Mock APIs
Teams
Organisations
Data sources
Database connections
Usage
Access control
Stub Mappings
- GETGet all stub mappings
- POSTCreate a new stub mapping
- DELDelete all stub mappings
- POSTReset stub mappings
- POSTPersist stub mappings
- POSTImport stub mappings
- GETGet stub mapping by ID
- PUTUpdate a stub mapping
- DELDelete a stub mapping
- POSTFind stub mappings matching metadata
- POSTDelete stub mappings matching metadata
Requests
- GETGet all requests in journal
- DELDelete all requests in journal
- GETGet request by ID
- DELDelete request by ID
- POSTEmpty the request journaldeprecated
- POSTCount requests by criteria
- POSTRemove requests by criteria
- POSTDelete requests mappings matching metadata
- POSTFind requests by criteria
- GETFind unmatched requests
OpenAPI
Imports
Import into a mock API
Import any supported format into your Mock API. The supplied data will be converted into stubs that your Mock API will be populated with. Supported formats include WireMock mappings JSON files, OpenAPI specifications, Postman collections, HAR (HTTP Archive) logs, WireMock request log JSON files and WireMock directories.
curl --request POST \
--url https://wmc.wiremockapi.cloud/v1/mock-apis/{mockApiId}/imports \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: */*' \
--data '{
"mappings": [
{
"id": "<string>",
"uuid": "<string>",
"name": "<string>",
"request": "{\n \"urlPath\" : \"/charges\",\n \"method\" : \"POST\",\n \"headers\" : {\n \"Content-Type\" : {\n \"equalTo\" : \"application/json\"\n }\n }\n",
"response": {
"status": 123,
"statusMessage": "<string>",
"headers": {},
"additionalProxyRequestHeaders": {},
"removeProxyRequestHeaders": [
"<string>"
],
"body": "<string>",
"base64Body": "<string>",
"jsonBody": "<any>",
"bodyFileName": "user-profile-responses/user1.json",
"fault": "CONNECTION_RESET_BY_PEER",
"fixedDelayMilliseconds": 123,
"delayDistribution": {
"median": 123,
"sigma": 123,
"type": "lognormal"
},
"chunkedDribbleDelay": {
"numberOfChunks": 123,
"totalDuration": 123
},
"fromConfiguredStub": true,
"proxyBaseUrl": "<string>",
"proxyUrlPrefixToRemove": "<string>",
"transformerParameters": {},
"transformers": [
"<string>"
]
},
"persistent": true,
"priority": 2,
"scenarioName": "<string>",
"requiredScenarioState": "<string>",
"newScenarioState": "<string>",
"postServeActions": {},
"serveEventListeners": [
{
"name": "change-state",
"parameters": {
"operations": [
{
"operation": "SET",
"context": "<string>",
"key": "<string>",
"value": "<string>"
}
]
}
}
],
"metadata": {}
}
]
}'
Authorizations
Basic authentication header of the form Basic <encoded-value>
, where <encoded-value>
is the base64-encoded string username:password
.
Path Parameters
The ID of the Mock API
5 - 10
"jjl8y"
Body
A JSON file containing WireMock stub mappings.
A JSON file containing WireMock stub mappings.
Any valid OpenAPI specification.
Any valid Postman collection.
Any valid HAR (HTTP Archive) log file.
A request log returned from the Get all requests endpoint.
Response
Successfully imported
curl --request POST \
--url https://wmc.wiremockapi.cloud/v1/mock-apis/{mockApiId}/imports \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: */*' \
--data '{
"mappings": [
{
"id": "<string>",
"uuid": "<string>",
"name": "<string>",
"request": "{\n \"urlPath\" : \"/charges\",\n \"method\" : \"POST\",\n \"headers\" : {\n \"Content-Type\" : {\n \"equalTo\" : \"application/json\"\n }\n }\n",
"response": {
"status": 123,
"statusMessage": "<string>",
"headers": {},
"additionalProxyRequestHeaders": {},
"removeProxyRequestHeaders": [
"<string>"
],
"body": "<string>",
"base64Body": "<string>",
"jsonBody": "<any>",
"bodyFileName": "user-profile-responses/user1.json",
"fault": "CONNECTION_RESET_BY_PEER",
"fixedDelayMilliseconds": 123,
"delayDistribution": {
"median": 123,
"sigma": 123,
"type": "lognormal"
},
"chunkedDribbleDelay": {
"numberOfChunks": 123,
"totalDuration": 123
},
"fromConfiguredStub": true,
"proxyBaseUrl": "<string>",
"proxyUrlPrefixToRemove": "<string>",
"transformerParameters": {},
"transformers": [
"<string>"
]
},
"persistent": true,
"priority": 2,
"scenarioName": "<string>",
"requiredScenarioState": "<string>",
"newScenarioState": "<string>",
"postServeActions": {},
"serveEventListeners": [
{
"name": "change-state",
"parameters": {
"operations": [
{
"operation": "SET",
"context": "<string>",
"key": "<string>",
"value": "<string>"
}
]
}
}
],
"metadata": {}
}
]
}'