Per Device Licensing not returning all license data

CBurkhead
Building a reputation

Per Device Licensing not returning all license data

I am working with the  /organizations/{organizationId}/licenses endpoint to retrieve the licenses for a number of organizations and then match them up, based on serial number, with the inventory of the organization to track license expiration dates and devices that need licenses. The script is written and seems to be working for the most part. I am running into the following, which seems a bit odd.

 

For one organization, the number of records being returned by the licenses endpoint in 1204. The number of records being returned by the organization inventory is 1206. When my script is done, most of the devices have the license expiration date, or are just in inventory, so there is no date. I do have 36 records that come back with no license found. When I look in the dashboard at the license information, a number of these devices come up with a license expiration date.

 

Just for fun, I did a test where I made the same API call to /organizations/{organizationId}/licenses, but included the "deviceSerial" parameter and gave it a serial # that I was seeing as having a license in the dashboard, but did not have one from my script run. It came back with the license record, just fine. I then dumped all of the licenses from my normal API call to a file and searched for the serial number, just to make sure that there was not a problem with my search in the script. The serial number was not in the file.

 

So, it seems that when you make a normal API call to /organizations/{organizationId}/licenses (I am passing the perPage as 1000, BTW) it may not be returning all of the license information. Specifying the serial number in the call will return the license record, if there is one. Has anyone run into the same problem or something similar?

 

Another piece of information, this is a Python script making REST calls. I am not using the SDK. The organizations being looked at do have the per device licensing.

2 REPLIES 2
BrechtSchamp
Kind of a big deal

Interesting. Maybe @Melissa can have someone look into this and reach out to you?

CBurkhead
Building a reputation

That would be fantastic. I have added code to my script so that if the serial number can't be matched up from the full organization license list, it makes the call again with the specific serial number I am looking for. This has fixed most of the not found licenses. The remaining issues seem to mostly be around licenses that I know are about to expire (in the next 2 or so weeks). They are not appearing in the data from the API, but are in the dashboard.

 

I was also playing around with specifying the license state in the API call to see if that helped. Right now, if I specify "active", I get an error 500. I have been able to get data back when I tried the "unusedActive" state. Calling the endpoint without specifying the state does return licenses with different states.

Get notified when there are additional replies to this discussion.