Skip to content

Consolidate API endpoints under one path #170

Closed
campb303 opened this issue Jan 27, 2021 · 2 comments · Fixed by #183
Closed

Consolidate API endpoints under one path #170

campb303 opened this issue Jan 27, 2021 · 2 comments · Fixed by #183
Assignees
Labels
enhancement Request for a change to existing functionality high-priority Needs immediate extra focus

Comments

@campb303
Copy link
Collaborator

Currently the api has several different endpoints for various things:

Endpoints Use
/login Receives a JSON encoded username and password. Sets a Refresh token cookie and returns an access token.
/tokens/refresh Gets a new refresh token.
/api/<string:queue>/<int:number> Returns a JSON encoded Item.
/api/<string:queues> Returns a JSON encoded Queue.
/api/get_queues Returns a list of queues and their item counts.

In order to simplify the work needed for a reverse proxy in production as described in this comment, these endpoints should all be consolidated under one path: /api with a hierarchical organization following. For example:

  • /api - The root of the API path.
    • /login - The login path. (/api/login).
    • /tokens - The root for token related resources. (/api/tokens).
      • /refresh - Refresh an access token using a refresh token. (/api/tokens/refresh).
    • /data- The root for resources that return queue data. (/api/data).
      • /<string:queues> - Get a JSON encoded Queue or list of Queues. Example: /api/data/ce or /api/data/ce+comm.
      • /<string:queue>/<int:number> - Get a JSON encoded Item. Example: /api/items/ce/100.
@campb303 campb303 added api enhancement Request for a change to existing functionality high-priority Needs immediate extra focus labels Jan 27, 2021
@campb303 campb303 added this to the v1-readonly milestone Jan 27, 2021
@campb303
Copy link
Collaborator Author

campb303 commented Feb 3, 2021

API endpoints have been consolidated. @benne238 is working on docs now.

@campb303 campb303 linked a pull request Feb 8, 2021 that will close this issue
@campb303
Copy link
Collaborator Author

Docs has been written. Closing.

Sign in to join this conversation on GitHub.
Labels
enhancement Request for a change to existing functionality high-priority Needs immediate extra focus
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants