You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Aside from the generic API (REST), GoAlert offers a GraphQL API.
In v0.33.0, API keys were "taken out of experimental state" (#3797). However, there seems to be almost no documentation around the GraphQL API / API keys.
Here's a few things I ran into trying to get started with the GraphQL API:
Given an API key, how does one authenticate? (Spoiler: Authorization: Bearer ...). Although the API key does look like a bearer token, the ambiguity causes confusion: Acknowledge alert API endpoint #3412 (comment)
When creating an API key, one has to select a 'Role', which can be 'User' or 'Admin'. What does that mean? I have found that when trying to do an UpdateAlertsMutation with an API key with the 'User' role, I simply get back 'unauthorized'. And it's up to the user to figure out what that means: wrong key? Wrong header? Wrong role?
), but most clients don't support that, plus I don't like clients relying on what is essentially an implementation detail (permissions error when client specifies the wrong query for the wrong API key vs the wrong query being executed because the client uses the wrong API key).
Aside from the generic API (REST), GoAlert offers a GraphQL API.
In v0.33.0, API keys were "taken out of experimental state" (#3797). However, there seems to be almost no documentation around the GraphQL API / API keys.
Here's a few things I ran into trying to get started with the GraphQL API:
Authorization: Bearer ...). Although the API key does look like a bearer token, the ambiguity causes confusion: Acknowledge alert API endpoint #3412 (comment)/api/graphql/explorewhich has a neat list (already documented here: Better key management for GQL API keys #4198). Someone ran into this here: How would I hit GoAlert's API to determine an on-call user's email address? #3839 (comment)UpdateAlertsMutationwith an API key with the 'User' role, I simply get back 'unauthorized'. And it's up to the user to figure out what that means: wrong key? Wrong header? Wrong role?4.1. For users unfamiliar with GraphQL, it might not be clear that a fixed query may contain variables. See this question here: Admin Ability to Create API Keys for Integration with External Systems #3007 (comment)
goalert/apikey/middleware.go
Line 37 in 29e4f6c
goalert/apikey/middleware.go
Line 24 in 29e4f6c