From 9971fedab76a2e3d07da84114e7550c23f78a800 Mon Sep 17 00:00:00 2001 From: Tim Joosten Date: Sun, 27 Aug 2017 14:59:57 +0200 Subject: [PATCH 1/4] New start --- .gitattributes | 3 - .gitignore | 1 - LICENSE | 21 --- apiary.apib | 98 ----------- contribution.md | 5 - documentation/activities.md | 0 documentation/authorization.md | 0 documentation/groups.md | 0 documentation/rental.md | 0 documentation/status-codes.md | 0 documentation/users.md | 0 output.html | 305 --------------------------------- readme.md | 18 -- test.less => src/css/test.less | 0 14 files changed, 451 deletions(-) delete mode 100644 .gitattributes delete mode 100644 .gitignore delete mode 100644 LICENSE delete mode 100644 apiary.apib delete mode 100644 contribution.md delete mode 100644 documentation/activities.md delete mode 100644 documentation/authorization.md delete mode 100644 documentation/groups.md delete mode 100644 documentation/rental.md delete mode 100644 documentation/status-codes.md delete mode 100644 documentation/users.md delete mode 100644 output.html delete mode 100644 readme.md rename test.less => src/css/test.less (100%) diff --git a/.gitattributes b/.gitattributes deleted file mode 100644 index 34bfc66..0000000 --- a/.gitattributes +++ /dev/null @@ -1,3 +0,0 @@ -/.gitattributes export-ignore -/.gitignore export-ingore -/LICENSE export-ignore \ No newline at end of file diff --git a/.gitignore b/.gitignore deleted file mode 100644 index 757fee3..0000000 --- a/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/.idea \ No newline at end of file diff --git a/LICENSE b/LICENSE deleted file mode 100644 index e446a35..0000000 --- a/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2016 Tim Joosten - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/apiary.apib b/apiary.apib deleted file mode 100644 index a58b757..0000000 --- a/apiary.apib +++ /dev/null @@ -1,98 +0,0 @@ -FORMAT: 1A -HOST: http://www.st-joris-turnhout.be - -# SIJOT-3 API - -Deze referentie hoort bij de API die Scouts en Gidsen Sint-Joris, Turnhout. Heeft ontwikkeld voor intern gebruik. - -# Group algemeen -#### Authorization request headers - -Bij elke(*) request moet een *Authorization-header* worden meegegeven: - -`X-Authorization: {Uw API sleutel}` - -`{Uw API sleutel}` is een random gegenereerde JSON token. Die kan verkregen worden als admin in het controle -paneel van de website. - -(*) Enkele endpoints zijn publiek. Hierbij is geen *Authorization-header* noodzakelijk. Het resultaat kan wel afhangen -van de *Authorization-header* - -## Errors - -#### Status codes - -Code | Reason Phrase --------- | ----------------------------- -`200` | Request OK -`201` | Resource created -`304` | Not Modified -`400` | Bad request -`401` | Unauthorized request -`404` | Resource not found -`50x` | Internal server error. - -#### Formaat - -```javascript -{ - "error": { - "code": "{HTTP Status code}", - "http_code": "{Uitleg van de HTTP code}", - "message": "{Titel van de fout.}" - } -} -``` -# Group Overzicht - -### Oplijsting van alle verhuringen [GET /api/lease] - -+ Response 200 (application/json) - - + Headers - - X-Authorization: '' - - + Body - - { - } - -### Bekijk een specifieke verhuring [GET /{verhuring_id}] -+ Parameters - + verhuring_id (integer) - De id van de verhuring in het systeem. - -+ Response 401 - - -### Maak een verhuring aan [POST /api/lease] - -+ Request (application/json) - + Attributes - + choices: Swift, `Objective-C` (array, required) - test - -+ Response 401 - -### Verwijder een verhuring [DELETE /{verhuring_id}] - -+ Parameters - - + verhuring_id (integer) - De id van de verhuring in het systeem. - -+ Response 200 (application/json) - -+ Response 401 (application/json) - - + Body - - ```javascript - { - "error": { - "code": "401", - "http_code": "GEN-UNAUTHORIZED", - "message":"Unauthorized." - } - } - ``` - -+ Response 404 (application/json) \ No newline at end of file diff --git a/contribution.md b/contribution.md deleted file mode 100644 index e2ac7fa..0000000 --- a/contribution.md +++ /dev/null @@ -1,5 +0,0 @@ -Contribution Guidelines - -If you are submitting documentation for the current stable release, submit it to the corresponding branch. -For example, documentation for SIJOT-2.x would be submitted to the 2.* branch. -Documentation intended for the next release of Sijot-2.x should be submitted to the master branch. diff --git a/documentation/activities.md b/documentation/activities.md deleted file mode 100644 index e69de29..0000000 diff --git a/documentation/authorization.md b/documentation/authorization.md deleted file mode 100644 index e69de29..0000000 diff --git a/documentation/groups.md b/documentation/groups.md deleted file mode 100644 index e69de29..0000000 diff --git a/documentation/rental.md b/documentation/rental.md deleted file mode 100644 index e69de29..0000000 diff --git a/documentation/status-codes.md b/documentation/status-codes.md deleted file mode 100644 index e69de29..0000000 diff --git a/documentation/users.md b/documentation/users.md deleted file mode 100644 index e69de29..0000000 diff --git a/output.html b/output.html deleted file mode 100644 index 470f530..0000000 --- a/output.html +++ /dev/null @@ -1,305 +0,0 @@ -SIJOT-3 API Back to top

