PureBasic / Postman API / Update Collection
Back to Collection Items
IncludeFile "CkJsonObject.pb"
IncludeFile "CkStringBuilder.pb"
IncludeFile "CkHttp.pb"
IncludeFile "CkHttpResponse.pb"
Procedure ChilkatExample()
; This example assumes the Chilkat API to have been previously unlocked.
; See Global Unlock Sample for sample code.
http.i = CkHttp::ckCreate()
If http.i = 0
Debug "Failed to create object."
ProcedureReturn
EndIf
success.i
; Use this online tool to generate code from sample JSON: Generate Code to Create JSON
; The following JSON is sent in the request body.
; {
; "collection": {
; "info": {
; "name": "Sample Collection 530",
; "description": "This is just a sample collection.",
; "_postman_id": "174bad7c-07e3-45f3-914f-36cf84e5586f",
; "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
; },
; "item": [
; {
; "name": "This is a folder",
; "item": [
; {
; "name": "Sample POST Request",
; "request": {
; "url": "https://postman-echo.com/post",
; "method": "POST",
; "header": [
; {
; "key": "Content-Type",
; "value": "application/json"
; }
; ],
; "body": {
; "mode": "raw",
; "raw": "{\"data\": \"123\"}"
; },
; "description": "This is a sample POST Request"
; }
; }
; ]
; },
; {
; "name": "Sample GET Request",
; "request": {
; "url": "https://postman-echo/get",
; "method": "GET",
; "description": "This is a sample GET Request"
; }
; }
; ]
; }
; }
json.i = CkJsonObject::ckCreate()
If json.i = 0
Debug "Failed to create object."
ProcedureReturn
EndIf
CkJsonObject::ckUpdateString(json,"collection.info.name","Sample Collection 530")
CkJsonObject::ckUpdateString(json,"collection.info.description","This is just a sample collection.")
CkJsonObject::ckUpdateString(json,"collection.info._postman_id","174bad7c-07e3-45f3-914f-36cf84e5586f")
CkJsonObject::ckUpdateString(json,"collection.info.schema","https://schema.getpostman.com/json/collection/v2.1.0/collection.json")
CkJsonObject::ckUpdateString(json,"collection.item[0].name","This is a folder")
CkJsonObject::ckUpdateString(json,"collection.item[0].item[0].name","Sample POST Request")
CkJsonObject::ckUpdateString(json,"collection.item[0].item[0].request.url","https://postman-echo.com/post")
CkJsonObject::ckUpdateString(json,"collection.item[0].item[0].request.method","POST")
CkJsonObject::ckUpdateString(json,"collection.item[0].item[0].request.header[0].key","Content-Type")
CkJsonObject::ckUpdateString(json,"collection.item[0].item[0].request.header[0].value","application/json")
CkJsonObject::ckUpdateString(json,"collection.item[0].item[0].request.body.mode","raw")
CkJsonObject::ckUpdateString(json,"collection.item[0].item[0].request.body.raw","{" + Chr(34) + "data" + Chr(34) + ": " + Chr(34) + "123" + Chr(34) + "}")
CkJsonObject::ckUpdateString(json,"collection.item[0].item[0].request.description","This is a sample POST Request")
CkJsonObject::ckUpdateString(json,"collection.item[1].name","Sample GET Request")
CkJsonObject::ckUpdateString(json,"collection.item[1].request.url","https://postman-echo/get")
CkJsonObject::ckUpdateString(json,"collection.item[1].request.method","GET")
CkJsonObject::ckUpdateString(json,"collection.item[1].request.description","This is a sample GET Request")
CkHttp::ckSetRequestHeader(http,"Content-Type","application/json")
CkHttp::ckSetRequestHeader(http,"X-API-Key","{{postman_api_key}}")
sbRequestBody.i = CkStringBuilder::ckCreate()
If sbRequestBody.i = 0
Debug "Failed to create object."
ProcedureReturn
EndIf
CkJsonObject::ckEmitSb(json,sbRequestBody)
resp.i = CkHttp::ckPTextSb(http,"PUT","https://api.getpostman.com/collections/{{collection_uid}}",sbRequestBody,"utf-8","application/json",0,0)
If CkHttp::ckLastMethodSuccess(http) = 0
Debug CkHttp::ckLastErrorText(http)
CkHttp::ckDispose(http)
CkJsonObject::ckDispose(json)
CkStringBuilder::ckDispose(sbRequestBody)
ProcedureReturn
EndIf
sbResponseBody.i = CkStringBuilder::ckCreate()
If sbResponseBody.i = 0
Debug "Failed to create object."
ProcedureReturn
EndIf
CkHttpResponse::ckGetBodySb(resp,sbResponseBody)
jResp.i = CkJsonObject::ckCreate()
If jResp.i = 0
Debug "Failed to create object."
ProcedureReturn
EndIf
CkJsonObject::ckLoadSb(jResp,sbResponseBody)
CkJsonObject::setCkEmitCompact(jResp, 0)
Debug "Response Body:"
Debug CkJsonObject::ckEmit(jResp)
respStatusCode.i = CkHttpResponse::ckStatusCode(resp)
Debug "Response Status Code = " + Str(respStatusCode)
If respStatusCode >= 400
Debug "Response Header:"
Debug CkHttpResponse::ckHeader(resp)
Debug "Failed."
CkHttpResponse::ckDispose(resp)
CkHttp::ckDispose(http)
CkJsonObject::ckDispose(json)
CkStringBuilder::ckDispose(sbRequestBody)
CkStringBuilder::ckDispose(sbResponseBody)
CkJsonObject::ckDispose(jResp)
ProcedureReturn
EndIf
CkHttpResponse::ckDispose(resp)
; Sample JSON response:
; (Sample code for parsing the JSON response is shown below)
; {
; "collection": {
; "id": "1d3daef4-2037-4584-ab86-bafd8c8f8a55",
; "name": "Sample Collection",
; "uid": "5852-1d3daef4-2037-4584-ab86-bafd8c8f8a55"
; }
; }
; Sample code for parsing the JSON response...
; Use this online tool to generate parsing code from sample JSON: Generate JSON Parsing Code
Id.s = CkJsonObject::ckStringOf(jResp,"collection.id")
Name.s = CkJsonObject::ckStringOf(jResp,"collection.name")
Uid.s = CkJsonObject::ckStringOf(jResp,"collection.uid")
CkHttp::ckDispose(http)
CkJsonObject::ckDispose(json)
CkStringBuilder::ckDispose(sbRequestBody)
CkStringBuilder::ckDispose(sbResponseBody)
CkJsonObject::ckDispose(jResp)
ProcedureReturn
EndProcedure
Curl Command
curl -X PUT
-H "X-API-Key: {{postman_api_key}}"
-H "Content-Type: application/json"
-d '{
"collection": {
"info": {
"name": "Sample Collection 530",
"description": "This is just a sample collection.",
"_postman_id": "174bad7c-07e3-45f3-914f-36cf84e5586f",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
},
"item": [
{
"name": "This is a folder",
"item": [
{
"name": "Sample POST Request",
"request": {
"url": "https://postman-echo.com/post",
"method": "POST",
"header": [
{
"key": "Content-Type",
"value": "application/json"
}
],
"body": {
"mode": "raw",
"raw": "{\"data\": \"123\"}"
},
"description": "This is a sample POST Request"
}
}
]
},
{
"name": "Sample GET Request",
"request": {
"url": "https://postman-echo/get",
"method": "GET",
"description": "This is a sample GET Request"
}
}
]
}
}'
https://api.getpostman.com/collections/{{collection_uid}}
Postman Collection Item JSON
{
"name": "Update Collection",
"event": [
{
"listen": "test",
"script": {
"type": "text/javascript",
"exec": [
"pm.test(\"response is ok\", function () {",
" pm.response.to.have.status(200);",
"});",
"",
"pm.test(\"response json data should not have errors\", function () {",
" pm.response.to.have.jsonBody();",
" pm.response.to.not.have.jsonBody('error');",
"});",
"",
"pm.test(\"response json should contain one collection\", function () {",
" pm.expect(pm.response.json()).to.have.property('collection').and.be.an('object');",
"});",
"",
"// additional tests to ensure that the relevant environment variables are present",
"pm.test('\"postman_api_key\" variable should be present', function () {",
" pm.expect(pm.variables.get('postman_api_key')).to.be.a('string');",
"});",
"",
"// we double check the request to ensure that relevant parameters are present",
"pm.test(\"request body must have valid json\", function () {",
" var _ = require('lodash'),",
" requestJSON = JSON.parse(_.get(pm.request, 'body.raw', '{}')),",
" collectionIdInRequestUrl = _.get(pm.request, 'url.path[1]', '').replace(/^.*?-/, '');",
"",
" // the request body collection should have the same collection Id as sent in URL",
" pm.expect(requestJSON).to.have.nested.property('collection.info._postman_id', ",
" collectionIdInRequestUrl);",
"});",
"",
"// you can unskip this test in case you want to have a stricter check on the selected",
"// environment.",
"pm.test.skip('\"collection_uid\" variable should be present', function () {",
" pm.expect(pm.variables.get('collection_uid')).to.be.a('string');",
"});"
]
}
}
],
"request": {
"method": "PUT",
"header": [
{
"key": "Content-Type",
"value": "application/json"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"collection\": {\n \"info\": {\n \"name\": \"Sample Collection 530\",\n \"description\": \"This is just a sample collection.\",\n \"_postman_id\": \"174bad7c-07e3-45f3-914f-36cf84e5586f\",\n \"schema\": \"https://schema.getpostman.com/json/collection/v2.1.0/collection.json\"\n },\n \"item\": [\n {\n \"name\": \"This is a folder\",\n \"item\": [\n {\n \"name\": \"Sample POST Request\",\n \"request\": {\n \"url\": \"https://postman-echo.com/post\",\n \"method\": \"POST\",\n \"header\": [\n {\n \"key\": \"Content-Type\",\n \"value\": \"application/json\"\n }\n ],\n \"body\": {\n \"mode\": \"raw\",\n \"raw\": \"{\\\"data\\\": \\\"123\\\"}\"\n },\n \"description\": \"This is a sample POST Request\"\n }\n }\n ]\n },\n {\n \"name\": \"Sample GET Request\",\n \"request\": {\n \"url\": \"https://postman-echo/get\",\n \"method\": \"GET\",\n \"description\": \"This is a sample GET Request\"\n }\n }\n ]\n }\n}"
},
"url": {
"raw": "https://api.getpostman.com/collections/{{collection_uid}}",
"protocol": "https",
"host": [
"api",
"getpostman",
"com"
],
"path": [
"collections",
"{{collection_uid}}"
]
},
"description": "This endpoint allows you to update an existing collection using the Postman Collection v2 format. For more information about the v2 schema, check the format [here](https://schema.getpostman.com/json/collection/v2.0.0/docs/index.html).\n\nOn successful updation of the collection, the response returns the collection `name`, `id` and `uid`.\n\n> Requires <a href=\"#authentication\">API Key</a> as `X-Api-Key` request header or `apikey` URL query parameter.\n\nNote: Please be careful when trying to update the collection, as the existing collection will be replaced by the request body."
},
"response": [
{
"name": "Collection Not Found",
"originalRequest": {
"method": "PUT",
"header": [
{
"key": "Content-Type",
"value": "application/json"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"collection\": {\n \"variables\": [],\n \"info\": {\n \"name\": \"Sample Collection\",\n \"_postman_id\": \"1d3daef4-2037-4584-ab86-bafd8c8f8a54\",\n \"description\": \"This is just a sample collection.\",\n \"schema\": \"https://schema.getpostman.com/json/collection/v2.0.0/collection.json\"\n },\n \"item\": [\n {\n \"name\": \"This is a folder\",\n \"description\": \"\",\n \"item\": [\n {\n \"_postman_id\": \"b5e8d7dd-909c-4ba7-aef4-8609bc50b586\",\n \"name\": \"Sample POST Request\",\n \"request\": {\n \"url\": \"echo.getpostman.com/post\",\n \"method\": \"POST\",\n \"header\": [\n {\n \"key\": \"Content-Type\",\n \"value\": \"application/json\",\n \"description\": \"\"\n }\n ],\n \"body\": {\n \"mode\": \"raw\",\n \"raw\": \"{\\n\\t\\\"data\\\": \\\"123\\\"\\n}\"\n },\n \"description\": \"This is a sample POST Request\"\n },\n \"response\": []\n }\n ]\n },\n {\n \"name\": \"This is a second folder\",\n \"description\": \"This is the second folder\",\n \"item\": []\n },\n {\n \"name\": \"Sample GET Request\",\n \"request\": {\n \"url\": \"echo.getpostman.com/get\",\n \"method\": \"GET\",\n \"header\": [],\n \"body\": {\n \"mode\": \"formdata\",\n \"formdata\": []\n },\n \"description\": \"This is a sample GET Request\"\n },\n \"response\": []\n },\n {\n \"name\": \"This is the second request\",\n \"request\": {\n \"url\": \"echo.getpostman.com/post\",\n \"method\": \"POST\",\n \"header\": [],\n \"body\": {\n \"mode\": \"formdata\",\n \"formdata\": []\n },\n \"description\": \"This is the second request\"\n },\n \"response\": []\n }\n ]\n }\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "https://api.getpostman.com/collections/{{collection_uid}}",
"protocol": "https",
"host": [
"api",
"getpostman",
"com"
],
"path": [
"collections",
"{{collection_uid}}"
]
}
},
"status": "Not Found",
"code": 404,
"_postman_previewlanguage": "json",
"header": [
{
"key": "Content-Type",
"value": "application/json",
"name": "Content-Type",
"description": {
"content": "",
"type": "text/plain"
}
}
],
"cookie": [
],
"body": "{\n \"error\": {\n \"name\": \"instanceNotFoundError\",\n \"message\": \"The specified item does not exist.\",\n \"details\": {\n \"item\": \"collection\",\n \"id\": \"1d3daef4-2037-4584-ab86-bafd8c8f8a54\"\n }\n }\n}"
},
{
"name": "Not Enough Permissions",
"originalRequest": {
"method": "PUT",
"header": [
{
"name": "Content-Type",
"key": "Content-Type",
"value": "application/json"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"collection\": {\n \"variables\": [],\n \"info\": {\n \"name\": \"Sample Collection\",\n \"_postman_id\": \"f7e2f1e3-94fb-55a6-e491-ce5cc80aa451\",\n \"description\": \"This is just a sample collection.\",\n \"schema\": \"https://schema.getpostman.com/json/collection/v2.0.0/collection.json\"\n },\n \"item\": [\n {\n \"name\": \"This is a folder\",\n \"description\": \"\",\n \"item\": [\n {\n \"_postman_id\": \"b5e8d7dd-909c-4ba7-aef4-8609bc50b586\",\n \"name\": \"Sample POST Request\",\n \"request\": {\n \"url\": \"echo.getpostman.com/post\",\n \"method\": \"POST\",\n \"header\": [\n {\n \"key\": \"Content-Type\",\n \"value\": \"application/json\",\n \"description\": \"\"\n }\n ],\n \"body\": {\n \"mode\": \"raw\",\n \"raw\": \"{\\n\\t\\\"data\\\": \\\"123\\\"\\n}\"\n },\n \"description\": \"This is a sample POST Request\"\n },\n \"response\": []\n }\n ]\n },\n {\n \"name\": \"This is a second folder\",\n \"description\": \"This is the second folder\",\n \"item\": []\n },\n {\n \"name\": \"Sample GET Request\",\n \"request\": {\n \"url\": \"echo.getpostman.com/get\",\n \"method\": \"GET\",\n \"header\": [],\n \"body\": {\n \"mode\": \"formdata\",\n \"formdata\": []\n },\n \"description\": \"This is a sample GET Request\"\n },\n \"response\": []\n },\n {\n \"name\": \"This is the second request\",\n \"request\": {\n \"url\": \"echo.getpostman.com/post\",\n \"method\": \"POST\",\n \"header\": [],\n \"body\": {\n \"mode\": \"formdata\",\n \"formdata\": []\n },\n \"description\": \"This is the second request\"\n },\n \"response\": []\n }\n ]\n }\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "https://api.getpostman.com/collections/{{collection_uid}}",
"protocol": "https",
"host": [
"api",
"getpostman",
"com"
],
"path": [
"collections",
"{{collection_uid}}"
]
}
},
"status": "Forbidden",
"code": 403,
"_postman_previewlanguage": "json",
"header": [
{
"key": "Content-Type",
"value": "application/json",
"description": {
"content": "",
"type": "text/plain"
}
}
],
"cookie": [
],
"body": "{\n \"error\": {\n \"name\": \"forbiddenError\",\n \"message\": \"You do not have enough permissions to perform this action.\"\n }\n}"
},
{
"name": "Malformed Request",
"originalRequest": {
"method": "PUT",
"header": [
{
"name": "Content-Type",
"key": "Content-Type",
"value": "application/json"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"collection\": {\n \"variables\": [],\n \"info\": {\n \"_postman_id\": \"1d3daef4-2037-4584-ab86-bafd8c8f8a55\",\n \"description\": \"This is just a sample collection.\",\n \"schema\": \"https://schema.getpostman.com/json/collection/v2.0.0/collection.json\"\n },\n \"item\": [\n {\n \"name\": \"This is a folder\",\n \"description\": \"\",\n \"item\": [\n {\n \"_postman_id\": \"b5e8d7dd-909c-4ba7-aef4-8609bc50b586\",\n \"name\": \"Sample POST Request\",\n \"request\": {\n \"url\": \"echo.getpostman.com/post\",\n \"method\": \"POST\",\n \"header\": [\n {\n \"key\": \"Content-Type\",\n \"value\": \"application/json\",\n \"description\": \"\"\n }\n ],\n \"body\": {\n \"mode\": \"raw\",\n \"raw\": \"{\\n\\t\\\"data\\\": \\\"123\\\"\\n}\"\n },\n \"description\": \"This is a sample POST Request\"\n },\n \"response\": []\n }\n ]\n },\n {\n \"name\": \"This is a second folder\",\n \"description\": \"This is the second folder\",\n \"item\": []\n },\n {\n \"name\": \"Sample GET Request\",\n \"request\": {\n \"url\": \"echo.getpostman.com/get\",\n \"method\": \"GET\",\n \"header\": [],\n \"body\": {\n \"mode\": \"formdata\",\n \"formdata\": []\n },\n \"description\": \"This is a sample GET Request\"\n },\n \"response\": []\n },\n {\n \"name\": \"This is the second request\",\n \"request\": {\n \"url\": \"echo.getpostman.com/post\",\n \"method\": \"POST\",\n \"header\": [],\n \"body\": {\n \"mode\": \"formdata\",\n \"formdata\": []\n },\n \"description\": \"This is the second request\"\n },\n \"response\": []\n }\n ]\n }\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "https://api.getpostman.com/collections/{{collection_uid}}",
"protocol": "https",
"host": [
"api",
"getpostman",
"com"
],
"path": [
"collections",
"{{collection_uid}}"
]
}
},
"status": "Bad Request",
"code": 400,
"_postman_previewlanguage": "json",
"header": [
{
"key": "Content-Type",
"value": "application/json",
"name": "Content-Type",
"description": {
"content": "",
"type": "text/plain"
}
}
],
"cookie": [
],
"body": "{\n \"error\": {\n \"name\": \"malformedRequestError\",\n \"message\": \"Missing required property: name at info\"\n }\n}"
},
{
"name": "Collection ID Mismatch",
"originalRequest": {
"method": "PUT",
"header": [
{
"name": "Content-Type",
"key": "Content-Type",
"value": "application/json"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"collection\": {\n \"variables\": [],\n \"info\": {\n \"name\": \"Sample Collection\",\n \"_postman_id\": \"1d3daef4-2037-4584-ab86-bafd8c8f8a54\",\n \"description\": \"This is just a sample collection.\",\n \"schema\": \"https://schema.getpostman.com/json/collection/v2.0.0/collection.json\"\n },\n \"item\": [\n {\n \"name\": \"This is a folder\",\n \"description\": \"\",\n \"item\": [\n {\n \"_postman_id\": \"b5e8d7dd-909c-4ba7-aef4-8609bc50b586\",\n \"name\": \"Sample POST Request\",\n \"request\": {\n \"url\": \"echo.getpostman.com/post\",\n \"method\": \"POST\",\n \"header\": [\n {\n \"key\": \"Content-Type\",\n \"value\": \"application/json\",\n \"description\": \"\"\n }\n ],\n \"body\": {\n \"mode\": \"raw\",\n \"raw\": \"{\\n\\t\\\"data\\\": \\\"123\\\"\\n}\"\n },\n \"description\": \"This is a sample POST Request\"\n },\n \"response\": []\n }\n ]\n },\n {\n \"name\": \"This is a second folder\",\n \"description\": \"This is the second folder\",\n \"item\": []\n },\n {\n \"name\": \"Sample GET Request\",\n \"request\": {\n \"url\": \"echo.getpostman.com/get\",\n \"method\": \"GET\",\n \"header\": [],\n \"body\": {\n \"mode\": \"formdata\",\n \"formdata\": []\n },\n \"description\": \"This is a sample GET Request\"\n },\n \"response\": []\n },\n {\n \"name\": \"This is the second request\",\n \"request\": {\n \"url\": \"echo.getpostman.com/post\",\n \"method\": \"POST\",\n \"header\": [],\n \"body\": {\n \"mode\": \"formdata\",\n \"formdata\": []\n },\n \"description\": \"This is the second request\"\n },\n \"response\": []\n }\n ]\n }\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "https://api.getpostman.com/collections/{{collection_uid}}",
"protocol": "https",
"host": [
"api",
"getpostman",
"com"
],
"path": [
"collections",
"{{collection_uid}}"
]
}
},
"status": "Bad Request",
"code": 400,
"_postman_previewlanguage": "json",
"header": [
{
"key": "Content-Type",
"value": "application/json",
"name": "Content-Type",
"description": {
"content": "",
"type": "text/plain"
}
}
],
"cookie": [
],
"body": "{\n \"error\": {\n \"name\": \"collectionMismatchError\",\n \"message\": \"The collection ID in the path does not match the collection ID in the request body.\"\n }\n}"
},
{
"name": "Collection Updated",
"originalRequest": {
"method": "PUT",
"header": [
{
"name": "Content-Type",
"key": "Content-Type",
"value": "application/json"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"collection\": {\n \"variables\": [],\n \"info\": {\n \"name\": \"Sample Collection\",\n \"_postman_id\": \"1d3daef4-2037-4584-ab86-bafd8c8f8a55\",\n \"description\": \"This is just a sample collection.\",\n \"schema\": \"https://schema.getpostman.com/json/collection/v2.0.0/collection.json\"\n },\n \"item\": [\n {\n \"name\": \"This is a folder\",\n \"description\": \"\",\n \"item\": [\n {\n \"_postman_id\": \"b5e8d7dd-909c-4ba7-aef4-8609bc50b586\",\n \"name\": \"Sample POST Request\",\n \"request\": {\n \"url\": \"echo.getpostman.com/post\",\n \"method\": \"POST\",\n \"header\": [\n {\n \"key\": \"Content-Type\",\n \"value\": \"application/json\",\n \"description\": \"\"\n }\n ],\n \"body\": {\n \"mode\": \"raw\",\n \"raw\": \"{\\n\\t\\\"data\\\": \\\"123\\\"\\n}\"\n },\n \"description\": \"This is a sample POST Request\"\n },\n \"response\": []\n }\n ]\n },\n {\n \"name\": \"This is a second folder\",\n \"description\": \"This is the second folder\",\n \"item\": []\n },\n {\n \"name\": \"Sample GET Request\",\n \"request\": {\n \"url\": \"echo.getpostman.com/get\",\n \"method\": \"GET\",\n \"header\": [],\n \"body\": {\n \"mode\": \"formdata\",\n \"formdata\": []\n },\n \"description\": \"This is a sample GET Request\"\n },\n \"response\": []\n },\n {\n \"name\": \"This is the second request\",\n \"request\": {\n \"url\": \"echo.getpostman.com/post\",\n \"method\": \"POST\",\n \"header\": [],\n \"body\": {\n \"mode\": \"formdata\",\n \"formdata\": []\n },\n \"description\": \"This is the second request\"\n },\n \"response\": []\n }\n ]\n }\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "https://api.getpostman.com/collections/{{collection_uid}}",
"protocol": "https",
"host": [
"api",
"getpostman",
"com"
],
"path": [
"collections",
"{{collection_uid}}"
]
}
},
"status": "OK",
"code": 200,
"_postman_previewlanguage": "json",
"header": [
{
"key": "Content-Type",
"value": "application/json",
"name": "Content-Type",
"description": {
"content": "",
"type": "text/plain"
}
}
],
"cookie": [
],
"body": "{\n \"collection\": {\n \"id\": \"1d3daef4-2037-4584-ab86-bafd8c8f8a55\",\n \"name\": \"Sample Collection\",\n \"uid\": \"5852-1d3daef4-2037-4584-ab86-bafd8c8f8a55\"\n }\n}"
}
]
}