Migration for Redirection-based Applications

Purpose

To generate access and refresh tokens from the existing auth token.

Use this API when your application has multiple users and it obtains their username and password to generate an auth token, or if the users input their auth tokens.

Prerequisite:

The application owner must share the client ID, auth token, auth token scopes, and the required OAuth scopes over an email to support@zohorecruit.com.

Zoho Recruit validates the auth token and the associated scope, and configures them in Zoho Accounts. After successful validation, Zoho Recruit informs the application owner about the client upgrade over an email.

How it Works?

  1. After successful validation from the service team, the external application accesses the "Migration for Redirection-based Applications" API with client ID, client secret, and auth token.

  2. Zoho Accounts checks whether the parameters passed in the request are already verified.

  3. After successful validation, Accounts provides OAuth access and refresh tokens to the application.

Request URL

https://accounts.zoho.com/oauth/v2/token/external/authtooauth

Request Method

POST

Parameters

Parameter NameData TypeDescription
client_idStringSpecify the client ID you obtained while registering your application
client_secretStringSpecify the client secret generated from the connected application
grant_typeStringThe grant type must be authtooauth
authtokenStringSpecify your auth token

Possible Errors

Error MessageReason
invalid_grantThe grant_type is not specified as authtooauth
access_deniedThe auth token you specified is already used to generate an OAuth token
or
You call the migration API after the allowed time of migration(expired)
or
the system has blocked the client
invalid_clientThe client ID you specified is wrong
or
the auth to oauth mapping entry for the valid client is not made in accounts
invalid_authtokenThe auth token you specified is wrong
or
the auth token scope mismatches with the pre-shared auth scopes
invalid_scopeThe OAuth scope you specified is invalid
Note:
  • The maximum number of migration requests you can make per minute is 60 and per hour is 100.

  • After the generation of an OAuthtoken, the system deletes the old auth token after 1 day.

  • The maximum number of times a client can pass an invalid auth token is 20. If you exceed this limit, the system blocks the client and throws the error message "access_denied".

Sample Response

Copied{
"access_token": "1000.8cb99dxxxxxxxxxxxxx9be93.9b8xxxxxxxxxxxxxxxf",
"refresh_token": "1000.b8xxxxxxxxxxxxxxxx58f.538b3xxxxxxxxxxxxxxxxx114",
"expires_in": 3600,
"token_type": "Bearer"
}