Citrix Endpoint Management has a robust REST API that can help with your automation efforts with your endpoints. What’s a practical use case?

Before we take a deep dive here, I’d recommend reading our API documentation. It breaks down our supported REST APIs in great detail.

Now let’s cover the use case!

Use Device ID to Get a Device’s Last Location

GPS tracking of fully managed devices is common for logistics companies and their proprietary applications. You can use the following APIs to automate device locations to identify specific delivery or service-personnel locations.

Begin by getting devices by filters.

URL: https://hostname:4443/xenmobile/api/v1/device/filter/v2
Request type: POST
Request header:

  • Auth_token: auth token obtained during login
  • Content type: application/json

This sample request will list devices of a given user displaying the device ID. You can use the “search” to search for the username.

{
“start”: “0”,
“limit”: “10”,
“sortOrder”: “ASC”,
“sortColumn”: “ID”,
“search”: “Johnathan”,
“enableCount”: “false”
}

And here’s the response from my environment.

We can now leverage the results of the request to get the device’s last location with another API call. Your application can use the get device last location by device ID API to list the device location.

The API details are as follows:

URL: https://hostname:4443/xenmobile/api/v1/device/lastLocation/{deviceId}
Request type: GET Page
Request header:

  • Auth_token: auth token obtained during login
  • Content type: application/json

And here’s the sample response showing the device coordinates:

{
“status”: 0,
“message”: “Success”,
“deviceCoordinate”: {
“longitude”: 2.43398027,
“latitude”: 48.64588589,
“accuracy”: 0.0,
“gpsTimestamp”: 1472226743000
}
}

Here the example URL from my environment based on the device ID: https://hostname:4443/xenmobile/api/v1/device/lastLocation/185.

And here’s the response:

Companies and software vendors can use this information for a wide array of use cases, from package tracking to locating service personnel.

With Citrix Endpoint Management automation is a breeze with the flexible APIs offered and the solution’s overall capabilities. Companies can take advantage of these great features and drive innovation to serve their business needs.