Creates an Application. Creating an application is usually a first step, after which you attach the application to either a number or an endpoint.

API Endpoint

POST
https://api.plivo.com/v1/Account/{auth_id}/Application/

Arguments

NameTypeDescription
answer_url requiredstringThe URL fetched when a call executes this application.
app_name requiredstringThe name of your application.
Allowed Values:
- Alphabets (upper case and lower case)
- Numbers (0-9).
- Only 2 special characters, i.e. ”-” (hyphen) and ”_” (underscore)
answer_methodstringThe method used to call the answer_url. Defaults to POST.
hangup_urlstringThe URL notified when the call hangs up. Defaults to answer_url.
hangup_methodstringThe method used to call the hangup_url. Defaults to POST.
fallback_answer_urlstringInvoked by Plivo only if answer_url is unavailable or the XML response is invalid. Should contain an XML response.
fallback_methodstringThe method used to call the fallback_answer_url. Defaults to POST.
message_urlstringThe URL notified when an inbound message is received. Defaults not set.
message_methodstringThe method used to call the message_url. Defaults to POST.
default_number_appbooleanIf set to true, this parameter ensures that newly created numbers that don’t have an app_id point to this application.
default_endpoint_appbooleanIf set to true, this parameter ensures that newly created endpoints that don’t have an app_id point to this application.
subaccountstringID of the subaccount that this application is associated with.
log_incoming_messagesbooleanIf set to false, the content of incoming messages to Plivo phone numbers associated with this application are not logged in Plivo systems, including the debug logs available on the Plivo console. Additionally, the last three digits of the “from” number are redacted in all system logs and in the Message Detail Record (MDR) of the incoming message.
Defaults to true when not specified.
Note that non-redacted content and “from” number are always passed to the message_url irrespective of the value set for this flag.

Request

import plivo

client = plivo.RestClient('<auth_id>','<auth_token>')
response = client.applications.create(
    app_name='TestApplication',
    answer_url='https://answer.url', )
print(response)

Response

HTTP Status Code: 201
{
  "message": "created",
  "app_id": "15784735442685051",
  "api_id": "5a9fcb68-582d-11e1-86da-6ff39efcb949"
}