Après l’envoi d’un SMS via l’API FASTERMESSAGE, vous obtiendrez en retour une réponse du serveur au format JSON comme ci-après.
Succès
Copy to clipboard
{
"status": true,
"code": "SUBMITTED",
"description": "202: The request has been submitted and is being processed",
"from": "FASTERMSG",
"to": "2292731",
"text": "Hello world!",
"smsCount": 1,
"messageId": "1698143748226271",
"uuid": "691bb97c4d36231cfea54312",
"sendAt": "2023-10-24T10:35:48.226+01:00",
"createdAt": "2023-10-24T10:35:48.286+01:00",
"message": "The request is processing",
"reference": "",
"batchId": "",
"priority": 3,
"iso": "BJ",
"country": "Benin",
"cc": 229,
"operator": "MTN",
"mcc": "616",
"mnc": "03"
}
Echèc
// Un exemple de réponse lorsqu'une erreur est détectée lors de la vérification des variables reçu.
{
"status": false,
"code": "AUTHENTICATION_FAILED",
"description": "401: Authentication failed"
}
// Un exemple de réponse lorsqu'une erreur est détectée lors de l'envoi du message.
{
"status": false,
"code": "INVALID_PHONE",
"description": "400: Invalid phone number",
"messageId": "1698148205253794"
}
Passons en revue les informations renvoyées par le serveur à la suite de la requête d’envoi :
- status : c’est l’état de soumission de la requête. Il est TRUE si tout s’est bien passé ou FALSE s’il y a un problème ;
- code : il s’agit du code retourné par la requête.
- description : c’est le message descriptif du code;
| Succès (2xx) | ||
|---|---|---|
| Code | Code HTTP | Message |
| DELIVERED | 200 | The message was delivered successfully |
| SENT | 200 | The message has been sent |
| PROGRAMMED | 200 | The task is programmed |
| SUBMITTED | 202 | The request has been submitted and is being processed |
| Échecs (4xx, 5xx, 3xx, autres) | ||
|---|---|---|
| Statut | Code | Message |
| REJECTED | 400 | The request has been rejected |
| BAD_REQUEST | 400 | The request was invalid |
| MISSING_PARAMETERS | 400 | Required parameters are missing |
| INVALID_SENDERID | 400 | Invalid sender ID |
| INVALID_PHONE | 400 | Invalid phone number |
| INVALID_OPERATOR | 400 | Invalid operator |
| INVALID_DATE_TIMEZONE | 400 | Invalid date or timezone |
| UNDEFINED_PRICE | 400 | Price not defined for this operator/country |
| MISSING_PARAMETERS_TO | 400 | Required parameter [to] is missing |
| MISSING_PARAMETERS_CONTENT | 400 | Required parameter [content] or [text] is missing |
| MISSING_PARAMETERS_FROM | 400 | Required parameter [from] is missing |
| FORBIDDEN | 403 | Access is forbidden |
| UNAUTHORIZED | 401 | Access is unauthorized |
| AUTHENTICATION_FAILED | 401 | Authentication failed |
| INSUFFICIENT_BALANCE | 402 | Insufficient balance to process the request |
| SUSPENDED | 423 | The resource is suspended |
| UNDELIVERED | 424 | The message could not be delivered |
| NOT_FOUND | 404 | The resource was not found |
| DELETED | 410 | The resource has been deleted |
| EXPIRED | 410 | The resource or session has expired |
| FAILED | 500 | The operation failed |
| ERROR | 500 | An unexpected error occurred |
| INTERNAL_SERVER_ERROR | 500 | Internal server error occurred |
| INTERNAL_ERROR | 500 | An internal error occurred |
| BAD_GATEWAY | 502 | Invalid response from the upstream server |
| SERVICE_UNAVAILABLE | 503 | The service is currently unavailable |
| GATEWAY_UNAVAILABLE | 503 | Gateway unavailable, please try again later |
| UNKNOWN | 520 | The status is unknown |