Check an API Submission Before Retrying
Use MessageID and GET Details to check whether TNZ accepted your REST API submission before retrying. Follow the 3-second and 10-second retry checks.
If your application sends a message through the REST API but receives no response, TNZ may still have accepted the submission. Sending the request again could create a duplicate message.
Before you retry, use GET Details to check for the MessageID from your original request. Include and save your own unique MessageID when you first send the request so you can check it without the response.
Automatic Duplicate Removal
For SMS, TNZ checks for the same To Number, From Number and Message within a 60-second window. If TNZ detects a duplicate, it returns Result="Rejected-Duplicate" and does not send or charge for that duplicate message.
The 60-second rule applies to SMS. It does not apply to other message types, where repeated duplicate submissions may be intentional.
MessageID Checks
Use a unique MessageID for each submission. Use letters and numbers, with no more than 40 characters. Save it in your application before you send the request.
MessageID allows you to track submissions against a key. TNZ will allow you to submit the same MessageID multiple times, however, using a unique MessageID for each submission is recommended.
Example including MessageID in your request
Your POST can include a unique MessageID:
{
"ToNumber": "+6421000001",
"Message": "Your appointment is tomorrow at 10am.",
"MessageID": "Appointment202611180001"
}
When TNZ acknowledges the submission, the response includes the same MessageID:
{
"MessageID": "Appointment202611180001"
}
The MessageID is an optional field. If you do not supply a MessageID value, the API will generate one for you and return it in the POST's response.
Check the submission before retrying
If there is a disconnection and your application does not record the successful submission, you may use your submitted MessageID to check if the submission was successful.
- Wait 3 seconds to give TNZ time to process the initial POST.
- Call GET Details with the original
MessageID. If you find a matching record, TNZ accepted the submission. Do not retry the POST. - If the check finds no matching record, wait another 10 seconds to allow for delays on the TNZ platform.
- Call GET Details again with the same
MessageID. If you find a matching record, do not retry the POST. - If the second check finds no matching record, you can retry the POST with a new
MessageID. A retry can still cause a duplicate message, even after both checks.
We recommend using a different MessageID for each retry. This helps you tell the attempts apart if you need to investigate a duplicate. For example, use Appointment202611180001Retry1 for a retry of Appointment202611180001. Save both references against the same operation in your application. To check the retry, use its new reference.
More info
TNZ accepting a submission does not mean the message reached its recipient. Check the delivery results separately.
The full API reference can be found at REST API.
Topics: Developers