DRTrack Users API
Contents
The DRTrack Users API is a RESTful service for managing DRTrack users and user access across multiple branches. It supports adding new users, modifying existing user details and permissions, and deleting users as needed.
Authentication
Authentication relies on JSON Web Tokens (JWT). Follow the instructions below to retrieve the JWT token, which can then be used to access all of this API’s endpoints.
The URL for the Access Token API is (APIPath):
https://<server_name>/api/v1.0/auth
The server name is your company’s unique url for accessing DRTrack. (e.g., christrucking.dev.appiantesting.com
)
Authentication request
To obtain an authentication token, you must use the HTTP GET method.
Headers
You must include these fields in the request header:
Field | Description | Data type |
---|---|---|
username
| The name created by your DRTrack admin when opening the web service account. |
string |
password
| The password created by your DRTrack admin when opening the web service account. |
string |
appName
| This is a placeholder that can be any string, usually the company name. |
string |
Sample Authentication Request
{
"description": "This is a representation of the request. In your client, make a GET request to the URL and provide username, password, and appName as HTTP headers.",
"request": {
"method": "GET",
"url": "https://<server_name>/api/v1.0/auth",
"headers": {
"username": "user1",
"password": "password",
"appName": "app1"
}
}
}
Sample Authentication Response
The general form of the response body is:
{
"AuthenticationToken": "<authToken>",
"Status": "<status>"
}
Field | Description | Data type |
---|---|---|
AuthenticationToken
| The authToken that can subsequently be used in the HTTP request header of DRTrack User API endpoints.
|
string |
Status
| The HTTP status code of the token request |
string |
Endpoints
GET /users
Get all users across all branches in your DRTrack site.
Resource URL
https://<server_name>/api/v1.0/users
The server name is your company’s unique url for accessing DRTrack. (e.g., christrucking.dev.appiantesting.com
)
Headers
You must include this line in the request header:
Authtoken: {authentication token returned by your GET authentication call}
Request
No request body JSON is required.
Sample Response
Returns a JSON object listing all users across all branches in your DRTrack site.
[
{
"key": 4002,
"userID": "dwalker",
"firstName": "David",
"lastName": "Walker",
"email": "David_Walker@company.com",
"encrypted": 1,
"tokenExpires": 0
},
{
"key": 701,
"userID": "nwilliams",
"firstName": "Nick",
"lastName": "Williams",
"email": "Nick_Williams@company.com",
"encrypted": 1,
"tokenExpires": 0
}
]
PUT /users/sync
Add, modify, or delete specific users in your DRTrack site.
Resource URL
https://<server_name>/api/v1.0/users/sync
The server name is your company’s unique url for accessing DRTrack. (e.g., christrucking.dev.appiantesting.com
)
Headers
You must include this line in the request header:
Authtoken: {authentication token returned by your GET authentication call}
Request Body
The general form of a Sync Users object is:
[
{
"method" : "ADD",
"branchIds" : "101|102",
"firstName": "John",
"lastName": "Doe",
"userLoginId": "jdoe",
"userGroup": "Admin"
},
{
"method" : "MODIFY",
"branchIds" : "103",
"firstName": "Jane",
"lastName": "Smith",
"userLoginId": "jsmith",
"userGroup": "User"
},
{
"method" : "DELETE",
"branchIds" : "104",
"firstName": "Bob",
"lastName": "Brown",
"userLoginId": "bbrown",
"userGroup": "Guest"
}
]
Sync Users Fields
Field | Description | Data type |
---|---|---|
method
| The method to be called: ADD, MODIFY, or DELETE |
string |
branchIds
| Branches whose access will be modified; branches should be separated with a pipe (|) |
string |
firstName
| Name to add/update user’s first name |
string |
lastName
| Name to add/update the user’s last name |
string |
email
| Email to add/update the user’s email |
string |
userPassword
| Password to add for a new user |
string |
userLoginId
| Login ID to add for a new user |
string |
groupId
| Group ID to add/update the user’s group ID |
int |
userGroup
| userGroup to add/update the user’s user group |
string |
Response
The API returns true if the sync operation was successful otherwise it returns false.