PYTHON SDK
v2.0.3
image_list.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.image import Image
9 from sdk.exceptions import CoolsmsException
10 
11 ## @brief This sample code demonstrate how to check image list 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  # Optional parameters for your own needs
19  params = dict()
20  # params["offset"] = "0" # default 0
21  # params["limit"] = "20" # default 20
22  cool = Image(api_key, api_secret)
23 
24  try:
25  response = cool.get_image_list(params)
26  print("Total Count : %s" % response['total_count'])
27  print("Limit : %s" % response['limit'])
28  print("Offset : %s" % response['offset'])
29  print("List : %s" % response['list'])
30 
31  except CoolsmsException as e:
32  print("Error Code : %s" % e.code)
33  print("Error Message : %s" % e.msg)
34 
35  sys.exit()
management image, using Rest API
Definition: image.py:16