Article

Sending Messages to the Business Chat Service

Send a message from the Customer Service Platform to a customer.

Overview

You can send messages to a customer by using the POST /message request method to the Business Chat service. Business Chat delivers the message to the customer’s device. Unless otherwise noted, all text fields support Basic Multilingual Plane of Unicode. For information about sending interactive messages, see Sending a Custom Interactive Message.

In addition to the dictionaries listed below, sending a message also includes keys from the Attachment dictionary.

Request

POST https://mspgw.push.apple.com/v1/message

Parameters

In addition to the keys from BaseMessage, use the following keys:

body

(Required) The message text; required when the type is text.

interactiveData

A dictionary representing the properties of an interactive message. See BaseInteractiveMessage dictionary.

type

(Required) A string that identifies the message type. For the list of possible values, see Message Type Values.

Response

The response includes a status code listed in the Response Codes section of Integrating with Business Chat.

The body of the response is empty unless the message sent is of type interactive and its JSON is larger than 10 KB. To reuse an asset, use the asset reference when creating a new interactive data JSON. For more information, see Receiving Large Interactive Data Payloads.

Example of a Text Message

Destination-Id: "urn:mbid:AQAAYyUbut6E4B3T9FLv5EbG/<truncated>", Source-Id: "a884eddf-<truncated>", Content-Type: "application/json", id: "0c316beb-<truncated>", Authorization: "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.<truncated>"{ "body": "Hi", "sourceId": "a884eddf-<truncated>", "locale": "en_US", "destinationId": "urn:mbid:AQAAYyUbut6E4B3T9FLv5EbG/<truncated>", "v": 1, "type": "text", "id": "0c316beb-<truncated>"}
HTTP/1.1 200 OKcache-control: no-cache, no-storecontent-length: 0strict-transport-security: max-age=31536000x-frame-options: DENY

See Also

First Steps

Sequencing Messages

Control the order in which the customer’s device receives messages from the business.