Skip to main content
Question

API for Asset Tag

  • June 9, 2020
  • 3 replies
  • 46 views

Forum|alt.badge.img+3

I a building a custom mobile app for our team to be able to add a location based on the mobile devices asset tag.

I have looked at the api, and I have found a way to update the location of a device using the serial number.

Is there a way, beside doing a loop through each device to set a location based on a mobile devices asset tag?

There will basically be 2 fields to this app, one where an asset tag is put in, and one where the location will be put in.

3 replies

Forum|alt.badge.img+19
  • Honored Contributor
  • 582 replies
  • June 9, 2020

You will need to search for the Asset Tag, get the Mobile Device ID from the result, and then use ID update the Location using the ID:

<<Jamf_URL>>/JSSResource/mobiledevices/match/<<ASSET_TAG>> will return the mobile device with that tag (assuming there is one). Grab the ID and then use /JSSResource/mobiledevice/id/<<ID>> to PUT the location.


Forum|alt.badge.img+3
  • Author
  • New Contributor
  • 2 replies
  • June 17, 2020

@RBlount So when i do the Put... is it going in as a JSON? This is an iOS application and it does not seem to take in the JSON object.


Forum|alt.badge.img+19
  • Honored Contributor
  • 582 replies
  • June 17, 2020

@BND10706 , not JSON, has to be XML for the classic API (which this call uses). Try using this XML:

'<mobile_device><general><asset_tag>12345</asset_tag></general></mobile_device>'