Code Monkey home page Code Monkey logo

api-documentation's People

Contributors

arthurhoaro avatar hartlco avatar nodiscc avatar virtualtam avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

api-documentation's Issues

General discussion

There are a few things that's need to be defined.

API services

It should describe every services in details. See the first example https://github.com/shaarli/api-documentation/blob/master/api-documentation.md (feel free to propose a better format if you know one).
Different services should be discussed in different issues/PR.

Authentication

Which method are we using? Could be a good idea to provide a few client usage example like done in shaarli/Shaarli#586

Implementation choices

There are a lot of framework and libs to deal with REST API out there. Should we use one of them?

ping @mro @toneiv @pikzen @dimtion

API endpoints

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.

Android API usage example

Hello,

I would like to contribute to the documentation and add a code snippet of the Shaarli API usage with Android.

I have written everything here. I am just starting to learn Android and I know I had some trouble making this work, so I am confident other people will take advantage of this.

I am not sure of how and where you would like to put the snippet so I opened this issue.

API Authentication

As discussed in #2, we need a way to authenticate clients to Shaarli's API.

I'm in favor of using JWT:

  • widely used, so there are client libraries in any language.
  • pretty much easy to implement if you want to
  • unique token for any request based on salted hash

@virtualtam has proposed to used an authentication process

When emitting several requests over an HTTP service that requires authentication, one usually:

  • opens an HTTP session with a first request carrying the credentials,
  • reuses this session to send further requests

Another possibility is OAuth in client_credentials mode. IMHO it's a bit too complex but it's not that hard:

  • the client has an ID + secret
  • get a temporary token from a refresh_token endpoint
  • carry its token in every request

EDIT: actually OAuth without a database is a bad idea, because we need to store clients, authorization code and tokens, at least.

how to edit the wiki?

#2 is not how I want to do it in the future โ€“ I tried a wiki edit but see a lengthy discussion while the according page remains blank.

Project goals

may I raise this question to be clarified explicitly? I touched it in shaarli/Shaarli#586 (comment)

  • what are the deliverables of this project?
  • what about acceptance tests?
  • what are the quality-expectations (regarding the api server side implementation) in a coarse grained manner a la https://github.com/mro/ShaarliOS#design-goals
  • what is the process for approving api changes (including experimental/stable/deprecated/purged state changes)

POST/PUT link - title shouldn't be required

Currently, the title is required for POST and PUT link endpoints. It shouldn't, as we can do like in the UI, use the URL as a title.

So there is no required field, an empty request would make a note with its shorturl as a title.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.