Getting Started with SMS Notification

SMS Notification are used to send regular updates and notification to the users. Plivo’s PHLO allows you to quickly create and configure a SMS Notifications for your business. An API call will trigger the PHLO and will enable sending SMS messages to the customers.

Use Case Outline

Creating the Use Case using PHLO

With PHLO, you can quickly create a workflow that suits your use case. To use PHLO, make sure to register and log on to Plivo Console.

Use the following components to create this PHLO:

Send SMS

When you send an API request to the PHLO, it triggers a SMS message to the user using the Send SMS component. This is a simple use case, yet it is one of the most widely used.

On the top navigation bar, click PHLO.
The PHLO page will appear and display your existing PHLOs, if any. If this is your first PHLO, then the PHLO page will be empty.

Click CREATE NEW PHLO to build a new PHLO.

On the Choose your use-case window, click Build my own.
The PHLO canvas will appear with the Start node.
Note: The Start node is the starting point of any PHLO. You can choose between the four available trigger states of the Start node; Incoming SMS, Incoming Call, Endpoint Call, and API Request. For this PHLO, we will use the API Request trigger state.

Click the Start node to open the Configurations tab and then enter the information to retrieve from the HTTP Request payload.
For example, this could be a list of numbers to send an SMS message to.

Click Validate to save the configurations for the node.

From the list of components, on the left hand side, drag and drop the Send SMS component onto the canvas. This will add a Send SMS node onto the canvas.

Connect the Start node with the Send SMS node, using the API Request trigger state.

Rename the node to Send_Notification.
Note: You can rename the nodes as per your requirements. We are using specific names to help you relate to the different nodes used in this use case.

Next, configure the Send SMS node to select the From and To numbers from the Start node.
Note: The SMS message can be static or dynamic. In this example, we will use a combination of a static message along with some dynamic message.

On the Send SMS Configurations tab, enter a static message (For example, Your order status is: ) in the Message field, followed by a variable to include the dynamic text. You can choose a variable by entering two curly brackets in the Speak Text field.
Note:

Enter two curly brackets to view all available variables.

The values for the From and To numbers are picked from the HTTP Request Payload. Make sure to clearly define the variables in the Start node.

Click Validate to save the configurations for the node.

After you complete the configurations, click Save.
You can trigger your PHLO using the PHLO URL to test it out.

Your complete PHLO will look like this:

Triggering the PHLO from your SMS app

Once you have created and configured your PHLO, copy the PHLO Run URL. You can integrate a PHLO into your application workflow by making an API request to the PHLO URL with the required payload.

packagemainimport("fmt""plivo-go")// Initialize the following params with corresponding values to trigger resourcesconstauthId="auth_id"constauthToken="auth_token"constphloId="phlo_id"// with payload in requestfuncmain(){testPhloRunWithParams()}functestPhloRunWithParams(){phloClient,err:=plivo.NewPhloClient(authId,authToken,&plivo.ClientOptions{})iferr!=nil{panic(err)}phloGet,err:=phloClient.Phlos.Get(phloId)iferr!=nil{panic(err)}//pass corresponding from and to valuestypeparamsmap[string]interface{}response,err:=phloGet.Run(params{"from":"111111111","to":"2222222222",})if(err!=nil){println(err)}fmt.Printf("Response: %#v\n",response)}// without payload in requestfuncmain(){testPhloRunWithoutParams()}functestPhloRunWithoutParams(){phloClient,err:=plivo.NewPhloClient(authId,authToken,&plivo.ClientOptions{})iferr!=nil{panic(err)}phloGet,err:=phloClient.Phlos.Get(phloId)iferr!=nil{panic(err)}response,err:=phloGet.Run(nil)iferr!=nil{panic(err)}fmt.Printf("Response: %#v\n",response)}

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16

<?php/**
* Example for API Request
*/require'vendor/autoload.php';usePlivo\Resources\PHLO\PhloRestClient;usePlivo\Exceptions\PlivoRestException;$client=newPhloRestClient("YOUR_AUTH_ID","YOUR_AUTH_TOKEN");$phlo=$client->phlo->get("YOUR_PHLO_ID");try{$response=$phlo->run(["field1"=>"value1","field2"=>"value2"]);// These are the fields entered in the PHLO consoleprint_r($response);}catch(PlivoRestException$ex){print_r($ex);}?>

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15

varplivo=require('../dist/rest/client-test.js');varPhloClient=plivo.PhloClient;varauthId='auth-id';varauthToken='auth-token';varphloId='PHLO_ID';varphloClient=phlo=null;// Run phlophloClient=newPhloClient(authId,authToken);phloClient.phlo(phloId).run().then(function(result){console.log('Phlo run result',result);}).catch(function(err){console.error('Phlo run failed',err);});

You can install the server-side SDKs and setup your development environment by referring to the instructions available in the below links: