POST /login |
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.
The Request body is a JSON object with the following members:
Member | Type | Purpose |
---|---|---|
username | string | 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". |
password | string | 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.
Name | Value | Description |
---|---|---|
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 |
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 |
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. |