-
Notifications
You must be signed in to change notification settings - Fork 0
API reference
Armandas edited this page Oct 6, 2023
·
14 revisions
GET
/
Get a list of museums
name | type | data type | description |
---|---|---|---|
page | optional | number | Page number (page ∈ ℕ) |
pageSize | optional | number | Description of the museum (pageSize ∈ ℕ ∩ [5,30]) |
HTTP Code | Content-Type | Response |
201 | application/json |
{
"museum": {
"id": 20,
"name": "MusMus4",
"description": "Museum description very large building lots and lots of items and categories",
"imageUrl": null
}
} |
401 | application/json |
{
"errors": [
"Invalid access token"
]
} |
422 | application/json |
{
"errors": [
{
"field": "name",
"message": "Required"
}
]
} |
curl --location 'http://localhost:4000/api/v1/museums?page=2&pageSize=5'
POST
/
Create a new museum (ADMIN)
USER MUST BE AN ADMIN
name | type | data type | description |
---|---|---|---|
name | required | string | Title of the museum |
description | required | string | Description of the museum |
HTTP Code | Content-Type | Response |
201 | application/json |
{
"museum": {
"id": 20,
"name": "MusMus4",
"description": "Museum description very large building lots and lots of items and categories",
"imageUrl": null
}
} |
401 | application/json |
{
"errors": [
"Invalid access token"
]
} |
422 | application/json |
{
"errors": [
{
"field": "name",
"message": "Required"
}
]
} |
curl --location 'http://localhost:4000/api/v1/museums' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer eyJhbGciOiJIbzI1NiJ9.ey...gS_kLNb1Cdaujo' \
--data '{
"name": "MusMus4",
"description": "Museum description very large building lots and lots of items and categories"
}'
GET
/
(gets all in-memory stub & proxy configs)
None
http code content-type response 200
text/plain;charset=UTF-8
YAML string
curl --location 'http://localhost:4000/api/v1/museums' \
--header 'Content-Type: application/json'
--header 'Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJpZCI6MSwicm9sZSI6IkFETUlOIiwiaWF0IjoxNjk1ODE5MjAyLCJpc3MiOiJzZXJ2ZXIiLCJhdWQiOiJ1c2VyIiwiZXhwIjoxNjk1ODI2NDAyNzUxfQ.OfXFX_XvHEBsKrXY3VW3OixmV4vIZgS_kLNu6CSaujo'
--data '{
"description": "Museum description very large building lots and lots of items and categories"
}'
GET
/{stub_numeric_id}
(gets stub by its resource-id-{stub_numeric_id} in the YAML config)
name type data type description stub_numeric_id
required int ($int64) The specific stub numeric id
http code content-type response 200
text/plain;charset=UTF-8
YAML string 400
application/json
{"code":"400","message":"Bad Request"}
curl -X GET -H "Content-Type: application/json" http://localhost:8889/0
GET
/{uuid}
(gets stub by its defined uuid property)
name type data type description uuid
required string The specific stub unique idendifier
http code content-type response 200
text/plain;charset=UTF-8
YAML string 400
application/json
{"code":"400","message":"Bad Request"}
curl -X GET -H "Content-Type: application/json" http://localhost:8889/some-unique-uuid-string
GET
/proxy-config/default
(gets default proxy-config)
None
http code content-type response 200
text/plain;charset=UTF-8
YAML string 400
application/json
{"code":"400","message":"Bad Request"}
curl -X GET -H "Content-Type: application/json" http://localhost:8889/proxy-config/default
GET
/proxy-config/{uuid}
(gets proxy config by its uuid property)
name type data type description uuid
required string The specific proxy config unique idendifier
http code content-type response 200
text/plain;charset=UTF-8
YAML string 400
application/json
{"code":"400","message":"Bad Request"}
curl -X GET -H "Content-Type: application/json" http://localhost:8889/proxy-config/some-unique-uuid-string
PUT
/{stub_numeric_id}
(updates stub by its resource-id-{stub_numeric_id} in the config)
name type data type description stub_numeric_id
required int ($int64) The specific stub numeric id
http code content-type response 201
text/plain;charset=UTF-8
Stub request index#<stub_numeric_id> updated successfully"
400
application/json
{"code":"400","message":"Bad Request"}
405
text/html;charset=utf-8
None
curl -X PUT -H "Content-Type: application/json" --data @put.json http://localhost:8889/0
PUT
/{uuid}
(updates stub by its defined uuid property)
name type data type description uuid
required string The specific stub unique idendifier
http code content-type response 201
text/plain;charset=UTF-8
Stub request uuid#<uuid> updated successfully
400
application/json
{"code":"400","message":"Bad Request"}
405
text/html;charset=utf-8
None
curl -X PUT -H "Content-Type: application/json" --data @put.json http://localhost:8889/some-unique-uuid-string
PUT
/proxy-config/default
(updates default proxy-config)
None
http code content-type response 201
text/plain;charset=UTF-8
Proxy config uuid#default updated successfully
400
application/json
{"code":"400","message":"Bad Request"}
405
text/html;charset=utf-8
None
curl -X PUT -H "Content-Type: application/json" --data @put.json http://localhost:8889/proxy-config/default
PUT
/proxy-config/{uuid}
(updates proxy-config by its uuid property)
name type data type description uuid
required string The specific proxy config unique idendifier
http code content-type response 201
text/plain;charset=UTF-8
Proxy config uuid#<uuid> updated successfully
400
application/json
{"code":"400","message":"Bad Request"}
405
text/html;charset=utf-8
None
curl -X PUT -H "Content-Type: application/json" --data @put.json http://localhost:8889/proxy-config/some-unique-uuid-string
DELETE
/
(deletes all in-memory stub & proxy configs)
None
http code content-type response 200
text/plain;charset=UTF-8
All in-memory YAML config was deleted successfully
curl -X DELETE -H "Content-Type: application/json" http://localhost:8889/
DELETE
/{stub_numeric_id}
(deletes stub by its resource-id-{stub_numeric_id} in the config)
name type data type description stub_numeric_id
required int ($int64) The specific stub numeric id
http code content-type response 200
text/plain;charset=UTF-8
Stub request index#<stub_numeric_id> deleted successfully
400
application/json
{"code":"400","message":"Bad Request"}
curl -X DELETE -H "Content-Type: application/json" http://localhost:8889/0
DELETE
/{uuid}
(updates stub by its defined uuid property)
name type data type description uuid
required string The specific stub unique idendifier
http code content-type response 200
text/plain;charset=UTF-8
Stub request uuid#<uuid> deleted successfully
400
application/json
{"code":"400","message":"Bad Request"}
curl -X DELETE -H "Content-Type: application/json" http://localhost:8889/some-unique-uuid-string
DELETE
/proxy-config/{uuid}
(deletes proxy-config by its uuid property)
name type data type description uuid
required string The specific proxy config unique idendifier
http code content-type response 200
text/plain;charset=UTF-8
Proxy config uuid#<uuid> deleted successfully
400
application/json
{"code":"400","message":"Bad Request"}
curl -X DELETE -H "Content-Type: application/json" http://localhost:8889/proxy-config/some-unique-uuid-string