Resource Owner Password Credentials


Use this grant type for scenarios where you want to authorize an app in which a uShip user would supply their own credentials. Note that access to this authorization method is extremely restricted.  In almost all situations, developers should not be handling the username and password themselves.  If you want your application to perform actions on uShip on behalf of a uShip user, consider the Authorization Code or Implicit methods instead.

OAuth 2.0 Resource Owner Password Grant Flow

Resource Owner Password Grant Flow

1.  POST to the correct environment and endpoint using the uShip user's credentials to get the access token.

Use the username and password in the request URI

https://apistaging.uship.com/oauth/token_authenticated OR

https://api.uship.com/oauth/token_authenticated

Request

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

username={{ushipusername}}&
password={{password}}&
client_id={{clientId}}&
client_secret={{clientSecret}}&

grant_type=password 

Response

{
"token_type": "bearer",
"access_token": "string",
"expires_in": 600,
"refresh_token": "string"
}

2. Access a resource endpoint using the access token.

Request

Header
authorization: Bearer {{access_token String}}

POST to the correct environment and endpoint.  For example:

Staging

https://apistaging.uship.com/v2/preferences OR

https://apistaging.uship.com/v2/search OR

https://apistaging.uship.com/v2/savedSearches

Production

https://api.uship.com/v2/preferences 

https://api.uship.com/v2/search

https://api.uship.com/v2/savedSearches

Register your application.