Send One Time Password (OTP)
API URL
URL used to send HTTP requests:
https://portal.bulkgate.com/api/1.0/otp/send
POST /api/1.0/otp/send HTTP/1.1
Host: portal.bulkgate.com
Content-Type: application/json
Cache-Control: no-cache
Parameters table
PARAMETER NAME | VALUE | MANDATORY | DEFAULT VALUE |
---|---|---|---|
application_id | Application ID | Yes | - |
application_token | Application token | Yes | - |
number | Phone number to which send the verification code | Yes | - |
country | Country code of phone number | no | The value is taken from the profile. |
language | Language of send otp message | no | en |
code_type | Type of code. (string , int , or combined ) | no | int |
code_length | Length of verification code (4-100). | no | 6 |
request_quota_number | The number of requests per minute for request_quota_identification | no | 1 |
request_quota_identification | Identification of the "OTP user / requester" to whom the request_quota_number quota per minute will apply. We recommend using an IP address for this identification. | Yes | - |
trials_available_resend | Limit of available resends | no | null - unlimited |
trials_available_verification | Limit of available verification | no | null - unlimited |
daily_limit | Limit of available requests per day (sliding for last 24 hours) | no | null - unlimited |
expiration | Expiration of OTP request in seconds, after completion of this time request is not possible. | no | 604800 - 7 days |
channel | Alternative channels. Channels are listed in a cascade, if we are unable to deliver your message via highest priority channel, channels lower in the cascade list will be used. If none of them manages to deliver sms will be used instead. | no | SMS object and/or Viber object |
SMS object parameters table
PARAMETER NAME | VALUE | MANDATORY | DEFAULT VALUE |
---|---|---|---|
sender_id | Sender ID, see sender ID type | no | gSystem |
sender_id_value | Sender value - gOwn (e.g. "420 777 777 777"), gText (e.g. "BulkGate"), gProfile (e.g. "423"), gMobile or gPush (KEY) | no | null |
Viber object parameters table
PARAMETER NAME | VALUE | MANDATORY | DEFAULT VALUE |
---|---|---|---|
sender | Name of your registered sender for Viber | Yes | - |
expiration | Seconds to wait until trying another channel | no | 120 |
Example of full request
POST /api/1.0/otp/send HTTP/1.1
Host: portal.bulkgate.com
Content-Type: application/json
Cache-Control: no-cache
{
"application_id": "APPLICATION_ID",
"application_token": "APPLICATION_TOKEN",
"number": "44777777777",
"country": "gb",
"language": "en",
"code_type": "string",
"code_length": 7,
"request_quota_number": 1,
"request_quota_identification": "127.0.0.1",
"trials_available_resend": 2,
"trials_available_verification": 5,
"daily_limit": 100,
"expiration": 3600,
"channel": {
"viber": {
"sender": "Lt. Hagan",
"expiration": 100
},
"sms": {
"sender_id": "gText",
"sender_id_value": "Lt-Hagan",
"unicode": true
}
}
}
Response to this command may be:
In case of success:
{
"data": {
"id": "otp-id"
}
}
In case of error:
{
"type": "unknown_identity",
"code": 400,
"error": "Unknown identity",
"detail": null
}
{
"type": "invalid_input_parameters",
"code": 400,
"error": "Invalid input parameters",
"detail": null
}