Data Action Concepts
Overview
Spoke supports data actions as a mechanism for customizing organization specific work flows. They are useful for configuring additional call rules, such as blocking outbound calls to specific phone numbers, or overriding the caller ID shown on outbound calls.
To get started, you will need to configure a data action in the Spoke Account Portal. You will need to provide a valid, publicly routable HTTPS URL that accepts GET or POST requests with the application/json content type.
Spoke will invoke this URL with the corresponding payload when performing a data action.
For security reasons, we strongly recommend that you ensure requests to your endpoint come from Spoke. The easiest method to validate that a request was sent via Spoke is to verify the signature.
Securing Data Actions
Verifying the signature
A request is considered valid based on the following conditions:
- The
x-spoke-timestampheader is a valid UNIX timestamp, and represents a time sent within the last 5 minutes (using millisecond precision). This header allows the consumer to validate when a request was sent, to avoid replay attacks. - The
x-spoke-signatureheader is formatted assha256=<HMAC algorithm cipher text>, and it contains the correct hash based on the hexadecimal representation of the SHA256 HMAC algorithm with the signing secret applied to<x-spoke-timestamp header value>.<request data>.- The calculated hash includes the timestamp to ensure that an attacker cannot modify the timestamp without also invalidating the message signature.
- The source of
<request data>depends on the HTTP method used:- For
GETrequests, it is the request URL including the query parameters - For
POSTrequests, it is the raw request body
- For
A request can be validated via the following:
Code
Delivery Attempts
Spoke will attempt to deliver Data Action events to your server once. To successfully invoke the data action, your endpoint must respond with a valid response payload within 2 seconds of the HTTP request being received.
Failure to return a response within the timeout period will not be treated as an error condition. If your endpoint does not return a response within the timeout period, the call will proceed as planned, using the original configuration for the call.
Available Data Actions
Handle new conversation creation, including auto-responses and user assignment.
Enrich and customise customer information shown on the contact card and during calls.
Change the configuration of an outbound call as it is about to be placed.
Override team configuration just before a call is offered to a team.