SIJOT-3 API

Deze referentie hoort bij de API die Scouts en Gidsen Sint-Joris, Turnhout. Heeft ontwikkeld voor intern gebruik.

-

algemeen

Authorization request headers

-

Bij elke(*) request moet een Authorization-header worden meegegeven:

-

X-Authorization: {Uw API sleutel}

-

{Uw API sleutel} is een random gegenereerde JSON token. Die kan verkregen worden als admin in het controle -paneel van de website.

-

(*) Enkele endpoints zijn publiek. Hierbij is geen Authorization-header noodzakelijk. Het resultaat kan wel afhangen -van de Authorization-header

-

Errors

-

Status codes

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
CodeReason Phrase
200Request OK
201Resource created
304Not Modified
400Bad request
401Unauthorized request
404Resource not found
50xInternal server error.
-

Formaat

-
{
-    "error": {
-        "code": "{HTTP Status code}",
-        "http_code": "{Uitleg van de HTTP code}",
-        "message": "{Titel van de fout.}"
-    }
-}
-

Overzicht

Oplijsting van alle verhuringen

Oplijsting van alle verhuringen
GET/api/lease

Example URI

GET http://www.st-joris-turnhout.be/api/lease
Response  200
HideShow
Headers
Content-Type: application/json
X-Authorization: '<Uw API sleutel>'
Body
{}

Bekijk een specifieke verhuring

Bekijk een specifieke verhuring
GET/{verhuring_id}

Example URI

GET http://www.st-joris-turnhout.be/verhuring_id
URI Parameters
HideShow
verhuring_id
integer (required) 

De id van de verhuring in het systeem.

-
Response  401

Maak een verhuring aan

Maak een verhuring aan
POST/api/lease

Example URI

POST http://www.st-joris-turnhout.be/api/lease
Request
HideShow
Headers
Content-Type: application/json
Body
{
-  "choices": [
-    "Swift",
-    "Objective-C"
-  ]
-}
Schema
{
-  "$schema": "http://json-schema.org/draft-04/schema#",
-  "type": "object",
-  "properties": {
-    "choices": {
-      "type": "array",
-      "description": "test"
-    }
-  },
-  "required": [
-    "choices"
-  ]
-}
Response  401

Verwijder een verhuring

Verwijder een verhuring
DELETE/{verhuring_id}

Example URI

DELETE http://www.st-joris-turnhout.be/verhuring_id
URI Parameters
HideShow
verhuring_id
integer (required) 

De id van de verhuring in het systeem.

