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

API endpoints #7

Closed
ArthurHoaro opened this issue Jun 16, 2016 · 2 comments
Closed

API endpoints #7

ArthurHoaro opened this issue Jun 16, 2016 · 2 comments

Comments

@ArthurHoaro
Copy link
Member

ArthurHoaro commented Jun 16, 2016

As discussed in #3 we have 2 ways to handle parameters:

Method Endpoint
DELETE ?do=api&q=/links/Shsmbw
POST ?do=api&q=/links
GET ?do=api&q=/links&limit=20

or

Method Endpoint
DELETE ?do=api&request=links&param=Shsmbw
POST ?do=api&request=links
GET ?do=api&request=links&limit=20

Optionally we can add URL rewriting for cleaner URL.

The first one requires a bit of work to handle parameters properly, while the second one makes URL rewriting more complex.

EDIT: parameter names are also debatable, but won't be used client side if we add URL rewriting.
EDIT BIS: I forgot the API version, but you get the idea.

@ArthurHoaro
Copy link
Member Author

ArthurHoaro commented Jun 16, 2016

My vote goes to the first method with URL rewriting.

  • URL rewriting from the beginning to avoid client using previous format the day we add clean URL.
  • The first method because handling slightly complex parameter a easier than writing complex URL rewriting in multiple web server configuration syntax.

This means that we would have

Method Endpoint Real URL
DELETE /api/v1/links/Shsmbw ?do=api&version=1&q=/links/Shsmbw
POST /api/v1/links/ ?do=api&version=1&q=/links
GET /api/v1/links?limit=20 ?do=api&version=1&q=/links&limit=20

@ArthurHoaro
Copy link
Member Author

URL rewriting is handled by Slim.

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

No branches or pull requests

1 participant