Skip to content

Implement the Limits API #3

@arcanericky

Description

@arcanericky

The Pushover Limits API is simple and has a very short writeup at https://pushover.net/api#limits. It uses only a single parameter (token) and can be viewed with:

$ curl https://api.pushover.net/1/apps/limits.json?token=apitoken
{"limit":7500,"remaining":7405,"reset":1564635600,"status":1,"request":"7e3888b4-0bc8-4525-b567-d30e11b68d92"}

Implement this API in a limits.go module, including appropriate comments for GoDoc and unit tests. Use the Messages and Validate API as examples.

Use this API in the Pushover CLI utility with a limits commmand. An example might be:

$ pushover limits --token apitoken
Request
Token:       apitoken

Response
HTML Status:      200 OK
HTML Status Code: 200
API Status:       1
Request ID:       7e3888b4-0bc8-4525-b567-d30e11b68d92
Limit:            7500
Remaining:        7405
Reset:            1564635600
Response Body: {"status":1,"group":0,"devices":["pixel2xl"],"licenses":["Android"],"request":"a5669be9-1160-40cb-b680-36dde650bc28"}

Include unit tests for the CLI functionality.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions