Generate Token
This endpoint is used to generate refresh token using parameters client_id, code and client_secret.
If Grant type is "authorization_code" then request body must have two mandatory parameters, called "code" and "redirect_uri".
While generating new access token on expiry, request body must have grant type as "refresh_token" and mandatory parameter called "refresh_token".
Body Required
-
Code will be come from the authorize url call back redirect url.
-
Refresh Token
-
grant_type
Values are
authorization_code
orrefresh_token
. -
Redirect URI
Responses
-
Generate required refresh and access tokens.
-
The client request has not been completed because it lacks valid authentication credentials for the requested resource.
-
The client does not have access rights to the content.
-
The request method is known by the server but is not supported by the target resource.
curl \
-X POST https://openapi.niftypm.com/oauth/token \
-H "Content-Type: application/json" \
-H "authorization: string" \
-d '{"code":"Pk6DnFY4q9Z1X7aOQATV5z4bxg1rjwH4","refresh_token":"string","grant_type":"authorization_code","redirect_uri":"string"}'
# Headers
authorization: string
# Payload
{
"code": "Pk6DnFY4q9Z1X7aOQATV5z4bxg1rjwH4",
"refresh_token": "string",
"grant_type": "authorization_code",
"redirect_uri": "string"
}
# Headers
authorization: string
# Payload
{
"code": "Pk6DnFY4q9Z1X7aOQATV5z4bxg1rjwH4",
"refresh_token": "string",
"grant_type": "authorization_code",
"redirect_uri": "string"
}
{
"access_token": "string",
"token_type": "string",
"refresh_token": "string",
"expires_in": 42.0,
"scope": "file"
}
{
"access_token": "string",
"token_type": "string",
"refresh_token": "string",
"expires_in": 42.0,
"scope": "file"
}