How to Send API Requests via Integromat and Integrate SendPulse with Your System

Chatbot API provides a number of methods to integrate chatbots with your system. You can use them to get detailed information about your account, chatbots, subscribers, variables, flows, and chats. You can also create campaigns and start flows, as well as assign and delete variables and tags.

Using the "SendPulse" element in Integromat, you can send any API requests at the right moment according to the set script.

Select the "SendPulse" element and the "Make an API Call" action.

To connect your SendPulse account, click Add, and enter your Client ID and Client Secret from the “API” tab in your account settings. Click Continue.

In the URL field, insert the request's endpoint.

Select one of the methods: GET to get information, POST to create or add information, PUT/PATCH to update information, DELETE to delete data.

Insert the request body. You can see an example of the query under the desired method in the API documentation (see “Example”). Select the variable received in one of the previous elements, or write your value in the variable value for it to be transmitted.

Sample query for the "Send free message to a contact by phone number" method that will send a message to WhatsApp by changing the value in Google Sheets:

In the URL field, specify: /whatsapp/contacts/sendByPhone

In the body of the request, specify:

{
  "bot_id": "dfg144hj45gh4j5h4gj5gh4jgh", // Your WhatsApp chatbot ID
  "phone": "+3806666666666", // Variable with a phone in international format obtained from another element
  "message": {
    "type": "text",
    "text": {
      "body": "" // The content of the text message. You can add emoji to your text if it's up to 1024 Unicode characters long
    }
  }
}

Sample request for the "Create a new contact in the WhatsApp chatbot audience" method:

Sample request for the "Add a tag to contact" method:

For most requests, you'll need the subscriber's ID. You can get it using the "Get a list of contacts by tag," "Get contacts by variable," and "Get contact info by phone number" methods and via webhook or the "contact.id" variable in the "API request" element request.

Click Ok.

If you use several API methods in your script, click on the module, and select "Run this module only." You can add the resulting data to other elements by choosing the resulting parameters.

To test the functionality of the whole script, click Run once, perform the action that triggers the desired element and sends the information to the "SendPulse" element.

Turn the toggle switch "ON" to activate the script.

You can also click on the number above the element to see the information that was received and will be transmitted to the next element.

If any of the elements failed to execute, it will be highlighted red and, when clicked, display the reason for the error and a hint on how to fix it. Note that until the error is fixed, the entire script may pause and not run; operations will be queued up.

If you have any questions about configuration or script failures, you can contact Integromat support.

Read about other methods you can use to integrate with Integromat: "How to Integrate SendPulse with Services via Integromat."

Rate this article about "How to Send API Requests via Integromat and Integrate SendPulse with Your System"

User Rating: 5 / 5

    Popular in Our Blog

    Try a free chatbot for Facebook Messenger