forked from plivo/plivo-examples-python
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplivo_application.py
45 lines (34 loc) · 1.01 KB
/
plivo_application.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
import plivo
auth_id = ""
auth_token = ""
p = plivo.RestAPI(auth_id, auth_token)
# Create application
params = {
'app_name' : 'Gandalf the Gray',
'answer_url' : 'http://example.com/answer_url',
'answer_method' : 'POST',
'hangup_url' : 'http://example.com/hangup_url',
'hangup_method' : 'POST',
'fallback_url' : 'http://example.com/fallback_url',
'fallback_method' : 'POST',
}
response = p.create_application(params)
# Modify application
response = p.modify_application(params)
# Delete application
params = {
'app_id' : 'XXXXXXXXXXXXXXXXXXXXX',
}
response = p.delete_application(params)
# Create subaccount application
params = {
'subaccount' : ' XXXXXXXXXXXX',
'app_name' : 'Gimli the dwarf',
'answer_url' : 'http://example.com/answer_url',
'answer_method' : 'POST',
'hangup_url' : 'http://example.com/hangup_url',
'hangup_method' : 'POST',
'fallback_url' : 'http://example.com/fallback_url',
'fallback_method' : 'POST',
}
response = p.create_application(params)