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.
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:
Each message will contain a few common fields, as well as specific fields depending on the message type. The common fields are:
Occurs when the user sends a text message. It will contain the following additional text field:
Occurs when the user sends a media message (i.e. files and/or images sent). It will contain the following additional fields:
mediaUrls.type field will always be file. MIME types for RCS media messages is coming soon.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.
Occurs when the user sends a location to the bot. It will contain the following additional location fields:
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.
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.
To type inbound messages, use the Pinnacle namespace. For example:
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:
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! 🎉