Mobile Token Request

 

Utilize the Mobile Token request to retrieve a token values for a single mobile user that you can use for processing a Local Service Inquiry Request. Identify the tokens by providing company ID, username, and password for a specific mobile user (see Local Service Information API Setup).

 

The purpose of this request is to provide you with a unique token allowing you to continually make Local Service Inquiry Request calls without providing credentials for each request.

 

To processes an initial password request, you will need to the following information:

    Company ID provided to you by EWS Group. This is the same company ID referenced when logging into MSCrew or into MoversConnect.

    Username and Password established within the Mobile User tab within Personnel Setup.

 

Refer to Local Service Information API Setup for more information.

 

Target

 

Request URI

https://www.moversconnect.net/mobiletoken 

Content-Type

Valid options:

application/json

application/xml

application/x-www-form-urlencoded

Request Method

POST

Request Timeout

60 seconds

Body

 

Content-Type

application/json or application/xml

Encoding

utf-8

Request Payload - Raw Body

You can use the Mobile Token request to establish a token or activate a refresh token. An initial token may only be valid for a few days, whereas a refresh token is good for 90 days.

 

Request Password Token

Provide the company_id, username, and password for the mobile user defined within Local Service Information API Setup. Set the grant_type, client_id, and client_secret as those provided within the JSON example below.

 

{

   "grant_type":"Password",

   "company_id":"YourCompanyID",

   "username":"YourMobileUser",

   "password":"YouMobileUserPassword",

   "client_id":"CrewConnect",

   "client_secret":"7FC113A41D8E4EE6AAD26D79743F9A34"

}

 

Activate Refresh Token

The response from the initial request provides you Token and RefreshToken values. You can activate the Refresh Token by requesting a grant_type of Token, similar to the JSON example below.

 

{

   "grant_type":"Token",

   "token":"YourRefreshTokenFromOriginalPasswordRequest",

   "client_id":"CrewConnect",

   "client_secret":"7FC113A41D8E4EE6AAD26D79743F9A34"

}

 

NOTE: When you process a grant_type of Password or RefreshToken, then any previously issued tokens and refresh tokens are immediately null and void and can no longer be used.

 

Response

 

Response:

Password Token

When you request an initial password token, the response includes data similar to the following JSON example.

 

{

   "RefreshExpires":1523377033,

   "RefreshToken":"YourTokenFromOriginalPasswordRequest",

   "Token":"YourInitialToken",

   "TokenExpires":1516292233

}

 

The Token value is needed to make a Local Service Inquiry Request through a Custom Headers parameter.

 

Activate Refresh Token

Use the RefreshToken value from the initial password request to extend the token for 90 days. The output of the request includes the expiration dates for the two tokens. NOTE: Expiration dates are represented by the number of seconds since January 1, 1970 UTC as a 64-bit integer.

 

{

   "RefreshExpires":1523377033,

   "RefreshToken":null,

   "Token":null,

   "TokenExpires":1516292233

}

 

Continue to use the Token value in Local Service Inquiry Request calls.

 

 

The following examples illustrate the use of the Mobile Token request in JSON for each utilized section.

 

 

Figure 102: Target section of a Password request (in JSON)

 

Figure 103: Body section of a Password request (in JSON)

 

 

Figure 104: Response section of a Password request (in JSON)

 

 

Figure 105: Body of a Token request (in JSON)

 

 

RELATED TOPICS:

Local Service Inquiry Request

Local Service Information API Setup