AssetTrack Upload API
Overview
AssetTrack provides an API allowing data to be sent into AssetTrack through the AssetTrack Queue. It enables programmatic feeding of data to AssetTrack from other systems such as auto-discovery, active directory or others, which is then validated and published to the configured database target the same as if collected via an AssetTrack Mobile device or web form.
Licensing
The AssetTrack Upload API is licensed as a separate module which can be installed on top of an existing AssetTrack Server. Contact sales@amitracks.com for pricing information.
Usage
First, define an AssetTrack Upload form that contains the data fields expected by the upload. Upload forms can be configured and protected via permissions the same as any AssetTrack form.
Next, write a program that performs the following steps:
- Authenticates against the API, receiving a cookie value that will be used to authenticate the upload calls to the API.
- Creates a formatted JSON object that represents the Upload form data and posts the it to the correct API end point.
Methods
Please note the following that is true for calling AssetTrack API end points:
- The paths specified assume a default installation of the API, which creates a virtual directory, /AssetTrackApi. If you have customized the installation to a different root directory, change the endpoint paths accordingly.
- When posting JSON arguments to an API end point, the following should be true:
- The JSON should be added to the BODY of the HTTP request.
- Add the header, "Content-Type: application/json"
Login
Endpoint | /AssetTrackApi/api/login | ||||||||||
HTTP method | POST | ||||||||||
JSON argument | { | ||||||||||
Response | Successful Auth:
Unsuccessful Auth:
|
Upload forms data submission
Endpoint | /AssetTrackApi/api/TaskData/DelimitedData | ||||
HTTP method | POST | ||||
JSON argument | { // An array of string values specifying the column headers contained in the // An array of string arrays representing the row data. One string array for each row, | ||||
Response | Successful:
|
Sample App
A sample Windows application, written in C#, is provided here showing how to submit data to AssetTrack using the upload API.