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,638,561
Community Members
 
Community Events
196
Community Groups

Get list of all subscribers using REST API

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.

1 answer

0 votes
Alan Violada
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
Oct 06, 2022

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://javascript.plainenglish.io/this-is-how-you-can-retrieve-all-data-via-paginated-api-calls-in-vanilla-javascript-a8258e208ea0

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!

Suggest an answer

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

Atlassian Community Events