Add Client
This API allows adding a new client to the system.
Endpoint
POST /api/client/add
info
Make sure you have the appropriate API key to authenticate this request. Without it, the request will fail.
Request
Headers
Key | Value |
---|---|
Content-Type | application/json |
tip
The Content-Type
header is required and should always be set to application/json
for this endpoint.
Body
{
"appName": "ExampleApp",
"appUrl": "example.com",
"appDescription": "A sample app",
"preferredSmsGateway": "AlphaSMS",
"isHost": true
}
Description of Request Body
Parameter | Type | Description | Required |
---|---|---|---|
appName | string | Name of the application | Yes |
appUrl | string | URL of the application | Yes |
appDescription | string | Brief description of the application | No |
preferredSmsGateway | string | Preferred SMS gateway | No |
isHost | boolean | Indicates if the client is a host | Yes |
Response
Success Response
{
"status": 200,
"results": {
"appDescription": "your app description",
"appUrl": "your application url",
"secretKey": "secretkey generated by the server",
"preferredSmsGateway": "AlphaSMS",
"preferredEmailGateway": null,
"preferredPushNotificationGateway": null,
"isHost": true,
"smsConfig": null
}
}
Error Response
{
"status": 400,
"error": "Invalid request"
}
Check the status
code in the response to handle success or errors appropriately in your application.
Example Usage
cURL Command
curl --request POST \
--url https://your-base-url/api/client/add \
--header 'Content-Type: application/json' \
--data '{
"appName": "ExampleApp",
"appUrl": "example.com",
"appDescription": "A sample app",
"preferredSmsGateway": "AlphaSMS",
"isHost": true
}'