memorandum. I want Garoon's REST functions to be enhanced a little more.
Common specifications of Garoon REST API https://developer.cybozu.io/hc/ja/articles/360000503306
GET organization https://developer.cybozu.io/hc/ja/articles/360017843172
import requests
url = 'https://(Subdomain name).cybozu.com/g/api/v1/base/organizations/1/users'
headers = {
'Host': '(Subdomain name).cybozu.com:443',
# 'Content-Type': 'application/json',
#"login name:Specify the BASE64 encoded password as the value.
#Rewrite xxxxxxxxx
'X-Cybozu-Authorization': 'xxxxxxxxx',
'Authorization': 'Basic xxxxxxxxx'
}
params = {
'limit':1000
}
response = requests.get(url, headers=headers, params=params)
downloadData = response.json()
if len(downloadData) > 0:
print(downloadData['users'])
[{'id': '1', 'name': 'Yamada Taro', 'code': '0001'},
{'id': '2', 'name': 'Hanako Yamada', 'code': '0002'}}]
With SOAP Similar information can be obtained by "Getting organization information" (However, of the user information, only the user ID is returned) https://developer.cybozu.io/hc/ja/articles/202511450
How to use Requests (Python Library) https://qiita.com/sqrtxx/items/49beaa3795925e7de666
Recommended Posts