-
Response  200
HideShow
Headers
Content-Type: application/json
Response  401
HideShow
Headers
Content-Type: application/json
Body
{
-  "error": {
-    "code": "401",
-    "http_code": "GEN-UNAUTHORIZED",
-    "message": "Unauthorized."
-  }
-}
Response  404
HideShow
Headers
Content-Type: application/json

Generated by aglio on 27 Aug 2017

\ No newline at end of file diff --git a/readme.md b/readme.md deleted file mode 100644 index 6f8b826..0000000 --- a/readme.md +++ /dev/null @@ -1,18 +0,0 @@ -![alt tag](https://github.com/Tjoosten/SVG-scss/blob/master/repo-assets/logo.jpg) - -## Table of contents. - -- [Authorization](documentation/authorization.md) -- [Rental api](documentation/rental.md) -- [Users api](documentation/users.md) -- [Groups api](documentation/groups.md) -- [Activities api](documentation/activities.md) -- [Status codes](documentation/status-codes.md) - -## Contributing - -Wil je bij dragen tot deze repository. Dan kun je gerust eens rustig het Contributie bestand doornemen. - -## License - -Alle documenten in deze repository zijn vrijgegeven onder de MIT Licentie. diff --git a/test.less b/src/css/test.less similarity index 100% rename from test.less rename to src/css/test.less From 46303408879a66157089596933528b529f843555 Mon Sep 17 00:00:00 2001 From: Tim Joosten Date: Sun, 27 Aug 2017 15:01:44 +0200 Subject: [PATCH 2/4] Implement apib file --- src/api.apib | 98 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 98 insertions(+) create mode 100644 src/api.apib diff --git a/src/api.apib b/src/api.apib new file mode 100644 index 0000000..a58b757 --- /dev/null +++ b/src/api.apib @@ -0,0 +1,98 @@ +FORMAT: 1A +HOST: http://www.st-joris-turnhout.be + +# SIJOT-3 API + +Deze referentie hoort bij de API die Scouts en Gidsen Sint-Joris, Turnhout. Heeft ontwikkeld voor intern gebruik. + +# Group algemeen +#### Authorization request headers + +Bij elke(*) request moet een *Authorization-header* worden meegegeven: + +`X-Authorization: {Uw API sleutel}` + +`{Uw API sleutel}` is een random gegenereerde JSON token. Die kan verkregen worden als admin in het controle +paneel van de website. + +(*) Enkele endpoints zijn publiek. Hierbij is geen *Authorization-header* noodzakelijk. Het resultaat kan wel afhangen +van de *Authorization-header* + +## Errors + +#### Status codes + +Code | Reason Phrase +-------- | ----------------------------- +`200` | Request OK +`201` | Resource created +`304` | Not Modified +`400` | Bad request +`401` | Unauthorized request +`404` | Resource not found +`50x` | Internal server error. + +#### Formaat + +```javascript +{ + "error": { + "code": "{HTTP Status code}", + "http_code": "{Uitleg van de HTTP code}", + "message": "{Titel van de fout.}" + } +} +``` +# Group Overzicht + +### Oplijsting van alle verhuringen [GET /api/lease] + ++ Response 200 (application/json) + + + Headers + + X-Authorization: '' + + + Body + + { + } + +### Bekijk een specifieke verhuring [GET /{verhuring_id}] ++ Parameters + + verhuring_id (integer) - De id van de verhuring in het systeem. + ++ Response 401 + + +### Maak een verhuring aan [POST /api/lease] + ++ Request (application/json) + + Attributes + + choices: Swift, `Objective-C` (array, required) - test + ++ Response 401 + +### Verwijder een verhuring [DELETE /{verhuring_id}] + ++ Parameters + + + verhuring_id (integer) - De id van de verhuring in het systeem. + ++ Response 200 (application/json) + ++ Response 401 (application/json) + + + Body + + ```javascript + { + "error": { + "code": "401", + "http_code": "GEN-UNAUTHORIZED", + "message":"Unauthorized." + } + } + ``` + ++ Response 404 (application/json) \ No newline at end of file From 62bde29dce3520f05273837372235f2a7f6ae8e0 Mon Sep 17 00:00:00 2001 From: Tim Joosten Date: Sun, 27 Aug 2017 23:43:35 +0200 Subject: [PATCH 3/4] Update apib file --- output.html | 375 +++++++++++++++++++++++++++++++++++++++++++++++++++ package.json | 19 +++ src/api.apib | 151 +++++++++++++++++++-- 3 files changed, 533 insertions(+), 12 deletions(-) create mode 100644 output.html create mode 100644 package.json diff --git a/output.html b/output.html new file mode 100644 index 0000000..ba165f9 --- /dev/null +++ b/output.html @@ -0,0 +1,375 @@ +SIJOT-3 API Back to top

SIJOT-3 API

Deze referentie hoort bij de API die Scouts en Gidsen Sint-Joris, Turnhout. Heeft ontwikkeld voor intern gebruik.

+

algemeen

Authorization request headers

+

Bij elke(*) request moet een Authorization-header worden meegegeven:

+

X-Authorization: {Uw API sleutel}

+

{Uw API sleutel} is een random gegenereerde JSON token. Die kan verkregen worden als admin in het controle +paneel van de website.

+

(*) Enkele endpoints zijn publiek. Hierbij is geen Authorization-header noodzakelijk. Het resultaat kan wel afhangen +van de Authorization-header

+

Errors

+

Status codes

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
CodeReason Phrase
200Request OK
201Resource created
304Not Modified
400Bad request
401Unauthorized request
404Resource not found
50xInternal server error.
+

Formaat

+
{
+    "error": {
+        "code": "{HTTP Status code}",
+        "http_code": "{Uitleg van de HTTP code}",
+        "message": "{Titel van de fout.}"
+    }
+}
+

Verhuringen

Oplijsting van alle verhuringen

Oplijsting van alle verhuringen
GET/api/lease

Example URI

GET http://www.st-joris-turnhout.be/api/lease
Response  200
HideShow
Headers
Content-Type: application/json
X-Authorization: '<Uw API sleutel>'
Body
{}
Response  401
HideShow
Headers
Content-Type: application/json
Body
{
+  "error": {
+    "code": "401",
+    "http_code": "GEN-UNAUTHORIZED",
+    "message": "Unauthorized"
+  }
+}

Bekijk een specifieke verhuring

Bekijk een specifieke verhuring
GET/api/lease/{verhuring_id}

Example URI

GET http://www.st-joris-turnhout.be/api/lease/verhuring_id
URI Parameters
HideShow
verhuring_id
integer (required) 

De id van de verhuring in het systeem.

+
Response  200
HideShow
Headers
Content-Type: application/json
X-Authorization: '<Uw api sleutel>'
Body
{}
Response  401
HideShow
Headers
Content-Type: application/json
Body
{
+  "error": {
+    "code": "401",
+    "http_code": "GEN-UNAUTHORIZED",
+    "message": "Unauthorized"
+  }
+}

Maak een verhuring aan

Maak een verhuring aan
POST/api/lease

Example URI

POST http://www.st-joris-turnhout.be/api/lease
Request
HideShow
Headers
Content-Type: application/json
Body
{
+  "status_id": 0,
+  "start_datum": "0000/00/00",
+  "eind_datum": "0000/00/00",
+  "contact_email": "naam@domein.tld",
+  "groeps_naam": "Sint Joris Turnhout"
+}
Schema
{
+  "$schema": "http://json-schema.org/draft-04/schema#",
+  "type": "object",
+  "properties": {
+    "status_id": {
+      "type": "number",
+      "description": "1 = Nieuw, 2 = Optie, 3 = Bevestigd"
+    },
+    "start_datum": {
+      "type": "string",
+      "description": "Start datum v/d verhuring (YYYY/MM/DD)"
+    },
+    "eind_datum": {
+      "type": "string",
+      "description": "Eind datum v/d verhuring (YYYY/MM/DD)"
+    },
+    "contact_email": {
+      "type": "string",
+      "description": "Email adres v/d contact persoon"
+    },
+    "groeps_naam": {
+      "type": "string",
+      "description": "De naam van de groep"
+    }
+  },
+  "required": [
+    "status_id",
+    "start_datum",
+    "eind_datum",
+    "contact_email",
+    "groeps_naam"
+  ]
+}
Response  401

Verwijder een verhuring

Verwijder een verhuring
DELETE/api/lease/{verhuring_id}

Example URI

DELETE http://www.st-joris-turnhout.be/api/lease/verhuring_id
URI Parameters
HideShow
verhuring_id
integer (required) 

De id van de verhuring in het systeem.

+
Response  200
HideShow
Headers
Content-Type: application/json
X-Authorization: '<uw api sleutel>'
Response  401
HideShow
Headers
Content-Type: application/json
Body
{
+  "error": {
+    "code": "401",
+    "http_code": "GEN-UNAUTHORIZED",
+    "message": "Unauthorized."
+  }
+}
Response  404
HideShow
Headers
Content-Type: application/json

Logins

Login aanmaken

Login aanmaken
POST/api/users

Example URI

POST http://www.st-joris-turnhout.be/api/users

Login verwijderen

Login verwijderen
DELETE/api/users/{user_id}

Example URI

DELETE http://www.st-joris-turnhout.be/api/users/user_id
URI Parameters
HideShow
user_id
integer (required) 

De id van de login in het systeem.

+

Activiteiten

Oplijsting van alle activiteiten

Oplijsting van alle activiteiten
GET/api/activities

+

Deze end-point is publiek

+
+

Example URI

GET http://www.st-joris-turnhout.be/api/activities

Takken

Oplijsting van alle groepen

Oplijsting van alle groepen
GET/api/groups

Example URI

GET http://www.st-joris-turnhout.be/api/groups
Response  200
HideShow
Headers
Content-Type: application/json
Response  401
HideShow
Headers
Content-Type: application/json
Body
{
+  "error": {
+    "code": "401",
+    "http_code": "GEN-UNAUTHORIZED",
+    "message": "Unauthorized"
+  }
+}

Informatie specifieke groep

Informatie specifieke groep
GET/api/groups/

Example URI

GET http://www.st-joris-turnhout.be/api/groups/

Leidinsploeg

Leidinsploeg
GET/api/groups/leidingsploeg

Example URI

GET http://www.st-joris-turnhout.be/api/groups/leidingsploeg

API sleutels

+

Voor deze endpoints heb je administratie rechten nodig in de website.

+
+
    +
  • +

    Response 200 (application/json)

    +
  • +
  • +

    Response 401 (appliation/json)

    +
      +
    • Body
      {
      +    "error": {
      +        "code": 401, 
      +        "http_code": "GEN-AUTHORIZED", 
      +        "message": "Unauthorized"
      +    }
      +}
      +
    • +
    +
  • +
+

Sleutel aanmaken

Sleutel aanmaken
POST/api/key

+

Voor deze endpoint heb je administratie rechten nodig in de website.

+
+

Example URI

POST http://www.st-joris-turnhout.be/api/key

Sleutel verwijderen

Sleutel verwijderen
DELETE/api/key/

+

Voor deze endp-oint heb je administratie rechten nodig in de website.

+
+

Example URI

DELETE http://www.st-joris-turnhout.be/api/key/

Generated by aglio on 27 Aug 2017

\ No newline at end of file diff --git a/package.json b/package.json new file mode 100644 index 0000000..e261b6d --- /dev/null +++ b/package.json @@ -0,0 +1,19 @@ +{ + "name": "api-docs", + "version": "1.0.0", + "description": "", + "main": "index.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/Scouts-Sint-Joris/API-docs.git" + }, + "author": "", + "license": "ISC", + "bugs": { + "url": "https://github.com/Scouts-Sint-Joris/API-docs/issues" + }, + "homepage": "https://github.com/Scouts-Sint-Joris/API-docs#readme" +} diff --git a/src/api.apib b/src/api.apib index a58b757..3f81b47 100644 --- a/src/api.apib +++ b/src/api.apib @@ -43,37 +43,79 @@ Code | Reason Phrase } } ``` -# Group Overzicht +# Group Verhuringen ### Oplijsting van alle verhuringen [GET /api/lease] + Response 200 (application/json) + Headers - + X-Authorization: '' + Body - - { + ```javascript + { + } + ``` + ++ Response 401 (application/json) + + + Body + ```javascript + { + "error": { + "code": "401", + "http_code": "GEN-UNAUTHORIZED", + "message": "Unauthorized" } + } + ``` -### Bekijk een specifieke verhuring [GET /{verhuring_id}] +### Bekijk een specifieke verhuring [GET /api/lease/{verhuring_id}] + Parameters + verhuring_id (integer) - De id van de verhuring in het systeem. - -+ Response 401 + ++ Response 200 (application/json) + + + Headers + + X-Authorization: '' + + + Body + ```javascript + { + } + ``` + ++ Response 401 (application/json) + + + Body + + ```javascript + { + "error": { + "code": "401", + "http_code": "GEN-UNAUTHORIZED", + "message": "Unauthorized" + } + } + ``` ### Maak een verhuring aan [POST /api/lease] + Request (application/json) + Attributes - + choices: Swift, `Objective-C` (array, required) - test + + status_id: 0 (number, required) - 1 = Nieuw, 2 = Optie, 3 = Bevestigd + + start_datum: 0000/00/00 (string, required) - Start datum v/d verhuring (YYYY/MM/DD) + + eind_datum: 0000/00/00 (string, required) - Eind datum v/d verhuring (YYYY/MM/DD) + + contact_email: naam@domein.tld (string, required) - Email adres v/d contact persoon + + groeps_naam: Sint Joris Turnhout (string, required) - De naam van de groep + Response 401 -### Verwijder een verhuring [DELETE /{verhuring_id}] +### Verwijder een verhuring [DELETE /api/lease/{verhuring_id}] + Parameters @@ -81,6 +123,10 @@ Code | Reason Phrase + Response 200 (application/json) + + Headers + + X-Authorization: '' + + Response 401 (application/json) + Body @@ -88,11 +134,92 @@ Code | Reason Phrase ```javascript { "error": { - "code": "401", + "code": "401", "http_code": "GEN-UNAUTHORIZED", - "message":"Unauthorized." + "message": "Unauthorized." } } ``` -+ Response 404 (application/json) \ No newline at end of file ++ Response 404 (application/json) + +# Group Logins + +### Login aanmaken [POST /api/users] + +### Login verwijderen [DELETE /api/users/{user_id}] + ++ Parameters + + + user_id (integer) - De id van de login in het systeem. + +# Group Activiteiten + +### Oplijsting van alle activiteiten [GET /api/activities] + +:::note +Deze end-point is publiek +::: + +# Group Takken + +### Oplijsting van alle groepen [GET /api/groups] + ++ Response 200 (application/json) + ++ Response 401 (application/json) + + + Body + ```javascript + { + "error": { + "code": "401", + "http_code": "GEN-UNAUTHORIZED", + "message": "Unauthorized" + } + } + ``` + + +### Informatie specifieke groep [GET /api/groups/{selector}] + ++ parameters + + + selector (string) = De selector van de groep in de website. + +### Leidinsploeg [GET /api/groups/leidingsploeg] + +# Group API sleutels + +:::note +Voor deze endpoints heb je administratie rechten nodig in de website. +::: + ++ Response 200 (application/json) + ++ Response 401 (appliation/json) + + + Body + ```javascript + { + "error": { + "code": 401, + "http_code": "GEN-AUTHORIZED", + "message": "Unauthorized" + } + } + ``` + + +### Sleutel aanmaken [POST /api/key] + +:::note +Voor deze endpoint heb je administratie rechten nodig in de website. +::: + +### Sleutel verwijderen [DELETE /api/key/] + +:::note +Voor deze endpoint heb je administratie rechten nodig in de website. +::: + From 81a1b6be70251f93557c9504274547d77617b8a2 Mon Sep 17 00:00:00 2001 From: Tim Joosten Date: Mon, 28 Aug 2017 00:54:49 +0200 Subject: [PATCH 4/4] Update --- output.html | 109 ++++++++++-------------------------------------- src/api-v1.apib | 86 ++++++++++++++++++++++++++++++++++++++ src/api.apib | 11 ++++- 3 files changed, 117 insertions(+), 89 deletions(-) create mode 100644 src/api-v1.apib diff --git a/output.html b/output.html index ba165f9..787f3f2 100644 --- a/output.html +++ b/output.html @@ -1,5 +1,5 @@ -SIJOT-3 API Back to top

SIJOT-3 API

Deze referentie hoort bij de API die Scouts en Gidsen Sint-Joris, Turnhout. Heeft ontwikkeld voor intern gebruik.

-

algemeen

Authorization request headers

+SIJOT-3 API Back to top

SIJOT-3 API

Deze referentie hoort bij de API die Scouts en Gidsen Sint-Joris, Turnhout. Heeft ontwikkeld voor intern gebruik.

+

Algemeen

Authorization request headers

Bij elke(*) request moet een Authorization-header worden meegegeven:

X-Authorization: {Uw API sleutel}

{Uw API sleutel} is een random gegenereerde JSON token. Die kan verkregen worden als admin in het controle @@ -54,102 +54,35 @@

Formaat

Oplijsting van alle verhuringen

Oplijsting van alle verhuringen
GET/api/lease

Example URI

GET http://www.st-joris-turnhout.be/api/lease
Response  200
HideShow
Headers
Content-Type: application/json
X-Authorization: '<Uw API sleutel>'
Body
{}
Response  401
HideShow
Headers
Content-Type: application/json
Body
{
+

Verhuringen

Oplijsting van alle Verhuringen

Oplijsting van alle Verhuringen
GET/api/lease

Example URI

GET http://www.st-joris-turnhout.be/api/lease

Informatie optrent verhuring

Informatie optrent verhuring
GET/api/lease/1

Example URI

GET http://www.st-joris-turnhout.be/api/lease/1

Verhuring invoegen

Verhuring invoegen
POST/api/lease/store

Example URI

POST http://www.st-joris-turnhout.be/api/lease/store

Verhuring aanpassen

Verhuring aanpassen
PUT/api/lease/1

Example URI

PUT http://www.st-joris-turnhout.be/api/lease/1

Verhuring verwijderen

Verhuring verwijderen
DELETE/api/lease/1

Example URI

DELETE http://www.st-joris-turnhout.be/api/lease/1
Response  401
HideShow
Headers
Content-Type: application/json
Body
{
   "error": {
-    "code": "401",
-    "http_code": "GEN-UNAUTHORIZED",
+    "code": 401,
+    "http_code": "GEN-AUTHORIZED",
     "message": "Unauthorized"
   }
-}

Bekijk een specifieke verhuring

Bekijk een specifieke verhuring
GET/api/lease/{verhuring_id}

Example URI

GET http://www.st-joris-turnhout.be/api/lease/verhuring_id
URI Parameters
HideShow
verhuring_id
integer (required) 

De id van de verhuring in het systeem.

-
Response  200
HideShow
Headers
Content-Type: application/json
X-Authorization: '<Uw api sleutel>'
Body
{}
Response  401
HideShow
Headers
Content-Type: application/json
Body
{
-  "error": {
-    "code": "401",
-    "http_code": "GEN-UNAUTHORIZED",
-    "message": "Unauthorized"
-  }
-}

Maak een verhuring aan

Maak een verhuring aan
POST/api/lease

Example URI

POST http://www.st-joris-turnhout.be/api/lease
Request
HideShow
Headers
Content-Type: application/json
Body
{
-  "status_id": 0,
-  "start_datum": "0000/00/00",
-  "eind_datum": "0000/00/00",
-  "contact_email": "naam@domein.tld",
-  "groeps_naam": "Sint Joris Turnhout"
 }
Schema
{
   "$schema": "http://json-schema.org/draft-04/schema#",
   "type": "object",
   "properties": {
-    "status_id": {
-      "type": "number",
-      "description": "1 = Nieuw, 2 = Optie, 3 = Bevestigd"
-    },
-    "start_datum": {
-      "type": "string",
-      "description": "Start datum v/d verhuring (YYYY/MM/DD)"
-    },
-    "eind_datum": {
-      "type": "string",
-      "description": "Eind datum v/d verhuring (YYYY/MM/DD)"
-    },
-    "contact_email": {
-      "type": "string",
-      "description": "Email adres v/d contact persoon"
-    },
-    "groeps_naam": {
-      "type": "string",
-      "description": "De naam van de groep"
+    "error": {
+      "type": "object",
+      "properties": {
+        "code": {
+          "type": "number"
+        },
+        "http_code": {
+          "type": "string"
+        },
+        "message": {
+          "type": "string"
+        }
+      }
     }
-  },
-  "required": [
-    "status_id",
-    "start_datum",
-    "eind_datum",
-    "contact_email",
-    "groeps_naam"
-  ]
-}
Response  401

Verwijder een verhuring

Verwijder een verhuring
DELETE/api/lease/{verhuring_id}

Example URI

DELETE http://www.st-joris-turnhout.be/api/lease/verhuring_id
URI Parameters
HideShow
verhuring_id
integer (required) 

De id van de verhuring in het systeem.

-
Response  200
HideShow
Headers
Content-Type: application/json
X-Authorization: '<uw api sleutel>'
Response  401
HideShow
Headers
Content-Type: application/json
Body
{
-  "error": {
-    "code": "401",
-    "http_code": "GEN-UNAUTHORIZED",
-    "message": "Unauthorized."
   }
-}
Response  404
HideShow
Headers
Content-Type: application/json

Logins

Login aanmaken

Login aanmaken
POST/api/users

Example URI

POST http://www.st-joris-turnhout.be/api/users

Login verwijderen

Login verwijderen
DELETE/api/users/{user_id}

Example URI

DELETE http://www.st-joris-turnhout.be/api/users/user_id
URI Parameters
HideShow
user_id
integer (required) 

De id van de login in het systeem.

-

Activiteiten

Oplijsting van alle activiteiten

Oplijsting van alle activiteiten
GET/api/activities

-

Deze end-point is publiek

-
-

Example URI

GET http://www.st-joris-turnhout.be/api/activities

Takken

Oplijsting van alle groepen

Oplijsting van alle groepen
GET/api/groups

Example URI

GET http://www.st-joris-turnhout.be/api/groups
Response  200
HideShow
Headers
Content-Type: application/json
Response  401
HideShow
Headers
Content-Type: application/json
Body
{
-  "error": {
-    "code": "401",
-    "http_code": "GEN-UNAUTHORIZED",
-    "message": "Unauthorized"
-  }
-}

Informatie specifieke groep

Informatie specifieke groep
GET/api/groups/

Example URI

GET http://www.st-joris-turnhout.be/api/groups/

Leidinsploeg

Leidinsploeg
GET/api/groups/leidingsploeg

Example URI

GET http://www.st-joris-turnhout.be/api/groups/leidingsploeg

API sleutels

-

Voor deze endpoints heb je administratie rechten nodig in de website.

-
-
    -
  • -

    Response 200 (application/json)

    -
  • -
  • -

    Response 401 (appliation/json)

    -
      -
    • Body
      {
      -    "error": {
      -        "code": 401, 
      -        "http_code": "GEN-AUTHORIZED", 
      -        "message": "Unauthorized"
      -    }
      -}
      -
    • -
    -
  • -
-

Sleutel aanmaken

Sleutel aanmaken
POST/api/key

-

Voor deze endpoint heb je administratie rechten nodig in de website.

-
-

Example URI

POST http://www.st-joris-turnhout.be/api/key

Sleutel verwijderen

Sleutel verwijderen
DELETE/api/key/

-

Voor deze endp-oint heb je administratie rechten nodig in de website.

+}
Response  200
HideShow
Headers
Content-Type: application/json

Logins

Takken

Activiteiten

API sleutels

+

NOTE: Je hebt admin rechten nodig in de website om dit deeltje van de api te gebruiken.

-

Example URI

DELETE http://www.st-joris-turnhout.be/api/key/

Generated by aglio on 27 Aug 2017