Using Multi DC in server and client-based apps

In server-based applications

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

1. Identify the user location during the authorization request

In the authorization request, you will send calls to the domain https://accounts.zoho.com. In the response, the location of the user's DC will be included as the parameter location. You can view the respective server URL for this location using https://accounts.zoho.com/oauth/serverinfo.

Sample authorization response:

https://oauth.pstmn.io/v1/browser-callback
?code=1000.abbb4c9e0902704b90cc556f32ec0336.5ff4478926a43657280d5cbe1af1917a
&location=in
&accounts-server=https://accounts.zoho.in

In this example, location=in.
 

2. Make access token request to the server URL associated with user's location

Once you have identified the user's data center, you need to make the access token request to the server URL corresponding to that location. For example, if location=eu, you will need to make access token request to https://accounts.zoho.eu.

Example request:

https://accounts.zoho.eu/oauth/v2/token
?client_id=1000.GMB0YULZHJK411248S8I5GZ4CHUEX0
&grant_type=authorization_code
&client_secret=122c324d3496d5d777ceeebc129470715fbb856b7
&redirect_uri=https://www.zylker.com/oauthredirect
&code=1000.86a03ca5dbfccb7445b1889b8215efb0.cad9e1ae4989a1196fe05aa729fcb4e1

Example response:

{
"access_token":"1000.2deaf8d0c268e3c85daa2a013a843b10.703adef2bb337b 8ca36cfc5d7b83cf24",
"refresh_token":"1000.18e983526f0ca8575ea9c53b0cd5bb58.1bd83a6f2e22c3a7e1309d96ae439cc1",
"api_domain":"https://api.zoho.eu",
"token_type":"Bearer",
"expires_in":3600
}

In the response, you will find api_domain, which is where you will need to make the service API requests.
 

3. 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.


 

In client-based applications

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

1. Identify the user location during the access token request

In the access token request, you will send calls to the domain https://accounts.zoho.com. In the response, the location of the user's DC will be included as the parameter location. You can view the respective server URL for this location using https://accounts.zoho.com/oauth/serverinfo. You will also find api_domain, which is where you will need to make the service API requests.

Sample authorization response:

https://www.zylker.com/oauthredirect#
&access_token=1000.835d578e9a2103d2e87994ae8752074d.4496b74ddde6413f83fe615e8388e488
&expires_in=3600
&location=in
&api_domain=https://www.zohoapis.in


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.