Skip to main content

Get Client by Secret Key

This endpoint retrieves client details using their secret key.

Endpoint

POST /api/client/get/secretKey

info

The secretKey header is required for this endpoint. Make sure to pass a valid key.


Request

Headers

KeyValue
secretKeyyour-secret-key

Response

Success Response

{
"status": 200,
"results": {
"appDescription": "An E-commerce Platform",
"appUrl": "example.com",
"secretKey": "/RandomGeneratedSecretKey==",
"preferredSmsGateway": "ExampleSMS",
"preferredEmailGateway": null,
"preferredPushNotificationGateway": null,
"isHost": true,
"smsConfig": [
{
"providerName": "ExampleSMS",
"providerUrl": "https://portal.example-sms.com/",
"username": "[email protected]",
"senderId": "ExampleID",
"smsType": "Transactional",
"smsApi": "https://api.example-sms.com/sendsms",
"balanceUrl": "https://api.example-sms.com/user/balance",
"balance": 5000.0,
"perSmsCost": 0.5,
"isActive": true
}
]
}
}

Error Response

{
"status": 404,
"error": "Client not found"
}

Example Usage

Here’s how you can retrieve client details using cURL:

curl --request POST \
--url https://your-base-url/api/client/get/secretKey \
--header 'secretKey: your-secret-key'

Description of Response Fields

Top-Level Fields

FieldTypeDescription
statusintegerThe HTTP status code of the response.
resultsobjectContains the detailed client information if the request is successful.

results Object

FieldTypeDescription
appDescriptionstringA brief description of the client's application.
appUrlstringThe URL of the client's application.
secretKeystringThe unique secret key associated with the client.
preferredSmsGatewaystringThe name of the client's preferred SMS gateway.
preferredEmailGatewaystringThe name of the client's preferred email gateway (if configured).
preferredPushNotificationGatewaystringThe name of the client's preferred push notification gateway (if configured).
isHostbooleanIndicates whether the client is a host.
smsConfigarrayA list of SMS configurations associated with the client.

smsConfig Array

FieldTypeDescription
providerNamestringName of the SMS provider.
providerUrlstringThe portal URL for the SMS provider.
usernamestringThe username used to authenticate with the SMS provider.
senderIdstringThe sender ID used for SMS messages (if applicable).
smsTypestringType of SMS (e.g., Transactional or Promotional).
smsApistringThe API endpoint for sending SMS.
balanceUrlstringThe API endpoint to check the SMS balance.
balancefloatThe current balance of the SMS account.
perSmsCostfloatThe cost of sending one SMS message.
isActivebooleanIndicates whether the SMS configuration is active for the client.