Skip to main content
Question

Delay time after POST or DELETE api calls

  • August 21, 2024
  • 3 replies
  • 27 views

Forum|alt.badge.img+3

Hello community.

When I create or delete something on my Jamf site through api call (for example, creating a new policy with  POST on "/JSSResource/policies/id/-1"), I am getting a successful response with code 200 and the newly created policy's id.
Then, I am trying to fetch all policies from my Jamf site (GET on "
/JSSResource/policies"), but the response does not contain the newly created policy. 

Should I wait for few seconds before I fetch my policies and check if the creation succeeded? (Since I am running a code that does it I need to know how much sleep time I should add). Are there a different solution than doing busy waiting?

All I wrote I experience for DELETE requests as well.

Thanks in advance 

3 replies

talkingmoose
Forum|alt.badge.img+36
  • Community Manager
  • August 21, 2024

If you're using Jamf Cloud, it has multiple servers. You're likely changing one and the other hasn't synchronized yet. Usually takes a minute or less.


Forum|alt.badge.img+3
  • Author
  • New Contributor
  • August 25, 2024

@talkingmoose Thanks.
Is there a query I can do to know when the servers are synced? 
Is there a way to know if a set of API calls are going to be resolved on different server?


talkingmoose
Forum|alt.badge.img+36
  • Community Manager
  • August 26, 2024

@talkingmoose Thanks.
Is there a query I can do to know when the servers are synced? 
Is there a way to know if a set of API calls are going to be resolved on different server?


There's no way to tell other than to refresh the page.

It's usually less than a minute. You could build in a sleep command to wait, if it's becoming a problem for you.