PYTHON SDK
v2.0.3
register.py
이 파일의 문서화 페이지로 가기
1 # vi:set sw=4 ts=4 expandtab:
2 # -*- coding: utf8 -*-
3 
4 import sys
5 
6 sys.path.insert(0, "../../")
7 
8 from sdk.api.sender_id import SenderID
9 from sdk.exceptions import CoolsmsException
10 
11 ## @brief This sample code demonstrate how to request sender number register through CoolSMS Rest API
12 if __name__ == "__main__":
13 
14  # set api key, api secret
15  api_key = "#ENTER_YOUR_OWN#"
16  api_secret = "#ENTER_YOUR_OWN#"
17 
18  # phone is mandatory.
19  phone = "01000000000"
20 
21  cool = SenderID(api_key, api_secret)
22 
23  try:
24  response = cool.register(phone)
25  print("ARS Number : %s" % response['ars_number'])
26  print("Handle Key : %s" % response['handle_key'])
27 
28  except CoolsmsException as e:
29  print("Error Code : %s" % e.code)
30  print("Error Message : %s" % e.msg)
31 
32  sys.exit()
management sender id, using Rest API
Definition: sender_id.py:15