relaton / api.relaton.org

Relaton Service API
https://relaton-api.herokuapp.com
1 stars 1 forks source link

Add API endpoint to find a standard #5

Closed abunashir closed 5 years ago

abunashir commented 5 years ago

At the core, we want this application to allow it's client to fetch any standards, and also handle underlying caching and everything to minimize underlying processing.

This commit adds the initial setup with ISO standard provider, so whenever any client request for any of the standard, then this will look in our internal repository if we already have that document then it will return to the client.

But if we don't have that standard in our repository, then it will use the proper finder class, fetch the document and also store to our internal repository before sending back to the client. We will also use this pre-cached document to further requests.

= Request
---------
Method: GET
Endpoint: /qpi/standard
Parameters: `code` and `year`.
Example: `/api/standard?code=ISO 19115&year=2013`

= Response
----------
Status: 200 (ok), or 422 (Unprocessable).
Response Body:

`
{
  "code": "ISO 19115",
  "type": "ISO",
  "updated_at": "2019-08-08",
  "document": {
    "xml": "xml-document",
    "json":  { "key": "value" }
  }
}
`