Receive inbound messages
Receive inbound messages from Pinnacle.
Add a Webhook
You can add testing webhooks on the testing page. For other webhooks, you can configure them on the webhooks page. Once you add your webhook, you will be provided with a PINNACLE-SIGNING-SECRET
that will be sent alongside all inbound requests. Keep this secret safe, as it will be used to authenticate requests.
Receiving Inbound Messages
All inbound messages (SMS, MMS, and RCS) will be sent as a POST request to your webhook URL. Inbound messages can be categorized into four types:
- Inbound Text Messages: Standard text messages sent by users.
- Inbound Media Messages: Messages that contain media (images, audio, video, files).
- Inbound Action Messages (RCS only): Messages when the user interacts with buttons or quick replies.
- Inbound Location Messages (RCS only): Messages that contain location coordinates in latitude and longitude.
Each message will contain a few common fields, as well as specific fields depending on the message type. The common fields are:
Inbound Text Messages
Occurs when the user sends a text message. It will contain the following additional text field:
Inbound Media Messages
Occurs when the user sends a media message (i.e. files and/or images sent). It will contain the following additional fields:
Note for RCS Media Messages
- If multiple images and text are sent in a single message, they will be received as separate text and media messages.
- The
mediaUrls.type
field will always befile
. MIME types for RCS media messages is coming soon.
Inbound Action Messages (RCS only)
Occurs when the user interacts with buttons or quick replies. It will contain the following additional fields:
Note that for trigger
actions, you’ll have access to the payload
and actionMetadata
fields.
For any other action types, only the actionTitle
will be available (in addition to the messageType
). This means that that action was tapped on.
Inbound Location Messages (RCS only)
Occurs when the user sends a location to the bot. It will contain the following additional location fields:
Authenticating Requests
To authenticate inbound requests, you will need to add a webhook to your account. This will give you a PINNACLE-SIGNING-SECRET
that will be sent alongside all inbound requests. For example:
You will need to verify this secret in your application to ensure that the request is coming from Pinnacle. Note that headers are case-insensitive so they may have different casing depending on the language and framework you are using.
Language-native type definitions
Python
To type inbound messages, use the Pinnacle.parse_inbound_message(message: dict)
static method. This method will return the appropriate inbound message type based on the message type.
Typescript
To type inbound messages, use the Pinnacle
namespace. For example:
Ruby
To type inbound messages, use the Pinnacle::{{INBOUND_MESSAGE_TYPE}}.from_json(json_object: json_body)
method where json_body
is a JSON string. For example:
Examples
See our hackathon projects for examples of how to handle inbound messages. If you have any questions, feel free to reach out to our support team. Happy coding! 🎉