diff --git a/docs/api/credentials.md b/docs/api/credentials.md new file mode 100644 index 000000000..37fb223bc --- /dev/null +++ b/docs/api/credentials.md @@ -0,0 +1,47 @@ +# Credentials + +Gets a token for subsequent API calls + +**URL** + + `/credentials` + +**Method** + + `GET` + +**URL Params** + + None + +**Data Params** + + None + +**Success Response** + +| Code | Content| +| --- |:------ | +| 200 OK | JWT Token | + +**Error Response** + +| Code | Content | +| --- | :--------- | +| 401 UNAUTHORIZED | `{ status: "401", message : "You are unauthorized to make this request." }`| + +**Sample Call** + +```json +GET /api/{apiversion}/credentials +{ + +} + +HTTP/1.1 200 OK +"eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhZG1pbiJ9.O7hC-ta225epRQlJZO44WC-l2cWohKnJ8lkmlOQpw8Z_xYiwJ6-qDUhHeJEZH9DmwIwz_jD77sj1kQUkXHsbOg" +``` + +**Notes** + +You must send a basic authentication header with this request diff --git a/docs/api/location.md b/docs/api/location.md new file mode 100644 index 000000000..e9954225e --- /dev/null +++ b/docs/api/location.md @@ -0,0 +1,37 @@ +# Location + +Gets a list of registered devices + +**URL** + + `/location` + +**Method** + + `GET` + +**URL Params** + + None + +**Data Params** + + None + +**Success Response** + +| Code | Content | +| --- |:------ | +| 200 | | + +**Sample Call** + +```json +GET /api/{apiversion}/location +{ + +} + +HTTP/1.1 200 OK +"eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhZG1pbiJ9.O7hC-ta225epRQlJZO44WC-l2cWohKnJ8lkmlOQpw8Z_xYiwJ6-qDUhHeJEZH9DmwIwz_jD77sj1kQUkXHsbOg" +``` diff --git a/docs/api/overview.md b/docs/api/overview.md new file mode 100644 index 000000000..d64173c6c --- /dev/null +++ b/docs/api/overview.md @@ -0,0 +1,3 @@ +Routr API version is currently `v1beta1`. We continue to improve the API, resource definition, and other artifacts until we reach a final version. We can then establish an update policy to ensure backward compatibility. Until then keep an eye on this document. The endpoint for the API is as follows: + +`/api/{apiversion}` diff --git a/docs/api/reference.md b/docs/api/reference.md deleted file mode 100644 index 0579cafe2..000000000 --- a/docs/api/reference.md +++ /dev/null @@ -1,39 +0,0 @@ -## Introduction - -**Routr** API version is currently `v1beta1`. We continue to improve the API, resource definition, and other artifacts until we reach a final version. We can then establish an update policy to ensure backward compatibility. Until then keep an eye on this document. The endpoint for the API is as follows: - -`/api/{apiversion}` - -## Authentication - -Obtain your API by -`/api/{apiversion}/credentials` - -`/api/{apiversion}` - - ---- - -## Obtain Account Key -Obtain API access key - -### Arguments: - -username :: string : User name -secret :: string : Password - -### Result: -res :: integer : Status code (0 on success, 1 otherwise) - -### Examples: -```javascript - POST /api/{apiversion}/credentials - { - "user": "peter", - "host": "myserver.com", - "newpass": "blank" - } - - HTTP/1.1 200 OK - "" -``` diff --git a/docs/theme/partials/header.html b/docs/theme/partials/header.html index 62171a6b7..241173c14 100644 --- a/docs/theme/partials/header.html +++ b/docs/theme/partials/header.html @@ -2,6 +2,24 @@