Authentication¶
zoho-people-sdk uses OAuth 2.0 with automatic token refresh.
Obtaining credentials¶
Create a Self Client
Generate a code with the required scopes:
ZOHOPEOPLE.forms.ALL,ZOHOPEOPLE.attendance.ALL,
ZOHOPEOPLE.timetracker.ALL,ZOHOPEOPLE.leave.ALL
Exchange the code for a refresh token using
python main.py 1
Environment variables¶
Copy .env.example to .env and fill in your values:
ZOHO_CLIENT_ID=1000.xxxxxxxxxx
ZOHO_CLIENT_SECRET=xxxxxxxxxx
ZOHO_REFRESH_TOKEN=1000.xxxxxxxxxx
ZOHO_DATA_CENTRE=US # US | EU | IN | AU | JP
ZOHO_USER_EMAIL=you@company.com
Loading from environment¶
from zoho_people import ZohoPeopleAuth, ZohoPeopleClient
auth = ZohoPeopleAuth.from_env()
client = ZohoPeopleClient(auth=auth)
Explicit configuration¶
auth = ZohoPeopleAuth(
client_id="1000.xxx",
client_secret="yyy",
refresh_token="1000.zzz",
data_centre="EU",
)
client = ZohoPeopleClient(auth=auth)
Data centres¶
Region |
Code |
Accounts URL |
|---|---|---|
United States |
|
|
Europe |
|
|
India |
|
|
Australia |
|
|
Japan |
|
|