EraseDevice API

steviethetv
New Contributor III

Has anyone had success with the EraseDevice API call?
I have the shell command:

/usr/bin/curl --silent --show-error --connect-timeout 30 --request POST --user "username":"password" "https://site.jamfcloud.com/JSSResource/computercommands/command/EraseDevice/passcode/123456/id/#"

but I keep receiving the error:

<html>
<head>
   <title>Status page</title>
</head>
<body style="font-family: sans-serif;">
<p style="font-size: 1.2em;font-weight: bold;margin: 1em 0px;">Unauthorized</p>
<p>The request requires user authentication</p>
<p>You can get technical details <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.2">here</a>.<br>
Please continue your visit at our <a href="/">home page</a>.
</p>
</body>
</html>

The user account making that API call has read, update, and delete permissions on the JSS Object, Computers, and it has the JSS Action, Send Computer Remote Wipe Command.

Does anyone have any suggestions on how to get this command to work or can share how you make the API call to wipe a device?

2 ACCEPTED SOLUTIONS

brad
Contributor

Hi @stevesmith ,

I am able to run that command and it posts as expected. I needed to give the API account Create access on computers and Allow for sending the remote wipe. I see you have Read, Update, and Delete. Adding Create should do the trick.

Good luck!

-Brad

View solution in original post

steviethetv
New Contributor III

Yup, that worked. From Jamf Support:

This is a known Product Issue affecting v9.98 and v9.99. The Product Issue, trackable as PI-003795, results in requests made with the 'computercommands' resource failing unless the user specified for authentication has the 'create' permission for computer objects. The user can perform the same action within the GUI fine but it will fail via the API.

View solution in original post

2 REPLIES 2

brad
Contributor

Hi @stevesmith ,

I am able to run that command and it posts as expected. I needed to give the API account Create access on computers and Allow for sending the remote wipe. I see you have Read, Update, and Delete. Adding Create should do the trick.

Good luck!

-Brad

steviethetv
New Contributor III

Yup, that worked. From Jamf Support:

This is a known Product Issue affecting v9.98 and v9.99. The Product Issue, trackable as PI-003795, results in requests made with the 'computercommands' resource failing unless the user specified for authentication has the 'create' permission for computer objects. The user can perform the same action within the GUI fine but it will fail via the API.