SMS error codes are sent at each stage of the delivery process. Depending on the message_state returned, an accompanying error_code may be given. That is, if delivery is unsuccessful when we tried to deliver the SMS to the carrier, the message_state will be updated from “queued” to “failed” and an accompanying error_code will be given.
If the message has been successfully sent to the carrier, it can still hit roadblocks that can cause the SMS to fail. In this scenario, the message_state would change from “queued” to “sent”, and then to “undelivered”, which will be accompanied by an error_code. SMS error codes can help you learn more about a delivery issue.
The following illustration shows a successful delivery path and the message_states that can occur.
Click here for a comprehensive list of Plivo error codes for outgoing and incoming messages.