Use rest api in airwatch


#1

Hi,

I would like to start using rest api for an AirWatch 9.2.1 on prem installation . I know a little about Javascript and some nodeJS and I think (hope) it should be enough to write some simple scripts. Unlikely I really don’t know where to start.
Could someone make an example of how to authenticate via rest api and make some simple queries, like the list of all devices?

Thank you in advance
Giorgio


#3

Hi Giorgio,
You might find useful this URLs to VMware publicly available examples :
https://github.com/vmwarecode/Execute-AirWatch-Rest-API-Call/blob/master/Execute-AWRestAPI.ps1

https://code.vmware.com/samples?categories=Sample&sort=dateDesc&keywords=&tags=AirWatch&groups=&filters=&page=

this is the url to pdf with REST API guide
https://docs.vmware.com/en/VMware-AirWatch/9.1/REST%20API%209_1.pdf

VMware stopped creating those from v9.2, instead you can access online API documentation via URL
https://<Airwatch_server_URL>/api/help


#4

Hi Greg,

thank you for the reply!
With te examples I managed to make first queries, but I found a behavior that may need some modifies on AirWatch: when I query https://aw_server/api/mdm/devices/search I get a json of just 500 devices, even if devices registered on AW are more than 1500…

Do you know if there is a global variable to edit in order to raise the limit of devices per query, or something like that?

Really thank you again
Giorgio


#5

Hi,

you can try this /api/mdm/devices/search?pagesize=10000


#6

Thank you, this solved!