{"info":{"_postman_id":"11116a67-ce46-44c0-a3b0-fd33150eb8ce","name":"Sunbird Composite Search API","description":"<html><head></head><body><p>The Composite Search APIs allow you to search the Content, assets and Assesment on the Sunbird platform.</p>\n<p>The URL for Composite Search API(s) is /composite/v3/search.</p>\n</body></html>","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","toc":[],"owner":"25463377","collectionId":"11116a67-ce46-44c0-a3b0-fd33150eb8ce","publishedId":"2s8ZDa3MP7","public":true,"customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"EF5B25"},"publishDate":"2023-01-23T09:55:46.000Z"},"item":[{"name":"Positive","item":[{"name":"Content Search","item":[{"name":"200 - Get live Content list","event":[{"listen":"test","script":{"exec":["let jsonResponse = pm.response.json();","","pm.test(\"Status code is 200\", function () {","    pm.response.to.have.status(200);","});","","pm.test(\"Verify keys and data type of the response result\", () => {","    pm.expect(jsonResponse.result.content).to.be.a(\"array\");","});","","pm.test(\"Content type should be Content\", function () {","    pm.expect(jsonResponse.result.content[0].contentType).to.eql('Resource');","});","","//Validation","pm.test(\"id should be api.v1.search\", function () {","   pm.expect(jsonResponse.id).to.eql(\"api.v1.search\");","});","pm.test(\"ver should be 1.0\", function () {","   pm.expect(jsonResponse.ver).to.eql(\"1.0\");","});",""],"type":"text/javascript","id":"b1424ed4-cbdd-4258-9c64-15848ecd808a"}}],"id":"e1aa4af9-6422-4bf5-a92c-f948b81560d8","protocolProfileBehavior":{"disabledSystemHeaders":{"connection":true},"disableUrlEncoding":false,"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Content-Type","value":"application/json"},{"key":"user-id","value":"ae94b68c-a535-4dce-8e7a-fb9662b0ad68","type":"text"}],"body":{"mode":"raw","raw":"{\n    \"request\": {\n        \"filters\": {\n            \"status\": [\n                \"Live\"\n            ],\n            \"mimeType\": \"application/vnd.ekstep.ecml-archive\",\n            \"contentType\": \"Resource\",\n            \"objectType\": \"Content\"\n        },\n        \"sort_by\": {\n            \"lastUpdatedOn\": \"desc\"\n        }\n    }\n}"},"url":"{{host}}/action/composite/v3/search","description":"<p>This API is associated with search API\nThe endpoint for search is /composite/v3/search</p>\n","urlObject":{"path":["action","composite","v3","search"],"host":["{{host}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"e1aa4af9-6422-4bf5-a92c-f948b81560d8"}],"id":"2c1683e9-8942-46b1-8177-eaa8ad5e95f4","_postman_id":"2c1683e9-8942-46b1-8177-eaa8ad5e95f4","description":""},{"name":"Assessment Search","item":[{"name":"200 - Get live Assesment list","event":[{"listen":"test","script":{"exec":["let jsonResponse = pm.response.json();","","pm.test(\"Status code is 200\", function () {","    pm.response.to.have.status(200);","});","","pm.test(\"Verify keys and data type of the response result\", () => {","    pm.expect(jsonResponse.result.items).to.be.a(\"array\");","});","","pm.test(\"Content type should be Asset\", function () {","    pm.expect(jsonResponse.result.items[0].objectType).to.eql('AssessmentItem');","});","","//Validation","pm.test(\"id should be api.v1.search\", function () {","   pm.expect(jsonResponse.id).to.eql(\"api.v1.search\");","});","pm.test(\"ver should be 1.0\", function () {","   pm.expect(jsonResponse.ver).to.eql(\"1.0\");","});",""],"type":"text/javascript","id":"6cab4d85-1192-4957-afe5-3c20c237d204"}}],"id":"3dba6b4a-3551-427e-bfe7-8f1290798564","protocolProfileBehavior":{"disabledSystemHeaders":{"connection":true},"disableUrlEncoding":false,"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Content-Type","value":"application/json"},{"key":"user-id","value":"ae94b68c-a535-4dce-8e7a-fb9662b0ad68","type":"text"}],"body":{"mode":"raw","raw":"{\n    \"request\": {\n        \"filters\": {\n            \"objectType\": [\n                \"AssessmentItem\"\n            ],\n            \"status\": [\n                \"Live\"\n            ]\n        },\n        \"sort_by\": {\n            \"lastUpdatedOn\": \"desc\"\n        },\n        \"limit\": 50\n    }\n}"},"url":"{{host}}/action/composite/v3/search","urlObject":{"path":["action","composite","v3","search"],"host":["{{host}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"3dba6b4a-3551-427e-bfe7-8f1290798564"}],"id":"b6f448ee-b7a4-4947-8e13-c9a15255dd00","_postman_id":"b6f448ee-b7a4-4947-8e13-c9a15255dd00","description":""},{"name":"Asset Search","item":[{"name":"200 - Get live assets list","event":[{"listen":"test","script":{"exec":["let jsonResponse = pm.response.json();","","pm.test(\"Status code is 200\", function () {","    pm.response.to.have.status(200);","});","","pm.test(\"Verify keys and data type of the response result\", () => {","    pm.expect(jsonResponse.result.content).to.be.a(\"array\");","});","","pm.test(\"Content type should be Asset\", function () {","    pm.expect(jsonResponse.result.content[0].contentType).to.eql('Asset');","});","","//Validation","pm.test(\"id should be api.v1.search\", function () {","   pm.expect(jsonResponse.id).to.eql(\"api.v1.search\");","});","pm.test(\"ver should be 1.0\", function () {","   pm.expect(jsonResponse.ver).to.eql(\"1.0\");","});",""],"type":"text/javascript","id":"60a033a5-43b0-491e-a016-fb8d19ca7647"}}],"id":"249e1262-0d16-49ac-96e6-ab5d207285d5","protocolProfileBehavior":{"disableUrlEncoding":false,"disabledSystemHeaders":{"connection":true},"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Content-Type","value":"application/json"},{"key":"user-id","type":"text","value":"ae94b68c-a535-4dce-8e7a-fb9662b0ad68"}],"body":{"mode":"raw","raw":"{\n    \"request\": {\n        \"filters\": {\n            \"mediaType\": [\n                \"image\"\n            ],\n            \"contentType\": [\n                \"Asset\"\n            ],\n            \"status\": [\n                \"Live\"\n            ]\n        },\n        \"limit\": 50,\n        \"offset\": 0\n    }\n}"},"url":"{{host}}/action/composite/v3/search","urlObject":{"path":["action","composite","v3","search"],"host":["{{host}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"249e1262-0d16-49ac-96e6-ab5d207285d5"}],"id":"0f9f4414-4bdf-4abd-9891-ea51cdd53a8c","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":[""],"id":"fcb0687a-3cb7-46cc-95e0-7f2a5866f712"}},{"listen":"test","script":{"type":"text/javascript","exec":[""],"id":"43f8ea04-f9b3-4579-a830-5a8c0ac7a91c"}}],"_postman_id":"0f9f4414-4bdf-4abd-9891-ea51cdd53a8c","description":""}],"id":"c2249e5a-bc77-4a7b-acf5-993ef26e2d6c","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":[""],"id":"6e9d5886-e9c9-4974-9341-7d3973015513"}},{"listen":"test","script":{"type":"text/javascript","exec":["let jsonResponse = pm.response.json();","","//Verification","pm.test(\"Status code is 200\", () => {","    pm.response.to.have.status(200)","});","//code name contains a string","tests[\"Status code name has string OK\"] = responseCode.name.has(\"OK\");","","pm.test(\"Verify keys and data type of the params in positive scenario\", () => {","  pm.expect(jsonResponse.params.resmsgid).to.be.a(\"string\");","  pm.expect(jsonResponse.params.err).to.be.null;","  pm.expect(jsonResponse.params.status).to.be.a(\"string\");","  pm.expect(jsonResponse.params.errmsg).to.be.null;","});","","pm.test(\"params.status should be \\\"successful\\\"\", () => {","    pm.expect(jsonResponse.params.status).to.eql(\"successful\");","});","pm.test(\"responseCode should be OK\", () => {","    pm.expect(jsonResponse.responseCode).to.eql(\"OK\");","});"],"id":"4ed2e1fe-f5ab-4444-8a8e-5420dda1789c"}}],"_postman_id":"c2249e5a-bc77-4a7b-acf5-993ef26e2d6c","description":""},{"name":"Negative","item":[{"name":"400 - Search filters missing","event":[{"listen":"test","script":{"exec":["let jsonResponse = pm.response.json()","","//Verification","pm.test(\"Status code is 400\", () => {","    pm.response.to.have.status(400)","});","//code name contains a string","tests[\"Status code name has string \\\"Bad Request\\\"\"] = responseCode.name.has(\"Bad Request\");","","pm.test(\"Verify keys and data type of the response result\", () => {","  pm.expect(jsonResponse.result).to.be.an(\"object\");","});","","//Validation","// Response body","pm.test(\"responseCode should be \\\"CLIENT_ERROR\\\"\", () => {","    pm.expect(jsonResponse.responseCode).to.eql(\"CLIENT_ERROR\");","});","","// Params","pm.test(\"params.err should be \\\"ERR_CONTENT_SEARCH_FIELDS_MISSING\\\"\", () => {","    pm.expect(jsonResponse.params.err).to.eql(\"ERR_CONTENT_SEARCH_FIELDS_MISSING\");","});","pm.test(\"params.errmsg should be \\\"Required fields for search content are missing\\\"\", () => {","    pm.expect(jsonResponse.params.errmsg).to.eql(\"Required fields for search content are missing\");","});"],"type":"text/javascript","id":"cc2ac7b2-bd50-4792-bbf0-cee94658b5d6"}}],"id":"a0e7ff9b-ca6d-4725-b54f-b72b3ca49574","protocolProfileBehavior":{"disabledSystemHeaders":{"connection":true},"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Content-Type","value":"application/json"},{"key":"X-Authenticated-User-token","value":"{{keycloak_access_token}}"},{"key":"Authorization","value":"{{kong_api_key}}"}],"body":{"mode":"raw","raw":"{\n    \"request\": {\n    }\n}"},"url":"{{host}}/action/composite/v3/search","description":"<p>This API is associated with batch creation\nThe endpoint for Creates a Batch is /batch/create\nThe fields marked with an asterisk (*) are mandatory. They cannot be null or empty.</p>\n","urlObject":{"path":["action","composite","v3","search"],"host":["{{host}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"a0e7ff9b-ca6d-4725-b54f-b72b3ca49574"},{"name":"500 - parameter cannot be negative","event":[{"listen":"test","script":{"exec":["let jsonResponse = pm.response.json()","","//Verification","pm.test(\"Status code is 500\", () => {","    pm.response.to.have.status(500)","});","","pm.test(\"Verify keys and data type of the response result\", () => {","  pm.expect(jsonResponse.result).to.be.an(\"object\");","});","","//Validation","// Response body","pm.test(\"responseCode should be \\\"SERVER_ERROR\\\"\", () => {","    pm.expect(jsonResponse.responseCode).to.eql(\"SERVER_ERROR\");","});","","// Params","pm.test(\"params.err should be \\\"ERR_SYSTEM_EXCEPTION\\\"\", () => {","    pm.expect(jsonResponse.params.err).to.eql(\"ERR_SYSTEM_EXCEPTION\");","});","pm.test(\"params.errmsg should be \\\"[size] parameter cannot be negative, found [-1]\\\"\", () => {","    pm.expect(jsonResponse.params.errmsg).to.eql(\"[size] parameter cannot be negative, found [-1]\");","});"],"type":"text/javascript","id":"1f0e3e51-ef8c-4652-924d-623da66f9131"}}],"id":"618b123c-479d-4471-8e30-12bda0649674","protocolProfileBehavior":{"disabledSystemHeaders":{"connection":true},"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Content-Type","value":"application/json"},{"key":"X-Authenticated-User-token","value":"{{keycloak_access_token}}"},{"key":"Authorization","value":"{{kong_api_key}}"}],"body":{"mode":"raw","raw":"{\n    \"request\": {\n        \"filters\": {\n            \"objectType\": [\n                \"AssessmentItem\"\n            ],\n            \"status\": [\n                \"Live\"\n            ]\n        },\n        \"sort_by\": {\n            \"lastUpdatedOn\": \"desc\"\n        },\n        \"limit\": -1\n    }\n}"},"url":"{{host}}/action/composite/v3/search","description":"<p>This API is associated with batch creation\nThe endpoint for Creates a Batch is /batch/create\nThe fields marked with an asterisk (*) are mandatory. They cannot be null or empty.</p>\n","urlObject":{"path":["action","composite","v3","search"],"host":["{{host}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"618b123c-479d-4471-8e30-12bda0649674"}],"id":"2376dcb3-0c3a-4158-a76c-5cb185039bb2","event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":[""],"id":"bbf25035-2638-45ab-b87b-18a928a97b11"}},{"listen":"test","script":{"type":"text/javascript","exec":["let jsonResponse = pm.response.json();","","pm.test(\"Verify keys and data type of the params in negative scenario\", () => {","  pm.expect(jsonResponse.params.resmsgid).to.be.a(\"string\");","  pm.expect(jsonResponse.params.msgid).to.be.null;","  pm.expect(jsonResponse.params.err).to.be.a(\"string\");","  pm.expect(jsonResponse.params.status).to.be.a(\"string\");","  pm.expect(jsonResponse.params.errmsg).to.be.a(\"string\");","});","","pm.test(\"params.status should be \\\"failed\\\"\", () => {","    pm.expect(jsonResponse.params.status).to.eql(\"failed\");","});","","pm.test(\"id should be api.v1.search\", () => {","   pm.expect(jsonResponse.id).to.eql(\"api.v1.search\");","});","pm.test(\"ver should be 1.0\", () => {","   pm.expect(jsonResponse.ver).to.eql(\"1.0\");","});"],"id":"cef49d1a-7cf1-45eb-95d3-614aa42402c6"}}],"_postman_id":"2376dcb3-0c3a-4158-a76c-5cb185039bb2","description":""}],"event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":[""],"id":"cf05d9d6-4d6e-4293-9b65-5c5ed6666aac"}},{"listen":"test","script":{"type":"text/javascript","exec":["pm.test(\"Content-Type header is present\", () => {","  pm.response.to.have.header(\"Content-Type\");","});","","pm.test(\"Validate keys and data type of the response body\", () => {","  let jsonResponse = pm.response.json();","  pm.expect(jsonResponse).to.be.an(\"object\").that.has.all.keys('id', 'ver', 'ts', 'params', 'responseCode', 'result');","  pm.expect(jsonResponse.id).to.be.a(\"string\");","  pm.expect(jsonResponse.ver).to.be.a(\"string\");","  pm.expect(jsonResponse.ts).to.be.a(\"string\");","  pm.expect(jsonResponse.params).to.be.an(\"object\").that.has.all.keys('resmsgid', 'msgid', 'err', 'status', 'errmsg');","  pm.expect(jsonResponse.responseCode).to.be.a(\"string\");","  pm.expect(jsonResponse.result).to.be.an(\"object\");","});"],"id":"2a857c60-cecb-4cb5-b216-40b04377d655"}}]}