GetAuthentication Token
Contents
DRTrack Web Services includes a full of set of APIs for data regarding orders, accounts, and route information. A unique URL is provided for each customer to access the service. Please contact if you are a current DRTrack customer and don’t know your company’s unique URL.
The GetAuthenticationToken
API validates User identification info with our Billing and Licensing system. It returns a token that is valid for 24 hours and can be used for all requests within that timeframe.
Testing the Service
To test the DRTrack service, you will need to create a client and use it to call the service.
class Test
{
static void Main()
{
DRTrackWebServiceClient client = new DRTrackWebServiceClient();
// Use the 'client' variable to call operations on the service.
// Always close the client.
client.Close();
}
Authentication
Each API call must include an authentication token.
GetAuthenticationToken Request Parameters
Name | Description | Type |
---|---|---|
username
| The username for the account. |
string |
password
| The password for the account. |
string |
applicationName
| The name of the Trimble Maps application. (e.g. DRTrack) |
string |
Note: Please contact if you are a current DRTrack customer and you don’t know these required parameters.
Sample GetAuthenticationToken Method
public string token { get; set; }
public Authentication GetAuthenticationObj()
{
AuthenticationResponseEnvelope response = wc.GetAuthenticationToken("username", "password", "applicationName");
if (response != null && response.authenticationField != null)
{
MyToken = response.authenticationField.authenticationTokenField;
if (response.responseStatusField != null && response.responseStatusField.errorField != null)
{
var error = response.responseStatusField.errorField.FirstOrDefault();
if (error != null)
{
MessageBox.Show(error.codeField + error.messageField);
}
}
}
return new Authentication
{
authenticationTokenField = MyToken
};
}
Sample XML Request
<?xml version="1.0" encoding="utf-8"?>
<GetAuthenticationToken xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance>
<username></username>
<password></password>
<applicationName><applicationName>
</GetAuthenticationToken>
Sample XML Response
<?xml version="1.0" encoding="utf-8"?>
<AuthenticationResponseEnvelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<ExtensionData />
<authenticationField>
<ExtensionData />
<authenticationTokenField>DEV-Test-20170310040431-RI86TW</authenticationTokenField>
</authenticationField>
</AuthenticationResponseEnvelope>