-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding documentation to the OxO homepage, inital commit of the doc pa…
…rt, more content necessary
- Loading branch information
Showing
6 changed files
with
204 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
= OxO API guide | ||
|
||
[[overview-http-verbs]] | ||
== HTTP verbs | ||
|
||
This API supports the following HTTP verbs. | ||
|
||
|=== | ||
| Verb | Usage | ||
|
||
| `GET` | ||
| Used to retrieve a resource | ||
|=== | ||
|
||
[[overview-http-status-codes]] | ||
== HTTP status codes | ||
|
||
This API tries to adhere as closely as possible to standard HTTP and REST conventions in its | ||
use of HTTP status codes. | ||
|
||
|=== | ||
| Status code | Usage | ||
|
||
| `200 OK` | ||
| The request completed successfully | ||
|
||
| `400 Bad Request` | ||
| The request was malformed. The response body will include an error providing further information | ||
|
||
| `404 Not Found` | ||
| The requested resource did not exist | ||
|=== | ||
|
||
== Errors | ||
|
||
Whenever an error response (status code >= 400) is returned, the body will contain a JSON object | ||
that describes the problem. The error object has the following structure: | ||
|
||
include::{snippets}/error-example/response-fields.adoc[] | ||
|
||
For example, a request that attempts to apply a non-existent tag to a resource will produce a `400 Bad Request` response: | ||
|
||
include::{snippets}/error-example/http-response.adoc[] | ||
|
||
[[overview-hypermedia]] | ||
== Hypermedia | ||
|
||
This API uses hypermedia and resources include links to other resources in their | ||
responses. Responses are in http://stateless.co/hal_specification.html[Hypertext Application | ||
Language (HAL)] format. Links can be found benath the `_links` key. Users of the API should | ||
not created URIs themselves, instead they should use the above-described links to navigate | ||
from resource to resource. | ||
|
||
[[overview-pagination]] | ||
== Listing resources | ||
|
||
Requests that return multiple resources will be paginated to 20 items by default. You can change number of items | ||
returned using the `size` parameter up to a maximum of 500 for a single request. The API also supports the `page` | ||
parameter for accessing a specific page of items. | ||
|
||
=== Paging resources | ||
|
||
Links will be provided in the response to navigate the resources. | ||
|
||
==== Example request | ||
|
||
include::{snippets}/page-example/curl-request.adoc[] | ||
|
||
==== Example response | ||
include::{snippets}/api-example/http-response.adoc[] | ||
|
||
|
||
|
||
|
||
=== Datasource | ||
Example request | ||
include::{snippets}/datasources-list-example/curl-request.adoc[] | ||
include::{snippets}/datasources-list-example/http-request.adoc[] | ||
Example reply | ||
include::{snippets}/datasources-list-example/http-response.adoc[] | ||
|
||
|
||
=== mappings | ||
Example request | ||
include::{snippets}/mappings-list-example/curl-request.adoc[] | ||
include::{snippets}/mappings-list-example/http-request.adoc[] | ||
Example reply | ||
include::{snippets}/mappings-list-example/http-response.adoc[] | ||
|
||
=== terms | ||
Example request | ||
include::{snippets}/terms-list-example/curl-request.adoc[] | ||
include::{snippets}/terms-list-example/http-request.adoc[] | ||
Example reply | ||
include::{snippets}/terms-list-example/http-response.adoc[] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters