Hi
We want to subscribe distribution groups to components. How do we go about this? Can we do this from the back end or do we need to go to the actual statuspage and click the "Subscribe" button next to the component and enter the email address?
Thanks
Asher
Hi @Asher Francis , it's Dave from Statuspage. The reason you don't see the API endpoint that Carmen refers to is that it was deprecated recently (see our post about abuse mitigation for details).
Instead, you should use our authenticated API, which provides an endpoint for create subscribers. Here are the docs for that endpoint:
https://developer.statuspage.io/#operation/postPagesPageIdSubscribers
So you'd be doing a POST to this URL:
https://api.statuspage.io/v1/pages/PAGE_ID/subscribers
(Be sure to replace the PAGE_ID with the alphanumeric ID for your page.)
You can specify a list of components to subscribe in the body of the request. Here's an example body:
{
"subscriber": {
"email": "dave@example.com",
"component_ids": [ "COMPONENT_ID_1", "COMPONENT_ID_1" ]
}
}
The COMPONENT_ID values should of course be replaced by the alphanumeric IDs for the components in question.
If you want to update the list of subscribed components for an existing subscriber, you can do a PATCH for that specific subscriber, as described here:
https://developer.statuspage.io/#operation/patchPagesPageIdSubscribersSubscriberId
Hope this helps!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Asher,
You can do this with the API.
There is a conversation in the community regarding this question
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Carmen
Thanks for this and for your answer on my other question
Unfortunately the suggestion in this article doesn't work - going to /api on my statuspage, there is no option for subscribers
Ideally, we'd like to silently subscribe distribution groups to components
Can you provide any more information on this?
We're also on the business subscription
Thanks
Asher
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi again,
It worked for us. We use this for each subscriber:
PATCH https://api.statuspage.io/v1/{page_id}/subscribers/{subscriber_id}
and send to the page the jason file with the list of components for this subscriber
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Carmen
Thanks for this.
This assumes that users are already subscribed. How would we add subscribers from the API?
Thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Asher,
We have automated the creation of a subscriber list (a csv file) from our active directory.
With one of the API we download our page's subscribers and put them in a second list.
We compare the 2 lists and if there is an email from our active directory csv file that is missing from the pages's subscribers list, we subscribe those.
It allows us to automate the subscription of any new employe
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.