Using Multi DC in non-browser based applications

In non-browser based applications, the Multi DC flow will be as follows:
 

1. Identify the user's location from the polling request

After getting the device_code from the initiation request, you will poll requests and wait for user's permission. After the user grants permission, if your app and the user are present in the same location (i.e., data center), the server will respond with an access token. However, if your app and the server are present in different DCs, you will get the feedback other_dc from the server along with the actual location of the user.

Example feedback:

{
user_location": "eu",
"error": "other_dc"
}

Now, you will need to send further polling requests to the server URL corresponding to the user's location. In the response, you will get the access_token and the api_domain, which is where you will need to make the service API requests.

Example response:

{
access_token": "1004.a3fdad1f7115c8d00a491938a3650a2f.68485f81304",
"api_domain": "https://api.zoho.com",
"token_type": "Bearer",
"expires_in":3600
}

 

2. Make service API requests to the api domain associated with user's location

Make request calls to the service you want to access through the api_domain you get from the response of the access token request.