Skip to content

Latest commit

 

History

History
27 lines (15 loc) · 2.36 KB

concepts.md

File metadata and controls

27 lines (15 loc) · 2.36 KB

Messaging 2.0 Concepts

There are a few concepts that are important to understand how Bandwidth's new messaging API functions:

  1. Message Storage
  2. Message Callbacks
  3. Message Creation

Message Storage IE GET /messages {#manage-storage}

Messaging 2.0 does not keep any records to fetch later. If you need to keep track of delivered, error-ed, received messages after you receive the corresponding callback event, you MUST store the events in the data-store of your choice.

Once we have successfully delivered the callback event and receive an HTTP 2xx response, Bandwidth can no longer provide any detail about that message.

Message Callbacks {#message-callbacks}

As the messaging 2.0 API does not offer message storage or detailed messaging records, Bandwidth will attempt to deliver every callback until your server replies with a HTTP 2xx status code. If the callback request times out, or your server returns a code less than HTTP 2xx or greater than HTTP 3xx Bandwidth will try to deliver the callback multiple times over the next 24 hours.

After 24 hours, if your server has not returned a HTTP 2xx code, Bandwidth will no longer try to send the callback.

Message Creation/Acceptance (HTTP 201 vs HTTP 202) {#message-creation}

The messaging 2.0 API works off of an internal queuing system. As such, when you POST to the v2/.../messages to create a new message, Bandwidth will reply with an HTTP 202 - Accepted. This indicates that the message has been placed on the queue

As the message progresses through the internal system you will receive a Message Sent callback when the message has been dequeued and on the way to the downstream carrier. You will then receive a Message Delivered callback when the message has been handed off to the downstream carrier. ⚠️ MMS messages (including Group messages) DO NOT support message delivery receipts, as such, you will only receive the Message Sent callback.

If at any-point through the process the message fails, you will receive a detailed Message Failed callback with an error code describing the reason for failure.