Skip to content
Browse files

add PhoneStatus example

  • Loading branch information...
1 parent 8cd0ed3 commit 96d84252cc9780c2ad0b7e1c346aec39f3c6041f @tamiel tamiel committed Nov 3, 2011
Showing with 36 additions and 0 deletions.
  1. +29 −0 examples/phonestatus.py
  2. +7 −0 plivocldhelper.py
View
29 examples/phonestatus.py
@@ -0,0 +1,29 @@
+#!/usr/bin/env python
+import plivocldhelper
+import sys
+
+try:
+ phone = sys.argv[1]
+except:
+ print "Need Phone"
+ sys.exit(1)
+
+# Sid and AuthToken
+SID = 'MTFMMJMZNTRHYTEXMTVM'
+AUTH_TOKEN = 'OGRmYTNkMjBkMWI3NTNiZWU3MTM2M2U0M2EwMjRm'
+
+# Create a REST object
+plivo = plivocldhelper.REST(SID, AUTH_TOKEN)
+
+params = {
+ 'Phone' : phone
+}
+
+try:
+ result = plivo.phone_status(params)
+ print result
+except Exception, e:
+ print e
+ raise
+
+
View
7 plivocldhelper.py
@@ -148,6 +148,13 @@ def phone_order(self, params):
method = 'POST'
return self.request(path, method, params)
+ def phone_status(self, params):
+ """REST Phone Status Helper
+ """
+ path = '/' + self.api_version + '/Phone/Status/'
+ method = 'POST'
+ return self.request(path, method, params)
+
def call(self, call_params):
"""REST Call Helper
"""

0 comments on commit 96d8425

Please sign in to comment.
Something went wrong with that request. Please try again.