How to send SMS via Zoho Creator?

How to send SMS via Zoho Creator?

How to send Zoho Voice SMS via Zoho Creator?

 

Follow the steps below to send automatic SMS via a Zoho Voice number directly from your Zoho Creator solutions.

 

Step1 :

    Login to https://creator.zoho.com/


Step 2:

To create connectors for your Creator solution:


Go to Microservices - > Create New -> Connections - > Pick & Create 

Step 3:

Click CUSTOM CONNECTOR -> Create New



If you have previously created Custom Connectors, they will be displayed as cards on the Custom Connectors page. Click the +Create New icon in the top-right corner, a builder will appear.

 

 

Step 4:


    Enter the connector name and save.


Step 5:


    Enter General connector details such as  Connector name , Connector link name , Description, and Logo-> Click Save and continue


Step6:


     Defines the authentication settings of the Custom Connector, such as Authentication Type, Authentication Parameters and Scopes. Choose OAuth2 Authentication as the Authenticatio type then click Save and continue.


The Authentication Parameters appears in the subsequent page as shown below:

 

Copy the Callback URL into your clipboard to be updated in the API console.

 

Step 7:

 To update the authentication parameters, open a new tab in parallel go to 'https://api-console.zoho.com/' 

 

This will take you to the Zoho API console where you can directly access and configure the specific authentication API ZCreatorSMS.

 

Click on Add Client and then choose Server-based Applications

 

Step 8:

    Add Client name and Homepage URL.  Paste the callback url that you copied from your creator page into the Authorized Redirect URL and click Create.

 

 

 

Once the new client is created, Copy the Client ID and the Client Secret values that are automatically generated from the Client Secret tab.

 

 

Step 9:


In the creator page with Authentication Parameters as shown in step 6, paste the Client ID, the Client Secret and the following values in the respective fields.

 

Authorization URL : https://accounts.zoho.com/oauth/v2/auth

Refresh Token URL: https://accounts.zoho.com/oauth/v2/token

Token URL : https://accounts.zoho.com/oauth/v2/token

Revoke Token URL : https://accounts.zoho.com/oauth/v2/revoke

 

Then click the Save and Continue button.


After saving the Authentication Parameters in OAuth2 Authentication, You will be directed to the OAuth Scopes section or you can also navigate by clicking OAuth Scopes from the left pane.

 

Step 10:

 

In the Creator page, now select the OAuth Scopes menu under the Security section and click Add Scope.

Key in the scope details as follows:

Scope Display Name : ZohoVoice Send SMS

Scope Value : ZohoVoice.sms.ALL

 


Then click on the Mark as Ready button to mark the custom connector just created as ready to use it in connection. Now the Stage of the scope will change from Draft to Ready.

 

 

Step  11:

 


To integrate your Zoho Creator application with other cloud service like Zoho Voice, you need to configure a connection. This process of configuring a connection is twofold.

The first step requires you to create the connection with the specified parameters.


The next step requires you to authorize the connection for it to be functional.

 

Immediately after the connector is ready, Add Connection button appears, Click on Add Connection.

     

Give Connection Name as zohovoice_sms. 

For a connector with OAuth2 type authentication, you will be prompted to select Scope for Connection before creating a connection.

 


Select the Always use the same authorization for all environments checkbox, if you need the same credentials to be used to authorize across all environments.

 

Click Create and Authorize. The connection will be created and prompted for authorization.

 


Note:

You cannot edit or delete scopes once you added connections with the Custom Connector.


 

Step 12:

 


Enter the Name of the Authorization Account and the authorization credentials. The name provided is used to identify the authorization. The credentials required to authorize are based on the authentication type supported by the target service. Here it is OAuth2 authentication type.

    

  


On selecting the checkbox Always use the same authorization for all environments, all environments will be locked and the authorization will remain constant across environments.

 

Click Authorize and proceed to authorize access to the selected service.

 


With OAuth2 Authentication type, once you click Authorize,  you will be redirected to the  Zoho Voice Authorization Page. Now click Accept to accept the access permissions for the application.

 

Make sure you provide the name for the  Connection as "zohovoice_sms" then it will redirect to a new page.

 

 

    

    

 


Now navigate to Microservices-> Connections, click on the connection card bearing the name:"zohovoice_sms connection". Now enable connect.ion access to application


Enabling the connection access allows other users to use the connection on your creator application. Turn on the Connection Access for the desired application by just dragging the toggle in the right to green. as shown below:

 

Step 13:

Now, go to Solutions. click on Create or Edit Solution


Click on the Workflow button at the top to navigate to the workflow dashboard.


Then click Create Workflow-> New Workflow.

Select While using the form option to specify when you need to trigger the workflow.

Key in the required details:


Choose the required form by the form name. Select Created or Edited option as the Record Event and Successful Form Submission option as the Form Event. Finally name the workflow and click on the Create Workflow button. The workflow builder will appear as shown in the example illustration below:

 

Click Add New Action. The actions associated with the chosen form event are displayed.

 

    

 

Choose Deluge Script.



Info:

Connections using Custom Connectors should be invoked using Deluge invoke URL task, mentioning the respective action API, for any specific scenario/workflow as given in the code below.


 

    Paste the code below and save. Finally Click Done to exit the workflow builder.

 

response = Map();

dataTxt = Map();

dataTxt.put("message","this is test SMS");

dataTxt.put("customerNumber",input.{FORM_FILED});

dataTxt.put("senderId","+1484292YYYY");

resp = invokeurl

[

    url :"https://voice.zoho.com/rest/json/v1/sms/send"

    type :POST

    parameters:dataTxt.toString()

    headers:{"Content-Type":"application/json"}

    connection:"zohovoice_sms"

];

info resp;

 

Inside the code:

 

input.{FORM_FILED} serves as the placeholder for the numbers submitted via your Zoho Creator solution


Hardcode the zoho Voice number that is supposed to send messages near the variable senderID


For more convenience, it is best to have the connector name as zohovoice_sms throughout the setup.