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

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,556,161
Community Members
 
Community Events
184
Community Groups

How to get policy ID

Edited

Hello all,

I'm trying to setup a MW via Rest API https://docs.opsgenie.com/docs/maintenance-api

My problem is that I have no idea were to find the Policy ID. I've tried to look in Global Policies via the web interface but the IDs are not listed.

Creating a policy using https://docs.opsgenie.com/docs/alert-and-notification-policy-api to get the ID also doesn't work. I get "code":40301,"message":"You are not authorized to use policies!" with an api key that has full access.

Thank you in advance!

Adrian

1 answer

1 accepted

0 votes
Answer accepted
Chris DeGidio
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
Jul 12, 2021

Hi Adrian,

I hope this answer finds you well! You can get the id's of policies via the API as well. This endpoint would be documented here: https://docs.opsgenie.com/docs/alert-and-notification-policy-api#list-alert-policies

Please let us know if you have any further questions or concerns. Thanks so much

Regards,

Chris

Hi Chris,

Thanks for answering.

I've tried to get the alerts and but receive this error:

"code":40301,"message":"Api key is not authorized to create global policies. Assigned team id is: [bf2e9e67-......]"

I also tried notifications and nothing is returned.

Please see attached a screenshot with the permissions.Screen Shot 2021-07-13 at 14.57.51.png

Regards,

Adrian

Chris DeGidio
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
Jul 13, 2021

Hi Adrian,

Could you attempt using a Global API integration key to make the call and let me know how that goes? 

You can gather that from Settings >> Integrations list/Integrations and navigating to the default api integration. 

The API key management key has access to certain API endpoints mentioned here https://support.atlassian.com/opsgenie/docs/api-key-management/

The main purpose of usage for these API keys is configuration based API requests. They can be used for configuration requests, some Alert API requests like Get Alert, List Alerts, and Incident API requests. Only Create Alert, Acknowledge Alert, Close Alert, and Add Note to Alert API requests are blocked for these API keys.


Please let us know if you have any further questions or concerns.

Hi Chris,

Now I understand that I have a limited account and only admins can create an API key for global integrations. The API key that I'm using is a team integrations key.

Thanks again for you help.

Regards,

Adrian

Suggest an answer

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

Atlassian Community Events