Posted on 06-09-2020 01:13 PM
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.
Posted on 06-09-2020 01:23 PM
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.
Posted on 06-17-2020 07:22 AM
@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.
Posted on 06-17-2020 01:27 PM
@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>'