Authorization Endpoint
Endpoint: GET /oauth/authorize
The authorization endpoint is used to obtain an authorization code, which can be exchanged for an access token.
Request Parameters:
client_id
: The client ID of your application (obtained during app registration)redirect_uri
: The URI where users will be redirected to after authorizationresponse_type
: The type of response expected from the authorization server (usecode
for the authorization code flow)state
: An optional string to maintain state between the request and the callback {/scope
: The permissions requested by your application (optional) /}
Direct the user to the authorization URL with the appropriate parameters. For example:
https://api.commoninja.com/oauth/authorize?client_id=YOUR_CLIENT_ID&redirect_uri=YOUR_REDIRECT_URI&response_type=code&state=YOUR_STATE
Authorization Screen example:
Upon successful authorization, the user will be redirected to the specified redirect_uri
with an authorization code appended as a query parameter.
Example Redirect:
https://your-redirect-uri.com/callback?code=AUTHORIZATION_CODE&state=YOUR_STATE