You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
Next: Root
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
The Atlassian Community can help you and your team get more value out of Atlassian products and practices.
Hello,
I heard there is a changes in the use of REST API.
・Upcoming changes to enforce pagination for Statuspage's authenticated REST API
https://community.atlassian.com/t5/Statuspage-articles/Upcoming-changes-to-enforce-pagination-for-Statuspage-s/ba-p/2089947
I'm saving a list of email addresses of all subscribers to a file with the following command.
curl https://api.statuspage.io/v1/pages/{page_id}/subscribers \
-H "Authorization: OAuth your-api-key-goes-here" \
-X GET |sed 's/"id"/\n/g' |awk -F\" '{print $12}' |grep -v ^$ > /tmp/subscriber_list.txt
but, Looking at the document below, I realized that from February 28, 2023,
I can no longer acquire all subscribers with the above command(It looks like that I can get subscribers up to 100)
Is my understanding correct?
If yes, how can I get a list of all subscribers?
・Get a list of subscribers
https://developer.statuspage.io/#operation/getPagesPageIdSubscribers
Thanks.
Hey there, Alan from the Statuspage support team here, thanks for reaching out with this question. There are many different ways to implement this, but essentially to get all page subscribers in the case that you have more than 100, some kind of recursion or iteration would need to be applied to loop the requests until you reach the last page. The response header for endpoints that are paginated should contain the LINK header, which can be used to reach the next page in your iteration. Some possibly useful links on the topic:
https://ethancbanks.com/how-to-pass-api-query-parameters-in-a-curl-request/
https://developer.atlassian.com/server/confluence/pagination-in-the-rest-api/ (While not related to the Statuspage API, the logic is similar)
Hopefully the above is helpful, let us know if you have any questions!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.