Workspace ONE, Postman and API Custom Commands
By George Gonzalez
- 2 minutes read - 357 wordsWhen using Workspace ONE for modern management of macOS devices, most of the time I live in the UI, but once in a while it makes sense to just use the API.
You can use any method, from PowerShell in Windows to the terminal, but for this example I’ll use Postman , you can check out my post for more of my commonly used tools.
I won’t go into the process of downloading and setting up Postman or creating the necessary permissions for an API account on your WS1 instance. There are some good articles out there on the topic and I will link them at the bottom of this post.
These instructions assume that you have already set up your environment and Postman with the appropriate Tenant Code, API credentials and have set up the API account with the correct permissions.
Once this is set up and you can submit queries and receive data from your Workspace ONE tenant, then you can proceed testing Custom Commands. In this case we will send a custom command that will schedule a software update on a DEP enrolled mac.
The body of the post should look something like this, although you would need to change the Product Key, Version, Deferrals and other details to fit your needs.
The API request type is POST:
https://servername.awmdm.com/AP1/mdm/devices/DEVICEIDGOESHERE/commands?command=CustomMdmCommand
The body should be set to raw and JSON
Headers should look similar to this, remembering to set the Content-Type to application/json
If the command is successful you will see a “202 Accepted”
Once the command is sent you can check the Troubleshooting and\or Commands details in the UEM console for the device ID.
Opening the Event Data gives more details on the OS update.
On the client side, once the MDM Command is processed the update prompt should appear as follows:
And that is all there is to it!
If you need to issue the command to a group of devices then instead of entering a DEVICEID in the POST you can replace with a variable and run it as a collection.
References:
Using Postman to Execute REST API calls