File tree Expand file tree Collapse file tree 3 files changed +143
-0
lines changed Expand file tree Collapse file tree 3 files changed +143
-0
lines changed Original file line number Diff line number Diff line change 1+ import sys , os
2+ sys .path .append (os .path .join (os .path .dirname (__file__ ), '..' ))
3+
4+ import messagebird
5+
6+ # ACCESS_KEY = ''
7+ # VERIFY_ID = ''
8+
9+ try :
10+ ACCESS_KEY
11+ except NameError :
12+ print ('You need to set an ACCESS_KEY constant in this file' )
13+ sys .exit (1 )
14+
15+ try :
16+ VERIFY_ID
17+ except NameError :
18+ print ('You need to set a VERIFY_ID constant in this file' )
19+ sys .exit (1 )
20+
21+ try :
22+ # Create a MessageBird client with the specified ACCESS_KEY.
23+ client = messagebird .Client (ACCESS_KEY )
24+
25+ # Create a new Lookup HLR object.
26+ verify = client .verify (VERIFY_ID )
27+
28+ # Print the object information.
29+ print ('\n The following information was returned as a Verify object:\n ' )
30+ print (' id : %s' % verify .id )
31+ print (' href : %s' % verify .href )
32+ print (' recipient : %s' % verify .recipient )
33+ print (' reference : %s' % verify .reference )
34+ print (' messages : %s' % verify .messages )
35+ print (' status : %s' % verify .status )
36+ print (' createdDatetime : %s' % verify .createdDatetime )
37+ print (' validUntilDatetime : %s\n ' % verify .validUntilDatetime )
38+
39+ except messagebird .client .ErrorException as e :
40+ print ('\n An error occured while requesting a Verify object:\n ' )
41+
42+ for error in e .errors :
43+ print (' code : %d' % error .code )
44+ print (' description : %s' % error .description )
45+ print (' parameter : %s\n ' % error .parameter )
Original file line number Diff line number Diff line change 1+ import sys , os
2+ sys .path .append (os .path .join (os .path .dirname (__file__ ), '..' ))
3+
4+ import messagebird
5+
6+ # ACCESS_KEY = ''
7+ # PHONE_NUMBER = ''
8+
9+ try :
10+ ACCESS_KEY
11+ except NameError :
12+ print ('You need to set an ACCESS_KEY constant in this file' )
13+ sys .exit (1 )
14+
15+ try :
16+ PHONE_NUMBER
17+ except NameError :
18+ print ('You need to set a PHONE_NUMBER constant in this file' )
19+ sys .exit (1 )
20+
21+ try :
22+ # Create a MessageBird client with the specified ACCESS_KEY.
23+ client = messagebird .Client (ACCESS_KEY )
24+
25+ # Create a new Lookup HLR object.
26+ verify = client .verify_create (PHONE_NUMBER )
27+
28+ # Print the object information.
29+ print ('\n The following information was returned as a Verify object:\n ' )
30+ print (' id : %s' % verify .id )
31+ print (' href : %s' % verify .href )
32+ print (' recipient : %s' % verify .recipient )
33+ print (' reference : %s' % verify .reference )
34+ print (' messages : %s' % verify .messages )
35+ print (' status : %s' % verify .status )
36+ print (' createdDatetime : %s' % verify .createdDatetime )
37+ print (' validUntilDatetime : %s\n ' % verify .validUntilDatetime )
38+
39+ except messagebird .client .ErrorException as e :
40+ print ('\n An error occured while requesting a Verify object:\n ' )
41+
42+ for error in e .errors :
43+ print (' code : %d' % error .code )
44+ print (' description : %s' % error .description )
45+ print (' parameter : %s\n ' % error .parameter )
Original file line number Diff line number Diff line change 1+ import sys , os
2+ sys .path .append (os .path .join (os .path .dirname (__file__ ), '..' ))
3+
4+ import messagebird
5+
6+ # ACCESS_KEY = ''
7+ # VERIFY_ID = ''
8+ # VERIFY_TOKEN = ''
9+
10+ try :
11+ ACCESS_KEY
12+ except NameError :
13+ print ('You need to set an ACCESS_KEY constant in this file' )
14+ sys .exit (1 )
15+
16+ try :
17+ VERIFY_ID
18+ except NameError :
19+ print ('You need to set a VERIFY_ID constant in this file' )
20+ sys .exit (1 )
21+
22+ try :
23+ VERIFY_TOKEN
24+ except NameError :
25+ print ('You need to set a VERIFY_TOKEN constant in this file' )
26+ sys .exit (1 )
27+
28+
29+ try :
30+ # Create a MessageBird client with the specified ACCESS_KEY.
31+ client = messagebird .Client (ACCESS_KEY )
32+
33+ # Create a new Lookup HLR object.
34+ verify = client .verify_verify (VERIFY_ID , VERIFY_TOKEN )
35+
36+ # Print the object information.
37+ print ('\n The following information was returned as a Verify object:\n ' )
38+ print (' id : %s' % verify .id )
39+ print (' href : %s' % verify .href )
40+ print (' recipient : %s' % verify .recipient )
41+ print (' reference : %s' % verify .reference )
42+ print (' messages : %s' % verify .messages )
43+ print (' status : %s' % verify .status )
44+ print (' createdDatetime : %s' % verify .createdDatetime )
45+ print (' validUntilDatetime : %s\n ' % verify .validUntilDatetime )
46+
47+ except messagebird .client .ErrorException as e :
48+ print ('\n An error occured while requesting a Verify object:\n ' )
49+
50+ for error in e .errors :
51+ print (' code : %d' % error .code )
52+ print (' description : %s' % error .description )
53+ print (' parameter : %s\n ' % error .parameter )
You can’t perform that action at this time.
0 commit comments