Skip to main content

/auth/token

Flow

  • All API calls require an Authorization: Bearer <bearer token> header.
  • Automated <bearer token> rotation is recommended.
  • Successful authentication rotation calls will return a new bearer token.

Supported Methods

  • POST

Request

/auth/token

HEADERS

RCOMultitudeKeyTypeDescription
R1User-AgentStringAn identifying string in Product/Version format, where Version is a SemVer-compliant string, that uniquely identifies your application.
R1AcceptStringThe only supported response type for this endpoint is application/json.
R1Content-TypeStringPThe only supported request type for this endpoint is application/json.
R1Request-IDStringThe integrator's external request ID for support traceablility and issue debugging. This string should be a UUID V4 value.
R1PAC-Application-IDStringThe application identifier for which API access has been authorized; this value is typically expressed in reverse domain notation and is bound to an API key provided by Paciolan during provisioning.

Request Object

RCOKeyTypeDescription
RgrantTypeStringauthorization_code or refresh_token
CcodeStringauthorization code to generate access and refresh token
CrefreshTokenStringexchange refresh token for an access token when the access token has expired

Response

HEADERS

PropertyTypeDescription
Request-IDStringThe same ID provided in the header of the request call returned back.
Content-TypeStringSupported type is application/json.

Response Object

PropertyTypeDescription
accessTokenStringThe access token string issued by the authorization server
expirationDateTime (JSON String)Access token expiry in YYYY-MM-DDTHH:MM:SS.sssssssssZ (UTC) format
refreshTokenStringIf the access token will expire, then use refresh token to obtain another access token
tokenTypeStringThe type of token, typically just the string "Bearer"

Error Response Object

PropertyTypeDescription
errorStringGeneric description of error that occured

Examples

Request with authorization code

curl 'https://link-sandbox.paciolan.info/v1/auth/token' \
-H 'User-Agent: MyApplication/1.0' \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-H 'Request-ID: <RequestID>' \
-H 'PAC-Application-ID: com.mycompany.myapp' \
-d '{
"grantType": "authorization_code",
"code": "1fdb0e9c-57cb-4ea8-a066-56abb5ee773c"
}'
Success Response
{
"accessToken": "hsfsdgfdsgvb4354gfnbnkaerAtrJKNnrtusiJNOuts",
"expiration": "2023-02-18T19:39:39.548608815Z",
"refreshToken": "sflk5j6q2kgmKjfrs_kijdngka9qpoutrei45gfnm",
"tokenType": "Bearer"
}

Request with Refresh Token

curl 'https://link-sandbox.paciolan.info/v1/auth/token' \
-H 'User-Agent: MyApplication/1.0' \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-H 'Request-ID: <RequestID>' \
-H 'PAC-Application-ID: com.mycompany.myapp' \
-d '{
"grantType": "refresh_token",
"refreshToken": "sflk5j6q2kgmKjfrs_kijdngka9qpoutrei45gfnm"
}'
Success Response
{
"accessToken": "dsmvkhrthiurt9873245jkhs7f90234jh_8435kjhdsf8",
"expiration": "2023-02-18T19:39:39.548608815Z",
"refreshToken": "vcnhgflkrjelewjrwooruewoi34243jksfhcmhrkahu",
"tokenType": "Bearer"
}
Unsuccessful Response
{
"error": "invalid credential"
}