Initialize Single Call
Initiate a single outbound call with custom options
Init Single Call
Details
| Description | The "Init" endpoint initializes a single call. |
|---|---|
| HTTP Method | POST |
| Endpoint URL | https://platform.innocalls.com/v1/api-gateway/order-confirmation/:id/single-call/init |
| Authorization | To access the API endpoints, you need to authenticate using API keys and API secrets. The API supports Basic Authentication for authorization. You need to include your API ID as the username and your API secret as the password in the HTTP header when making requests. Replace API_ID with your API ID and API_SECRET with your API secret, separated by a colon (:). The value after Basic is the Base64 encoding of your API key and API secret concatenated with a colon. |
| Rate Limit | 3 requests per second |
Request Parameters
| Parameter | Description | Format | Location | Constrains |
|---|---|---|---|---|
| id | The ID of the order confirmation that the call belongs to | String | Path | Required |
| phone | The phone number to be used in the process. | National format | Body | Required |
| useDefaultFlowOptions | Determines whether to use default flow options or custom options | Boolean (true/false) | Body | Required |
| minutesToWaitBeforeFirstTrial | The number of minutes to wait before the first trial | Integer | Body | Required if Min: 0 |
| delayMinutesBetweenTrials | The delay in minutes between each trial. | Integer | Body | Required if Min: 5 |
| trialsCount | The number of trials to be conducted. | Integer | Body | Required if Min: 1 Max: 10 |
| variables | An array of call campaign variables with their values. | Array of objects | Body | Required if the flow has variables |
Request Example
Example 1
curl 'https://platform.innocalls.com/api/v1/api-gateway/order-confirmation/:id/single-call/init' \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic <base64-encoded string apiId:apiSecret>' \
--data '{
"phone": "2012xxxxxxxx",
"orderNumber": "001",
"useDefaultFlowOptions": true
}'Description
When the order confirmation does not have any required variables and you want to use the same order confirmation flow options.
Example 2
curl 'https://platform.innocalls.com/api/v1/api-gateway/order-confirmation/:id/single-call/init' \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic <base64-encoded string apiId:apiSecret>' \
--data '{
"phone": "2012xxxxxxxx",
"orderNumber": "001",
"trialsCount": 2,
"minutesToWaitBeforeFirstTrial": 1,
"delayMinutesBetweenTrials": 5,
"useDefaultFlowOptions": false
}'Description
When the order confirmation doesn't have any required variables, and you want to customize options for trialsCount, minutesToWaitBeforeFirstTrial, and delayMinutesBetweenTrials, instead of using the same order confirmation flow options.
Example 3
curl 'https://platform.innocalls.com/api/v1/api-gateway/order-confirmation/:id/single-call/init' \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic <base64-encoded string apiId:apiSecret>' \
--data '{
"phone": "2012xxxxxxxx",
"orderNumber": "001",
"useDefaultFlowOptions": true,
"variables": [
{
"variableName": "moneyVar",
"value": {
"amount": "1050",
"currency": "USD"
}
},
{
"variableName": "fullNumberVar",
"value": "12"
},
{
"variableName": "separatedNumberVar",
"value": "002"
},
{
"variableName": "txtVar",
"value": "hi"
}
]
}'Description
When the order confirmation includes required variables, the variables field should be an array containing all necessary variables along with their corresponding values. The value for each variable must adhere to specific constraints based on the variable type selected during creation.
- For text variables, the value should not be empty.
- For separated variables, the value should consist only of numeric digits.
- For money variables, the value should be an object containing the amount and the currency.
The amount should be a number greater than zero, and the currency should be one of the allowed currencies: 'SAR', 'USD', 'EGP', 'EUR'. - For fullNumber variables, the value should be a valid integer number.
Success Response Example
A successful response is indicated by the HTTP status code 204.
Possible Errors
| Error Code | Description |
|---|---|
| 401 Unauthorized | Invalid Credential |
| 403 Forbidden | Not Enough Permissions to access the resource |
| 429 Too Many Requests | This occurs when requests exceed the rate limit |
| 404 Not Found | This occurs when the requested order confirmation is not found |
| 400 BadRequest | This error occurs due to malformed or invalid request parameters |