I'd like to remove a component from its group via the API. I'm trying to do this by using PATCH on the specific component's URL. Here's the cUrl I'm trying:
curl -v https://api.statuspage.io/v1/pages/$PAGE_ID/components/$COMPONENT_ID \
-H "Authorization: OAuth $STATUSPAGE_AUTH_TOKEN" \
-X PATCH \
-H "Content-Type: application/json" \
-d '{"component":{"group_id":null}}'
However, this gives the following error:
{"error":"Couldn't find GroupComponent"}
I also tried setting the `group_id` to `""` but that gave the same result. What do I actually need to do to achieve this?
I'd like to avoid using the component-groups/ API methods if possible as this way is more convenient. You can set a component's group in the UI page for that particular component so I don't see why the API should be any different.
Hi @Luke Murray ,
Happy to help!
The endpoint you've shown is for components, but you will need to the component-groups endpoint shown here https://developer.statuspage.io/#operation/patchPagesPageIdComponentGroupsId in order to remove the components. This command will essentially "overwrite" the original group contents so that it will contain the components you list in the command.
Please let me know if that was what you were looking for!
Thank you,
Shivam
Disappointing you can't do it that way but I can see why you can't.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
That's feedback I can pass along to our Engineering team; it is a bit confusing choosing the right endpoint for this particular task, but since this is related to Groups specifically vs individual components, that former endpoint will be the one to use as a means of changing the groups themselves.
Please let us know if you have any follow up questions!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.