SMS
  • 20 Jan 2022
  • 1 Minute to read
  • Contributors
  • Dark
    Light
  • PDF

SMS

  • Dark
    Light
  • PDF

Article Summary

Copy folder Twilio "SMS" to your workspace.

copy_folder

There are two processes in this folder:

"Sending SMS" - for sending SMS via Twilio API

How it works

The first process sends SMS and copies the request with reference = {{sid}} (unique message ID) to the second process for getting callback.

The second process receives a callback from Twilio and modifies the task in the first process by adding a status.

To send SMS via API Twilio and get a callback do the following steps in your processes:

  1. Click the node Waiting for Callback, press Copy near callback url and it will be copied to clipboard.

callback_url_copy

  1. Click on the "Calling API" node. In the Call API logic configuration panel, add the received callback url to the value of the StatusCallback parameter.

callback_url_set

Replace the word "json" with "nvp" in callback URL.

For example, you get callback url -
https://corezoid.com/api/1/json/callback/559a817f4b8ff96bf5000b/cb9f670f5c223ec42e1

The parameter value StatusCallback will be -
https://corezoid.com/api/1/nvp/callback/559a817f4b8ff96bf5000b/cb9f670f5c223ec42e1/

add at the end

Press Deploy to commit changes.

To test sending SMS switch process "Sending SMS" to View mode .

Press button + New task.

new_task

Enter the parameter values:

  • AuthToken - Your AuthToken
  • AccountSid - Your AccountSid
  • Number_to - recipient's phone number with "+" and the country code
  • Number_from - Your phone number Twilio
  • Body - text of the message (up to 1600 characters)

add_task

and press Add task.

As a result, the task will pass through the process and go to one of the final nodes (red or green).

The process is prepared to call from other processes using logic `Call Process.

In case of successful execution the following parameters will be added to the task:

  • status - message status
  • sid - unique message identifier

If API Twilio returns an error, the task will go to the escalation node and the following parameters will be added:

  • code - error code Twilio
  • message - text error Twilio
  • url_more_info - link to the website Twilio, where there is a detailed description of the caused error.

In case of error while calling API Twilio, the task will go to the escalation node and the following parameters will be added:

  • code - code error
  • message - text error

Useful links Twilio:

  • Description of input parameters of Twilio API "Sending SMS"

Was this article helpful?