Audience-specific embedding / API options
Asked by poggen:

We have a number of SaaS products with various tenant models. Some of those tenant models are siloed in a fashion where a customer would have to know status on an individual tenant basis, e.g. tenantX.productA.company.tld. This is doable using audience-specific pages and connecting our IdP via SAML, allowing a logged in user on our developer portal to click a link to the status page, have the SSO kick in and then display only the components that are relevant for that specific user.

However, we would like to have the status information be more integrated in our SaaS platform and not simply link the users to the statuspage. Having looked extensively on what's available in terms of docs and other forum posts, I figured I'd ask the question here:

Is there any way of getting audience-specific status information as an embed or by querying it via an API for use inside an app/other website?


Answers:
author: Alan Violada
body: Hey [@poggen](/t5/user/viewprofilepage/user-id/5176593), Alan from the Statuspage support team here, thanks for reaching out to us with this question. While Statuspage does have the Status Embed feature, which could be a fit for what you are looking for, it is unfortunately limited to Public pages only:

[Statuspage Status Embed Feature](https://support.atlassian.com/statuspage/docs/what-is-status-embed/)

You can, however, use the available APIs to get the information you need, then display them as needed on your platform:

[What are the different APIs under Statuspage?](https://support.atlassian.com/statuspage/docs/what-are-the-different-apis-under-statuspage/)

[API Documentation](https://developer.statuspage.io/#section/Basics/HTTPS)

Let me know if you have any questions on the above, or anything else we may assist with!

Cheers,

Alan

comments: author: poggen
body: Thanks for your reply, Alan. OK, however it isn't immediately obvious to me how one would go about doing that using the API endpoints you have. Would you mind explaining what endpoints should be queried to be able to present our users with audience-specific statuspage information via your API?


author: Alan Violada
body: That would really depend on what information you plan to present, and how - For example, if you want to display open/ongoing incidents, you might want to use the "**Unresolved incidents**" endpoint, and use the results to display data such as incident status, affected components, and their status, etc.

[Unresolved incidents endpoint](https://developer.statuspage.io/#operation/getPagesPageIdIncidentsUnresolved)

You could use the "**Scheduled incidents**" endpoint to display information about scheduled maintenances with information about components that will be affected, start and end time, and other details.

[Scheduled incidents endpoint](https://developer.statuspage.io/#operation/getPagesPageIdIncidentsScheduled)

You can find example request responses for each endpoint in the above documentation, so you are able to map out how you would use the data to display it on your platform.

Let me know if this helps!

Regards,

Alan


author: poggen
body: Hi again,

I think you're misunderstanding me. I definitely understand your endpoints and will surely be able to map them towards our intended UX. However, what I don't understand is how I am supposed to have the API calls take the current logged in user into account, in order to display information only relevant to him/her. If I query e.g. \`GET /pages/{page_id}/components\` --- how would I be able to pass the user to that query in order for the response to only list components that the user in question should see?

BR,

Oscar


author: Alan Violada
body: Thanks for clarifying, Oscar, and apologies for missing your point there! Your use case would probably be slightly less straightforward - This is just an initial idea, but you might be able to get the logged-in users "**Page Access User ID** " as well as their "**Page Access Group ID**" by using the below endpoint and searching by their email:

[Get Page Access User endpoint](https://developer.statuspage.io/#operation/getPagesPageIdPageAccessUsers)

With that info, you might choose to either query the audience groups they are a part of, to get the status for all included components, or you might try to manually query each component the user has access to based on the "Page Access User Components" endpoint:

[Page Access Group Components endpoint](https://developer.statuspage.io/#operation/getPagesPageIdPageAccessGroupsPageAccessGroupIdComponents)

[Page Access User Components endpoint](https://developer.statuspage.io/#operation/getPagesPageIdPageAccessUsersPageAccessUserIdComponents)

If you want to go a bit deeper, you could try to query for any ongoing incidents or scheduled maintenance, and try to filter them based on the affected components X the components the user has access to, but that would have to be done on your side I believe, as I can't see a way to do it directly via the API requests.

Let me know if this helps give you a starting point, and if you have any questions.

Regards,

Alan


Tags: api

embed

rest-api