Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Opsgenie automation

Hi,

I am trying to update a "rotation" under "schedule" using API call with no success.

I can GET/POST but cannot PATCH/PUT.

I get "Request method 'PATCH' not supported"

or

"Request method 'PUT' not supported"

 

This is the request I am trying to call:

curl -v -X PATCH \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: GenieKey <mykey>" \
-d '{
"name": "rotname",
"startDate": "2021-03-23T15:00:00Z",
"endDate": "2021-03-23T21:00:00Z",
"type": "daily",
"length": 1,
"participants": [
{
"type": "user",
"id": "<user-id>"
}
]
}
' "https://api.eu.opsgenie.com/v2/schedules/<schedule-id>/rotations/"

 

Hope you can help me.

2 answers

1 vote
Nick H
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
Mar 23, 2021

Hi @Daniel Wor ,

I think your URL is missing the ID of the rotation which is causing that response of PUT and PATCH not supported: https://docs.opsgenie.com/docs/schedule-rotation-api#update-schedule-rotation-partial

Below is a test of replacing User 1 with User 6 in my test schedule. Note that in my PATCH request I have the rotation ID in my URL so it looks something like: https://api.opsgenie.com/v2/schedules/:scheduleIdentifier/rotations/:id

rotapi1.jpgrotapi2.jpgrotapi3.jpgrotapi4.jpg

 

Hope this helps! Let us know if you have any additional questions, issues, etc.

@Daniel Wor ,

You can also do that using Lamp ( Lamp is a Go based command line utility to interact with Opsgenie service. It provides capabilities to create and close alerts, attach files, etc..)

See more: 

https://docs.opsgenie.com/docs/lamp-command-line-interface-for-opsgenie#update-schedule-rotation-command

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
TAGS
AUG Leaders

Atlassian Community Events