Updated Admin API Reference (markdown)

Noah Lerner
2020-02-02 13:25:33 +02:00
parent 97088364b3
commit dd01ecb18e

@@ -251,6 +251,67 @@ Example : `11111110-a633-40e8-a244-5cb80bc0ab66.json`
### `DELETE /__admin/mappings`
Delete all stub mappings.
### `DELETE /__admin/mappings`
Delete all stub mappings matched to the GUIDs in the body of request.
NOTE: `AllowBodyForAllHttpMethods` must be set to true in Admin Settings for this feature to work. Otherwise, body will arrive to the service empty and delete all stub mappings.
Delete an existing stub mapping (identical to the POST request, but deletes instead of create)
Example request:
```js
{
"Guid": "dae02a0d-8a33-46ed-aab0-afbecc8643e3",
"Request": {
"Url": "/testabc",
"Methods": [
"put"
],
"Headers": [
{
"Name": "Content-Type",
"Matchers": [
{
"Name": "WildcardMatcher",
"Pattern": "application/*"
}
]
}
],
"Cookies": [],
"Params": [
{
"Name": "start",
"Values": [ "1000", "1001" ]
}
],
"Body": {
"Matcher": {
"Name": "JsonPathMatcher",
"Pattern": "$.things[?(@.name == 'RequiredThing')]"
}
}
},
"Response": {
"UseTransformer": true,
"StatusCode": 205,
"BodyAsJson": { "result": "test - {{request.path}}" },
"Headers": {
"Content-Type": "application/json", "a" : "b"
},
"Delay": 10
}
}
```
This is also valid syntax for the request (demonstrates multi-delete):
[{
"Guid": "dae02a0d-8a33-46ed-aab0-afbecc8643e3"
},
{
"Guid": "c181c4f6-fe48-4712-8390-e1a4b358e278"
}]
### `GET /__admin/mappings/{guid}`
Get a single stub mapping