Mijn eerste API die ik heb gemaakt in 4-3-2020 Base URL https://example.com/api
in the header you put Authorization
-> your special key
URL Params:
Field | Value | Required |
---|---|---|
table | the table you want | yes |
row | a specific row | (optional) |
limit | how many you want | (optional) |
URL: https://example.com/api/table/row/limit
Example: https://example.com/api/category/name/3
Success Response:
{
"code": 200,
"data": [
{"name": "tafellamp"},
{"name": "buitenlamp"},
{"name": "Dieren lampen"}
]
}
URL Params:
Field | Value | Required |
---|---|---|
table | the table you want | yes |
Body Params:
Field | Value | Required |
---|---|---|
row | the row you want to define (joined by "-") | yes |
value | the values you want to define (joined by "-") | yes |
URL: https://example.com/api/table
Example: https://example.com/api/category
URL Params:
Field | Value | Required |
---|---|---|
table | the table you want | yes |
id | The specific id of a item | yes |
URL: https://example.com/api/table/id
Example: https://example.com/api/category/12
URL Params:
Field | Value | Required |
---|---|---|
table | the table you want | yes |
id | the specific id | yes |
row | a specific row | yes |
value | how many you want | yes |
URL: https://example.com/api/key/table/id/row/value
Example: http://example.com/api/category/13/name/working
-
Success Response:
- Code: 200
Content:{data: [{id: 12}] }
- Code: 200
-
Error Response:
- Code: 401 UNAUTHORIZED
Content:{ error : "you don't have a key" }
- Code: 422 UNPROCESSABLE ENTRY
Content:{ error : "please give an ..." }
- Code: 409 CONFLICT
Content:{ error : "..." }
- Code: 401 UNAUTHORIZED