Posted on 05-19-2020 09:18 AM
Hello,
I'm trying to use the DELETE API in the JAMF School API but without success. What am I doing wrong ?
curl -X DELETE -H "Accept:application/json" -H "X-Server-Protocol-Version: 3" -H "Authorization: Basic xxxxxxxx" https://apiv6.zuludesk.com/users/:3801107
{"code":404,"message":"UserNotFound"}
curl -X DELETE -H "Accept:application/json" -H "X-Server-Protocol-Version: 3" -H "Authorization: Basic xxxxxxx" https://apiv6.zuludesk.com/users/3801107
{"code":404,"message":"UserNotFound"}
Thank you,
Antonio
Posted on 05-19-2020 09:23 AM
Forgot to mention that the user 3801107 exists in our JAMF School database :)
Posted on 05-19-2020 09:49 AM
Hi @asaraca,
The:
https://apiv6.zuludesk.com/users/3801107
May need to be:
https://apiv6.zuludesk.com/JSSResource/users/id/3801107
Or if 3801107 it is the name:
https://apiv6.zuludesk.com/JSSResource/users/name/3801107
Also, I know json and Jamf's Api integration can sometimes get tricky
@iMatthewCM Has a great set of jamf API scripts on his Github
Posted on 05-20-2020 10:05 AM
Still not working :(
curl -X DELETE -H "Accept:application/json" -H "X-Server-Protocol-Version: 3" -H "Authorization: Basic xxxx" https://apiv6.zuludesk.com/JSSResource/users/name/3801107
{"error":{"code":404,"message":"Not found"}}
curl -X DELETE -H "Accept:application/json" -H "X-Server-Protocol-Version: 3" -H "Authorization: Basic xxxx" https://apiv6.zuludesk.com/JSSResource/users/id/3801107
{"error":{"code":404,"message":"Not found"}}
Posted on 05-20-2020 11:49 AM
In it's simplest form, this should work:
curl -sku "Username":"Password" "https://apiv6.zuludesk.com/JSSResource/users/id/3801107" -X DELETE
If you need to use with base64 authorization:
curl -sk -H 'authorization: Basic xxxxxxx' "https://apiv6.zuludesk.com/JSSResource/users/id/3801107" -X DELETE
There are some great Jamf API videos online including:
Getting Started With the Jamf API Part 1 – Kitzy
Posted on 05-21-2020 12:41 PM
It still doesn't work. The problem I think is that we are using JAMF School and not JAMF Pro and the API don't seem to work the same way :(
Posted on 05-21-2020 01:51 PM
Using https://apiv6.zuludesk.com/docs/#api-Users-Delete as a reference
Your curl command should look like:
curl -X DELETE "https://api.zuludesk.com/users/:id" --header "Content-Type: application/x-www-form-urlencoded; charset=utf-8" --header "Authorization: Basic xxxxx"
Does it work if you add the Content-Type to the header?
Posted on 06-05-2023 10:38 PM
@afarnsworth Kindly let me know what's that content-type? As I'm getting below error message when I use Delete parameter in curl.
Posted on 05-25-2020 04:26 AM
Sadly no, I still have the "user not found" error.
Posted on 05-25-2020 10:26 AM
Finally I found the error: the id is not the id in the JAMF School web interface, but the id returned by the API.
Posted on 05-27-2020 08:47 AM
I don't know why but I am facing a similar kind of issue with the API.