# without payload in request

import plivo

auth_id = '<auth_id>'
auth_token = '<auth_token>'
phlo_id = '<phlo_id>'
phlo_client = plivo.phlo.RestClient(auth_id=auth_id, auth_token=auth_token)
phlo = phlo_client.phlo.get(phlo_id)
response = phlo.run()
print str(response)

# with payload in request

import plivo

auth_id = '<auth_id>'
auth_token = '<auth_token>'
phlo_id = '<phlo_id>'
payload = {"from" : "+12025550000","to" : "+12025551111"}
phlo_client = plivo.phlo.RestClient(auth_id=auth_id, auth_token=auth_token)
phlo = phlo_client.phlo.get(phlo_id)
response = phlo.run(**payload)
print str(response)
{
    "phlo_id": "4c1a9f23-7f56-4879-bb80-db856e1e7701",
    "api_id": "7b6f8256-07c7-4d9a-bf2a-a2cd0f05d269",
    "message": "b'Send SMS' - b'Send SMS_1' with phlo_run_uuid: 7b6f8256-07c7-4d9a-bf2a-a2cd0f05d269 executed with response: {'api_id': '81525812-3c04-11e9-aa1e-06c75f1208d2',\n 'message': 'message(s) queued',\n 'message_uuid': ['8152b05a-3c04-11e9-aa1e-06c75f1208d2']}"
}

Run a PHLO by triggering it via an API request to the PHLO URL. PHLO URLs are listed on the PHLO page of the console.

API Endpoint

POST
https://phlorunner.plivo.com/v1/account/{auth_id}/phlo/{phlo_id}

Arguments

URL Params

ParamTypeDescription/Allowed Values
auth_id (Required)stringYou can find your Plivo Auth ID on the overview page of the console.
phlo_id (Required)stringUnique identifier for the PHLO. You can find a PHLO ID on the PHLO page of the console.

Payload

If a dynamic payload is not defined in the Start node of the PHLO (as shown in the screenshot) then no arguments need to be passed. In this example, the payload will be defined in the Send SMS node.

Payload_undefined

If a dynamic payload is defined in the Start node of the PHLO (as shown in the next screenshot) then values for keys defined in the Start node of PHLO will be passed. In this example, the values are

ParamDescription
from

Value of the from key

to

Value of the to key

Payload_defined

Payload defined in the Start node will be accessed in the Send SMS node using liquid tags like the one shown in the image below.

Payload_defined

Returns

Returns an api_id to uniquely identify the PHLO run, referred to as phlo_run_id. The message attribute in the response provides more information about the PHLO run.

# without payload in request

import plivo

auth_id = '<auth_id>'
auth_token = '<auth_token>'
phlo_id = '<phlo_id>'
phlo_client = plivo.phlo.RestClient(auth_id=auth_id, auth_token=auth_token)
phlo = phlo_client.phlo.get(phlo_id)
response = phlo.run()
print str(response)

# with payload in request

import plivo

auth_id = '<auth_id>'
auth_token = '<auth_token>'
phlo_id = '<phlo_id>'
payload = {"from" : "+12025550000","to" : "+12025551111"}
phlo_client = plivo.phlo.RestClient(auth_id=auth_id, auth_token=auth_token)
phlo = phlo_client.phlo.get(phlo_id)
response = phlo.run(**payload)
print str(response)
{
    "phlo_id": "4c1a9f23-7f56-4879-bb80-db856e1e7701",
    "api_id": "7b6f8256-07c7-4d9a-bf2a-a2cd0f05d269",
    "message": "b'Send SMS' - b'Send SMS_1' with phlo_run_uuid: 7b6f8256-07c7-4d9a-bf2a-a2cd0f05d269 executed with response: {'api_id': '81525812-3c04-11e9-aa1e-06c75f1208d2',\n 'message': 'message(s) queued',\n 'message_uuid': ['8152b05a-3c04-11e9-aa1e-06c75f1208d2']}"
}

Message will differ depending on the node defined for the PHLO trigger