Authentication: getOAuthToken

Deprecated

Note: This information is provided for legacy reference only. Please see our supported forms of authentication referenced below and use our REST API Authentication Guides for more information.

Creates an OAuth2 authorization server token endpoint. For more information about OAuth 2.0 please see OAuth2.0.

Request

HTTP request

POST /v2/oauth2/token

Parameters

Parameter NameValueDescription

Responses

CodeDescriptionReference
201

Successful response.

oauthAccess
400

Error encountered.

errorDetails

SDK Method

Authentication::getOAuthToken

Definitions

errorDetails

This object describes errors that occur. It is only valid for responses, and ignored in requests.

errorCodestring

An error code associated with the error.

messagestring

A short error message.

nameValue

errorDetailserrorDetails

namestring

The name or key of a name/value pair.

originalValuestring

The initial value of the tab when it was sent to the recipient.

valuestring

The value field of a name/value pair.

oauthAccess

access_tokenstring

Access token information.

data[nameValue]

expires_instring

refresh_tokenstring

scopestring

Must be set to "api".

token_typestring

Examples

Generic JSON Response

Response
{
  "access_token": "sample string 1",
  "token_type": "sample string 2",
  "expires_in": "sample string 3",
  "refresh_token": "sample string 4",
  "scope": "sample string 5",
  "data": [
    {}
  ]
}
Generic XML Response

Response
<oauthAccess xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.docusign.com/restapi">
  <access_token>sample string 1</access_token>
  <data>
    <nameValue />
  </data>
  <expires_in>sample string 3</expires_in>
  <refresh_token>sample string 4</refresh_token>
  <scope>sample string 5</scope>
  <token_type>sample string 2</token_type>
</oauthAccess> 
}} />