Client Credentials


Use this authorization grant type if you are building an application that just needs to access an endpoint as an anonymous user. For example, there's no need for a specific user to search listings.

You will need a client secret that must be handled in a secure fashion according to the OAuth 2.0 spec.

OAuth 2.0 Client Credentials Grant Type

OAuth 2.0 Client Credentials Grant Type

Example Flow

1. Retrieve the access token using the client credentials.

POST to the URL: https://api.uship.com/oauth/token

In case of Sandbox access (Staging: Search/Estimates/Rates), POST to the URL: https://apistaging.uship.com/oauth/token

Request

Header
content-type:ʉ۬application/x-www-form-urlencoded

grant_type=client_credentials&
client_id={{clientid}}&
client_secret={{client_secret String}}

Response

{
"token_type": "bearer",
"mapi": "string",
"access_token": "string",
"expires_in": 2592000,
"refresh_token": "string"
}

2. Use the access token to call a uShip endpoint. 

Request

Header
authorization:ʉ۬Bearer {{access_token String}}

 

 

 

Register your application.