Get users belonging to your organization from Garoon REST API with Python + Requests

memorandum. I want Garoon's REST functions to be enhanced a little more.

reference

Common specifications of Garoon REST API https://developer.cybozu.io/hc/ja/articles/360000503306

GET organization https://developer.cybozu.io/hc/ja/articles/360017843172

Source

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'])
        

Output result

[{'id': '1', 'name': 'Yamada Taro', 'code': '0001'},
 {'id': '2', 'name': 'Hanako Yamada', 'code': '0002'}}]

Supplement

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

Referenced articles

How to use Requests (Python Library) https://qiita.com/sqrtxx/items/49beaa3795925e7de666

Recommended Posts

Get users belonging to your organization from Garoon REST API with Python + Requests
Get schedule from Garoon SOAP API with Python + Zeep
Image upload & download to Azure Storage. With Python + requests + REST API
[First API] Try to get Qiita articles with Python
Get your heart rate from the fitbit API in Python!
The first API to make with python Djnago REST framework
Hit REST in Python to get data from New Relic
Get data from analytics API with Google API Client for python
Get reviews with python googlemap api
Create folders from '01' to '12' with python
Get the weather with Python requests
Get the weather with Python requests 2
How to get started with Python
Get upcoming weather from python weather api
Operate Jupyter with REST API to extract and save Python code
A story about adding a REST API to a daemon made with Python
How to get followers and followers from python using the Mastodon API
Get US stock price from Python with Web API with Raspberry Pi
Get html from element with Python selenium
[Note] Get data from PostgreSQL with Python
Create wordcloud from your tweet with python3
I tried to get the authentication code of Qiita API with Python.
POST photos with Microsoft Bing Image Search API to get Image Insights (Python)
[Python] Get Python package information with PyPI API
I tried to get the movie information of TMDb API with Python
API explanation to touch mastodon from python
Connect to coincheck's Websocket API from Python
Get a list of articles posted by users with Python 3 Qiita API v2
How to automatically generate API document with Django REST framework & POST from document screen
Get stock price data with Quandl API [Python]
[Bash] Use here-documents to get python power from bash
I tried to get CloudWatch data with Python
Get Gmail subject and body with Python and Gmail API
From Python environment construction to virtual environment construction with anaconda
[Python] Mention to multiple people with Slack API
A layman wants to get started with Python
Python script to get note information with REAPER
Memo to create your own Box with Pepper's Python
How to scrape image data from flickr with python
[Python] Get the text of the law from the e-GOV Law API
I tried to get started with blender python script_Part 01
Push notifications from Python to Android using Google's API
Get LEAD data using Marketo's REST API in Python
I tried to get started with blender python script_Part 02
Register a ticket with redmine API using python requests
From buying a computer to running a program with python
Hit Watson's REST API from Python on IBM Bluemix
Get mail from Gmail and label it with Python3
How to get mouse wheel verdict with Python curses
Try to tamper with requests from iphone with Burp Suite
[Python] Get user information and article information with Qiita API
Get data from database via ODBC with Python (Access)
How to operate Discord API with Python (bot registration)
ODBC access to SQL Server from Linux with Python
[Python / Ruby] Understanding with code How to get data from online and write it to CSV
Changes from Python 3.0 to Python 3.5
Get date with python
Retry with python requests
Minimum knowledge to get started with the Python logging module
Get the package version to register with PyPI from Git
How to hide your Google Maps API key from HTML