Oauth

Getting the tokens

Changed on

After the customer has confirmed the app installation, you will need to exchange the authorization_code to a pair of access and refresh tokens. Using an access token, you can access the user's data through the API.

post/oauth/token

Request

  • Base URL
    https://oauth.pipedrive.com
  • Auth
    HTTP basic

Headers

Authorizationstring required

Base 64 encoded string containing the client_id and client_secret values. The header value should be Basic <base64(client_id:client_secret)>.

Request body application/x-www-form-urlencoded

grant_type'authorization_code' | 'refresh_token'

Since you are trying to exchange an authorization code for a pair of tokens, you must use the value "authorization_code"

codestring

The authorization code that you received after the user confirmed app installation

redirect_uristring

The callback URL you provided when you registered your app

Response

Returns user Oauth2 tokens.

access_tokenstring

You need to use an access_token for accessing the user's data via API. You will need to refresh the access token if the access_token becomes invalid.

token_typestring

The format of the token. Always "Bearer".

refresh_tokenstring

A refresh token is needed when you refresh the access token. refresh_token will expire if it isn't used in 60 days. Each time refresh_token is used, its expiry date is reset back to 60 days.

scopestring

List of scopes to which users have agreed to grant access within this access_token

expires_ininteger

The maximum time in seconds until the access_token expires

api_domainstring

The base URL path, including the company_domain, where the requests can be sent to

Changes