Skip to main content
Question

Unable to use DELETE function in JAMF School API


Forum|alt.badge.img+3

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

10 replies

Forum|alt.badge.img+3
  • Author
  • New Contributor
  • 5 replies
  • May 19, 2020

Forgot to mention that the user 3801107 exists in our JAMF School database :)


Forum|alt.badge.img+9
  • Contributor
  • 154 replies
  • May 19, 2020

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


Forum|alt.badge.img+3
  • Author
  • New Contributor
  • 5 replies
  • May 20, 2020

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"}}


Forum|alt.badge.img+9
  • Contributor
  • 154 replies
  • May 20, 2020

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

Hands on with the Jamf Pro API Part 1


Forum|alt.badge.img+3
  • Author
  • New Contributor
  • 5 replies
  • May 21, 2020

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 :(


afarnsworth
Forum|alt.badge.img+8
  • Contributor
  • 46 replies
  • May 21, 2020

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?


Forum|alt.badge.img+3
  • Author
  • New Contributor
  • 5 replies
  • May 25, 2020

Sadly no, I still have the "user not found" error.


Forum|alt.badge.img+3
  • Author
  • New Contributor
  • 5 replies
  • May 25, 2020

Finally I found the error: the id is not the id in the JAMF School web interface, but the id returned by the API.


Forum|alt.badge.img
  • New Contributor
  • 1 reply
  • May 27, 2020

I don't know why but I am facing a similar kind of issue with the API.


Forum|alt.badge.img+5
  • Contributor
  • 64 replies
  • June 6, 2023
afarnsworth wrote:

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?


@afarnsworth Kindly let me know what's that content-type? As I'm getting below error message when I use Delete parameter in curl.

 

 


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings