curl --request POST \
--url https://wmc.wiremockapi.cloud/v1/mock-apis/{mockApiId}/imports \
--header 'Authorization: <api-key>' \
--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": "<unknown>",
"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": {}
}
]
}
'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: <api-key>' \
--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": "<unknown>",
"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": {}
}
]
}
'The ID of the Mock API
5 - 10"jjl8y"
A JSON file containing WireMock stub mappings.
Show child attributes
Successfully imported