Create a Mock response
POST https://api.getpostman.com/collections/{{collectionId}}/responses?request={{requestId}}
Creates a request response in a collection. For a complete list of properties, see the [Collection Format Response documentation]
Note:
It is recommended that you pass the name
property in the request body. If you do not, the system uses a null value. As a result, this creates a response with a blank name.
Request Params
Key | Datatype | Required | Description |
---|---|---|---|
request | string | (Required) The parent request's ID. |
Request Body
{"name"=>"OK {{company}} ({{material}})", "responseCode"=>{"code"=>200, "name"=>"OK"}, "headers"=>[{"key"=>"content-type", "value"=>"application/json; charset=utf-8"}], "text"=>"{\n \"id\": \"{{company}}\", \n \"name\": \"OK {{company}}\", \n \"city\": \"{{city}}\", \n \"motto\": \"{{motto}}\", \n \"description\": \"{{description}}\", \n \"associations\": \n [{\n\"name\": \"{{product}}\",\n\"type\": \"product\",\n\"url\": \"{{url}}\",\n\"material\": \"{{material}}\" \n }\n ]\n}", "language"=>"json", "requestObject"=>"{\"method\":\"GET\",\"headers\":\"X-Api-Key: <API Key>\\n\",\"pathVariables\":{\"companyId\":\"{{company}}\"},\"url\":\"{{baseUrl}}/companies/:companyId?material={{material}}\",\"pathVariableData\":[{\"key\":\"companyId\",\"value\":\"{{company}}\",\"description\":\"(Required) Company ID\"}],\"queryParams\":[{\"key\":\"material\",\"value\":\"{{material}}\",\"equals\":true,\"description\":\"\",\"enabled\":true},{\"key\":\"mode\",\"value\":\"exact\",\"equals\":true,\"description\":\"\",\"enabled\":false}],\"headerData\":[{\"description\":\"Added as a part of security scheme: apikey\",\"key\":\"X-Api-Key\",\"value\":\"<API Key>\"}],\"dataMode\":null,\"data\":null,\"protocolProfileBehavior\":{\"disableBodyPruning\":true}}"}