Dispatch

All Sections

Messages API Reference

Content

    Endpoints

    dispatch.all.readwritedispatch.messages.readwrite

    Schedule a Message for delivery. You can read more about the message delivery process in How it works.

    Request body

    targetIdRequired
    string

    The ID of the Target the Message will be delivered to

    Example: DI-T-3f409cb5d8

    deliveryTimeRequired
    string
    ISO-8601 Date & Time

    The desired delivery time for the Message

    Example: 2020-05-01T17:36:08.555Z

    payloadRequired
    string
    0 - 61440

    The payload to be delivered in the Message

    Example: { "hello": "world" }

    Responses

    200application/json

    A Message

    Example response body
    {
    "messageId": "DI-M-2c9b5021-e892-43d9-84c2-365670afa319",
    "nextDeliveryTime": "2020-05-01T17:36:08.555Z",
    "originalDeliveryTime": "2020-05-01T17:36:08.555Z",
    "schedulingTime": "2020-05-01T17:35:08.709Z",
    "targetId": "DI-T-3f409cb5d8"
    }
    <<No Content

    Error codes

    E-DI-3001

    Target not found

    E-DI-5002

    Payload was too large

    E-DI-5005

    Monthly free tier limit reached

    dispatch.all.readdispatch.all.readwritedispatch.messages.readdispatch.messages.readwrite

    Path parameters

    messageId
    string

    A Message ID

    Example: DI-M-2c9b5021-e892-43d9-84c2-365670afa319

    Responses

    200application/json

    A Message

    Example response body
    {
    "messageId": "DI-M-2c9b5021-e892-43d9-84c2-365670afa319",
    "nextDeliveryTime": "2020-05-01T17:36:08.555Z",
    "originalDeliveryTime": "2020-05-01T17:36:08.555Z",
    "schedulingTime": "2020-05-01T17:35:08.709Z",
    "targetId": "DI-T-3f409cb5d8"
    }
    404No Content

    The Message was not found.

    <<No Content

    dispatch.all.readdispatch.all.readwritedispatch.messages.readdispatch.messages.readwrite

    Path parameters

    messageId
    string

    A Message ID

    Example: DI-M-2c9b5021-e892-43d9-84c2-365670afa319

    Responses

    200text/plain

    A Message payload

    Example response body
    Some message payload
    404No Content

    The Message was not found.

    <<No Content

    dispatch.all.readwritedispatch.messages.readwrite

    Cancel the delivery of a Message. You can read more about the message delivery process in How it works.

    Path parameters

    messageId
    string

    A Message ID

    Example: DI-M-2c9b5021-e892-43d9-84c2-365670afa319

    Responses

    200application/json

    The Message was cancelled sucessfully

    Example response body
    {
    "TODO": "Correct fields",
    "messageId": "DI-M-2c9b5021-e892-43d9-84c2-365670afa319",
    "cancellationTime": "2020-05-01T17:36:08.555Z",
    "originalDeliveryTime": "2020-05-01T17:36:08.555Z",
    "schedulingTime": "2020-05-01T17:35:08.709Z",
    "targetId": "DI-T-3f409cb5d8"
    }
    <<No Content

    Error codes

    E-DI-5001

    Message not found

    E-DI-5003

    Cannot cancel message in the current state

    dispatch.all.readwritedispatch.messages.readwrite

    Reschedule a the delivery time of a Message. You can read more about the message delivery process in How it works.

    Path parameters

    messageId
    string

    A Message ID

    Example: DI-M-2c9b5021-e892-43d9-84c2-365670afa319

    Request body

    deliveryTimeRequired
    string
    ISO-8601 Date & Time

    The desired delivery time for the Message

    Example: 2020-05-01T17:36:08.555Z

    Responses

    200application/json

    The Message was rescheduled sucessfully

    Example response body
    {
    "messageId": "DI-M-2c9b5021-e892-43d9-84c2-365670afa319",
    "nextDeliveryTime": "2020-05-01T17:36:08.555Z",
    "originalDeliveryTime": "2020-05-01T17:36:08.555Z",
    "schedulingTime": "2020-05-01T17:35:08.709Z",
    "targetId": "DI-T-3f409cb5d8"
    }
    <<No Content

    Error codes

    E-DI-5001

    Message not found

    E-DI-5004

    Cannot reschedule already delivered messages

    dispatch.all.readdispatch.all.readwritedispatch.messages.readdispatch.messages.readwrite

    Find all currently scheduled messages. Ordered by the Message NextDeliveryTime, closest in time first.

    Query parameters

    targetIdRequired
    string

    ID of the Target to find scheduled messages for.

    Example: DI-T-3f409cb5d8

    minTimeOptional
    string
    ISO-8601 Date & Time

    The minimum NextDeliveryTime (inclusive).

    Example: 2020-05-01T00:00:00.000Z

    maxTimeOptional
    string
    ISO-8601 Date & Time

    The maximum NextDeliveryTime (inclusive).

    Example: 2020-06-01T00:00:00.000Z

    pageTokenOptional
    string

    Specifies the page to read. Use a value provided by earlier responses in pageToken and nextPageToken.

    Example: eyJmaXJzdCI6InBhZ2UifQ==

    limitOptional
    integer
    1 - 100 (Default: 20)

    Limit the return page size to the specified count.

    Example: 1

    Responses

    200application/json

    A PagedList of Messages

    Example response body
    {
    "count": 1,
    "pageToken": "eyJmaXJzdCI6InBhZ2UifQ==",
    "nextPageToken": "eyJzZWNvbmQiOiJwYWdlIn0=",
    "items": [
    {
    "messageId": "DI-M-2c9b5021-e892-43d9-84c2-365670afa319",
    "nextDeliveryTime": "2020-05-01T17:36:08.555Z",
    "originalDeliveryTime": "2020-05-01T17:36:08.555Z",
    "schedulingTime": "2020-05-01T17:35:08.709Z",
    "targetId": "DI-T-3f409cb5d8"
    }
    ]
    }
    <<No Content

    dispatch.all.readdispatch.all.readwritedispatch.messages.readdispatch.messages.readwrite

    Find all dead letter messages. Ordered by the Message DeadLetterTime, oldest first.

    Query parameters

    targetIdRequired
    string

    ID of the Target to find dead letter messages for.

    Example: DI-T-3f409cb5d8

    minTimeOptional
    string
    ISO-8601 Date & Time

    The minimum DeadLetterTime (inclusive).

    Example: 2020-05-01T00:00:00.000Z

    maxTimeOptional
    string
    ISO-8601 Date & Time

    The maximum DeadLetterTime (inclusive).

    Example: 2020-06-01T00:00:00.000Z

    pageTokenOptional
    string

    Specifies the page to read. Use a value provided by earlier responses in pageToken and nextPageToken.

    Example: eyJmaXJzdCI6InBhZ2UifQ==

    limitOptional
    integer
    1 - 100 (Default: 20)

    Limit the return page size to the specified count.

    Example: 1

    Responses

    200application/json

    A PagedList of Messages

    Example response body
    {
    "count": 1,
    "pageToken": "eyJmaXJzdCI6InBhZ2UifQ==",
    "nextPageToken": "eyJzZWNvbmQiOiJwYWdlIn0=",
    "items": [
    {
    "messageId": "DI-M-2c9b5021-e892-43d9-84c2-365670afa319",
    "nextDeliveryTime": "2020-05-01T17:36:08.555Z",
    "originalDeliveryTime": "2020-05-01T17:36:08.555Z",
    "schedulingTime": "2020-05-01T17:35:08.709Z",
    "targetId": "DI-T-3f409cb5d8"
    }
    ]
    }
    <<No Content

    Models

    A paged list of items. Use the nextPageToken in follow-up requests to step through all available items. nextPageToken will be null on the last page.

    items
    array

    A list of items

    count
    integer

    The number of items in the list

    pageToken
    string

    The token for the current page

    nextPageToken
    string | NULL

    The token for the next page

    A message

    messageId
    string

    The Message ID

    targetId
    string

    The delivery Target ID

    schedulingTime
    string
    ISO-8601 Date & Time

    The time the Message was scheduled

    originalDeliveryTime
    string
    ISO-8601 Date & Time

    The time the Message was originally scheduled for delivery for

    state
    string
    SCHEDULED
    DELIVERED
    DEAD_LETTER
    CANCELLED
    deliveryFailureCount
    integer

    The number of times Dispatch has been unable to deliver the Message

    nextDeliveryTime
    string | NULL
    ISO-8601 Date & Time

    The time of the next delivery attempt

    lastDeliveryTime
    string | NULL
    ISO-8601 Date & Time

    The time of the latest delivery attempt

    deadLetterTime
    string | NULL
    ISO-8601 Date & Time

    The time the Message was marked as a Dead Letter

    cancellationTime
    string | NULL
    ISO-8601 Date & Time

    The time that Message was cancelled

    expirationTime
    string | NULL
    ISO-8601 Date & Time

    The time the Message will be removed from the system

    A container for a list of Error objects

    errors
    array

    An array of Error objects

    An error object

    code
    string

    The error code

    message
    string

    A descriptive error message