Skip to content

Commit 8b996cf

Browse files
author
Tony Bedford
committed
Initial draft of application code snippets
1 parent 33c1033 commit 8b996cf

File tree

5 files changed

+63
-0
lines changed

5 files changed

+63
-0
lines changed

application/create-application.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/usr/bin/env python3
2+
import nexmo
3+
from pprint import pprint
4+
5+
client = nexmo.Client(
6+
application_id=APPLICATION_ID,
7+
private_key=APPLICATION_PRIVATE_KEY_PATH,
8+
)
9+
10+
response = client.application_v2.create_application({
11+
name='Example App',
12+
type='voice'
13+
})
14+
15+
pprint(response)

application/delete-application.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/usr/bin/env python3
2+
import nexmo
3+
from pprint import pprint
4+
5+
client = nexmo.Client(
6+
application_id=APPLICATION_ID,
7+
private_key=APPLICATION_PRIVATE_KEY_PATH,
8+
)
9+
10+
response = client.application_v2.delete_application(uuid)
11+
12+
pprint(response)

application/get-application.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/usr/bin/env python3
2+
import nexmo
3+
from pprint import pprint
4+
5+
client = nexmo.Client(
6+
application_id=APPLICATION_ID,
7+
private_key=APPLICATION_PRIVATE_KEY_PATH,
8+
)
9+
10+
response = client.application_v2.get_application(uuid)
11+
12+
pprint(response)

application/list-applications.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/usr/bin/env python3
2+
import nexmo
3+
from pprint import pprint
4+
5+
client = nexmo.Client(
6+
application_id=APPLICATION_ID,
7+
private_key=APPLICATION_PRIVATE_KEY_PATH,
8+
)
9+
10+
response = client.application_v2.list_applications()
11+
12+
pprint(response)

application/update-application.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/usr/bin/env python3
2+
import nexmo
3+
from pprint import pprint
4+
5+
client = nexmo.Client(
6+
application_id=APPLICATION_ID,
7+
private_key=APPLICATION_PRIVATE_KEY_PATH,
8+
)
9+
10+
response = client.application_v2.update_application(uuid, answer_method='POST')
11+
12+
pprint(response)

0 commit comments

Comments
 (0)