Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create butter bar frontend for API usage notification #3992

Closed
zachaysan opened this issue May 21, 2024 · 0 comments · Fixed by #4027
Closed

Create butter bar frontend for API usage notification #3992

zachaysan opened this issue May 21, 2024 · 0 comments · Fixed by #4027
Assignees

Comments

@zachaysan
Copy link
Contributor

zachaysan commented May 21, 2024

At the endpoint:

GET /api/v1/organisations/<int:organisation_pk>/api-usage-notification/

If there are no results then do not show the butter bar. If there are results that look like this.

[{
    "notified_at": "2023-01-19T09:09:47.325132Z",
    "organisation_id": 2232,
    "percent_usage": 100,
}]

Take the percent_usage value and include it into language that says something like "Your organisation has exceeded X% of its API usage quota"

If at 100% or higher, then check if they have a paid plan. If they have a paid plan add the following "automated billing for the overages may apply."

If, on the other hand, they have a free plan and at or higher than 100% then add the following "API access may be turned off unless your organisation upgrades."

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants