An interesting use case I had recently was to export all devices and their information, through API, from the Workspace One UEM console.
The reason for this was to import device data into ServiceNOW to be used within support tickets as well as asset information.
The first step is to find the API that we will need and setup the authentication.
Workspace One has an extensive list of APIs that can be leveraged. To find APIs and receive help, navigate to your https://WorkspaceOneUEMconsole.awmdm.com/api/help URL. ours is: https://cn.eucse.com/api/help/#!/apis
There’s a lot of useful information on getting started with your Workspace One UEM APIs. Read through the ‘Getting Started’ section for some useful tips and tricks.
To identify the APIs you require, navigate to the ‘APIs’ tab.
To export all device information from your console you’ll need: MDM (Mobile Device Management) REST API V2
The overview will tell you what this specific API is for:
“AirWatch REST APIs allows you to manage all the functionalities of Mobile Device Management (MDM). The functionalities that are included but not limited to are device commands, retrieval of compliance, profile, network, location, and event log details. As an administrator, you need to enable Devices admin role permissions in Accounts > Administrators > Roles page to access MDM functionalities through APIs.”
Navigate to ‘API Reference’ – This page will allow you to test API’s to make sure you’re ‘GET’ting or ‘POST’ing the correct information.
In order to begin, we’ll have to authenticate against our environment. Leave this page open and open another tab to your Workspace One UEM console. We’re now going to create a new Admin account and aw-tenant-code (REST API).
- Navigate to: Accounts->Administrators
- Click ‘List View’
- Add Admin
- Under roles, make sure your new admin has the role of Console administrator or AirWatch Administrator
Now that our admin is created, we need to add a new REST API entry, this will be referenced as aw-tenant-code when leveraging APIs.
Now navigate to: Groups&Settings->All Settings->System->Advanced->API->REST API
Click Add and create a new API with admin as the account type. Make a note of the API Key, we’ll need that for the aw-tenant-code.
Head back to the API reference tab.
Make sure the host and base URL are set correctly. For my environment, I have the following:
We now need to Authorise against the console.
Click on the Authorise button.
Scroll down to ‘Basic Authentication’
Add the Admin Username and password into the ‘Basic Authentication’ section and hit authorise.
Click back on Authorise again and add the the API key into the aw-tenant-code
Now that you’re authorised, you can scroll down and click ‘Try it out’.
This should then pull all the device information and display it in the response:
Success! You’ve leveraged an API to export the device information!
You can also use something like Postman to export the information, using the same information: