Click or drag to resize
POST /login
Print this page
Description

This service is used to send user credentials to the server and to request an authentication token for further communication. The resulting token is then included in all subsequent requests, as described in Making REST service calls.

Request

The Request body is a JSON object with the following members:

MemberTypePurpose
usernamestring The username of the driver who is logging in. This value can be the driver's email address or a value in the form "company:user".
passwordstring The password of the driver who is logging in. This is sent in clear text, relying on the HTTPS transport to protect the data.

Optional parameters

By default, tokens expire in 24 hours, but you can specify the expiration that you want. All /login REST calls can use an optional parameter to set expiration.

NameValueDescription
expiry ISO 8601 timestamp Specifies the date-time when the credentials will expire, from 1 minute up to 1 year in the future. For example, this sets expiration to occur the last day of the year:
expiry=2014-12-31T12:59:59Z
If you set a value that is outside of this allowed range in the future, the server assigns the default value (24 hours). If you specify a value that is in the past, the server returns an authentication error. Note that you must specify this parameter in the request query string, not in the request JSON body.
expires integer Specifies how many seconds until the credentials will expire, from 1 minute up to 1 year in the future. For example, these set expiration to occur in 12 hours and 30 days, respectively:
expires=43200
expires=2592000
If you set expiration to fall outside of this allowed range in the future, the server assigns the default value (24 hours). If you specify a negative number, the server returns an authentication error. Note that you must specify this parameter in the request query string, not in the request JSON body.
Response

On successful authentication, the Response body is a LoginResponse object:

Member Type Purpose
token Guid The authentication token (GUID) to be included with subsequent template requests. Obtaining this indicates a successful log in.
customerName string (read-only) The name of the customer who was granted the token.
username string (read-only) The name of the user who was granted the token.
customerId int (read-only) The ID of the customer who was granted the token.
userId int (read-only) The ID of the user who was granted the token.
apiHost string (read-only) The host location to use for subsequent TDE requests.
If the request fails, an Error Response is generated.