External Request (Webhook)
This block allows you to execute an external request to another server for the purpose of transferring data and, if necessary, writing data to custom fields as part of a response from another server (from a JSON response).
Description of the base window
HTTP request method (GET/POST/PUT/DELETE)
2. HTTP URL (link to an external server). You can also insert contact variables, for example userId for a specific user
3. HTTP headers, complete list of headers. By default, Smart Sender adds the following headers to every request:
User-Agent: Smart Sender
Content-type: Application/json
4. HTTP body, available only for POST / PUT, stores the request body in JSON format
5. HTTP request stores QUERY variables. Do not set variables in the URL, this is where they should be set
6. HTTP response (response) - shows the headers, body of the request and response
7. Correspondences, here you can specify correspondences from the HTTP response body for writing variables to the client card in JSONPath format
8. Revert changes to this external query
9. Saving changes in an external query
For testing, you need to connect a messenger for notifications (data for testing will be taken from this account), after that you will have access to the “Test request” button. This functionality executes a test request to an external server.
This screenshot shows an example of sending messages through our API. In this example, the Smart Sender server returned 403 Forbidden due to invalid access (token).
This example provides an example of correspondences for writing an error code and a message text to a customer card for further use.
If you need to send the request body not in the Application/json format, but in the application/x-www-form-urlencoded format, specify this header from the corresponding section. The request body will be sent as a key-value.