need help with a script. need to wipe an iPad from the API

Contributor II

OK. here's the situation. we are 1:1 with student iPads at the high school level. we replaced the older student 1:1 devices and are in the process of repurposing the old one to be used on carts in the elementary schools. for the most part they have all been wiped and are good to go, however every so often one pops up that has not been wiped yet.

my goal is to have a self service policy that asks for the serial number and then runs a script that issues the remote wipe command via the API, and then just let DEP configure the device.

i just don't know the API command

any ideas?


New Contributor II

I wrote this proof of concept for sending remote wipes to macOS devices. It uses the API and should give you an idea of where to start:
You could probably adapt it to iOS devices, but the key command is:
https://' server '/JSSResource/computercommands/command/' command '/passcode/' passcode '/id/' + computerid
This is the article I used to learn about the API:

Hope that helps!