0

I want to fetch versionName of all app/product deployed to AirWatch, using Airwatch api's but I am not sure if any API available for that or not.

I searched in document but I am not able to find any api name. Can anyone tell me service name to get versions of android application.

Edit1: Below calls not returning any data. am I missing something

https://host/api/mdm/devices/apps?searchby=idTest&id=1520&pageTest=1
https:host/api/mdm/devices/1520/apps?page={page}&pagesize=1

This way calling other services and working

"https://host/api/mdm/devices?searchby=Serialnumber&id=jjjQA7AL"

Edit2: When I am using URI

https://host/api/mdm/devices/apps?searchby=Serialnumber&id=R10QA7AL&page=1&pagesize=1

Getting kind of sample data(not related to my products)

{"DeviceApps":[{"ApplicationName":"Amazon Kindle","Version":"8.21.1.0","BuildVersion":"","Status":2,"Size":"122252286","ApplicationIdentifier":"com.amazon.kindle","Type":"System","IsManaged":false}],"Page":1,"PageSize":1,"Total":61}
R15
  • 13,982
  • 14
  • 97
  • 173

1 Answers1

2

Functionality: Retrieves the detail s of the applications that are present on the device.

APIURI–https://host/api/mdm/devices/{id}/apps?page={page}&pagesize={pagesize}

With the above API, you can get various information about the Apps that are installed on the device. You can refer to Chapter 6 of the Document specifically page 361-363

Edit-1

example: https://host/api/mdm/devices/apps?searchby=Serialnumber&id=R10QA7AL&page=1&pagesize=50

Edit-2

You can use any of the following option in searchby parameter

Macaddress,Udid,Serialnumber,ImeiNumber

examples:

https://host/api/mdm/devices/apps?searchby=Serialnumber&id=R10QA7AL&page=1&pagesize=50
https://host/api/mdm/devices/apps?searchby=ImeiNumber&id=YourID&page=1&pagesize=50
https://host/api/mdm/devices/apps?searchby=Udid&id=YourID&page=1&pagesize=50
https://host/api/mdm/devices/apps?searchby=Macaddress&id=YourID&page=1&pagesize=50

Edit:3 If you want to get all pages or all apps, remove page and pagesize params. like this

https://host/api/mdm/devices/apps?searchby=Serialnumber&id=R10QA7AL
R15
  • 13,982
  • 14
  • 97
  • 173
Sahil Manchanda
  • 9,812
  • 4
  • 39
  • 89
  • Thanks for your answer. I will try it. I can't seen images in my m/c as URL restricted. – R15 Sep 03 '19 at 07:04
  • @r15 np, just go to the document as mentioned in the answer :) – Sahil Manchanda Sep 03 '19 at 07:06
  • I have tried first api and alternate api but both are not returning any result. Seems I am not calling those in proper way. Can you please check updated question where I am showing how I am calling services. Thank you. – R15 Sep 04 '19 at 06:11
  • APIURI you have given could you please format it with dummy values. – R15 Sep 04 '19 at 06:21
  • @r15, please check added an example – Sahil Manchanda Sep 04 '19 at 06:43
  • When I am using above code service calling successfully but getting kind dummy data(not related to my products). One more option we can have by using `id` (instead of serialNo) if we use given `APIURI`. I have `id` value can you please give my sample URI of your `APIURI` by using dummy value. Please check edited question. Thank you. – R15 Sep 04 '19 at 07:46
  • @r15, I've included all the possible combinations that are possible using searchby parameter – Sahil Manchanda Sep 04 '19 at 07:58
  • Thank you so much. You have given example only of alternate api not the main one which using `id` from document. However I am checking these combination first. – R15 Sep 04 '19 at 08:01
  • @r15, I used the alternate api because the same pattern worked for you as you've mentioned in Edit-1 and secondly it provides more flexibility – Sahil Manchanda Sep 04 '19 at 08:03
  • @r15, question: the json response you posted in your questions says 61 pages, did you check all the 61 Apps information? – Sahil Manchanda Sep 04 '19 at 09:05
  • I have checked all pages. This is giving all application installed in my mobile along with versionName(upto here fine. I can filter apps I need or deployed to airwatch server) but the problem is few as are 'failed to install' I need to get version of those apps too to append(suffix) version with app names in product/app list. I am trying to check with other combinations too. I have no idea how page size I should Pass because 61 getting after calling api not before. Thank you. – R15 Sep 04 '19 at 09:31
  • @r15, you can try asking a separate question for getting "failed to install" details, as it's kinda separate issue from this one. And try putting all the relevant info their with what you are getting and what you want – Sahil Manchanda Sep 04 '19 at 09:36
  • I am facing issue. How can I get all apps. If I pass page 61 I am not getting any apps. If I pass 60 some apps are coming. Out of 61 apps, My apps are 10+. in device. If you have idea Can you please tell me how to solve this issue. What page size should I send. Clients have different devices and mobiles. Thank you. – R15 Sep 04 '19 at 10:35
  • @r15 you can try setting pagesize to any arbitrarily large number say 150 to get all the apps in one request. – Sahil Manchanda Sep 04 '19 at 10:47
  • When I am exceeding given size result getting 0 records. Can you please have look on page 361 deprecated APIS. Can I use it. – R15 Sep 04 '19 at 12:29
  • @r15, usage of deprecated APIs are discouraged always. You need to run pagination with small number of page size say 20. And if it doesn't match your expectation then you might need to contact the support team of VMWare. We've already done what is possible according to documentation. – Sahil Manchanda Sep 05 '19 at 04:36
  • Yeah I will check pagination too. I've tried _Serial Number_ deprecated API for just to see result, this way `https://host/api/mdm/devices/serialnumber/R10QA7AL/apps` but not working(returning: 404 not found). Am I setting values correctly? Thank you. – R15 Sep 05 '19 at 06:16
  • I have got all app of my device if I remove `page` and `pagesize` params. I couldn't have done w/o your help bro. Thank you. – R15 Sep 05 '19 at 12:01
  • @r15, glad you got it working. request you to accept my answer :) so that it may help others in the future. – Sahil Manchanda Sep 05 '19 at 18:03