post https://messaging-api.veripin.net/v1.0/2fa/request
Introduction
Make sure to learn more about the use cases behind this API by reading the Use case.
The /request API aims to solve the following use cases:
- Generation of 2FA codes
- Delivery of 2FA codes
An example request toward /request is:
{
"to": "447916123456",
"template_id": "11bf5b37-e0b8-42e0-8dcf-dc8c4aefc000",
"parameters": {
"firstName": "John",
"lastName": "Doe"
}
}Where:
tois the recipient receiving the 2FA messagetemplate_idis the id of the template you want to deliver to the recipient (template endpoint)parametersis a freeform key value object used in interpolating the keys and values against the template referenced viatemplate_id
API responses
The following responses and error codes are being returned as a part of the API response.
Error codes
When sending the message using the /request endpoint the following errors can appear within the error field:
HTTP STATUS 200
| status | error_message | description |
|---|---|---|
| ACCEPTED | OK | The request has been successfully processed |
| REJECTED | CLIENT_COUNTRY_FORBIDDEN | The country has been forbidden |
| REJECTED | ROUTING_FILTER_INVALID_LENGTH | The "to" number doesn't have the valid length |
| REJECTED | ROUTING_PREFIX_FILTER_INVALID_NUMBER | The "to" number doesn't have the valid prefix |
| REJECTED | TEMPLATE_NOT_FOUND | The template which has been referenced wasn't found |
| REJECTED | DESTINATION_ADDRESS_INVALID | The "to" number doesn't have a valid value. Minimum 9, maximum: 15 |
| REJECTED | OUT_OF_BALANCE | The client is out of balance |
| REJECTED | GENERAL_ERROR | A general error has been encountered |
HTTP STATUS 401 Unauthorized
| status | error_message | description |
|---|---|---|
| REJECTED | CLIENT_DISABLED | The client is not enabled |
| REJECTED | PRODUCT_DISABLED | The product has been disabled |
| REJECTED | ACCOUNT_DISABLED | The client account has been disabled |
| REJECTED | CONNECTION_DISABLED | The client HTTP connection is disabled |
| REJECTED | IP_NOT_ALLOWED | The request to the HTTP API has been made from an unauthorized IP |
| REJECTED | UNAUTHORIZED | The request was not authorized as the API key is not valid |
| REJECTED | GENERAL_ERROR | A general error has been encountered |
