diff --git a/content-api/api-tests/Collections/Sunbird Content Management API(s)_V1.postman_collection.json b/content-api/api-tests/Collections/Sunbird Content Management API(s)_V1.postman_collection.json new file mode 100644 index 000000000..47f42c2b3 --- /dev/null +++ b/content-api/api-tests/Collections/Sunbird Content Management API(s)_V1.postman_collection.json @@ -0,0 +1,23190 @@ +{ + "info": { + "_postman_id": "3a33b6a7-0451-41d4-a2e2-b7233c507254", + "name": "Sunbird Content Management API(s)_V1", + "description": "The Content Management API allows you to manage content over the sunbird platform.Apis perform operations related to all the _Content_ on the Sunbird Platform.\n- Each of the endpoints serve a different purpose, so which one to use depends on what you want to do\n- The operations include CRUD (Create, Update, Read and Delete) operations and other operations such as upload, publish, flag, link Dialcode, etc.\n- The URL for Sunbird Content API(s) is `content/v2`\n- [TestCases](https://www.getpostman.com/collections/3c1817fcb4606ae53b9a)\n\nContact Support:\n Email: info@sunbird.org", + "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json", + "_exporter_id": "19432603", + "_collection_link": "https://blue-flare-639335.postman.co/workspace/API-automation-Knowlg~3ae6d444-e850-468d-bdb0-8be163d62aea/collection/19432603-3a33b6a7-0451-41d4-a2e2-b7233c507254?action=share&source=collection_link&creator=19432603" + }, + "item": [ + { + "name": "content", + "item": [ + { + "name": "v4", + "item": [ + { + "name": "upload", + "item": [ + { + "name": "Upload content", + "item": [ + { + "name": "Pre requisite", + "item": [ + { + "name": "Create content", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json();\r", + "\r", + "pm.collectionVariables.set(\"upload_content_id\", jsonResponse.result.identifier);\r", + "console.log(pm.collectionVariables.get(\"upload_content_id\"));\r", + "\r", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "X-Authenticated-User-token", + "value": "{{keycloak_access_token}}" + }, + { + "key": "X-Channel-Id", + "value": "sunbird" + }, + { + "key": "Authorization", + "value": "{{auth_token}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"content\": {\n \"name\": \"Pdf Content_01\",\n \"code\": \"1242e9ea-660a-4536-a142-cc242a7a4162\",\n \"mimeType\": \"application/pdf\",\n \"primaryCategory\": \"Explanation Content\"\n }\n }\n}" + }, + "url": { + "raw": "{{host}}/content/v4/create", + "host": [ + "{{host}}" + ], + "path": [ + "content", + "v4", + "create" + ] + } + }, + "response": [] + } + ] + }, + { + "name": "Positive", + "item": [ + { + "name": "Upload Content with valid file", + "request": { + "auth": { + "type": "apikey", + "apikey": [ + { + "key": "key", + "value": "Authorization", + "type": "string" + }, + { + "key": "value", + "value": "", + "type": "string" + }, + { + "key": "in", + "value": "header", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "description": "(Required) The Content Type entity is the media type of the resource.Possible media types can be:-\n - Application/json\n - Multipart/form-data\n - Application/x-www-form-urlencoded", + "key": "Content-Type", + "value": "ea laborum" + }, + { + "description": "(Required) The Registered User ID to execute the API.", + "key": "X-Authenticated-Userid", + "value": "ea laborum" + }, + { + "description": "(Required) All content APIs require authorization for use. Specify the authorization key received from the administrator when placing the request for use of the API.", + "key": "Authorization", + "value": "ea laborum" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "body": { + "mode": "formdata", + "formdata": [ + { + "key": "file", + "description": "(Required) Content package file which you intend to upload", + "type": "file", + "src": "/C:/Users/Qualitrix/Downloads/pdf_233.pdf" + } + ] + }, + "url": { + "raw": "{{baseUrl}}/content/v4/upload/{{upload_content_id}}", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v4", + "upload", + "{{upload_content_id}}" + ] + }, + "description": "This API is associated with uploading content on the Sunbird Platform .\n - The**_/upload/{content Id}_** endpoint executes \"Upload Content\" request based on parameters provided as metadata in the request body.\n - The endpoint for **Upload Content** is `/content/v2/upload`\n - It points to knowledge-mw-service - `/v2/content/upload`\n - {...}refers to a section of upload endpoint URL path that needs to be replaced by appropriate Id.\n - You need to provide a valid content Id value in {Content Id} field of API URL.\n - It is mandatory to provide values for parameters marked with *.\n - Mandatory fields cannot be null or empty." + }, + "response": [ + { + "name": "OK ! Successful operation.\"Content upload\" operation was successfully executed.", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource.Possible media types can be:-\n - Application/json\n - Multipart/form-data\n - Application/x-www-form-urlencoded", + "key": "Content-Type", + "value": "ea laborum" + }, + { + "description": "(Required) The Registered User ID to execute the API.", + "key": "X-Authenticated-Userid", + "value": "ea laborum" + }, + { + "description": "(Required) All content APIs require authorization for use. Specify the authorization key received from the administrator when placing the request for use of the API.", + "key": "Authorization", + "value": "ea laborum" + } + ], + "body": { + "mode": "formdata", + "formdata": [ + { + "key": "file", + "description": "(Required) Content package file which you intend to upload", + "type": "file", + "src": [] + } + ] + }, + "url": { + "raw": "{{baseUrl}}/content/v2/upload/:Content_Id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v2", + "upload", + ":Content_Id" + ], + "variable": [ + { + "key": "Content_Id", + "value": "ea laborum", + "description": "(Required) Please append a valid Content Id To the Request URL" + } + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"api.content.upload\",\n \"ver\": \"3.0\",\n \"ts\": \"2020-12-10T21:00:16ZZ\",\n \"params\": {\n \"resmsgid\": \"4505a08c-9d0c-447b-8b3f-692e31f841fd\",\n \"msgid\": null,\n \"err\": null,\n \"status\": \"successful\",\n \"errmsg\": null\n },\n \"responseCode\": \"OK\",\n \"result\": {\n \"identifier\": \"do_1131697376667402241315\",\n \"artifactUrl\": \"https://ekstep-public-dev.s3-ap-south-1.amazonaws.com/content/do_112547906582659072139/artifact/pdf_1531726896452.pdf\",\n \"content_url\": \"https://ekstep-public-dev.s3-ap-south-1.amazonaws.com/content/do_112547906582659072139/artifact/pdf_1531726896452.pdf\",\n \"node_id\": \"do_1131697376667402241315\",\n \"versionKey\": \"1607634016927\"\n }\n}" + }, + { + "name": "RESOURCE NOT FOUND,**Content Send for Review** operation failed !The possible reason for failure is that you may have provided wrong content id.", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource.Possible media types can be:-\n - Application/json\n - Multipart/form-data\n - Application/x-www-form-urlencoded", + "key": "Content-Type", + "value": "ea laborum" + }, + { + "description": "(Required) The Registered User ID to execute the API.", + "key": "X-Authenticated-Userid", + "value": "ea laborum" + }, + { + "description": "(Required) All content APIs require authorization for use. Specify the authorization key received from the administrator when placing the request for use of the API.", + "key": "Authorization", + "value": "ea laborum" + } + ], + "body": { + "mode": "formdata", + "formdata": [ + { + "key": "file", + "description": "(Required) Content package file which you intend to upload", + "type": "file", + "src": [] + } + ] + }, + "url": { + "raw": "{{baseUrl}}/content/v2/upload/:Content_Id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v2", + "upload", + ":Content_Id" + ], + "variable": [ + { + "key": "Content_Id", + "value": "ea laborum", + "description": "(Required) Please append a valid Content Id To the Request URL" + } + ] + } + }, + "status": "Not Found", + "code": 404, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"api.content.upload\",\n \"ver\": \"3.0\",\n \"ts\": \"2020-12-10T21:21:20ZZ\",\n \"params\": {\n \"resmsgid\": \"58139c89-2852-4673-b414-2f867c91bbc1\",\n \"msgid\": null,\n \"err\": \"NOT_FOUND\",\n \"status\": \"failed\",\n \"errmsg\": \"Error! Node(s) doesn't Exists. | [Invalid Node Id.]: do_11316973766674022413151\"\n },\n \"responseCode\": \"RESOURCE_NOT_FOUND\",\n \"result\": {\n \"messages\": null\n }\n}" + }, + { + "name": "INTERNAL SERVER ERROR ! Looks like something went wrong! These errors are tracked automatically, but if the problem persists feel free to contact us. In the meantime, try refreshing.", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource.Possible media types can be:-\n - Application/json\n - Multipart/form-data\n - Application/x-www-form-urlencoded", + "key": "Content-Type", + "value": "ea laborum" + }, + { + "description": "(Required) The Registered User ID to execute the API.", + "key": "X-Authenticated-Userid", + "value": "ea laborum" + }, + { + "description": "(Required) All content APIs require authorization for use. Specify the authorization key received from the administrator when placing the request for use of the API.", + "key": "Authorization", + "value": "ea laborum" + } + ], + "body": { + "mode": "formdata", + "formdata": [ + { + "key": "file", + "description": "(Required) Content package file which you intend to upload", + "type": "file", + "src": [] + } + ] + }, + "url": { + "raw": "{{baseUrl}}/content/v2/upload/:Content_Id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v2", + "upload", + ":Content_Id" + ], + "variable": [ + { + "key": "Content_Id", + "value": "ea laborum", + "description": "(Required) Please append a valid Content Id To the Request URL" + } + ] + } + }, + "status": "Internal Server Error", + "code": 500, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"result\": {},\n \"id\": \"cupidatat reprehenderit dolor\",\n \"ver\": \"minim anim commodo\",\n \"ts\": \"commodo\",\n \"params\": {\n \"resmsgid\": \"pariatur repre\",\n \"msgid\": \"irure\",\n \"err\": \"consequat esse ea\",\n \"status\": \"esse\",\n \"errmsg\": \"aliqua laboris velit\"\n },\n \"responseCode\": \"reprehenderit dolor elit sunt dolore\"\n}" + } + ] + } + ] + }, + { + "name": "Negative", + "item": [ + { + "name": "Upload Content with invalid file", + "request": { + "auth": { + "type": "apikey", + "apikey": [ + { + "key": "key", + "value": "Authorization", + "type": "string" + }, + { + "key": "value", + "value": "", + "type": "string" + }, + { + "key": "in", + "value": "header", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "description": "(Required) The Content Type entity is the media type of the resource.Possible media types can be:-\n - Application/json\n - Multipart/form-data\n - Application/x-www-form-urlencoded", + "key": "Content-Type", + "value": "ea laborum" + }, + { + "description": "(Required) The Registered User ID to execute the API.", + "key": "X-Authenticated-Userid", + "value": "ea laborum" + }, + { + "description": "(Required) All content APIs require authorization for use. Specify the authorization key received from the administrator when placing the request for use of the API.", + "key": "Authorization", + "value": "ea laborum" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "body": { + "mode": "formdata", + "formdata": [ + { + "key": "file", + "description": "(Required) Content package file which you intend to upload", + "type": "file", + "src": "/C:/Users/Qualitrix/Downloads/pdf_233.pdf" + } + ] + }, + "url": { + "raw": "{{baseUrl}}/content/v4/upload/{{upload_content_id}}", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v4", + "upload", + "{{upload_content_id}}" + ] + }, + "description": "This API is associated with uploading content on the Sunbird Platform .\n - The**_/upload/{content Id}_** endpoint executes \"Upload Content\" request based on parameters provided as metadata in the request body.\n - The endpoint for **Upload Content** is `/content/v2/upload`\n - It points to knowledge-mw-service - `/v2/content/upload`\n - {...}refers to a section of upload endpoint URL path that needs to be replaced by appropriate Id.\n - You need to provide a valid content Id value in {Content Id} field of API URL.\n - It is mandatory to provide values for parameters marked with *.\n - Mandatory fields cannot be null or empty." + }, + "response": [ + { + "name": "OK ! Successful operation.\"Content upload\" operation was successfully executed.", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource.Possible media types can be:-\n - Application/json\n - Multipart/form-data\n - Application/x-www-form-urlencoded", + "key": "Content-Type", + "value": "ea laborum" + }, + { + "description": "(Required) The Registered User ID to execute the API.", + "key": "X-Authenticated-Userid", + "value": "ea laborum" + }, + { + "description": "(Required) All content APIs require authorization for use. Specify the authorization key received from the administrator when placing the request for use of the API.", + "key": "Authorization", + "value": "ea laborum" + } + ], + "body": { + "mode": "formdata", + "formdata": [ + { + "key": "file", + "description": "(Required) Content package file which you intend to upload", + "type": "file", + "src": [] + } + ] + }, + "url": { + "raw": "{{baseUrl}}/content/v2/upload/:Content_Id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v2", + "upload", + ":Content_Id" + ], + "variable": [ + { + "key": "Content_Id", + "value": "ea laborum", + "description": "(Required) Please append a valid Content Id To the Request URL" + } + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"api.content.upload\",\n \"ver\": \"3.0\",\n \"ts\": \"2020-12-10T21:00:16ZZ\",\n \"params\": {\n \"resmsgid\": \"4505a08c-9d0c-447b-8b3f-692e31f841fd\",\n \"msgid\": null,\n \"err\": null,\n \"status\": \"successful\",\n \"errmsg\": null\n },\n \"responseCode\": \"OK\",\n \"result\": {\n \"identifier\": \"do_1131697376667402241315\",\n \"artifactUrl\": \"https://ekstep-public-dev.s3-ap-south-1.amazonaws.com/content/do_112547906582659072139/artifact/pdf_1531726896452.pdf\",\n \"content_url\": \"https://ekstep-public-dev.s3-ap-south-1.amazonaws.com/content/do_112547906582659072139/artifact/pdf_1531726896452.pdf\",\n \"node_id\": \"do_1131697376667402241315\",\n \"versionKey\": \"1607634016927\"\n }\n}" + }, + { + "name": "RESOURCE NOT FOUND,**Content Send for Review** operation failed !The possible reason for failure is that you may have provided wrong content id.", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource.Possible media types can be:-\n - Application/json\n - Multipart/form-data\n - Application/x-www-form-urlencoded", + "key": "Content-Type", + "value": "ea laborum" + }, + { + "description": "(Required) The Registered User ID to execute the API.", + "key": "X-Authenticated-Userid", + "value": "ea laborum" + }, + { + "description": "(Required) All content APIs require authorization for use. Specify the authorization key received from the administrator when placing the request for use of the API.", + "key": "Authorization", + "value": "ea laborum" + } + ], + "body": { + "mode": "formdata", + "formdata": [ + { + "key": "file", + "description": "(Required) Content package file which you intend to upload", + "type": "file", + "src": [] + } + ] + }, + "url": { + "raw": "{{baseUrl}}/content/v2/upload/:Content_Id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v2", + "upload", + ":Content_Id" + ], + "variable": [ + { + "key": "Content_Id", + "value": "ea laborum", + "description": "(Required) Please append a valid Content Id To the Request URL" + } + ] + } + }, + "status": "Not Found", + "code": 404, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"api.content.upload\",\n \"ver\": \"3.0\",\n \"ts\": \"2020-12-10T21:21:20ZZ\",\n \"params\": {\n \"resmsgid\": \"58139c89-2852-4673-b414-2f867c91bbc1\",\n \"msgid\": null,\n \"err\": \"NOT_FOUND\",\n \"status\": \"failed\",\n \"errmsg\": \"Error! Node(s) doesn't Exists. | [Invalid Node Id.]: do_11316973766674022413151\"\n },\n \"responseCode\": \"RESOURCE_NOT_FOUND\",\n \"result\": {\n \"messages\": null\n }\n}" + }, + { + "name": "INTERNAL SERVER ERROR ! Looks like something went wrong! These errors are tracked automatically, but if the problem persists feel free to contact us. In the meantime, try refreshing.", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource.Possible media types can be:-\n - Application/json\n - Multipart/form-data\n - Application/x-www-form-urlencoded", + "key": "Content-Type", + "value": "ea laborum" + }, + { + "description": "(Required) The Registered User ID to execute the API.", + "key": "X-Authenticated-Userid", + "value": "ea laborum" + }, + { + "description": "(Required) All content APIs require authorization for use. Specify the authorization key received from the administrator when placing the request for use of the API.", + "key": "Authorization", + "value": "ea laborum" + } + ], + "body": { + "mode": "formdata", + "formdata": [ + { + "key": "file", + "description": "(Required) Content package file which you intend to upload", + "type": "file", + "src": [] + } + ] + }, + "url": { + "raw": "{{baseUrl}}/content/v2/upload/:Content_Id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v2", + "upload", + ":Content_Id" + ], + "variable": [ + { + "key": "Content_Id", + "value": "ea laborum", + "description": "(Required) Please append a valid Content Id To the Request URL" + } + ] + } + }, + "status": "Internal Server Error", + "code": 500, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"result\": {},\n \"id\": \"cupidatat reprehenderit dolor\",\n \"ver\": \"minim anim commodo\",\n \"ts\": \"commodo\",\n \"params\": {\n \"resmsgid\": \"pariatur repre\",\n \"msgid\": \"irure\",\n \"err\": \"consequat esse ea\",\n \"status\": \"esse\",\n \"errmsg\": \"aliqua laboris velit\"\n },\n \"responseCode\": \"reprehenderit dolor elit sunt dolore\"\n}" + } + ] + } + ] + } + ] + }, + { + "name": "Upload URL", + "item": [ + { + "name": "Pre requisite", + "item": [ + { + "name": "Create content", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json();\r", + "\r", + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "pm.test(\"Status code name has string OK\", function () {\r", + " pm.response.to.have.status(\"OK\");\r", + "});\r", + "pm.test(\"id should be api.content.create\", function () {\r", + " pm.expect(jsonResponse.id).to.eql(\"api.content.create\");\r", + "});\r", + "pm.test(\"ver should be 4.0\", function () {\r", + " pm.expect(jsonResponse.ver).to.eql(\"4.0\");\r", + "});\r", + "\r", + "pm.test(\"Params has keys: resmsgid , msgid , err , status , errmsg \", () => {\r", + " pm.expect(jsonResponse.params).to.have.all.keys('resmsgid', 'msgid','err','status','errmsg');\r", + " pm.expect(jsonResponse.params.resmsgid).to.be.a(\"string\");\r", + " pm.expect(jsonResponse.params.msgid).to.be.a('null');\r", + " pm.expect(jsonResponse.params.err).to.be.a('null');\r", + " pm.expect(jsonResponse.params.status).to.be.a(\"string\");\r", + " pm.expect(jsonResponse.params.errmsg).to.be.a('null');\r", + "});\r", + "\r", + "pm.test(\"Status is successful\", function () {\r", + " pm.expect(jsonResponse.params.status).to.be.equal(\"successful\");\r", + "});\r", + "\r", + "pm.test(\"ResponseCode is OK\", function () {\r", + " pm.expect(jsonResponse.responseCode).to.be.equal(\"OK\");\r", + "});\r", + "\r", + "// Set global variable\r", + "pm.collectionVariables.set(\"pre_content_id\", jsonResponse.result.identifier);\r", + "\r", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "X-Authenticated-User-token", + "value": "{{keycloak_access_token}}" + }, + { + "key": "X-Channel-Id", + "value": "sunbird" + }, + { + "key": "Authorization", + "value": "{{kong_api_key}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"content\": {\n \"name\": \"PDF Content\",\n \"code\": \"1242e9ea-660a-4536-a142-cc242a7a4162\",\n \"mimeType\": \"application/pdf\",\n \"primaryCategory\": \"Explanation Content\"\n }\n }\n}" + }, + "url": { + "raw": "{{host}}/content/v4/create", + "host": [ + "{{host}}" + ], + "path": [ + "content", + "v4", + "create" + ] + } + }, + "response": [] + }, + { + "name": "Upload URL", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json();\r", + "\r", + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "pm.test(\"Status code name has string OK\", function () {\r", + " pm.response.to.have.status(\"OK\");\r", + "});\r", + "pm.test(\"id should be api.content.upload.url\", function () {\r", + " pm.expect(jsonResponse.id).to.eql(\"api.content.upload.url\");\r", + "});\r", + "pm.test(\"ver should be 4.0\", function () {\r", + " pm.expect(jsonResponse.ver).to.eql(\"4.0\");\r", + "});\r", + "\r", + "pm.test(\"Params has keys: resmsgid , msgid , err , status , errmsg \", () => {\r", + " pm.expect(jsonResponse.params).to.have.all.keys('resmsgid', 'msgid','err','status','errmsg');\r", + " pm.expect(jsonResponse.params.resmsgid).to.be.a(\"string\");\r", + " pm.expect(jsonResponse.params.msgid).to.be.a('null');\r", + " pm.expect(jsonResponse.params.err).to.be.a('null');\r", + " pm.expect(jsonResponse.params.status).to.be.a(\"string\");\r", + " pm.expect(jsonResponse.params.errmsg).to.be.a('null');\r", + "});\r", + "\r", + "pm.test(\"Status is successful\", function () {\r", + " pm.expect(jsonResponse.params.status).to.be.equal(\"successful\");\r", + "});\r", + "\r", + "pm.test(\"ResponseCode is OK\", function () {\r", + " pm.expect(jsonResponse.responseCode).to.be.equal(\"OK\");\r", + "});\r", + "\r", + "\r", + "pm.test(\"Verify keys and data type of the response result\", () => {\r", + " pm.expect(jsonResponse.result).to.have.all.keys('identifier', 'url_expiry', 'pre_signed_url');\r", + "});\r", + "pm.collectionVariables.set(\"pre_signed_URL\",jsonResponse.result.pre_signed_url );\r", + "console.log(pm.collectionVariables.get(\"pre_signed_URL\"));\r", + "\r", + "pm.collectionVariables.set(\"id\", jsonResponse.result.identifier);\r", + "console.log(pm.collectionVariables.get(\"id\"));\r", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "apikey", + "apikey": [ + { + "key": "key", + "value": "Authorization", + "type": "string" + }, + { + "key": "value", + "value": "", + "type": "string" + }, + { + "key": "in", + "value": "header", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "description": "(Required) The Content Type entity is the media type of the resource.Possible media types can be:-\n - Application/json", + "key": "Content-Type", + "value": "application/json" + }, + { + "description": "(Required) The Registered User ID to execute the API.", + "key": "X-Authenticated-Userid", + "value": "ea laborum" + }, + { + "description": "(Required) All content APIs require authorization for use. Specify the authorization key received from the administrator when placing the request for use of the API.", + "key": "Authorization", + "value": "ea laborum" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"content\": {\n \"fileName\":\"test.pdf\"\n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/content/v4/upload/url/{{pre_content_id}}", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v4", + "upload", + "url", + "{{pre_content_id}}" + ] + }, + "description": "This API is associated with uploading content on the Sunbird Platform .\n - The**_/upload/url/{content Id}_** endpoint executes \"Upload Content URL\" request based on parameters provided as metadata in the request body.\n - The endpoint for **Upload Content URL** is `/content/v2/upload/url`\n - It points to knowledge-mw-service - `/v2/content/upload/url`\n - {...}refers to a section of upload endpoint URL path that needs to be replaced by appropriate Id.\n - You need to provide a valid content Id value in {Content Id} field of API URL.\n - On Success api returns pre-signed-url link with come configured ttl against which file can be uploaded.\n - It is mandatory to provide values for parameters marked with *.\n - Mandatory fields cannot be null or empty." + }, + "response": [ + { + "name": "OK ! Successful operation.\"Content upload\" operation was successfully executed.", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource.Possible media types can be:-\n - Application/json", + "key": "Content-Type", + "value": "ea laborum" + }, + { + "description": "(Required) The Registered User ID to execute the API.", + "key": "X-Authenticated-Userid", + "value": "ea laborum" + }, + { + "description": "(Required) All content APIs require authorization for use. Specify the authorization key received from the administrator when placing the request for use of the API.", + "key": "Authorization", + "value": "ea laborum" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"content\": {\n \"fileName\": \"test.pdf\"\n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/content/v2/upload/url/:Content_Id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v2", + "upload", + "url", + ":Content_Id" + ], + "variable": [ + { + "key": "Content_Id", + "value": "ea laborum", + "description": "(Required) Please append a valid Content Id To the Request URL" + } + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"api.content.upload.url\",\n \"ver\": \"3.0\",\n \"ts\": \"2020-12-11T23:52:44ZZ\",\n \"params\": {\n \"resmsgid\": \"81e308fa-3e36-45ff-b295-e28e8f757dc7\",\n \"msgid\": null,\n \"err\": null,\n \"status\": \"successful\",\n \"errmsg\": null\n },\n \"responseCode\": \"OK\",\n \"result\": {\n \"identifier\": \"do_11317053041892556811094\",\n \"url_expiry\": \"54000\",\n \"pre_signed_url\": \"https://sunbirddev.blob.core.windows.net/sunbird-content-dev/content/assets/do_11317053041892556811094/10-page-pdf.pdf?sv=2017-04-17&se=2020-12-12T14%3A52%3A44Z&sr=b&sp=w&sig=Tlt6uWI/6lMeupkEbsTAmGajmo1qzw8HeUHrVwOm6yk%3D\"\n }\n}" + }, + { + "name": "BAD REQUEST. The 'Upload Url' operation failed ! The possible reason for failure is that you may have missed providing input for a mandatory parameter.", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource.Possible media types can be:-\n - Application/json", + "key": "Content-Type", + "value": "ea laborum" + }, + { + "description": "(Required) The Registered User ID to execute the API.", + "key": "X-Authenticated-Userid", + "value": "ea laborum" + }, + { + "description": "(Required) All content APIs require authorization for use. Specify the authorization key received from the administrator when placing the request for use of the API.", + "key": "Authorization", + "value": "ea laborum" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"content\": {\n \"fileName\": \"test.pdf\"\n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/content/v2/upload/url/:Content_Id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v2", + "upload", + "url", + ":Content_Id" + ], + "variable": [ + { + "key": "Content_Id", + "value": "ea laborum", + "description": "(Required) Please append a valid Content Id To the Request URL" + } + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"api.content.upload.url\",\n \"ver\": \"3.0\",\n \"ts\": \"2020-12-11T23:54:07ZZ\",\n \"params\": {\n \"resmsgid\": \"4edde64d-3116-4271-bcc1-a8ba0ec2d56b\",\n \"msgid\": null,\n \"err\": \"ERR_CONTENT_BLANK_FILE_NAME\",\n \"status\": \"failed\",\n \"errmsg\": \"File name is blank\"\n },\n \"responseCode\": \"CLIENT_ERROR\",\n \"result\": {\n \"messages\": null\n }\n}" + }, + { + "name": "RESOURCE NOT FOUND,**Content Id sent for generating upload url** operation failed !The possible reason for failure is that you may have provided wrong content id.", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource.Possible media types can be:-\n - Application/json", + "key": "Content-Type", + "value": "ea laborum" + }, + { + "description": "(Required) The Registered User ID to execute the API.", + "key": "X-Authenticated-Userid", + "value": "ea laborum" + }, + { + "description": "(Required) All content APIs require authorization for use. Specify the authorization key received from the administrator when placing the request for use of the API.", + "key": "Authorization", + "value": "ea laborum" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"content\": {\n \"fileName\": \"test.pdf\"\n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/content/v2/upload/url/:Content_Id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v2", + "upload", + "url", + ":Content_Id" + ], + "variable": [ + { + "key": "Content_Id", + "value": "ea laborum", + "description": "(Required) Please append a valid Content Id To the Request URL" + } + ] + } + }, + "status": "Not Found", + "code": 404, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"api.upload.url\",\n \"ver\": \"1.0\",\n \"ts\": \"2020-12-11T23:48:26.694Z\",\n \"params\": {\n \"resmsgid\": \"5cf72660-3c0b-11eb-b0a2-8d5c9f561887\",\n \"msgid\": null,\n \"status\": \"failed\",\n \"err\": \"NOT_FOUND\",\n \"errmsg\": \"Error! Node(s) doesn't Exists. | [Invalid Node Id.]: do_11254577204586086415\"\n },\n \"responseCode\": \"RESOURCE_NOT_FOUND\",\n \"result\": {}\n}" + }, + { + "name": "INTERNAL SERVER ERROR ! Looks like something went wrong! These errors are tracked automatically, but if the problem persists feel free to contact us. In the meantime, try refreshing.", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource.Possible media types can be:-\n - Application/json", + "key": "Content-Type", + "value": "ea laborum" + }, + { + "description": "(Required) The Registered User ID to execute the API.", + "key": "X-Authenticated-Userid", + "value": "ea laborum" + }, + { + "description": "(Required) All content APIs require authorization for use. Specify the authorization key received from the administrator when placing the request for use of the API.", + "key": "Authorization", + "value": "ea laborum" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"content\": {\n \"fileName\": \"test.pdf\"\n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/content/v2/upload/url/:Content_Id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v2", + "upload", + "url", + ":Content_Id" + ], + "variable": [ + { + "key": "Content_Id", + "value": "ea laborum", + "description": "(Required) Please append a valid Content Id To the Request URL" + } + ] + } + }, + "status": "Internal Server Error", + "code": 500, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"result\": {},\n \"id\": \"cupidatat reprehenderit dolor\",\n \"ver\": \"minim anim commodo\",\n \"ts\": \"commodo\",\n \"params\": {\n \"resmsgid\": \"pariatur repre\",\n \"msgid\": \"irure\",\n \"err\": \"consequat esse ea\",\n \"status\": \"esse\",\n \"errmsg\": \"aliqua laboris velit\"\n },\n \"responseCode\": \"reprehenderit dolor elit sunt dolore\"\n}" + } + ] + }, + { + "name": "Upload file to the URL", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 201\", function () {\r", + " pm.response.to.have.status(201);\r", + "});\r", + "\r", + "var fullUrl= pm.collectionVariables.get(\"pre_signed_URL\");\r", + "\r", + "// Find the index of '?' to get the position of the query parameters\r", + "var indexOfQuestionMark = fullUrl.indexOf('?');\r", + "\r", + "// Extract the partial URL without the query parameters\r", + "var partialUrl = indexOfQuestionMark !== -1 ? fullUrl.slice(0, indexOfQuestionMark) : fullUrl;\r", + "pm.collectionVariables.set(\"partial_URL\", partialUrl);\r", + "// Log the partial URL to the console (you can remove this line if not needed)\r", + "console.log(pm.collectionVariables.get(\"partial_URL\"));\r", + "\r", + "// Now you can use the 'partialUrl' variable in Postman as needed\r", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "PUT", + "header": [ + { + "key": "X-Ms-Blob-Type", + "value": "BlockBlob" + } + ], + "body": { + "mode": "formdata", + "formdata": [ + { + "key": "file", + "type": "file", + "src": "/C:/Users/Qualitrix/Downloads/pdf_233.pdf" + } + ] + }, + "url": { + "raw": "{{pre_signed_URL}}", + "host": [ + "{{pre_signed_URL}}" + ] + } + }, + "response": [] + } + ] + }, + { + "name": "Positive", + "item": [ + { + "name": "Update the content with valid URL and mime type", + "event": [ + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + }, + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json();\r", + "\r", + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "pm.test(\"Status code name has string OK\", function () {\r", + " pm.response.to.have.status(\"OK\");\r", + "});\r", + "pm.test(\"id should be api.content.upload\", function () {\r", + " pm.expect(jsonResponse.id).to.eql(\"api.content.upload\");\r", + "});\r", + "pm.test(\"ver should be 4.0\", function () {\r", + " pm.expect(jsonResponse.ver).to.eql(\"4.0\");\r", + "});\r", + "\r", + "pm.test(\"Params has keys: resmsgid , msgid , err , status , errmsg \", () => {\r", + " pm.expect(jsonResponse.params).to.have.all.keys('resmsgid', 'msgid','err','status','errmsg');\r", + " pm.expect(jsonResponse.params.resmsgid).to.be.a(\"string\");\r", + " pm.expect(jsonResponse.params.msgid).to.be.a('null');\r", + " pm.expect(jsonResponse.params.err).to.be.a('null');\r", + " pm.expect(jsonResponse.params.status).to.be.a(\"string\");\r", + " pm.expect(jsonResponse.params.errmsg).to.be.a('null');\r", + "});\r", + "\r", + "pm.test(\"Status is successful\", function () {\r", + " pm.expect(jsonResponse.params.status).to.be.equal(\"successful\");\r", + "});\r", + "\r", + "pm.test(\"ResponseCode is OK\", function () {\r", + " pm.expect(jsonResponse.responseCode).to.be.equal(\"OK\");\r", + "});\r", + "\r", + "pm.test(\"Result has keys: identifier , artifactUrl , content_url , node_id , versionKey \", () => {\r", + " pm.expect(jsonResponse.result).to.have.all.keys('identifier', 'artifactUrl','content_url','node_id','versionKey');\r", + " pm.expect(jsonResponse.result.identifier).to.be.a(\"string\");\r", + " pm.expect(jsonResponse.result.artifactUrl).to.be.a(\"string\");\r", + " pm.expect(jsonResponse.result.content_url).to.be.a(\"string\");\r", + " pm.expect(jsonResponse.result.node_id).to.be.a(\"string\");\r", + " pm.expect(jsonResponse.result.versionKey).to.be.a(\"string\");\r", + "});\r", + "\r", + "pm.test(`artifactUrl should be: ${pm.collectionVariables.get(\"partial_URL\")}`, function () {\r", + " pm.expect(jsonResponse.result.artifactUrl).to.be.equal(`${pm.collectionVariables.get(\"partial_URL\")}`);\r", + "});\r", + "\r", + "pm.test(`content_url should be: ${pm.collectionVariables.get(\"partial_URL\")}`, function () {\r", + " pm.expect(jsonResponse.result.content_url).to.be.equal(`${pm.collectionVariables.get(\"partial_URL\")}`);\r", + "});\r", + "\r", + "pm.test(`identifier should be: ${pm.collectionVariables.get(\"pre_content_id\")}`, function () {\r", + " pm.expect(jsonResponse.result.identifier).to.be.equal(`${pm.collectionVariables.get(\"pre_content_id\")}`);\r", + "});\r", + "\r", + "pm.test(`node_id should be: ${pm.collectionVariables.get(\"pre_content_id\")}`, function () {\r", + " pm.expect(jsonResponse.result.node_id).to.be.equal(`${pm.collectionVariables.get(\"pre_content_id\")}`);\r", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "user-id", + "value": "mahesh" + }, + { + "key": "Cookie", + "value": "connect.sid=s%3AnLNdCeYI27WUkZBIFdX1J5MKTM6ISEdJ.SFTq%2FeT2cVLh5TSEWmwZPCekWDSeNXILHPDyziKa26E" + }, + { + "key": "X-Channel-Id", + "value": "0137541424673095687" + }, + { + "key": "X-Authenticated-User-token", + "value": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImtpZCI6ImFjY2Vzc3YxX2tleTEifQ.eyJhdWQiOiJodHRwczovL2Rldi5zdW5iaXJkZWQub3JnL2F1dGgvcmVhbG1zL3N1bmJpcmQiLCJzdWIiOiJmOjVhOGEzZjJiLTM0MDktNDJlMC05MDAxLWY5MTNiYzBmZGUzMToxNTVjZTNjNS03MTNlLTQ3NDktYmMxYy05NWQwOWM2NDA5MTQiLCJyb2xlcyI6W3sicm9sZSI6IkNPTlRFTlRfQ1JFQVRPUiIsInNjb3BlIjpbeyJvcmdhbmlzYXRpb25JZCI6IjAxMzc1NDE0MjQ2NzMwOTU2ODcifV19LHsicm9sZSI6IkNPVVJTRV9NRU5UT1IiLCJzY29wZSI6W3sib3JnYW5pc2F0aW9uSWQiOiIwMTM3NTQxNDI0NjczMDk1Njg3In1dfSx7InJvbGUiOiJQVUJMSUMiLCJzY29wZSI6W119XSwiaXNzIjoiaHR0cHM6Ly9kZXYuc3VuYmlyZGVkLm9yZy9hdXRoL3JlYWxtcy9zdW5iaXJkIiwibmFtZSI6ImNvbnRlbnRDcmVhdG9yIiwidHlwIjoiQmVhcmVyIiwiZXhwIjoxNzAyMzI0NjU0LCJpYXQiOjE3MDIyODE0NTR9.MxiIhP6YJmI1XbozLNoJeQAbdQKs597f2mlNHWcJ-ZZIXvBx4BcX7T57B5xXGIT6LJ6YlS86saiG6SXHIG5ptgICphdefNysfVgkSUmqTsgzfzvjp2lzIw8Re7xi735Kd7B612y5Tkswm0ETP7NIeQ7-Tc_3h37GV04ISfx0LMD75UvgllxcDz91Bl6N3-WN4KwCeKIfJ-iZj-EJLwoBmJjGsgNCNTn5DTzF_joFcyett__WVc14Ex-BqRSq8Hr2fMVoHpNXze3QUJ7PcD4JRY2Ywg5R9VkHz3mkhY9kI1cWeHdQypeSsM8niQK1XCWJz_aTqsP35MshDnHkWhmDyg" + }, + { + "key": "Authorization", + "value": "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiIzZGNjMzY3OWIwYTE0NmU2YWYyZjlmZDA5NWU5NTlkNCJ9.0NZhX5sqUNy-GZUya90aQFkr5ZNiqfOuELYz_IvoyS8" + } + ], + "body": { + "mode": "formdata", + "formdata": [ + { + "key": "fileUrl", + "value": "{{partial_URL}}", + "type": "text" + }, + { + "key": "mimeType", + "value": "application/pdf", + "type": "text" + } + ] + }, + "url": { + "raw": "{{host}}/content/v4/upload/{{pre_content_id}}", + "host": [ + "{{host}}" + ], + "path": [ + "content", + "v4", + "upload", + "{{pre_content_id}}" + ] + } + }, + "response": [] + }, + { + "name": "Upload the content with Valid url and no mime type", + "event": [ + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + }, + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json();\r", + "\r", + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "pm.test(\"Status code name has string OK\", function () {\r", + " pm.response.to.have.status(\"OK\");\r", + "});\r", + "pm.test(\"id should be api.content.upload\", function () {\r", + " pm.expect(jsonResponse.id).to.eql(\"api.content.upload\");\r", + "});\r", + "pm.test(\"ver should be 4.0\", function () {\r", + " pm.expect(jsonResponse.ver).to.eql(\"4.0\");\r", + "});\r", + "\r", + "pm.test(\"Params has keys: resmsgid , msgid , err , status , errmsg \", () => {\r", + " pm.expect(jsonResponse.params).to.have.all.keys('resmsgid', 'msgid','err','status','errmsg');\r", + " pm.expect(jsonResponse.params.resmsgid).to.be.a(\"string\");\r", + " pm.expect(jsonResponse.params.msgid).to.be.a('null');\r", + " pm.expect(jsonResponse.params.err).to.be.a('null');\r", + " pm.expect(jsonResponse.params.status).to.be.a(\"string\");\r", + " pm.expect(jsonResponse.params.errmsg).to.be.a('null');\r", + "});\r", + "\r", + "pm.test(\"Status is successful\", function () {\r", + " pm.expect(jsonResponse.params.status).to.be.equal(\"successful\");\r", + "});\r", + "\r", + "pm.test(\"ResponseCode is OK\", function () {\r", + " pm.expect(jsonResponse.responseCode).to.be.equal(\"OK\");\r", + "});\r", + "\r", + "pm.test(\"Result has keys: identifier , artifactUrl , content_url , node_id , versionKey \", () => {\r", + " pm.expect(jsonResponse.result).to.have.all.keys('identifier', 'artifactUrl','content_url','node_id','versionKey');\r", + " pm.expect(jsonResponse.result.identifier).to.be.a(\"string\");\r", + " pm.expect(jsonResponse.result.artifactUrl).to.be.a(\"string\");\r", + " pm.expect(jsonResponse.result.content_url).to.be.a(\"string\");\r", + " pm.expect(jsonResponse.result.node_id).to.be.a(\"string\");\r", + " pm.expect(jsonResponse.result.versionKey).to.be.a(\"string\");\r", + "});\r", + "\r", + "pm.test(`artifactUrl should be: ${pm.collectionVariables.get(\"partial_URL\")}`, function () {\r", + " pm.expect(jsonResponse.result.artifactUrl).to.be.equal(`${pm.collectionVariables.get(\"partial_URL\")}`);\r", + "});\r", + "\r", + "pm.test(`content_url should be: ${pm.collectionVariables.get(\"partial_URL\")}`, function () {\r", + " pm.expect(jsonResponse.result.content_url).to.be.equal(`${pm.collectionVariables.get(\"partial_URL\")}`);\r", + "});\r", + "\r", + "pm.test(`identifier should be: ${pm.collectionVariables.get(\"content_id\")}`, function () {\r", + " pm.expect(jsonResponse.result.identifier).to.be.equal(`${pm.collectionVariables.get(\"content_id\")}`);\r", + "});\r", + "\r", + "pm.test(`node_id should be: ${pm.collectionVariables.get(\"content_id\")}`, function () {\r", + " pm.expect(jsonResponse.result.node_id).to.be.equal(`${pm.collectionVariables.get(\"content_id\")}`);\r", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "user-id", + "value": "mahesh" + }, + { + "key": "Cookie", + "value": "connect.sid=s%3AnLNdCeYI27WUkZBIFdX1J5MKTM6ISEdJ.SFTq%2FeT2cVLh5TSEWmwZPCekWDSeNXILHPDyziKa26E" + }, + { + "key": "X-Channel-Id", + "value": "0137541424673095687" + }, + { + "key": "X-Authenticated-User-token", + "value": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImtpZCI6ImFjY2Vzc3YxX2tleTEifQ.eyJhdWQiOiJodHRwczovL2Rldi5zdW5iaXJkZWQub3JnL2F1dGgvcmVhbG1zL3N1bmJpcmQiLCJzdWIiOiJmOjVhOGEzZjJiLTM0MDktNDJlMC05MDAxLWY5MTNiYzBmZGUzMToxNTVjZTNjNS03MTNlLTQ3NDktYmMxYy05NWQwOWM2NDA5MTQiLCJyb2xlcyI6W3sicm9sZSI6IkNPTlRFTlRfQ1JFQVRPUiIsInNjb3BlIjpbeyJvcmdhbmlzYXRpb25JZCI6IjAxMzc1NDE0MjQ2NzMwOTU2ODcifV19LHsicm9sZSI6IkNPVVJTRV9NRU5UT1IiLCJzY29wZSI6W3sib3JnYW5pc2F0aW9uSWQiOiIwMTM3NTQxNDI0NjczMDk1Njg3In1dfSx7InJvbGUiOiJQVUJMSUMiLCJzY29wZSI6W119XSwiaXNzIjoiaHR0cHM6Ly9kZXYuc3VuYmlyZGVkLm9yZy9hdXRoL3JlYWxtcy9zdW5iaXJkIiwibmFtZSI6ImNvbnRlbnRDcmVhdG9yIiwidHlwIjoiQmVhcmVyIiwiZXhwIjoxNzAyMzI0NjU0LCJpYXQiOjE3MDIyODE0NTR9.MxiIhP6YJmI1XbozLNoJeQAbdQKs597f2mlNHWcJ-ZZIXvBx4BcX7T57B5xXGIT6LJ6YlS86saiG6SXHIG5ptgICphdefNysfVgkSUmqTsgzfzvjp2lzIw8Re7xi735Kd7B612y5Tkswm0ETP7NIeQ7-Tc_3h37GV04ISfx0LMD75UvgllxcDz91Bl6N3-WN4KwCeKIfJ-iZj-EJLwoBmJjGsgNCNTn5DTzF_joFcyett__WVc14Ex-BqRSq8Hr2fMVoHpNXze3QUJ7PcD4JRY2Ywg5R9VkHz3mkhY9kI1cWeHdQypeSsM8niQK1XCWJz_aTqsP35MshDnHkWhmDyg" + }, + { + "key": "Authorization", + "value": "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiIzZGNjMzY3OWIwYTE0NmU2YWYyZjlmZDA5NWU5NTlkNCJ9.0NZhX5sqUNy-GZUya90aQFkr5ZNiqfOuELYz_IvoyS8" + } + ], + "body": { + "mode": "formdata", + "formdata": [ + { + "key": "fileUrl", + "value": "{{partial_URL}}", + "type": "text" + }, + { + "key": "mimeType", + "value": "dummy", + "type": "text", + "disabled": true + } + ] + }, + "url": { + "raw": "{{host}}/content/v4/upload/{{content_id}}", + "host": [ + "{{host}}" + ], + "path": [ + "content", + "v4", + "upload", + "{{content_id}}" + ] + } + }, + "response": [] + } + ] + }, + { + "name": "Negative", + "item": [ + { + "name": "Upload the content with invalid url and valid mime type", + "event": [ + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + }, + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json();\r", + "\r", + "pm.test(\"Status code is 400\", function () {\r", + " pm.response.to.have.status(400);\r", + "});\r", + "\r", + "pm.test(\"Status code name has string Bad Request\", function () {\r", + " pm.response.to.have.status(\"Bad Request\");\r", + "});\r", + "\r", + "pm.test(\"id should be api.content.upload\", function () {\r", + " pm.expect(jsonResponse.id).to.eql(\"api.content.upload\");\r", + "});\r", + "pm.test(\"ver should be 4.0\", function () {\r", + " pm.expect(jsonResponse.ver).to.eql(\"4.0\");\r", + "});\r", + "\r", + "pm.test(\"Params has keys: resmsgid , msgid , err , status , errmsg \", () => {\r", + " pm.expect(jsonResponse.params).to.have.all.keys('resmsgid', 'msgid','err','status','errmsg');\r", + " pm.expect(jsonResponse.params.resmsgid).to.be.a(\"string\");\r", + " pm.expect(jsonResponse.params.msgid).to.be.a('null');\r", + " pm.expect(jsonResponse.params.err).to.be.a('string');\r", + " pm.expect(jsonResponse.params.status).to.be.a(\"string\");\r", + " pm.expect(jsonResponse.params.errmsg).to.be.a('string');\r", + "});\r", + "\r", + "pm.test(\"err is ERR_INVALID_FILE_URL\", function () {\r", + " pm.expect(jsonResponse.params.err).to.be.equal(\"ERR_INVALID_FILE_URL\");\r", + "});\r", + "pm.test(\"errmsg: Please Provide Valid File Url!\", function () {\r", + " pm.expect(jsonResponse.params.errmsg).to.be.equal(\"Please Provide Valid File Url!\");\r", + "});\r", + "\r", + "pm.test(\"Status is failed\", function () {\r", + " pm.expect(jsonResponse.params.status).to.be.equal(\"failed\");\r", + "});\r", + "\r", + "pm.test(\"ResponseCode is CLIENT_ERROR\", function () {\r", + " pm.expect(jsonResponse.responseCode).to.be.equal(\"CLIENT_ERROR\");\r", + "});\r", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "user-id", + "value": "mahesh" + }, + { + "key": "Cookie", + "value": "connect.sid=s%3AnLNdCeYI27WUkZBIFdX1J5MKTM6ISEdJ.SFTq%2FeT2cVLh5TSEWmwZPCekWDSeNXILHPDyziKa26E" + }, + { + "key": "X-Channel-Id", + "value": "0137541424673095687" + }, + { + "key": "X-Authenticated-User-token", + "value": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImtpZCI6ImFjY2Vzc3YxX2tleTEifQ.eyJhdWQiOiJodHRwczovL2Rldi5zdW5iaXJkZWQub3JnL2F1dGgvcmVhbG1zL3N1bmJpcmQiLCJzdWIiOiJmOjVhOGEzZjJiLTM0MDktNDJlMC05MDAxLWY5MTNiYzBmZGUzMToxNTVjZTNjNS03MTNlLTQ3NDktYmMxYy05NWQwOWM2NDA5MTQiLCJyb2xlcyI6W3sicm9sZSI6IkNPTlRFTlRfQ1JFQVRPUiIsInNjb3BlIjpbeyJvcmdhbmlzYXRpb25JZCI6IjAxMzc1NDE0MjQ2NzMwOTU2ODcifV19LHsicm9sZSI6IkNPVVJTRV9NRU5UT1IiLCJzY29wZSI6W3sib3JnYW5pc2F0aW9uSWQiOiIwMTM3NTQxNDI0NjczMDk1Njg3In1dfSx7InJvbGUiOiJQVUJMSUMiLCJzY29wZSI6W119XSwiaXNzIjoiaHR0cHM6Ly9kZXYuc3VuYmlyZGVkLm9yZy9hdXRoL3JlYWxtcy9zdW5iaXJkIiwibmFtZSI6ImNvbnRlbnRDcmVhdG9yIiwidHlwIjoiQmVhcmVyIiwiZXhwIjoxNzAyMzI0NjU0LCJpYXQiOjE3MDIyODE0NTR9.MxiIhP6YJmI1XbozLNoJeQAbdQKs597f2mlNHWcJ-ZZIXvBx4BcX7T57B5xXGIT6LJ6YlS86saiG6SXHIG5ptgICphdefNysfVgkSUmqTsgzfzvjp2lzIw8Re7xi735Kd7B612y5Tkswm0ETP7NIeQ7-Tc_3h37GV04ISfx0LMD75UvgllxcDz91Bl6N3-WN4KwCeKIfJ-iZj-EJLwoBmJjGsgNCNTn5DTzF_joFcyett__WVc14Ex-BqRSq8Hr2fMVoHpNXze3QUJ7PcD4JRY2Ywg5R9VkHz3mkhY9kI1cWeHdQypeSsM8niQK1XCWJz_aTqsP35MshDnHkWhmDyg" + }, + { + "key": "Authorization", + "value": "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiIzZGNjMzY3OWIwYTE0NmU2YWYyZjlmZDA5NWU5NTlkNCJ9.0NZhX5sqUNy-GZUya90aQFkr5ZNiqfOuELYz_IvoyS8" + } + ], + "body": { + "mode": "formdata", + "formdata": [ + { + "key": "fileUrl", + "value": "dummy", + "type": "text" + }, + { + "key": "mimeType", + "value": "application/pdf", + "type": "text" + } + ] + }, + "url": { + "raw": "{{host}}/content/v4/upload/{{content_id}}", + "host": [ + "{{host}}" + ], + "path": [ + "content", + "v4", + "upload", + "{{content_id}}" + ] + } + }, + "response": [] + } + ] + } + ] + } + ] + }, + { + "name": "flag", + "item": [ + { + "name": "Flag content", + "item": [ + { + "name": "Pre requisite", + "item": [ + { + "name": "Create content", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json();\r", + "\r", + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "pm.test(\"Status code name has string OK\", function () {\r", + " pm.response.to.have.status(\"OK\");\r", + "});\r", + "pm.test(\"id should be api.content.create\", function () {\r", + " pm.expect(jsonResponse.id).to.eql(\"api.content.create\");\r", + "});\r", + "pm.test(\"ver should be 4.0\", function () {\r", + " pm.expect(jsonResponse.ver).to.eql(\"4.0\");\r", + "});\r", + "\r", + "pm.test(\"Params has keys: resmsgid , msgid , err , status , errmsg \", () => {\r", + " pm.expect(jsonResponse.params).to.have.all.keys('resmsgid', 'msgid','err','status','errmsg');\r", + " pm.expect(jsonResponse.params.resmsgid).to.be.a(\"string\");\r", + " pm.expect(jsonResponse.params.msgid).to.be.a('null');\r", + " pm.expect(jsonResponse.params.err).to.be.a('null');\r", + " pm.expect(jsonResponse.params.status).to.be.a(\"string\");\r", + " pm.expect(jsonResponse.params.errmsg).to.be.a('null');\r", + "});\r", + "\r", + "pm.test(\"Status is successful\", function () {\r", + " pm.expect(jsonResponse.params.status).to.be.equal(\"successful\");\r", + "});\r", + "\r", + "pm.test(\"ResponseCode is OK\", function () {\r", + " pm.expect(jsonResponse.responseCode).to.be.equal(\"OK\");\r", + "});\r", + "\r", + "// Set global variable\r", + "pm.collectionVariables.set(\"flag_content_id\", jsonResponse.result.identifier);\r", + "\r", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "X-Authenticated-User-token", + "value": "{{keycloak_access_token}}" + }, + { + "key": "X-Channel-Id", + "value": "sunbird" + }, + { + "key": "Authorization", + "value": "{{kong_api_key}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"content\": {\n \"name\": \"PDF Content\",\n \"code\": \"1242e9ea-660a-4536-a142-cc242a7a4162\",\n \"mimeType\": \"application/pdf\",\n \"primaryCategory\": \"Explanation Content\"\n }\n }\n}" + }, + "url": { + "raw": "{{host}}/content/v4/create", + "host": [ + "{{host}}" + ], + "path": [ + "content", + "v4", + "create" + ] + } + }, + "response": [] + } + ] + }, + { + "name": "Positive", + "item": [ + { + "name": "Flag valid Content", + "request": { + "auth": { + "type": "apikey", + "apikey": [ + { + "key": "key", + "value": "Authorization", + "type": "string" + }, + { + "key": "value", + "value": "", + "type": "string" + }, + { + "key": "in", + "value": "header", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "description": "(Required) The Content Type entity is the media type of the resource.Possible media types can be:-\n - Application/json", + "key": "Content-Type", + "value": "ea laborum" + }, + { + "description": "(Required) The Registered User ID to execute the API.", + "key": "X-Authenticated-Userid", + "value": "ea laborum" + }, + { + "description": "(Required) All content APIs require authorization for use. Specify the authorization key received from the administrator when placing the request for use of the API.", + "key": "Authorization", + "value": "ea laborum" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/content/v2/flag/{{flag_content_id}}", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v2", + "flag", + "{{flag_content_id}}" + ] + }, + "description": "This API is associated with setting Flag for content.\n - The **_/flag/{content Id}_** endpoint executes a request to set flagging status for content ,flag can either be set to \"Accepted\" or \"Rejected\".\n - The endpoint for **Flag Content** is `/content/v2/flag`\n - It points to knowledge-mw-service - `/v2/content/flag`\n - {...}refers to a section of reject endpoint URL path that needs to be replaced by appropriate Id.\n - You need to provide a valid content Id value in {Content Id} field of API URL.\n - It is mandatory to provide values for parameters marked with *.\n - Mandatory fields cannot be null or empty." + }, + "response": [ + { + "name": "OK ! Successful operation.\"Content Flagging\" operation was successfully executed.", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource.Possible media types can be:-\n - Application/json", + "key": "Content-Type", + "value": "ea laborum" + }, + { + "description": "(Required) The Registered User ID to execute the API.", + "key": "X-Authenticated-Userid", + "value": "ea laborum" + }, + { + "description": "(Required) All content APIs require authorization for use. Specify the authorization key received from the administrator when placing the request for use of the API.", + "key": "Authorization", + "value": "ea laborum" + } + ], + "body": { + "mode": "raw", + "raw": "{}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/content/v2/flag/:Content_Id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v2", + "flag", + ":Content_Id" + ], + "variable": [ + { + "key": "Content_Id", + "value": "ea laborum", + "description": "(Required) Please append a valid Content Id To the Request URL" + } + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"api.content.flag\",\n \"ver\": \"3.0\",\n \"ts\": \"2020-12-11T08:45:49ZZ\",\n \"params\": {\n \"resmsgid\": \"9c935e0c-b504-45e6-bd15-313f46c4613f\",\n \"msgid\": null,\n \"err\": null,\n \"status\": \"successful\",\n \"errmsg\": null\n },\n \"responseCode\": \"OK\",\n \"result\": {\n \"identifier\": \"do_213143334457982976144\",\n \"node_id\": \"do_213143334457982976144\",\n \"versionKey\": \"1607676349236\"\n }\n}" + }, + { + "name": "ERR_CONTENT_NOT_FLAGGABLE! Looks like contentId is not in flaggable status.", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource.Possible media types can be:-\n - Application/json", + "key": "Content-Type", + "value": "ea laborum" + }, + { + "description": "(Required) The Registered User ID to execute the API.", + "key": "X-Authenticated-Userid", + "value": "ea laborum" + }, + { + "description": "(Required) All content APIs require authorization for use. Specify the authorization key received from the administrator when placing the request for use of the API.", + "key": "Authorization", + "value": "ea laborum" + } + ], + "body": { + "mode": "raw", + "raw": "{}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/content/v2/flag/:Content_Id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v2", + "flag", + ":Content_Id" + ], + "variable": [ + { + "key": "Content_Id", + "value": "ea laborum", + "description": "(Required) Please append a valid Content Id To the Request URL" + } + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"api.content.flag\",\n \"ver\": \"3.0\",\n \"ts\": \"2020-12-11T08:44:53ZZ\",\n \"params\": {\n \"resmsgid\": \"2ff1945b-a114-44ca-929e-7d19a6f8a745\",\n \"msgid\": null,\n \"err\": \"ERR_CONTENT_NOT_FLAGGABLE\",\n \"status\": \"failed\",\n \"errmsg\": \"Unpublished Content do_213168073757138944196 cannot be flagged\"\n },\n \"responseCode\": \"CLIENT_ERROR\",\n \"result\": {\n \"messages\": null\n }\n}" + }, + { + "name": "RESOURCE NOT FOUND,**Content Send for Flag** operation failed !The possible reason for failure is that you may have provided wrong content id.", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource.Possible media types can be:-\n - Application/json", + "key": "Content-Type", + "value": "ea laborum" + }, + { + "description": "(Required) The Registered User ID to execute the API.", + "key": "X-Authenticated-Userid", + "value": "ea laborum" + }, + { + "description": "(Required) All content APIs require authorization for use. Specify the authorization key received from the administrator when placing the request for use of the API.", + "key": "Authorization", + "value": "ea laborum" + } + ], + "body": { + "mode": "raw", + "raw": "{}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/content/v2/flag/:Content_Id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v2", + "flag", + ":Content_Id" + ], + "variable": [ + { + "key": "Content_Id", + "value": "ea laborum", + "description": "(Required) Please append a valid Content Id To the Request URL" + } + ] + } + }, + "status": "Not Found", + "code": 404, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"api.content.flag\",\n \"ver\": \"3.0\",\n \"ts\": \"2020-12-11T09:41:41ZZ\",\n \"params\": {\n \"resmsgid\": \"5b4f0b33-3941-4c18-b8bf-123c2e0348e6\",\n \"msgid\": null,\n \"err\": \"NOT_FOUND\",\n \"status\": \"failed\",\n \"errmsg\": \"Error! Node(s) doesn't Exists. | [Invalid Node Id.]: do_2131433344579829761441\"\n },\n \"responseCode\": \"RESOURCE_NOT_FOUND\",\n \"result\": {\n \"messages\": null\n }\n}" + }, + { + "name": "INTERNAL SERVER ERROR ! Looks like something went wrong! These errors are tracked automatically, but if the problem persists feel free to contact us. In the meantime, try refreshing.", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource.Possible media types can be:-\n - Application/json", + "key": "Content-Type", + "value": "ea laborum" + }, + { + "description": "(Required) The Registered User ID to execute the API.", + "key": "X-Authenticated-Userid", + "value": "ea laborum" + }, + { + "description": "(Required) All content APIs require authorization for use. Specify the authorization key received from the administrator when placing the request for use of the API.", + "key": "Authorization", + "value": "ea laborum" + } + ], + "body": { + "mode": "raw", + "raw": "{}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/content/v2/flag/:Content_Id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v2", + "flag", + ":Content_Id" + ], + "variable": [ + { + "key": "Content_Id", + "value": "ea laborum", + "description": "(Required) Please append a valid Content Id To the Request URL" + } + ] + } + }, + "status": "Internal Server Error", + "code": 500, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"result\": {},\n \"id\": \"cupidatat reprehenderit dolor\",\n \"ver\": \"minim anim commodo\",\n \"ts\": \"commodo\",\n \"params\": {\n \"resmsgid\": \"pariatur repre\",\n \"msgid\": \"irure\",\n \"err\": \"consequat esse ea\",\n \"status\": \"esse\",\n \"errmsg\": \"aliqua laboris velit\"\n },\n \"responseCode\": \"reprehenderit dolor elit sunt dolore\"\n}" + } + ] + } + ] + }, + { + "name": "Negative", + "item": [ + { + "name": "Flag invalid Content", + "request": { + "auth": { + "type": "apikey", + "apikey": [ + { + "key": "key", + "value": "Authorization", + "type": "string" + }, + { + "key": "value", + "value": "", + "type": "string" + }, + { + "key": "in", + "value": "header", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "description": "(Required) The Content Type entity is the media type of the resource.Possible media types can be:-\n - Application/json", + "key": "Content-Type", + "value": "ea laborum" + }, + { + "description": "(Required) The Registered User ID to execute the API.", + "key": "X-Authenticated-Userid", + "value": "ea laborum" + }, + { + "description": "(Required) All content APIs require authorization for use. Specify the authorization key received from the administrator when placing the request for use of the API.", + "key": "Authorization", + "value": "ea laborum" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/content/v2/flag/dummy", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v2", + "flag", + "dummy" + ] + }, + "description": "This API is associated with setting Flag for content.\n - The **_/flag/{content Id}_** endpoint executes a request to set flagging status for content ,flag can either be set to \"Accepted\" or \"Rejected\".\n - The endpoint for **Flag Content** is `/content/v2/flag`\n - It points to knowledge-mw-service - `/v2/content/flag`\n - {...}refers to a section of reject endpoint URL path that needs to be replaced by appropriate Id.\n - You need to provide a valid content Id value in {Content Id} field of API URL.\n - It is mandatory to provide values for parameters marked with *.\n - Mandatory fields cannot be null or empty." + }, + "response": [ + { + "name": "OK ! Successful operation.\"Content Flagging\" operation was successfully executed.", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource.Possible media types can be:-\n - Application/json", + "key": "Content-Type", + "value": "ea laborum" + }, + { + "description": "(Required) The Registered User ID to execute the API.", + "key": "X-Authenticated-Userid", + "value": "ea laborum" + }, + { + "description": "(Required) All content APIs require authorization for use. Specify the authorization key received from the administrator when placing the request for use of the API.", + "key": "Authorization", + "value": "ea laborum" + } + ], + "body": { + "mode": "raw", + "raw": "{}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/content/v2/flag/:Content_Id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v2", + "flag", + ":Content_Id" + ], + "variable": [ + { + "key": "Content_Id", + "value": "ea laborum", + "description": "(Required) Please append a valid Content Id To the Request URL" + } + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"api.content.flag\",\n \"ver\": \"3.0\",\n \"ts\": \"2020-12-11T08:45:49ZZ\",\n \"params\": {\n \"resmsgid\": \"9c935e0c-b504-45e6-bd15-313f46c4613f\",\n \"msgid\": null,\n \"err\": null,\n \"status\": \"successful\",\n \"errmsg\": null\n },\n \"responseCode\": \"OK\",\n \"result\": {\n \"identifier\": \"do_213143334457982976144\",\n \"node_id\": \"do_213143334457982976144\",\n \"versionKey\": \"1607676349236\"\n }\n}" + }, + { + "name": "ERR_CONTENT_NOT_FLAGGABLE! Looks like contentId is not in flaggable status.", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource.Possible media types can be:-\n - Application/json", + "key": "Content-Type", + "value": "ea laborum" + }, + { + "description": "(Required) The Registered User ID to execute the API.", + "key": "X-Authenticated-Userid", + "value": "ea laborum" + }, + { + "description": "(Required) All content APIs require authorization for use. Specify the authorization key received from the administrator when placing the request for use of the API.", + "key": "Authorization", + "value": "ea laborum" + } + ], + "body": { + "mode": "raw", + "raw": "{}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/content/v2/flag/:Content_Id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v2", + "flag", + ":Content_Id" + ], + "variable": [ + { + "key": "Content_Id", + "value": "ea laborum", + "description": "(Required) Please append a valid Content Id To the Request URL" + } + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"api.content.flag\",\n \"ver\": \"3.0\",\n \"ts\": \"2020-12-11T08:44:53ZZ\",\n \"params\": {\n \"resmsgid\": \"2ff1945b-a114-44ca-929e-7d19a6f8a745\",\n \"msgid\": null,\n \"err\": \"ERR_CONTENT_NOT_FLAGGABLE\",\n \"status\": \"failed\",\n \"errmsg\": \"Unpublished Content do_213168073757138944196 cannot be flagged\"\n },\n \"responseCode\": \"CLIENT_ERROR\",\n \"result\": {\n \"messages\": null\n }\n}" + }, + { + "name": "RESOURCE NOT FOUND,**Content Send for Flag** operation failed !The possible reason for failure is that you may have provided wrong content id.", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource.Possible media types can be:-\n - Application/json", + "key": "Content-Type", + "value": "ea laborum" + }, + { + "description": "(Required) The Registered User ID to execute the API.", + "key": "X-Authenticated-Userid", + "value": "ea laborum" + }, + { + "description": "(Required) All content APIs require authorization for use. Specify the authorization key received from the administrator when placing the request for use of the API.", + "key": "Authorization", + "value": "ea laborum" + } + ], + "body": { + "mode": "raw", + "raw": "{}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/content/v2/flag/:Content_Id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v2", + "flag", + ":Content_Id" + ], + "variable": [ + { + "key": "Content_Id", + "value": "ea laborum", + "description": "(Required) Please append a valid Content Id To the Request URL" + } + ] + } + }, + "status": "Not Found", + "code": 404, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"api.content.flag\",\n \"ver\": \"3.0\",\n \"ts\": \"2020-12-11T09:41:41ZZ\",\n \"params\": {\n \"resmsgid\": \"5b4f0b33-3941-4c18-b8bf-123c2e0348e6\",\n \"msgid\": null,\n \"err\": \"NOT_FOUND\",\n \"status\": \"failed\",\n \"errmsg\": \"Error! Node(s) doesn't Exists. | [Invalid Node Id.]: do_2131433344579829761441\"\n },\n \"responseCode\": \"RESOURCE_NOT_FOUND\",\n \"result\": {\n \"messages\": null\n }\n}" + }, + { + "name": "INTERNAL SERVER ERROR ! Looks like something went wrong! These errors are tracked automatically, but if the problem persists feel free to contact us. In the meantime, try refreshing.", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource.Possible media types can be:-\n - Application/json", + "key": "Content-Type", + "value": "ea laborum" + }, + { + "description": "(Required) The Registered User ID to execute the API.", + "key": "X-Authenticated-Userid", + "value": "ea laborum" + }, + { + "description": "(Required) All content APIs require authorization for use. Specify the authorization key received from the administrator when placing the request for use of the API.", + "key": "Authorization", + "value": "ea laborum" + } + ], + "body": { + "mode": "raw", + "raw": "{}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/content/v2/flag/:Content_Id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v2", + "flag", + ":Content_Id" + ], + "variable": [ + { + "key": "Content_Id", + "value": "ea laborum", + "description": "(Required) Please append a valid Content Id To the Request URL" + } + ] + } + }, + "status": "Internal Server Error", + "code": 500, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"result\": {},\n \"id\": \"cupidatat reprehenderit dolor\",\n \"ver\": \"minim anim commodo\",\n \"ts\": \"commodo\",\n \"params\": {\n \"resmsgid\": \"pariatur repre\",\n \"msgid\": \"irure\",\n \"err\": \"consequat esse ea\",\n \"status\": \"esse\",\n \"errmsg\": \"aliqua laboris velit\"\n },\n \"responseCode\": \"reprehenderit dolor elit sunt dolore\"\n}" + } + ] + } + ] + } + ] + }, + { + "name": "Flag accept", + "item": [ + { + "name": "Pre requisite", + "item": [ + { + "name": "Create content", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json();\r", + "\r", + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "pm.test(\"Status code name has string OK\", function () {\r", + " pm.response.to.have.status(\"OK\");\r", + "});\r", + "pm.test(\"id should be api.content.create\", function () {\r", + " pm.expect(jsonResponse.id).to.eql(\"api.content.create\");\r", + "});\r", + "pm.test(\"ver should be 4.0\", function () {\r", + " pm.expect(jsonResponse.ver).to.eql(\"4.0\");\r", + "});\r", + "\r", + "pm.test(\"Params has keys: resmsgid , msgid , err , status , errmsg \", () => {\r", + " pm.expect(jsonResponse.params).to.have.all.keys('resmsgid', 'msgid','err','status','errmsg');\r", + " pm.expect(jsonResponse.params.resmsgid).to.be.a(\"string\");\r", + " pm.expect(jsonResponse.params.msgid).to.be.a('null');\r", + " pm.expect(jsonResponse.params.err).to.be.a('null');\r", + " pm.expect(jsonResponse.params.status).to.be.a(\"string\");\r", + " pm.expect(jsonResponse.params.errmsg).to.be.a('null');\r", + "});\r", + "\r", + "pm.test(\"Status is successful\", function () {\r", + " pm.expect(jsonResponse.params.status).to.be.equal(\"successful\");\r", + "});\r", + "\r", + "pm.test(\"ResponseCode is OK\", function () {\r", + " pm.expect(jsonResponse.responseCode).to.be.equal(\"OK\");\r", + "});\r", + "\r", + "// Set global variable\r", + "pm.collectionVariables.set(\"flag_accept_content_id\", jsonResponse.result.identifier);\r", + "\r", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "X-Authenticated-User-token", + "value": "{{keycloak_access_token}}" + }, + { + "key": "X-Channel-Id", + "value": "sunbird" + }, + { + "key": "Authorization", + "value": "{{kong_api_key}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"content\": {\n \"name\": \"PDF Content\",\n \"code\": \"1242e9ea-660a-4536-a142-cc242a7a4162\",\n \"mimeType\": \"application/pdf\",\n \"primaryCategory\": \"Explanation Content\"\n }\n }\n}" + }, + "url": { + "raw": "{{host}}/content/v4/create", + "host": [ + "{{host}}" + ], + "path": [ + "content", + "v4", + "create" + ] + } + }, + "response": [] + }, + { + "name": "Flag valid Content Copy", + "request": { + "auth": { + "type": "apikey", + "apikey": [ + { + "key": "key", + "value": "Authorization", + "type": "string" + }, + { + "key": "value", + "value": "", + "type": "string" + }, + { + "key": "in", + "value": "header", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "description": "(Required) The Content Type entity is the media type of the resource.Possible media types can be:-\n - Application/json", + "key": "Content-Type", + "value": "ea laborum" + }, + { + "description": "(Required) The Registered User ID to execute the API.", + "key": "X-Authenticated-Userid", + "value": "ea laborum" + }, + { + "description": "(Required) All content APIs require authorization for use. Specify the authorization key received from the administrator when placing the request for use of the API.", + "key": "Authorization", + "value": "ea laborum" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/content/v2/flag/{{flag_accept_content_id}}", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v2", + "flag", + "{{flag_accept_content_id}}" + ] + }, + "description": "This API is associated with setting Flag for content.\n - The **_/flag/{content Id}_** endpoint executes a request to set flagging status for content ,flag can either be set to \"Accepted\" or \"Rejected\".\n - The endpoint for **Flag Content** is `/content/v2/flag`\n - It points to knowledge-mw-service - `/v2/content/flag`\n - {...}refers to a section of reject endpoint URL path that needs to be replaced by appropriate Id.\n - You need to provide a valid content Id value in {Content Id} field of API URL.\n - It is mandatory to provide values for parameters marked with *.\n - Mandatory fields cannot be null or empty." + }, + "response": [ + { + "name": "OK ! Successful operation.\"Content Flagging\" operation was successfully executed.", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource.Possible media types can be:-\n - Application/json", + "key": "Content-Type", + "value": "ea laborum" + }, + { + "description": "(Required) The Registered User ID to execute the API.", + "key": "X-Authenticated-Userid", + "value": "ea laborum" + }, + { + "description": "(Required) All content APIs require authorization for use. Specify the authorization key received from the administrator when placing the request for use of the API.", + "key": "Authorization", + "value": "ea laborum" + } + ], + "body": { + "mode": "raw", + "raw": "{}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/content/v2/flag/:Content_Id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v2", + "flag", + ":Content_Id" + ], + "variable": [ + { + "key": "Content_Id", + "value": "ea laborum", + "description": "(Required) Please append a valid Content Id To the Request URL" + } + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"api.content.flag\",\n \"ver\": \"3.0\",\n \"ts\": \"2020-12-11T08:45:49ZZ\",\n \"params\": {\n \"resmsgid\": \"9c935e0c-b504-45e6-bd15-313f46c4613f\",\n \"msgid\": null,\n \"err\": null,\n \"status\": \"successful\",\n \"errmsg\": null\n },\n \"responseCode\": \"OK\",\n \"result\": {\n \"identifier\": \"do_213143334457982976144\",\n \"node_id\": \"do_213143334457982976144\",\n \"versionKey\": \"1607676349236\"\n }\n}" + }, + { + "name": "ERR_CONTENT_NOT_FLAGGABLE! Looks like contentId is not in flaggable status.", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource.Possible media types can be:-\n - Application/json", + "key": "Content-Type", + "value": "ea laborum" + }, + { + "description": "(Required) The Registered User ID to execute the API.", + "key": "X-Authenticated-Userid", + "value": "ea laborum" + }, + { + "description": "(Required) All content APIs require authorization for use. Specify the authorization key received from the administrator when placing the request for use of the API.", + "key": "Authorization", + "value": "ea laborum" + } + ], + "body": { + "mode": "raw", + "raw": "{}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/content/v2/flag/:Content_Id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v2", + "flag", + ":Content_Id" + ], + "variable": [ + { + "key": "Content_Id", + "value": "ea laborum", + "description": "(Required) Please append a valid Content Id To the Request URL" + } + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"api.content.flag\",\n \"ver\": \"3.0\",\n \"ts\": \"2020-12-11T08:44:53ZZ\",\n \"params\": {\n \"resmsgid\": \"2ff1945b-a114-44ca-929e-7d19a6f8a745\",\n \"msgid\": null,\n \"err\": \"ERR_CONTENT_NOT_FLAGGABLE\",\n \"status\": \"failed\",\n \"errmsg\": \"Unpublished Content do_213168073757138944196 cannot be flagged\"\n },\n \"responseCode\": \"CLIENT_ERROR\",\n \"result\": {\n \"messages\": null\n }\n}" + }, + { + "name": "RESOURCE NOT FOUND,**Content Send for Flag** operation failed !The possible reason for failure is that you may have provided wrong content id.", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource.Possible media types can be:-\n - Application/json", + "key": "Content-Type", + "value": "ea laborum" + }, + { + "description": "(Required) The Registered User ID to execute the API.", + "key": "X-Authenticated-Userid", + "value": "ea laborum" + }, + { + "description": "(Required) All content APIs require authorization for use. Specify the authorization key received from the administrator when placing the request for use of the API.", + "key": "Authorization", + "value": "ea laborum" + } + ], + "body": { + "mode": "raw", + "raw": "{}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/content/v2/flag/:Content_Id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v2", + "flag", + ":Content_Id" + ], + "variable": [ + { + "key": "Content_Id", + "value": "ea laborum", + "description": "(Required) Please append a valid Content Id To the Request URL" + } + ] + } + }, + "status": "Not Found", + "code": 404, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"api.content.flag\",\n \"ver\": \"3.0\",\n \"ts\": \"2020-12-11T09:41:41ZZ\",\n \"params\": {\n \"resmsgid\": \"5b4f0b33-3941-4c18-b8bf-123c2e0348e6\",\n \"msgid\": null,\n \"err\": \"NOT_FOUND\",\n \"status\": \"failed\",\n \"errmsg\": \"Error! Node(s) doesn't Exists. | [Invalid Node Id.]: do_2131433344579829761441\"\n },\n \"responseCode\": \"RESOURCE_NOT_FOUND\",\n \"result\": {\n \"messages\": null\n }\n}" + }, + { + "name": "INTERNAL SERVER ERROR ! Looks like something went wrong! These errors are tracked automatically, but if the problem persists feel free to contact us. In the meantime, try refreshing.", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource.Possible media types can be:-\n - Application/json", + "key": "Content-Type", + "value": "ea laborum" + }, + { + "description": "(Required) The Registered User ID to execute the API.", + "key": "X-Authenticated-Userid", + "value": "ea laborum" + }, + { + "description": "(Required) All content APIs require authorization for use. Specify the authorization key received from the administrator when placing the request for use of the API.", + "key": "Authorization", + "value": "ea laborum" + } + ], + "body": { + "mode": "raw", + "raw": "{}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/content/v2/flag/:Content_Id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v2", + "flag", + ":Content_Id" + ], + "variable": [ + { + "key": "Content_Id", + "value": "ea laborum", + "description": "(Required) Please append a valid Content Id To the Request URL" + } + ] + } + }, + "status": "Internal Server Error", + "code": 500, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"result\": {},\n \"id\": \"cupidatat reprehenderit dolor\",\n \"ver\": \"minim anim commodo\",\n \"ts\": \"commodo\",\n \"params\": {\n \"resmsgid\": \"pariatur repre\",\n \"msgid\": \"irure\",\n \"err\": \"consequat esse ea\",\n \"status\": \"esse\",\n \"errmsg\": \"aliqua laboris velit\"\n },\n \"responseCode\": \"reprehenderit dolor elit sunt dolore\"\n}" + } + ] + } + ] + }, + { + "name": "Positive", + "item": [ + { + "name": "Flag accept valid content id", + "request": { + "auth": { + "type": "apikey", + "apikey": [ + { + "key": "key", + "value": "Authorization", + "type": "string" + }, + { + "key": "value", + "value": "", + "type": "string" + }, + { + "key": "in", + "value": "header", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "description": "(Required) The Content Type entity is the media type of the resource.Possible media types can be:-\n - Application/json\n - Multipart/form-data\n - Application/x-www-form-urlencoded", + "key": "Content-Type", + "value": "ea laborum" + }, + { + "description": "(Required) The Registered User ID to execute the API.", + "key": "X-Authenticated-User-token", + "value": "ea laborum" + }, + { + "description": "(Required) All content APIs require authorization for use. Specify the authorization key received from the administrator when placing the request for use of the API.", + "key": "Authorization", + "value": "ea laborum" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"versionKey\": \"1507102327646\"\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/content/v2/flag/accept/{{flag_accept_content_id}}", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v2", + "flag", + "accept", + "{{flag_accept_content_id}}" + ] + }, + "description": "This API is associated with setting Accept Flag for content under review process on the Sunbird Platform .\n - The **_/flag/accept/_**endpoint executes request for flagging content under review to \"Accept flag\", if content is found appropriate.\n - The endpoint for **Flag Accept Content** is `/content/v2/flag/accept`\n - It points to knowledge-mw-service - `/v2/content/flag/accept`\n - It is mandatory to provide values for parameters marked with *.\n - Mandatory fields cannot be null or empty." + }, + "response": [ + { + "name": "OK ! Successful operation.\"Accept Flag\" operation was successfully executed.", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource.Possible media types can be:-\n - Application/json\n - Multipart/form-data\n - Application/x-www-form-urlencoded", + "key": "Content-Type", + "value": "ea laborum" + }, + { + "description": "(Required) The Registered User ID to execute the API.", + "key": "X-Authenticated-User-token", + "value": "ea laborum" + }, + { + "description": "(Required) All content APIs require authorization for use. Specify the authorization key received from the administrator when placing the request for use of the API.", + "key": "Authorization", + "value": "ea laborum" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"versionKey\": \"1507102327646\"\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/content/v2/flag/accept/:Content_Id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v2", + "flag", + "accept", + ":Content_Id" + ], + "variable": [ + { + "key": "Content_Id", + "value": "ea laborum", + "description": "(Required) Please append a valid Content Id To the Request URL" + } + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"api.flag.accept\",\n \"ver\": \"1.0\",\n \"ts\": \"2020-12-11T11:40:01.464Z\",\n \"params\": {\n \"resmsgid\": \"9a9e4b80-3ba5-11eb-b0a2-8d5c9f561887\",\n \"msgid\": \"9a49e9f0-3ba5-11eb-b0a2-8d5c9f561887\",\n \"status\": \"successful\",\n \"err\": null,\n \"errmsg\": null\n },\n \"responseCode\": \"OK\",\n \"result\": {\n \"identifier\": \"do_31221753157709004825531\",\n \"node_id\": \"do_31221753157709004825531\",\n \"versionKey\": \"1607686801161\"\n }\n}" + }, + { + "name": "BAD REQUEST. The \"Accept Flag\" operation failed ! The possible reason for failure is that you may have missed providing input for a mandatory parameter.", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource.Possible media types can be:-\n - Application/json\n - Multipart/form-data\n - Application/x-www-form-urlencoded", + "key": "Content-Type", + "value": "ea laborum" + }, + { + "description": "(Required) The Registered User ID to execute the API.", + "key": "X-Authenticated-User-token", + "value": "ea laborum" + }, + { + "description": "(Required) All content APIs require authorization for use. Specify the authorization key received from the administrator when placing the request for use of the API.", + "key": "Authorization", + "value": "ea laborum" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"versionKey\": \"1507102327646\"\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/content/v2/flag/accept/:Content_Id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v2", + "flag", + "accept", + ":Content_Id" + ], + "variable": [ + { + "key": "Content_Id", + "value": "ea laborum", + "description": "(Required) Please append a valid Content Id To the Request URL" + } + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"api.flag.accept\",\n \"ver\": \"1.0\",\n \"ts\": \"2020-12-11T11:25:34.614Z\",\n \"params\": {\n \"resmsgid\": \"95ef7b60-3ba3-11eb-be5b-f9d249ba9049\",\n \"msgid\": null,\n \"status\": \"failed\",\n \"err\": \"ERR_INVALID_CONTENT\",\n \"errmsg\": \"Invalid Flagged Content! Content Can Not Be Accepted.\"\n },\n \"responseCode\": \"CLIENT_ERROR\",\n \"result\": {}\n}" + }, + { + "name": "RESOURCE NOT FOUND,**Content Send for Flag Accept** operation failed !The possible reason for failure is that you may have provided wrong content id.", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource.Possible media types can be:-\n - Application/json\n - Multipart/form-data\n - Application/x-www-form-urlencoded", + "key": "Content-Type", + "value": "ea laborum" + }, + { + "description": "(Required) The Registered User ID to execute the API.", + "key": "X-Authenticated-User-token", + "value": "ea laborum" + }, + { + "description": "(Required) All content APIs require authorization for use. Specify the authorization key received from the administrator when placing the request for use of the API.", + "key": "Authorization", + "value": "ea laborum" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"versionKey\": \"1507102327646\"\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/content/v2/flag/accept/:Content_Id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v2", + "flag", + "accept", + ":Content_Id" + ], + "variable": [ + { + "key": "Content_Id", + "value": "ea laborum", + "description": "(Required) Please append a valid Content Id To the Request URL" + } + ] + } + }, + "status": "Not Found", + "code": 404, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"api.flag.accept\",\n \"ver\": \"1.0\",\n \"ts\": \"2020-12-11T11:24:42.903Z\",\n \"params\": {\n \"resmsgid\": \"771d0270-3ba3-11eb-be5b-f9d249ba9049\",\n \"msgid\": null,\n \"status\": \"failed\",\n \"err\": \"NOT_FOUND\",\n \"errmsg\": \"Error! Node(s) doesn't Exists. | [Invalid Node Id.]: do_213143334457982976144\"\n },\n \"responseCode\": \"RESOURCE_NOT_FOUND\",\n \"result\": {}\n}" + }, + { + "name": "INTERNAL SERVER ERROR ! Looks like something went wrong! These errors are tracked automatically, but if the problem persists feel free to contact us. In the meantime, try refreshing.", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource.Possible media types can be:-\n - Application/json\n - Multipart/form-data\n - Application/x-www-form-urlencoded", + "key": "Content-Type", + "value": "ea laborum" + }, + { + "description": "(Required) The Registered User ID to execute the API.", + "key": "X-Authenticated-User-token", + "value": "ea laborum" + }, + { + "description": "(Required) All content APIs require authorization for use. Specify the authorization key received from the administrator when placing the request for use of the API.", + "key": "Authorization", + "value": "ea laborum" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"versionKey\": \"1507102327646\"\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/content/v2/flag/accept/:Content_Id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v2", + "flag", + "accept", + ":Content_Id" + ], + "variable": [ + { + "key": "Content_Id", + "value": "ea laborum", + "description": "(Required) Please append a valid Content Id To the Request URL" + } + ] + } + }, + "status": "Internal Server Error", + "code": 500, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"result\": {},\n \"id\": \"cupidatat reprehenderit dolor\",\n \"ver\": \"minim anim commodo\",\n \"ts\": \"commodo\",\n \"params\": {\n \"resmsgid\": \"pariatur repre\",\n \"msgid\": \"irure\",\n \"err\": \"consequat esse ea\",\n \"status\": \"esse\",\n \"errmsg\": \"aliqua laboris velit\"\n },\n \"responseCode\": \"reprehenderit dolor elit sunt dolore\"\n}" + } + ] + } + ] + }, + { + "name": "Negative", + "item": [ + { + "name": "Flag accept invalid content id", + "request": { + "auth": { + "type": "apikey", + "apikey": [ + { + "key": "key", + "value": "Authorization", + "type": "string" + }, + { + "key": "value", + "value": "", + "type": "string" + }, + { + "key": "in", + "value": "header", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "description": "(Required) The Content Type entity is the media type of the resource.Possible media types can be:-\n - Application/json\n - Multipart/form-data\n - Application/x-www-form-urlencoded", + "key": "Content-Type", + "value": "ea laborum" + }, + { + "description": "(Required) The Registered User ID to execute the API.", + "key": "X-Authenticated-User-token", + "value": "ea laborum" + }, + { + "description": "(Required) All content APIs require authorization for use. Specify the authorization key received from the administrator when placing the request for use of the API.", + "key": "Authorization", + "value": "ea laborum" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"versionKey\": \"1507102327646\"\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/content/v2/flag/accept/{{flag_accept_content_id}}", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v2", + "flag", + "accept", + "{{flag_accept_content_id}}" + ] + }, + "description": "This API is associated with setting Accept Flag for content under review process on the Sunbird Platform .\n - The **_/flag/accept/_**endpoint executes request for flagging content under review to \"Accept flag\", if content is found appropriate.\n - The endpoint for **Flag Accept Content** is `/content/v2/flag/accept`\n - It points to knowledge-mw-service - `/v2/content/flag/accept`\n - It is mandatory to provide values for parameters marked with *.\n - Mandatory fields cannot be null or empty." + }, + "response": [ + { + "name": "OK ! Successful operation.\"Accept Flag\" operation was successfully executed.", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource.Possible media types can be:-\n - Application/json\n - Multipart/form-data\n - Application/x-www-form-urlencoded", + "key": "Content-Type", + "value": "ea laborum" + }, + { + "description": "(Required) The Registered User ID to execute the API.", + "key": "X-Authenticated-User-token", + "value": "ea laborum" + }, + { + "description": "(Required) All content APIs require authorization for use. Specify the authorization key received from the administrator when placing the request for use of the API.", + "key": "Authorization", + "value": "ea laborum" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"versionKey\": \"1507102327646\"\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/content/v2/flag/accept/:Content_Id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v2", + "flag", + "accept", + ":Content_Id" + ], + "variable": [ + { + "key": "Content_Id", + "value": "ea laborum", + "description": "(Required) Please append a valid Content Id To the Request URL" + } + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"api.flag.accept\",\n \"ver\": \"1.0\",\n \"ts\": \"2020-12-11T11:40:01.464Z\",\n \"params\": {\n \"resmsgid\": \"9a9e4b80-3ba5-11eb-b0a2-8d5c9f561887\",\n \"msgid\": \"9a49e9f0-3ba5-11eb-b0a2-8d5c9f561887\",\n \"status\": \"successful\",\n \"err\": null,\n \"errmsg\": null\n },\n \"responseCode\": \"OK\",\n \"result\": {\n \"identifier\": \"do_31221753157709004825531\",\n \"node_id\": \"do_31221753157709004825531\",\n \"versionKey\": \"1607686801161\"\n }\n}" + }, + { + "name": "BAD REQUEST. The \"Accept Flag\" operation failed ! The possible reason for failure is that you may have missed providing input for a mandatory parameter.", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource.Possible media types can be:-\n - Application/json\n - Multipart/form-data\n - Application/x-www-form-urlencoded", + "key": "Content-Type", + "value": "ea laborum" + }, + { + "description": "(Required) The Registered User ID to execute the API.", + "key": "X-Authenticated-User-token", + "value": "ea laborum" + }, + { + "description": "(Required) All content APIs require authorization for use. Specify the authorization key received from the administrator when placing the request for use of the API.", + "key": "Authorization", + "value": "ea laborum" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"versionKey\": \"1507102327646\"\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/content/v2/flag/accept/:Content_Id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v2", + "flag", + "accept", + ":Content_Id" + ], + "variable": [ + { + "key": "Content_Id", + "value": "ea laborum", + "description": "(Required) Please append a valid Content Id To the Request URL" + } + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"api.flag.accept\",\n \"ver\": \"1.0\",\n \"ts\": \"2020-12-11T11:25:34.614Z\",\n \"params\": {\n \"resmsgid\": \"95ef7b60-3ba3-11eb-be5b-f9d249ba9049\",\n \"msgid\": null,\n \"status\": \"failed\",\n \"err\": \"ERR_INVALID_CONTENT\",\n \"errmsg\": \"Invalid Flagged Content! Content Can Not Be Accepted.\"\n },\n \"responseCode\": \"CLIENT_ERROR\",\n \"result\": {}\n}" + }, + { + "name": "RESOURCE NOT FOUND,**Content Send for Flag Accept** operation failed !The possible reason for failure is that you may have provided wrong content id.", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource.Possible media types can be:-\n - Application/json\n - Multipart/form-data\n - Application/x-www-form-urlencoded", + "key": "Content-Type", + "value": "ea laborum" + }, + { + "description": "(Required) The Registered User ID to execute the API.", + "key": "X-Authenticated-User-token", + "value": "ea laborum" + }, + { + "description": "(Required) All content APIs require authorization for use. Specify the authorization key received from the administrator when placing the request for use of the API.", + "key": "Authorization", + "value": "ea laborum" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"versionKey\": \"1507102327646\"\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/content/v2/flag/accept/:Content_Id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v2", + "flag", + "accept", + ":Content_Id" + ], + "variable": [ + { + "key": "Content_Id", + "value": "ea laborum", + "description": "(Required) Please append a valid Content Id To the Request URL" + } + ] + } + }, + "status": "Not Found", + "code": 404, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"api.flag.accept\",\n \"ver\": \"1.0\",\n \"ts\": \"2020-12-11T11:24:42.903Z\",\n \"params\": {\n \"resmsgid\": \"771d0270-3ba3-11eb-be5b-f9d249ba9049\",\n \"msgid\": null,\n \"status\": \"failed\",\n \"err\": \"NOT_FOUND\",\n \"errmsg\": \"Error! Node(s) doesn't Exists. | [Invalid Node Id.]: do_213143334457982976144\"\n },\n \"responseCode\": \"RESOURCE_NOT_FOUND\",\n \"result\": {}\n}" + }, + { + "name": "INTERNAL SERVER ERROR ! Looks like something went wrong! These errors are tracked automatically, but if the problem persists feel free to contact us. In the meantime, try refreshing.", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource.Possible media types can be:-\n - Application/json\n - Multipart/form-data\n - Application/x-www-form-urlencoded", + "key": "Content-Type", + "value": "ea laborum" + }, + { + "description": "(Required) The Registered User ID to execute the API.", + "key": "X-Authenticated-User-token", + "value": "ea laborum" + }, + { + "description": "(Required) All content APIs require authorization for use. Specify the authorization key received from the administrator when placing the request for use of the API.", + "key": "Authorization", + "value": "ea laborum" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"versionKey\": \"1507102327646\"\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/content/v2/flag/accept/:Content_Id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v2", + "flag", + "accept", + ":Content_Id" + ], + "variable": [ + { + "key": "Content_Id", + "value": "ea laborum", + "description": "(Required) Please append a valid Content Id To the Request URL" + } + ] + } + }, + "status": "Internal Server Error", + "code": 500, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"result\": {},\n \"id\": \"cupidatat reprehenderit dolor\",\n \"ver\": \"minim anim commodo\",\n \"ts\": \"commodo\",\n \"params\": {\n \"resmsgid\": \"pariatur repre\",\n \"msgid\": \"irure\",\n \"err\": \"consequat esse ea\",\n \"status\": \"esse\",\n \"errmsg\": \"aliqua laboris velit\"\n },\n \"responseCode\": \"reprehenderit dolor elit sunt dolore\"\n}" + } + ] + } + ] + } + ] + } + ] + }, + { + "name": "Create Content", + "item": [ + { + "name": "Positive", + "item": [ + { + "name": "Create content with minimal required attribute", + "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(\"Status code name has string OK\", function () {", + " pm.response.to.have.status(\"OK\");", + "});", + "pm.test(\"id should be api.content.create\", function () {", + " pm.expect(jsonResponse.id).to.eql(\"api.content.create\");", + "});", + "pm.test(\"ver should be 4.0\", function () {", + " pm.expect(jsonResponse.ver).to.eql(\"4.0\");", + "});", + "", + "pm.test(\"Params has keys: resmsgid , msgid , err , status , errmsg \", () => {", + " pm.expect(jsonResponse.params).to.have.all.keys('resmsgid', 'msgid','err','status','errmsg');", + " pm.expect(jsonResponse.params.resmsgid).to.be.a(\"string\");", + " pm.expect(jsonResponse.params.msgid).to.be.a('null');", + " pm.expect(jsonResponse.params.err).to.be.a('null');", + " pm.expect(jsonResponse.params.status).to.be.a(\"string\");", + " pm.expect(jsonResponse.params.errmsg).to.be.a('null');", + "});", + "", + "pm.test(\"Status is successful\", function () {", + " pm.expect(jsonResponse.params.status).to.be.equal(\"successful\");", + "});", + "", + "pm.test(\"ResponseCode is OK\", function () {", + " pm.expect(jsonResponse.responseCode).to.be.equal(\"OK\");", + "});", + "pm.test(\"Result has keys: identifier , node_id , versionKey\", () => {", + " pm.expect(jsonResponse.result).to.have.all.keys('identifier', 'node_id','versionKey');", + " pm.expect(jsonResponse.result.identifier).to.be.a(\"string\");", + " pm.expect(jsonResponse.result.versionKey).to.be.a(\"string\");", + " pm.expect(jsonResponse.result.node_id).to.be.a(\"string\");", + "});", + "", + "// Set global variable", + "pm.collectionVariables.set(\"content_id_01\", jsonResponse.result.identifier);", + "" + ], + "type": "text/javascript" + } + } + ], + "protocolProfileBehavior": { + "disabledSystemHeaders": { + "connection": true + } + }, + "request": { + "auth": { + "type": "apikey", + "apikey": [ + { + "key": "value", + "value": "{{kong_api_key}}", + "type": "string" + }, + { + "key": "key", + "value": "Authorization", + "type": "string" + }, + { + "key": "in", + "value": "header", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "X-Authenticated-User-token", + "value": "{{keycloak_access_token}}" + }, + { + "key": "", + "value": "", + "disabled": true + }, + { + "key": "X-Channel-Id", + "value": "{{channel_id}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"content\": {\n \"name\": \"Untitled Content\",\n \"code\": \"1242e9ea-660a-4536-a142-cc242a7a4162\",\n \"mimeType\": \"application/pdf\",\n \"primaryCategory\": \"Explanation Content\"\n }\n }\n}" + }, + "url": { + "raw": "{{host}}/content/v4/create", + "host": [ + "{{host}}" + ], + "path": [ + "content", + "v4", + "create" + ] + }, + "description": "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." + }, + "response": [] + }, + { + "name": "Create content with identifier", + "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(\"Status code name has string OK\", function () {", + " pm.response.to.have.status(\"OK\");", + "});", + "pm.test(\"id should be api.content.create\", function () {", + " pm.expect(jsonResponse.id).to.eql(\"api.content.create\");", + "});", + "pm.test(\"ver should be 4.0\", function () {", + " pm.expect(jsonResponse.ver).to.eql(\"4.0\");", + "});", + "", + "pm.test(\"Params has keys: resmsgid , msgid , err , status , errmsg \", () => {", + " pm.expect(jsonResponse.params).to.have.all.keys('resmsgid', 'msgid','err','status','errmsg');", + " pm.expect(jsonResponse.params.resmsgid).to.be.a(\"string\");", + " pm.expect(jsonResponse.params.msgid).to.be.a('null');", + " pm.expect(jsonResponse.params.err).to.be.a('null');", + " pm.expect(jsonResponse.params.status).to.be.a(\"string\");", + " pm.expect(jsonResponse.params.errmsg).to.be.a('null');", + "});", + "", + "pm.test(\"Status is successful\", function () {", + " pm.expect(jsonResponse.params.status).to.be.equal(\"successful\");", + "});", + "", + "pm.test(\"ResponseCode is OK\", function () {", + " pm.expect(jsonResponse.responseCode).to.be.equal(\"OK\");", + "});", + "pm.test(\"Result has keys: identifier , node_id , versionKey\", () => {", + " pm.expect(jsonResponse.result).to.have.all.keys('identifier', 'node_id','versionKey');", + " pm.expect(jsonResponse.result.identifier).to.be.a(\"string\");", + " pm.expect(jsonResponse.result.versionKey).to.be.a(\"string\");", + " pm.expect(jsonResponse.result.node_id).to.be.a(\"string\");", + "});", + "", + "// Result", + "pm.test(`identifier should be equal to ${JSON.parse(request.data).request.content.identifier}`, () => {", + " pm.expect(jsonResponse.result.identifier).to.eql(`${JSON.parse(request.data).request.content.identifier}`);", + "});", + "pm.test(`node_id should be equal to ${JSON.parse(request.data).request.content.identifier}`, () => {", + " pm.expect(jsonResponse.result.node_id).to.eql(`${JSON.parse(request.data).request.content.identifier}`);", + "});", + "", + "", + "" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "pm.collectionVariables.set(\"identifier\", \"some_identifier07\");" + ], + "type": "text/javascript" + } + } + ], + "protocolProfileBehavior": { + "disabledSystemHeaders": { + "connection": true + } + }, + "request": { + "auth": { + "type": "apikey", + "apikey": [ + { + "key": "value", + "value": "{{auth_token}}", + "type": "string" + }, + { + "key": "key", + "value": "Authorization", + "type": "string" + }, + { + "key": "in", + "value": "header", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "X-Authenticated-User-token", + "value": "{{keycloak_access_token}}" + }, + { + "key": "Authorization", + "value": "{{kong_api_key}}" + }, + { + "key": "X-Channel-Id", + "value": "{{channel_id}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"content\": {\n \"identifier\": \"{{identifier}}\",\n \"name\": \"Untitled Content\",\n \"code\": \"1242e9ea-660a-4536-a142-cc242a7a4162\",\n \"mimeType\": \"application/pdf\",\n \"primaryCategory\": \"Explanation Content\"\n }\n }\n}" + }, + "url": { + "raw": "{{host}}/content/v4/create", + "host": [ + "{{host}}" + ], + "path": [ + "content", + "v4", + "create" + ] + }, + "description": "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." + }, + "response": [] + }, + { + "name": "Create content with external fields", + "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(\"Status code name has string OK\", function () {", + " pm.response.to.have.status(\"OK\");", + "});", + "pm.test(\"id should be api.content.create\", function () {", + " pm.expect(jsonResponse.id).to.eql(\"api.content.create\");", + "});", + "pm.test(\"ver should be 4.0\", function () {", + " pm.expect(jsonResponse.ver).to.eql(\"4.0\");", + "});", + "", + "pm.test(\"Params has keys: resmsgid , msgid , err , status , errmsg \", () => {", + " pm.expect(jsonResponse.params).to.have.all.keys('resmsgid', 'msgid','err','status','errmsg');", + " pm.expect(jsonResponse.params.resmsgid).to.be.a(\"string\");", + " pm.expect(jsonResponse.params.msgid).to.be.a('null');", + " pm.expect(jsonResponse.params.err).to.be.a('null');", + " pm.expect(jsonResponse.params.status).to.be.a(\"string\");", + " pm.expect(jsonResponse.params.errmsg).to.be.a('null');", + "});", + "", + "pm.test(\"Status is successful\", function () {", + " pm.expect(jsonResponse.params.status).to.be.equal(\"successful\");", + "});", + "", + "pm.test(\"ResponseCode is OK\", function () {", + " pm.expect(jsonResponse.responseCode).to.be.equal(\"OK\");", + "});", + "pm.test(\"Result has keys: identifier , node_id , versionKey\", () => {", + " pm.expect(jsonResponse.result).to.have.all.keys('identifier', 'node_id','versionKey');", + " pm.expect(jsonResponse.result.identifier).to.be.a(\"string\");", + " pm.expect(jsonResponse.result.versionKey).to.be.a(\"string\");", + " pm.expect(jsonResponse.result.node_id).to.be.a(\"string\");", + "});", + "", + "", + "// Set global variable", + "pm.collectionVariables.set(\"content_id_02\", jsonResponse.result.identifier);", + "", + "" + ], + "type": "text/javascript" + } + } + ], + "protocolProfileBehavior": { + "disabledSystemHeaders": { + "connection": true + } + }, + "request": { + "auth": { + "type": "apikey", + "apikey": [ + { + "key": "value", + "value": "{{auth_token}}", + "type": "string" + }, + { + "key": "key", + "value": "Authorization", + "type": "string" + }, + { + "key": "in", + "value": "header", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "X-Authenticated-User-token", + "value": "{{keycloak_access_token}}" + }, + { + "key": "Authorization", + "value": "{{kong_api_key}}" + }, + { + "key": "X-Channel-Id", + "value": "{{channel_id}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"content\": {\n \"name\": \"Untitled Content\",\n \"code\": \"1242e9ea-660a-4536-a142-cc242a7a4162\",\n \"mimeType\": \"application/pdf\",\n \"primaryCategory\": \"Explanation Content\",\n \"body\": \"{\\\"key\\\":\\\"value\\\"}\"\n }\n }\n}" + }, + "url": { + "raw": "{{host}}/content/v4/create", + "host": [ + "{{host}}" + ], + "path": [ + "content", + "v4", + "create" + ] + }, + "description": "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." + }, + "response": [] + }, + { + "name": "Create content with Special character in name", + "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(\"Status code name has string OK\", function () {", + " pm.response.to.have.status(\"OK\");", + "});", + "pm.test(\"id should be api.content.create\", function () {", + " pm.expect(jsonResponse.id).to.eql(\"api.content.create\");", + "});", + "pm.test(\"ver should be 4.0\", function () {", + " pm.expect(jsonResponse.ver).to.eql(\"4.0\");", + "});", + "", + "pm.test(\"Params has keys: resmsgid , msgid , err , status , errmsg \", () => {", + " pm.expect(jsonResponse.params).to.have.all.keys('resmsgid', 'msgid','err','status','errmsg');", + " pm.expect(jsonResponse.params.resmsgid).to.be.a(\"string\");", + " pm.expect(jsonResponse.params.msgid).to.be.a('null');", + " pm.expect(jsonResponse.params.err).to.be.a('null');", + " pm.expect(jsonResponse.params.status).to.be.a(\"string\");", + " pm.expect(jsonResponse.params.errmsg).to.be.a('null');", + "});", + "", + "pm.test(\"Status is successful\", function () {", + " pm.expect(jsonResponse.params.status).to.be.equal(\"successful\");", + "});", + "", + "pm.test(\"ResponseCode is OK\", function () {", + " pm.expect(jsonResponse.responseCode).to.be.equal(\"OK\");", + "});", + "pm.test(\"Result has keys: identifier , node_id , versionKey\", () => {", + " pm.expect(jsonResponse.result).to.have.all.keys('identifier', 'node_id','versionKey');", + " pm.expect(jsonResponse.result.identifier).to.be.a(\"string\");", + " pm.expect(jsonResponse.result.versionKey).to.be.a(\"string\");", + " pm.expect(jsonResponse.result.node_id).to.be.a(\"string\");", + "});", + "", + "", + "// Set global variable", + "pm.collectionVariables.set(\"content_id_03\", jsonResponse.result.identifier);", + "", + "" + ], + "type": "text/javascript" + } + } + ], + "protocolProfileBehavior": { + "disabledSystemHeaders": { + "connection": 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}}" + }, + { + "key": "X-Channel-Id", + "value": "{{channel_id}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"content\": {\n \"name\": \"~`S!@#$%^&*()_+=:;\\\"'<,>.?/\",\n \"code\": \"1242e9ea-660a-4536-a142-cc242a7a4162\",\n \"mimeType\": \"application/pdf\",\n \"primaryCategory\": \"Explanation Content\"\n }\n }\n}" + }, + "url": { + "raw": "{{host}}/content/v4/create", + "host": [ + "{{host}}" + ], + "path": [ + "content", + "v4", + "create" + ] + }, + "description": "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." + }, + "response": [] + } + ] + }, + { + "name": "Negative", + "item": [ + { + "name": "Create content with missing channel", + "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(\"id should be api.content.create\", function () {", + " pm.expect(jsonResponse.id).to.eql(\"api.content.create\");", + "});", + "", + "pm.test(\"ver should be 4.0\", function () {", + " pm.expect(jsonResponse.ver).to.eql(\"4.0\");", + "});", + "", + "pm.test(\"Params has keys: resmsgid , msgid , err , status , errmsg \", () => {", + " pm.expect(jsonResponse.params).to.have.all.keys('resmsgid', 'msgid','err','status','errmsg');", + " pm.expect(jsonResponse.params.resmsgid).to.be.a(\"string\");", + " pm.expect(jsonResponse.params.msgid).to.be.a('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(\"Verify keys and data type of the response result\", () => {", + " pm.expect(jsonResponse.result).to.be.an(\"object\");", + " pm.expect(jsonResponse.result).to.have.all.keys('messages');", + " pm.expect(jsonResponse.result.messages).to.not.be.empty;", + "});", + "", + "//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 \\\"CLIENT_ERROR\\\"\", () => {", + " pm.expect(jsonResponse.params.err).to.eql(\"CLIENT_ERROR\");", + "});", + "pm.test(\"params.errmsg should be \\\"Validation Errors\\\"\", () => {", + " pm.expect(jsonResponse.params.errmsg).to.eql(\"Validation Errors\");", + "});", + "", + "// Result", + "pm.test(\"result body should include messages \\\"Required Metadata channel not set\\\"\", () => {", + " pm.expect(jsonResponse.result.messages).to.have.length(1)", + " pm.expect(jsonResponse.result.messages).to.include('Required Metadata channel not set');", + "});", + "" + ], + "type": "text/javascript" + } + } + ], + "protocolProfileBehavior": { + "disabledSystemHeaders": { + "connection": 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}}" + }, + { + "key": "X-Channel-Id", + "value": "", + "type": "text", + "disabled": true + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"content\": {\n \"name\": \"Untitled Content\",\n \"code\": \"1242e9ea-660a-4536-a142-cc242a7a4162\",\n \"mimeType\": \"application/pdf\",\n \"createdBy\": \"530b19ea-dc8d-4cc7-a4b5-0c0214c8113a\",\n \"resourceType\": \"Learn\",\n \"framework\": \"ekstep_ncert_k-12\",\n \"primaryCategory\": \"Explanation Content\"\n }\n }\n}" + }, + "url": { + "raw": "{{host}}/content/v4/create", + "host": [ + "{{host}}" + ], + "path": [ + "content", + "v4", + "create" + ] + }, + "description": "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." + }, + "response": [] + }, + { + "name": "Create content with empty channel", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json()", + "", + "//Verification", + "pm.test(\"Status code is 400\", () => {", + " pm.response.to.have.status(400)", + "});", + "pm.test(\"id should be api.content.create\", function () {", + " pm.expect(jsonResponse.id).to.eql(\"api.content.create\");", + "});", + "", + "pm.test(\"ver should be 4.0\", function () {", + " pm.expect(jsonResponse.ver).to.eql(\"4.0\");", + "});", + "", + "pm.test(\"Params has keys: resmsgid , msgid , err , status , errmsg \", () => {", + " pm.expect(jsonResponse.params).to.have.all.keys('resmsgid', 'msgid','err','status','errmsg');", + " pm.expect(jsonResponse.params.resmsgid).to.be.a(\"string\");", + " pm.expect(jsonResponse.params.msgid).to.be.a('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');", + "});", + "", + "//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\");", + " pm.expect(jsonResponse.result).to.have.all.keys('messages');", + " pm.expect(jsonResponse.result.messages).to.not.be.empty;", + "});", + "", + "//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 \\\"CLIENT_ERROR\\\"\", () => {", + " pm.expect(jsonResponse.params.err).to.eql(\"CLIENT_ERROR\");", + "});", + "pm.test(\"params.errmsg should be \\\"Validation Errors\\\"\", () => {", + " pm.expect(jsonResponse.params.errmsg).to.eql(\"Validation Errors\");", + "});", + "", + "// Result", + "pm.test(\"result body should include messages \\\"Required Metadata channel not set\\\"\", () => {", + " pm.expect(jsonResponse.result.messages).to.have.length(1)", + " pm.expect(jsonResponse.result.messages).to.include('Required Metadata channel not set');", + "});", + "" + ], + "type": "text/javascript" + } + } + ], + "protocolProfileBehavior": { + "disabledSystemHeaders": { + "connection": 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}}" + }, + { + "key": "X-Channel-Id", + "value": "", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"content\": {\n \"name\": \"Untitled Content\",\n \"code\": \"1242e9ea-660a-4536-a142-cc242a7a4162\",\n \"mimeType\": \"application/pdf\",\n \"createdBy\": \"530b19ea-dc8d-4cc7-a4b5-0c0214c8113a\",\n \"resourceType\": \"Learn\",\n \"framework\": \"ekstep_ncert_k-12\",\n \"primaryCategory\": \"Explanation Content\"\n }\n }\n}" + }, + "url": { + "raw": "{{host}}/content/v4/create", + "host": [ + "{{host}}" + ], + "path": [ + "content", + "v4", + "create" + ] + }, + "description": "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." + }, + "response": [] + }, + { + "name": "Create content with missing name", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json()", + "", + "//Verification", + "pm.test(\"Status code is 400\", () => {", + " pm.response.to.have.status(400)", + "});", + "pm.test(\"id should be api.content.create\", function () {", + " pm.expect(jsonResponse.id).to.eql(\"api.content.create\");", + "});", + "", + "pm.test(\"ver should be 4.0\", function () {", + " pm.expect(jsonResponse.ver).to.eql(\"4.0\");", + "});", + "", + "pm.test(\"Params has keys: resmsgid , msgid , err , status , errmsg \", () => {", + " pm.expect(jsonResponse.params).to.have.all.keys('resmsgid', 'msgid','err','status','errmsg');", + " pm.expect(jsonResponse.params.resmsgid).to.be.a(\"string\");", + " pm.expect(jsonResponse.params.msgid).to.be.a('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');", + "});", + "", + "//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\");", + " pm.expect(jsonResponse.result).to.have.all.keys('messages');", + " pm.expect(jsonResponse.result.messages).to.not.be.empty;", + "});", + "", + "//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 \\\"CLIENT_ERROR\\\"\", () => {", + " pm.expect(jsonResponse.params.err).to.eql(\"CLIENT_ERROR\");", + "});", + "pm.test(\"params.errmsg should be \\\"Validation Errors\\\"\", () => {", + " pm.expect(jsonResponse.params.errmsg).to.eql(\"Validation Errors\");", + "});", + "", + "// Result", + "pm.test(\"result body should include messages \\\"Required Metadata name not set\\\"\", () => {", + " pm.expect(jsonResponse.result.messages).to.have.length(1)", + " pm.expect(jsonResponse.result.messages).to.include('Required Metadata name not set');", + "});", + "" + ], + "type": "text/javascript" + } + } + ], + "protocolProfileBehavior": { + "disabledSystemHeaders": { + "connection": 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}}" + }, + { + "key": "X-Channel-Id", + "value": "{{channel_id}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"content\": {\n \"code\": \"1242e9ea-660a-4536-a142-cc242a7a4162\",\n \"mimeType\": \"application/pdf\",\n \"primaryCategory\": \"Explanation Content\"\n }\n }\n}" + }, + "url": { + "raw": "{{host}}/content/v4/create", + "host": [ + "{{host}}" + ], + "path": [ + "content", + "v4", + "create" + ] + }, + "description": "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." + }, + "response": [] + }, + { + "name": "Create content with name: invalid datatype", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json()", + "", + "//Verification", + "pm.test(\"Status code is 400\", () => {", + " pm.response.to.have.status(400)", + "});", + "pm.test(\"id should be api.content.create\", function () {", + " pm.expect(jsonResponse.id).to.eql(\"api.content.create\");", + "});", + "", + "pm.test(\"ver should be 4.0\", function () {", + " pm.expect(jsonResponse.ver).to.eql(\"4.0\");", + "});", + "", + "pm.test(\"Params has keys: resmsgid , msgid , err , status , errmsg \", () => {", + " pm.expect(jsonResponse.params).to.have.all.keys('resmsgid', 'msgid','err','status','errmsg');", + " pm.expect(jsonResponse.params.resmsgid).to.be.a(\"string\");", + " pm.expect(jsonResponse.params.msgid).to.be.a('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');", + "});", + "", + "//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\");", + " pm.expect(jsonResponse.result).to.have.all.keys('messages');", + " pm.expect(jsonResponse.result.messages).to.not.be.empty;", + "});", + "", + "//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 \\\"CLIENT_ERROR\\\"\", () => {", + " pm.expect(jsonResponse.params.err).to.eql(\"CLIENT_ERROR\");", + "});", + "pm.test(\"params.errmsg should be \\\"Validation Errors\\\"\", () => {", + " pm.expect(jsonResponse.params.errmsg).to.eql(\"Validation Errors\");", + "});", + "", + "// Result", + "pm.test(\"result body should include messages \\\"Metadata name should be a/an String value\\\"\", () => {", + " pm.expect(jsonResponse.result.messages).to.have.length(1)", + " pm.expect(jsonResponse.result.messages).to.include('Metadata name should be a/an String value');", + "});", + "" + ], + "type": "text/javascript" + } + } + ], + "protocolProfileBehavior": { + "disabledSystemHeaders": { + "connection": 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}}" + }, + { + "key": "X-Channel-Id", + "value": "{{channel_id}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"content\": {\n \"name\": 423432,\n \"code\": \"1242e9ea-660a-4536-a142-cc242a7a4162\",\n \"mimeType\": \"application/pdf\",\n \"primaryCategory\": \"Explanation Content\"\n }\n }\n}" + }, + "url": { + "raw": "{{host}}/content/v4/create", + "host": [ + "{{host}}" + ], + "path": [ + "content", + "v4", + "create" + ] + }, + "description": "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." + }, + "response": [] + }, + { + "name": "Create content with name empty", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json()", + "", + "//Verification", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400)", + "});", + "pm.test(\"id should be api.content.create\", function () {", + " pm.expect(jsonResponse.id).to.eql(\"api.content.create\");", + "});", + "", + "pm.test(\"ver should be 4.0\", function () {", + " pm.expect(jsonResponse.ver).to.eql(\"4.0\");", + "});", + "", + "pm.test(\"Params has keys: resmsgid , msgid , err , status , errmsg \", () => {", + " pm.expect(jsonResponse.params).to.have.all.keys('resmsgid', 'msgid','err','status','errmsg');", + " pm.expect(jsonResponse.params.resmsgid).to.be.a(\"string\");", + " pm.expect(jsonResponse.params.msgid).to.be.a('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');", + "});", + "", + "//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\");", + " pm.expect(jsonResponse.result).to.have.all.keys('messages');", + " pm.expect(jsonResponse.result.messages).to.not.be.empty;", + "});", + "", + "//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 \\\"CLIENT_ERROR\\\"\", () => {", + " pm.expect(jsonResponse.params.err).to.eql(\"CLIENT_ERROR\");", + "});", + "pm.test(\"params.errmsg should be \\\"Validation Errors\\\"\", () => {", + " pm.expect(jsonResponse.params.errmsg).to.eql(\"Validation Errors\");", + "});", + "", + "// Result", + "pm.test(\"result body should include messages \\\"Required Metadata name not set\\\"\", () => {", + " pm.expect(jsonResponse.result.messages).to.have.length(1)", + " pm.expect(jsonResponse.result.messages).to.include('Required Metadata name not set');", + "});", + "" + ], + "type": "text/javascript" + } + } + ], + "protocolProfileBehavior": { + "disabledSystemHeaders": { + "connection": 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}}" + }, + { + "key": "X-Channel-Id", + "value": "{{channel_id}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"content\": {\n \"name\": \"\",\n \"code\": \"1242e9ea-660a-4536-a142-cc242a7a4162\",\n \"mimeType\": \"application/pdf\",\n \"primaryCategory\": \"Explanation Content\"\n }\n }\n}" + }, + "url": { + "raw": "{{host}}/content/v4/create", + "host": [ + "{{host}}" + ], + "path": [ + "content", + "v4", + "create" + ] + }, + "description": "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." + }, + "response": [] + }, + { + "name": "Create content with missing code", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json()", + "", + "//Verification", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400)", + "});", + "pm.test(\"id should be api.content.create\", function () {", + " pm.expect(jsonResponse.id).to.eql(\"api.content.create\");", + "});", + "", + "pm.test(\"ver should be 4.0\", function () {", + " pm.expect(jsonResponse.ver).to.eql(\"4.0\");", + "});", + "", + "pm.test(\"Params has keys: resmsgid , msgid , err , status , errmsg \", () => {", + " pm.expect(jsonResponse.params).to.have.all.keys('resmsgid', 'msgid','err','status','errmsg');", + " pm.expect(jsonResponse.params.resmsgid).to.be.a(\"string\");", + " pm.expect(jsonResponse.params.msgid).to.be.a('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');", + "});", + "", + "//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\");", + " pm.expect(jsonResponse.result).to.have.all.keys('messages');", + " pm.expect(jsonResponse.result.messages).to.not.be.empty;", + "});", + "", + "//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 \\\"CLIENT_ERROR\\\"\", () => {", + " pm.expect(jsonResponse.params.err).to.eql(\"CLIENT_ERROR\");", + "});", + "pm.test(\"params.errmsg should be \\\"Validation Errors\\\"\", () => {", + " pm.expect(jsonResponse.params.errmsg).to.eql(\"Validation Errors\");", + "});", + "", + "// Result", + "pm.test(\"result body should include messages \\\"Required Metadata code not set\\\"\", () => {", + " pm.expect(jsonResponse.result.messages).to.have.length(1)", + " pm.expect(jsonResponse.result.messages).to.include('Required Metadata code not set');", + "});", + "" + ], + "type": "text/javascript" + } + } + ], + "protocolProfileBehavior": { + "disabledSystemHeaders": { + "connection": 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}}" + }, + { + "key": "X-Channel-Id", + "value": "{{channel_id}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"content\": {\n \"name\": \"Untitled Content\",\n \"mimeType\": \"application/pdf\",\n \"primaryCategory\": \"Explanation Content\"\n }\n }\n}" + }, + "url": { + "raw": "{{host}}/content/v4/create", + "host": [ + "{{host}}" + ], + "path": [ + "content", + "v4", + "create" + ] + }, + "description": "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." + }, + "response": [] + }, + { + "name": "Create content with missing mimeType", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json()", + "", + "//Verification", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400)", + "});", + "pm.test(\"id should be api.content.create\", function () {", + " pm.expect(jsonResponse.id).to.eql(\"api.content.create\");", + "});", + "", + "pm.test(\"ver should be 4.0\", function () {", + " pm.expect(jsonResponse.ver).to.eql(\"4.0\");", + "});", + "", + "pm.test(\"Params has keys: resmsgid , msgid , err , status , errmsg \", () => {", + " pm.expect(jsonResponse.params).to.have.all.keys('resmsgid', 'msgid','err','status','errmsg');", + " pm.expect(jsonResponse.params.resmsgid).to.be.a(\"string\");", + " pm.expect(jsonResponse.params.msgid).to.be.a('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');", + "});", + "", + "//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\");", + " pm.expect(jsonResponse.result).to.have.all.keys('messages');", + " pm.expect(jsonResponse.result.messages).to.not.be.empty;", + "});", + "", + "//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 \\\"CLIENT_ERROR\\\"\", () => {", + " pm.expect(jsonResponse.params.err).to.eql(\"CLIENT_ERROR\");", + "});", + "pm.test(\"params.errmsg should be \\\"Validation Errors\\\"\", () => {", + " pm.expect(jsonResponse.params.errmsg).to.eql(\"Validation Errors\");", + "});", + "", + "// Result", + "pm.test(\"result body should include messages \\\"Required Metadata mimeType not set\\\"\", () => {", + " pm.expect(jsonResponse.result.messages).to.have.length(1)", + " pm.expect(jsonResponse.result.messages).to.include('Required Metadata mimeType not set');", + "});", + "" + ], + "type": "text/javascript" + } + } + ], + "protocolProfileBehavior": { + "disabledSystemHeaders": { + "connection": 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}}" + }, + { + "key": "X-Channel-Id", + "value": "{{channel_id}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"content\": {\n \"name\": \"Untitled Content\",\n \"code\": \"1242e9ea-660a-4536-a142-cc242a7a4162\",\n \"primaryCategory\": \"Explanation Content\"\n }\n }\n}" + }, + "url": { + "raw": "{{host}}/content/v4/create", + "host": [ + "{{host}}" + ], + "path": [ + "content", + "v4", + "create" + ] + }, + "description": "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." + }, + "response": [] + }, + { + "name": "Create content with invalid mimeType", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json()", + "", + "//Verification", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400)", + "});", + "pm.test(\"id should be api.content.create\", function () {", + " pm.expect(jsonResponse.id).to.eql(\"api.content.create\");", + "});", + "", + "pm.test(\"ver should be 4.0\", function () {", + " pm.expect(jsonResponse.ver).to.eql(\"4.0\");", + "});", + "", + "pm.test(\"Params has keys: resmsgid , msgid , err , status , errmsg \", () => {", + " pm.expect(jsonResponse.params).to.have.all.keys('resmsgid', 'msgid','err','status','errmsg');", + " pm.expect(jsonResponse.params.resmsgid).to.be.a(\"string\");", + " pm.expect(jsonResponse.params.msgid).to.be.a('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(\"id should be api.content.create\", function () {", + " pm.expect(jsonResponse.id).to.eql(\"api.content.create\");", + "});", + "", + "pm.test(\"ver should be 4.0\", function () {", + " pm.expect(jsonResponse.ver).to.eql(\"4.0\");", + "});", + "", + "pm.test(\"Params has keys: resmsgid , msgid , err , status , errmsg \", () => {", + " pm.expect(jsonResponse.params).to.have.all.keys('resmsgid', 'msgid','err','status','errmsg');", + " pm.expect(jsonResponse.params.resmsgid).to.be.a(\"string\");", + " pm.expect(jsonResponse.params.msgid).to.be.a('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');", + "});", + "", + "//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\");", + " pm.expect(jsonResponse.result).to.have.all.keys('messages');", + " pm.expect(jsonResponse.result.messages).to.not.be.empty;", + "});", + "", + "//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 \\\"CLIENT_ERROR\\\"\", () => {", + " pm.expect(jsonResponse.params.err).to.eql(\"CLIENT_ERROR\");", + "});", + "pm.test(\"params.errmsg should be \\\"Validation Errors\\\"\", () => {", + " pm.expect(jsonResponse.params.errmsg).to.eql(\"Validation Errors\");", + "});", + "", + "// Result", + "pm.test(\"result body should include messages \\\"Metadata mimeType should be one of: [application/vnd.ekstep.ecml-archive, application/vnd.ekstep.html-archive, application/vnd.android.package-archive, application/vnd.ekstep.content-archive, application/vnd.ekstep.content-collection, application/vnd.ekstep.plugin-archive, application/vnd.ekstep.h5p-archive, application/epub, text/x-url, video/x-youtube, application/octet-stream, application/msword, application/pdf, image/jpeg, image/jpg, image/png, image/tiff, image/bmp, image/gif, image/svg+xml, video/avi, video/mpeg, video/quicktime, video/3gpp, video/mp4, video/ogg, video/webm, audio/mp3, audio/mp4, audio/mpeg, audio/ogg, audio/webm, audio/x-wav, audio/wav, application/json, application/quiz]\\\"\", () => {", + " pm.expect(jsonResponse.result.messages).to.have.length(1)", + " pm.expect(jsonResponse.result.messages).to.include('Metadata mimeType should be one of: [application/vnd.ekstep.ecml-archive, application/vnd.ekstep.html-archive, application/vnd.android.package-archive, application/vnd.ekstep.content-archive, application/vnd.ekstep.content-collection, application/vnd.ekstep.plugin-archive, application/vnd.ekstep.h5p-archive, application/epub, text/x-url, video/x-youtube, application/octet-stream, application/msword, application/pdf, image/jpeg, image/jpg, image/png, image/tiff, image/bmp, image/gif, image/svg+xml, video/avi, video/mpeg, video/quicktime, video/3gpp, video/mp4, video/ogg, video/webm, audio/mp3, audio/mp4, audio/mpeg, audio/ogg, audio/webm, audio/x-wav, audio/wav, application/json, application/quiz]');", + "});", + "" + ], + "type": "text/javascript" + } + } + ], + "protocolProfileBehavior": { + "disabledSystemHeaders": { + "connection": 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}}" + }, + { + "key": "X-Channel-Id", + "value": "{{channel_id}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"content\": {\n \"name\": \"Untitled Content\",\n \"code\": \"1242e9ea-660a-4536-a142-cc242a7a4162\",\n \"mimeType\": \"some-mimeType\",\n \"primaryCategory\": \"Explanation Content\"\n }\n }\n}" + }, + "url": { + "raw": "{{host}}/content/v4/create", + "host": [ + "{{host}}" + ], + "path": [ + "content", + "v4", + "create" + ] + }, + "description": "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." + }, + "response": [] + }, + { + "name": "Create content without primaryCategory", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json()", + "", + "//Verification", + "pm.test(\"Status code is 400\", () => {", + " pm.response.to.have.status(400)", + "});", + "pm.test(\"id should be api.content.create\", function () {", + " pm.expect(jsonResponse.id).to.eql(\"api.content.create\");", + "});", + "", + "pm.test(\"ver should be 4.0\", function () {", + " pm.expect(jsonResponse.ver).to.eql(\"4.0\");", + "});", + "", + "pm.test(\"Params has keys: resmsgid , msgid , err , status , errmsg \", () => {", + " pm.expect(jsonResponse.params).to.have.all.keys('resmsgid', 'msgid','err','status','errmsg');", + " pm.expect(jsonResponse.params.resmsgid).to.be.a(\"string\");", + " pm.expect(jsonResponse.params.msgid).to.be.a('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');", + "});", + "", + "//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 \\\"VALIDATION_ERROR\\\"\", () => {", + " pm.expect(jsonResponse.params.err).to.eql(\"VALIDATION_ERROR\");", + "});", + "pm.test(\"params.errmsg should be \\\"primaryCategory is a mandatory parameter\\\"\", () => {", + " pm.expect(jsonResponse.params.errmsg).to.eql(\"primaryCategory is a mandatory parameter\");", + "});", + "", + "// Result", + "pm.test(\"result body should be empty\", () => {", + " pm.expect(jsonResponse.result).to.eql({});", + " pm.expect(jsonResponse.result).to.be.empty;", + "});", + "" + ], + "type": "text/javascript" + } + } + ], + "protocolProfileBehavior": { + "disabledSystemHeaders": { + "connection": 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}}" + }, + { + "key": "X-Channel-Id", + "value": "{{channel_id}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"content\": {\n \"name\": \"Untitled Content\",\n \"code\": \"1242e9ea-660a-4536-a142-cc242a7a4162\",\n \"mimeType\": \"application/pdf\"\n }\n }\n}" + }, + "url": { + "raw": "{{host}}/content/v4/create", + "host": [ + "{{host}}" + ], + "path": [ + "content", + "v4", + "create" + ] + }, + "description": "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." + }, + "response": [] + }, + { + "name": "Create content with Invalid subject", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json()", + "", + "//Verification", + "pm.test(\"Status code is 400\", () => {", + " pm.response.to.have.status(400)", + "});", + "pm.test(\"id should be api.content.create\", function () {", + " pm.expect(jsonResponse.id).to.eql(\"api.content.create\");", + "});", + "", + "pm.test(\"ver should be 4.0\", function () {", + " pm.expect(jsonResponse.ver).to.eql(\"4.0\");", + "});", + "", + "pm.test(\"Params has keys: resmsgid , msgid , err , status , errmsg \", () => {", + " pm.expect(jsonResponse.params).to.have.all.keys('resmsgid', 'msgid','err','status','errmsg');", + " pm.expect(jsonResponse.params.resmsgid).to.be.a(\"string\");", + " pm.expect(jsonResponse.params.msgid).to.be.a('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');", + "});", + "", + "//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\");", + " pm.expect(jsonResponse.result).to.have.all.keys('messages');", + " pm.expect(jsonResponse.result.messages).to.not.be.empty;", + "});", + "", + "//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 \\\"CLIENT_ERROR\\\"\", () => {", + " pm.expect(jsonResponse.params.err).to.eql(\"CLIENT_ERROR\");", + "});", + "pm.test(\"params.errmsg should be \\\"Validation Errors.\\\"\", () => {", + " pm.expect(jsonResponse.params.errmsg).to.eql(\"Validation Errors.\");", + "});", + "", + "// Result", + "pm.test(\"result body should include messages \\\"subject range data is empty from the given framework.\\\"\", () => {", + " pm.expect(jsonResponse.result.messages).to.have.length(1)", + " pm.expect(jsonResponse.result.messages).to.include('subject range data is empty from the given framework.');", + "});", + "" + ], + "type": "text/javascript" + } + } + ], + "protocolProfileBehavior": { + "disabledSystemHeaders": { + "connection": 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}}" + }, + { + "key": "X-Channel-Id", + "value": "{{channel_id}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"content\": {\n \"name\": \"Untitled Content\",\n \"code\": \"1242e9ea-660a-4536-a142-cc242a7a4162\",\n \"mimeType\": \"application/pdf\",\n \"createdBy\": \"530b19ea-dc8d-4cc7-a4b5-0c0214c8113a\",\n \"resourceType\": \"Learn\",\n \"framework\": \"ekstep_ncert_k-12-erwe\",\n \"subject\": [\"test\"],\n \"primaryCategory\": \"Explanation Content\"\n }\n }\n}" + }, + "url": { + "raw": "{{host}}/content/v4/create", + "host": [ + "{{host}}" + ], + "path": [ + "content", + "v4", + "create" + ] + }, + "description": "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." + }, + "response": [] + }, + { + "name": "Create content with Invalid primaryCategory", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json()", + "", + "//Verification", + "pm.test(\"Status code is 404\", () => {", + " pm.response.to.have.status(404)", + "});", + "pm.test(\"id should be api.content.create\", function () {", + " pm.expect(jsonResponse.id).to.eql(\"api.content.create\");", + "});", + "", + "pm.test(\"ver should be 4.0\", function () {", + " pm.expect(jsonResponse.ver).to.eql(\"4.0\");", + "});", + "", + "pm.test(\"Params has keys: resmsgid , msgid , err , status , errmsg \", () => {", + " pm.expect(jsonResponse.params).to.have.all.keys('resmsgid', 'msgid','err','status','errmsg');", + " pm.expect(jsonResponse.params.resmsgid).to.be.a(\"string\");", + " pm.expect(jsonResponse.params.msgid).to.be.a('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');", + "});", + "", + "//code name contains a string", + "tests[\"Status code name has string \\\"Not Found\\\"\"] = responseCode.name.has(\"Not Found\");", + "", + "pm.test(\"Verify keys and data type of the response result\", () => {", + " pm.expect(jsonResponse.result).to.have.all.keys('messages');", + " pm.expect(jsonResponse.result.messages).to.be.null;", + "});", + "", + "//Validation", + "// Response body", + "pm.test(\"responseCode should be RESOURCE_NOT_FOUND\", () => {", + " pm.expect(jsonResponse.responseCode).to.eql(\"RESOURCE_NOT_FOUND\");", + "});", + "", + "// Params", + "pm.test(\"params.err should be \\\"404\\\"\", () => {", + " pm.expect(jsonResponse.params.err).to.eql(\"404\");", + "});", + "pm.test(`params.errmsg should be \\\"Entry is not found in cassandra for content with identifier:: obj-cat:${JSON.parse(request.data).request.content.primaryCategory}_content_all {}\\\"`, () => {", + " pm.expect(jsonResponse.params.errmsg).to.eql(`Entry is not found in cassandra for content with identifier: obj-cat:${JSON.parse(request.data).request.content.primaryCategory}_content_all {}`);", + "});", + "", + "// Result", + "pm.test(\"messages should be null\", () => {", + " pm.expect(jsonResponse.result.messages).to.eql(null);", + "});", + "" + ], + "type": "text/javascript" + } + } + ], + "protocolProfileBehavior": { + "disabledSystemHeaders": { + "connection": 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}}" + }, + { + "key": "X-Channel-Id", + "value": "{{channel_id}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"content\": {\n \"name\": \"Untitled Content\",\n \"code\": \"1242e9ea-660a-4536-a142-cc242a7a4162\",\n \"mimeType\": \"application/pdf\",\n \"createdBy\": \"530b19ea-dc8d-4cc7-a4b5-0c0214c8113a\",\n \"resourceType\": \"Learn\",\n \"framework\": \"ekstep_ncert_k-12\",\n \"primaryCategory\": \"aabaa\"\n }\n }\n}" + }, + "url": { + "raw": "{{host}}/content/v4/create", + "host": [ + "{{host}}" + ], + "path": [ + "content", + "v4", + "create" + ] + }, + "description": "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." + }, + "response": [] + }, + { + "name": "Create content which already exists", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json();", + "", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});", + "pm.test(\"Status code name has string Bad Request\", function () {", + " pm.response.to.have.status(\"Bad Request\");", + "});", + "pm.test(\"id should be api.content.create\", function () {", + " pm.expect(jsonResponse.id).to.eql(\"api.content.create\");", + "});", + "pm.test(\"ver should be 4.0\", function () {", + " pm.expect(jsonResponse.ver).to.eql(\"4.0\");", + "});", + "pm.test(\"Params has keys: resmsgid , msgid , err , status , errmsg \", () => {", + " pm.expect(jsonResponse.params).to.have.all.keys('resmsgid', 'msgid','err','status','errmsg');", + " pm.expect(jsonResponse.params.resmsgid).to.be.a(\"string\");", + " pm.expect(jsonResponse.params.msgid).to.be.a('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(\"err is CONSTRAINT_VALIDATION_FAILED\", function () {", + " pm.expect(jsonResponse.params.err).to.be.equal(\"CONSTRAINT_VALIDATION_FAILED\");", + "});", + "pm.test(`errmsg: Object already exists with identifier: ${pm.collectionVariables.get(\"identifier\")}`, function () {", + " pm.expect(jsonResponse.params.errmsg).to.be.equal(`Object already exists with identifier: ${pm.collectionVariables.get(\"identifier\")}`);", + "});", + "", + "pm.test(\"Status is failed\", function () {", + " pm.expect(jsonResponse.params.status).to.be.equal(\"failed\");", + "});", + "", + "pm.test(\"ResponseCode is CLIENT_ERROR\", function () {", + " pm.expect(jsonResponse.responseCode).to.be.equal(\"CLIENT_ERROR\");", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "protocolProfileBehavior": { + "disabledSystemHeaders": { + "connection": true + } + }, + "request": { + "auth": { + "type": "apikey", + "apikey": [ + { + "key": "value", + "value": "{{auth_token}}", + "type": "string" + }, + { + "key": "key", + "value": "Authorization", + "type": "string" + }, + { + "key": "in", + "value": "header", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "X-Authenticated-User-token", + "value": "{{keycloak_access_token}}" + }, + { + "key": "Authorization", + "value": "{{kong_api_key}}" + }, + { + "key": "X-Channel-Id", + "value": "{{channel_id}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"content\": {\n \"identifier\": \"{{identifier}}\",\n \"name\": \"Untitled Content\",\n \"code\": \"1242e9ea-660a-4536-a142-cc242a7a4162\",\n \"mimeType\": \"application/pdf\",\n \"primaryCategory\": \"Explanation Content\"\n }\n }\n}" + }, + "url": { + "raw": "{{host}}/content/v4/create", + "host": [ + "{{host}}" + ], + "path": [ + "content", + "v4", + "create" + ] + }, + "description": "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." + }, + "response": [] + } + ] + } + ], + "description": "Pre requisite is required for the second of the create content Positive scenario" + }, + { + "name": "Update Content", + "item": [ + { + "name": "Pre requisite", + "item": [ + { + "name": "Create Content", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json();\r", + "\r", + "pm.collectionVariables.set(\"update_content_id\", jsonResponse.result.identifier);\r", + "console.log(pm.collectionVariables.get(\"update_content_id\"));\r", + "\r", + "pm.collectionVariables.set(\"updatecontent_versionkey\", jsonResponse.result.versionKey);\r", + "console.log(pm.collectionVariables.get(\"updatecontent_versionkey\"));" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "apikey", + "apikey": [ + { + "key": "key", + "value": "Authorization", + "type": "string" + }, + { + "key": "value", + "value": "", + "type": "string" + }, + { + "key": "in", + "value": "header", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "X-Authenticated-User-token", + "value": "{{keycloak_access_token}}" + }, + { + "key": "X-Channel-Id", + "value": "{{channel_id}}" + }, + { + "key": "Authorization", + "value": "{{auth_token}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"content\": {\n \"name\": \"Untitled Content\",\n \"code\": \"1242e9ea-660a-4536-a142-cc242a7a4162\",\n \"mimeType\": \"application/pdf\",\n \"primaryCategory\": \"Explanation Content\"\n }\n }\n}" + }, + "url": { + "raw": "{{host}}/content/v4/create", + "host": [ + "{{host}}" + ], + "path": [ + "content", + "v4", + "create" + ] + }, + "description": "This API is associated with creating content on the Sunbird Platform.\n - The endpoint for **Create Content** is `/content/v2/create`\n - It points to knowledge-mw-service - `/v2/content/create`\n - It is mandatory to provide values for parameters marked with *.\n - Mandatory fields cannot be null or empty." + }, + "response": [ + { + "name": "SUCCESS. The **Create Content** operation was successful!", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource.Possible media types can be:-\n - Application/json", + "key": "Content-Type", + "value": "ea laborum" + }, + { + "description": "(Required) Represents a physical location (e.g: state) uniquely to which the user belongs.", + "key": "x-channel-id", + "value": "ea laborum" + }, + { + "description": "(Required) Represents the authorized User ID to execute the API.", + "key": "X-Authenticated-User-Token", + "value": "ea laborum" + }, + { + "description": "(Required) To make use of the API, you require authorization. Raise a request to the administrator for the use of the API. You will receive the authorization key. Specify the key received, here.", + "key": "Authorization", + "value": "ea laborum" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"content\": {\n \"name\": \"H5P Content\",\n \"code\": \"h5pcontent\",\n \"mimeType\": \"application/vnd.ekstep.h5p-archive\",\n \"primaryCategory\": \"Resource\",\n \"createdBy\": \"874ed8a5-782e-4f6c-8f36-e0288455901e\"\n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/content/v2/create", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v2", + "create" + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"api.content.create\",\n \"ver\": \"3.0\",\n \"ts\": \"2020-12-10T20:24:45ZZ\",\n \"params\": {\n \"resmsgid\": \"3be02c4b-3324-41a3-afd8-60f6be0584d2\",\n \"msgid\": null,\n \"err\": null,\n \"status\": \"successful\",\n \"errmsg\": null\n },\n \"responseCode\": \"OK\",\n \"result\": {\n \"identifier\": \"do_1131697204035993601314\",\n \"node_id\": \"do_1131697204035993601314\",\n \"versionKey\": \"1607631885207\"\n }\n}" + }, + { + "name": "'BAD REQUEST. The **Create Content** operation failed. You may have missed input for a mandatory parameter.'", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource.Possible media types can be:-\n - Application/json", + "key": "Content-Type", + "value": "ea laborum" + }, + { + "description": "(Required) Represents a physical location (e.g: state) uniquely to which the user belongs.", + "key": "x-channel-id", + "value": "ea laborum" + }, + { + "description": "(Required) Represents the authorized User ID to execute the API.", + "key": "X-Authenticated-User-Token", + "value": "ea laborum" + }, + { + "description": "(Required) To make use of the API, you require authorization. Raise a request to the administrator for the use of the API. You will receive the authorization key. Specify the key received, here.", + "key": "Authorization", + "value": "ea laborum" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"content\": {\n \"name\": \"H5P Content\",\n \"code\": \"h5pcontent\",\n \"mimeType\": \"application/vnd.ekstep.h5p-archive\",\n \"primaryCategory\": \"Resource\",\n \"createdBy\": \"874ed8a5-782e-4f6c-8f36-e0288455901e\"\n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/content/v2/create", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v2", + "create" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"api.content.create\",\n \"ver\": \"1.0\",\n \"ts\": \"2020-12-10T08:50:29.786Z\",\n \"params\": {\n \"resmsgid\": \"c169a7a0-3ac4-11eb-b0a2-8d5c9f561887\",\n \"msgid\": null,\n \"status\": \"failed\",\n \"err\": \"ERR_CONTENT_CREATE_FIELDS_MISSING\",\n \"errmsg\": \"Required fields for create content are missing\"\n },\n \"responseCode\": \"CLIENT_ERROR\",\n \"result\": {}\n}" + }, + { + "name": "'INTERNAL SERVER ERROR. We track these errors automatically and try to set it right at the earliest. Try refreshing the page. If the problem persists contact us at info@sunbird.org.'", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource.Possible media types can be:-\n - Application/json", + "key": "Content-Type", + "value": "ea laborum" + }, + { + "description": "(Required) Represents a physical location (e.g: state) uniquely to which the user belongs.", + "key": "x-channel-id", + "value": "ea laborum" + }, + { + "description": "(Required) Represents the authorized User ID to execute the API.", + "key": "X-Authenticated-User-Token", + "value": "ea laborum" + }, + { + "description": "(Required) To make use of the API, you require authorization. Raise a request to the administrator for the use of the API. You will receive the authorization key. Specify the key received, here.", + "key": "Authorization", + "value": "ea laborum" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"content\": {\n \"name\": \"H5P Content\",\n \"code\": \"h5pcontent\",\n \"mimeType\": \"application/vnd.ekstep.h5p-archive\",\n \"primaryCategory\": \"Resource\",\n \"createdBy\": \"874ed8a5-782e-4f6c-8f36-e0288455901e\"\n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/content/v2/create", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v2", + "create" + ] + } + }, + "status": "Internal Server Error", + "code": 500, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"api.content.create\",\n \"ver\": \"1.0\",\n \"ts\": \"2020-12-10T08:51:51.647Z\",\n \"params\": {\n \"resmsgid\": \"f234a6f0-3ac4-11eb-b0a2-8d5c9f561887\",\n \"msgid\": null,\n \"status\": \"failed\",\n \"err\": null,\n \"errmsg\": null\n },\n \"responseCode\": \"SERVER_ERROR\",\n \"result\": {}\n}" + } + ] + }, + { + "name": "Create Content", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json();\r", + "\r", + "pm.collectionVariables.set(\"update_content\", jsonResponse.result.identifier);\r", + "console.log(pm.collectionVariables.get(\"update_content\"));\r", + "\r", + "pm.collectionVariables.set(\"update_versionkey\", jsonResponse.result.versionKey);\r", + "console.log(pm.collectionVariables.get(\"update_versionkey\"));" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "apikey", + "apikey": [ + { + "key": "key", + "value": "Authorization", + "type": "string" + }, + { + "key": "value", + "value": "", + "type": "string" + }, + { + "key": "in", + "value": "header", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "X-Authenticated-User-token", + "value": "{{keycloak_access_token}}" + }, + { + "key": "X-Channel-Id", + "value": "{{channel_id}}" + }, + { + "key": "Authorization", + "value": "{{auth_token}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"content\": {\n \"name\": \"Untitled Content\",\n \"code\": \"1242e9ea-660a-4536-a142-cc242a7a4162\",\n \"mimeType\": \"application/pdf\",\n \"primaryCategory\": \"Explanation Content\"\n }\n }\n}" + }, + "url": { + "raw": "{{host}}/content/v4/create", + "host": [ + "{{host}}" + ], + "path": [ + "content", + "v4", + "create" + ] + }, + "description": "This API is associated with creating content on the Sunbird Platform.\n - The endpoint for **Create Content** is `/content/v2/create`\n - It points to knowledge-mw-service - `/v2/content/create`\n - It is mandatory to provide values for parameters marked with *.\n - Mandatory fields cannot be null or empty." + }, + "response": [ + { + "name": "SUCCESS. The **Create Content** operation was successful!", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource.Possible media types can be:-\n - Application/json", + "key": "Content-Type", + "value": "ea laborum" + }, + { + "description": "(Required) Represents a physical location (e.g: state) uniquely to which the user belongs.", + "key": "x-channel-id", + "value": "ea laborum" + }, + { + "description": "(Required) Represents the authorized User ID to execute the API.", + "key": "X-Authenticated-User-Token", + "value": "ea laborum" + }, + { + "description": "(Required) To make use of the API, you require authorization. Raise a request to the administrator for the use of the API. You will receive the authorization key. Specify the key received, here.", + "key": "Authorization", + "value": "ea laborum" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"content\": {\n \"name\": \"H5P Content\",\n \"code\": \"h5pcontent\",\n \"mimeType\": \"application/vnd.ekstep.h5p-archive\",\n \"primaryCategory\": \"Resource\",\n \"createdBy\": \"874ed8a5-782e-4f6c-8f36-e0288455901e\"\n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/content/v2/create", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v2", + "create" + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"api.content.create\",\n \"ver\": \"3.0\",\n \"ts\": \"2020-12-10T20:24:45ZZ\",\n \"params\": {\n \"resmsgid\": \"3be02c4b-3324-41a3-afd8-60f6be0584d2\",\n \"msgid\": null,\n \"err\": null,\n \"status\": \"successful\",\n \"errmsg\": null\n },\n \"responseCode\": \"OK\",\n \"result\": {\n \"identifier\": \"do_1131697204035993601314\",\n \"node_id\": \"do_1131697204035993601314\",\n \"versionKey\": \"1607631885207\"\n }\n}" + }, + { + "name": "'BAD REQUEST. The **Create Content** operation failed. You may have missed input for a mandatory parameter.'", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource.Possible media types can be:-\n - Application/json", + "key": "Content-Type", + "value": "ea laborum" + }, + { + "description": "(Required) Represents a physical location (e.g: state) uniquely to which the user belongs.", + "key": "x-channel-id", + "value": "ea laborum" + }, + { + "description": "(Required) Represents the authorized User ID to execute the API.", + "key": "X-Authenticated-User-Token", + "value": "ea laborum" + }, + { + "description": "(Required) To make use of the API, you require authorization. Raise a request to the administrator for the use of the API. You will receive the authorization key. Specify the key received, here.", + "key": "Authorization", + "value": "ea laborum" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"content\": {\n \"name\": \"H5P Content\",\n \"code\": \"h5pcontent\",\n \"mimeType\": \"application/vnd.ekstep.h5p-archive\",\n \"primaryCategory\": \"Resource\",\n \"createdBy\": \"874ed8a5-782e-4f6c-8f36-e0288455901e\"\n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/content/v2/create", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v2", + "create" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"api.content.create\",\n \"ver\": \"1.0\",\n \"ts\": \"2020-12-10T08:50:29.786Z\",\n \"params\": {\n \"resmsgid\": \"c169a7a0-3ac4-11eb-b0a2-8d5c9f561887\",\n \"msgid\": null,\n \"status\": \"failed\",\n \"err\": \"ERR_CONTENT_CREATE_FIELDS_MISSING\",\n \"errmsg\": \"Required fields for create content are missing\"\n },\n \"responseCode\": \"CLIENT_ERROR\",\n \"result\": {}\n}" + }, + { + "name": "'INTERNAL SERVER ERROR. We track these errors automatically and try to set it right at the earliest. Try refreshing the page. If the problem persists contact us at info@sunbird.org.'", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource.Possible media types can be:-\n - Application/json", + "key": "Content-Type", + "value": "ea laborum" + }, + { + "description": "(Required) Represents a physical location (e.g: state) uniquely to which the user belongs.", + "key": "x-channel-id", + "value": "ea laborum" + }, + { + "description": "(Required) Represents the authorized User ID to execute the API.", + "key": "X-Authenticated-User-Token", + "value": "ea laborum" + }, + { + "description": "(Required) To make use of the API, you require authorization. Raise a request to the administrator for the use of the API. You will receive the authorization key. Specify the key received, here.", + "key": "Authorization", + "value": "ea laborum" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"content\": {\n \"name\": \"H5P Content\",\n \"code\": \"h5pcontent\",\n \"mimeType\": \"application/vnd.ekstep.h5p-archive\",\n \"primaryCategory\": \"Resource\",\n \"createdBy\": \"874ed8a5-782e-4f6c-8f36-e0288455901e\"\n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/content/v2/create", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v2", + "create" + ] + } + }, + "status": "Internal Server Error", + "code": 500, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"api.content.create\",\n \"ver\": \"1.0\",\n \"ts\": \"2020-12-10T08:51:51.647Z\",\n \"params\": {\n \"resmsgid\": \"f234a6f0-3ac4-11eb-b0a2-8d5c9f561887\",\n \"msgid\": null,\n \"status\": \"failed\",\n \"err\": null,\n \"errmsg\": null\n },\n \"responseCode\": \"SERVER_ERROR\",\n \"result\": {}\n}" + } + ] + }, + { + "name": "Create Content for invalid primaryCategory", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json();\r", + "\r", + "pm.collectionVariables.set(\"content_update\", jsonResponse.result.identifier);\r", + "console.log(pm.collectionVariables.get(\"content_update\"));\r", + "\r", + "pm.collectionVariables.set(\"versionkey_update\", jsonResponse.result.versionKey);\r", + "console.log(pm.collectionVariables.get(\"versionkey_update\"));" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "apikey", + "apikey": [ + { + "key": "key", + "value": "Authorization", + "type": "string" + }, + { + "key": "value", + "value": "", + "type": "string" + }, + { + "key": "in", + "value": "header", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "X-Authenticated-User-token", + "value": "{{keycloak_access_token}}" + }, + { + "key": "X-Channel-Id", + "value": "{{channel_id}}" + }, + { + "key": "Authorization", + "value": "{{auth_token}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"content\": {\n \"name\": \"Untitled Content\",\n \"code\": \"1242e9ea-660a-4536-a142-cc242a7a4162\",\n \"mimeType\": \"application/pdf\",\n \"primaryCategory\": \"Explanation Content\"\n }\n }\n}" + }, + "url": { + "raw": "{{host}}/content/v4/create", + "host": [ + "{{host}}" + ], + "path": [ + "content", + "v4", + "create" + ] + }, + "description": "This API is associated with creating content on the Sunbird Platform.\n - The endpoint for **Create Content** is `/content/v2/create`\n - It points to knowledge-mw-service - `/v2/content/create`\n - It is mandatory to provide values for parameters marked with *.\n - Mandatory fields cannot be null or empty." + }, + "response": [ + { + "name": "SUCCESS. The **Create Content** operation was successful!", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource.Possible media types can be:-\n - Application/json", + "key": "Content-Type", + "value": "ea laborum" + }, + { + "description": "(Required) Represents a physical location (e.g: state) uniquely to which the user belongs.", + "key": "x-channel-id", + "value": "ea laborum" + }, + { + "description": "(Required) Represents the authorized User ID to execute the API.", + "key": "X-Authenticated-User-Token", + "value": "ea laborum" + }, + { + "description": "(Required) To make use of the API, you require authorization. Raise a request to the administrator for the use of the API. You will receive the authorization key. Specify the key received, here.", + "key": "Authorization", + "value": "ea laborum" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"content\": {\n \"name\": \"H5P Content\",\n \"code\": \"h5pcontent\",\n \"mimeType\": \"application/vnd.ekstep.h5p-archive\",\n \"primaryCategory\": \"Resource\",\n \"createdBy\": \"874ed8a5-782e-4f6c-8f36-e0288455901e\"\n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/content/v2/create", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v2", + "create" + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"api.content.create\",\n \"ver\": \"3.0\",\n \"ts\": \"2020-12-10T20:24:45ZZ\",\n \"params\": {\n \"resmsgid\": \"3be02c4b-3324-41a3-afd8-60f6be0584d2\",\n \"msgid\": null,\n \"err\": null,\n \"status\": \"successful\",\n \"errmsg\": null\n },\n \"responseCode\": \"OK\",\n \"result\": {\n \"identifier\": \"do_1131697204035993601314\",\n \"node_id\": \"do_1131697204035993601314\",\n \"versionKey\": \"1607631885207\"\n }\n}" + }, + { + "name": "'BAD REQUEST. The **Create Content** operation failed. You may have missed input for a mandatory parameter.'", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource.Possible media types can be:-\n - Application/json", + "key": "Content-Type", + "value": "ea laborum" + }, + { + "description": "(Required) Represents a physical location (e.g: state) uniquely to which the user belongs.", + "key": "x-channel-id", + "value": "ea laborum" + }, + { + "description": "(Required) Represents the authorized User ID to execute the API.", + "key": "X-Authenticated-User-Token", + "value": "ea laborum" + }, + { + "description": "(Required) To make use of the API, you require authorization. Raise a request to the administrator for the use of the API. You will receive the authorization key. Specify the key received, here.", + "key": "Authorization", + "value": "ea laborum" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"content\": {\n \"name\": \"H5P Content\",\n \"code\": \"h5pcontent\",\n \"mimeType\": \"application/vnd.ekstep.h5p-archive\",\n \"primaryCategory\": \"Resource\",\n \"createdBy\": \"874ed8a5-782e-4f6c-8f36-e0288455901e\"\n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/content/v2/create", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v2", + "create" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"api.content.create\",\n \"ver\": \"1.0\",\n \"ts\": \"2020-12-10T08:50:29.786Z\",\n \"params\": {\n \"resmsgid\": \"c169a7a0-3ac4-11eb-b0a2-8d5c9f561887\",\n \"msgid\": null,\n \"status\": \"failed\",\n \"err\": \"ERR_CONTENT_CREATE_FIELDS_MISSING\",\n \"errmsg\": \"Required fields for create content are missing\"\n },\n \"responseCode\": \"CLIENT_ERROR\",\n \"result\": {}\n}" + }, + { + "name": "'INTERNAL SERVER ERROR. We track these errors automatically and try to set it right at the earliest. Try refreshing the page. If the problem persists contact us at info@sunbird.org.'", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource.Possible media types can be:-\n - Application/json", + "key": "Content-Type", + "value": "ea laborum" + }, + { + "description": "(Required) Represents a physical location (e.g: state) uniquely to which the user belongs.", + "key": "x-channel-id", + "value": "ea laborum" + }, + { + "description": "(Required) Represents the authorized User ID to execute the API.", + "key": "X-Authenticated-User-Token", + "value": "ea laborum" + }, + { + "description": "(Required) To make use of the API, you require authorization. Raise a request to the administrator for the use of the API. You will receive the authorization key. Specify the key received, here.", + "key": "Authorization", + "value": "ea laborum" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"content\": {\n \"name\": \"H5P Content\",\n \"code\": \"h5pcontent\",\n \"mimeType\": \"application/vnd.ekstep.h5p-archive\",\n \"primaryCategory\": \"Resource\",\n \"createdBy\": \"874ed8a5-782e-4f6c-8f36-e0288455901e\"\n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/content/v2/create", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v2", + "create" + ] + } + }, + "status": "Internal Server Error", + "code": 500, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"api.content.create\",\n \"ver\": \"1.0\",\n \"ts\": \"2020-12-10T08:51:51.647Z\",\n \"params\": {\n \"resmsgid\": \"f234a6f0-3ac4-11eb-b0a2-8d5c9f561887\",\n \"msgid\": null,\n \"status\": \"failed\",\n \"err\": null,\n \"errmsg\": null\n },\n \"responseCode\": \"SERVER_ERROR\",\n \"result\": {}\n}" + } + ] + } + ] + }, + { + "name": "Positive", + "item": [ + { + "name": "Update existing data or add new data", + "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(\"Status code name has string OK\", function () {", + " pm.response.to.have.status(\"OK\");", + "});", + "pm.test(\"id should be api.content.update\", function () {", + " pm.expect(jsonResponse.id).to.eql(\"api.content.update\");", + "});", + "pm.test(\"ver should be 4.0\", function () {", + " pm.expect(jsonResponse.ver).to.eql(\"4.0\");", + "});", + "", + "pm.test(\"Params has keys: resmsgid , msgid , err , status , errmsg \", () => {", + " pm.expect(jsonResponse.params).to.have.all.keys('resmsgid', 'msgid','err','status','errmsg');", + " pm.expect(jsonResponse.params.resmsgid).to.be.a(\"string\");", + " pm.expect(jsonResponse.params.msgid).to.be.a('null');", + " pm.expect(jsonResponse.params.err).to.be.a('null');", + " pm.expect(jsonResponse.params.status).to.be.a(\"string\");", + " pm.expect(jsonResponse.params.errmsg).to.be.a('null');", + "});", + "", + "pm.test(\"Status is successful\", function () {", + " pm.expect(jsonResponse.params.status).to.be.equal(\"successful\");", + "});", + "", + "pm.test(\"ResponseCode is OK\", function () {", + " pm.expect(jsonResponse.responseCode).to.be.equal(\"OK\");", + "});", + "pm.test(\"Result has keys: identifier , node_id , versionKey\", () => {", + " pm.expect(jsonResponse.result).to.have.all.keys('identifier', 'node_id','versionKey');", + " pm.expect(jsonResponse.result.identifier).to.be.a(\"string\");", + " pm.expect(jsonResponse.result.versionKey).to.be.a(\"string\");", + " pm.expect(jsonResponse.result.node_id).to.be.a(\"string\");", + "});", + "", + "pm.test(\"identifier should be equal to \" + pm.collectionVariables.get(\"update_content_id\"), () => {", + " pm.expect(jsonResponse.result.identifier).to.eql(pm.collectionVariables.get(\"update_content_id\"));", + "});", + "pm.test(\"node_id should be equal to \" + pm.collectionVariables.get(\"update_content_id\"), () => {", + " pm.expect(jsonResponse.result.node_id).to.eql(pm.collectionVariables.get(\"update_content_id\"));", + "});", + "" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "PATCH", + "header": [ + { + "key": "Content-Type", + "value": "application/json", + "type": "text" + }, + { + "key": "X-Authenticated-User-token", + "value": "{{keycloak_access_token}}", + "type": "text" + }, + { + "key": "Authorization", + "value": "{{kong_api_key}}", + "type": "text" + }, + { + "key": "X-Channel-Id", + "value": "{{channel_id}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"content\": {\n \"versionKey\":\"{{updatecontent_versionkey}}\",\n \"description\": \"Updated description for this content\",\n \"resourceType\": \"Learn\",\n \"framework\": \"ekstep_ncert_k-12\",\n \"name\": \"API DOCUMENTATION CONTENT\"\n }\n }\n}" + }, + "url": { + "raw": "{{host}}/content/v4/update/{{update_content_id}}", + "host": [ + "{{host}}" + ], + "path": [ + "content", + "v4", + "update", + "{{update_content_id}}" + ] + }, + "description": "This API is associated with updating a batch on the Sunbird Platform.\nThe endpoint for Course Batch Update is /batch/update\nThe fields marked with an asterisk (*) are mandatory. They cannot be null or empty." + }, + "response": [] + }, + { + "name": "Update special character in name", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json();", + "", + "pm.test(\"Verify keys and data type of the response result\", () => {", + " pm.expect(jsonResponse.result).to.have.all.keys('identifier', 'node_id', 'versionKey');", + " pm.expect(jsonResponse.result.identifier).to.be.a(\"string\");", + " pm.expect(jsonResponse.result.node_id).to.be.a(\"string\");", + " pm.expect(jsonResponse.result.versionKey).to.be.a(\"string\");", + "});", + "", + "//Validation", + "pm.test(\"id should be api.content.update\", () => {", + " pm.expect(jsonResponse.id).to.eql(\"api.content.update\");", + "});", + "pm.test(\"ver should be 4.0\", () => {", + " pm.expect(jsonResponse.ver).to.eql(\"4.0\");", + "});", + "pm.test(\"Result has keys: identifier , node_id , versionKey\", () => {", + " pm.expect(jsonResponse.result).to.have.all.keys('identifier', 'node_id','versionKey');", + " pm.expect(jsonResponse.result.identifier).to.be.a(\"string\");", + " pm.expect(jsonResponse.result.versionKey).to.be.a(\"string\");", + " pm.expect(jsonResponse.result.node_id).to.be.a(\"string\");", + "});", + "", + "pm.test(\"identifier should be equal to \" + pm.collectionVariables.get(\"update_content\"), () => {", + " pm.expect(jsonResponse.result.identifier).to.eql(pm.collectionVariables.get(\"update_content\"));", + "});", + "pm.test(\"node_id should be equal to \" + pm.collectionVariables.get(\"update_content\"), () => {", + " pm.expect(jsonResponse.result.node_id).to.eql(pm.collectionVariables.get(\"update_content\"));", + "});", + "", + "// Set global variable", + "//pm.globals.set(\"versionKey\", jsonResponse.result.versionKey);", + "" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "pm.collectionVariables.get(\"update_versionkey\");" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "PATCH", + "header": [ + { + "key": "Content-Type", + "value": "application/json", + "type": "text" + }, + { + "key": "X-Authenticated-User-token", + "value": "{{keycloak_access_token}}", + "type": "text" + }, + { + "key": "Authorization", + "value": "{{kong_api_key}}", + "type": "text" + }, + { + "key": "X-Channel-Id", + "value": "{{channel_id}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"content\": {\n \"versionKey\": \"{{update_versionkey}}\",\n \"description\": \"description updated for this content\",\n \"name\": \"~`S!@#$%^&*()_+=:;\\\"'<,>.?/\"\n }\n }\n}" + }, + "url": { + "raw": "{{host}}/content/v4/update/{{update_content}}", + "host": [ + "{{host}}" + ], + "path": [ + "content", + "v4", + "update", + "{{update_content}}" + ] + }, + "description": "This API is associated with updating a batch on the Sunbird Platform.\nThe endpoint for Course Batch Update is /batch/update\nThe fields marked with an asterisk (*) are mandatory. They cannot be null or empty." + }, + "response": [] + } + ] + }, + { + "name": "Negative", + "item": [ + { + "name": "Update content Invalid versionKey", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json()", + "", + "//Verification", + "pm.test(\"Status code is 400\", () => {", + " pm.response.to.have.status(400)", + "});", + "pm.test(\"id should be api.content.update\", function () {", + " pm.expect(jsonResponse.id).to.eql(\"api.content.update\");", + "});", + "pm.test(\"Params has keys: resmsgid , msgid , err , status , errmsg \", () => {", + " pm.expect(jsonResponse.params).to.have.all.keys('resmsgid', 'msgid','err','status','errmsg');", + " pm.expect(jsonResponse.params.resmsgid).to.be.a(\"string\");", + " pm.expect(jsonResponse.params.msgid).to.be.a('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(\"ver should be 4.0\", function () {", + " pm.expect(jsonResponse.ver).to.eql(\"4.0\");", + "});", + "//code name contains a string", + "tests[\"Status code name has string Bad Request\"] = responseCode.name.has(\"Bad Request\");", + "", + "pm.test(\"Content-Encoding header should not present\", () => {", + " pm.response.to.not.have.header(\"Content-Encoding\");", + "});", + "", + "pm.test(\"Verify keys and data type of the response result\", () => {", + " pm.expect(jsonResponse.result).to.be.an(\"object\");", + " pm.expect(jsonResponse.result).to.have.all.keys('messages');", + " pm.expect(jsonResponse.result.messages).to.be.null;", + "});", + "", + "//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 CLIENT_ERROR\", () => {", + " pm.expect(jsonResponse.params.err).to.eql(\"CLIENT_ERROR\");", + "});", + "pm.test(\"params.status should be failed\", () => {", + " pm.expect(jsonResponse.params.status).to.eql(\"failed\");", + "});", + "pm.test(\"params.errmsg should be \\\"Invalid version Key\\\"\", () => {", + " pm.expect(jsonResponse.params.errmsg).to.eql(\"Invalid version Key\");", + "});", + "", + "// Result", + "pm.test(\"messages should be null\", () => {", + " pm.expect(jsonResponse.result.messages).to.eql(null);", + "});", + "" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "pm.globals.set('invalid-versionKey', '3534534543');", + "// pm.globals.set(\"content_id\", '');" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "PATCH", + "header": [ + { + "key": "Content-Type", + "value": "application/json", + "type": "text" + }, + { + "key": "X-Authenticated-User-token", + "value": "{{keycloak_access_token}}", + "type": "text" + }, + { + "key": "Authorization", + "value": "{{kong_api_key}}", + "type": "text" + }, + { + "key": "X-Channel-Id", + "value": "{{channel_id}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"content\": {\n \"versionKey\": \"{{invalid-versionKey}}\",\n \"lastUpdatedBy\": \"874ed8a5-782e-4f6c-8f36-e0288455901e\",\n \"description\": \"dsd\",\n \"name\": \"API DOCUMENTATION CONTENT\"\n }\n }\n}" + }, + "url": { + "raw": "{{host}}/content/v4/update/{{update_content_id}}", + "host": [ + "{{host}}" + ], + "path": [ + "content", + "v4", + "update", + "{{update_content_id}}" + ] + }, + "description": "This API is associated with updating a batch on the Sunbird Platform.\nThe endpoint for Course Batch Update is /batch/update\nThe fields marked with an asterisk (*) are mandatory. They cannot be null or empty." + }, + "response": [] + }, + { + "name": "Update content with Empty name", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json()", + "", + "//Verification", + "pm.test(\"Status code is 400\", () => {", + " pm.response.to.have.status(400)", + "});", + "pm.test(\"ver should be 4.0\", function () {", + " pm.expect(jsonResponse.ver).to.eql(\"4.0\");", + "});", + "pm.test(\"id should be api.content.update\", function () {", + " pm.expect(jsonResponse.id).to.eql(\"api.content.update\");", + "});", + "pm.test(\"Params has keys: resmsgid , msgid , err , status , errmsg \", () => {", + " pm.expect(jsonResponse.params).to.have.all.keys('resmsgid', 'msgid','err','status','errmsg');", + " pm.expect(jsonResponse.params.resmsgid).to.be.a(\"string\");", + " pm.expect(jsonResponse.params.msgid).to.be.a('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');", + "});", + "//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\");", + " pm.expect(jsonResponse.result).to.have.all.keys('messages');", + " pm.expect(jsonResponse.result.messages).to.not.be.empty;", + "});", + "", + "//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 \\\"CLIENT_ERROR\\\"\", () => {", + " pm.expect(jsonResponse.params.err).to.eql(\"CLIENT_ERROR\");", + "});", + "pm.test(\"params.errmsg should be \\\"Validation Errors\\\"\", () => {", + " pm.expect(jsonResponse.params.errmsg).to.eql(\"Validation Errors\");", + "});", + "", + "// Result", + "pm.test(\"result body should include messages \\\"Required Metadata name not set\\\"\", () => {", + " pm.expect(jsonResponse.result.messages).to.have.length(1)", + " pm.expect(jsonResponse.result.messages).to.include('Required Metadata name not set');", + "});", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "PATCH", + "header": [ + { + "key": "Content-Type", + "value": "application/json", + "type": "text" + }, + { + "key": "X-Authenticated-User-token", + "value": "{{keycloak_access_token}}", + "type": "text" + }, + { + "key": "Authorization", + "value": "{{kong_api_key}}", + "type": "text" + }, + { + "key": "X-Channel-Id", + "value": "{{channel_id}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"content\": {\n \"versionKey\": \"{{updatecontent_versionkey}}\",\n \"name\": \"\"\n }\n }\n}" + }, + "url": { + "raw": "{{host}}/content/v4/update/{{update_content_id}}", + "host": [ + "{{host}}" + ], + "path": [ + "content", + "v4", + "update", + "{{update_content_id}}" + ] + }, + "description": "This API is associated with updating a batch on the Sunbird Platform.\nThe endpoint for Course Batch Update is /batch/update\nThe fields marked with an asterisk (*) are mandatory. They cannot be null or empty." + }, + "response": [] + }, + { + "name": "Update content with Invalid content id", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json()", + "", + "//Verification", + "pm.test(\"Status code is 404\", () => {", + " pm.response.to.have.status(404)", + "});", + "pm.test(\"ver should be 4.0\", function () {", + " pm.expect(jsonResponse.ver).to.eql(\"4.0\");", + "});", + "pm.test(\"id should be api.content.update\", function () {", + " pm.expect(jsonResponse.id).to.eql(\"api.content.update\");", + "});", + "pm.test(\"Params has keys: resmsgid , msgid , err , status , errmsg \", () => {", + " pm.expect(jsonResponse.params).to.have.all.keys('resmsgid', 'msgid','err','status','errmsg');", + " pm.expect(jsonResponse.params.resmsgid).to.be.a(\"string\");", + " pm.expect(jsonResponse.params.msgid).to.be.a('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');", + "});", + "//code name contains a string", + "tests[\"Status code name has string \\\"Not Found\\\"\"] = responseCode.name.has(\"Not Found\");", + "", + "pm.test(\"Verify keys and data type of the response result\", () => {", + " pm.expect(jsonResponse.result).to.be.an(\"object\");", + " pm.expect(jsonResponse.result).to.have.all.keys('messages');", + " pm.expect(jsonResponse.result.messages).to.be.null;", + "});", + "", + "//Validation", + "// Response body", + "pm.test(\"responseCode should be RESOURCE_NOT_FOUND\", () => {", + " pm.expect(jsonResponse.responseCode).to.eql(\"RESOURCE_NOT_FOUND\");", + "});", + "", + "// Params", + "pm.test(\"params.err should be NOT_FOUND\", () => {", + " pm.expect(jsonResponse.params.err).to.eql(\"NOT_FOUND\");", + "});", + "pm.test(`params.errmsg should be \\\"Error! Node(s) doesn't Exists. | [Invalid Node Id.]: ${pm.collectionVariables.get(\"invalid_content_id\")}\\\"`, () => {", + " pm.expect(jsonResponse.params.errmsg).to.eql(`Error! Node(s) doesn't Exists. | [Invalid Node Id.]: ${pm.collectionVariables.get(\"invalid_content_id\")}`);", + "});", + "", + "// Result", + "pm.test(\"messages should be null\", () => {", + " pm.expect(jsonResponse.result.messages).to.eql(null);", + "});", + "" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "pm.collectionVariables.set(\"invalid_content_id\", 'do_21357909972698726412211');" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "PATCH", + "header": [ + { + "key": "Content-Type", + "value": "application/json", + "type": "text" + }, + { + "key": "X-Authenticated-User-token", + "value": "{{keycloak_access_token}}", + "type": "text" + }, + { + "key": "Authorization", + "value": "{{kong_api_key}}", + "type": "text" + }, + { + "key": "X-Channel-Id", + "value": "{{channel_id}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"content\": {\n \"versionKey\": \"{{updatecontent_versionkey}}\",\n \"lastUpdatedBy\": \"874ed8a5-782e-4f6c-8f36-e0288455901e\",\n \"description\": \"dsd\",\n \"name\": \"API DOCUMENTATION CONTENT\"\n }\n }\n}" + }, + "url": { + "raw": "{{host}}/content/v4/update/{{invalid_content_id}}", + "host": [ + "{{host}}" + ], + "path": [ + "content", + "v4", + "update", + "{{invalid_content_id}}" + ] + }, + "description": "This API is associated with updating a batch on the Sunbird Platform.\nThe endpoint for Course Batch Update is /batch/update\nThe fields marked with an asterisk (*) are mandatory. They cannot be null or empty." + }, + "response": [] + }, + { + "name": "Update content with Invalid primaryCategory", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json()", + "", + "//Verification", + "pm.test(\"Status code is 404\", () => {", + " pm.response.to.have.status(404)", + "});", + "pm.test(\"ver should be 4.0\", function () {", + " pm.expect(jsonResponse.ver).to.eql(\"4.0\");", + "});", + "pm.test(\"id should be api.content.update\", function () {", + " pm.expect(jsonResponse.id).to.eql(\"api.content.update\");", + "});", + "pm.test(\"Params has keys: resmsgid , msgid , err , status , errmsg \", () => {", + " pm.expect(jsonResponse.params).to.have.all.keys('resmsgid', 'msgid','err','status','errmsg');", + " pm.expect(jsonResponse.params.resmsgid).to.be.a(\"string\");", + " pm.expect(jsonResponse.params.msgid).to.be.a('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');", + "});", + "//code name contains a string", + "tests[\"Status code name has string \\\"Not Found\\\"\"] = responseCode.name.has(\"Not Found\");", + "", + "pm.test(\"Verify keys and data type of the response result\", () => {", + " pm.expect(jsonResponse.result).to.be.an(\"object\");", + " pm.expect(jsonResponse.result).to.have.all.keys('messages');", + " pm.expect(jsonResponse.result.messages).to.be.null;", + "});", + "", + "//Validation", + "// Response body", + "pm.test(\"responseCode should be RESOURCE_NOT_FOUND\", () => {", + " pm.expect(jsonResponse.responseCode).to.eql(\"RESOURCE_NOT_FOUND\");", + "});", + "", + "// Params", + "pm.test(\"params.err should be \\\"404\\\"\", () => {", + " pm.expect(jsonResponse.params.err).to.eql(\"404\");", + "});", + "pm.test(\"params.status should be \\\"failed\\\"\", () => {", + " pm.expect(jsonResponse.params.status).to.eql(\"failed\");", + "});", + "pm.test(`params.errmsg should be \\\"Entry is not found in cassandra for content with identifier: obj-cat:${JSON.parse(request.data).request.content.primaryCategory}_content_all {}\\\"`, () => {", + " pm.expect(jsonResponse.params.errmsg).to.eql(`Entry is not found in cassandra for content with identifier: obj-cat:${JSON.parse(request.data).request.content.primaryCategory}_content_all {}`);", + "});", + "", + "pm.test(\"messages should be null\", () => {", + " pm.expect(jsonResponse.result.messages).to.eql(null);", + "});", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "PATCH", + "header": [ + { + "key": "Content-Type", + "value": "application/json", + "type": "text" + }, + { + "key": "X-Authenticated-User-token", + "value": "{{keycloak_access_token}}", + "type": "text" + }, + { + "key": "Authorization", + "value": "{{kong_api_key}}", + "type": "text" + }, + { + "key": "X-Channel-Id", + "value": "{{channel_id}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"content\": {\n \"versionKey\": \"{{versionkey_update}}\",\n \"description\": \"dsd\",\n \"name\": \"API DOCUMENTATION CONTENT\",\n \"primaryCategory\": \"abcd\"\n }\n }\n}" + }, + "url": { + "raw": "{{host}}/content/v4/update/{{content_update}}", + "host": [ + "{{host}}" + ], + "path": [ + "content", + "v4", + "update", + "{{content_update}}" + ] + }, + "description": "This API is associated with updating a batch on the Sunbird Platform.\nThe endpoint for Course Batch Update is /batch/update\nThe fields marked with an asterisk (*) are mandatory. They cannot be null or empty." + }, + "response": [] + } + ] + } + ] + }, + { + "name": "Read content", + "item": [ + { + "name": "Pre requisite", + "item": [ + { + "name": "Create Content", + "event": [ + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + }, + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json();\r", + "\r", + "pm.collectionVariables.set(\"read_content\", jsonResponse.result.identifier);\r", + "console.log(pm.collectionVariables.get(\"read_content\"));\r", + "\r", + "" + ], + "type": "text/javascript" + } + } + ], + "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}}" + }, + { + "key": "X-Channel-Id", + "value": "{{channel_id}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"content\": {\n \"name\": \"Untitled Content\",\n \"code\": \"1242e9ea-660a-4536-a142-cc242a7a4162\",\n \"mimeType\": \"application/pdf\",\n \"primaryCategory\": \"Explanation Content\",\n \"body\": \"{\\\"key\\\":\\\"value\\\"}\"\n }\n }\n}" + }, + "url": { + "raw": "{{host}}/content/v4/create", + "host": [ + "{{host}}" + ], + "path": [ + "content", + "v4", + "create" + ] + }, + "description": "This API is associated with creating content on the Sunbird Platform.\n - The endpoint for **Create Content** is `/content/v2/create`\n - It points to knowledge-mw-service - `/v2/content/create`\n - It is mandatory to provide values for parameters marked with *.\n - Mandatory fields cannot be null or empty." + }, + "response": [ + { + "name": "SUCCESS. The **Create Content** operation was successful!", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource.Possible media types can be:-\n - Application/json", + "key": "Content-Type", + "value": "ea laborum" + }, + { + "description": "(Required) Represents a physical location (e.g: state) uniquely to which the user belongs.", + "key": "x-channel-id", + "value": "ea laborum" + }, + { + "description": "(Required) Represents the authorized User ID to execute the API.", + "key": "X-Authenticated-User-Token", + "value": "ea laborum" + }, + { + "description": "(Required) To make use of the API, you require authorization. Raise a request to the administrator for the use of the API. You will receive the authorization key. Specify the key received, here.", + "key": "Authorization", + "value": "ea laborum" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"content\": {\n \"name\": \"H5P Content\",\n \"code\": \"h5pcontent\",\n \"mimeType\": \"application/vnd.ekstep.h5p-archive\",\n \"primaryCategory\": \"Resource\",\n \"createdBy\": \"874ed8a5-782e-4f6c-8f36-e0288455901e\"\n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/content/v2/create", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v2", + "create" + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"api.content.create\",\n \"ver\": \"3.0\",\n \"ts\": \"2020-12-10T20:24:45ZZ\",\n \"params\": {\n \"resmsgid\": \"3be02c4b-3324-41a3-afd8-60f6be0584d2\",\n \"msgid\": null,\n \"err\": null,\n \"status\": \"successful\",\n \"errmsg\": null\n },\n \"responseCode\": \"OK\",\n \"result\": {\n \"identifier\": \"do_1131697204035993601314\",\n \"node_id\": \"do_1131697204035993601314\",\n \"versionKey\": \"1607631885207\"\n }\n}" + }, + { + "name": "'BAD REQUEST. The **Create Content** operation failed. You may have missed input for a mandatory parameter.'", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource.Possible media types can be:-\n - Application/json", + "key": "Content-Type", + "value": "ea laborum" + }, + { + "description": "(Required) Represents a physical location (e.g: state) uniquely to which the user belongs.", + "key": "x-channel-id", + "value": "ea laborum" + }, + { + "description": "(Required) Represents the authorized User ID to execute the API.", + "key": "X-Authenticated-User-Token", + "value": "ea laborum" + }, + { + "description": "(Required) To make use of the API, you require authorization. Raise a request to the administrator for the use of the API. You will receive the authorization key. Specify the key received, here.", + "key": "Authorization", + "value": "ea laborum" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"content\": {\n \"name\": \"H5P Content\",\n \"code\": \"h5pcontent\",\n \"mimeType\": \"application/vnd.ekstep.h5p-archive\",\n \"primaryCategory\": \"Resource\",\n \"createdBy\": \"874ed8a5-782e-4f6c-8f36-e0288455901e\"\n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/content/v2/create", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v2", + "create" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"api.content.create\",\n \"ver\": \"1.0\",\n \"ts\": \"2020-12-10T08:50:29.786Z\",\n \"params\": {\n \"resmsgid\": \"c169a7a0-3ac4-11eb-b0a2-8d5c9f561887\",\n \"msgid\": null,\n \"status\": \"failed\",\n \"err\": \"ERR_CONTENT_CREATE_FIELDS_MISSING\",\n \"errmsg\": \"Required fields for create content are missing\"\n },\n \"responseCode\": \"CLIENT_ERROR\",\n \"result\": {}\n}" + }, + { + "name": "'INTERNAL SERVER ERROR. We track these errors automatically and try to set it right at the earliest. Try refreshing the page. If the problem persists contact us at info@sunbird.org.'", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource.Possible media types can be:-\n - Application/json", + "key": "Content-Type", + "value": "ea laborum" + }, + { + "description": "(Required) Represents a physical location (e.g: state) uniquely to which the user belongs.", + "key": "x-channel-id", + "value": "ea laborum" + }, + { + "description": "(Required) Represents the authorized User ID to execute the API.", + "key": "X-Authenticated-User-Token", + "value": "ea laborum" + }, + { + "description": "(Required) To make use of the API, you require authorization. Raise a request to the administrator for the use of the API. You will receive the authorization key. Specify the key received, here.", + "key": "Authorization", + "value": "ea laborum" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"content\": {\n \"name\": \"H5P Content\",\n \"code\": \"h5pcontent\",\n \"mimeType\": \"application/vnd.ekstep.h5p-archive\",\n \"primaryCategory\": \"Resource\",\n \"createdBy\": \"874ed8a5-782e-4f6c-8f36-e0288455901e\"\n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/content/v2/create", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v2", + "create" + ] + } + }, + "status": "Internal Server Error", + "code": 500, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"api.content.create\",\n \"ver\": \"1.0\",\n \"ts\": \"2020-12-10T08:51:51.647Z\",\n \"params\": {\n \"resmsgid\": \"f234a6f0-3ac4-11eb-b0a2-8d5c9f561887\",\n \"msgid\": null,\n \"status\": \"failed\",\n \"err\": null,\n \"errmsg\": null\n },\n \"responseCode\": \"SERVER_ERROR\",\n \"result\": {}\n}" + } + ] + } + ] + }, + { + "name": "Positive", + "item": [ + { + "name": "Read all data except external data", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json();", + "", + "pm.test(\"Verify keys and data type of the response result\", () => {", + " pm.expect(jsonResponse.result).to.have.all.keys('content');", + " pm.expect(jsonResponse.result.content).to.be.an(\"object\")", + " pm.expect(jsonResponse.result.content).to.have.any.keys('identifier', 'versionKey', 'code', 'channel', 'mimeType', 'createdOn', 'primaryCategory', 'contentDisposition', 'contentEncoding', 'objectType', 'visibility', 'discussionForum', 'license', 'version', 'compatibilityLevel', 'name', 'status');", + " pm.expect(jsonResponse.result.content.identifier).to.be.a(\"string\");", + " pm.expect(jsonResponse.result.content.versionKey).to.be.a(\"string\");", + " pm.expect(jsonResponse.result.content.version).to.be.a(\"number\");", + " pm.expect(jsonResponse.result.content.channel).to.be.a(\"string\");", + " pm.expect(jsonResponse.result.content.compatibilityLevel).to.be.a(\"number\");", + " pm.expect(jsonResponse.result.content.ownershipType).to.be.an(\"array\");", + "});", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Status code name has string OK\", function () {", + " pm.response.to.have.status(\"OK\");", + "});", + "//Validation", + "pm.test(\"id should be api.content.read\", () => {", + " pm.expect(jsonResponse.id).to.eql(\"api.content.read\");", + "});", + "pm.test(\"ver should be 4.0\", () => {", + " pm.expect(jsonResponse.ver).to.eql(\"4.0\");", + "});", + "", + "pm.test(`identifier should be equal to ${pm.collectionVariables.get(\"read_content\")}`, () => {", + " pm.expect(jsonResponse.result.content.identifier).to.eql(pm.collectionVariables.get(\"read_content\"));", + "});", + "pm.test(\"objectType should be Content\", () => {", + " pm.expect(jsonResponse.result.content.objectType).to.eql(\"Content\");", + "});", + "pm.test(\"visibility should be Default\", () => {", + " pm.expect(jsonResponse.result.content.visibility).to.eql(\"Default\");", + "});", + "pm.test(\"compatibilityLevel should be 1\", () => {", + " pm.expect(jsonResponse.result.content.compatibilityLevel).to.eql(1);", + "});", + "pm.test(\"status should be Draft\", () => {", + " pm.expect(jsonResponse.result.content.status).to.eql(\"Draft\");", + "});", + "" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "X-Authenticated-User-token", + "value": "{{keycloak_access_token}}", + "type": "text" + }, + { + "key": "Authorization", + "value": "{{kong_api_key}}", + "type": "text" + } + ], + "url": { + "raw": "{{host}}/content/v4/read/{{read_content}}", + "host": [ + "{{host}}" + ], + "path": [ + "content", + "v4", + "read", + "{{read_content}}" + ] + }, + "description": "Fetch a particular Batch\nThis API is associated with fetching a particular batch on the Sunbird Platform.\nThe endpoint for Fetch a particular Batch is /batch/read/{Batch_ID}\nThe fields marked with an asterisk (*) are mandatory. They cannot be null or empty." + }, + "response": [] + }, + { + "name": "Read specific attributes by sending fields query params", + "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(\"Status code name has string OK\", function () {", + " pm.response.to.have.status(\"OK\");", + "});", + "", + "pm.test(\"Verify keys and data type of the response result\", () => {", + " pm.expect(jsonResponse.result).to.have.all.keys('content');", + " pm.expect(jsonResponse.result.content).to.be.an(\"object\")", + " pm.expect(jsonResponse.result.content).to.have.all.keys('identifier', 'primaryCategory', 'name', 'languageCode','body');", + " pm.expect(jsonResponse.result.content.identifier).to.be.a(\"string\");", + " pm.expect(jsonResponse.result.content.versionKey).to.be.undefined;", + " pm.expect(jsonResponse.result.content.version).to.be.undefined;", + " pm.expect(jsonResponse.result.content.channel).to.be.undefined;", + " pm.expect(jsonResponse.result.content.compatibilityLevel).to.be.undefined;", + " pm.expect(jsonResponse.result.content.languageCode).to.be.an(\"array\");", + "});", + "", + "//Validation", + "pm.test(\"id should be api.content.read\", function () {", + " pm.expect(jsonResponse.id).to.eql(\"api.content.read\");", + "});", + "pm.test(\"ver should be 4.0\", () => {", + " pm.expect(jsonResponse.ver).to.eql(\"4.0\");", + "});", + "", + "pm.test(`identifier should be equal to ${pm.collectionVariables.get(\"read_content\")}`, () => {", + " pm.expect(jsonResponse.result.content.identifier).to.eql(pm.collectionVariables.get(\"read_content\"));", + "});", + "" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "// pm.globals.set('content_id', '');" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "X-Authenticated-User-token", + "value": "{{keycloak_access_token}}", + "type": "text" + }, + { + "key": "Authorization", + "value": "{{kong_api_key}}", + "type": "text" + } + ], + "url": { + "raw": "{{host}}/content/v4/read/{{read_content}}?fields=name,primaryCategory,body", + "host": [ + "{{host}}" + ], + "path": [ + "content", + "v4", + "read", + "{{read_content}}" + ], + "query": [ + { + "key": "fields", + "value": "name,primaryCategory,body", + "description": "Fields param is used to get the external data in response, by default read API doesn't return external data. Also fields can be used to get the specific data only in response instead of getting all the data." + } + ] + }, + "description": "Fetch a particular Batch\nThis API is associated with fetching a particular batch on the Sunbird Platform.\nThe endpoint for Fetch a particular Batch is /batch/read/{Batch_ID}\nThe fields marked with an asterisk (*) are mandatory. They cannot be null or empty." + }, + "response": [] + } + ] + }, + { + "name": "Negtaive", + "item": [ + { + "name": "Read invalid content", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json()", + "", + "//Verification", + "pm.test(\"Status code is 404\", function () {", + " pm.response.to.have.status(404)", + "});", + "pm.test(\"Params has keys: resmsgid , msgid , err , status , errmsg \", () => {", + " pm.expect(jsonResponse.params).to.have.all.keys('resmsgid', 'msgid','err','status','errmsg');", + " pm.expect(jsonResponse.params.resmsgid).to.be.a(\"string\");", + " pm.expect(jsonResponse.params.msgid).to.be.a('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');", + "});", + "//code name contains a string", + "tests[\"Status code name has string \\\"Not Found\\\"\"] = responseCode.name.has(\"Not Found\");", + "", + "pm.test(\"Test data type of the response and keys\", () => {", + " pm.expect(jsonResponse.result).to.be.an(\"object\");", + " pm.expect(jsonResponse.result).to.have.all.keys('messages');", + " pm.expect(jsonResponse.result.messages).to.be.null;", + "});", + "", + "//Validation", + "// Response body", + "pm.test(\"id should be api.content.read\", () => {", + " pm.expect(jsonResponse.id).to.eql(\"api.content.read\");", + "});", + "pm.test(\"ver should be 4.0\", () => {", + " pm.expect(jsonResponse.ver).to.eql(\"4.0\");", + "});", + "pm.test(\"responseCode should be RESOURCE_NOT_FOUND\", () => {", + " pm.expect(jsonResponse.responseCode).to.eql(\"RESOURCE_NOT_FOUND\");", + "});", + "", + "// Params", + "pm.test(\"params.err should be \\\"NOT_FOUND\\\"\", () => {", + " pm.expect(jsonResponse.params.err).to.eql(\"NOT_FOUND\");", + "});", + "pm.test(\"params.status should be \\\"failed\\\"\", () => {", + " pm.expect(jsonResponse.params.status).to.eql(\"failed\");", + "});", + "pm.test(`params.errmsg should be \\\"Error! Node(s) doesn't Exists. | [Invalid Node Id.]: ${pm.globals.get('invalid_content_id')}\\\"`, () => {", + " pm.expect(jsonResponse.params.errmsg).to.eql(`Error! Node(s) doesn't Exists. | [Invalid Node Id.]: ${pm.globals.get('invalid_content_id')}`);", + "});", + "", + "// Result", + "pm.test(\"messages should be null\", () => {", + " pm.expect(jsonResponse.result.messages).to.eql(null);", + "});", + "" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "pm.globals.set('invalid_content_id', 'do_42353245436534');" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "X-Authenticated-User-token", + "value": "{{keycloak_access_token}}", + "type": "text" + }, + { + "key": "Authorization", + "value": "{{kong_api_key}}", + "type": "text" + } + ], + "url": { + "raw": "{{host}}/content/v4/read/{{invalid_content_id}}", + "host": [ + "{{host}}" + ], + "path": [ + "content", + "v4", + "read", + "{{invalid_content_id}}" + ] + }, + "description": "Fetch a particular Batch\nThis API is associated with fetching a particular batch on the Sunbird Platform.\nThe endpoint for Fetch a particular Batch is /batch/read/{Batch_ID}\nThe fields marked with an asterisk (*) are mandatory. They cannot be null or empty." + }, + "response": [] + } + ] + } + ] + }, + { + "name": "Submit Review", + "item": [ + { + "name": "Pre requisite", + "item": [ + { + "name": "Create Content", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json();\r", + "\r", + "pm.collectionVariables.set(\"submit_content\", jsonResponse.result.identifier);\r", + "console.log(pm.collectionVariables.get(\"submit_content\"));\r", + "\r", + "" + ], + "type": "text/javascript" + } + } + ], + "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}}" + }, + { + "key": "X-Channel-Id", + "value": "sunbird" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"content\": {\n \"name\": \"Untitled Content\",\n \"code\": \"1242e9ea-660a-4536-a142-cc242a7a4162\",\n \"mimeType\": \"video/mp4\",\n \"primaryCategory\": \"Explanation Content\",\n \"body\": \"{\\\"key\\\":\\\"value\\\"}\"\n }\n }\n}" + }, + "url": { + "raw": "{{host}}/content/v4/create", + "host": [ + "{{host}}" + ], + "path": [ + "content", + "v4", + "create" + ] + }, + "description": "This API is associated with creating content on the Sunbird Platform.\n - The endpoint for **Create Content** is `/content/v2/create`\n - It points to knowledge-mw-service - `/v2/content/create`\n - It is mandatory to provide values for parameters marked with *.\n - Mandatory fields cannot be null or empty." + }, + "response": [ + { + "name": "SUCCESS. The **Create Content** operation was successful!", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource.Possible media types can be:-\n - Application/json", + "key": "Content-Type", + "value": "ea laborum" + }, + { + "description": "(Required) Represents a physical location (e.g: state) uniquely to which the user belongs.", + "key": "x-channel-id", + "value": "ea laborum" + }, + { + "description": "(Required) Represents the authorized User ID to execute the API.", + "key": "X-Authenticated-User-Token", + "value": "ea laborum" + }, + { + "description": "(Required) To make use of the API, you require authorization. Raise a request to the administrator for the use of the API. You will receive the authorization key. Specify the key received, here.", + "key": "Authorization", + "value": "ea laborum" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"content\": {\n \"name\": \"H5P Content\",\n \"code\": \"h5pcontent\",\n \"mimeType\": \"application/vnd.ekstep.h5p-archive\",\n \"primaryCategory\": \"Resource\",\n \"createdBy\": \"874ed8a5-782e-4f6c-8f36-e0288455901e\"\n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/content/v2/create", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v2", + "create" + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"api.content.create\",\n \"ver\": \"3.0\",\n \"ts\": \"2020-12-10T20:24:45ZZ\",\n \"params\": {\n \"resmsgid\": \"3be02c4b-3324-41a3-afd8-60f6be0584d2\",\n \"msgid\": null,\n \"err\": null,\n \"status\": \"successful\",\n \"errmsg\": null\n },\n \"responseCode\": \"OK\",\n \"result\": {\n \"identifier\": \"do_1131697204035993601314\",\n \"node_id\": \"do_1131697204035993601314\",\n \"versionKey\": \"1607631885207\"\n }\n}" + }, + { + "name": "'BAD REQUEST. The **Create Content** operation failed. You may have missed input for a mandatory parameter.'", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource.Possible media types can be:-\n - Application/json", + "key": "Content-Type", + "value": "ea laborum" + }, + { + "description": "(Required) Represents a physical location (e.g: state) uniquely to which the user belongs.", + "key": "x-channel-id", + "value": "ea laborum" + }, + { + "description": "(Required) Represents the authorized User ID to execute the API.", + "key": "X-Authenticated-User-Token", + "value": "ea laborum" + }, + { + "description": "(Required) To make use of the API, you require authorization. Raise a request to the administrator for the use of the API. You will receive the authorization key. Specify the key received, here.", + "key": "Authorization", + "value": "ea laborum" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"content\": {\n \"name\": \"H5P Content\",\n \"code\": \"h5pcontent\",\n \"mimeType\": \"application/vnd.ekstep.h5p-archive\",\n \"primaryCategory\": \"Resource\",\n \"createdBy\": \"874ed8a5-782e-4f6c-8f36-e0288455901e\"\n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/content/v2/create", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v2", + "create" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"api.content.create\",\n \"ver\": \"1.0\",\n \"ts\": \"2020-12-10T08:50:29.786Z\",\n \"params\": {\n \"resmsgid\": \"c169a7a0-3ac4-11eb-b0a2-8d5c9f561887\",\n \"msgid\": null,\n \"status\": \"failed\",\n \"err\": \"ERR_CONTENT_CREATE_FIELDS_MISSING\",\n \"errmsg\": \"Required fields for create content are missing\"\n },\n \"responseCode\": \"CLIENT_ERROR\",\n \"result\": {}\n}" + }, + { + "name": "'INTERNAL SERVER ERROR. We track these errors automatically and try to set it right at the earliest. Try refreshing the page. If the problem persists contact us at info@sunbird.org.'", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource.Possible media types can be:-\n - Application/json", + "key": "Content-Type", + "value": "ea laborum" + }, + { + "description": "(Required) Represents a physical location (e.g: state) uniquely to which the user belongs.", + "key": "x-channel-id", + "value": "ea laborum" + }, + { + "description": "(Required) Represents the authorized User ID to execute the API.", + "key": "X-Authenticated-User-Token", + "value": "ea laborum" + }, + { + "description": "(Required) To make use of the API, you require authorization. Raise a request to the administrator for the use of the API. You will receive the authorization key. Specify the key received, here.", + "key": "Authorization", + "value": "ea laborum" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"content\": {\n \"name\": \"H5P Content\",\n \"code\": \"h5pcontent\",\n \"mimeType\": \"application/vnd.ekstep.h5p-archive\",\n \"primaryCategory\": \"Resource\",\n \"createdBy\": \"874ed8a5-782e-4f6c-8f36-e0288455901e\"\n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/content/v2/create", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v2", + "create" + ] + } + }, + "status": "Internal Server Error", + "code": 500, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"api.content.create\",\n \"ver\": \"1.0\",\n \"ts\": \"2020-12-10T08:51:51.647Z\",\n \"params\": {\n \"resmsgid\": \"f234a6f0-3ac4-11eb-b0a2-8d5c9f561887\",\n \"msgid\": null,\n \"status\": \"failed\",\n \"err\": null,\n \"errmsg\": null\n },\n \"responseCode\": \"SERVER_ERROR\",\n \"result\": {}\n}" + } + ] + }, + { + "name": "Upload URL Copy", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json();\r", + "\r", + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "pm.test(\"Status code name has string OK\", function () {\r", + " pm.response.to.have.status(\"OK\");\r", + "});\r", + "pm.test(\"id should be api.content.upload.url\", function () {\r", + " pm.expect(jsonResponse.id).to.eql(\"api.content.upload.url\");\r", + "});\r", + "pm.test(\"ver should be 4.0\", function () {\r", + " pm.expect(jsonResponse.ver).to.eql(\"4.0\");\r", + "});\r", + "\r", + "pm.test(\"Params has keys: resmsgid , msgid , err , status , errmsg \", () => {\r", + " pm.expect(jsonResponse.params).to.have.all.keys('resmsgid', 'msgid','err','status','errmsg');\r", + " pm.expect(jsonResponse.params.resmsgid).to.be.a(\"string\");\r", + " pm.expect(jsonResponse.params.msgid).to.be.a('null');\r", + " pm.expect(jsonResponse.params.err).to.be.a('null');\r", + " pm.expect(jsonResponse.params.status).to.be.a(\"string\");\r", + " pm.expect(jsonResponse.params.errmsg).to.be.a('null');\r", + "});\r", + "\r", + "pm.test(\"Status is successful\", function () {\r", + " pm.expect(jsonResponse.params.status).to.be.equal(\"successful\");\r", + "});\r", + "\r", + "pm.test(\"ResponseCode is OK\", function () {\r", + " pm.expect(jsonResponse.responseCode).to.be.equal(\"OK\");\r", + "});\r", + "\r", + "\r", + "pm.test(\"Verify keys and data type of the response result\", () => {\r", + " pm.expect(jsonResponse.result).to.have.all.keys('identifier', 'url_expiry', 'pre_signed_url');\r", + "});\r", + "pm.collectionVariables.set(\"pre_signed_URL\",jsonResponse.result.pre_signed_url );\r", + "console.log(pm.collectionVariables.get(\"pre_signed_URL\"));\r", + "\r", + "\r", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "apikey", + "apikey": [ + { + "key": "key", + "value": "Authorization", + "type": "string" + }, + { + "key": "value", + "value": "", + "type": "string" + }, + { + "key": "in", + "value": "header", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "description": "(Required) The Content Type entity is the media type of the resource.Possible media types can be:-\n - Application/json", + "key": "Content-Type", + "value": "application/json" + }, + { + "description": "(Required) The Registered User ID to execute the API.", + "key": "X-Authenticated-Userid", + "value": "ea laborum" + }, + { + "description": "(Required) All content APIs require authorization for use. Specify the authorization key received from the administrator when placing the request for use of the API.", + "key": "Authorization", + "value": "ea laborum" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"content\": {\n \"fileName\":\"test.pdf\"\n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/content/v4/upload/url/{{submit_content}}", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v4", + "upload", + "url", + "{{submit_content}}" + ] + }, + "description": "This API is associated with uploading content on the Sunbird Platform .\n - The**_/upload/url/{content Id}_** endpoint executes \"Upload Content URL\" request based on parameters provided as metadata in the request body.\n - The endpoint for **Upload Content URL** is `/content/v2/upload/url`\n - It points to knowledge-mw-service - `/v2/content/upload/url`\n - {...}refers to a section of upload endpoint URL path that needs to be replaced by appropriate Id.\n - You need to provide a valid content Id value in {Content Id} field of API URL.\n - On Success api returns pre-signed-url link with come configured ttl against which file can be uploaded.\n - It is mandatory to provide values for parameters marked with *.\n - Mandatory fields cannot be null or empty." + }, + "response": [ + { + "name": "OK ! Successful operation.\"Content upload\" operation was successfully executed.", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource.Possible media types can be:-\n - Application/json", + "key": "Content-Type", + "value": "ea laborum" + }, + { + "description": "(Required) The Registered User ID to execute the API.", + "key": "X-Authenticated-Userid", + "value": "ea laborum" + }, + { + "description": "(Required) All content APIs require authorization for use. Specify the authorization key received from the administrator when placing the request for use of the API.", + "key": "Authorization", + "value": "ea laborum" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"content\": {\n \"fileName\": \"test.pdf\"\n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/content/v2/upload/url/:Content_Id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v2", + "upload", + "url", + ":Content_Id" + ], + "variable": [ + { + "key": "Content_Id", + "value": "ea laborum", + "description": "(Required) Please append a valid Content Id To the Request URL" + } + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"api.content.upload.url\",\n \"ver\": \"3.0\",\n \"ts\": \"2020-12-11T23:52:44ZZ\",\n \"params\": {\n \"resmsgid\": \"81e308fa-3e36-45ff-b295-e28e8f757dc7\",\n \"msgid\": null,\n \"err\": null,\n \"status\": \"successful\",\n \"errmsg\": null\n },\n \"responseCode\": \"OK\",\n \"result\": {\n \"identifier\": \"do_11317053041892556811094\",\n \"url_expiry\": \"54000\",\n \"pre_signed_url\": \"https://sunbirddev.blob.core.windows.net/sunbird-content-dev/content/assets/do_11317053041892556811094/10-page-pdf.pdf?sv=2017-04-17&se=2020-12-12T14%3A52%3A44Z&sr=b&sp=w&sig=Tlt6uWI/6lMeupkEbsTAmGajmo1qzw8HeUHrVwOm6yk%3D\"\n }\n}" + }, + { + "name": "BAD REQUEST. The 'Upload Url' operation failed ! The possible reason for failure is that you may have missed providing input for a mandatory parameter.", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource.Possible media types can be:-\n - Application/json", + "key": "Content-Type", + "value": "ea laborum" + }, + { + "description": "(Required) The Registered User ID to execute the API.", + "key": "X-Authenticated-Userid", + "value": "ea laborum" + }, + { + "description": "(Required) All content APIs require authorization for use. Specify the authorization key received from the administrator when placing the request for use of the API.", + "key": "Authorization", + "value": "ea laborum" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"content\": {\n \"fileName\": \"test.pdf\"\n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/content/v2/upload/url/:Content_Id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v2", + "upload", + "url", + ":Content_Id" + ], + "variable": [ + { + "key": "Content_Id", + "value": "ea laborum", + "description": "(Required) Please append a valid Content Id To the Request URL" + } + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"api.content.upload.url\",\n \"ver\": \"3.0\",\n \"ts\": \"2020-12-11T23:54:07ZZ\",\n \"params\": {\n \"resmsgid\": \"4edde64d-3116-4271-bcc1-a8ba0ec2d56b\",\n \"msgid\": null,\n \"err\": \"ERR_CONTENT_BLANK_FILE_NAME\",\n \"status\": \"failed\",\n \"errmsg\": \"File name is blank\"\n },\n \"responseCode\": \"CLIENT_ERROR\",\n \"result\": {\n \"messages\": null\n }\n}" + }, + { + "name": "RESOURCE NOT FOUND,**Content Id sent for generating upload url** operation failed !The possible reason for failure is that you may have provided wrong content id.", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource.Possible media types can be:-\n - Application/json", + "key": "Content-Type", + "value": "ea laborum" + }, + { + "description": "(Required) The Registered User ID to execute the API.", + "key": "X-Authenticated-Userid", + "value": "ea laborum" + }, + { + "description": "(Required) All content APIs require authorization for use. Specify the authorization key received from the administrator when placing the request for use of the API.", + "key": "Authorization", + "value": "ea laborum" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"content\": {\n \"fileName\": \"test.pdf\"\n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/content/v2/upload/url/:Content_Id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v2", + "upload", + "url", + ":Content_Id" + ], + "variable": [ + { + "key": "Content_Id", + "value": "ea laborum", + "description": "(Required) Please append a valid Content Id To the Request URL" + } + ] + } + }, + "status": "Not Found", + "code": 404, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"api.upload.url\",\n \"ver\": \"1.0\",\n \"ts\": \"2020-12-11T23:48:26.694Z\",\n \"params\": {\n \"resmsgid\": \"5cf72660-3c0b-11eb-b0a2-8d5c9f561887\",\n \"msgid\": null,\n \"status\": \"failed\",\n \"err\": \"NOT_FOUND\",\n \"errmsg\": \"Error! Node(s) doesn't Exists. | [Invalid Node Id.]: do_11254577204586086415\"\n },\n \"responseCode\": \"RESOURCE_NOT_FOUND\",\n \"result\": {}\n}" + }, + { + "name": "INTERNAL SERVER ERROR ! Looks like something went wrong! These errors are tracked automatically, but if the problem persists feel free to contact us. In the meantime, try refreshing.", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource.Possible media types can be:-\n - Application/json", + "key": "Content-Type", + "value": "ea laborum" + }, + { + "description": "(Required) The Registered User ID to execute the API.", + "key": "X-Authenticated-Userid", + "value": "ea laborum" + }, + { + "description": "(Required) All content APIs require authorization for use. Specify the authorization key received from the administrator when placing the request for use of the API.", + "key": "Authorization", + "value": "ea laborum" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"content\": {\n \"fileName\": \"test.pdf\"\n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/content/v2/upload/url/:Content_Id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v2", + "upload", + "url", + ":Content_Id" + ], + "variable": [ + { + "key": "Content_Id", + "value": "ea laborum", + "description": "(Required) Please append a valid Content Id To the Request URL" + } + ] + } + }, + "status": "Internal Server Error", + "code": 500, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"result\": {},\n \"id\": \"cupidatat reprehenderit dolor\",\n \"ver\": \"minim anim commodo\",\n \"ts\": \"commodo\",\n \"params\": {\n \"resmsgid\": \"pariatur repre\",\n \"msgid\": \"irure\",\n \"err\": \"consequat esse ea\",\n \"status\": \"esse\",\n \"errmsg\": \"aliqua laboris velit\"\n },\n \"responseCode\": \"reprehenderit dolor elit sunt dolore\"\n}" + } + ] + }, + { + "name": "Upload file to the URL Copy", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 201\", function () {\r", + " pm.response.to.have.status(201);\r", + "});\r", + "\r", + "var fullUrl= pm.collectionVariables.get(\"pre_signed_URL\");\r", + "\r", + "// Find the index of '?' to get the position of the query parameters\r", + "var indexOfQuestionMark = fullUrl.indexOf('?');\r", + "\r", + "// Extract the partial URL without the query parameters\r", + "var partialUrl = indexOfQuestionMark !== -1 ? fullUrl.slice(0, indexOfQuestionMark) : fullUrl;\r", + "pm.collectionVariables.set(\"partial_URL\", partialUrl);\r", + "// Log the partial URL to the console (you can remove this line if not needed)\r", + "console.log(pm.collectionVariables.get(\"partial_URL\"));\r", + "\r", + "// Now you can use the 'partialUrl' variable in Postman as needed\r", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "PUT", + "header": [ + { + "key": "X-Ms-Blob-Type", + "value": "BlockBlob" + } + ], + "body": { + "mode": "formdata", + "formdata": [ + { + "key": "file", + "type": "file", + "src": "/C:/Users/Qualitrix/Downloads/pdf_233.pdf" + } + ] + }, + "url": { + "raw": "{{pre_signed_URL}}", + "host": [ + "{{pre_signed_URL}}" + ] + } + }, + "response": [] + }, + { + "name": "Update the content with valid URL and mime type Copy", + "event": [ + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + }, + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json();\r", + "\r", + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "pm.test(\"Status code name has string OK\", function () {\r", + " pm.response.to.have.status(\"OK\");\r", + "});\r", + "pm.test(\"id should be api.content.upload\", function () {\r", + " pm.expect(jsonResponse.id).to.eql(\"api.content.upload\");\r", + "});\r", + "pm.test(\"ver should be 4.0\", function () {\r", + " pm.expect(jsonResponse.ver).to.eql(\"4.0\");\r", + "});\r", + "\r", + "pm.test(\"Params has keys: resmsgid , msgid , err , status , errmsg \", () => {\r", + " pm.expect(jsonResponse.params).to.have.all.keys('resmsgid', 'msgid','err','status','errmsg');\r", + " pm.expect(jsonResponse.params.resmsgid).to.be.a(\"string\");\r", + " pm.expect(jsonResponse.params.msgid).to.be.a('null');\r", + " pm.expect(jsonResponse.params.err).to.be.a('null');\r", + " pm.expect(jsonResponse.params.status).to.be.a(\"string\");\r", + " pm.expect(jsonResponse.params.errmsg).to.be.a('null');\r", + "});\r", + "\r", + "pm.test(\"Status is successful\", function () {\r", + " pm.expect(jsonResponse.params.status).to.be.equal(\"successful\");\r", + "});\r", + "\r", + "pm.test(\"ResponseCode is OK\", function () {\r", + " pm.expect(jsonResponse.responseCode).to.be.equal(\"OK\");\r", + "});\r", + "\r", + "pm.test(\"Result has keys: identifier , artifactUrl , content_url , node_id , versionKey \", () => {\r", + " pm.expect(jsonResponse.result).to.have.all.keys('identifier', 'artifactUrl','content_url','node_id','versionKey');\r", + " pm.expect(jsonResponse.result.identifier).to.be.a(\"string\");\r", + " pm.expect(jsonResponse.result.artifactUrl).to.be.a(\"string\");\r", + " pm.expect(jsonResponse.result.content_url).to.be.a(\"string\");\r", + " pm.expect(jsonResponse.result.node_id).to.be.a(\"string\");\r", + " pm.expect(jsonResponse.result.versionKey).to.be.a(\"string\");\r", + "});\r", + "\r", + "pm.test(`artifactUrl should be: ${pm.collectionVariables.get(\"partial_URL\")}`, function () {\r", + " pm.expect(jsonResponse.result.artifactUrl).to.be.equal(`${pm.collectionVariables.get(\"partial_URL\")}`);\r", + "});\r", + "\r", + "pm.test(`content_url should be: ${pm.collectionVariables.get(\"partial_URL\")}`, function () {\r", + " pm.expect(jsonResponse.result.content_url).to.be.equal(`${pm.collectionVariables.get(\"partial_URL\")}`);\r", + "});\r", + "\r", + "pm.test(`identifier should be: ${pm.collectionVariables.get(\"submit_content\")}`, function () {\r", + " pm.expect(jsonResponse.result.identifier).to.be.equal(`${pm.collectionVariables.get(\"submit_content\")}`);\r", + "});\r", + "\r", + "pm.test(`node_id should be: ${pm.collectionVariables.get(\"submit_content\")}`, function () {\r", + " pm.expect(jsonResponse.result.node_id).to.be.equal(`${pm.collectionVariables.get(\"submit_content\")}`);\r", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "user-id", + "value": "mahesh" + }, + { + "key": "Cookie", + "value": "connect.sid=s%3AnLNdCeYI27WUkZBIFdX1J5MKTM6ISEdJ.SFTq%2FeT2cVLh5TSEWmwZPCekWDSeNXILHPDyziKa26E" + }, + { + "key": "X-Channel-Id", + "value": "0137541424673095687" + }, + { + "key": "X-Authenticated-User-token", + "value": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImtpZCI6ImFjY2Vzc3YxX2tleTEifQ.eyJhdWQiOiJodHRwczovL2Rldi5zdW5iaXJkZWQub3JnL2F1dGgvcmVhbG1zL3N1bmJpcmQiLCJzdWIiOiJmOjVhOGEzZjJiLTM0MDktNDJlMC05MDAxLWY5MTNiYzBmZGUzMToxNTVjZTNjNS03MTNlLTQ3NDktYmMxYy05NWQwOWM2NDA5MTQiLCJyb2xlcyI6W3sicm9sZSI6IkNPTlRFTlRfQ1JFQVRPUiIsInNjb3BlIjpbeyJvcmdhbmlzYXRpb25JZCI6IjAxMzc1NDE0MjQ2NzMwOTU2ODcifV19LHsicm9sZSI6IkNPVVJTRV9NRU5UT1IiLCJzY29wZSI6W3sib3JnYW5pc2F0aW9uSWQiOiIwMTM3NTQxNDI0NjczMDk1Njg3In1dfSx7InJvbGUiOiJQVUJMSUMiLCJzY29wZSI6W119XSwiaXNzIjoiaHR0cHM6Ly9kZXYuc3VuYmlyZGVkLm9yZy9hdXRoL3JlYWxtcy9zdW5iaXJkIiwibmFtZSI6ImNvbnRlbnRDcmVhdG9yIiwidHlwIjoiQmVhcmVyIiwiZXhwIjoxNzAyMzI0NjU0LCJpYXQiOjE3MDIyODE0NTR9.MxiIhP6YJmI1XbozLNoJeQAbdQKs597f2mlNHWcJ-ZZIXvBx4BcX7T57B5xXGIT6LJ6YlS86saiG6SXHIG5ptgICphdefNysfVgkSUmqTsgzfzvjp2lzIw8Re7xi735Kd7B612y5Tkswm0ETP7NIeQ7-Tc_3h37GV04ISfx0LMD75UvgllxcDz91Bl6N3-WN4KwCeKIfJ-iZj-EJLwoBmJjGsgNCNTn5DTzF_joFcyett__WVc14Ex-BqRSq8Hr2fMVoHpNXze3QUJ7PcD4JRY2Ywg5R9VkHz3mkhY9kI1cWeHdQypeSsM8niQK1XCWJz_aTqsP35MshDnHkWhmDyg" + }, + { + "key": "Authorization", + "value": "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiIzZGNjMzY3OWIwYTE0NmU2YWYyZjlmZDA5NWU5NTlkNCJ9.0NZhX5sqUNy-GZUya90aQFkr5ZNiqfOuELYz_IvoyS8" + } + ], + "body": { + "mode": "formdata", + "formdata": [ + { + "key": "fileUrl", + "value": "{{partial_URL}}", + "type": "text" + }, + { + "key": "mimeType", + "value": "application/pdf", + "type": "text" + } + ] + }, + "url": { + "raw": "{{host}}/content/v4/upload/{{submit_content}}", + "host": [ + "{{host}}" + ], + "path": [ + "content", + "v4", + "upload", + "{{submit_content}}" + ] + } + }, + "response": [] + }, + { + "name": "Create content for negative scenario", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json();\r", + "\r", + "pm.collectionVariables.set(\"submit_content_neg\", jsonResponse.result.identifier);\r", + "console.log(pm.collectionVariables.get(\"submit_content_neg\"));\r", + "\r", + "" + ], + "type": "text/javascript" + } + } + ], + "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}}" + }, + { + "key": "X-Channel-Id", + "value": "sunbird" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"content\": {\n \"name\": \"Untitled Content\",\n \"code\": \"1242e9ea-660a-4536-a142-cc242a7a4162\",\n \"mimeType\": \"video/mp4\",\n \"primaryCategory\": \"Explanation Content\",\n \"body\": \"{\\\"key\\\":\\\"value\\\"}\"\n }\n }\n}" + }, + "url": { + "raw": "{{host}}/content/v4/create", + "host": [ + "{{host}}" + ], + "path": [ + "content", + "v4", + "create" + ] + } + }, + "response": [] + } + ] + }, + { + "name": "Positive", + "item": [ + { + "name": "Submit for Review", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json();\r", + "\r", + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "pm.test(\"Status code name has string OK\", function () {\r", + " pm.response.to.have.status(\"OK\");\r", + "});\r", + "pm.test(\"id should be api.content.review\", function () {\r", + " pm.expect(jsonResponse.id).to.eql(\"api.content.review\");\r", + "});\r", + "pm.test(\"ver should be 4.0\", function () {\r", + " pm.expect(jsonResponse.ver).to.eql(\"4.0\");\r", + "});\r", + "\r", + "pm.test(\"Params has keys: resmsgid , msgid , err , status , errmsg \", () => {\r", + " pm.expect(jsonResponse.params).to.have.all.keys('resmsgid', 'msgid','err','status','errmsg');\r", + " pm.expect(jsonResponse.params.resmsgid).to.be.a(\"string\");\r", + " pm.expect(jsonResponse.params.msgid).to.be.a('null');\r", + " pm.expect(jsonResponse.params.err).to.be.a('null');\r", + " pm.expect(jsonResponse.params.status).to.be.a(\"string\");\r", + " pm.expect(jsonResponse.params.errmsg).to.be.a('null');\r", + "});\r", + "\r", + "pm.test(\"Status is successful\", function () {\r", + " pm.expect(jsonResponse.params.status).to.be.equal(\"successful\");\r", + "});\r", + "\r", + "pm.test(\"ResponseCode is OK\", function () {\r", + " pm.expect(jsonResponse.responseCode).to.be.equal(\"OK\");\r", + "});\r", + "pm.test(\"Result has keys: identifier , versionKey\", () => {\r", + " pm.expect(jsonResponse.result).to.have.all.keys('identifier','versionKey');\r", + " pm.expect(jsonResponse.result.identifier).to.be.a(\"string\");\r", + " pm.expect(jsonResponse.result.versionKey).to.be.a(\"string\");\r", + "});\r", + "\r", + "pm.test(`identifier should be: ${pm.collectionVariables.get(\"submit_content\")}`, function () {\r", + " pm.expect(jsonResponse.result.identifier).to.be.equal(`${pm.collectionVariables.get(\"submit_content\")}`);\r", + "});\r", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "apikey", + "apikey": [ + { + "key": "value", + "value": "{{auth_token}}", + "type": "string" + }, + { + "key": "key", + "value": "Authorization", + "type": "string" + }, + { + "key": "in", + "value": "header", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "description": "(Required) The Content Type entity is the media type of the resource.Possible media types can be:-\n - Application/json", + "key": "Content-Type", + "value": "application/json" + }, + { + "description": "(Required) The Registered User ID to execute the API.", + "key": "X-Authenticated-User-token", + "value": "ea laborum" + }, + { + "description": "(Required) All content APIs require authorization for use. Specify the authorization key received from the administrator when placing the request for use of the API.", + "key": "Authorization", + "value": "ea laborum" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/content/v4/review/{{submit_content}}", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v4", + "review", + "{{submit_content}}" + ] + }, + "description": ">- This API is associated with Submission of content for Review on the Sunbird Platform .\n - The**_/review/{content Id}_** endpoint executes \"Submit for Review\" request based on parameters provided as metadata in the request body.\n - The endpoint for **Review Content** is `/content/v2/review`\n - It points to knowledge-mw-service - `/v2/content/review`\n - {...}refers to a section of review endpoint URL path that needs to be replaced by appropriate Id.\n - You need to provide a valid content Id value in {Content Id} field of API URL.\n - It is mandatory to provide values for parameters marked with *.\n - Mandatory fields cannot be null or empty." + }, + "response": [ + { + "name": "OK ! Successful operation.Content sent for review operation was successfully executed.", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource.Possible media types can be:-\n - Application/json", + "key": "Content-Type", + "value": "ea laborum" + }, + { + "description": "(Required) The Registered User ID to execute the API.", + "key": "X-Authenticated-User-token", + "value": "ea laborum" + }, + { + "description": "(Required) All content APIs require authorization for use. Specify the authorization key received from the administrator when placing the request for use of the API.", + "key": "Authorization", + "value": "ea laborum" + } + ], + "body": { + "mode": "raw", + "raw": "{}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/content/v2/review/:Content_Id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v2", + "review", + ":Content_Id" + ], + "variable": [ + { + "key": "Content_Id", + "value": "ea laborum", + "description": "(Required) Please append a valid Content Id To the Request URL" + } + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"ekstep.learning.content.review\",\n \"ver\": \"3.0\",\n \"ts\": \"2020-12-10T21:06:26ZZ\",\n \"params\": {\n \"resmsgid\": \"186cf9a9-8094-4cdd-926f-b77a030921d1\",\n \"msgid\": null,\n \"err\": null,\n \"status\": \"successful\",\n \"errmsg\": null\n },\n \"responseCode\": \"OK\",\n \"result\": {\n \"node_id\": \"do_1131697376667402241315\",\n \"versionKey\": \"1607634386533\"\n }\n}" + }, + { + "name": "RESOURCE NOT FOUND,**Content Send for Review** operation failed !The possible reason for failure is that you may have provided wrong content id.", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource.Possible media types can be:-\n - Application/json", + "key": "Content-Type", + "value": "ea laborum" + }, + { + "description": "(Required) The Registered User ID to execute the API.", + "key": "X-Authenticated-User-token", + "value": "ea laborum" + }, + { + "description": "(Required) All content APIs require authorization for use. Specify the authorization key received from the administrator when placing the request for use of the API.", + "key": "Authorization", + "value": "ea laborum" + } + ], + "body": { + "mode": "raw", + "raw": "{}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/content/v2/review/:Content_Id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v2", + "review", + ":Content_Id" + ], + "variable": [ + { + "key": "Content_Id", + "value": "ea laborum", + "description": "(Required) Please append a valid Content Id To the Request URL" + } + ] + } + }, + "status": "Not Found", + "code": 404, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"ekstep.learning.content.review\",\n \"ver\": \"3.0\",\n \"ts\": \"2020-12-10T21:06:54ZZ\",\n \"params\": {\n \"resmsgid\": \"944ac944-78d9-43e2-bfd5-337ab52b6552\",\n \"msgid\": null,\n \"err\": \"ERR_TAXONOMY_INVALID_CONTENT\",\n \"status\": \"failed\",\n \"errmsg\": \"Error! While Fetching the Content for Operation | [Content Id: do_11316973766674022413151]\"\n },\n \"responseCode\": \"CLIENT_ERROR\",\n \"result\": {}\n}" + }, + { + "name": "INTERNAL SERVER ERROR ! Looks like something went wrong! We track these errors automatically, but if the problem persists feel free to contact us. In the meantime, try refreshing.", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource.Possible media types can be:-\n - Application/json", + "key": "Content-Type", + "value": "ea laborum" + }, + { + "description": "(Required) The Registered User ID to execute the API.", + "key": "X-Authenticated-User-token", + "value": "ea laborum" + }, + { + "description": "(Required) All content APIs require authorization for use. Specify the authorization key received from the administrator when placing the request for use of the API.", + "key": "Authorization", + "value": "ea laborum" + } + ], + "body": { + "mode": "raw", + "raw": "{}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/content/v2/review/:Content_Id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v2", + "review", + ":Content_Id" + ], + "variable": [ + { + "key": "Content_Id", + "value": "ea laborum", + "description": "(Required) Please append a valid Content Id To the Request URL" + } + ] + } + }, + "status": "Internal Server Error", + "code": 500, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"result\": {},\n \"id\": \"cupidatat reprehenderit dolor\",\n \"ver\": \"minim anim commodo\",\n \"ts\": \"commodo\",\n \"params\": {\n \"resmsgid\": \"pariatur repre\",\n \"msgid\": \"irure\",\n \"err\": \"consequat esse ea\",\n \"status\": \"esse\",\n \"errmsg\": \"aliqua laboris velit\"\n },\n \"responseCode\": \"reprehenderit dolor elit sunt dolore\"\n}" + } + ] + } + ] + }, + { + "name": "Negative", + "item": [ + { + "name": "Submit invalid content for review", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json()\r", + "\r", + "//Verification\r", + "pm.test(\"Status code is 404\", function () {\r", + " pm.response.to.have.status(404)\r", + "});\r", + "pm.test(\"Params has keys: resmsgid , msgid , err , status , errmsg \", () => {\r", + " pm.expect(jsonResponse.params).to.have.all.keys('resmsgid', 'msgid','err','status','errmsg');\r", + " pm.expect(jsonResponse.params.resmsgid).to.be.a(\"string\");\r", + " pm.expect(jsonResponse.params.msgid).to.be.a('null');\r", + " pm.expect(jsonResponse.params.err).to.be.a('string');\r", + " pm.expect(jsonResponse.params.status).to.be.a(\"string\");\r", + " pm.expect(jsonResponse.params.errmsg).to.be.a('string');\r", + "});\r", + "//code name contains a string\r", + "tests[\"Status code name has string \\\"Not Found\\\"\"] = responseCode.name.has(\"Not Found\");\r", + "\r", + "pm.test(\"Test data type of the response and keys\", () => {\r", + " pm.expect(jsonResponse.result).to.be.an(\"object\");\r", + " pm.expect(jsonResponse.result).to.have.all.keys('messages');\r", + " pm.expect(jsonResponse.result.messages).to.be.null;\r", + "});\r", + "\r", + "//Validation\r", + "// Response body\r", + "pm.test(\"id should be api.content.review\", () => {\r", + " pm.expect(jsonResponse.id).to.eql(\"api.content.review\");\r", + "});\r", + "pm.test(\"ver should be 4.0\", () => {\r", + " pm.expect(jsonResponse.ver).to.eql(\"4.0\");\r", + "});\r", + "pm.test(\"responseCode should be RESOURCE_NOT_FOUND\", () => {\r", + " pm.expect(jsonResponse.responseCode).to.eql(\"RESOURCE_NOT_FOUND\");\r", + "});\r", + "\r", + "// Params\r", + "pm.test(\"params.err should be \\\"NOT_FOUND\\\"\", () => {\r", + " pm.expect(jsonResponse.params.err).to.eql(\"NOT_FOUND\");\r", + "});\r", + "pm.test(\"params.status should be \\\"failed\\\"\", () => {\r", + " pm.expect(jsonResponse.params.status).to.eql(\"failed\");\r", + "});\r", + "pm.test(`Error! Node(s) doesn't Exists. | [Invalid Node Id.]: dummy`, () => {\r", + " pm.expect(jsonResponse.params.errmsg).to.eql(`Error! Node(s) doesn't Exists. | [Invalid Node Id.]: dummy`);\r", + "});\r", + "\r", + "// Result\r", + "pm.test(\"messages should be null\", () => {\r", + " pm.expect(jsonResponse.result.messages).to.eql(null);\r", + "});\r", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "ea laborum" + }, + { + "key": "X-Authenticated-User-token", + "value": "ea laborum" + }, + { + "key": "Authorization", + "value": "{{auth_token}}" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{}" + }, + "url": { + "raw": "{{host}}/content/v4/review/dummy", + "host": [ + "{{host}}" + ], + "path": [ + "content", + "v4", + "review", + "dummy" + ] + } + }, + "response": [] + }, + { + "name": "Submit content for review without artifactr URL", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json()\r", + "\r", + "//Verification\r", + "pm.test(\"Status code is 400\", function () {\r", + " pm.response.to.have.status(400)\r", + "});\r", + "pm.test(\"Params has keys: resmsgid , msgid , err , status , errmsg \", () => {\r", + " pm.expect(jsonResponse.params).to.have.all.keys('resmsgid', 'msgid','err','status','errmsg');\r", + " pm.expect(jsonResponse.params.resmsgid).to.be.a(\"string\");\r", + " pm.expect(jsonResponse.params.msgid).to.be.a('null');\r", + " pm.expect(jsonResponse.params.err).to.be.a('string');\r", + " pm.expect(jsonResponse.params.status).to.be.a(\"string\");\r", + " pm.expect(jsonResponse.params.errmsg).to.be.a('string');\r", + "});\r", + "//code name contains a string\r", + "tests[\"Status code name has string \\\"Bad Request\\\"\"] = responseCode.name.has(\"Bad Request\");\r", + "\r", + "pm.test(\"Test data type of the response and keys\", () => {\r", + " pm.expect(jsonResponse.result).to.be.an(\"object\");\r", + " pm.expect(jsonResponse.result).to.have.all.keys('messages');\r", + " pm.expect(jsonResponse.result.messages).to.be.null;\r", + "});\r", + "\r", + "//Validation\r", + "// Response body\r", + "pm.test(\"id should be api.content.review\", () => {\r", + " pm.expect(jsonResponse.id).to.eql(\"api.content.review\");\r", + "});\r", + "pm.test(\"ver should be 4.0\", () => {\r", + " pm.expect(jsonResponse.ver).to.eql(\"4.0\");\r", + "});\r", + "pm.test(\"responseCode should be CLIENT_ERROR\", () => {\r", + " pm.expect(jsonResponse.responseCode).to.eql(\"CLIENT_ERROR\");\r", + "});\r", + "\r", + "// Params\r", + "pm.test(\"params.err should be \\\"VALIDATOR_ERROR\\\"\", () => {\r", + " pm.expect(jsonResponse.params.err).to.eql(\"VALIDATOR_ERROR\");\r", + "});\r", + "pm.test(\"params.status should be \\\"failed\\\"\", () => {\r", + " pm.expect(jsonResponse.params.status).to.eql(\"failed\");\r", + "});\r", + "pm.test(`Error! Missing One or More Required Fields in Object. | [Either artifactUrl is missing or invalid!]\"`, () => {\r", + " pm.expect(jsonResponse.params.errmsg).to.eql(`Error! Missing One or More Required Fields in Object. | [Either artifactUrl is missing or invalid!]`);\r", + "});\r", + "\r", + "// Result\r", + "pm.test(\"messages should be null\", () => {\r", + " pm.expect(jsonResponse.result.messages).to.eql(null);\r", + "});\r", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "ea laborum" + }, + { + "key": "X-Authenticated-User-token", + "value": "ea laborum" + }, + { + "key": "Authorization", + "value": "{{auth_token}}" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{}" + }, + "url": { + "raw": "{{host}}/content/v4/review/{{submit_content_neg}}", + "host": [ + "{{host}}" + ], + "path": [ + "content", + "v4", + "review", + "{{submit_content_neg}}" + ] + } + }, + "response": [] + } + ] + } + ] + }, + { + "name": "Publish Content", + "item": [ + { + "name": "Pre requisite", + "item": [ + { + "name": "Create Content", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json();\r", + "\r", + "pm.collectionVariables.set(\"publish_content\", jsonResponse.result.identifier);\r", + "console.log(pm.collectionVariables.get(\"publish_content\"));\r", + "\r", + "" + ], + "type": "text/javascript" + } + } + ], + "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}}" + }, + { + "key": "X-Channel-Id", + "value": "sunbird" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"content\": {\n \"name\": \"Untitled Content\",\n \"code\": \"1242e9ea-660a-4536-a142-cc242a7a4162\",\n \"mimeType\": \"video/mp4\",\n \"primaryCategory\": \"Explanation Content\",\n \"body\": \"{\\\"key\\\":\\\"value\\\"}\"\n }\n }\n}" + }, + "url": { + "raw": "{{host}}/content/v4/create", + "host": [ + "{{host}}" + ], + "path": [ + "content", + "v4", + "create" + ] + }, + "description": "This API is associated with creating content on the Sunbird Platform.\n - The endpoint for **Create Content** is `/content/v2/create`\n - It points to knowledge-mw-service - `/v2/content/create`\n - It is mandatory to provide values for parameters marked with *.\n - Mandatory fields cannot be null or empty." + }, + "response": [ + { + "name": "SUCCESS. The **Create Content** operation was successful!", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource.Possible media types can be:-\n - Application/json", + "key": "Content-Type", + "value": "ea laborum" + }, + { + "description": "(Required) Represents a physical location (e.g: state) uniquely to which the user belongs.", + "key": "x-channel-id", + "value": "ea laborum" + }, + { + "description": "(Required) Represents the authorized User ID to execute the API.", + "key": "X-Authenticated-User-Token", + "value": "ea laborum" + }, + { + "description": "(Required) To make use of the API, you require authorization. Raise a request to the administrator for the use of the API. You will receive the authorization key. Specify the key received, here.", + "key": "Authorization", + "value": "ea laborum" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"content\": {\n \"name\": \"H5P Content\",\n \"code\": \"h5pcontent\",\n \"mimeType\": \"application/vnd.ekstep.h5p-archive\",\n \"primaryCategory\": \"Resource\",\n \"createdBy\": \"874ed8a5-782e-4f6c-8f36-e0288455901e\"\n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/content/v2/create", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v2", + "create" + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"api.content.create\",\n \"ver\": \"3.0\",\n \"ts\": \"2020-12-10T20:24:45ZZ\",\n \"params\": {\n \"resmsgid\": \"3be02c4b-3324-41a3-afd8-60f6be0584d2\",\n \"msgid\": null,\n \"err\": null,\n \"status\": \"successful\",\n \"errmsg\": null\n },\n \"responseCode\": \"OK\",\n \"result\": {\n \"identifier\": \"do_1131697204035993601314\",\n \"node_id\": \"do_1131697204035993601314\",\n \"versionKey\": \"1607631885207\"\n }\n}" + }, + { + "name": "'BAD REQUEST. The **Create Content** operation failed. You may have missed input for a mandatory parameter.'", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource.Possible media types can be:-\n - Application/json", + "key": "Content-Type", + "value": "ea laborum" + }, + { + "description": "(Required) Represents a physical location (e.g: state) uniquely to which the user belongs.", + "key": "x-channel-id", + "value": "ea laborum" + }, + { + "description": "(Required) Represents the authorized User ID to execute the API.", + "key": "X-Authenticated-User-Token", + "value": "ea laborum" + }, + { + "description": "(Required) To make use of the API, you require authorization. Raise a request to the administrator for the use of the API. You will receive the authorization key. Specify the key received, here.", + "key": "Authorization", + "value": "ea laborum" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"content\": {\n \"name\": \"H5P Content\",\n \"code\": \"h5pcontent\",\n \"mimeType\": \"application/vnd.ekstep.h5p-archive\",\n \"primaryCategory\": \"Resource\",\n \"createdBy\": \"874ed8a5-782e-4f6c-8f36-e0288455901e\"\n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/content/v2/create", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v2", + "create" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"api.content.create\",\n \"ver\": \"1.0\",\n \"ts\": \"2020-12-10T08:50:29.786Z\",\n \"params\": {\n \"resmsgid\": \"c169a7a0-3ac4-11eb-b0a2-8d5c9f561887\",\n \"msgid\": null,\n \"status\": \"failed\",\n \"err\": \"ERR_CONTENT_CREATE_FIELDS_MISSING\",\n \"errmsg\": \"Required fields for create content are missing\"\n },\n \"responseCode\": \"CLIENT_ERROR\",\n \"result\": {}\n}" + }, + { + "name": "'INTERNAL SERVER ERROR. We track these errors automatically and try to set it right at the earliest. Try refreshing the page. If the problem persists contact us at info@sunbird.org.'", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource.Possible media types can be:-\n - Application/json", + "key": "Content-Type", + "value": "ea laborum" + }, + { + "description": "(Required) Represents a physical location (e.g: state) uniquely to which the user belongs.", + "key": "x-channel-id", + "value": "ea laborum" + }, + { + "description": "(Required) Represents the authorized User ID to execute the API.", + "key": "X-Authenticated-User-Token", + "value": "ea laborum" + }, + { + "description": "(Required) To make use of the API, you require authorization. Raise a request to the administrator for the use of the API. You will receive the authorization key. Specify the key received, here.", + "key": "Authorization", + "value": "ea laborum" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"content\": {\n \"name\": \"H5P Content\",\n \"code\": \"h5pcontent\",\n \"mimeType\": \"application/vnd.ekstep.h5p-archive\",\n \"primaryCategory\": \"Resource\",\n \"createdBy\": \"874ed8a5-782e-4f6c-8f36-e0288455901e\"\n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/content/v2/create", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v2", + "create" + ] + } + }, + "status": "Internal Server Error", + "code": 500, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"api.content.create\",\n \"ver\": \"1.0\",\n \"ts\": \"2020-12-10T08:51:51.647Z\",\n \"params\": {\n \"resmsgid\": \"f234a6f0-3ac4-11eb-b0a2-8d5c9f561887\",\n \"msgid\": null,\n \"status\": \"failed\",\n \"err\": null,\n \"errmsg\": null\n },\n \"responseCode\": \"SERVER_ERROR\",\n \"result\": {}\n}" + } + ] + }, + { + "name": "Upload URL", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json();\r", + "\r", + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "pm.test(\"Status code name has string OK\", function () {\r", + " pm.response.to.have.status(\"OK\");\r", + "});\r", + "pm.test(\"id should be api.content.upload.url\", function () {\r", + " pm.expect(jsonResponse.id).to.eql(\"api.content.upload.url\");\r", + "});\r", + "pm.test(\"ver should be 4.0\", function () {\r", + " pm.expect(jsonResponse.ver).to.eql(\"4.0\");\r", + "});\r", + "\r", + "pm.test(\"Params has keys: resmsgid , msgid , err , status , errmsg \", () => {\r", + " pm.expect(jsonResponse.params).to.have.all.keys('resmsgid', 'msgid','err','status','errmsg');\r", + " pm.expect(jsonResponse.params.resmsgid).to.be.a(\"string\");\r", + " pm.expect(jsonResponse.params.msgid).to.be.a('null');\r", + " pm.expect(jsonResponse.params.err).to.be.a('null');\r", + " pm.expect(jsonResponse.params.status).to.be.a(\"string\");\r", + " pm.expect(jsonResponse.params.errmsg).to.be.a('null');\r", + "});\r", + "\r", + "pm.test(\"Status is successful\", function () {\r", + " pm.expect(jsonResponse.params.status).to.be.equal(\"successful\");\r", + "});\r", + "\r", + "pm.test(\"ResponseCode is OK\", function () {\r", + " pm.expect(jsonResponse.responseCode).to.be.equal(\"OK\");\r", + "});\r", + "\r", + "\r", + "pm.test(\"Verify keys and data type of the response result\", () => {\r", + " pm.expect(jsonResponse.result).to.have.all.keys('identifier', 'url_expiry', 'pre_signed_url');\r", + "});\r", + "pm.collectionVariables.set(\"pre_signed_URL\",jsonResponse.result.pre_signed_url );\r", + "console.log(pm.collectionVariables.get(\"pre_signed_URL\"));\r", + "\r", + "\r", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "apikey", + "apikey": [ + { + "key": "key", + "value": "Authorization", + "type": "string" + }, + { + "key": "value", + "value": "", + "type": "string" + }, + { + "key": "in", + "value": "header", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "description": "(Required) The Content Type entity is the media type of the resource.Possible media types can be:-\n - Application/json", + "key": "Content-Type", + "value": "application/json" + }, + { + "description": "(Required) The Registered User ID to execute the API.", + "key": "X-Authenticated-Userid", + "value": "ea laborum" + }, + { + "description": "(Required) All content APIs require authorization for use. Specify the authorization key received from the administrator when placing the request for use of the API.", + "key": "Authorization", + "value": "ea laborum" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"content\": {\n \"fileName\":\"test.pdf\"\n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/content/v4/upload/url/{{publish_content}}", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v4", + "upload", + "url", + "{{publish_content}}" + ] + }, + "description": "This API is associated with uploading content on the Sunbird Platform .\n - The**_/upload/url/{content Id}_** endpoint executes \"Upload Content URL\" request based on parameters provided as metadata in the request body.\n - The endpoint for **Upload Content URL** is `/content/v2/upload/url`\n - It points to knowledge-mw-service - `/v2/content/upload/url`\n - {...}refers to a section of upload endpoint URL path that needs to be replaced by appropriate Id.\n - You need to provide a valid content Id value in {Content Id} field of API URL.\n - On Success api returns pre-signed-url link with come configured ttl against which file can be uploaded.\n - It is mandatory to provide values for parameters marked with *.\n - Mandatory fields cannot be null or empty." + }, + "response": [ + { + "name": "OK ! Successful operation.\"Content upload\" operation was successfully executed.", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource.Possible media types can be:-\n - Application/json", + "key": "Content-Type", + "value": "ea laborum" + }, + { + "description": "(Required) The Registered User ID to execute the API.", + "key": "X-Authenticated-Userid", + "value": "ea laborum" + }, + { + "description": "(Required) All content APIs require authorization for use. Specify the authorization key received from the administrator when placing the request for use of the API.", + "key": "Authorization", + "value": "ea laborum" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"content\": {\n \"fileName\": \"test.pdf\"\n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/content/v2/upload/url/:Content_Id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v2", + "upload", + "url", + ":Content_Id" + ], + "variable": [ + { + "key": "Content_Id", + "value": "ea laborum", + "description": "(Required) Please append a valid Content Id To the Request URL" + } + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"api.content.upload.url\",\n \"ver\": \"3.0\",\n \"ts\": \"2020-12-11T23:52:44ZZ\",\n \"params\": {\n \"resmsgid\": \"81e308fa-3e36-45ff-b295-e28e8f757dc7\",\n \"msgid\": null,\n \"err\": null,\n \"status\": \"successful\",\n \"errmsg\": null\n },\n \"responseCode\": \"OK\",\n \"result\": {\n \"identifier\": \"do_11317053041892556811094\",\n \"url_expiry\": \"54000\",\n \"pre_signed_url\": \"https://sunbirddev.blob.core.windows.net/sunbird-content-dev/content/assets/do_11317053041892556811094/10-page-pdf.pdf?sv=2017-04-17&se=2020-12-12T14%3A52%3A44Z&sr=b&sp=w&sig=Tlt6uWI/6lMeupkEbsTAmGajmo1qzw8HeUHrVwOm6yk%3D\"\n }\n}" + }, + { + "name": "BAD REQUEST. The 'Upload Url' operation failed ! The possible reason for failure is that you may have missed providing input for a mandatory parameter.", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource.Possible media types can be:-\n - Application/json", + "key": "Content-Type", + "value": "ea laborum" + }, + { + "description": "(Required) The Registered User ID to execute the API.", + "key": "X-Authenticated-Userid", + "value": "ea laborum" + }, + { + "description": "(Required) All content APIs require authorization for use. Specify the authorization key received from the administrator when placing the request for use of the API.", + "key": "Authorization", + "value": "ea laborum" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"content\": {\n \"fileName\": \"test.pdf\"\n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/content/v2/upload/url/:Content_Id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v2", + "upload", + "url", + ":Content_Id" + ], + "variable": [ + { + "key": "Content_Id", + "value": "ea laborum", + "description": "(Required) Please append a valid Content Id To the Request URL" + } + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"api.content.upload.url\",\n \"ver\": \"3.0\",\n \"ts\": \"2020-12-11T23:54:07ZZ\",\n \"params\": {\n \"resmsgid\": \"4edde64d-3116-4271-bcc1-a8ba0ec2d56b\",\n \"msgid\": null,\n \"err\": \"ERR_CONTENT_BLANK_FILE_NAME\",\n \"status\": \"failed\",\n \"errmsg\": \"File name is blank\"\n },\n \"responseCode\": \"CLIENT_ERROR\",\n \"result\": {\n \"messages\": null\n }\n}" + }, + { + "name": "RESOURCE NOT FOUND,**Content Id sent for generating upload url** operation failed !The possible reason for failure is that you may have provided wrong content id.", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource.Possible media types can be:-\n - Application/json", + "key": "Content-Type", + "value": "ea laborum" + }, + { + "description": "(Required) The Registered User ID to execute the API.", + "key": "X-Authenticated-Userid", + "value": "ea laborum" + }, + { + "description": "(Required) All content APIs require authorization for use. Specify the authorization key received from the administrator when placing the request for use of the API.", + "key": "Authorization", + "value": "ea laborum" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"content\": {\n \"fileName\": \"test.pdf\"\n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/content/v2/upload/url/:Content_Id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v2", + "upload", + "url", + ":Content_Id" + ], + "variable": [ + { + "key": "Content_Id", + "value": "ea laborum", + "description": "(Required) Please append a valid Content Id To the Request URL" + } + ] + } + }, + "status": "Not Found", + "code": 404, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"api.upload.url\",\n \"ver\": \"1.0\",\n \"ts\": \"2020-12-11T23:48:26.694Z\",\n \"params\": {\n \"resmsgid\": \"5cf72660-3c0b-11eb-b0a2-8d5c9f561887\",\n \"msgid\": null,\n \"status\": \"failed\",\n \"err\": \"NOT_FOUND\",\n \"errmsg\": \"Error! Node(s) doesn't Exists. | [Invalid Node Id.]: do_11254577204586086415\"\n },\n \"responseCode\": \"RESOURCE_NOT_FOUND\",\n \"result\": {}\n}" + }, + { + "name": "INTERNAL SERVER ERROR ! Looks like something went wrong! These errors are tracked automatically, but if the problem persists feel free to contact us. In the meantime, try refreshing.", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource.Possible media types can be:-\n - Application/json", + "key": "Content-Type", + "value": "ea laborum" + }, + { + "description": "(Required) The Registered User ID to execute the API.", + "key": "X-Authenticated-Userid", + "value": "ea laborum" + }, + { + "description": "(Required) All content APIs require authorization for use. Specify the authorization key received from the administrator when placing the request for use of the API.", + "key": "Authorization", + "value": "ea laborum" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"content\": {\n \"fileName\": \"test.pdf\"\n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/content/v2/upload/url/:Content_Id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v2", + "upload", + "url", + ":Content_Id" + ], + "variable": [ + { + "key": "Content_Id", + "value": "ea laborum", + "description": "(Required) Please append a valid Content Id To the Request URL" + } + ] + } + }, + "status": "Internal Server Error", + "code": 500, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"result\": {},\n \"id\": \"cupidatat reprehenderit dolor\",\n \"ver\": \"minim anim commodo\",\n \"ts\": \"commodo\",\n \"params\": {\n \"resmsgid\": \"pariatur repre\",\n \"msgid\": \"irure\",\n \"err\": \"consequat esse ea\",\n \"status\": \"esse\",\n \"errmsg\": \"aliqua laboris velit\"\n },\n \"responseCode\": \"reprehenderit dolor elit sunt dolore\"\n}" + } + ] + }, + { + "name": "Upload file to the URL", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 201\", function () {\r", + " pm.response.to.have.status(201);\r", + "});\r", + "\r", + "var fullUrl= pm.collectionVariables.get(\"pre_signed_URL\");\r", + "\r", + "// Find the index of '?' to get the position of the query parameters\r", + "var indexOfQuestionMark = fullUrl.indexOf('?');\r", + "\r", + "// Extract the partial URL without the query parameters\r", + "var partialUrl = indexOfQuestionMark !== -1 ? fullUrl.slice(0, indexOfQuestionMark) : fullUrl;\r", + "pm.collectionVariables.set(\"partial_URL\", partialUrl);\r", + "// Log the partial URL to the console (you can remove this line if not needed)\r", + "console.log(pm.collectionVariables.get(\"partial_URL\"));\r", + "\r", + "// Now you can use the 'partialUrl' variable in Postman as needed\r", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "PUT", + "header": [ + { + "key": "X-Ms-Blob-Type", + "value": "BlockBlob" + } + ], + "body": { + "mode": "formdata", + "formdata": [ + { + "key": "file", + "type": "file", + "src": "/C:/Users/Qualitrix/Downloads/pdf_233.pdf" + } + ] + }, + "url": { + "raw": "{{pre_signed_URL}}", + "host": [ + "{{pre_signed_URL}}" + ] + } + }, + "response": [] + }, + { + "name": "Update the content with URL and mime type", + "event": [ + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + }, + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json();\r", + "\r", + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "pm.test(\"Status code name has string OK\", function () {\r", + " pm.response.to.have.status(\"OK\");\r", + "});\r", + "pm.test(\"id should be api.content.upload\", function () {\r", + " pm.expect(jsonResponse.id).to.eql(\"api.content.upload\");\r", + "});\r", + "pm.test(\"ver should be 4.0\", function () {\r", + " pm.expect(jsonResponse.ver).to.eql(\"4.0\");\r", + "});\r", + "\r", + "pm.test(\"Params has keys: resmsgid , msgid , err , status , errmsg \", () => {\r", + " pm.expect(jsonResponse.params).to.have.all.keys('resmsgid', 'msgid','err','status','errmsg');\r", + " pm.expect(jsonResponse.params.resmsgid).to.be.a(\"string\");\r", + " pm.expect(jsonResponse.params.msgid).to.be.a('null');\r", + " pm.expect(jsonResponse.params.err).to.be.a('null');\r", + " pm.expect(jsonResponse.params.status).to.be.a(\"string\");\r", + " pm.expect(jsonResponse.params.errmsg).to.be.a('null');\r", + "});\r", + "\r", + "pm.test(\"Status is successful\", function () {\r", + " pm.expect(jsonResponse.params.status).to.be.equal(\"successful\");\r", + "});\r", + "\r", + "pm.test(\"ResponseCode is OK\", function () {\r", + " pm.expect(jsonResponse.responseCode).to.be.equal(\"OK\");\r", + "});\r", + "\r", + "pm.test(\"Result has keys: identifier , artifactUrl , content_url , node_id , versionKey \", () => {\r", + " pm.expect(jsonResponse.result).to.have.all.keys('identifier', 'artifactUrl','content_url','node_id','versionKey');\r", + " pm.expect(jsonResponse.result.identifier).to.be.a(\"string\");\r", + " pm.expect(jsonResponse.result.artifactUrl).to.be.a(\"string\");\r", + " pm.expect(jsonResponse.result.content_url).to.be.a(\"string\");\r", + " pm.expect(jsonResponse.result.node_id).to.be.a(\"string\");\r", + " pm.expect(jsonResponse.result.versionKey).to.be.a(\"string\");\r", + "});\r", + "\r", + "pm.test(`artifactUrl should be: ${pm.collectionVariables.get(\"partial_URL\")}`, function () {\r", + " pm.expect(jsonResponse.result.artifactUrl).to.be.equal(`${pm.collectionVariables.get(\"partial_URL\")}`);\r", + "});\r", + "\r", + "pm.test(`content_url should be: ${pm.collectionVariables.get(\"partial_URL\")}`, function () {\r", + " pm.expect(jsonResponse.result.content_url).to.be.equal(`${pm.collectionVariables.get(\"partial_URL\")}`);\r", + "});\r", + "\r", + "pm.test(`identifier should be: ${pm.collectionVariables.get(\"publish_content\")}`, function () {\r", + " pm.expect(jsonResponse.result.identifier).to.be.equal(`${pm.collectionVariables.get(\"publish_content\")}`);\r", + "});\r", + "\r", + "pm.test(`node_id should be: ${pm.collectionVariables.get(\"publish_content\")}`, function () {\r", + " pm.expect(jsonResponse.result.node_id).to.be.equal(`${pm.collectionVariables.get(\"publish_content\")}`);\r", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "user-id", + "value": "mahesh" + }, + { + "key": "Cookie", + "value": "connect.sid=s%3AnLNdCeYI27WUkZBIFdX1J5MKTM6ISEdJ.SFTq%2FeT2cVLh5TSEWmwZPCekWDSeNXILHPDyziKa26E" + }, + { + "key": "X-Channel-Id", + "value": "0137541424673095687" + }, + { + "key": "X-Authenticated-User-token", + "value": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImtpZCI6ImFjY2Vzc3YxX2tleTEifQ.eyJhdWQiOiJodHRwczovL2Rldi5zdW5iaXJkZWQub3JnL2F1dGgvcmVhbG1zL3N1bmJpcmQiLCJzdWIiOiJmOjVhOGEzZjJiLTM0MDktNDJlMC05MDAxLWY5MTNiYzBmZGUzMToxNTVjZTNjNS03MTNlLTQ3NDktYmMxYy05NWQwOWM2NDA5MTQiLCJyb2xlcyI6W3sicm9sZSI6IkNPTlRFTlRfQ1JFQVRPUiIsInNjb3BlIjpbeyJvcmdhbmlzYXRpb25JZCI6IjAxMzc1NDE0MjQ2NzMwOTU2ODcifV19LHsicm9sZSI6IkNPVVJTRV9NRU5UT1IiLCJzY29wZSI6W3sib3JnYW5pc2F0aW9uSWQiOiIwMTM3NTQxNDI0NjczMDk1Njg3In1dfSx7InJvbGUiOiJQVUJMSUMiLCJzY29wZSI6W119XSwiaXNzIjoiaHR0cHM6Ly9kZXYuc3VuYmlyZGVkLm9yZy9hdXRoL3JlYWxtcy9zdW5iaXJkIiwibmFtZSI6ImNvbnRlbnRDcmVhdG9yIiwidHlwIjoiQmVhcmVyIiwiZXhwIjoxNzAyMzI0NjU0LCJpYXQiOjE3MDIyODE0NTR9.MxiIhP6YJmI1XbozLNoJeQAbdQKs597f2mlNHWcJ-ZZIXvBx4BcX7T57B5xXGIT6LJ6YlS86saiG6SXHIG5ptgICphdefNysfVgkSUmqTsgzfzvjp2lzIw8Re7xi735Kd7B612y5Tkswm0ETP7NIeQ7-Tc_3h37GV04ISfx0LMD75UvgllxcDz91Bl6N3-WN4KwCeKIfJ-iZj-EJLwoBmJjGsgNCNTn5DTzF_joFcyett__WVc14Ex-BqRSq8Hr2fMVoHpNXze3QUJ7PcD4JRY2Ywg5R9VkHz3mkhY9kI1cWeHdQypeSsM8niQK1XCWJz_aTqsP35MshDnHkWhmDyg" + }, + { + "key": "Authorization", + "value": "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiIzZGNjMzY3OWIwYTE0NmU2YWYyZjlmZDA5NWU5NTlkNCJ9.0NZhX5sqUNy-GZUya90aQFkr5ZNiqfOuELYz_IvoyS8" + } + ], + "body": { + "mode": "formdata", + "formdata": [ + { + "key": "fileUrl", + "value": "{{partial_URL}}", + "type": "text" + }, + { + "key": "mimeType", + "value": "application/pdf", + "type": "text" + } + ] + }, + "url": { + "raw": "{{host}}/content/v4/upload/{{publish_content}}", + "host": [ + "{{host}}" + ], + "path": [ + "content", + "v4", + "upload", + "{{publish_content}}" + ] + } + }, + "response": [] + }, + { + "name": "Submit for Review", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json();\r", + "\r", + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "pm.test(\"Status code name has string OK\", function () {\r", + " pm.response.to.have.status(\"OK\");\r", + "});\r", + "pm.test(\"id should be api.content.review\", function () {\r", + " pm.expect(jsonResponse.id).to.eql(\"api.content.review\");\r", + "});\r", + "pm.test(\"ver should be 4.0\", function () {\r", + " pm.expect(jsonResponse.ver).to.eql(\"4.0\");\r", + "});\r", + "\r", + "pm.test(\"Params has keys: resmsgid , msgid , err , status , errmsg \", () => {\r", + " pm.expect(jsonResponse.params).to.have.all.keys('resmsgid', 'msgid','err','status','errmsg');\r", + " pm.expect(jsonResponse.params.resmsgid).to.be.a(\"string\");\r", + " pm.expect(jsonResponse.params.msgid).to.be.a('null');\r", + " pm.expect(jsonResponse.params.err).to.be.a('null');\r", + " pm.expect(jsonResponse.params.status).to.be.a(\"string\");\r", + " pm.expect(jsonResponse.params.errmsg).to.be.a('null');\r", + "});\r", + "\r", + "pm.test(\"Status is successful\", function () {\r", + " pm.expect(jsonResponse.params.status).to.be.equal(\"successful\");\r", + "});\r", + "\r", + "pm.test(\"ResponseCode is OK\", function () {\r", + " pm.expect(jsonResponse.responseCode).to.be.equal(\"OK\");\r", + "});\r", + "pm.test(\"Result has keys: identifier , versionKey\", () => {\r", + " pm.expect(jsonResponse.result).to.have.all.keys('identifier','versionKey');\r", + " pm.expect(jsonResponse.result.identifier).to.be.a(\"string\");\r", + " pm.expect(jsonResponse.result.versionKey).to.be.a(\"string\");\r", + "});\r", + "\r", + "pm.test(`identifier should be: ${pm.collectionVariables.get(\"publish_content\")}`, function () {\r", + " pm.expect(jsonResponse.result.identifier).to.be.equal(`${pm.collectionVariables.get(\"publish_content\")}`);\r", + "});\r", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "apikey", + "apikey": [ + { + "key": "value", + "value": "{{auth_token}}", + "type": "string" + }, + { + "key": "key", + "value": "Authorization", + "type": "string" + }, + { + "key": "in", + "value": "header", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "description": "(Required) The Content Type entity is the media type of the resource.Possible media types can be:-\n - Application/json", + "key": "Content-Type", + "value": "application/json" + }, + { + "description": "(Required) The Registered User ID to execute the API.", + "key": "X-Authenticated-User-token", + "value": "ea laborum" + }, + { + "description": "(Required) All content APIs require authorization for use. Specify the authorization key received from the administrator when placing the request for use of the API.", + "key": "Authorization", + "value": "ea laborum" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/content/v4/review/{{publish_content}}", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v4", + "review", + "{{publish_content}}" + ] + }, + "description": ">- This API is associated with Submission of content for Review on the Sunbird Platform .\n - The**_/review/{content Id}_** endpoint executes \"Submit for Review\" request based on parameters provided as metadata in the request body.\n - The endpoint for **Review Content** is `/content/v2/review`\n - It points to knowledge-mw-service - `/v2/content/review`\n - {...}refers to a section of review endpoint URL path that needs to be replaced by appropriate Id.\n - You need to provide a valid content Id value in {Content Id} field of API URL.\n - It is mandatory to provide values for parameters marked with *.\n - Mandatory fields cannot be null or empty." + }, + "response": [ + { + "name": "OK ! Successful operation.Content sent for review operation was successfully executed.", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource.Possible media types can be:-\n - Application/json", + "key": "Content-Type", + "value": "ea laborum" + }, + { + "description": "(Required) The Registered User ID to execute the API.", + "key": "X-Authenticated-User-token", + "value": "ea laborum" + }, + { + "description": "(Required) All content APIs require authorization for use. Specify the authorization key received from the administrator when placing the request for use of the API.", + "key": "Authorization", + "value": "ea laborum" + } + ], + "body": { + "mode": "raw", + "raw": "{}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/content/v2/review/:Content_Id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v2", + "review", + ":Content_Id" + ], + "variable": [ + { + "key": "Content_Id", + "value": "ea laborum", + "description": "(Required) Please append a valid Content Id To the Request URL" + } + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"ekstep.learning.content.review\",\n \"ver\": \"3.0\",\n \"ts\": \"2020-12-10T21:06:26ZZ\",\n \"params\": {\n \"resmsgid\": \"186cf9a9-8094-4cdd-926f-b77a030921d1\",\n \"msgid\": null,\n \"err\": null,\n \"status\": \"successful\",\n \"errmsg\": null\n },\n \"responseCode\": \"OK\",\n \"result\": {\n \"node_id\": \"do_1131697376667402241315\",\n \"versionKey\": \"1607634386533\"\n }\n}" + }, + { + "name": "RESOURCE NOT FOUND,**Content Send for Review** operation failed !The possible reason for failure is that you may have provided wrong content id.", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource.Possible media types can be:-\n - Application/json", + "key": "Content-Type", + "value": "ea laborum" + }, + { + "description": "(Required) The Registered User ID to execute the API.", + "key": "X-Authenticated-User-token", + "value": "ea laborum" + }, + { + "description": "(Required) All content APIs require authorization for use. Specify the authorization key received from the administrator when placing the request for use of the API.", + "key": "Authorization", + "value": "ea laborum" + } + ], + "body": { + "mode": "raw", + "raw": "{}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/content/v2/review/:Content_Id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v2", + "review", + ":Content_Id" + ], + "variable": [ + { + "key": "Content_Id", + "value": "ea laborum", + "description": "(Required) Please append a valid Content Id To the Request URL" + } + ] + } + }, + "status": "Not Found", + "code": 404, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"ekstep.learning.content.review\",\n \"ver\": \"3.0\",\n \"ts\": \"2020-12-10T21:06:54ZZ\",\n \"params\": {\n \"resmsgid\": \"944ac944-78d9-43e2-bfd5-337ab52b6552\",\n \"msgid\": null,\n \"err\": \"ERR_TAXONOMY_INVALID_CONTENT\",\n \"status\": \"failed\",\n \"errmsg\": \"Error! While Fetching the Content for Operation | [Content Id: do_11316973766674022413151]\"\n },\n \"responseCode\": \"CLIENT_ERROR\",\n \"result\": {}\n}" + }, + { + "name": "INTERNAL SERVER ERROR ! Looks like something went wrong! We track these errors automatically, but if the problem persists feel free to contact us. In the meantime, try refreshing.", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource.Possible media types can be:-\n - Application/json", + "key": "Content-Type", + "value": "ea laborum" + }, + { + "description": "(Required) The Registered User ID to execute the API.", + "key": "X-Authenticated-User-token", + "value": "ea laborum" + }, + { + "description": "(Required) All content APIs require authorization for use. Specify the authorization key received from the administrator when placing the request for use of the API.", + "key": "Authorization", + "value": "ea laborum" + } + ], + "body": { + "mode": "raw", + "raw": "{}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/content/v2/review/:Content_Id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v2", + "review", + ":Content_Id" + ], + "variable": [ + { + "key": "Content_Id", + "value": "ea laborum", + "description": "(Required) Please append a valid Content Id To the Request URL" + } + ] + } + }, + "status": "Internal Server Error", + "code": 500, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"result\": {},\n \"id\": \"cupidatat reprehenderit dolor\",\n \"ver\": \"minim anim commodo\",\n \"ts\": \"commodo\",\n \"params\": {\n \"resmsgid\": \"pariatur repre\",\n \"msgid\": \"irure\",\n \"err\": \"consequat esse ea\",\n \"status\": \"esse\",\n \"errmsg\": \"aliqua laboris velit\"\n },\n \"responseCode\": \"reprehenderit dolor elit sunt dolore\"\n}" + } + ] + }, + { + "name": "Create content for negative scenario", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json();\r", + "\r", + "pm.collectionVariables.set(\"content_wo_url\", jsonResponse.result.identifier);\r", + "console.log(pm.collectionVariables.get(\"content_wo_url\"));\r", + "\r", + "" + ], + "type": "text/javascript" + } + } + ], + "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}}" + }, + { + "key": "X-Channel-Id", + "value": "sunbird" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"content\": {\n \"name\": \"Untitled Content\",\n \"code\": \"1242e9ea-660a-4536-a142-cc242a7a4162\",\n \"mimeType\": \"video/mp4\",\n \"primaryCategory\": \"Explanation Content\",\n \"body\": \"{\\\"key\\\":\\\"value\\\"}\"\n }\n }\n}" + }, + "url": { + "raw": "{{host}}/content/v4/create", + "host": [ + "{{host}}" + ], + "path": [ + "content", + "v4", + "create" + ] + } + }, + "response": [] + } + ] + }, + { + "name": "Positive", + "item": [ + { + "name": "Publish Content", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json()\r", + "\r", + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "\r", + "pm.test(\"id has string - api.content.publish.public \", function () {\r", + " pm.expect(jsonResponse.id).to.be.equal(\"api.content.publish.public\");\r", + "});\r", + "\r", + "pm.test(\"Version is 4.0 \", function () {\r", + " pm.expect(jsonResponse.ver).to.be.equal(\"4.0\");\r", + "});\r", + "\r", + "pm.test(\"Verify keys and data type of the response result\", () => {\r", + " pm.expect(jsonResponse.params).to.have.all.keys('resmsgid','msgid','status', 'err','errmsg');\r", + " pm.expect(jsonResponse.params.resmsgid).to.be.a(\"string\");\r", + " pm.expect(jsonResponse.params.msgid).to.be.a(\"null\"); \r", + " pm.expect(jsonResponse.params.status).to.be.a(\"string\");\r", + " pm.expect(jsonResponse.params.err).to.be.a(\"null\");\r", + " pm.expect(jsonResponse.params.errmsg).to.be.a(\"null\");\r", + "});\r", + "\r", + "pm.test(\"Status is successful \", function () {\r", + " pm.expect(jsonResponse.params.status).to.be.equal(\"successful\");\r", + "});\r", + "\r", + "pm.test(\"ResponseCode is OK \", function () {\r", + " pm.expect(jsonResponse.responseCode).to.be.equal(\"OK\");\r", + "});\r", + "\r", + "pm.test(\"Verify keys and data type of the response result\", () => {\r", + " pm.expect(jsonResponse.result).to.have.all.keys('publishStatus','node_id');\r", + " pm.expect(jsonResponse.result.publishStatus).to.be.a('String');\r", + " pm.expect(jsonResponse.result.node_id).to.be.a('String');\r", + "});\r", + "\r", + "pm.test(\"node should be equal to \" + pm.collectionVariables.get(\"publish_content\"), () => {\r", + " pm.expect(jsonResponse.result.node_id).to.eql(pm.collectionVariables.get(\"publish_content\"));\r", + "});\r", + "pm.test(`publishStatus should be equal to Publish Event for Content Id ${pm.collectionVariables.get(\"publish_content\")} is pushed Successfully!`, () => {\r", + " pm.expect(jsonResponse.result.publishStatus).to.eql(`Publish Event for Content Id '${pm.collectionVariables.get(\"publish_content\")}' is pushed Successfully!`);\r", + "});\r", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "apikey", + "apikey": [ + { + "key": "key", + "value": "Authorization", + "type": "string" + }, + { + "key": "value", + "value": "", + "type": "string" + }, + { + "key": "in", + "value": "header", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "description": "(Required) The Content Type entity is the media type of the resource.Possible media types can be:-\n - Application/json\n - Multipart/form-data\n - Application/x-www-form-urlencoded", + "key": "Content-Type", + "value": "application/json" + }, + { + "description": "(Required) User Registered ID , which is used for logging In", + "key": "X-Authenticated-User-token", + "value": "ea laborum" + }, + { + "description": "(Required) Authorizing user in order to grant access.", + "key": "Authorization", + "value": "ea laborum" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"content\": {\n \"Publisher\": \"sunbird.publisher.create\",\n \"lastPublishedBy\": \"Ekstep\"\n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/content/v4/publish/{{publish_content}}", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v4", + "publish", + "{{publish_content}}" + ] + }, + "description": "This API is associated with publishing content on the Sunbird Platform .\n - **_/publish/_** endpoint executes the \"Publish Content\" request based on parameters provided as metadata in the request body.\n - The endpoint for **Publish Content** is `/content/v1/publish`\n - It points to knowledge-mw-service - `/v2/content/publish`\n - {...}refers to a section of review endpoint URL path that needs to be replaced by appropriate Id.\n - It is mandatory to provide values for parameters marked with *.\n - Mandatory fields cannot be null or empty." + }, + "response": [ + { + "name": "OK ! Successful operation.**Content publish operation was successfully executed.", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource.Possible media types can be:-\n - Application/json\n - Multipart/form-data\n - Application/x-www-form-urlencoded", + "key": "Content-Type", + "value": "ea laborum" + }, + { + "description": "(Required) User Registered ID , which is used for logging In", + "key": "X-Authenticated-User-token", + "value": "ea laborum" + }, + { + "description": "(Required) Authorizing user in order to grant access.", + "key": "Authorization", + "value": "ea laborum" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"content\": {\n \"lastPublishedBy\": \"Ekstep\"\n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/content/v1/publish/:Content_Id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v1", + "publish", + ":Content_Id" + ], + "variable": [ + { + "key": "Content_Id", + "value": "ea laborum", + "description": "(Required) Content Id to be published" + } + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"api.v3.publish\",\n \"ver\": \"1.0\",\n \"ts\": \"2020-12-10T21:41:23.491Z\",\n \"params\": {\n \"resmsgid\": \"72c4ef30-3b30-11eb-b0a2-8d5c9f561887\",\n \"msgid\": \"72979da0-3b30-11eb-b0a2-8d5c9f561887\",\n \"status\": \"successful\",\n \"err\": null,\n \"errmsg\": null\n },\n \"responseCode\": \"OK\",\n \"result\": {\n \"content_id\": \"do_21316975736724684813479\",\n \"publishStatus\": \"Publish Operation for Content Id 'do_21316975736724684813479' Started Successfully!\"\n }\n}" + }, + { + "name": "RESOURCE NOT FOUND,**Content Send for Review** operation failed !The possible reason for failure is that you may have provided wrong content id.", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource.Possible media types can be:-\n - Application/json\n - Multipart/form-data\n - Application/x-www-form-urlencoded", + "key": "Content-Type", + "value": "ea laborum" + }, + { + "description": "(Required) User Registered ID , which is used for logging In", + "key": "X-Authenticated-User-token", + "value": "ea laborum" + }, + { + "description": "(Required) Authorizing user in order to grant access.", + "key": "Authorization", + "value": "ea laborum" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"content\": {\n \"lastPublishedBy\": \"Ekstep\"\n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/content/v1/publish/:Content_Id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v1", + "publish", + ":Content_Id" + ], + "variable": [ + { + "key": "Content_Id", + "value": "ea laborum", + "description": "(Required) Content Id to be published" + } + ] + } + }, + "status": "Not Found", + "code": 404, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"api.v3.publish\",\n \"ver\": \"1.0\",\n \"ts\": \"2020-12-10T21:51:39.870Z\",\n \"params\": {\n \"resmsgid\": \"e228e7e0-3b31-11eb-b0a2-8d5c9f561887\",\n \"msgid\": null,\n \"status\": \"failed\",\n \"err\": \"NOT_FOUND\",\n \"errmsg\": \"Error! Node(s) doesn't Exists. | [Invalid Node Id.]: do_213169757367246848134791\"\n },\n \"responseCode\": \"RESOURCE_NOT_FOUND\",\n \"result\": {}\n}" + }, + { + "name": "INTERNAL SERVER ERROR ! Looks like something went wrong! We track these errors automatically, but if the problem persists feel free to contact us. In the meantime, try refreshing.", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource.Possible media types can be:-\n - Application/json\n - Multipart/form-data\n - Application/x-www-form-urlencoded", + "key": "Content-Type", + "value": "ea laborum" + }, + { + "description": "(Required) User Registered ID , which is used for logging In", + "key": "X-Authenticated-User-token", + "value": "ea laborum" + }, + { + "description": "(Required) Authorizing user in order to grant access.", + "key": "Authorization", + "value": "ea laborum" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"content\": {\n \"lastPublishedBy\": \"Ekstep\"\n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/content/v1/publish/:Content_Id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v1", + "publish", + ":Content_Id" + ], + "variable": [ + { + "key": "Content_Id", + "value": "ea laborum", + "description": "(Required) Content Id to be published" + } + ] + } + }, + "status": "Internal Server Error", + "code": 500, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"result\": {},\n \"id\": \"cupidatat reprehenderit dolor\",\n \"ver\": \"minim anim commodo\",\n \"ts\": \"commodo\",\n \"params\": {\n \"resmsgid\": \"pariatur repre\",\n \"msgid\": \"irure\",\n \"err\": \"consequat esse ea\",\n \"status\": \"esse\",\n \"errmsg\": \"aliqua laboris velit\"\n },\n \"responseCode\": \"reprehenderit dolor elit sunt dolore\"\n}" + } + ] + } + ] + }, + { + "name": "Negative", + "item": [ + { + "name": "Publish content without artifact URL", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json()\r", + "\r", + "//Verification\r", + "pm.test(\"Status code is 400\", function () {\r", + " pm.response.to.have.status(400)\r", + "});\r", + "pm.test(\"Params has keys: resmsgid , msgid , err , status , errmsg \", () => {\r", + " pm.expect(jsonResponse.params).to.have.all.keys('resmsgid', 'msgid','err','status','errmsg');\r", + " pm.expect(jsonResponse.params.resmsgid).to.be.a(\"string\");\r", + " pm.expect(jsonResponse.params.msgid).to.be.a('null');\r", + " pm.expect(jsonResponse.params.err).to.be.a('string');\r", + " pm.expect(jsonResponse.params.status).to.be.a(\"string\");\r", + " pm.expect(jsonResponse.params.errmsg).to.be.a('string');\r", + "});\r", + "//code name contains a string\r", + "tests[\"Status code name has string \\\"Bad Request\\\"\"] = responseCode.name.has(\"Bad Request\");\r", + "\r", + "pm.test(\"Test data type of the response and keys\", () => {\r", + " pm.expect(jsonResponse.result).to.be.an(\"object\");\r", + " pm.expect(jsonResponse.result).to.have.all.keys('messages');\r", + " pm.expect(jsonResponse.result.messages).to.be.null;\r", + "});\r", + "\r", + "//Validation\r", + "// Response body\r", + "pm.test(\"id should be api.content.publish.public\", () => {\r", + " pm.expect(jsonResponse.id).to.eql(\"api.content.publish.public\");\r", + "});\r", + "pm.test(\"ver should be 4.0\", () => {\r", + " pm.expect(jsonResponse.ver).to.eql(\"4.0\");\r", + "});\r", + "pm.test(\"responseCode should be CLIENT_ERROR\", () => {\r", + " pm.expect(jsonResponse.responseCode).to.eql(\"CLIENT_ERROR\");\r", + "});\r", + "\r", + "// Params\r", + "pm.test(\"params.err should be \\\"VALIDATOR_ERROR\\\"\", () => {\r", + " pm.expect(jsonResponse.params.err).to.eql(\"VALIDATOR_ERROR\");\r", + "});\r", + "pm.test(\"params.status should be \\\"failed\\\"\", () => {\r", + " pm.expect(jsonResponse.params.status).to.eql(\"failed\");\r", + "});\r", + "pm.test(`Error! Missing One or More Required Fields in Object. | [Either artifactUrl is missing or invalid!]\"`, () => {\r", + " pm.expect(jsonResponse.params.errmsg).to.eql(`Error! Missing One or More Required Fields in Object. | [Either artifactUrl is missing or invalid!]`);\r", + "});\r", + "\r", + "// Result\r", + "pm.test(\"messages should be null\", () => {\r", + " pm.expect(jsonResponse.result.messages).to.eql(null);\r", + "});\r", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "X-Authenticated-User-token", + "value": "ea laborum" + }, + { + "key": "Authorization", + "value": "" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"content\": {\n \"lastPublishedBy\": \"Ekstep\"\n }\n }\n}" + }, + "url": { + "raw": "{{host}}/content/v4/publish/{{content_wo_url}}", + "host": [ + "{{host}}" + ], + "path": [ + "content", + "v4", + "publish", + "{{content_wo_url}}" + ] + } + }, + "response": [] + }, + { + "name": "Publish invalid content", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json()\r", + "\r", + "//Verification\r", + "pm.test(\"Status code is 404\", function () {\r", + " pm.response.to.have.status(404)\r", + "});\r", + "pm.test(\"Params has keys: resmsgid , msgid , err , status , errmsg \", () => {\r", + " pm.expect(jsonResponse.params).to.have.all.keys('resmsgid', 'msgid','err','status','errmsg');\r", + " pm.expect(jsonResponse.params.resmsgid).to.be.a(\"string\");\r", + " pm.expect(jsonResponse.params.msgid).to.be.a('null');\r", + " pm.expect(jsonResponse.params.err).to.be.a('string');\r", + " pm.expect(jsonResponse.params.status).to.be.a(\"string\");\r", + " pm.expect(jsonResponse.params.errmsg).to.be.a('string');\r", + "});\r", + "//code name contains a string\r", + "tests[\"Status code name has string \\\"Not Found\\\"\"] = responseCode.name.has(\"Not Found\");\r", + "\r", + "pm.test(\"Test data type of the response and keys\", () => {\r", + " pm.expect(jsonResponse.result).to.be.an(\"object\");\r", + " pm.expect(jsonResponse.result).to.have.all.keys('messages');\r", + " pm.expect(jsonResponse.result.messages).to.be.null;\r", + "});\r", + "\r", + "//Validation\r", + "// Response body\r", + "pm.test(\"id should be api.content.publish.public\", () => {\r", + " pm.expect(jsonResponse.id).to.eql(\"api.content.publish.public\");\r", + "});\r", + "pm.test(\"ver should be 4.0\", () => {\r", + " pm.expect(jsonResponse.ver).to.eql(\"4.0\");\r", + "});\r", + "pm.test(\"responseCode should be RESOURCE_NOT_FOUND\", () => {\r", + " pm.expect(jsonResponse.responseCode).to.eql(\"RESOURCE_NOT_FOUND\");\r", + "});\r", + "\r", + "// Params\r", + "pm.test(\"params.err should be \\\"NOT_FOUND\\\"\", () => {\r", + " pm.expect(jsonResponse.params.err).to.eql(\"NOT_FOUND\");\r", + "});\r", + "pm.test(\"params.status should be \\\"failed\\\"\", () => {\r", + " pm.expect(jsonResponse.params.status).to.eql(\"failed\");\r", + "});\r", + "pm.test(`Error! Node(s) doesn't Exists. | [Invalid Node Id.]: dummy`, () => {\r", + " pm.expect(jsonResponse.params.errmsg).to.eql(`Error! Node(s) doesn't Exists. | [Invalid Node Id.]: dummy`);\r", + "});\r", + "\r", + "// Result\r", + "pm.test(\"messages should be null\", () => {\r", + " pm.expect(jsonResponse.result.messages).to.eql(null);\r", + "});\r", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "X-Authenticated-User-token", + "value": "ea laborum" + }, + { + "key": "Authorization", + "value": "" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"content\": {\n \"lastPublishedBy\": \"Ekstep\"\n }\n }\n}" + }, + "url": { + "raw": "{{host}}/content/v4/publish/dummy", + "host": [ + "{{host}}" + ], + "path": [ + "content", + "v4", + "publish", + "dummy" + ] + } + }, + "response": [] + } + ] + } + ] + }, + { + "name": "Reject content", + "item": [ + { + "name": "Pre requisite Copy", + "item": [ + { + "name": "Create Content", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json();\r", + "\r", + "pm.collectionVariables.set(\"reject_content\", jsonResponse.result.identifier);\r", + "console.log(pm.collectionVariables.get(\"reject_content\"));\r", + "\r", + "" + ], + "type": "text/javascript" + } + } + ], + "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}}" + }, + { + "key": "X-Channel-Id", + "value": "sunbird" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"content\": {\n \"name\": \"Untitled Content\",\n \"code\": \"1242e9ea-660a-4536-a142-cc242a7a4162\",\n \"mimeType\": \"video/mp4\",\n \"primaryCategory\": \"Explanation Content\",\n \"body\": \"{\\\"key\\\":\\\"value\\\"}\"\n }\n }\n}" + }, + "url": { + "raw": "{{host}}/content/v4/create", + "host": [ + "{{host}}" + ], + "path": [ + "content", + "v4", + "create" + ] + }, + "description": "This API is associated with creating content on the Sunbird Platform.\n - The endpoint for **Create Content** is `/content/v2/create`\n - It points to knowledge-mw-service - `/v2/content/create`\n - It is mandatory to provide values for parameters marked with *.\n - Mandatory fields cannot be null or empty." + }, + "response": [ + { + "name": "SUCCESS. The **Create Content** operation was successful!", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource.Possible media types can be:-\n - Application/json", + "key": "Content-Type", + "value": "ea laborum" + }, + { + "description": "(Required) Represents a physical location (e.g: state) uniquely to which the user belongs.", + "key": "x-channel-id", + "value": "ea laborum" + }, + { + "description": "(Required) Represents the authorized User ID to execute the API.", + "key": "X-Authenticated-User-Token", + "value": "ea laborum" + }, + { + "description": "(Required) To make use of the API, you require authorization. Raise a request to the administrator for the use of the API. You will receive the authorization key. Specify the key received, here.", + "key": "Authorization", + "value": "ea laborum" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"content\": {\n \"name\": \"H5P Content\",\n \"code\": \"h5pcontent\",\n \"mimeType\": \"application/vnd.ekstep.h5p-archive\",\n \"primaryCategory\": \"Resource\",\n \"createdBy\": \"874ed8a5-782e-4f6c-8f36-e0288455901e\"\n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/content/v2/create", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v2", + "create" + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"api.content.create\",\n \"ver\": \"3.0\",\n \"ts\": \"2020-12-10T20:24:45ZZ\",\n \"params\": {\n \"resmsgid\": \"3be02c4b-3324-41a3-afd8-60f6be0584d2\",\n \"msgid\": null,\n \"err\": null,\n \"status\": \"successful\",\n \"errmsg\": null\n },\n \"responseCode\": \"OK\",\n \"result\": {\n \"identifier\": \"do_1131697204035993601314\",\n \"node_id\": \"do_1131697204035993601314\",\n \"versionKey\": \"1607631885207\"\n }\n}" + }, + { + "name": "'BAD REQUEST. The **Create Content** operation failed. You may have missed input for a mandatory parameter.'", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource.Possible media types can be:-\n - Application/json", + "key": "Content-Type", + "value": "ea laborum" + }, + { + "description": "(Required) Represents a physical location (e.g: state) uniquely to which the user belongs.", + "key": "x-channel-id", + "value": "ea laborum" + }, + { + "description": "(Required) Represents the authorized User ID to execute the API.", + "key": "X-Authenticated-User-Token", + "value": "ea laborum" + }, + { + "description": "(Required) To make use of the API, you require authorization. Raise a request to the administrator for the use of the API. You will receive the authorization key. Specify the key received, here.", + "key": "Authorization", + "value": "ea laborum" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"content\": {\n \"name\": \"H5P Content\",\n \"code\": \"h5pcontent\",\n \"mimeType\": \"application/vnd.ekstep.h5p-archive\",\n \"primaryCategory\": \"Resource\",\n \"createdBy\": \"874ed8a5-782e-4f6c-8f36-e0288455901e\"\n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/content/v2/create", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v2", + "create" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"api.content.create\",\n \"ver\": \"1.0\",\n \"ts\": \"2020-12-10T08:50:29.786Z\",\n \"params\": {\n \"resmsgid\": \"c169a7a0-3ac4-11eb-b0a2-8d5c9f561887\",\n \"msgid\": null,\n \"status\": \"failed\",\n \"err\": \"ERR_CONTENT_CREATE_FIELDS_MISSING\",\n \"errmsg\": \"Required fields for create content are missing\"\n },\n \"responseCode\": \"CLIENT_ERROR\",\n \"result\": {}\n}" + }, + { + "name": "'INTERNAL SERVER ERROR. We track these errors automatically and try to set it right at the earliest. Try refreshing the page. If the problem persists contact us at info@sunbird.org.'", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource.Possible media types can be:-\n - Application/json", + "key": "Content-Type", + "value": "ea laborum" + }, + { + "description": "(Required) Represents a physical location (e.g: state) uniquely to which the user belongs.", + "key": "x-channel-id", + "value": "ea laborum" + }, + { + "description": "(Required) Represents the authorized User ID to execute the API.", + "key": "X-Authenticated-User-Token", + "value": "ea laborum" + }, + { + "description": "(Required) To make use of the API, you require authorization. Raise a request to the administrator for the use of the API. You will receive the authorization key. Specify the key received, here.", + "key": "Authorization", + "value": "ea laborum" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"content\": {\n \"name\": \"H5P Content\",\n \"code\": \"h5pcontent\",\n \"mimeType\": \"application/vnd.ekstep.h5p-archive\",\n \"primaryCategory\": \"Resource\",\n \"createdBy\": \"874ed8a5-782e-4f6c-8f36-e0288455901e\"\n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/content/v2/create", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v2", + "create" + ] + } + }, + "status": "Internal Server Error", + "code": 500, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"api.content.create\",\n \"ver\": \"1.0\",\n \"ts\": \"2020-12-10T08:51:51.647Z\",\n \"params\": {\n \"resmsgid\": \"f234a6f0-3ac4-11eb-b0a2-8d5c9f561887\",\n \"msgid\": null,\n \"status\": \"failed\",\n \"err\": null,\n \"errmsg\": null\n },\n \"responseCode\": \"SERVER_ERROR\",\n \"result\": {}\n}" + } + ] + }, + { + "name": "Upload URL", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json();\r", + "\r", + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "pm.test(\"Status code name has string OK\", function () {\r", + " pm.response.to.have.status(\"OK\");\r", + "});\r", + "pm.test(\"id should be api.content.upload.url\", function () {\r", + " pm.expect(jsonResponse.id).to.eql(\"api.content.upload.url\");\r", + "});\r", + "pm.test(\"ver should be 4.0\", function () {\r", + " pm.expect(jsonResponse.ver).to.eql(\"4.0\");\r", + "});\r", + "\r", + "pm.test(\"Params has keys: resmsgid , msgid , err , status , errmsg \", () => {\r", + " pm.expect(jsonResponse.params).to.have.all.keys('resmsgid', 'msgid','err','status','errmsg');\r", + " pm.expect(jsonResponse.params.resmsgid).to.be.a(\"string\");\r", + " pm.expect(jsonResponse.params.msgid).to.be.a('null');\r", + " pm.expect(jsonResponse.params.err).to.be.a('null');\r", + " pm.expect(jsonResponse.params.status).to.be.a(\"string\");\r", + " pm.expect(jsonResponse.params.errmsg).to.be.a('null');\r", + "});\r", + "\r", + "pm.test(\"Status is successful\", function () {\r", + " pm.expect(jsonResponse.params.status).to.be.equal(\"successful\");\r", + "});\r", + "\r", + "pm.test(\"ResponseCode is OK\", function () {\r", + " pm.expect(jsonResponse.responseCode).to.be.equal(\"OK\");\r", + "});\r", + "\r", + "\r", + "pm.test(\"Verify keys and data type of the response result\", () => {\r", + " pm.expect(jsonResponse.result).to.have.all.keys('identifier', 'url_expiry', 'pre_signed_url');\r", + "});\r", + "pm.collectionVariables.set(\"pre_signed_URL\",jsonResponse.result.pre_signed_url );\r", + "console.log(pm.collectionVariables.get(\"pre_signed_URL\"));\r", + "\r", + "\r", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "apikey", + "apikey": [ + { + "key": "key", + "value": "Authorization", + "type": "string" + }, + { + "key": "value", + "value": "", + "type": "string" + }, + { + "key": "in", + "value": "header", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "description": "(Required) The Content Type entity is the media type of the resource.Possible media types can be:-\n - Application/json", + "key": "Content-Type", + "value": "application/json" + }, + { + "description": "(Required) The Registered User ID to execute the API.", + "key": "X-Authenticated-Userid", + "value": "ea laborum" + }, + { + "description": "(Required) All content APIs require authorization for use. Specify the authorization key received from the administrator when placing the request for use of the API.", + "key": "Authorization", + "value": "ea laborum" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"content\": {\n \"fileName\":\"test.pdf\"\n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/content/v4/upload/url/{{reject_content}}", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v4", + "upload", + "url", + "{{reject_content}}" + ] + }, + "description": "This API is associated with uploading content on the Sunbird Platform .\n - The**_/upload/url/{content Id}_** endpoint executes \"Upload Content URL\" request based on parameters provided as metadata in the request body.\n - The endpoint for **Upload Content URL** is `/content/v2/upload/url`\n - It points to knowledge-mw-service - `/v2/content/upload/url`\n - {...}refers to a section of upload endpoint URL path that needs to be replaced by appropriate Id.\n - You need to provide a valid content Id value in {Content Id} field of API URL.\n - On Success api returns pre-signed-url link with come configured ttl against which file can be uploaded.\n - It is mandatory to provide values for parameters marked with *.\n - Mandatory fields cannot be null or empty." + }, + "response": [ + { + "name": "OK ! Successful operation.\"Content upload\" operation was successfully executed.", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource.Possible media types can be:-\n - Application/json", + "key": "Content-Type", + "value": "ea laborum" + }, + { + "description": "(Required) The Registered User ID to execute the API.", + "key": "X-Authenticated-Userid", + "value": "ea laborum" + }, + { + "description": "(Required) All content APIs require authorization for use. Specify the authorization key received from the administrator when placing the request for use of the API.", + "key": "Authorization", + "value": "ea laborum" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"content\": {\n \"fileName\": \"test.pdf\"\n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/content/v2/upload/url/:Content_Id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v2", + "upload", + "url", + ":Content_Id" + ], + "variable": [ + { + "key": "Content_Id", + "value": "ea laborum", + "description": "(Required) Please append a valid Content Id To the Request URL" + } + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"api.content.upload.url\",\n \"ver\": \"3.0\",\n \"ts\": \"2020-12-11T23:52:44ZZ\",\n \"params\": {\n \"resmsgid\": \"81e308fa-3e36-45ff-b295-e28e8f757dc7\",\n \"msgid\": null,\n \"err\": null,\n \"status\": \"successful\",\n \"errmsg\": null\n },\n \"responseCode\": \"OK\",\n \"result\": {\n \"identifier\": \"do_11317053041892556811094\",\n \"url_expiry\": \"54000\",\n \"pre_signed_url\": \"https://sunbirddev.blob.core.windows.net/sunbird-content-dev/content/assets/do_11317053041892556811094/10-page-pdf.pdf?sv=2017-04-17&se=2020-12-12T14%3A52%3A44Z&sr=b&sp=w&sig=Tlt6uWI/6lMeupkEbsTAmGajmo1qzw8HeUHrVwOm6yk%3D\"\n }\n}" + }, + { + "name": "BAD REQUEST. The 'Upload Url' operation failed ! The possible reason for failure is that you may have missed providing input for a mandatory parameter.", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource.Possible media types can be:-\n - Application/json", + "key": "Content-Type", + "value": "ea laborum" + }, + { + "description": "(Required) The Registered User ID to execute the API.", + "key": "X-Authenticated-Userid", + "value": "ea laborum" + }, + { + "description": "(Required) All content APIs require authorization for use. Specify the authorization key received from the administrator when placing the request for use of the API.", + "key": "Authorization", + "value": "ea laborum" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"content\": {\n \"fileName\": \"test.pdf\"\n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/content/v2/upload/url/:Content_Id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v2", + "upload", + "url", + ":Content_Id" + ], + "variable": [ + { + "key": "Content_Id", + "value": "ea laborum", + "description": "(Required) Please append a valid Content Id To the Request URL" + } + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"api.content.upload.url\",\n \"ver\": \"3.0\",\n \"ts\": \"2020-12-11T23:54:07ZZ\",\n \"params\": {\n \"resmsgid\": \"4edde64d-3116-4271-bcc1-a8ba0ec2d56b\",\n \"msgid\": null,\n \"err\": \"ERR_CONTENT_BLANK_FILE_NAME\",\n \"status\": \"failed\",\n \"errmsg\": \"File name is blank\"\n },\n \"responseCode\": \"CLIENT_ERROR\",\n \"result\": {\n \"messages\": null\n }\n}" + }, + { + "name": "RESOURCE NOT FOUND,**Content Id sent for generating upload url** operation failed !The possible reason for failure is that you may have provided wrong content id.", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource.Possible media types can be:-\n - Application/json", + "key": "Content-Type", + "value": "ea laborum" + }, + { + "description": "(Required) The Registered User ID to execute the API.", + "key": "X-Authenticated-Userid", + "value": "ea laborum" + }, + { + "description": "(Required) All content APIs require authorization for use. Specify the authorization key received from the administrator when placing the request for use of the API.", + "key": "Authorization", + "value": "ea laborum" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"content\": {\n \"fileName\": \"test.pdf\"\n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/content/v2/upload/url/:Content_Id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v2", + "upload", + "url", + ":Content_Id" + ], + "variable": [ + { + "key": "Content_Id", + "value": "ea laborum", + "description": "(Required) Please append a valid Content Id To the Request URL" + } + ] + } + }, + "status": "Not Found", + "code": 404, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"api.upload.url\",\n \"ver\": \"1.0\",\n \"ts\": \"2020-12-11T23:48:26.694Z\",\n \"params\": {\n \"resmsgid\": \"5cf72660-3c0b-11eb-b0a2-8d5c9f561887\",\n \"msgid\": null,\n \"status\": \"failed\",\n \"err\": \"NOT_FOUND\",\n \"errmsg\": \"Error! Node(s) doesn't Exists. | [Invalid Node Id.]: do_11254577204586086415\"\n },\n \"responseCode\": \"RESOURCE_NOT_FOUND\",\n \"result\": {}\n}" + }, + { + "name": "INTERNAL SERVER ERROR ! Looks like something went wrong! These errors are tracked automatically, but if the problem persists feel free to contact us. In the meantime, try refreshing.", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource.Possible media types can be:-\n - Application/json", + "key": "Content-Type", + "value": "ea laborum" + }, + { + "description": "(Required) The Registered User ID to execute the API.", + "key": "X-Authenticated-Userid", + "value": "ea laborum" + }, + { + "description": "(Required) All content APIs require authorization for use. Specify the authorization key received from the administrator when placing the request for use of the API.", + "key": "Authorization", + "value": "ea laborum" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"content\": {\n \"fileName\": \"test.pdf\"\n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/content/v2/upload/url/:Content_Id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v2", + "upload", + "url", + ":Content_Id" + ], + "variable": [ + { + "key": "Content_Id", + "value": "ea laborum", + "description": "(Required) Please append a valid Content Id To the Request URL" + } + ] + } + }, + "status": "Internal Server Error", + "code": 500, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"result\": {},\n \"id\": \"cupidatat reprehenderit dolor\",\n \"ver\": \"minim anim commodo\",\n \"ts\": \"commodo\",\n \"params\": {\n \"resmsgid\": \"pariatur repre\",\n \"msgid\": \"irure\",\n \"err\": \"consequat esse ea\",\n \"status\": \"esse\",\n \"errmsg\": \"aliqua laboris velit\"\n },\n \"responseCode\": \"reprehenderit dolor elit sunt dolore\"\n}" + } + ] + }, + { + "name": "Upload file to the URL", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 201\", function () {\r", + " pm.response.to.have.status(201);\r", + "});\r", + "\r", + "var fullUrl= pm.collectionVariables.get(\"pre_signed_URL\");\r", + "\r", + "// Find the index of '?' to get the position of the query parameters\r", + "var indexOfQuestionMark = fullUrl.indexOf('?');\r", + "\r", + "// Extract the partial URL without the query parameters\r", + "var partialUrl = indexOfQuestionMark !== -1 ? fullUrl.slice(0, indexOfQuestionMark) : fullUrl;\r", + "pm.collectionVariables.set(\"partial_URL\", partialUrl);\r", + "// Log the partial URL to the console (you can remove this line if not needed)\r", + "console.log(pm.collectionVariables.get(\"partial_URL\"));\r", + "\r", + "// Now you can use the 'partialUrl' variable in Postman as needed\r", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "PUT", + "header": [ + { + "key": "X-Ms-Blob-Type", + "value": "BlockBlob" + } + ], + "body": { + "mode": "formdata", + "formdata": [ + { + "key": "file", + "type": "file", + "src": "/C:/Users/Qualitrix/Downloads/pdf_233.pdf" + } + ] + }, + "url": { + "raw": "{{pre_signed_URL}}", + "host": [ + "{{pre_signed_URL}}" + ] + } + }, + "response": [] + }, + { + "name": "Update the content with URL and mime type", + "event": [ + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + }, + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json();\r", + "\r", + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "pm.test(\"Status code name has string OK\", function () {\r", + " pm.response.to.have.status(\"OK\");\r", + "});\r", + "pm.test(\"id should be api.content.upload\", function () {\r", + " pm.expect(jsonResponse.id).to.eql(\"api.content.upload\");\r", + "});\r", + "pm.test(\"ver should be 4.0\", function () {\r", + " pm.expect(jsonResponse.ver).to.eql(\"4.0\");\r", + "});\r", + "\r", + "pm.test(\"Params has keys: resmsgid , msgid , err , status , errmsg \", () => {\r", + " pm.expect(jsonResponse.params).to.have.all.keys('resmsgid', 'msgid','err','status','errmsg');\r", + " pm.expect(jsonResponse.params.resmsgid).to.be.a(\"string\");\r", + " pm.expect(jsonResponse.params.msgid).to.be.a('null');\r", + " pm.expect(jsonResponse.params.err).to.be.a('null');\r", + " pm.expect(jsonResponse.params.status).to.be.a(\"string\");\r", + " pm.expect(jsonResponse.params.errmsg).to.be.a('null');\r", + "});\r", + "\r", + "pm.test(\"Status is successful\", function () {\r", + " pm.expect(jsonResponse.params.status).to.be.equal(\"successful\");\r", + "});\r", + "\r", + "pm.test(\"ResponseCode is OK\", function () {\r", + " pm.expect(jsonResponse.responseCode).to.be.equal(\"OK\");\r", + "});\r", + "\r", + "pm.test(\"Result has keys: identifier , artifactUrl , content_url , node_id , versionKey \", () => {\r", + " pm.expect(jsonResponse.result).to.have.all.keys('identifier', 'artifactUrl','content_url','node_id','versionKey');\r", + " pm.expect(jsonResponse.result.identifier).to.be.a(\"string\");\r", + " pm.expect(jsonResponse.result.artifactUrl).to.be.a(\"string\");\r", + " pm.expect(jsonResponse.result.content_url).to.be.a(\"string\");\r", + " pm.expect(jsonResponse.result.node_id).to.be.a(\"string\");\r", + " pm.expect(jsonResponse.result.versionKey).to.be.a(\"string\");\r", + "});\r", + "\r", + "pm.test(`artifactUrl should be: ${pm.collectionVariables.get(\"partial_URL\")}`, function () {\r", + " pm.expect(jsonResponse.result.artifactUrl).to.be.equal(`${pm.collectionVariables.get(\"partial_URL\")}`);\r", + "});\r", + "\r", + "pm.test(`content_url should be: ${pm.collectionVariables.get(\"partial_URL\")}`, function () {\r", + " pm.expect(jsonResponse.result.content_url).to.be.equal(`${pm.collectionVariables.get(\"partial_URL\")}`);\r", + "});\r", + "\r", + "pm.test(`identifier should be: ${pm.collectionVariables.get(\"reject_content\")}`, function () {\r", + " pm.expect(jsonResponse.result.identifier).to.be.equal(`${pm.collectionVariables.get(\"reject_content\")}`);\r", + "});\r", + "\r", + "pm.test(`node_id should be: ${pm.collectionVariables.get(\"reject_content\")}`, function () {\r", + " pm.expect(jsonResponse.result.node_id).to.be.equal(`${pm.collectionVariables.get(\"reject_content\")}`);\r", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "user-id", + "value": "mahesh" + }, + { + "key": "Cookie", + "value": "connect.sid=s%3AnLNdCeYI27WUkZBIFdX1J5MKTM6ISEdJ.SFTq%2FeT2cVLh5TSEWmwZPCekWDSeNXILHPDyziKa26E" + }, + { + "key": "X-Channel-Id", + "value": "0137541424673095687" + }, + { + "key": "X-Authenticated-User-token", + "value": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImtpZCI6ImFjY2Vzc3YxX2tleTEifQ.eyJhdWQiOiJodHRwczovL2Rldi5zdW5iaXJkZWQub3JnL2F1dGgvcmVhbG1zL3N1bmJpcmQiLCJzdWIiOiJmOjVhOGEzZjJiLTM0MDktNDJlMC05MDAxLWY5MTNiYzBmZGUzMToxNTVjZTNjNS03MTNlLTQ3NDktYmMxYy05NWQwOWM2NDA5MTQiLCJyb2xlcyI6W3sicm9sZSI6IkNPTlRFTlRfQ1JFQVRPUiIsInNjb3BlIjpbeyJvcmdhbmlzYXRpb25JZCI6IjAxMzc1NDE0MjQ2NzMwOTU2ODcifV19LHsicm9sZSI6IkNPVVJTRV9NRU5UT1IiLCJzY29wZSI6W3sib3JnYW5pc2F0aW9uSWQiOiIwMTM3NTQxNDI0NjczMDk1Njg3In1dfSx7InJvbGUiOiJQVUJMSUMiLCJzY29wZSI6W119XSwiaXNzIjoiaHR0cHM6Ly9kZXYuc3VuYmlyZGVkLm9yZy9hdXRoL3JlYWxtcy9zdW5iaXJkIiwibmFtZSI6ImNvbnRlbnRDcmVhdG9yIiwidHlwIjoiQmVhcmVyIiwiZXhwIjoxNzAyMzI0NjU0LCJpYXQiOjE3MDIyODE0NTR9.MxiIhP6YJmI1XbozLNoJeQAbdQKs597f2mlNHWcJ-ZZIXvBx4BcX7T57B5xXGIT6LJ6YlS86saiG6SXHIG5ptgICphdefNysfVgkSUmqTsgzfzvjp2lzIw8Re7xi735Kd7B612y5Tkswm0ETP7NIeQ7-Tc_3h37GV04ISfx0LMD75UvgllxcDz91Bl6N3-WN4KwCeKIfJ-iZj-EJLwoBmJjGsgNCNTn5DTzF_joFcyett__WVc14Ex-BqRSq8Hr2fMVoHpNXze3QUJ7PcD4JRY2Ywg5R9VkHz3mkhY9kI1cWeHdQypeSsM8niQK1XCWJz_aTqsP35MshDnHkWhmDyg" + }, + { + "key": "Authorization", + "value": "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiIzZGNjMzY3OWIwYTE0NmU2YWYyZjlmZDA5NWU5NTlkNCJ9.0NZhX5sqUNy-GZUya90aQFkr5ZNiqfOuELYz_IvoyS8" + } + ], + "body": { + "mode": "formdata", + "formdata": [ + { + "key": "fileUrl", + "value": "{{partial_URL}}", + "type": "text" + }, + { + "key": "mimeType", + "value": "application/pdf", + "type": "text" + } + ] + }, + "url": { + "raw": "{{host}}/content/v4/upload/{{reject_content}}", + "host": [ + "{{host}}" + ], + "path": [ + "content", + "v4", + "upload", + "{{reject_content}}" + ] + } + }, + "response": [] + }, + { + "name": "Submit for Review Copy", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json();\r", + "\r", + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "pm.test(\"Status code name has string OK\", function () {\r", + " pm.response.to.have.status(\"OK\");\r", + "});\r", + "pm.test(\"id should be api.content.review\", function () {\r", + " pm.expect(jsonResponse.id).to.eql(\"api.content.review\");\r", + "});\r", + "pm.test(\"ver should be 4.0\", function () {\r", + " pm.expect(jsonResponse.ver).to.eql(\"4.0\");\r", + "});\r", + "\r", + "pm.test(\"Params has keys: resmsgid , msgid , err , status , errmsg \", () => {\r", + " pm.expect(jsonResponse.params).to.have.all.keys('resmsgid', 'msgid','err','status','errmsg');\r", + " pm.expect(jsonResponse.params.resmsgid).to.be.a(\"string\");\r", + " pm.expect(jsonResponse.params.msgid).to.be.a('null');\r", + " pm.expect(jsonResponse.params.err).to.be.a('null');\r", + " pm.expect(jsonResponse.params.status).to.be.a(\"string\");\r", + " pm.expect(jsonResponse.params.errmsg).to.be.a('null');\r", + "});\r", + "\r", + "pm.test(\"Status is successful\", function () {\r", + " pm.expect(jsonResponse.params.status).to.be.equal(\"successful\");\r", + "});\r", + "\r", + "pm.test(\"ResponseCode is OK\", function () {\r", + " pm.expect(jsonResponse.responseCode).to.be.equal(\"OK\");\r", + "});\r", + "pm.test(\"Result has keys: identifier , versionKey\", () => {\r", + " pm.expect(jsonResponse.result).to.have.all.keys('identifier','versionKey');\r", + " pm.expect(jsonResponse.result.identifier).to.be.a(\"string\");\r", + " pm.expect(jsonResponse.result.versionKey).to.be.a(\"string\");\r", + "});\r", + "\r", + "pm.test(`identifier should be: ${pm.collectionVariables.get(\"reject_content\")}`, function () {\r", + " pm.expect(jsonResponse.result.identifier).to.be.equal(`${pm.collectionVariables.get(\"reject_content\")}`);\r", + "});\r", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "apikey", + "apikey": [ + { + "key": "value", + "value": "{{auth_token}}", + "type": "string" + }, + { + "key": "key", + "value": "Authorization", + "type": "string" + }, + { + "key": "in", + "value": "header", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "description": "(Required) The Content Type entity is the media type of the resource.Possible media types can be:-\n - Application/json", + "key": "Content-Type", + "value": "application/json" + }, + { + "description": "(Required) The Registered User ID to execute the API.", + "key": "X-Authenticated-User-token", + "value": "ea laborum" + }, + { + "description": "(Required) All content APIs require authorization for use. Specify the authorization key received from the administrator when placing the request for use of the API.", + "key": "Authorization", + "value": "ea laborum" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/content/v4/review/{{reject_content}}", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v4", + "review", + "{{reject_content}}" + ] + }, + "description": ">- This API is associated with Submission of content for Review on the Sunbird Platform .\n - The**_/review/{content Id}_** endpoint executes \"Submit for Review\" request based on parameters provided as metadata in the request body.\n - The endpoint for **Review Content** is `/content/v2/review`\n - It points to knowledge-mw-service - `/v2/content/review`\n - {...}refers to a section of review endpoint URL path that needs to be replaced by appropriate Id.\n - You need to provide a valid content Id value in {Content Id} field of API URL.\n - It is mandatory to provide values for parameters marked with *.\n - Mandatory fields cannot be null or empty." + }, + "response": [ + { + "name": "OK ! Successful operation.Content sent for review operation was successfully executed.", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource.Possible media types can be:-\n - Application/json", + "key": "Content-Type", + "value": "ea laborum" + }, + { + "description": "(Required) The Registered User ID to execute the API.", + "key": "X-Authenticated-User-token", + "value": "ea laborum" + }, + { + "description": "(Required) All content APIs require authorization for use. Specify the authorization key received from the administrator when placing the request for use of the API.", + "key": "Authorization", + "value": "ea laborum" + } + ], + "body": { + "mode": "raw", + "raw": "{}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/content/v2/review/:Content_Id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v2", + "review", + ":Content_Id" + ], + "variable": [ + { + "key": "Content_Id", + "value": "ea laborum", + "description": "(Required) Please append a valid Content Id To the Request URL" + } + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"ekstep.learning.content.review\",\n \"ver\": \"3.0\",\n \"ts\": \"2020-12-10T21:06:26ZZ\",\n \"params\": {\n \"resmsgid\": \"186cf9a9-8094-4cdd-926f-b77a030921d1\",\n \"msgid\": null,\n \"err\": null,\n \"status\": \"successful\",\n \"errmsg\": null\n },\n \"responseCode\": \"OK\",\n \"result\": {\n \"node_id\": \"do_1131697376667402241315\",\n \"versionKey\": \"1607634386533\"\n }\n}" + }, + { + "name": "RESOURCE NOT FOUND,**Content Send for Review** operation failed !The possible reason for failure is that you may have provided wrong content id.", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource.Possible media types can be:-\n - Application/json", + "key": "Content-Type", + "value": "ea laborum" + }, + { + "description": "(Required) The Registered User ID to execute the API.", + "key": "X-Authenticated-User-token", + "value": "ea laborum" + }, + { + "description": "(Required) All content APIs require authorization for use. Specify the authorization key received from the administrator when placing the request for use of the API.", + "key": "Authorization", + "value": "ea laborum" + } + ], + "body": { + "mode": "raw", + "raw": "{}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/content/v2/review/:Content_Id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v2", + "review", + ":Content_Id" + ], + "variable": [ + { + "key": "Content_Id", + "value": "ea laborum", + "description": "(Required) Please append a valid Content Id To the Request URL" + } + ] + } + }, + "status": "Not Found", + "code": 404, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"ekstep.learning.content.review\",\n \"ver\": \"3.0\",\n \"ts\": \"2020-12-10T21:06:54ZZ\",\n \"params\": {\n \"resmsgid\": \"944ac944-78d9-43e2-bfd5-337ab52b6552\",\n \"msgid\": null,\n \"err\": \"ERR_TAXONOMY_INVALID_CONTENT\",\n \"status\": \"failed\",\n \"errmsg\": \"Error! While Fetching the Content for Operation | [Content Id: do_11316973766674022413151]\"\n },\n \"responseCode\": \"CLIENT_ERROR\",\n \"result\": {}\n}" + }, + { + "name": "INTERNAL SERVER ERROR ! Looks like something went wrong! We track these errors automatically, but if the problem persists feel free to contact us. In the meantime, try refreshing.", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource.Possible media types can be:-\n - Application/json", + "key": "Content-Type", + "value": "ea laborum" + }, + { + "description": "(Required) The Registered User ID to execute the API.", + "key": "X-Authenticated-User-token", + "value": "ea laborum" + }, + { + "description": "(Required) All content APIs require authorization for use. Specify the authorization key received from the administrator when placing the request for use of the API.", + "key": "Authorization", + "value": "ea laborum" + } + ], + "body": { + "mode": "raw", + "raw": "{}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/content/v2/review/:Content_Id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v2", + "review", + ":Content_Id" + ], + "variable": [ + { + "key": "Content_Id", + "value": "ea laborum", + "description": "(Required) Please append a valid Content Id To the Request URL" + } + ] + } + }, + "status": "Internal Server Error", + "code": 500, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"result\": {},\n \"id\": \"cupidatat reprehenderit dolor\",\n \"ver\": \"minim anim commodo\",\n \"ts\": \"commodo\",\n \"params\": {\n \"resmsgid\": \"pariatur repre\",\n \"msgid\": \"irure\",\n \"err\": \"consequat esse ea\",\n \"status\": \"esse\",\n \"errmsg\": \"aliqua laboris velit\"\n },\n \"responseCode\": \"reprehenderit dolor elit sunt dolore\"\n}" + } + ] + } + ] + }, + { + "name": "Positive", + "item": [ + { + "name": "Reject Valid Content during review", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json();\r", + "\r", + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "pm.test(\"Status code name has string OK\", function () {\r", + " pm.response.to.have.status(\"OK\");\r", + "});\r", + "pm.test(\"id should be api.content.review.reject\", function () {\r", + " pm.expect(jsonResponse.id).to.eql(\"api.content.review.reject\");\r", + "});\r", + "pm.test(\"ver should be 4.0\", function () {\r", + " pm.expect(jsonResponse.ver).to.eql(\"4.0\");\r", + "});\r", + "\r", + "pm.test(\"Params has keys: resmsgid , msgid , err , status , errmsg \", () => {\r", + " pm.expect(jsonResponse.params).to.have.all.keys('resmsgid', 'msgid','err','status','errmsg');\r", + " pm.expect(jsonResponse.params.resmsgid).to.be.a(\"string\");\r", + " pm.expect(jsonResponse.params.msgid).to.be.a('null');\r", + " pm.expect(jsonResponse.params.err).to.be.a('null');\r", + " pm.expect(jsonResponse.params.status).to.be.a(\"string\");\r", + " pm.expect(jsonResponse.params.errmsg).to.be.a('null');\r", + "});\r", + "\r", + "pm.test(\"Status is successful\", function () {\r", + " pm.expect(jsonResponse.params.status).to.be.equal(\"successful\");\r", + "});\r", + "\r", + "pm.test(\"ResponseCode is OK\", function () {\r", + " pm.expect(jsonResponse.responseCode).to.be.equal(\"OK\");\r", + "});\r", + "pm.test(\"Result has keys: identifier , node_id \", () => {\r", + " pm.expect(jsonResponse.result).to.have.all.keys('identifier', 'node_id');\r", + " pm.expect(jsonResponse.result.identifier).to.be.a(\"string\");\r", + " pm.expect(jsonResponse.result.node_id).to.be.a(\"string\");\r", + "});\r", + "\r", + "pm.test(`identifier should be: ${pm.collectionVariables.get(\"reject_content\")}`, function () {\r", + " pm.expect(jsonResponse.result.identifier).to.be.equal(`${pm.collectionVariables.get(\"reject_content\")}`);\r", + "});\r", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "apikey", + "apikey": [ + { + "key": "key", + "value": "Authorization", + "type": "string" + }, + { + "key": "value", + "value": "", + "type": "string" + }, + { + "key": "in", + "value": "header", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "description": "(Required) The Content Type entity is the media type of the resource.Possible media types can be:-\n - Application/json", + "key": "Content-Type", + "value": "application/json" + }, + { + "description": "(Required) The Registered User ID to execute the API.", + "key": "X-Authenticated-User-Token", + "value": "ea laborum" + }, + { + "description": "(Required) All content APIs require authorization for use. Specify the authorization key received from the administrator when placing the request for use of the API.", + "key": "Authorization", + "value": "ea laborum" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/content/v4/reject/{{reject_content}}", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v4", + "reject", + "{{reject_content}}" + ] + }, + "description": "This API is associated with rejecting content under review.\n - The **_/reject/{contentId}_** endpoint executes request for rejecting content which is under review.\n - The endpoint for **Reject Content** is `/content/v2/reject`\n - It points to knowledge-mw-service - `/v2/content/reject`\n - {...}refers to a section of reject endpoint URL path that needs to be replaced by appropriate Id.\n - You need to provide a valid content Id value in {Content Id} field of API URL.\n - It is mandatory to provide values for parameters marked with *.\n - Mandatory fields cannot be null or empty." + }, + "response": [ + { + "name": "OK ! Successful operation.\"Content reject\" operation was successfully executed.", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource.Possible media types can be:-\n - Application/json", + "key": "Content-Type", + "value": "ea laborum" + }, + { + "description": "(Required) The Registered User ID to execute the API.", + "key": "X-Authenticated-User-Token", + "value": "ea laborum" + }, + { + "description": "(Required) All content APIs require authorization for use. Specify the authorization key received from the administrator when placing the request for use of the API.", + "key": "Authorization", + "value": "ea laborum" + } + ], + "body": { + "mode": "raw", + "raw": "{}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/content/v2/reject/:Content_Id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v2", + "reject", + ":Content_Id" + ], + "variable": [ + { + "key": "Content_Id", + "value": "ea laborum", + "description": "(Required) Please append a valid Content Id To the Request URL" + } + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"api.v3.reject\",\n \"ver\": \"1.0\",\n \"ts\": \"2020-12-11T08:09:46.451Z\",\n \"params\": {\n \"resmsgid\": \"3b7c1230-3b88-11eb-b0a2-8d5c9f561887\",\n \"msgid\": \"3b692670-3b88-11eb-b0a2-8d5c9f561887\",\n \"status\": \"successful\",\n \"err\": null,\n \"errmsg\": null\n },\n \"responseCode\": \"OK\",\n \"result\": {\n \"node_id\": \"do_213168073757138944196\",\n \"versionKey\": \"1607674186357\"\n }\n}" + }, + { + "name": "ERROR CONTENT NOT IN REVIEW STATUS ! Looks like contentId provided is not in review status.", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource.Possible media types can be:-\n - Application/json", + "key": "Content-Type", + "value": "ea laborum" + }, + { + "description": "(Required) The Registered User ID to execute the API.", + "key": "X-Authenticated-User-Token", + "value": "ea laborum" + }, + { + "description": "(Required) All content APIs require authorization for use. Specify the authorization key received from the administrator when placing the request for use of the API.", + "key": "Authorization", + "value": "ea laborum" + } + ], + "body": { + "mode": "raw", + "raw": "{}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/content/v2/reject/:Content_Id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v2", + "reject", + ":Content_Id" + ], + "variable": [ + { + "key": "Content_Id", + "value": "ea laborum", + "description": "(Required) Please append a valid Content Id To the Request URL" + } + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"api.v3.reject\",\n \"ver\": \"1.0\",\n \"ts\": \"2020-12-11T08:03:51.807Z\",\n \"params\": {\n \"resmsgid\": \"6819b0f0-3b87-11eb-b0a2-8d5c9f561887\",\n \"msgid\": null,\n \"status\": \"failed\",\n \"err\": \"ERR_CONTENT_NOT_IN_REVIEW\",\n \"errmsg\": \"Content is not in review state for identifier: do_2131680942619115521243\"\n },\n \"responseCode\": \"CLIENT_ERROR\",\n \"result\": {}\n}" + }, + { + "name": "RESOURCE NOT FOUND ! Looks like contentId provided is not a valid content.", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource.Possible media types can be:-\n - Application/json", + "key": "Content-Type", + "value": "ea laborum" + }, + { + "description": "(Required) The Registered User ID to execute the API.", + "key": "X-Authenticated-User-Token", + "value": "ea laborum" + }, + { + "description": "(Required) All content APIs require authorization for use. Specify the authorization key received from the administrator when placing the request for use of the API.", + "key": "Authorization", + "value": "ea laborum" + } + ], + "body": { + "mode": "raw", + "raw": "{}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/content/v2/reject/:Content_Id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v2", + "reject", + ":Content_Id" + ], + "variable": [ + { + "key": "Content_Id", + "value": "ea laborum", + "description": "(Required) Please append a valid Content Id To the Request URL" + } + ] + } + }, + "status": "Not Found", + "code": 404, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"api.v3.reject\",\n \"ver\": \"1.0\",\n \"ts\": \"2020-12-11T08:08:30.454Z\",\n \"params\": {\n \"resmsgid\": \"0e2fd960-3b88-11eb-b0a2-8d5c9f561887\",\n \"msgid\": null,\n \"status\": \"failed\",\n \"err\": \"NOT_FOUND\",\n \"errmsg\": \"Error! Node(s) doesn't Exists. | [Invalid Node Id.]: do_2123462720305561601147\"\n },\n \"responseCode\": \"RESOURCE_NOT_FOUND\",\n \"result\": {}\n}" + }, + { + "name": "INTERNAL SERVER ERROR ! Looks like something went wrong! These errors are tracked automatically, but if the problem persists feel free to contact us. In the meantime, try refreshing.", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource.Possible media types can be:-\n - Application/json", + "key": "Content-Type", + "value": "ea laborum" + }, + { + "description": "(Required) The Registered User ID to execute the API.", + "key": "X-Authenticated-User-Token", + "value": "ea laborum" + }, + { + "description": "(Required) All content APIs require authorization for use. Specify the authorization key received from the administrator when placing the request for use of the API.", + "key": "Authorization", + "value": "ea laborum" + } + ], + "body": { + "mode": "raw", + "raw": "{}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/content/v2/reject/:Content_Id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v2", + "reject", + ":Content_Id" + ], + "variable": [ + { + "key": "Content_Id", + "value": "ea laborum", + "description": "(Required) Please append a valid Content Id To the Request URL" + } + ] + } + }, + "status": "Internal Server Error", + "code": 500, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"result\": {},\n \"id\": \"cupidatat reprehenderit dolor\",\n \"ver\": \"minim anim commodo\",\n \"ts\": \"commodo\",\n \"params\": {\n \"resmsgid\": \"pariatur repre\",\n \"msgid\": \"irure\",\n \"err\": \"consequat esse ea\",\n \"status\": \"esse\",\n \"errmsg\": \"aliqua laboris velit\"\n },\n \"responseCode\": \"reprehenderit dolor elit sunt dolore\"\n}" + } + ] + } + ] + }, + { + "name": "Negative", + "item": [ + { + "name": "Reject invalid Content during review", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json()\r", + "\r", + "//Verification\r", + "pm.test(\"Status code is 404\", function () {\r", + " pm.response.to.have.status(404)\r", + "});\r", + "pm.test(\"Params has keys: resmsgid , msgid , err , status , errmsg \", () => {\r", + " pm.expect(jsonResponse.params).to.have.all.keys('resmsgid', 'msgid','err','status','errmsg');\r", + " pm.expect(jsonResponse.params.resmsgid).to.be.a(\"string\");\r", + " pm.expect(jsonResponse.params.msgid).to.be.a('null');\r", + " pm.expect(jsonResponse.params.err).to.be.a('string');\r", + " pm.expect(jsonResponse.params.status).to.be.a(\"string\");\r", + " pm.expect(jsonResponse.params.errmsg).to.be.a('string');\r", + "});\r", + "//code name contains a string\r", + "tests[\"Status code name has string \\\"Not Found\\\"\"] = responseCode.name.has(\"Not Found\");\r", + "\r", + "pm.test(\"Test data type of the response and keys\", () => {\r", + " pm.expect(jsonResponse.result).to.be.an(\"object\");\r", + " pm.expect(jsonResponse.result).to.have.all.keys('messages');\r", + " pm.expect(jsonResponse.result.messages).to.be.null;\r", + "});\r", + "\r", + "//Validation\r", + "// Response body\r", + "pm.test(\"id should be api.content.review.reject\", () => {\r", + " pm.expect(jsonResponse.id).to.eql(\"api.content.review.reject\");\r", + "});\r", + "pm.test(\"ver should be 4.0\", () => {\r", + " pm.expect(jsonResponse.ver).to.eql(\"4.0\");\r", + "});\r", + "pm.test(\"responseCode should be RESOURCE_NOT_FOUND\", () => {\r", + " pm.expect(jsonResponse.responseCode).to.eql(\"RESOURCE_NOT_FOUND\");\r", + "});\r", + "\r", + "// Params\r", + "pm.test(\"params.err should be \\\"NOT_FOUND\\\"\", () => {\r", + " pm.expect(jsonResponse.params.err).to.eql(\"NOT_FOUND\");\r", + "});\r", + "pm.test(\"params.status should be \\\"failed\\\"\", () => {\r", + " pm.expect(jsonResponse.params.status).to.eql(\"failed\");\r", + "});\r", + "pm.test(`Error! Node(s) doesn't Exists. | [Invalid Node Id.]: dummy`, () => {\r", + " pm.expect(jsonResponse.params.errmsg).to.eql(`Error! Node(s) doesn't Exists. | [Invalid Node Id.]: dummy`);\r", + "});\r", + "// Result\r", + "pm.test(\"messages should be null\", () => {\r", + " pm.expect(jsonResponse.result.messages).to.eql(null);\r", + "});\r", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "apikey", + "apikey": [ + { + "key": "key", + "value": "Authorization", + "type": "string" + }, + { + "key": "value", + "value": "", + "type": "string" + }, + { + "key": "in", + "value": "header", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "description": "(Required) The Content Type entity is the media type of the resource.Possible media types can be:-\n - Application/json", + "key": "Content-Type", + "value": "application/json" + }, + { + "description": "(Required) The Registered User ID to execute the API.", + "key": "X-Authenticated-User-Token", + "value": "ea laborum" + }, + { + "description": "(Required) All content APIs require authorization for use. Specify the authorization key received from the administrator when placing the request for use of the API.", + "key": "Authorization", + "value": "ea laborum" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/content/v4/reject/dummy", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v4", + "reject", + "dummy" + ] + }, + "description": "This API is associated with rejecting content under review.\n - The **_/reject/{contentId}_** endpoint executes request for rejecting content which is under review.\n - The endpoint for **Reject Content** is `/content/v2/reject`\n - It points to knowledge-mw-service - `/v2/content/reject`\n - {...}refers to a section of reject endpoint URL path that needs to be replaced by appropriate Id.\n - You need to provide a valid content Id value in {Content Id} field of API URL.\n - It is mandatory to provide values for parameters marked with *.\n - Mandatory fields cannot be null or empty." + }, + "response": [ + { + "name": "OK ! Successful operation.\"Content reject\" operation was successfully executed.", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource.Possible media types can be:-\n - Application/json", + "key": "Content-Type", + "value": "ea laborum" + }, + { + "description": "(Required) The Registered User ID to execute the API.", + "key": "X-Authenticated-User-Token", + "value": "ea laborum" + }, + { + "description": "(Required) All content APIs require authorization for use. Specify the authorization key received from the administrator when placing the request for use of the API.", + "key": "Authorization", + "value": "ea laborum" + } + ], + "body": { + "mode": "raw", + "raw": "{}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/content/v2/reject/:Content_Id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v2", + "reject", + ":Content_Id" + ], + "variable": [ + { + "key": "Content_Id", + "value": "ea laborum", + "description": "(Required) Please append a valid Content Id To the Request URL" + } + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"api.v3.reject\",\n \"ver\": \"1.0\",\n \"ts\": \"2020-12-11T08:09:46.451Z\",\n \"params\": {\n \"resmsgid\": \"3b7c1230-3b88-11eb-b0a2-8d5c9f561887\",\n \"msgid\": \"3b692670-3b88-11eb-b0a2-8d5c9f561887\",\n \"status\": \"successful\",\n \"err\": null,\n \"errmsg\": null\n },\n \"responseCode\": \"OK\",\n \"result\": {\n \"node_id\": \"do_213168073757138944196\",\n \"versionKey\": \"1607674186357\"\n }\n}" + }, + { + "name": "ERROR CONTENT NOT IN REVIEW STATUS ! Looks like contentId provided is not in review status.", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource.Possible media types can be:-\n - Application/json", + "key": "Content-Type", + "value": "ea laborum" + }, + { + "description": "(Required) The Registered User ID to execute the API.", + "key": "X-Authenticated-User-Token", + "value": "ea laborum" + }, + { + "description": "(Required) All content APIs require authorization for use. Specify the authorization key received from the administrator when placing the request for use of the API.", + "key": "Authorization", + "value": "ea laborum" + } + ], + "body": { + "mode": "raw", + "raw": "{}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/content/v2/reject/:Content_Id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v2", + "reject", + ":Content_Id" + ], + "variable": [ + { + "key": "Content_Id", + "value": "ea laborum", + "description": "(Required) Please append a valid Content Id To the Request URL" + } + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"api.v3.reject\",\n \"ver\": \"1.0\",\n \"ts\": \"2020-12-11T08:03:51.807Z\",\n \"params\": {\n \"resmsgid\": \"6819b0f0-3b87-11eb-b0a2-8d5c9f561887\",\n \"msgid\": null,\n \"status\": \"failed\",\n \"err\": \"ERR_CONTENT_NOT_IN_REVIEW\",\n \"errmsg\": \"Content is not in review state for identifier: do_2131680942619115521243\"\n },\n \"responseCode\": \"CLIENT_ERROR\",\n \"result\": {}\n}" + }, + { + "name": "RESOURCE NOT FOUND ! Looks like contentId provided is not a valid content.", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource.Possible media types can be:-\n - Application/json", + "key": "Content-Type", + "value": "ea laborum" + }, + { + "description": "(Required) The Registered User ID to execute the API.", + "key": "X-Authenticated-User-Token", + "value": "ea laborum" + }, + { + "description": "(Required) All content APIs require authorization for use. Specify the authorization key received from the administrator when placing the request for use of the API.", + "key": "Authorization", + "value": "ea laborum" + } + ], + "body": { + "mode": "raw", + "raw": "{}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/content/v2/reject/:Content_Id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v2", + "reject", + ":Content_Id" + ], + "variable": [ + { + "key": "Content_Id", + "value": "ea laborum", + "description": "(Required) Please append a valid Content Id To the Request URL" + } + ] + } + }, + "status": "Not Found", + "code": 404, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"api.v3.reject\",\n \"ver\": \"1.0\",\n \"ts\": \"2020-12-11T08:08:30.454Z\",\n \"params\": {\n \"resmsgid\": \"0e2fd960-3b88-11eb-b0a2-8d5c9f561887\",\n \"msgid\": null,\n \"status\": \"failed\",\n \"err\": \"NOT_FOUND\",\n \"errmsg\": \"Error! Node(s) doesn't Exists. | [Invalid Node Id.]: do_2123462720305561601147\"\n },\n \"responseCode\": \"RESOURCE_NOT_FOUND\",\n \"result\": {}\n}" + }, + { + "name": "INTERNAL SERVER ERROR ! Looks like something went wrong! These errors are tracked automatically, but if the problem persists feel free to contact us. In the meantime, try refreshing.", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource.Possible media types can be:-\n - Application/json", + "key": "Content-Type", + "value": "ea laborum" + }, + { + "description": "(Required) The Registered User ID to execute the API.", + "key": "X-Authenticated-User-Token", + "value": "ea laborum" + }, + { + "description": "(Required) All content APIs require authorization for use. Specify the authorization key received from the administrator when placing the request for use of the API.", + "key": "Authorization", + "value": "ea laborum" + } + ], + "body": { + "mode": "raw", + "raw": "{}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/content/v2/reject/:Content_Id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v2", + "reject", + ":Content_Id" + ], + "variable": [ + { + "key": "Content_Id", + "value": "ea laborum", + "description": "(Required) Please append a valid Content Id To the Request URL" + } + ] + } + }, + "status": "Internal Server Error", + "code": 500, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"result\": {},\n \"id\": \"cupidatat reprehenderit dolor\",\n \"ver\": \"minim anim commodo\",\n \"ts\": \"commodo\",\n \"params\": {\n \"resmsgid\": \"pariatur repre\",\n \"msgid\": \"irure\",\n \"err\": \"consequat esse ea\",\n \"status\": \"esse\",\n \"errmsg\": \"aliqua laboris velit\"\n },\n \"responseCode\": \"reprehenderit dolor elit sunt dolore\"\n}" + } + ] + } + ] + } + ] + }, + { + "name": "Retire Content", + "item": [ + { + "name": "Pre requisite", + "item": [ + { + "name": "Create Content", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json();\r", + "\r", + "pm.collectionVariables.set(\"retire_content\", jsonResponse.result.identifier);\r", + "console.log(pm.collectionVariables.get(\"retire_content\"));\r", + "\r", + "" + ], + "type": "text/javascript" + } + } + ], + "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}}" + }, + { + "key": "X-Channel-Id", + "value": "sunbird" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"content\": {\n \"name\": \"Untitled Content\",\n \"code\": \"1242e9ea-660a-4536-a142-cc242a7a4162\",\n \"mimeType\": \"video/mp4\",\n \"primaryCategory\": \"Explanation Content\",\n \"body\": \"{\\\"key\\\":\\\"value\\\"}\"\n }\n }\n}" + }, + "url": { + "raw": "{{host}}/content/v4/create", + "host": [ + "{{host}}" + ], + "path": [ + "content", + "v4", + "create" + ] + }, + "description": "This API is associated with creating content on the Sunbird Platform.\n - The endpoint for **Create Content** is `/content/v2/create`\n - It points to knowledge-mw-service - `/v2/content/create`\n - It is mandatory to provide values for parameters marked with *.\n - Mandatory fields cannot be null or empty." + }, + "response": [ + { + "name": "SUCCESS. The **Create Content** operation was successful!", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource.Possible media types can be:-\n - Application/json", + "key": "Content-Type", + "value": "ea laborum" + }, + { + "description": "(Required) Represents a physical location (e.g: state) uniquely to which the user belongs.", + "key": "x-channel-id", + "value": "ea laborum" + }, + { + "description": "(Required) Represents the authorized User ID to execute the API.", + "key": "X-Authenticated-User-Token", + "value": "ea laborum" + }, + { + "description": "(Required) To make use of the API, you require authorization. Raise a request to the administrator for the use of the API. You will receive the authorization key. Specify the key received, here.", + "key": "Authorization", + "value": "ea laborum" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"content\": {\n \"name\": \"H5P Content\",\n \"code\": \"h5pcontent\",\n \"mimeType\": \"application/vnd.ekstep.h5p-archive\",\n \"primaryCategory\": \"Resource\",\n \"createdBy\": \"874ed8a5-782e-4f6c-8f36-e0288455901e\"\n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/content/v2/create", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v2", + "create" + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"api.content.create\",\n \"ver\": \"3.0\",\n \"ts\": \"2020-12-10T20:24:45ZZ\",\n \"params\": {\n \"resmsgid\": \"3be02c4b-3324-41a3-afd8-60f6be0584d2\",\n \"msgid\": null,\n \"err\": null,\n \"status\": \"successful\",\n \"errmsg\": null\n },\n \"responseCode\": \"OK\",\n \"result\": {\n \"identifier\": \"do_1131697204035993601314\",\n \"node_id\": \"do_1131697204035993601314\",\n \"versionKey\": \"1607631885207\"\n }\n}" + }, + { + "name": "'BAD REQUEST. The **Create Content** operation failed. You may have missed input for a mandatory parameter.'", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource.Possible media types can be:-\n - Application/json", + "key": "Content-Type", + "value": "ea laborum" + }, + { + "description": "(Required) Represents a physical location (e.g: state) uniquely to which the user belongs.", + "key": "x-channel-id", + "value": "ea laborum" + }, + { + "description": "(Required) Represents the authorized User ID to execute the API.", + "key": "X-Authenticated-User-Token", + "value": "ea laborum" + }, + { + "description": "(Required) To make use of the API, you require authorization. Raise a request to the administrator for the use of the API. You will receive the authorization key. Specify the key received, here.", + "key": "Authorization", + "value": "ea laborum" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"content\": {\n \"name\": \"H5P Content\",\n \"code\": \"h5pcontent\",\n \"mimeType\": \"application/vnd.ekstep.h5p-archive\",\n \"primaryCategory\": \"Resource\",\n \"createdBy\": \"874ed8a5-782e-4f6c-8f36-e0288455901e\"\n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/content/v2/create", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v2", + "create" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"api.content.create\",\n \"ver\": \"1.0\",\n \"ts\": \"2020-12-10T08:50:29.786Z\",\n \"params\": {\n \"resmsgid\": \"c169a7a0-3ac4-11eb-b0a2-8d5c9f561887\",\n \"msgid\": null,\n \"status\": \"failed\",\n \"err\": \"ERR_CONTENT_CREATE_FIELDS_MISSING\",\n \"errmsg\": \"Required fields for create content are missing\"\n },\n \"responseCode\": \"CLIENT_ERROR\",\n \"result\": {}\n}" + }, + { + "name": "'INTERNAL SERVER ERROR. We track these errors automatically and try to set it right at the earliest. Try refreshing the page. If the problem persists contact us at info@sunbird.org.'", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource.Possible media types can be:-\n - Application/json", + "key": "Content-Type", + "value": "ea laborum" + }, + { + "description": "(Required) Represents a physical location (e.g: state) uniquely to which the user belongs.", + "key": "x-channel-id", + "value": "ea laborum" + }, + { + "description": "(Required) Represents the authorized User ID to execute the API.", + "key": "X-Authenticated-User-Token", + "value": "ea laborum" + }, + { + "description": "(Required) To make use of the API, you require authorization. Raise a request to the administrator for the use of the API. You will receive the authorization key. Specify the key received, here.", + "key": "Authorization", + "value": "ea laborum" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"content\": {\n \"name\": \"H5P Content\",\n \"code\": \"h5pcontent\",\n \"mimeType\": \"application/vnd.ekstep.h5p-archive\",\n \"primaryCategory\": \"Resource\",\n \"createdBy\": \"874ed8a5-782e-4f6c-8f36-e0288455901e\"\n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/content/v2/create", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v2", + "create" + ] + } + }, + "status": "Internal Server Error", + "code": 500, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"api.content.create\",\n \"ver\": \"1.0\",\n \"ts\": \"2020-12-10T08:51:51.647Z\",\n \"params\": {\n \"resmsgid\": \"f234a6f0-3ac4-11eb-b0a2-8d5c9f561887\",\n \"msgid\": null,\n \"status\": \"failed\",\n \"err\": null,\n \"errmsg\": null\n },\n \"responseCode\": \"SERVER_ERROR\",\n \"result\": {}\n}" + } + ] + }, + { + "name": "Upload URL", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json();\r", + "\r", + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "pm.test(\"Status code name has string OK\", function () {\r", + " pm.response.to.have.status(\"OK\");\r", + "});\r", + "pm.test(\"id should be api.content.upload.url\", function () {\r", + " pm.expect(jsonResponse.id).to.eql(\"api.content.upload.url\");\r", + "});\r", + "pm.test(\"ver should be 4.0\", function () {\r", + " pm.expect(jsonResponse.ver).to.eql(\"4.0\");\r", + "});\r", + "\r", + "pm.test(\"Params has keys: resmsgid , msgid , err , status , errmsg \", () => {\r", + " pm.expect(jsonResponse.params).to.have.all.keys('resmsgid', 'msgid','err','status','errmsg');\r", + " pm.expect(jsonResponse.params.resmsgid).to.be.a(\"string\");\r", + " pm.expect(jsonResponse.params.msgid).to.be.a('null');\r", + " pm.expect(jsonResponse.params.err).to.be.a('null');\r", + " pm.expect(jsonResponse.params.status).to.be.a(\"string\");\r", + " pm.expect(jsonResponse.params.errmsg).to.be.a('null');\r", + "});\r", + "\r", + "pm.test(\"Status is successful\", function () {\r", + " pm.expect(jsonResponse.params.status).to.be.equal(\"successful\");\r", + "});\r", + "\r", + "pm.test(\"ResponseCode is OK\", function () {\r", + " pm.expect(jsonResponse.responseCode).to.be.equal(\"OK\");\r", + "});\r", + "\r", + "\r", + "pm.test(\"Verify keys and data type of the response result\", () => {\r", + " pm.expect(jsonResponse.result).to.have.all.keys('identifier', 'url_expiry', 'pre_signed_url');\r", + "});\r", + "pm.collectionVariables.set(\"pre_signed_URL\",jsonResponse.result.pre_signed_url );\r", + "console.log(pm.collectionVariables.get(\"pre_signed_URL\"));\r", + "\r", + "\r", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "apikey", + "apikey": [ + { + "key": "key", + "value": "Authorization", + "type": "string" + }, + { + "key": "value", + "value": "", + "type": "string" + }, + { + "key": "in", + "value": "header", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "description": "(Required) The Content Type entity is the media type of the resource.Possible media types can be:-\n - Application/json", + "key": "Content-Type", + "value": "application/json" + }, + { + "description": "(Required) The Registered User ID to execute the API.", + "key": "X-Authenticated-Userid", + "value": "ea laborum" + }, + { + "description": "(Required) All content APIs require authorization for use. Specify the authorization key received from the administrator when placing the request for use of the API.", + "key": "Authorization", + "value": "ea laborum" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"content\": {\n \"fileName\":\"test.pdf\"\n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/content/v4/upload/url/{{retire_content}}", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v4", + "upload", + "url", + "{{retire_content}}" + ] + }, + "description": "This API is associated with uploading content on the Sunbird Platform .\n - The**_/upload/url/{content Id}_** endpoint executes \"Upload Content URL\" request based on parameters provided as metadata in the request body.\n - The endpoint for **Upload Content URL** is `/content/v2/upload/url`\n - It points to knowledge-mw-service - `/v2/content/upload/url`\n - {...}refers to a section of upload endpoint URL path that needs to be replaced by appropriate Id.\n - You need to provide a valid content Id value in {Content Id} field of API URL.\n - On Success api returns pre-signed-url link with come configured ttl against which file can be uploaded.\n - It is mandatory to provide values for parameters marked with *.\n - Mandatory fields cannot be null or empty." + }, + "response": [ + { + "name": "OK ! Successful operation.\"Content upload\" operation was successfully executed.", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource.Possible media types can be:-\n - Application/json", + "key": "Content-Type", + "value": "ea laborum" + }, + { + "description": "(Required) The Registered User ID to execute the API.", + "key": "X-Authenticated-Userid", + "value": "ea laborum" + }, + { + "description": "(Required) All content APIs require authorization for use. Specify the authorization key received from the administrator when placing the request for use of the API.", + "key": "Authorization", + "value": "ea laborum" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"content\": {\n \"fileName\": \"test.pdf\"\n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/content/v2/upload/url/:Content_Id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v2", + "upload", + "url", + ":Content_Id" + ], + "variable": [ + { + "key": "Content_Id", + "value": "ea laborum", + "description": "(Required) Please append a valid Content Id To the Request URL" + } + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"api.content.upload.url\",\n \"ver\": \"3.0\",\n \"ts\": \"2020-12-11T23:52:44ZZ\",\n \"params\": {\n \"resmsgid\": \"81e308fa-3e36-45ff-b295-e28e8f757dc7\",\n \"msgid\": null,\n \"err\": null,\n \"status\": \"successful\",\n \"errmsg\": null\n },\n \"responseCode\": \"OK\",\n \"result\": {\n \"identifier\": \"do_11317053041892556811094\",\n \"url_expiry\": \"54000\",\n \"pre_signed_url\": \"https://sunbirddev.blob.core.windows.net/sunbird-content-dev/content/assets/do_11317053041892556811094/10-page-pdf.pdf?sv=2017-04-17&se=2020-12-12T14%3A52%3A44Z&sr=b&sp=w&sig=Tlt6uWI/6lMeupkEbsTAmGajmo1qzw8HeUHrVwOm6yk%3D\"\n }\n}" + }, + { + "name": "BAD REQUEST. The 'Upload Url' operation failed ! The possible reason for failure is that you may have missed providing input for a mandatory parameter.", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource.Possible media types can be:-\n - Application/json", + "key": "Content-Type", + "value": "ea laborum" + }, + { + "description": "(Required) The Registered User ID to execute the API.", + "key": "X-Authenticated-Userid", + "value": "ea laborum" + }, + { + "description": "(Required) All content APIs require authorization for use. Specify the authorization key received from the administrator when placing the request for use of the API.", + "key": "Authorization", + "value": "ea laborum" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"content\": {\n \"fileName\": \"test.pdf\"\n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/content/v2/upload/url/:Content_Id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v2", + "upload", + "url", + ":Content_Id" + ], + "variable": [ + { + "key": "Content_Id", + "value": "ea laborum", + "description": "(Required) Please append a valid Content Id To the Request URL" + } + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"api.content.upload.url\",\n \"ver\": \"3.0\",\n \"ts\": \"2020-12-11T23:54:07ZZ\",\n \"params\": {\n \"resmsgid\": \"4edde64d-3116-4271-bcc1-a8ba0ec2d56b\",\n \"msgid\": null,\n \"err\": \"ERR_CONTENT_BLANK_FILE_NAME\",\n \"status\": \"failed\",\n \"errmsg\": \"File name is blank\"\n },\n \"responseCode\": \"CLIENT_ERROR\",\n \"result\": {\n \"messages\": null\n }\n}" + }, + { + "name": "RESOURCE NOT FOUND,**Content Id sent for generating upload url** operation failed !The possible reason for failure is that you may have provided wrong content id.", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource.Possible media types can be:-\n - Application/json", + "key": "Content-Type", + "value": "ea laborum" + }, + { + "description": "(Required) The Registered User ID to execute the API.", + "key": "X-Authenticated-Userid", + "value": "ea laborum" + }, + { + "description": "(Required) All content APIs require authorization for use. Specify the authorization key received from the administrator when placing the request for use of the API.", + "key": "Authorization", + "value": "ea laborum" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"content\": {\n \"fileName\": \"test.pdf\"\n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/content/v2/upload/url/:Content_Id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v2", + "upload", + "url", + ":Content_Id" + ], + "variable": [ + { + "key": "Content_Id", + "value": "ea laborum", + "description": "(Required) Please append a valid Content Id To the Request URL" + } + ] + } + }, + "status": "Not Found", + "code": 404, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"api.upload.url\",\n \"ver\": \"1.0\",\n \"ts\": \"2020-12-11T23:48:26.694Z\",\n \"params\": {\n \"resmsgid\": \"5cf72660-3c0b-11eb-b0a2-8d5c9f561887\",\n \"msgid\": null,\n \"status\": \"failed\",\n \"err\": \"NOT_FOUND\",\n \"errmsg\": \"Error! Node(s) doesn't Exists. | [Invalid Node Id.]: do_11254577204586086415\"\n },\n \"responseCode\": \"RESOURCE_NOT_FOUND\",\n \"result\": {}\n}" + }, + { + "name": "INTERNAL SERVER ERROR ! Looks like something went wrong! These errors are tracked automatically, but if the problem persists feel free to contact us. In the meantime, try refreshing.", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource.Possible media types can be:-\n - Application/json", + "key": "Content-Type", + "value": "ea laborum" + }, + { + "description": "(Required) The Registered User ID to execute the API.", + "key": "X-Authenticated-Userid", + "value": "ea laborum" + }, + { + "description": "(Required) All content APIs require authorization for use. Specify the authorization key received from the administrator when placing the request for use of the API.", + "key": "Authorization", + "value": "ea laborum" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"content\": {\n \"fileName\": \"test.pdf\"\n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/content/v2/upload/url/:Content_Id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v2", + "upload", + "url", + ":Content_Id" + ], + "variable": [ + { + "key": "Content_Id", + "value": "ea laborum", + "description": "(Required) Please append a valid Content Id To the Request URL" + } + ] + } + }, + "status": "Internal Server Error", + "code": 500, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"result\": {},\n \"id\": \"cupidatat reprehenderit dolor\",\n \"ver\": \"minim anim commodo\",\n \"ts\": \"commodo\",\n \"params\": {\n \"resmsgid\": \"pariatur repre\",\n \"msgid\": \"irure\",\n \"err\": \"consequat esse ea\",\n \"status\": \"esse\",\n \"errmsg\": \"aliqua laboris velit\"\n },\n \"responseCode\": \"reprehenderit dolor elit sunt dolore\"\n}" + } + ] + }, + { + "name": "Upload file to the URL", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 201\", function () {\r", + " pm.response.to.have.status(201);\r", + "});\r", + "\r", + "var fullUrl= pm.collectionVariables.get(\"pre_signed_URL\");\r", + "\r", + "// Find the index of '?' to get the position of the query parameters\r", + "var indexOfQuestionMark = fullUrl.indexOf('?');\r", + "\r", + "// Extract the partial URL without the query parameters\r", + "var partialUrl = indexOfQuestionMark !== -1 ? fullUrl.slice(0, indexOfQuestionMark) : fullUrl;\r", + "pm.collectionVariables.set(\"partial_URL\", partialUrl);\r", + "// Log the partial URL to the console (you can remove this line if not needed)\r", + "console.log(pm.collectionVariables.get(\"partial_URL\"));\r", + "\r", + "// Now you can use the 'partialUrl' variable in Postman as needed\r", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "PUT", + "header": [ + { + "key": "X-Ms-Blob-Type", + "value": "BlockBlob" + } + ], + "body": { + "mode": "formdata", + "formdata": [ + { + "key": "file", + "type": "file", + "src": "/C:/Users/Qualitrix/Downloads/pdf_233.pdf" + } + ] + }, + "url": { + "raw": "{{pre_signed_URL}}", + "host": [ + "{{pre_signed_URL}}" + ] + } + }, + "response": [] + }, + { + "name": "Update the content with URL and mime type", + "event": [ + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + }, + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json();\r", + "\r", + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "pm.test(\"Status code name has string OK\", function () {\r", + " pm.response.to.have.status(\"OK\");\r", + "});\r", + "pm.test(\"id should be api.content.upload\", function () {\r", + " pm.expect(jsonResponse.id).to.eql(\"api.content.upload\");\r", + "});\r", + "pm.test(\"ver should be 4.0\", function () {\r", + " pm.expect(jsonResponse.ver).to.eql(\"4.0\");\r", + "});\r", + "\r", + "pm.test(\"Params has keys: resmsgid , msgid , err , status , errmsg \", () => {\r", + " pm.expect(jsonResponse.params).to.have.all.keys('resmsgid', 'msgid','err','status','errmsg');\r", + " pm.expect(jsonResponse.params.resmsgid).to.be.a(\"string\");\r", + " pm.expect(jsonResponse.params.msgid).to.be.a('null');\r", + " pm.expect(jsonResponse.params.err).to.be.a('null');\r", + " pm.expect(jsonResponse.params.status).to.be.a(\"string\");\r", + " pm.expect(jsonResponse.params.errmsg).to.be.a('null');\r", + "});\r", + "\r", + "pm.test(\"Status is successful\", function () {\r", + " pm.expect(jsonResponse.params.status).to.be.equal(\"successful\");\r", + "});\r", + "\r", + "pm.test(\"ResponseCode is OK\", function () {\r", + " pm.expect(jsonResponse.responseCode).to.be.equal(\"OK\");\r", + "});\r", + "\r", + "pm.test(\"Result has keys: identifier , artifactUrl , content_url , node_id , versionKey \", () => {\r", + " pm.expect(jsonResponse.result).to.have.all.keys('identifier', 'artifactUrl','content_url','node_id','versionKey');\r", + " pm.expect(jsonResponse.result.identifier).to.be.a(\"string\");\r", + " pm.expect(jsonResponse.result.artifactUrl).to.be.a(\"string\");\r", + " pm.expect(jsonResponse.result.content_url).to.be.a(\"string\");\r", + " pm.expect(jsonResponse.result.node_id).to.be.a(\"string\");\r", + " pm.expect(jsonResponse.result.versionKey).to.be.a(\"string\");\r", + "});\r", + "\r", + "pm.test(`artifactUrl should be: ${pm.collectionVariables.get(\"partial_URL\")}`, function () {\r", + " pm.expect(jsonResponse.result.artifactUrl).to.be.equal(`${pm.collectionVariables.get(\"partial_URL\")}`);\r", + "});\r", + "\r", + "pm.test(`content_url should be: ${pm.collectionVariables.get(\"partial_URL\")}`, function () {\r", + " pm.expect(jsonResponse.result.content_url).to.be.equal(`${pm.collectionVariables.get(\"partial_URL\")}`);\r", + "});\r", + "\r", + "pm.test(`identifier should be: ${pm.collectionVariables.get(\"retire_content\")}`, function () {\r", + " pm.expect(jsonResponse.result.identifier).to.be.equal(`${pm.collectionVariables.get(\"retire_content\")}`);\r", + "});\r", + "\r", + "pm.test(`node_id should be: ${pm.collectionVariables.get(\"retire_content\")}`, function () {\r", + " pm.expect(jsonResponse.result.node_id).to.be.equal(`${pm.collectionVariables.get(\"retire_content\")}`);\r", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "user-id", + "value": "mahesh" + }, + { + "key": "Cookie", + "value": "connect.sid=s%3AnLNdCeYI27WUkZBIFdX1J5MKTM6ISEdJ.SFTq%2FeT2cVLh5TSEWmwZPCekWDSeNXILHPDyziKa26E" + }, + { + "key": "X-Channel-Id", + "value": "0137541424673095687" + }, + { + "key": "X-Authenticated-User-token", + "value": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImtpZCI6ImFjY2Vzc3YxX2tleTEifQ.eyJhdWQiOiJodHRwczovL2Rldi5zdW5iaXJkZWQub3JnL2F1dGgvcmVhbG1zL3N1bmJpcmQiLCJzdWIiOiJmOjVhOGEzZjJiLTM0MDktNDJlMC05MDAxLWY5MTNiYzBmZGUzMToxNTVjZTNjNS03MTNlLTQ3NDktYmMxYy05NWQwOWM2NDA5MTQiLCJyb2xlcyI6W3sicm9sZSI6IkNPTlRFTlRfQ1JFQVRPUiIsInNjb3BlIjpbeyJvcmdhbmlzYXRpb25JZCI6IjAxMzc1NDE0MjQ2NzMwOTU2ODcifV19LHsicm9sZSI6IkNPVVJTRV9NRU5UT1IiLCJzY29wZSI6W3sib3JnYW5pc2F0aW9uSWQiOiIwMTM3NTQxNDI0NjczMDk1Njg3In1dfSx7InJvbGUiOiJQVUJMSUMiLCJzY29wZSI6W119XSwiaXNzIjoiaHR0cHM6Ly9kZXYuc3VuYmlyZGVkLm9yZy9hdXRoL3JlYWxtcy9zdW5iaXJkIiwibmFtZSI6ImNvbnRlbnRDcmVhdG9yIiwidHlwIjoiQmVhcmVyIiwiZXhwIjoxNzAyMzI0NjU0LCJpYXQiOjE3MDIyODE0NTR9.MxiIhP6YJmI1XbozLNoJeQAbdQKs597f2mlNHWcJ-ZZIXvBx4BcX7T57B5xXGIT6LJ6YlS86saiG6SXHIG5ptgICphdefNysfVgkSUmqTsgzfzvjp2lzIw8Re7xi735Kd7B612y5Tkswm0ETP7NIeQ7-Tc_3h37GV04ISfx0LMD75UvgllxcDz91Bl6N3-WN4KwCeKIfJ-iZj-EJLwoBmJjGsgNCNTn5DTzF_joFcyett__WVc14Ex-BqRSq8Hr2fMVoHpNXze3QUJ7PcD4JRY2Ywg5R9VkHz3mkhY9kI1cWeHdQypeSsM8niQK1XCWJz_aTqsP35MshDnHkWhmDyg" + }, + { + "key": "Authorization", + "value": "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiIzZGNjMzY3OWIwYTE0NmU2YWYyZjlmZDA5NWU5NTlkNCJ9.0NZhX5sqUNy-GZUya90aQFkr5ZNiqfOuELYz_IvoyS8" + } + ], + "body": { + "mode": "formdata", + "formdata": [ + { + "key": "fileUrl", + "value": "{{partial_URL}}", + "type": "text" + }, + { + "key": "mimeType", + "value": "application/pdf", + "type": "text" + } + ] + }, + "url": { + "raw": "{{host}}/content/v4/upload/{{retire_content}}", + "host": [ + "{{host}}" + ], + "path": [ + "content", + "v4", + "upload", + "{{retire_content}}" + ] + } + }, + "response": [] + }, + { + "name": "Submit for Review", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json();\r", + "\r", + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "pm.test(\"Status code name has string OK\", function () {\r", + " pm.response.to.have.status(\"OK\");\r", + "});\r", + "pm.test(\"id should be api.content.review\", function () {\r", + " pm.expect(jsonResponse.id).to.eql(\"api.content.review\");\r", + "});\r", + "pm.test(\"ver should be 4.0\", function () {\r", + " pm.expect(jsonResponse.ver).to.eql(\"4.0\");\r", + "});\r", + "\r", + "pm.test(\"Params has keys: resmsgid , msgid , err , status , errmsg \", () => {\r", + " pm.expect(jsonResponse.params).to.have.all.keys('resmsgid', 'msgid','err','status','errmsg');\r", + " pm.expect(jsonResponse.params.resmsgid).to.be.a(\"string\");\r", + " pm.expect(jsonResponse.params.msgid).to.be.a('null');\r", + " pm.expect(jsonResponse.params.err).to.be.a('null');\r", + " pm.expect(jsonResponse.params.status).to.be.a(\"string\");\r", + " pm.expect(jsonResponse.params.errmsg).to.be.a('null');\r", + "});\r", + "\r", + "pm.test(\"Status is successful\", function () {\r", + " pm.expect(jsonResponse.params.status).to.be.equal(\"successful\");\r", + "});\r", + "\r", + "pm.test(\"ResponseCode is OK\", function () {\r", + " pm.expect(jsonResponse.responseCode).to.be.equal(\"OK\");\r", + "});\r", + "pm.test(\"Result has keys: identifier , versionKey\", () => {\r", + " pm.expect(jsonResponse.result).to.have.all.keys('identifier','versionKey');\r", + " pm.expect(jsonResponse.result.identifier).to.be.a(\"string\");\r", + " pm.expect(jsonResponse.result.versionKey).to.be.a(\"string\");\r", + "});\r", + "\r", + "pm.test(`identifier should be: ${pm.collectionVariables.get(\"retire_content\")}`, function () {\r", + " pm.expect(jsonResponse.result.identifier).to.be.equal(`${pm.collectionVariables.get(\"retire_content\")}`);\r", + "});\r", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "apikey", + "apikey": [ + { + "key": "value", + "value": "{{auth_token}}", + "type": "string" + }, + { + "key": "key", + "value": "Authorization", + "type": "string" + }, + { + "key": "in", + "value": "header", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "description": "(Required) The Content Type entity is the media type of the resource.Possible media types can be:-\n - Application/json", + "key": "Content-Type", + "value": "application/json" + }, + { + "description": "(Required) The Registered User ID to execute the API.", + "key": "X-Authenticated-User-token", + "value": "ea laborum" + }, + { + "description": "(Required) All content APIs require authorization for use. Specify the authorization key received from the administrator when placing the request for use of the API.", + "key": "Authorization", + "value": "ea laborum" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/content/v4/review/{{retire_content}}", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v4", + "review", + "{{retire_content}}" + ] + }, + "description": ">- This API is associated with Submission of content for Review on the Sunbird Platform .\n - The**_/review/{content Id}_** endpoint executes \"Submit for Review\" request based on parameters provided as metadata in the request body.\n - The endpoint for **Review Content** is `/content/v2/review`\n - It points to knowledge-mw-service - `/v2/content/review`\n - {...}refers to a section of review endpoint URL path that needs to be replaced by appropriate Id.\n - You need to provide a valid content Id value in {Content Id} field of API URL.\n - It is mandatory to provide values for parameters marked with *.\n - Mandatory fields cannot be null or empty." + }, + "response": [ + { + "name": "OK ! Successful operation.Content sent for review operation was successfully executed.", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource.Possible media types can be:-\n - Application/json", + "key": "Content-Type", + "value": "ea laborum" + }, + { + "description": "(Required) The Registered User ID to execute the API.", + "key": "X-Authenticated-User-token", + "value": "ea laborum" + }, + { + "description": "(Required) All content APIs require authorization for use. Specify the authorization key received from the administrator when placing the request for use of the API.", + "key": "Authorization", + "value": "ea laborum" + } + ], + "body": { + "mode": "raw", + "raw": "{}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/content/v2/review/:Content_Id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v2", + "review", + ":Content_Id" + ], + "variable": [ + { + "key": "Content_Id", + "value": "ea laborum", + "description": "(Required) Please append a valid Content Id To the Request URL" + } + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"ekstep.learning.content.review\",\n \"ver\": \"3.0\",\n \"ts\": \"2020-12-10T21:06:26ZZ\",\n \"params\": {\n \"resmsgid\": \"186cf9a9-8094-4cdd-926f-b77a030921d1\",\n \"msgid\": null,\n \"err\": null,\n \"status\": \"successful\",\n \"errmsg\": null\n },\n \"responseCode\": \"OK\",\n \"result\": {\n \"node_id\": \"do_1131697376667402241315\",\n \"versionKey\": \"1607634386533\"\n }\n}" + }, + { + "name": "RESOURCE NOT FOUND,**Content Send for Review** operation failed !The possible reason for failure is that you may have provided wrong content id.", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource.Possible media types can be:-\n - Application/json", + "key": "Content-Type", + "value": "ea laborum" + }, + { + "description": "(Required) The Registered User ID to execute the API.", + "key": "X-Authenticated-User-token", + "value": "ea laborum" + }, + { + "description": "(Required) All content APIs require authorization for use. Specify the authorization key received from the administrator when placing the request for use of the API.", + "key": "Authorization", + "value": "ea laborum" + } + ], + "body": { + "mode": "raw", + "raw": "{}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/content/v2/review/:Content_Id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v2", + "review", + ":Content_Id" + ], + "variable": [ + { + "key": "Content_Id", + "value": "ea laborum", + "description": "(Required) Please append a valid Content Id To the Request URL" + } + ] + } + }, + "status": "Not Found", + "code": 404, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"ekstep.learning.content.review\",\n \"ver\": \"3.0\",\n \"ts\": \"2020-12-10T21:06:54ZZ\",\n \"params\": {\n \"resmsgid\": \"944ac944-78d9-43e2-bfd5-337ab52b6552\",\n \"msgid\": null,\n \"err\": \"ERR_TAXONOMY_INVALID_CONTENT\",\n \"status\": \"failed\",\n \"errmsg\": \"Error! While Fetching the Content for Operation | [Content Id: do_11316973766674022413151]\"\n },\n \"responseCode\": \"CLIENT_ERROR\",\n \"result\": {}\n}" + }, + { + "name": "INTERNAL SERVER ERROR ! Looks like something went wrong! We track these errors automatically, but if the problem persists feel free to contact us. In the meantime, try refreshing.", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource.Possible media types can be:-\n - Application/json", + "key": "Content-Type", + "value": "ea laborum" + }, + { + "description": "(Required) The Registered User ID to execute the API.", + "key": "X-Authenticated-User-token", + "value": "ea laborum" + }, + { + "description": "(Required) All content APIs require authorization for use. Specify the authorization key received from the administrator when placing the request for use of the API.", + "key": "Authorization", + "value": "ea laborum" + } + ], + "body": { + "mode": "raw", + "raw": "{}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/content/v2/review/:Content_Id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v2", + "review", + ":Content_Id" + ], + "variable": [ + { + "key": "Content_Id", + "value": "ea laborum", + "description": "(Required) Please append a valid Content Id To the Request URL" + } + ] + } + }, + "status": "Internal Server Error", + "code": 500, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"result\": {},\n \"id\": \"cupidatat reprehenderit dolor\",\n \"ver\": \"minim anim commodo\",\n \"ts\": \"commodo\",\n \"params\": {\n \"resmsgid\": \"pariatur repre\",\n \"msgid\": \"irure\",\n \"err\": \"consequat esse ea\",\n \"status\": \"esse\",\n \"errmsg\": \"aliqua laboris velit\"\n },\n \"responseCode\": \"reprehenderit dolor elit sunt dolore\"\n}" + } + ] + }, + { + "name": "Publish Content", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json()\r", + "\r", + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "\r", + "pm.test(\"id has string - api.content.publish.public \", function () {\r", + " pm.expect(jsonResponse.id).to.be.equal(\"api.content.publish.public\");\r", + "});\r", + "\r", + "pm.test(\"Version is 4.0 \", function () {\r", + " pm.expect(jsonResponse.ver).to.be.equal(\"4.0\");\r", + "});\r", + "\r", + "pm.test(\"Verify keys and data type of the response result\", () => {\r", + " pm.expect(jsonResponse.params).to.have.all.keys('resmsgid','msgid','status', 'err','errmsg');\r", + " pm.expect(jsonResponse.params.resmsgid).to.be.a(\"string\");\r", + " pm.expect(jsonResponse.params.msgid).to.be.a(\"null\"); \r", + " pm.expect(jsonResponse.params.status).to.be.a(\"string\");\r", + " pm.expect(jsonResponse.params.err).to.be.a(\"null\");\r", + " pm.expect(jsonResponse.params.errmsg).to.be.a(\"null\");\r", + "});\r", + "\r", + "pm.test(\"Status is successful \", function () {\r", + " pm.expect(jsonResponse.params.status).to.be.equal(\"successful\");\r", + "});\r", + "\r", + "pm.test(\"ResponseCode is OK \", function () {\r", + " pm.expect(jsonResponse.responseCode).to.be.equal(\"OK\");\r", + "});\r", + "\r", + "pm.test(\"Verify keys and data type of the response result\", () => {\r", + " pm.expect(jsonResponse.result).to.have.all.keys('publishStatus','node_id');\r", + " pm.expect(jsonResponse.result.publishStatus).to.be.a('String');\r", + " pm.expect(jsonResponse.result.node_id).to.be.a('String');\r", + "});\r", + "\r", + "pm.test(\"node should be equal to \" + pm.collectionVariables.get(\"retire_content\"), () => {\r", + " pm.expect(jsonResponse.result.node_id).to.eql(pm.collectionVariables.get(\"retire_content\"));\r", + "});\r", + "pm.test(`publishStatus should be equal to Publish Event for Content Id ${pm.collectionVariables.get(\"retire_content\")} is pushed Successfully!`, () => {\r", + " pm.expect(jsonResponse.result.publishStatus).to.eql(`Publish Event for Content Id '${pm.collectionVariables.get(\"retire_content\")}' is pushed Successfully!`);\r", + "});\r", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "apikey", + "apikey": [ + { + "key": "key", + "value": "Authorization", + "type": "string" + }, + { + "key": "value", + "value": "", + "type": "string" + }, + { + "key": "in", + "value": "header", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "description": "(Required) The Content Type entity is the media type of the resource.Possible media types can be:-\n - Application/json\n - Multipart/form-data\n - Application/x-www-form-urlencoded", + "key": "Content-Type", + "value": "application/json" + }, + { + "description": "(Required) User Registered ID , which is used for logging In", + "key": "X-Authenticated-User-token", + "value": "ea laborum" + }, + { + "description": "(Required) Authorizing user in order to grant access.", + "key": "Authorization", + "value": "ea laborum" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"content\": {\n \"Publisher\": \"sunbird.publisher.create\",\n \"lastPublishedBy\": \"Ekstep\"\n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/content/v4/publish/{{retire_content}}", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v4", + "publish", + "{{retire_content}}" + ] + }, + "description": "This API is associated with publishing content on the Sunbird Platform .\n - **_/publish/_** endpoint executes the \"Publish Content\" request based on parameters provided as metadata in the request body.\n - The endpoint for **Publish Content** is `/content/v1/publish`\n - It points to knowledge-mw-service - `/v2/content/publish`\n - {...}refers to a section of review endpoint URL path that needs to be replaced by appropriate Id.\n - It is mandatory to provide values for parameters marked with *.\n - Mandatory fields cannot be null or empty." + }, + "response": [ + { + "name": "OK ! Successful operation.**Content publish operation was successfully executed.", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource.Possible media types can be:-\n - Application/json\n - Multipart/form-data\n - Application/x-www-form-urlencoded", + "key": "Content-Type", + "value": "ea laborum" + }, + { + "description": "(Required) User Registered ID , which is used for logging In", + "key": "X-Authenticated-User-token", + "value": "ea laborum" + }, + { + "description": "(Required) Authorizing user in order to grant access.", + "key": "Authorization", + "value": "ea laborum" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"content\": {\n \"lastPublishedBy\": \"Ekstep\"\n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/content/v1/publish/:Content_Id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v1", + "publish", + ":Content_Id" + ], + "variable": [ + { + "key": "Content_Id", + "value": "ea laborum", + "description": "(Required) Content Id to be published" + } + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"api.v3.publish\",\n \"ver\": \"1.0\",\n \"ts\": \"2020-12-10T21:41:23.491Z\",\n \"params\": {\n \"resmsgid\": \"72c4ef30-3b30-11eb-b0a2-8d5c9f561887\",\n \"msgid\": \"72979da0-3b30-11eb-b0a2-8d5c9f561887\",\n \"status\": \"successful\",\n \"err\": null,\n \"errmsg\": null\n },\n \"responseCode\": \"OK\",\n \"result\": {\n \"content_id\": \"do_21316975736724684813479\",\n \"publishStatus\": \"Publish Operation for Content Id 'do_21316975736724684813479' Started Successfully!\"\n }\n}" + }, + { + "name": "RESOURCE NOT FOUND,**Content Send for Review** operation failed !The possible reason for failure is that you may have provided wrong content id.", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource.Possible media types can be:-\n - Application/json\n - Multipart/form-data\n - Application/x-www-form-urlencoded", + "key": "Content-Type", + "value": "ea laborum" + }, + { + "description": "(Required) User Registered ID , which is used for logging In", + "key": "X-Authenticated-User-token", + "value": "ea laborum" + }, + { + "description": "(Required) Authorizing user in order to grant access.", + "key": "Authorization", + "value": "ea laborum" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"content\": {\n \"lastPublishedBy\": \"Ekstep\"\n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/content/v1/publish/:Content_Id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v1", + "publish", + ":Content_Id" + ], + "variable": [ + { + "key": "Content_Id", + "value": "ea laborum", + "description": "(Required) Content Id to be published" + } + ] + } + }, + "status": "Not Found", + "code": 404, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"api.v3.publish\",\n \"ver\": \"1.0\",\n \"ts\": \"2020-12-10T21:51:39.870Z\",\n \"params\": {\n \"resmsgid\": \"e228e7e0-3b31-11eb-b0a2-8d5c9f561887\",\n \"msgid\": null,\n \"status\": \"failed\",\n \"err\": \"NOT_FOUND\",\n \"errmsg\": \"Error! Node(s) doesn't Exists. | [Invalid Node Id.]: do_213169757367246848134791\"\n },\n \"responseCode\": \"RESOURCE_NOT_FOUND\",\n \"result\": {}\n}" + }, + { + "name": "INTERNAL SERVER ERROR ! Looks like something went wrong! We track these errors automatically, but if the problem persists feel free to contact us. In the meantime, try refreshing.", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource.Possible media types can be:-\n - Application/json\n - Multipart/form-data\n - Application/x-www-form-urlencoded", + "key": "Content-Type", + "value": "ea laborum" + }, + { + "description": "(Required) User Registered ID , which is used for logging In", + "key": "X-Authenticated-User-token", + "value": "ea laborum" + }, + { + "description": "(Required) Authorizing user in order to grant access.", + "key": "Authorization", + "value": "ea laborum" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"content\": {\n \"lastPublishedBy\": \"Ekstep\"\n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/content/v1/publish/:Content_Id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v1", + "publish", + ":Content_Id" + ], + "variable": [ + { + "key": "Content_Id", + "value": "ea laborum", + "description": "(Required) Content Id to be published" + } + ] + } + }, + "status": "Internal Server Error", + "code": 500, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"result\": {},\n \"id\": \"cupidatat reprehenderit dolor\",\n \"ver\": \"minim anim commodo\",\n \"ts\": \"commodo\",\n \"params\": {\n \"resmsgid\": \"pariatur repre\",\n \"msgid\": \"irure\",\n \"err\": \"consequat esse ea\",\n \"status\": \"esse\",\n \"errmsg\": \"aliqua laboris velit\"\n },\n \"responseCode\": \"reprehenderit dolor elit sunt dolore\"\n}" + } + ] + }, + { + "name": "Create content for negative scenario", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json();\r", + "\r", + "pm.collectionVariables.set(\"retire_draft\", jsonResponse.result.identifier);\r", + "console.log(pm.collectionVariables.get(\"retire_draft\"));\r", + "\r", + "" + ], + "type": "text/javascript" + } + } + ], + "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}}" + }, + { + "key": "X-Channel-Id", + "value": "sunbird" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"content\": {\n \"name\": \"Untitled Content\",\n \"code\": \"1242e9ea-660a-4536-a142-cc242a7a4162\",\n \"mimeType\": \"video/mp4\",\n \"primaryCategory\": \"Explanation Content\",\n \"body\": \"{\\\"key\\\":\\\"value\\\"}\"\n }\n }\n}" + }, + "url": { + "raw": "{{host}}/content/v4/create", + "host": [ + "{{host}}" + ], + "path": [ + "content", + "v4", + "create" + ] + } + }, + "response": [] + } + ] + }, + { + "name": "Positive", + "item": [ + { + "name": "Retire a Live Content", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json();\r", + "\r", + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "pm.test(\"Status code name has string OK\", function () {\r", + " pm.response.to.have.status(\"OK\");\r", + "});\r", + "pm.test(\"id should be api.content.retire\", function () {\r", + " pm.expect(jsonResponse.id).to.eql(\"api.content.retire\");\r", + "});\r", + "pm.test(\"ver should be 4.0\", function () {\r", + " pm.expect(jsonResponse.ver).to.eql(\"4.0\");\r", + "});\r", + "\r", + "pm.test(\"Params has keys: resmsgid , msgid , err , status , errmsg \", () => {\r", + " pm.expect(jsonResponse.params).to.have.all.keys('resmsgid', 'msgid','err','status','errmsg');\r", + " pm.expect(jsonResponse.params.resmsgid).to.be.a(\"string\");\r", + " pm.expect(jsonResponse.params.msgid).to.be.a('null');\r", + " pm.expect(jsonResponse.params.err).to.be.a('null');\r", + " pm.expect(jsonResponse.params.status).to.be.a(\"string\");\r", + " pm.expect(jsonResponse.params.errmsg).to.be.a('null');\r", + "});\r", + "\r", + "pm.test(\"Status is successful\", function () {\r", + " pm.expect(jsonResponse.params.status).to.be.equal(\"successful\");\r", + "});\r", + "\r", + "pm.test(\"ResponseCode is OK\", function () {\r", + " pm.expect(jsonResponse.responseCode).to.be.equal(\"OK\");\r", + "});\r", + "pm.test(\"Result has keys: identifier , node_id \", () => {\r", + " pm.expect(jsonResponse.result).to.have.all.keys('identifier', 'node_id');\r", + " pm.expect(jsonResponse.result.identifier).to.be.a(\"string\");\r", + " pm.expect(jsonResponse.result.node_id).to.be.a(\"string\");\r", + "});\r", + "\r", + "pm.test(`identifier should be: ${pm.collectionVariables.get(\"retire_content\")}`, function () {\r", + " pm.expect(jsonResponse.result.identifier).to.be.equal(`${pm.collectionVariables.get(\"retire_content\")}`);\r", + "});\r", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "apikey", + "apikey": [ + { + "key": "key", + "value": "Authorization", + "type": "string" + }, + { + "key": "value", + "value": "", + "type": "string" + }, + { + "key": "in", + "value": "header", + "type": "string" + } + ] + }, + "method": "DELETE", + "header": [ + { + "description": "(Required) The Registered User ID to execute the API.", + "key": "X-Authenticated-User-token", + "value": "ea laborum" + }, + { + "description": "(Required) All content APIs require authorization for use. Specify the authorization key received from the administrator when placing the request for use of the API.", + "key": "Authorization", + "value": "ea laborum" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "url": { + "raw": "{{baseUrl}}/content/v4/retire/{{retire_content}}", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v4", + "retire", + "{{retire_content}}" + ] + }, + "description": "This API is associated with retiring content on the Sunbird Platform .\n - The **_/retire/{contentId}_** endpoint executes \"Retire Content\" request based on content Id to delete the specific content.'\n - The endpoint for **Retire Content** is `/content/v2/retire`\n - It points to knowledge-mw-service - `/v2/content/retire`\n - {...}refers to a section of review endpoint URL path that needs to be replaced by appropriate Id.\n - It is mandatory to provide values for parameters.\n - Mandatory fields cannot be null or empty." + }, + "response": [ + { + "name": "OK ! Successful operation.**Content deletion operation was successfully executed.", + "originalRequest": { + "method": "DELETE", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Registered User ID to execute the API.", + "key": "X-Authenticated-User-token", + "value": "ea laborum" + }, + { + "description": "(Required) All content APIs require authorization for use. Specify the authorization key received from the administrator when placing the request for use of the API.", + "key": "Authorization", + "value": "ea laborum" + } + ], + "url": { + "raw": "{{baseUrl}}/content/v2/retire/:Content_Id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v2", + "retire", + ":Content_Id" + ], + "variable": [ + { + "key": "Content_Id", + "value": "ea laborum", + "description": "(Required) Please append a valid Content Id To the Request URL" + } + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"api.content.retire\",\n \"ver\": \"3.0\",\n \"ts\": \"2020-12-11T12:05:52ZZ\",\n \"params\": {\n \"resmsgid\": \"ebd2655a-a69a-460c-9bcf-0f45f5938fac\",\n \"msgid\": null,\n \"err\": null,\n \"status\": \"successful\",\n \"errmsg\": null\n },\n \"responseCode\": \"OK\",\n \"result\": {\n \"identifier\": \"do_11283183576849612818\",\n \"node_id\": \"do_11283183576849612818\"\n }\n}" + }, + { + "name": "ERR CONTENT RETIRE! Content is already retired.", + "originalRequest": { + "method": "DELETE", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Registered User ID to execute the API.", + "key": "X-Authenticated-User-token", + "value": "ea laborum" + }, + { + "description": "(Required) All content APIs require authorization for use. Specify the authorization key received from the administrator when placing the request for use of the API.", + "key": "Authorization", + "value": "ea laborum" + } + ], + "url": { + "raw": "{{baseUrl}}/content/v2/retire/:Content_Id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v2", + "retire", + ":Content_Id" + ], + "variable": [ + { + "key": "Content_Id", + "value": "ea laborum", + "description": "(Required) Please append a valid Content Id To the Request URL" + } + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"api.content.retire\",\n \"ver\": \"3.0\",\n \"ts\": \"2020-12-11T12:01:24ZZ\",\n \"params\": {\n \"resmsgid\": \"ec20ec05-581c-4559-988a-449f3c5ae698\",\n \"msgid\": null,\n \"err\": \"ERR_CONTENT_RETIRE\",\n \"status\": \"failed\",\n \"errmsg\": \"Content with Identifier do_11316298360130764811 is already Retired.\"\n },\n \"responseCode\": \"CLIENT_ERROR\",\n \"result\": {\n \"messages\": null\n }\n}" + }, + { + "name": "RESOURCE NOT FOUND,**Content Send for Flag Accept** operation failed !The possible reason for failure is that you may have provided wrong content id.", + "originalRequest": { + "method": "DELETE", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Registered User ID to execute the API.", + "key": "X-Authenticated-User-token", + "value": "ea laborum" + }, + { + "description": "(Required) All content APIs require authorization for use. Specify the authorization key received from the administrator when placing the request for use of the API.", + "key": "Authorization", + "value": "ea laborum" + } + ], + "url": { + "raw": "{{baseUrl}}/content/v2/retire/:Content_Id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v2", + "retire", + ":Content_Id" + ], + "variable": [ + { + "key": "Content_Id", + "value": "ea laborum", + "description": "(Required) Please append a valid Content Id To the Request URL" + } + ] + } + }, + "status": "Not Found", + "code": 404, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"api.content.retire\",\n \"ver\": \"3.0\",\n \"ts\": \"2020-12-11T11:56:35ZZ\",\n \"params\": {\n \"resmsgid\": \"d826e808-2866-4603-9b60-0a3130a37128\",\n \"msgid\": null,\n \"err\": \"NOT_FOUND\",\n \"status\": \"failed\",\n \"errmsg\": \"Error! Node(s) doesn't Exists. | [Invalid Node Id.]: do_213143334457982976144\"\n },\n \"responseCode\": \"RESOURCE_NOT_FOUND\",\n \"result\": {\n \"messages\": null\n }\n}" + }, + { + "name": "INTERNAL SERVER ERROR ! Looks like something went wrong! These errors are tracked automatically, but if the problem persists feel free to contact us. In the meantime, try refreshing.", + "originalRequest": { + "method": "DELETE", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Registered User ID to execute the API.", + "key": "X-Authenticated-User-token", + "value": "ea laborum" + }, + { + "description": "(Required) All content APIs require authorization for use. Specify the authorization key received from the administrator when placing the request for use of the API.", + "key": "Authorization", + "value": "ea laborum" + } + ], + "url": { + "raw": "{{baseUrl}}/content/v2/retire/:Content_Id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v2", + "retire", + ":Content_Id" + ], + "variable": [ + { + "key": "Content_Id", + "value": "ea laborum", + "description": "(Required) Please append a valid Content Id To the Request URL" + } + ] + } + }, + "status": "Internal Server Error", + "code": 500, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"result\": {},\n \"id\": \"cupidatat reprehenderit dolor\",\n \"ver\": \"minim anim commodo\",\n \"ts\": \"commodo\",\n \"params\": {\n \"resmsgid\": \"pariatur repre\",\n \"msgid\": \"irure\",\n \"err\": \"consequat esse ea\",\n \"status\": \"esse\",\n \"errmsg\": \"aliqua laboris velit\"\n },\n \"responseCode\": \"reprehenderit dolor elit sunt dolore\"\n}" + } + ] + }, + { + "name": "Retire a draft Content", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json();\r", + "\r", + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "pm.test(\"Status code name has string OK\", function () {\r", + " pm.response.to.have.status(\"OK\");\r", + "});\r", + "pm.test(\"id should be api.content.retire\", function () {\r", + " pm.expect(jsonResponse.id).to.eql(\"api.content.retire\");\r", + "});\r", + "pm.test(\"ver should be 4.0\", function () {\r", + " pm.expect(jsonResponse.ver).to.eql(\"4.0\");\r", + "});\r", + "\r", + "pm.test(\"Params has keys: resmsgid , msgid , err , status , errmsg \", () => {\r", + " pm.expect(jsonResponse.params).to.have.all.keys('resmsgid', 'msgid','err','status','errmsg');\r", + " pm.expect(jsonResponse.params.resmsgid).to.be.a(\"string\");\r", + " pm.expect(jsonResponse.params.msgid).to.be.a('null');\r", + " pm.expect(jsonResponse.params.err).to.be.a('null');\r", + " pm.expect(jsonResponse.params.status).to.be.a(\"string\");\r", + " pm.expect(jsonResponse.params.errmsg).to.be.a('null');\r", + "});\r", + "\r", + "pm.test(\"Status is successful\", function () {\r", + " pm.expect(jsonResponse.params.status).to.be.equal(\"successful\");\r", + "});\r", + "\r", + "pm.test(\"ResponseCode is OK\", function () {\r", + " pm.expect(jsonResponse.responseCode).to.be.equal(\"OK\");\r", + "});\r", + "pm.test(\"Result has keys: identifier , node_id \", () => {\r", + " pm.expect(jsonResponse.result).to.have.all.keys('identifier', 'node_id');\r", + " pm.expect(jsonResponse.result.identifier).to.be.a(\"string\");\r", + " pm.expect(jsonResponse.result.node_id).to.be.a(\"string\");\r", + "});\r", + "\r", + "pm.test(`identifier should be: ${pm.collectionVariables.get(\"retire_draft\")}`, function () {\r", + " pm.expect(jsonResponse.result.identifier).to.be.equal(`${pm.collectionVariables.get(\"retire_draft\")}`);\r", + "});\r", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "apikey", + "apikey": [ + { + "key": "key", + "value": "Authorization", + "type": "string" + }, + { + "key": "value", + "value": "", + "type": "string" + }, + { + "key": "in", + "value": "header", + "type": "string" + } + ] + }, + "method": "DELETE", + "header": [ + { + "description": "(Required) The Registered User ID to execute the API.", + "key": "X-Authenticated-User-token", + "value": "ea laborum" + }, + { + "description": "(Required) All content APIs require authorization for use. Specify the authorization key received from the administrator when placing the request for use of the API.", + "key": "Authorization", + "value": "ea laborum" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "url": { + "raw": "{{baseUrl}}/content/v4/retire/{{retire_draft}}", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v4", + "retire", + "{{retire_draft}}" + ] + }, + "description": "This API is associated with retiring content on the Sunbird Platform .\n - The **_/retire/{contentId}_** endpoint executes \"Retire Content\" request based on content Id to delete the specific content.'\n - The endpoint for **Retire Content** is `/content/v2/retire`\n - It points to knowledge-mw-service - `/v2/content/retire`\n - {...}refers to a section of review endpoint URL path that needs to be replaced by appropriate Id.\n - It is mandatory to provide values for parameters.\n - Mandatory fields cannot be null or empty." + }, + "response": [ + { + "name": "OK ! Successful operation.**Content deletion operation was successfully executed.", + "originalRequest": { + "method": "DELETE", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Registered User ID to execute the API.", + "key": "X-Authenticated-User-token", + "value": "ea laborum" + }, + { + "description": "(Required) All content APIs require authorization for use. Specify the authorization key received from the administrator when placing the request for use of the API.", + "key": "Authorization", + "value": "ea laborum" + } + ], + "url": { + "raw": "{{baseUrl}}/content/v2/retire/:Content_Id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v2", + "retire", + ":Content_Id" + ], + "variable": [ + { + "key": "Content_Id", + "value": "ea laborum", + "description": "(Required) Please append a valid Content Id To the Request URL" + } + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"api.content.retire\",\n \"ver\": \"3.0\",\n \"ts\": \"2020-12-11T12:05:52ZZ\",\n \"params\": {\n \"resmsgid\": \"ebd2655a-a69a-460c-9bcf-0f45f5938fac\",\n \"msgid\": null,\n \"err\": null,\n \"status\": \"successful\",\n \"errmsg\": null\n },\n \"responseCode\": \"OK\",\n \"result\": {\n \"identifier\": \"do_11283183576849612818\",\n \"node_id\": \"do_11283183576849612818\"\n }\n}" + }, + { + "name": "ERR CONTENT RETIRE! Content is already retired.", + "originalRequest": { + "method": "DELETE", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Registered User ID to execute the API.", + "key": "X-Authenticated-User-token", + "value": "ea laborum" + }, + { + "description": "(Required) All content APIs require authorization for use. Specify the authorization key received from the administrator when placing the request for use of the API.", + "key": "Authorization", + "value": "ea laborum" + } + ], + "url": { + "raw": "{{baseUrl}}/content/v2/retire/:Content_Id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v2", + "retire", + ":Content_Id" + ], + "variable": [ + { + "key": "Content_Id", + "value": "ea laborum", + "description": "(Required) Please append a valid Content Id To the Request URL" + } + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"api.content.retire\",\n \"ver\": \"3.0\",\n \"ts\": \"2020-12-11T12:01:24ZZ\",\n \"params\": {\n \"resmsgid\": \"ec20ec05-581c-4559-988a-449f3c5ae698\",\n \"msgid\": null,\n \"err\": \"ERR_CONTENT_RETIRE\",\n \"status\": \"failed\",\n \"errmsg\": \"Content with Identifier do_11316298360130764811 is already Retired.\"\n },\n \"responseCode\": \"CLIENT_ERROR\",\n \"result\": {\n \"messages\": null\n }\n}" + }, + { + "name": "RESOURCE NOT FOUND,**Content Send for Flag Accept** operation failed !The possible reason for failure is that you may have provided wrong content id.", + "originalRequest": { + "method": "DELETE", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Registered User ID to execute the API.", + "key": "X-Authenticated-User-token", + "value": "ea laborum" + }, + { + "description": "(Required) All content APIs require authorization for use. Specify the authorization key received from the administrator when placing the request for use of the API.", + "key": "Authorization", + "value": "ea laborum" + } + ], + "url": { + "raw": "{{baseUrl}}/content/v2/retire/:Content_Id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v2", + "retire", + ":Content_Id" + ], + "variable": [ + { + "key": "Content_Id", + "value": "ea laborum", + "description": "(Required) Please append a valid Content Id To the Request URL" + } + ] + } + }, + "status": "Not Found", + "code": 404, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"api.content.retire\",\n \"ver\": \"3.0\",\n \"ts\": \"2020-12-11T11:56:35ZZ\",\n \"params\": {\n \"resmsgid\": \"d826e808-2866-4603-9b60-0a3130a37128\",\n \"msgid\": null,\n \"err\": \"NOT_FOUND\",\n \"status\": \"failed\",\n \"errmsg\": \"Error! Node(s) doesn't Exists. | [Invalid Node Id.]: do_213143334457982976144\"\n },\n \"responseCode\": \"RESOURCE_NOT_FOUND\",\n \"result\": {\n \"messages\": null\n }\n}" + }, + { + "name": "INTERNAL SERVER ERROR ! Looks like something went wrong! These errors are tracked automatically, but if the problem persists feel free to contact us. In the meantime, try refreshing.", + "originalRequest": { + "method": "DELETE", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Registered User ID to execute the API.", + "key": "X-Authenticated-User-token", + "value": "ea laborum" + }, + { + "description": "(Required) All content APIs require authorization for use. Specify the authorization key received from the administrator when placing the request for use of the API.", + "key": "Authorization", + "value": "ea laborum" + } + ], + "url": { + "raw": "{{baseUrl}}/content/v2/retire/:Content_Id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v2", + "retire", + ":Content_Id" + ], + "variable": [ + { + "key": "Content_Id", + "value": "ea laborum", + "description": "(Required) Please append a valid Content Id To the Request URL" + } + ] + } + }, + "status": "Internal Server Error", + "code": 500, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"result\": {},\n \"id\": \"cupidatat reprehenderit dolor\",\n \"ver\": \"minim anim commodo\",\n \"ts\": \"commodo\",\n \"params\": {\n \"resmsgid\": \"pariatur repre\",\n \"msgid\": \"irure\",\n \"err\": \"consequat esse ea\",\n \"status\": \"esse\",\n \"errmsg\": \"aliqua laboris velit\"\n },\n \"responseCode\": \"reprehenderit dolor elit sunt dolore\"\n}" + } + ] + } + ] + }, + { + "name": "Negative", + "item": [ + { + "name": "Retire Content which is already retired", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json()\r", + "\r", + "//Verification\r", + "pm.test(\"Status code is 400\", function () {\r", + " pm.response.to.have.status(400)\r", + "});\r", + "pm.test(\"Params has keys: resmsgid , msgid , err , status , errmsg \", () => {\r", + " pm.expect(jsonResponse.params).to.have.all.keys('resmsgid', 'msgid','err','status','errmsg');\r", + " pm.expect(jsonResponse.params.resmsgid).to.be.a(\"string\");\r", + " pm.expect(jsonResponse.params.msgid).to.be.a('null');\r", + " pm.expect(jsonResponse.params.err).to.be.a('string');\r", + " pm.expect(jsonResponse.params.status).to.be.a(\"string\");\r", + " pm.expect(jsonResponse.params.errmsg).to.be.a('string');\r", + "});\r", + "//code name contains a string\r", + "tests[\"Status code name has string \\\"Bad Request\\\"\"] = responseCode.name.has(\"Bad Request\");\r", + "\r", + "pm.test(\"Test data type of the response and keys\", () => {\r", + " pm.expect(jsonResponse.result).to.be.an(\"object\");\r", + " pm.expect(jsonResponse.result).to.have.all.keys('messages');\r", + " pm.expect(jsonResponse.result.messages).to.be.null;\r", + "});\r", + "\r", + "//Validation\r", + "// Response body\r", + "pm.test(\"id should be api.content.retire\", function () {\r", + " pm.expect(jsonResponse.id).to.eql(\"api.content.retire\");\r", + "});\r", + "pm.test(\"ver should be 4.0\", () => {\r", + " pm.expect(jsonResponse.ver).to.eql(\"4.0\");\r", + "});\r", + "pm.test(\"responseCode should be CLIENT_ERROR\", () => {\r", + " pm.expect(jsonResponse.responseCode).to.eql(\"CLIENT_ERROR\");\r", + "});\r", + "\r", + "// Params\r", + "pm.test(\"params.err should be \\\"ERR_CONTENT_RETIRE\\\"\", () => {\r", + " pm.expect(jsonResponse.params.err).to.eql(\"ERR_CONTENT_RETIRE\");\r", + "});\r", + "pm.test(\"params.status should be \\\"failed\\\"\", () => {\r", + " pm.expect(jsonResponse.params.status).to.eql(\"failed\");\r", + "});\r", + "pm.test(`errmsg: Content with Identifier ${pm.collectionVariables.get(\"retire_content\")} is already Retired.`, () => {\r", + " pm.expect(jsonResponse.params.errmsg).to.eql(`Content with Identifier ${pm.collectionVariables.get(\"retire_content\")} is already Retired.`);\r", + "});\r", + "\r", + "// Result\r", + "pm.test(\"messages should be null\", () => {\r", + " pm.expect(jsonResponse.result.messages).to.eql(null);\r", + "});\r", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "apikey", + "apikey": [ + { + "key": "key", + "value": "Authorization", + "type": "string" + }, + { + "key": "value", + "value": "", + "type": "string" + }, + { + "key": "in", + "value": "header", + "type": "string" + } + ] + }, + "method": "DELETE", + "header": [ + { + "description": "(Required) The Registered User ID to execute the API.", + "key": "X-Authenticated-User-token", + "value": "ea laborum" + }, + { + "description": "(Required) All content APIs require authorization for use. Specify the authorization key received from the administrator when placing the request for use of the API.", + "key": "Authorization", + "value": "ea laborum" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "url": { + "raw": "{{baseUrl}}/content/v4/retire/{{retire_content}}", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v4", + "retire", + "{{retire_content}}" + ] + }, + "description": "This API is associated with retiring content on the Sunbird Platform .\n - The **_/retire/{contentId}_** endpoint executes \"Retire Content\" request based on content Id to delete the specific content.'\n - The endpoint for **Retire Content** is `/content/v2/retire`\n - It points to knowledge-mw-service - `/v2/content/retire`\n - {...}refers to a section of review endpoint URL path that needs to be replaced by appropriate Id.\n - It is mandatory to provide values for parameters.\n - Mandatory fields cannot be null or empty." + }, + "response": [ + { + "name": "OK ! Successful operation.**Content deletion operation was successfully executed.", + "originalRequest": { + "method": "DELETE", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Registered User ID to execute the API.", + "key": "X-Authenticated-User-token", + "value": "ea laborum" + }, + { + "description": "(Required) All content APIs require authorization for use. Specify the authorization key received from the administrator when placing the request for use of the API.", + "key": "Authorization", + "value": "ea laborum" + } + ], + "url": { + "raw": "{{baseUrl}}/content/v2/retire/:Content_Id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v2", + "retire", + ":Content_Id" + ], + "variable": [ + { + "key": "Content_Id", + "value": "ea laborum", + "description": "(Required) Please append a valid Content Id To the Request URL" + } + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"api.content.retire\",\n \"ver\": \"3.0\",\n \"ts\": \"2020-12-11T12:05:52ZZ\",\n \"params\": {\n \"resmsgid\": \"ebd2655a-a69a-460c-9bcf-0f45f5938fac\",\n \"msgid\": null,\n \"err\": null,\n \"status\": \"successful\",\n \"errmsg\": null\n },\n \"responseCode\": \"OK\",\n \"result\": {\n \"identifier\": \"do_11283183576849612818\",\n \"node_id\": \"do_11283183576849612818\"\n }\n}" + }, + { + "name": "ERR CONTENT RETIRE! Content is already retired.", + "originalRequest": { + "method": "DELETE", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Registered User ID to execute the API.", + "key": "X-Authenticated-User-token", + "value": "ea laborum" + }, + { + "description": "(Required) All content APIs require authorization for use. Specify the authorization key received from the administrator when placing the request for use of the API.", + "key": "Authorization", + "value": "ea laborum" + } + ], + "url": { + "raw": "{{baseUrl}}/content/v2/retire/:Content_Id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v2", + "retire", + ":Content_Id" + ], + "variable": [ + { + "key": "Content_Id", + "value": "ea laborum", + "description": "(Required) Please append a valid Content Id To the Request URL" + } + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"api.content.retire\",\n \"ver\": \"3.0\",\n \"ts\": \"2020-12-11T12:01:24ZZ\",\n \"params\": {\n \"resmsgid\": \"ec20ec05-581c-4559-988a-449f3c5ae698\",\n \"msgid\": null,\n \"err\": \"ERR_CONTENT_RETIRE\",\n \"status\": \"failed\",\n \"errmsg\": \"Content with Identifier do_11316298360130764811 is already Retired.\"\n },\n \"responseCode\": \"CLIENT_ERROR\",\n \"result\": {\n \"messages\": null\n }\n}" + }, + { + "name": "RESOURCE NOT FOUND,**Content Send for Flag Accept** operation failed !The possible reason for failure is that you may have provided wrong content id.", + "originalRequest": { + "method": "DELETE", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Registered User ID to execute the API.", + "key": "X-Authenticated-User-token", + "value": "ea laborum" + }, + { + "description": "(Required) All content APIs require authorization for use. Specify the authorization key received from the administrator when placing the request for use of the API.", + "key": "Authorization", + "value": "ea laborum" + } + ], + "url": { + "raw": "{{baseUrl}}/content/v2/retire/:Content_Id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v2", + "retire", + ":Content_Id" + ], + "variable": [ + { + "key": "Content_Id", + "value": "ea laborum", + "description": "(Required) Please append a valid Content Id To the Request URL" + } + ] + } + }, + "status": "Not Found", + "code": 404, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"api.content.retire\",\n \"ver\": \"3.0\",\n \"ts\": \"2020-12-11T11:56:35ZZ\",\n \"params\": {\n \"resmsgid\": \"d826e808-2866-4603-9b60-0a3130a37128\",\n \"msgid\": null,\n \"err\": \"NOT_FOUND\",\n \"status\": \"failed\",\n \"errmsg\": \"Error! Node(s) doesn't Exists. | [Invalid Node Id.]: do_213143334457982976144\"\n },\n \"responseCode\": \"RESOURCE_NOT_FOUND\",\n \"result\": {\n \"messages\": null\n }\n}" + }, + { + "name": "INTERNAL SERVER ERROR ! Looks like something went wrong! These errors are tracked automatically, but if the problem persists feel free to contact us. In the meantime, try refreshing.", + "originalRequest": { + "method": "DELETE", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Registered User ID to execute the API.", + "key": "X-Authenticated-User-token", + "value": "ea laborum" + }, + { + "description": "(Required) All content APIs require authorization for use. Specify the authorization key received from the administrator when placing the request for use of the API.", + "key": "Authorization", + "value": "ea laborum" + } + ], + "url": { + "raw": "{{baseUrl}}/content/v2/retire/:Content_Id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v2", + "retire", + ":Content_Id" + ], + "variable": [ + { + "key": "Content_Id", + "value": "ea laborum", + "description": "(Required) Please append a valid Content Id To the Request URL" + } + ] + } + }, + "status": "Internal Server Error", + "code": 500, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"result\": {},\n \"id\": \"cupidatat reprehenderit dolor\",\n \"ver\": \"minim anim commodo\",\n \"ts\": \"commodo\",\n \"params\": {\n \"resmsgid\": \"pariatur repre\",\n \"msgid\": \"irure\",\n \"err\": \"consequat esse ea\",\n \"status\": \"esse\",\n \"errmsg\": \"aliqua laboris velit\"\n },\n \"responseCode\": \"reprehenderit dolor elit sunt dolore\"\n}" + } + ] + }, + { + "name": "Retire an invalid content", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json()\r", + "\r", + "//Verification\r", + "pm.test(\"Status code is 404\", function () {\r", + " pm.response.to.have.status(404)\r", + "});\r", + "pm.test(\"Params has keys: resmsgid , msgid , err , status , errmsg \", () => {\r", + " pm.expect(jsonResponse.params).to.have.all.keys('resmsgid', 'msgid','err','status','errmsg');\r", + " pm.expect(jsonResponse.params.resmsgid).to.be.a(\"string\");\r", + " pm.expect(jsonResponse.params.msgid).to.be.a('null');\r", + " pm.expect(jsonResponse.params.err).to.be.a('string');\r", + " pm.expect(jsonResponse.params.status).to.be.a(\"string\");\r", + " pm.expect(jsonResponse.params.errmsg).to.be.a('string');\r", + "});\r", + "//code name contains a string\r", + "tests[\"Status code name has string \\\"Not Found\\\"\"] = responseCode.name.has(\"Not Found\");\r", + "\r", + "pm.test(\"Test data type of the response and keys\", () => {\r", + " pm.expect(jsonResponse.result).to.be.an(\"object\");\r", + " pm.expect(jsonResponse.result).to.have.all.keys('messages');\r", + " pm.expect(jsonResponse.result.messages).to.be.null;\r", + "});\r", + "\r", + "//Validation\r", + "// Response body\r", + "pm.test(\"id should be api.content.retire\", () => {\r", + " pm.expect(jsonResponse.id).to.eql(\"api.content.retire\");\r", + "});\r", + "pm.test(\"ver should be 4.0\", () => {\r", + " pm.expect(jsonResponse.ver).to.eql(\"4.0\");\r", + "});\r", + "pm.test(\"responseCode should be RESOURCE_NOT_FOUND\", () => {\r", + " pm.expect(jsonResponse.responseCode).to.eql(\"RESOURCE_NOT_FOUND\");\r", + "});\r", + "\r", + "// Params\r", + "pm.test(\"params.err should be \\\"NOT_FOUND\\\"\", () => {\r", + " pm.expect(jsonResponse.params.err).to.eql(\"NOT_FOUND\");\r", + "});\r", + "pm.test(\"params.status should be \\\"failed\\\"\", () => {\r", + " pm.expect(jsonResponse.params.status).to.eql(\"failed\");\r", + "});\r", + "pm.test(`Error! Node(s) doesn't Exists. | [Invalid Node Id.]: dummy`, () => {\r", + " pm.expect(jsonResponse.params.errmsg).to.eql(`Error! Node(s) doesn't Exists. | [Invalid Node Id.]: dummy`);\r", + "});\r", + "\r", + "// Result\r", + "pm.test(\"messages should be null\", () => {\r", + " pm.expect(jsonResponse.result.messages).to.eql(null);\r", + "});\r", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "apikey", + "apikey": [ + { + "key": "key", + "value": "Authorization", + "type": "string" + }, + { + "key": "value", + "value": "", + "type": "string" + }, + { + "key": "in", + "value": "header", + "type": "string" + } + ] + }, + "method": "DELETE", + "header": [ + { + "description": "(Required) The Registered User ID to execute the API.", + "key": "X-Authenticated-User-token", + "value": "ea laborum" + }, + { + "description": "(Required) All content APIs require authorization for use. Specify the authorization key received from the administrator when placing the request for use of the API.", + "key": "Authorization", + "value": "ea laborum" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "url": { + "raw": "{{baseUrl}}/content/v4/retire/dummy", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v4", + "retire", + "dummy" + ] + }, + "description": "This API is associated with retiring content on the Sunbird Platform .\n - The **_/retire/{contentId}_** endpoint executes \"Retire Content\" request based on content Id to delete the specific content.'\n - The endpoint for **Retire Content** is `/content/v2/retire`\n - It points to knowledge-mw-service - `/v2/content/retire`\n - {...}refers to a section of review endpoint URL path that needs to be replaced by appropriate Id.\n - It is mandatory to provide values for parameters.\n - Mandatory fields cannot be null or empty." + }, + "response": [ + { + "name": "OK ! Successful operation.**Content deletion operation was successfully executed.", + "originalRequest": { + "method": "DELETE", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Registered User ID to execute the API.", + "key": "X-Authenticated-User-token", + "value": "ea laborum" + }, + { + "description": "(Required) All content APIs require authorization for use. Specify the authorization key received from the administrator when placing the request for use of the API.", + "key": "Authorization", + "value": "ea laborum" + } + ], + "url": { + "raw": "{{baseUrl}}/content/v2/retire/:Content_Id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v2", + "retire", + ":Content_Id" + ], + "variable": [ + { + "key": "Content_Id", + "value": "ea laborum", + "description": "(Required) Please append a valid Content Id To the Request URL" + } + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"api.content.retire\",\n \"ver\": \"3.0\",\n \"ts\": \"2020-12-11T12:05:52ZZ\",\n \"params\": {\n \"resmsgid\": \"ebd2655a-a69a-460c-9bcf-0f45f5938fac\",\n \"msgid\": null,\n \"err\": null,\n \"status\": \"successful\",\n \"errmsg\": null\n },\n \"responseCode\": \"OK\",\n \"result\": {\n \"identifier\": \"do_11283183576849612818\",\n \"node_id\": \"do_11283183576849612818\"\n }\n}" + }, + { + "name": "ERR CONTENT RETIRE! Content is already retired.", + "originalRequest": { + "method": "DELETE", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Registered User ID to execute the API.", + "key": "X-Authenticated-User-token", + "value": "ea laborum" + }, + { + "description": "(Required) All content APIs require authorization for use. Specify the authorization key received from the administrator when placing the request for use of the API.", + "key": "Authorization", + "value": "ea laborum" + } + ], + "url": { + "raw": "{{baseUrl}}/content/v2/retire/:Content_Id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v2", + "retire", + ":Content_Id" + ], + "variable": [ + { + "key": "Content_Id", + "value": "ea laborum", + "description": "(Required) Please append a valid Content Id To the Request URL" + } + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"api.content.retire\",\n \"ver\": \"3.0\",\n \"ts\": \"2020-12-11T12:01:24ZZ\",\n \"params\": {\n \"resmsgid\": \"ec20ec05-581c-4559-988a-449f3c5ae698\",\n \"msgid\": null,\n \"err\": \"ERR_CONTENT_RETIRE\",\n \"status\": \"failed\",\n \"errmsg\": \"Content with Identifier do_11316298360130764811 is already Retired.\"\n },\n \"responseCode\": \"CLIENT_ERROR\",\n \"result\": {\n \"messages\": null\n }\n}" + }, + { + "name": "RESOURCE NOT FOUND,**Content Send for Flag Accept** operation failed !The possible reason for failure is that you may have provided wrong content id.", + "originalRequest": { + "method": "DELETE", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Registered User ID to execute the API.", + "key": "X-Authenticated-User-token", + "value": "ea laborum" + }, + { + "description": "(Required) All content APIs require authorization for use. Specify the authorization key received from the administrator when placing the request for use of the API.", + "key": "Authorization", + "value": "ea laborum" + } + ], + "url": { + "raw": "{{baseUrl}}/content/v2/retire/:Content_Id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v2", + "retire", + ":Content_Id" + ], + "variable": [ + { + "key": "Content_Id", + "value": "ea laborum", + "description": "(Required) Please append a valid Content Id To the Request URL" + } + ] + } + }, + "status": "Not Found", + "code": 404, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"api.content.retire\",\n \"ver\": \"3.0\",\n \"ts\": \"2020-12-11T11:56:35ZZ\",\n \"params\": {\n \"resmsgid\": \"d826e808-2866-4603-9b60-0a3130a37128\",\n \"msgid\": null,\n \"err\": \"NOT_FOUND\",\n \"status\": \"failed\",\n \"errmsg\": \"Error! Node(s) doesn't Exists. | [Invalid Node Id.]: do_213143334457982976144\"\n },\n \"responseCode\": \"RESOURCE_NOT_FOUND\",\n \"result\": {\n \"messages\": null\n }\n}" + }, + { + "name": "INTERNAL SERVER ERROR ! Looks like something went wrong! These errors are tracked automatically, but if the problem persists feel free to contact us. In the meantime, try refreshing.", + "originalRequest": { + "method": "DELETE", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Registered User ID to execute the API.", + "key": "X-Authenticated-User-token", + "value": "ea laborum" + }, + { + "description": "(Required) All content APIs require authorization for use. Specify the authorization key received from the administrator when placing the request for use of the API.", + "key": "Authorization", + "value": "ea laborum" + } + ], + "url": { + "raw": "{{baseUrl}}/content/v2/retire/:Content_Id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v2", + "retire", + ":Content_Id" + ], + "variable": [ + { + "key": "Content_Id", + "value": "ea laborum", + "description": "(Required) Please append a valid Content Id To the Request URL" + } + ] + } + }, + "status": "Internal Server Error", + "code": 500, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"result\": {},\n \"id\": \"cupidatat reprehenderit dolor\",\n \"ver\": \"minim anim commodo\",\n \"ts\": \"commodo\",\n \"params\": {\n \"resmsgid\": \"pariatur repre\",\n \"msgid\": \"irure\",\n \"err\": \"consequat esse ea\",\n \"status\": \"esse\",\n \"errmsg\": \"aliqua laboris velit\"\n },\n \"responseCode\": \"reprehenderit dolor elit sunt dolore\"\n}" + } + ] + } + ] + }, + { + "name": "Discard content", + "item": [ + { + "name": "Pre requisite", + "item": [ + { + "name": "Create draft content", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json();\r", + "\r", + "pm.collectionVariables.set(\"discard_content\", jsonResponse.result.identifier);\r", + "console.log(pm.collectionVariables.get(\"discard_content\"));\r", + "\r", + "" + ], + "type": "text/javascript" + } + } + ], + "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}}" + }, + { + "key": "X-Channel-Id", + "value": "sunbird" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"content\": {\n \"name\": \"Untitled Content\",\n \"code\": \"1242e9ea-660a-4536-a142-cc242a7a4162\",\n \"mimeType\": \"video/mp4\",\n \"primaryCategory\": \"Explanation Content\",\n \"body\": \"{\\\"key\\\":\\\"value\\\"}\"\n }\n }\n}" + }, + "url": { + "raw": "{{host}}/content/v4/create", + "host": [ + "{{host}}" + ], + "path": [ + "content", + "v4", + "create" + ] + } + }, + "response": [] + }, + { + "name": "Create Content", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json();\r", + "\r", + "pm.collectionVariables.set(\"discard_livecontent\", jsonResponse.result.identifier);\r", + "console.log(pm.collectionVariables.get(\"discard_livecontent\"));\r", + "\r", + "" + ], + "type": "text/javascript" + } + } + ], + "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}}" + }, + { + "key": "X-Channel-Id", + "value": "sunbird" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"content\": {\n \"name\": \"Untitled Content\",\n \"code\": \"1242e9ea-660a-4536-a142-cc242a7a4162\",\n \"mimeType\": \"video/mp4\",\n \"primaryCategory\": \"Explanation Content\",\n \"body\": \"{\\\"key\\\":\\\"value\\\"}\"\n }\n }\n}" + }, + "url": { + "raw": "{{host}}/content/v4/create", + "host": [ + "{{host}}" + ], + "path": [ + "content", + "v4", + "create" + ] + }, + "description": "This API is associated with creating content on the Sunbird Platform.\n - The endpoint for **Create Content** is `/content/v2/create`\n - It points to knowledge-mw-service - `/v2/content/create`\n - It is mandatory to provide values for parameters marked with *.\n - Mandatory fields cannot be null or empty." + }, + "response": [ + { + "name": "SUCCESS. The **Create Content** operation was successful!", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource.Possible media types can be:-\n - Application/json", + "key": "Content-Type", + "value": "ea laborum" + }, + { + "description": "(Required) Represents a physical location (e.g: state) uniquely to which the user belongs.", + "key": "x-channel-id", + "value": "ea laborum" + }, + { + "description": "(Required) Represents the authorized User ID to execute the API.", + "key": "X-Authenticated-User-Token", + "value": "ea laborum" + }, + { + "description": "(Required) To make use of the API, you require authorization. Raise a request to the administrator for the use of the API. You will receive the authorization key. Specify the key received, here.", + "key": "Authorization", + "value": "ea laborum" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"content\": {\n \"name\": \"H5P Content\",\n \"code\": \"h5pcontent\",\n \"mimeType\": \"application/vnd.ekstep.h5p-archive\",\n \"primaryCategory\": \"Resource\",\n \"createdBy\": \"874ed8a5-782e-4f6c-8f36-e0288455901e\"\n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/content/v2/create", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v2", + "create" + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"api.content.create\",\n \"ver\": \"3.0\",\n \"ts\": \"2020-12-10T20:24:45ZZ\",\n \"params\": {\n \"resmsgid\": \"3be02c4b-3324-41a3-afd8-60f6be0584d2\",\n \"msgid\": null,\n \"err\": null,\n \"status\": \"successful\",\n \"errmsg\": null\n },\n \"responseCode\": \"OK\",\n \"result\": {\n \"identifier\": \"do_1131697204035993601314\",\n \"node_id\": \"do_1131697204035993601314\",\n \"versionKey\": \"1607631885207\"\n }\n}" + }, + { + "name": "'BAD REQUEST. The **Create Content** operation failed. You may have missed input for a mandatory parameter.'", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource.Possible media types can be:-\n - Application/json", + "key": "Content-Type", + "value": "ea laborum" + }, + { + "description": "(Required) Represents a physical location (e.g: state) uniquely to which the user belongs.", + "key": "x-channel-id", + "value": "ea laborum" + }, + { + "description": "(Required) Represents the authorized User ID to execute the API.", + "key": "X-Authenticated-User-Token", + "value": "ea laborum" + }, + { + "description": "(Required) To make use of the API, you require authorization. Raise a request to the administrator for the use of the API. You will receive the authorization key. Specify the key received, here.", + "key": "Authorization", + "value": "ea laborum" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"content\": {\n \"name\": \"H5P Content\",\n \"code\": \"h5pcontent\",\n \"mimeType\": \"application/vnd.ekstep.h5p-archive\",\n \"primaryCategory\": \"Resource\",\n \"createdBy\": \"874ed8a5-782e-4f6c-8f36-e0288455901e\"\n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/content/v2/create", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v2", + "create" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"api.content.create\",\n \"ver\": \"1.0\",\n \"ts\": \"2020-12-10T08:50:29.786Z\",\n \"params\": {\n \"resmsgid\": \"c169a7a0-3ac4-11eb-b0a2-8d5c9f561887\",\n \"msgid\": null,\n \"status\": \"failed\",\n \"err\": \"ERR_CONTENT_CREATE_FIELDS_MISSING\",\n \"errmsg\": \"Required fields for create content are missing\"\n },\n \"responseCode\": \"CLIENT_ERROR\",\n \"result\": {}\n}" + }, + { + "name": "'INTERNAL SERVER ERROR. We track these errors automatically and try to set it right at the earliest. Try refreshing the page. If the problem persists contact us at info@sunbird.org.'", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource.Possible media types can be:-\n - Application/json", + "key": "Content-Type", + "value": "ea laborum" + }, + { + "description": "(Required) Represents a physical location (e.g: state) uniquely to which the user belongs.", + "key": "x-channel-id", + "value": "ea laborum" + }, + { + "description": "(Required) Represents the authorized User ID to execute the API.", + "key": "X-Authenticated-User-Token", + "value": "ea laborum" + }, + { + "description": "(Required) To make use of the API, you require authorization. Raise a request to the administrator for the use of the API. You will receive the authorization key. Specify the key received, here.", + "key": "Authorization", + "value": "ea laborum" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"content\": {\n \"name\": \"H5P Content\",\n \"code\": \"h5pcontent\",\n \"mimeType\": \"application/vnd.ekstep.h5p-archive\",\n \"primaryCategory\": \"Resource\",\n \"createdBy\": \"874ed8a5-782e-4f6c-8f36-e0288455901e\"\n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/content/v2/create", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v2", + "create" + ] + } + }, + "status": "Internal Server Error", + "code": 500, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"api.content.create\",\n \"ver\": \"1.0\",\n \"ts\": \"2020-12-10T08:51:51.647Z\",\n \"params\": {\n \"resmsgid\": \"f234a6f0-3ac4-11eb-b0a2-8d5c9f561887\",\n \"msgid\": null,\n \"status\": \"failed\",\n \"err\": null,\n \"errmsg\": null\n },\n \"responseCode\": \"SERVER_ERROR\",\n \"result\": {}\n}" + } + ] + }, + { + "name": "Upload URL", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json();\r", + "\r", + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "pm.test(\"Status code name has string OK\", function () {\r", + " pm.response.to.have.status(\"OK\");\r", + "});\r", + "pm.test(\"id should be api.content.upload.url\", function () {\r", + " pm.expect(jsonResponse.id).to.eql(\"api.content.upload.url\");\r", + "});\r", + "pm.test(\"ver should be 4.0\", function () {\r", + " pm.expect(jsonResponse.ver).to.eql(\"4.0\");\r", + "});\r", + "\r", + "pm.test(\"Params has keys: resmsgid , msgid , err , status , errmsg \", () => {\r", + " pm.expect(jsonResponse.params).to.have.all.keys('resmsgid', 'msgid','err','status','errmsg');\r", + " pm.expect(jsonResponse.params.resmsgid).to.be.a(\"string\");\r", + " pm.expect(jsonResponse.params.msgid).to.be.a('null');\r", + " pm.expect(jsonResponse.params.err).to.be.a('null');\r", + " pm.expect(jsonResponse.params.status).to.be.a(\"string\");\r", + " pm.expect(jsonResponse.params.errmsg).to.be.a('null');\r", + "});\r", + "\r", + "pm.test(\"Status is successful\", function () {\r", + " pm.expect(jsonResponse.params.status).to.be.equal(\"successful\");\r", + "});\r", + "\r", + "pm.test(\"ResponseCode is OK\", function () {\r", + " pm.expect(jsonResponse.responseCode).to.be.equal(\"OK\");\r", + "});\r", + "\r", + "\r", + "pm.test(\"Verify keys and data type of the response result\", () => {\r", + " pm.expect(jsonResponse.result).to.have.all.keys('identifier', 'url_expiry', 'pre_signed_url');\r", + "});\r", + "pm.collectionVariables.set(\"pre_signed_URL\",jsonResponse.result.pre_signed_url );\r", + "console.log(pm.collectionVariables.get(\"pre_signed_URL\"));\r", + "\r", + "\r", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "apikey", + "apikey": [ + { + "key": "key", + "value": "Authorization", + "type": "string" + }, + { + "key": "value", + "value": "", + "type": "string" + }, + { + "key": "in", + "value": "header", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "description": "(Required) The Content Type entity is the media type of the resource.Possible media types can be:-\n - Application/json", + "key": "Content-Type", + "value": "application/json" + }, + { + "description": "(Required) The Registered User ID to execute the API.", + "key": "X-Authenticated-Userid", + "value": "ea laborum" + }, + { + "description": "(Required) All content APIs require authorization for use. Specify the authorization key received from the administrator when placing the request for use of the API.", + "key": "Authorization", + "value": "ea laborum" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"content\": {\n \"fileName\":\"test.pdf\"\n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/content/v4/upload/url/{{discard_livecontent}}", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v4", + "upload", + "url", + "{{discard_livecontent}}" + ] + }, + "description": "This API is associated with uploading content on the Sunbird Platform .\n - The**_/upload/url/{content Id}_** endpoint executes \"Upload Content URL\" request based on parameters provided as metadata in the request body.\n - The endpoint for **Upload Content URL** is `/content/v2/upload/url`\n - It points to knowledge-mw-service - `/v2/content/upload/url`\n - {...}refers to a section of upload endpoint URL path that needs to be replaced by appropriate Id.\n - You need to provide a valid content Id value in {Content Id} field of API URL.\n - On Success api returns pre-signed-url link with come configured ttl against which file can be uploaded.\n - It is mandatory to provide values for parameters marked with *.\n - Mandatory fields cannot be null or empty." + }, + "response": [ + { + "name": "OK ! Successful operation.\"Content upload\" operation was successfully executed.", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource.Possible media types can be:-\n - Application/json", + "key": "Content-Type", + "value": "ea laborum" + }, + { + "description": "(Required) The Registered User ID to execute the API.", + "key": "X-Authenticated-Userid", + "value": "ea laborum" + }, + { + "description": "(Required) All content APIs require authorization for use. Specify the authorization key received from the administrator when placing the request for use of the API.", + "key": "Authorization", + "value": "ea laborum" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"content\": {\n \"fileName\": \"test.pdf\"\n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/content/v2/upload/url/:Content_Id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v2", + "upload", + "url", + ":Content_Id" + ], + "variable": [ + { + "key": "Content_Id", + "value": "ea laborum", + "description": "(Required) Please append a valid Content Id To the Request URL" + } + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"api.content.upload.url\",\n \"ver\": \"3.0\",\n \"ts\": \"2020-12-11T23:52:44ZZ\",\n \"params\": {\n \"resmsgid\": \"81e308fa-3e36-45ff-b295-e28e8f757dc7\",\n \"msgid\": null,\n \"err\": null,\n \"status\": \"successful\",\n \"errmsg\": null\n },\n \"responseCode\": \"OK\",\n \"result\": {\n \"identifier\": \"do_11317053041892556811094\",\n \"url_expiry\": \"54000\",\n \"pre_signed_url\": \"https://sunbirddev.blob.core.windows.net/sunbird-content-dev/content/assets/do_11317053041892556811094/10-page-pdf.pdf?sv=2017-04-17&se=2020-12-12T14%3A52%3A44Z&sr=b&sp=w&sig=Tlt6uWI/6lMeupkEbsTAmGajmo1qzw8HeUHrVwOm6yk%3D\"\n }\n}" + }, + { + "name": "BAD REQUEST. The 'Upload Url' operation failed ! The possible reason for failure is that you may have missed providing input for a mandatory parameter.", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource.Possible media types can be:-\n - Application/json", + "key": "Content-Type", + "value": "ea laborum" + }, + { + "description": "(Required) The Registered User ID to execute the API.", + "key": "X-Authenticated-Userid", + "value": "ea laborum" + }, + { + "description": "(Required) All content APIs require authorization for use. Specify the authorization key received from the administrator when placing the request for use of the API.", + "key": "Authorization", + "value": "ea laborum" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"content\": {\n \"fileName\": \"test.pdf\"\n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/content/v2/upload/url/:Content_Id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v2", + "upload", + "url", + ":Content_Id" + ], + "variable": [ + { + "key": "Content_Id", + "value": "ea laborum", + "description": "(Required) Please append a valid Content Id To the Request URL" + } + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"api.content.upload.url\",\n \"ver\": \"3.0\",\n \"ts\": \"2020-12-11T23:54:07ZZ\",\n \"params\": {\n \"resmsgid\": \"4edde64d-3116-4271-bcc1-a8ba0ec2d56b\",\n \"msgid\": null,\n \"err\": \"ERR_CONTENT_BLANK_FILE_NAME\",\n \"status\": \"failed\",\n \"errmsg\": \"File name is blank\"\n },\n \"responseCode\": \"CLIENT_ERROR\",\n \"result\": {\n \"messages\": null\n }\n}" + }, + { + "name": "RESOURCE NOT FOUND,**Content Id sent for generating upload url** operation failed !The possible reason for failure is that you may have provided wrong content id.", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource.Possible media types can be:-\n - Application/json", + "key": "Content-Type", + "value": "ea laborum" + }, + { + "description": "(Required) The Registered User ID to execute the API.", + "key": "X-Authenticated-Userid", + "value": "ea laborum" + }, + { + "description": "(Required) All content APIs require authorization for use. Specify the authorization key received from the administrator when placing the request for use of the API.", + "key": "Authorization", + "value": "ea laborum" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"content\": {\n \"fileName\": \"test.pdf\"\n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/content/v2/upload/url/:Content_Id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v2", + "upload", + "url", + ":Content_Id" + ], + "variable": [ + { + "key": "Content_Id", + "value": "ea laborum", + "description": "(Required) Please append a valid Content Id To the Request URL" + } + ] + } + }, + "status": "Not Found", + "code": 404, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"api.upload.url\",\n \"ver\": \"1.0\",\n \"ts\": \"2020-12-11T23:48:26.694Z\",\n \"params\": {\n \"resmsgid\": \"5cf72660-3c0b-11eb-b0a2-8d5c9f561887\",\n \"msgid\": null,\n \"status\": \"failed\",\n \"err\": \"NOT_FOUND\",\n \"errmsg\": \"Error! Node(s) doesn't Exists. | [Invalid Node Id.]: do_11254577204586086415\"\n },\n \"responseCode\": \"RESOURCE_NOT_FOUND\",\n \"result\": {}\n}" + }, + { + "name": "INTERNAL SERVER ERROR ! Looks like something went wrong! These errors are tracked automatically, but if the problem persists feel free to contact us. In the meantime, try refreshing.", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource.Possible media types can be:-\n - Application/json", + "key": "Content-Type", + "value": "ea laborum" + }, + { + "description": "(Required) The Registered User ID to execute the API.", + "key": "X-Authenticated-Userid", + "value": "ea laborum" + }, + { + "description": "(Required) All content APIs require authorization for use. Specify the authorization key received from the administrator when placing the request for use of the API.", + "key": "Authorization", + "value": "ea laborum" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"content\": {\n \"fileName\": \"test.pdf\"\n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/content/v2/upload/url/:Content_Id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v2", + "upload", + "url", + ":Content_Id" + ], + "variable": [ + { + "key": "Content_Id", + "value": "ea laborum", + "description": "(Required) Please append a valid Content Id To the Request URL" + } + ] + } + }, + "status": "Internal Server Error", + "code": 500, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"result\": {},\n \"id\": \"cupidatat reprehenderit dolor\",\n \"ver\": \"minim anim commodo\",\n \"ts\": \"commodo\",\n \"params\": {\n \"resmsgid\": \"pariatur repre\",\n \"msgid\": \"irure\",\n \"err\": \"consequat esse ea\",\n \"status\": \"esse\",\n \"errmsg\": \"aliqua laboris velit\"\n },\n \"responseCode\": \"reprehenderit dolor elit sunt dolore\"\n}" + } + ] + }, + { + "name": "Upload file to the URL", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 201\", function () {\r", + " pm.response.to.have.status(201);\r", + "});\r", + "\r", + "var fullUrl= pm.collectionVariables.get(\"pre_signed_URL\");\r", + "\r", + "// Find the index of '?' to get the position of the query parameters\r", + "var indexOfQuestionMark = fullUrl.indexOf('?');\r", + "\r", + "// Extract the partial URL without the query parameters\r", + "var partialUrl = indexOfQuestionMark !== -1 ? fullUrl.slice(0, indexOfQuestionMark) : fullUrl;\r", + "pm.collectionVariables.set(\"partial_URL\", partialUrl);\r", + "// Log the partial URL to the console (you can remove this line if not needed)\r", + "console.log(pm.collectionVariables.get(\"partial_URL\"));\r", + "\r", + "// Now you can use the 'partialUrl' variable in Postman as needed\r", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "PUT", + "header": [ + { + "key": "X-Ms-Blob-Type", + "value": "BlockBlob" + } + ], + "body": { + "mode": "formdata", + "formdata": [ + { + "key": "file", + "type": "file", + "src": "/C:/Users/Qualitrix/Downloads/pdf_233.pdf" + } + ] + }, + "url": { + "raw": "{{pre_signed_URL}}", + "host": [ + "{{pre_signed_URL}}" + ] + } + }, + "response": [] + }, + { + "name": "Update the content with URL and mime type", + "event": [ + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + }, + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json();\r", + "\r", + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "pm.test(\"Status code name has string OK\", function () {\r", + " pm.response.to.have.status(\"OK\");\r", + "});\r", + "pm.test(\"id should be api.content.upload\", function () {\r", + " pm.expect(jsonResponse.id).to.eql(\"api.content.upload\");\r", + "});\r", + "pm.test(\"ver should be 4.0\", function () {\r", + " pm.expect(jsonResponse.ver).to.eql(\"4.0\");\r", + "});\r", + "\r", + "pm.test(\"Params has keys: resmsgid , msgid , err , status , errmsg \", () => {\r", + " pm.expect(jsonResponse.params).to.have.all.keys('resmsgid', 'msgid','err','status','errmsg');\r", + " pm.expect(jsonResponse.params.resmsgid).to.be.a(\"string\");\r", + " pm.expect(jsonResponse.params.msgid).to.be.a('null');\r", + " pm.expect(jsonResponse.params.err).to.be.a('null');\r", + " pm.expect(jsonResponse.params.status).to.be.a(\"string\");\r", + " pm.expect(jsonResponse.params.errmsg).to.be.a('null');\r", + "});\r", + "\r", + "pm.test(\"Status is successful\", function () {\r", + " pm.expect(jsonResponse.params.status).to.be.equal(\"successful\");\r", + "});\r", + "\r", + "pm.test(\"ResponseCode is OK\", function () {\r", + " pm.expect(jsonResponse.responseCode).to.be.equal(\"OK\");\r", + "});\r", + "\r", + "pm.test(\"Result has keys: identifier , artifactUrl , content_url , node_id , versionKey \", () => {\r", + " pm.expect(jsonResponse.result).to.have.all.keys('identifier', 'artifactUrl','content_url','node_id','versionKey');\r", + " pm.expect(jsonResponse.result.identifier).to.be.a(\"string\");\r", + " pm.expect(jsonResponse.result.artifactUrl).to.be.a(\"string\");\r", + " pm.expect(jsonResponse.result.content_url).to.be.a(\"string\");\r", + " pm.expect(jsonResponse.result.node_id).to.be.a(\"string\");\r", + " pm.expect(jsonResponse.result.versionKey).to.be.a(\"string\");\r", + "});\r", + "\r", + "pm.test(`artifactUrl should be: ${pm.collectionVariables.get(\"partial_URL\")}`, function () {\r", + " pm.expect(jsonResponse.result.artifactUrl).to.be.equal(`${pm.collectionVariables.get(\"partial_URL\")}`);\r", + "});\r", + "\r", + "pm.test(`content_url should be: ${pm.collectionVariables.get(\"partial_URL\")}`, function () {\r", + " pm.expect(jsonResponse.result.content_url).to.be.equal(`${pm.collectionVariables.get(\"partial_URL\")}`);\r", + "});\r", + "\r", + "pm.test(`identifier should be: ${pm.collectionVariables.get(\"discard_livecontent\")}`, function () {\r", + " pm.expect(jsonResponse.result.identifier).to.be.equal(`${pm.collectionVariables.get(\"discard_livecontent\")}`);\r", + "});\r", + "\r", + "pm.test(`node_id should be: ${pm.collectionVariables.get(\"discard_livecontent\")}`, function () {\r", + " pm.expect(jsonResponse.result.node_id).to.be.equal(`${pm.collectionVariables.get(\"discard_livecontent\")}`);\r", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "user-id", + "value": "mahesh" + }, + { + "key": "Cookie", + "value": "connect.sid=s%3AnLNdCeYI27WUkZBIFdX1J5MKTM6ISEdJ.SFTq%2FeT2cVLh5TSEWmwZPCekWDSeNXILHPDyziKa26E" + }, + { + "key": "X-Channel-Id", + "value": "0137541424673095687" + }, + { + "key": "X-Authenticated-User-token", + "value": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImtpZCI6ImFjY2Vzc3YxX2tleTEifQ.eyJhdWQiOiJodHRwczovL2Rldi5zdW5iaXJkZWQub3JnL2F1dGgvcmVhbG1zL3N1bmJpcmQiLCJzdWIiOiJmOjVhOGEzZjJiLTM0MDktNDJlMC05MDAxLWY5MTNiYzBmZGUzMToxNTVjZTNjNS03MTNlLTQ3NDktYmMxYy05NWQwOWM2NDA5MTQiLCJyb2xlcyI6W3sicm9sZSI6IkNPTlRFTlRfQ1JFQVRPUiIsInNjb3BlIjpbeyJvcmdhbmlzYXRpb25JZCI6IjAxMzc1NDE0MjQ2NzMwOTU2ODcifV19LHsicm9sZSI6IkNPVVJTRV9NRU5UT1IiLCJzY29wZSI6W3sib3JnYW5pc2F0aW9uSWQiOiIwMTM3NTQxNDI0NjczMDk1Njg3In1dfSx7InJvbGUiOiJQVUJMSUMiLCJzY29wZSI6W119XSwiaXNzIjoiaHR0cHM6Ly9kZXYuc3VuYmlyZGVkLm9yZy9hdXRoL3JlYWxtcy9zdW5iaXJkIiwibmFtZSI6ImNvbnRlbnRDcmVhdG9yIiwidHlwIjoiQmVhcmVyIiwiZXhwIjoxNzAyMzI0NjU0LCJpYXQiOjE3MDIyODE0NTR9.MxiIhP6YJmI1XbozLNoJeQAbdQKs597f2mlNHWcJ-ZZIXvBx4BcX7T57B5xXGIT6LJ6YlS86saiG6SXHIG5ptgICphdefNysfVgkSUmqTsgzfzvjp2lzIw8Re7xi735Kd7B612y5Tkswm0ETP7NIeQ7-Tc_3h37GV04ISfx0LMD75UvgllxcDz91Bl6N3-WN4KwCeKIfJ-iZj-EJLwoBmJjGsgNCNTn5DTzF_joFcyett__WVc14Ex-BqRSq8Hr2fMVoHpNXze3QUJ7PcD4JRY2Ywg5R9VkHz3mkhY9kI1cWeHdQypeSsM8niQK1XCWJz_aTqsP35MshDnHkWhmDyg" + }, + { + "key": "Authorization", + "value": "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiIzZGNjMzY3OWIwYTE0NmU2YWYyZjlmZDA5NWU5NTlkNCJ9.0NZhX5sqUNy-GZUya90aQFkr5ZNiqfOuELYz_IvoyS8" + } + ], + "body": { + "mode": "formdata", + "formdata": [ + { + "key": "fileUrl", + "value": "{{partial_URL}}", + "type": "text" + }, + { + "key": "mimeType", + "value": "application/pdf", + "type": "text" + } + ] + }, + "url": { + "raw": "{{host}}/content/v4/upload/{{discard_livecontent}}", + "host": [ + "{{host}}" + ], + "path": [ + "content", + "v4", + "upload", + "{{discard_livecontent}}" + ] + } + }, + "response": [] + }, + { + "name": "Submit for Review", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json();\r", + "\r", + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "pm.test(\"Status code name has string OK\", function () {\r", + " pm.response.to.have.status(\"OK\");\r", + "});\r", + "pm.test(\"id should be api.content.review\", function () {\r", + " pm.expect(jsonResponse.id).to.eql(\"api.content.review\");\r", + "});\r", + "pm.test(\"ver should be 4.0\", function () {\r", + " pm.expect(jsonResponse.ver).to.eql(\"4.0\");\r", + "});\r", + "\r", + "pm.test(\"Params has keys: resmsgid , msgid , err , status , errmsg \", () => {\r", + " pm.expect(jsonResponse.params).to.have.all.keys('resmsgid', 'msgid','err','status','errmsg');\r", + " pm.expect(jsonResponse.params.resmsgid).to.be.a(\"string\");\r", + " pm.expect(jsonResponse.params.msgid).to.be.a('null');\r", + " pm.expect(jsonResponse.params.err).to.be.a('null');\r", + " pm.expect(jsonResponse.params.status).to.be.a(\"string\");\r", + " pm.expect(jsonResponse.params.errmsg).to.be.a('null');\r", + "});\r", + "\r", + "pm.test(\"Status is successful\", function () {\r", + " pm.expect(jsonResponse.params.status).to.be.equal(\"successful\");\r", + "});\r", + "\r", + "pm.test(\"ResponseCode is OK\", function () {\r", + " pm.expect(jsonResponse.responseCode).to.be.equal(\"OK\");\r", + "});\r", + "pm.test(\"Result has keys: identifier , versionKey\", () => {\r", + " pm.expect(jsonResponse.result).to.have.all.keys('identifier','versionKey');\r", + " pm.expect(jsonResponse.result.identifier).to.be.a(\"string\");\r", + " pm.expect(jsonResponse.result.versionKey).to.be.a(\"string\");\r", + "});\r", + "\r", + "pm.test(`identifier should be: ${pm.collectionVariables.get(\"discard_livecontent\")}`, function () {\r", + " pm.expect(jsonResponse.result.identifier).to.be.equal(`${pm.collectionVariables.get(\"discard_livecontent\")}`);\r", + "});\r", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "apikey", + "apikey": [ + { + "key": "value", + "value": "{{auth_token}}", + "type": "string" + }, + { + "key": "key", + "value": "Authorization", + "type": "string" + }, + { + "key": "in", + "value": "header", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "description": "(Required) The Content Type entity is the media type of the resource.Possible media types can be:-\n - Application/json", + "key": "Content-Type", + "value": "application/json" + }, + { + "description": "(Required) The Registered User ID to execute the API.", + "key": "X-Authenticated-User-token", + "value": "ea laborum" + }, + { + "description": "(Required) All content APIs require authorization for use. Specify the authorization key received from the administrator when placing the request for use of the API.", + "key": "Authorization", + "value": "ea laborum" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/content/v4/review/{{discard_livecontent}}", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v4", + "review", + "{{discard_livecontent}}" + ] + }, + "description": ">- This API is associated with Submission of content for Review on the Sunbird Platform .\n - The**_/review/{content Id}_** endpoint executes \"Submit for Review\" request based on parameters provided as metadata in the request body.\n - The endpoint for **Review Content** is `/content/v2/review`\n - It points to knowledge-mw-service - `/v2/content/review`\n - {...}refers to a section of review endpoint URL path that needs to be replaced by appropriate Id.\n - You need to provide a valid content Id value in {Content Id} field of API URL.\n - It is mandatory to provide values for parameters marked with *.\n - Mandatory fields cannot be null or empty." + }, + "response": [ + { + "name": "OK ! Successful operation.Content sent for review operation was successfully executed.", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource.Possible media types can be:-\n - Application/json", + "key": "Content-Type", + "value": "ea laborum" + }, + { + "description": "(Required) The Registered User ID to execute the API.", + "key": "X-Authenticated-User-token", + "value": "ea laborum" + }, + { + "description": "(Required) All content APIs require authorization for use. Specify the authorization key received from the administrator when placing the request for use of the API.", + "key": "Authorization", + "value": "ea laborum" + } + ], + "body": { + "mode": "raw", + "raw": "{}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/content/v2/review/:Content_Id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v2", + "review", + ":Content_Id" + ], + "variable": [ + { + "key": "Content_Id", + "value": "ea laborum", + "description": "(Required) Please append a valid Content Id To the Request URL" + } + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"ekstep.learning.content.review\",\n \"ver\": \"3.0\",\n \"ts\": \"2020-12-10T21:06:26ZZ\",\n \"params\": {\n \"resmsgid\": \"186cf9a9-8094-4cdd-926f-b77a030921d1\",\n \"msgid\": null,\n \"err\": null,\n \"status\": \"successful\",\n \"errmsg\": null\n },\n \"responseCode\": \"OK\",\n \"result\": {\n \"node_id\": \"do_1131697376667402241315\",\n \"versionKey\": \"1607634386533\"\n }\n}" + }, + { + "name": "RESOURCE NOT FOUND,**Content Send for Review** operation failed !The possible reason for failure is that you may have provided wrong content id.", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource.Possible media types can be:-\n - Application/json", + "key": "Content-Type", + "value": "ea laborum" + }, + { + "description": "(Required) The Registered User ID to execute the API.", + "key": "X-Authenticated-User-token", + "value": "ea laborum" + }, + { + "description": "(Required) All content APIs require authorization for use. Specify the authorization key received from the administrator when placing the request for use of the API.", + "key": "Authorization", + "value": "ea laborum" + } + ], + "body": { + "mode": "raw", + "raw": "{}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/content/v2/review/:Content_Id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v2", + "review", + ":Content_Id" + ], + "variable": [ + { + "key": "Content_Id", + "value": "ea laborum", + "description": "(Required) Please append a valid Content Id To the Request URL" + } + ] + } + }, + "status": "Not Found", + "code": 404, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"ekstep.learning.content.review\",\n \"ver\": \"3.0\",\n \"ts\": \"2020-12-10T21:06:54ZZ\",\n \"params\": {\n \"resmsgid\": \"944ac944-78d9-43e2-bfd5-337ab52b6552\",\n \"msgid\": null,\n \"err\": \"ERR_TAXONOMY_INVALID_CONTENT\",\n \"status\": \"failed\",\n \"errmsg\": \"Error! While Fetching the Content for Operation | [Content Id: do_11316973766674022413151]\"\n },\n \"responseCode\": \"CLIENT_ERROR\",\n \"result\": {}\n}" + }, + { + "name": "INTERNAL SERVER ERROR ! Looks like something went wrong! We track these errors automatically, but if the problem persists feel free to contact us. In the meantime, try refreshing.", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource.Possible media types can be:-\n - Application/json", + "key": "Content-Type", + "value": "ea laborum" + }, + { + "description": "(Required) The Registered User ID to execute the API.", + "key": "X-Authenticated-User-token", + "value": "ea laborum" + }, + { + "description": "(Required) All content APIs require authorization for use. Specify the authorization key received from the administrator when placing the request for use of the API.", + "key": "Authorization", + "value": "ea laborum" + } + ], + "body": { + "mode": "raw", + "raw": "{}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/content/v2/review/:Content_Id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v2", + "review", + ":Content_Id" + ], + "variable": [ + { + "key": "Content_Id", + "value": "ea laborum", + "description": "(Required) Please append a valid Content Id To the Request URL" + } + ] + } + }, + "status": "Internal Server Error", + "code": 500, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"result\": {},\n \"id\": \"cupidatat reprehenderit dolor\",\n \"ver\": \"minim anim commodo\",\n \"ts\": \"commodo\",\n \"params\": {\n \"resmsgid\": \"pariatur repre\",\n \"msgid\": \"irure\",\n \"err\": \"consequat esse ea\",\n \"status\": \"esse\",\n \"errmsg\": \"aliqua laboris velit\"\n },\n \"responseCode\": \"reprehenderit dolor elit sunt dolore\"\n}" + } + ] + }, + { + "name": "Publish Content", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json()\r", + "\r", + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "\r", + "pm.test(\"id has string - api.content.publish.public \", function () {\r", + " pm.expect(jsonResponse.id).to.be.equal(\"api.content.publish.public\");\r", + "});\r", + "\r", + "pm.test(\"Version is 4.0 \", function () {\r", + " pm.expect(jsonResponse.ver).to.be.equal(\"4.0\");\r", + "});\r", + "\r", + "pm.test(\"Verify keys and data type of the response result\", () => {\r", + " pm.expect(jsonResponse.params).to.have.all.keys('resmsgid','msgid','status', 'err','errmsg');\r", + " pm.expect(jsonResponse.params.resmsgid).to.be.a(\"string\");\r", + " pm.expect(jsonResponse.params.msgid).to.be.a(\"null\"); \r", + " pm.expect(jsonResponse.params.status).to.be.a(\"string\");\r", + " pm.expect(jsonResponse.params.err).to.be.a(\"null\");\r", + " pm.expect(jsonResponse.params.errmsg).to.be.a(\"null\");\r", + "});\r", + "\r", + "pm.test(\"Status is successful \", function () {\r", + " pm.expect(jsonResponse.params.status).to.be.equal(\"successful\");\r", + "});\r", + "\r", + "pm.test(\"ResponseCode is OK \", function () {\r", + " pm.expect(jsonResponse.responseCode).to.be.equal(\"OK\");\r", + "});\r", + "\r", + "pm.test(\"Verify keys and data type of the response result\", () => {\r", + " pm.expect(jsonResponse.result).to.have.all.keys('publishStatus','node_id');\r", + " pm.expect(jsonResponse.result.publishStatus).to.be.a('String');\r", + " pm.expect(jsonResponse.result.node_id).to.be.a('String');\r", + "});\r", + "\r", + "pm.test(\"node should be equal to \" + pm.collectionVariables.get(\"discard_livecontent\"), () => {\r", + " pm.expect(jsonResponse.result.node_id).to.eql(pm.collectionVariables.get(\"discard_livecontent\"));\r", + "});\r", + "pm.test(`publishStatus should be equal to Publish Event for Content Id ${pm.collectionVariables.get(\"discard_livecontent\")} is pushed Successfully!`, () => {\r", + " pm.expect(jsonResponse.result.publishStatus).to.eql(`Publish Event for Content Id '${pm.collectionVariables.get(\"discard_livecontent\")}' is pushed Successfully!`);\r", + "});\r", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "apikey", + "apikey": [ + { + "key": "key", + "value": "Authorization", + "type": "string" + }, + { + "key": "value", + "value": "", + "type": "string" + }, + { + "key": "in", + "value": "header", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "description": "(Required) The Content Type entity is the media type of the resource.Possible media types can be:-\n - Application/json\n - Multipart/form-data\n - Application/x-www-form-urlencoded", + "key": "Content-Type", + "value": "application/json" + }, + { + "description": "(Required) User Registered ID , which is used for logging In", + "key": "X-Authenticated-User-token", + "value": "ea laborum" + }, + { + "description": "(Required) Authorizing user in order to grant access.", + "key": "Authorization", + "value": "ea laborum" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"content\": {\n \"Publisher\": \"sunbird.publisher.create\",\n \"lastPublishedBy\": \"Ekstep\"\n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/content/v4/publish/{{discard_livecontent}}", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v4", + "publish", + "{{discard_livecontent}}" + ] + }, + "description": "This API is associated with publishing content on the Sunbird Platform .\n - **_/publish/_** endpoint executes the \"Publish Content\" request based on parameters provided as metadata in the request body.\n - The endpoint for **Publish Content** is `/content/v1/publish`\n - It points to knowledge-mw-service - `/v2/content/publish`\n - {...}refers to a section of review endpoint URL path that needs to be replaced by appropriate Id.\n - It is mandatory to provide values for parameters marked with *.\n - Mandatory fields cannot be null or empty." + }, + "response": [ + { + "name": "OK ! Successful operation.**Content publish operation was successfully executed.", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource.Possible media types can be:-\n - Application/json\n - Multipart/form-data\n - Application/x-www-form-urlencoded", + "key": "Content-Type", + "value": "ea laborum" + }, + { + "description": "(Required) User Registered ID , which is used for logging In", + "key": "X-Authenticated-User-token", + "value": "ea laborum" + }, + { + "description": "(Required) Authorizing user in order to grant access.", + "key": "Authorization", + "value": "ea laborum" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"content\": {\n \"lastPublishedBy\": \"Ekstep\"\n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/content/v1/publish/:Content_Id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v1", + "publish", + ":Content_Id" + ], + "variable": [ + { + "key": "Content_Id", + "value": "ea laborum", + "description": "(Required) Content Id to be published" + } + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"api.v3.publish\",\n \"ver\": \"1.0\",\n \"ts\": \"2020-12-10T21:41:23.491Z\",\n \"params\": {\n \"resmsgid\": \"72c4ef30-3b30-11eb-b0a2-8d5c9f561887\",\n \"msgid\": \"72979da0-3b30-11eb-b0a2-8d5c9f561887\",\n \"status\": \"successful\",\n \"err\": null,\n \"errmsg\": null\n },\n \"responseCode\": \"OK\",\n \"result\": {\n \"content_id\": \"do_21316975736724684813479\",\n \"publishStatus\": \"Publish Operation for Content Id 'do_21316975736724684813479' Started Successfully!\"\n }\n}" + }, + { + "name": "RESOURCE NOT FOUND,**Content Send for Review** operation failed !The possible reason for failure is that you may have provided wrong content id.", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource.Possible media types can be:-\n - Application/json\n - Multipart/form-data\n - Application/x-www-form-urlencoded", + "key": "Content-Type", + "value": "ea laborum" + }, + { + "description": "(Required) User Registered ID , which is used for logging In", + "key": "X-Authenticated-User-token", + "value": "ea laborum" + }, + { + "description": "(Required) Authorizing user in order to grant access.", + "key": "Authorization", + "value": "ea laborum" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"content\": {\n \"lastPublishedBy\": \"Ekstep\"\n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/content/v1/publish/:Content_Id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v1", + "publish", + ":Content_Id" + ], + "variable": [ + { + "key": "Content_Id", + "value": "ea laborum", + "description": "(Required) Content Id to be published" + } + ] + } + }, + "status": "Not Found", + "code": 404, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"api.v3.publish\",\n \"ver\": \"1.0\",\n \"ts\": \"2020-12-10T21:51:39.870Z\",\n \"params\": {\n \"resmsgid\": \"e228e7e0-3b31-11eb-b0a2-8d5c9f561887\",\n \"msgid\": null,\n \"status\": \"failed\",\n \"err\": \"NOT_FOUND\",\n \"errmsg\": \"Error! Node(s) doesn't Exists. | [Invalid Node Id.]: do_213169757367246848134791\"\n },\n \"responseCode\": \"RESOURCE_NOT_FOUND\",\n \"result\": {}\n}" + }, + { + "name": "INTERNAL SERVER ERROR ! Looks like something went wrong! We track these errors automatically, but if the problem persists feel free to contact us. In the meantime, try refreshing.", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource.Possible media types can be:-\n - Application/json\n - Multipart/form-data\n - Application/x-www-form-urlencoded", + "key": "Content-Type", + "value": "ea laborum" + }, + { + "description": "(Required) User Registered ID , which is used for logging In", + "key": "X-Authenticated-User-token", + "value": "ea laborum" + }, + { + "description": "(Required) Authorizing user in order to grant access.", + "key": "Authorization", + "value": "ea laborum" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"content\": {\n \"lastPublishedBy\": \"Ekstep\"\n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/content/v1/publish/:Content_Id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v1", + "publish", + ":Content_Id" + ], + "variable": [ + { + "key": "Content_Id", + "value": "ea laborum", + "description": "(Required) Content Id to be published" + } + ] + } + }, + "status": "Internal Server Error", + "code": 500, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"result\": {},\n \"id\": \"cupidatat reprehenderit dolor\",\n \"ver\": \"minim anim commodo\",\n \"ts\": \"commodo\",\n \"params\": {\n \"resmsgid\": \"pariatur repre\",\n \"msgid\": \"irure\",\n \"err\": \"consequat esse ea\",\n \"status\": \"esse\",\n \"errmsg\": \"aliqua laboris velit\"\n },\n \"responseCode\": \"reprehenderit dolor elit sunt dolore\"\n}" + } + ] + } + ] + }, + { + "name": "Poitive", + "item": [ + { + "name": "Discard a Draft content", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json()\r", + "\r", + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "\r", + "pm.test(\"id has string - api.content.discard \", function () {\r", + " pm.expect(jsonResponse.id).to.be.equal(\"api.content.discard\");\r", + "});\r", + "\r", + "pm.test(\"Version is 4.0 \", function () {\r", + " pm.expect(jsonResponse.ver).to.be.equal(\"4.0\");\r", + "});\r", + "\r", + "pm.test(\"Verify keys and data type of the response result\", () => {\r", + " pm.expect(jsonResponse.params).to.have.all.keys('resmsgid','msgid','status', 'err','errmsg');\r", + " pm.expect(jsonResponse.params.resmsgid).to.be.a(\"string\");\r", + " pm.expect(jsonResponse.params.msgid).to.be.a(\"null\"); \r", + " pm.expect(jsonResponse.params.status).to.be.a(\"string\");\r", + " pm.expect(jsonResponse.params.err).to.be.a(\"null\");\r", + " pm.expect(jsonResponse.params.errmsg).to.be.a(\"null\");\r", + "});\r", + "\r", + "pm.test(\"Status is successful \", function () {\r", + " pm.expect(jsonResponse.params.status).to.be.equal(\"successful\");\r", + "});\r", + "\r", + "pm.test(\"ResponseCode is OK \", function () {\r", + " pm.expect(jsonResponse.responseCode).to.be.equal(\"OK\");\r", + "});\r", + "\r", + "pm.test(\"Verify keys and data type of the response result\", () => {\r", + " pm.expect(jsonResponse.result).to.have.all.keys('identifier','node_id','message');\r", + " pm.expect(jsonResponse.result.node_id).to.be.a('String');\r", + " pm.expect(jsonResponse.result.identifier).to.be.a('String');\r", + " pm.expect(jsonResponse.result.message).to.be.a('String');\r", + "});\r", + "\r", + "pm.test(`message: Draft version of the content with id : ${pm.collectionVariables.get(\"discard_content\")} is discarded`, () => {\r", + " pm.expect(jsonResponse.result.message).to.eql(`Draft version of the content with id : ${pm.collectionVariables.get(\"discard_content\")} is discarded`);\r", + "});\r", + "pm.test(`identifier should be: ${pm.collectionVariables.get(\"discard_content\")}`, function () {\r", + " pm.expect(jsonResponse.result.identifier).to.be.equal(`${pm.collectionVariables.get(\"discard_content\")}`);\r", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "DELETE", + "header": [ + { + "description": "(Required) The Content Type entity is the media type of the resource.Possible media types can be:- \n - Application/json", + "key": "Content-Type", + "value": "ea laborum" + }, + { + "description": "(Required) The Registered User ID used to execute the API.", + "key": "X-Authenticated-User-Token", + "value": "ea laborum" + }, + { + "description": "The unique ID provided to the State to which the user belongs.", + "key": "X-Channel-id", + "value": "ea laborum" + }, + { + "description": "(Required) All content APIs require authorization for use. Specify the authorization key received from the administrator when placing the request for use of the API.", + "key": "Authorization", + "value": "ea laborum" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "url": { + "raw": "{{baseUrl}}/content/v4/discard/{{discard_content}}", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v4", + "discard", + "{{discard_content}}" + ] + }, + "description": "This API is associated with Discard Content on the Sunbird Platform .\n - **_/Content/_** endpoint executes the \"Discard Content\" request based on parameters provided as metadata in the request body.\n - The endpoint for **Discard Content** is `/Content/v2/discard`\n - It points to knowledge-mw-service - `/v2/Content/discard`\n - {...}refers to a section of review endpoint URL path that needs to be replaced by appropriate Id.\n - It is mandatory to provide values for parameters marked with *.\n - Mandatory fields cannot be null or empty." + }, + "response": [ + { + "name": "OK", + "originalRequest": { + "method": "DELETE", + "header": [ + { + "description": "(Required) The Content Type entity is the media type of the resource.Possible media types can be:- \n - Application/json", + "key": "Content-Type", + "value": "ea laborum" + }, + { + "description": "(Required) The Registered User ID used to execute the API.", + "key": "X-Authenticated-User-Token", + "value": "ea laborum" + }, + { + "description": "The unique ID provided to the State to which the user belongs.", + "key": "X-Channel-id", + "value": "ea laborum" + }, + { + "description": "(Required) All content APIs require authorization for use. Specify the authorization key received from the administrator when placing the request for use of the API.", + "key": "Authorization", + "value": "ea laborum" + } + ], + "url": { + "raw": "{{baseUrl}}/content/v2/discard/:content_id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v2", + "discard", + ":content_id" + ], + "variable": [ + { + "key": "content_id", + "value": "ea laborum", + "description": "(Required) Please append a valid Content Id To the Request URL" + } + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"api.content.discard\",\n \"ver\": \"4.0\",\n \"ts\": \"2022-01-06T06:41:51ZZ\",\n \"params\": {\n \"resmsgid\": \"fc899cd5-958b-40ad-9a5c-6f31b65404b4\",\n \"status\": \"successful\"\n },\n \"responseCode\": \"OK\",\n \"result\": {\n \"identifier\": \"do_1134467341514588161171\",\n \"message\": \"Draft version of the content with id : do_1134467341514588161171 is discarded\",\n \"node_id\": \"do_1134467341514588161171\"\n }\n}" + } + ] + } + ] + }, + { + "name": "Negative", + "item": [ + { + "name": "Discard a Live content", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json()\r", + "\r", + "//Verification\r", + "pm.test(\"Status code is 400\", function () {\r", + " pm.response.to.have.status(400)\r", + "});\r", + "pm.test(\"Params has keys: resmsgid , msgid , err , status , errmsg \", () => {\r", + " pm.expect(jsonResponse.params).to.have.all.keys('resmsgid', 'msgid','err','status','errmsg');\r", + " pm.expect(jsonResponse.params.resmsgid).to.be.a(\"string\");\r", + " pm.expect(jsonResponse.params.msgid).to.be.a('null');\r", + " pm.expect(jsonResponse.params.err).to.be.a('string');\r", + " pm.expect(jsonResponse.params.status).to.be.a(\"string\");\r", + " pm.expect(jsonResponse.params.errmsg).to.be.a('string');\r", + "});\r", + "//code name contains a string\r", + "tests[\"Status code name has string \\\"Bad Request\\\"\"] = responseCode.name.has(\"Bad Request\");\r", + "\r", + "pm.test(\"Test data type of the response and keys\", () => {\r", + " pm.expect(jsonResponse.result).to.be.an(\"object\");\r", + " pm.expect(jsonResponse.result).to.have.all.keys('messages');\r", + " pm.expect(jsonResponse.result.messages).to.be.null;\r", + "});\r", + "\r", + "//Validation\r", + "// Response body\r", + "pm.test(\"id should be api.content.discard\", function () {\r", + " pm.expect(jsonResponse.id).to.eql(\"api.content.discard\");\r", + "});\r", + "pm.test(\"ver should be 4.0\", () => {\r", + " pm.expect(jsonResponse.ver).to.eql(\"4.0\");\r", + "});\r", + "pm.test(\"responseCode should be CLIENT_ERROR\", () => {\r", + " pm.expect(jsonResponse.responseCode).to.eql(\"CLIENT_ERROR\");\r", + "});\r", + "\r", + "// Params\r", + "pm.test(\"params.err should be \\\"ERR_CONTENT_NOT_DRAFT\\\"\", () => {\r", + " pm.expect(jsonResponse.params.err).to.eql(\"ERR_CONTENT_NOT_DRAFT\");\r", + "});\r", + "pm.test(\"params.status should be \\\"failed\\\"\", () => {\r", + " pm.expect(jsonResponse.params.status).to.eql(\"failed\");\r", + "});\r", + "pm.test(`errmsg: No changes to discard for content with content id: ${pm.collectionVariables.get(\"discard_livecontent\")} since content status isnt draft`, () => {\r", + " pm.expect(jsonResponse.params.errmsg).to.eql(`No changes to discard for content with content id: ${pm.collectionVariables.get(\"discard_livecontent\")} since content status isnt draft`);\r", + "});\r", + "\r", + "// Result\r", + "pm.test(\"messages should be null\", () => {\r", + " pm.expect(jsonResponse.result.messages).to.eql(null);\r", + "});\r", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "DELETE", + "header": [ + { + "description": "(Required) The Content Type entity is the media type of the resource.Possible media types can be:- \n - Application/json", + "key": "Content-Type", + "value": "ea laborum" + }, + { + "description": "(Required) The Registered User ID used to execute the API.", + "key": "X-Authenticated-User-Token", + "value": "ea laborum" + }, + { + "description": "The unique ID provided to the State to which the user belongs.", + "key": "X-Channel-id", + "value": "ea laborum" + }, + { + "description": "(Required) All content APIs require authorization for use. Specify the authorization key received from the administrator when placing the request for use of the API.", + "key": "Authorization", + "value": "ea laborum" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "url": { + "raw": "{{baseUrl}}/content/v4/discard/{{discard_livecontent}}", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v4", + "discard", + "{{discard_livecontent}}" + ] + }, + "description": "This API is associated with Discard Content on the Sunbird Platform .\n - **_/Content/_** endpoint executes the \"Discard Content\" request based on parameters provided as metadata in the request body.\n - The endpoint for **Discard Content** is `/Content/v2/discard`\n - It points to knowledge-mw-service - `/v2/Content/discard`\n - {...}refers to a section of review endpoint URL path that needs to be replaced by appropriate Id.\n - It is mandatory to provide values for parameters marked with *.\n - Mandatory fields cannot be null or empty." + }, + "response": [ + { + "name": "OK", + "originalRequest": { + "method": "DELETE", + "header": [ + { + "description": "(Required) The Content Type entity is the media type of the resource.Possible media types can be:- \n - Application/json", + "key": "Content-Type", + "value": "ea laborum" + }, + { + "description": "(Required) The Registered User ID used to execute the API.", + "key": "X-Authenticated-User-Token", + "value": "ea laborum" + }, + { + "description": "The unique ID provided to the State to which the user belongs.", + "key": "X-Channel-id", + "value": "ea laborum" + }, + { + "description": "(Required) All content APIs require authorization for use. Specify the authorization key received from the administrator when placing the request for use of the API.", + "key": "Authorization", + "value": "ea laborum" + } + ], + "url": { + "raw": "{{baseUrl}}/content/v2/discard/:content_id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v2", + "discard", + ":content_id" + ], + "variable": [ + { + "key": "content_id", + "value": "ea laborum", + "description": "(Required) Please append a valid Content Id To the Request URL" + } + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"api.content.discard\",\n \"ver\": \"4.0\",\n \"ts\": \"2022-01-06T06:41:51ZZ\",\n \"params\": {\n \"resmsgid\": \"fc899cd5-958b-40ad-9a5c-6f31b65404b4\",\n \"status\": \"successful\"\n },\n \"responseCode\": \"OK\",\n \"result\": {\n \"identifier\": \"do_1134467341514588161171\",\n \"message\": \"Draft version of the content with id : do_1134467341514588161171 is discarded\",\n \"node_id\": \"do_1134467341514588161171\"\n }\n}" + } + ] + }, + { + "name": "Discard a discarded content", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json()\r", + "\r", + "//Verification\r", + "pm.test(\"Status code is 404\", function () {\r", + " pm.response.to.have.status(404)\r", + "});\r", + "pm.test(\"Params has keys: resmsgid , msgid , err , status , errmsg \", () => {\r", + " pm.expect(jsonResponse.params).to.have.all.keys('resmsgid', 'msgid','err','status','errmsg');\r", + " pm.expect(jsonResponse.params.resmsgid).to.be.a(\"string\");\r", + " pm.expect(jsonResponse.params.msgid).to.be.a('null');\r", + " pm.expect(jsonResponse.params.err).to.be.a('string');\r", + " pm.expect(jsonResponse.params.status).to.be.a(\"string\");\r", + " pm.expect(jsonResponse.params.errmsg).to.be.a('string');\r", + "});\r", + "//code name contains a string\r", + "tests[\"Status code name has string \\\"Not Found\\\"\"] = responseCode.name.has(\"Not Found\");\r", + "\r", + "pm.test(\"Test data type of the response and keys\", () => {\r", + " pm.expect(jsonResponse.result).to.be.an(\"object\");\r", + " pm.expect(jsonResponse.result).to.have.all.keys('messages');\r", + " pm.expect(jsonResponse.result.messages).to.be.null;\r", + "});\r", + "\r", + "//Validation\r", + "// Response body\r", + "pm.test(\"id should be api.content.discard\", () => {\r", + " pm.expect(jsonResponse.id).to.eql(\"api.content.discard\");\r", + "});\r", + "pm.test(\"ver should be 4.0\", () => {\r", + " pm.expect(jsonResponse.ver).to.eql(\"4.0\");\r", + "});\r", + "pm.test(\"responseCode should be RESOURCE_NOT_FOUND\", () => {\r", + " pm.expect(jsonResponse.responseCode).to.eql(\"RESOURCE_NOT_FOUND\");\r", + "});\r", + "\r", + "// Params\r", + "pm.test(\"params.err should be \\\"NOT_FOUND\\\"\", () => {\r", + " pm.expect(jsonResponse.params.err).to.eql(\"NOT_FOUND\");\r", + "});\r", + "pm.test(\"params.status should be \\\"failed\\\"\", () => {\r", + " pm.expect(jsonResponse.params.status).to.eql(\"failed\");\r", + "});\r", + "pm.test(`errmsg: Error! Node(s) doesn't Exists. | [Invalid Node Id.]: ${pm.collectionVariables.get(\"discard_content\")}`, () => {\r", + " pm.expect(jsonResponse.params.errmsg).to.eql(`Error! Node(s) doesn't Exists. | [Invalid Node Id.]: ${pm.collectionVariables.get(\"discard_content\")}`);\r", + "});\r", + "\r", + "// Result\r", + "pm.test(\"messages should be null\", () => {\r", + " pm.expect(jsonResponse.result.messages).to.eql(null);\r", + "});\r", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "DELETE", + "header": [ + { + "description": "(Required) The Content Type entity is the media type of the resource.Possible media types can be:- \n - Application/json", + "key": "Content-Type", + "value": "ea laborum" + }, + { + "description": "(Required) The Registered User ID used to execute the API.", + "key": "X-Authenticated-User-Token", + "value": "ea laborum" + }, + { + "description": "The unique ID provided to the State to which the user belongs.", + "key": "X-Channel-id", + "value": "ea laborum" + }, + { + "description": "(Required) All content APIs require authorization for use. Specify the authorization key received from the administrator when placing the request for use of the API.", + "key": "Authorization", + "value": "ea laborum" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "url": { + "raw": "{{baseUrl}}/content/v4/discard/{{discard_content}}", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v4", + "discard", + "{{discard_content}}" + ] + }, + "description": "This API is associated with Discard Content on the Sunbird Platform .\n - **_/Content/_** endpoint executes the \"Discard Content\" request based on parameters provided as metadata in the request body.\n - The endpoint for **Discard Content** is `/Content/v2/discard`\n - It points to knowledge-mw-service - `/v2/Content/discard`\n - {...}refers to a section of review endpoint URL path that needs to be replaced by appropriate Id.\n - It is mandatory to provide values for parameters marked with *.\n - Mandatory fields cannot be null or empty." + }, + "response": [ + { + "name": "OK", + "originalRequest": { + "method": "DELETE", + "header": [ + { + "description": "(Required) The Content Type entity is the media type of the resource.Possible media types can be:- \n - Application/json", + "key": "Content-Type", + "value": "ea laborum" + }, + { + "description": "(Required) The Registered User ID used to execute the API.", + "key": "X-Authenticated-User-Token", + "value": "ea laborum" + }, + { + "description": "The unique ID provided to the State to which the user belongs.", + "key": "X-Channel-id", + "value": "ea laborum" + }, + { + "description": "(Required) All content APIs require authorization for use. Specify the authorization key received from the administrator when placing the request for use of the API.", + "key": "Authorization", + "value": "ea laborum" + } + ], + "url": { + "raw": "{{baseUrl}}/content/v2/discard/:content_id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v2", + "discard", + ":content_id" + ], + "variable": [ + { + "key": "content_id", + "value": "ea laborum", + "description": "(Required) Please append a valid Content Id To the Request URL" + } + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"api.content.discard\",\n \"ver\": \"4.0\",\n \"ts\": \"2022-01-06T06:41:51ZZ\",\n \"params\": {\n \"resmsgid\": \"fc899cd5-958b-40ad-9a5c-6f31b65404b4\",\n \"status\": \"successful\"\n },\n \"responseCode\": \"OK\",\n \"result\": {\n \"identifier\": \"do_1134467341514588161171\",\n \"message\": \"Draft version of the content with id : do_1134467341514588161171 is discarded\",\n \"node_id\": \"do_1134467341514588161171\"\n }\n}" + } + ] + }, + { + "name": "Discard an invalid content", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json()\r", + "\r", + "//Verification\r", + "pm.test(\"Status code is 404\", function () {\r", + " pm.response.to.have.status(404)\r", + "});\r", + "pm.test(\"Params has keys: resmsgid , msgid , err , status , errmsg \", () => {\r", + " pm.expect(jsonResponse.params).to.have.all.keys('resmsgid', 'msgid','err','status','errmsg');\r", + " pm.expect(jsonResponse.params.resmsgid).to.be.a(\"string\");\r", + " pm.expect(jsonResponse.params.msgid).to.be.a('null');\r", + " pm.expect(jsonResponse.params.err).to.be.a('string');\r", + " pm.expect(jsonResponse.params.status).to.be.a(\"string\");\r", + " pm.expect(jsonResponse.params.errmsg).to.be.a('string');\r", + "});\r", + "//code name contains a string\r", + "tests[\"Status code name has string \\\"Not Found\\\"\"] = responseCode.name.has(\"Not Found\");\r", + "\r", + "pm.test(\"Test data type of the response and keys\", () => {\r", + " pm.expect(jsonResponse.result).to.be.an(\"object\");\r", + " pm.expect(jsonResponse.result).to.have.all.keys('messages');\r", + " pm.expect(jsonResponse.result.messages).to.be.null;\r", + "});\r", + "\r", + "//Validation\r", + "// Response body\r", + "pm.test(\"id should be api.content.discard\", () => {\r", + " pm.expect(jsonResponse.id).to.eql(\"api.content.discard\");\r", + "});\r", + "pm.test(\"ver should be 4.0\", () => {\r", + " pm.expect(jsonResponse.ver).to.eql(\"4.0\");\r", + "});\r", + "pm.test(\"responseCode should be RESOURCE_NOT_FOUND\", () => {\r", + " pm.expect(jsonResponse.responseCode).to.eql(\"RESOURCE_NOT_FOUND\");\r", + "});\r", + "\r", + "// Params\r", + "pm.test(\"params.err should be \\\"NOT_FOUND\\\"\", () => {\r", + " pm.expect(jsonResponse.params.err).to.eql(\"NOT_FOUND\");\r", + "});\r", + "pm.test(\"params.status should be \\\"failed\\\"\", () => {\r", + " pm.expect(jsonResponse.params.status).to.eql(\"failed\");\r", + "});\r", + "pm.test(`errmsg: Error! Node(s) doesn't Exists. | [Invalid Node Id.]: dummy`, () => {\r", + " pm.expect(jsonResponse.params.errmsg).to.eql(`Error! Node(s) doesn't Exists. | [Invalid Node Id.]: dummy`);\r", + "});\r", + "\r", + "// Result\r", + "pm.test(\"messages should be null\", () => {\r", + " pm.expect(jsonResponse.result.messages).to.eql(null);\r", + "});\r", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "DELETE", + "header": [ + { + "description": "(Required) The Content Type entity is the media type of the resource.Possible media types can be:- \n - Application/json", + "key": "Content-Type", + "value": "ea laborum" + }, + { + "description": "(Required) The Registered User ID used to execute the API.", + "key": "X-Authenticated-User-Token", + "value": "ea laborum" + }, + { + "description": "The unique ID provided to the State to which the user belongs.", + "key": "X-Channel-id", + "value": "ea laborum" + }, + { + "description": "(Required) All content APIs require authorization for use. Specify the authorization key received from the administrator when placing the request for use of the API.", + "key": "Authorization", + "value": "ea laborum" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "url": { + "raw": "{{baseUrl}}/content/v4/discard/dummy", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v4", + "discard", + "dummy" + ] + }, + "description": "This API is associated with Discard Content on the Sunbird Platform .\n - **_/Content/_** endpoint executes the \"Discard Content\" request based on parameters provided as metadata in the request body.\n - The endpoint for **Discard Content** is `/Content/v2/discard`\n - It points to knowledge-mw-service - `/v2/Content/discard`\n - {...}refers to a section of review endpoint URL path that needs to be replaced by appropriate Id.\n - It is mandatory to provide values for parameters marked with *.\n - Mandatory fields cannot be null or empty." + }, + "response": [ + { + "name": "OK", + "originalRequest": { + "method": "DELETE", + "header": [ + { + "description": "(Required) The Content Type entity is the media type of the resource.Possible media types can be:- \n - Application/json", + "key": "Content-Type", + "value": "ea laborum" + }, + { + "description": "(Required) The Registered User ID used to execute the API.", + "key": "X-Authenticated-User-Token", + "value": "ea laborum" + }, + { + "description": "The unique ID provided to the State to which the user belongs.", + "key": "X-Channel-id", + "value": "ea laborum" + }, + { + "description": "(Required) All content APIs require authorization for use. Specify the authorization key received from the administrator when placing the request for use of the API.", + "key": "Authorization", + "value": "ea laborum" + } + ], + "url": { + "raw": "{{baseUrl}}/content/v2/discard/:content_id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v2", + "discard", + ":content_id" + ], + "variable": [ + { + "key": "content_id", + "value": "ea laborum", + "description": "(Required) Please append a valid Content Id To the Request URL" + } + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"api.content.discard\",\n \"ver\": \"4.0\",\n \"ts\": \"2022-01-06T06:41:51ZZ\",\n \"params\": {\n \"resmsgid\": \"fc899cd5-958b-40ad-9a5c-6f31b65404b4\",\n \"status\": \"successful\"\n },\n \"responseCode\": \"OK\",\n \"result\": {\n \"identifier\": \"do_1134467341514588161171\",\n \"message\": \"Draft version of the content with id : do_1134467341514588161171 is discarded\",\n \"node_id\": \"do_1134467341514588161171\"\n }\n}" + } + ] + } + ] + } + ] + } + ] + }, + { + "name": "Copy content", + "item": [ + { + "name": "Pre requisite", + "item": [ + { + "name": "Create Content", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json();\r", + "\r", + "pm.collectionVariables.set(\"copy_content\", jsonResponse.result.identifier);\r", + "console.log(pm.collectionVariables.get(\"copy_content\"));\r", + "\r", + "" + ], + "type": "text/javascript" + } + } + ], + "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}}" + }, + { + "key": "X-Channel-Id", + "value": "sunbird" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"content\": {\n \"name\": \"Untitled Content\",\n \"code\": \"1242e9ea-660a-4536-a142-cc242a7a4162\",\n \"mimeType\": \"application/pdf\",\n \"primaryCategory\": \"Explanation Content\",\n \"body\": \"{\\\"key\\\":\\\"value\\\"}\"\n }\n }\n}" + }, + "url": { + "raw": "{{host}}/content/v4/create", + "host": [ + "{{host}}" + ], + "path": [ + "content", + "v4", + "create" + ] + }, + "description": "This API is associated with creating content on the Sunbird Platform.\n - The endpoint for **Create Content** is `/content/v2/create`\n - It points to knowledge-mw-service - `/v2/content/create`\n - It is mandatory to provide values for parameters marked with *.\n - Mandatory fields cannot be null or empty." + }, + "response": [ + { + "name": "SUCCESS. The **Create Content** operation was successful!", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource.Possible media types can be:-\n - Application/json", + "key": "Content-Type", + "value": "ea laborum" + }, + { + "description": "(Required) Represents a physical location (e.g: state) uniquely to which the user belongs.", + "key": "x-channel-id", + "value": "ea laborum" + }, + { + "description": "(Required) Represents the authorized User ID to execute the API.", + "key": "X-Authenticated-User-Token", + "value": "ea laborum" + }, + { + "description": "(Required) To make use of the API, you require authorization. Raise a request to the administrator for the use of the API. You will receive the authorization key. Specify the key received, here.", + "key": "Authorization", + "value": "ea laborum" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"content\": {\n \"name\": \"H5P Content\",\n \"code\": \"h5pcontent\",\n \"mimeType\": \"application/vnd.ekstep.h5p-archive\",\n \"primaryCategory\": \"Resource\",\n \"createdBy\": \"874ed8a5-782e-4f6c-8f36-e0288455901e\"\n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/content/v2/create", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v2", + "create" + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"api.content.create\",\n \"ver\": \"3.0\",\n \"ts\": \"2020-12-10T20:24:45ZZ\",\n \"params\": {\n \"resmsgid\": \"3be02c4b-3324-41a3-afd8-60f6be0584d2\",\n \"msgid\": null,\n \"err\": null,\n \"status\": \"successful\",\n \"errmsg\": null\n },\n \"responseCode\": \"OK\",\n \"result\": {\n \"identifier\": \"do_1131697204035993601314\",\n \"node_id\": \"do_1131697204035993601314\",\n \"versionKey\": \"1607631885207\"\n }\n}" + }, + { + "name": "'BAD REQUEST. The **Create Content** operation failed. You may have missed input for a mandatory parameter.'", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource.Possible media types can be:-\n - Application/json", + "key": "Content-Type", + "value": "ea laborum" + }, + { + "description": "(Required) Represents a physical location (e.g: state) uniquely to which the user belongs.", + "key": "x-channel-id", + "value": "ea laborum" + }, + { + "description": "(Required) Represents the authorized User ID to execute the API.", + "key": "X-Authenticated-User-Token", + "value": "ea laborum" + }, + { + "description": "(Required) To make use of the API, you require authorization. Raise a request to the administrator for the use of the API. You will receive the authorization key. Specify the key received, here.", + "key": "Authorization", + "value": "ea laborum" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"content\": {\n \"name\": \"H5P Content\",\n \"code\": \"h5pcontent\",\n \"mimeType\": \"application/vnd.ekstep.h5p-archive\",\n \"primaryCategory\": \"Resource\",\n \"createdBy\": \"874ed8a5-782e-4f6c-8f36-e0288455901e\"\n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/content/v2/create", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v2", + "create" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"api.content.create\",\n \"ver\": \"1.0\",\n \"ts\": \"2020-12-10T08:50:29.786Z\",\n \"params\": {\n \"resmsgid\": \"c169a7a0-3ac4-11eb-b0a2-8d5c9f561887\",\n \"msgid\": null,\n \"status\": \"failed\",\n \"err\": \"ERR_CONTENT_CREATE_FIELDS_MISSING\",\n \"errmsg\": \"Required fields for create content are missing\"\n },\n \"responseCode\": \"CLIENT_ERROR\",\n \"result\": {}\n}" + }, + { + "name": "'INTERNAL SERVER ERROR. We track these errors automatically and try to set it right at the earliest. Try refreshing the page. If the problem persists contact us at info@sunbird.org.'", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource.Possible media types can be:-\n - Application/json", + "key": "Content-Type", + "value": "ea laborum" + }, + { + "description": "(Required) Represents a physical location (e.g: state) uniquely to which the user belongs.", + "key": "x-channel-id", + "value": "ea laborum" + }, + { + "description": "(Required) Represents the authorized User ID to execute the API.", + "key": "X-Authenticated-User-Token", + "value": "ea laborum" + }, + { + "description": "(Required) To make use of the API, you require authorization. Raise a request to the administrator for the use of the API. You will receive the authorization key. Specify the key received, here.", + "key": "Authorization", + "value": "ea laborum" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"content\": {\n \"name\": \"H5P Content\",\n \"code\": \"h5pcontent\",\n \"mimeType\": \"application/vnd.ekstep.h5p-archive\",\n \"primaryCategory\": \"Resource\",\n \"createdBy\": \"874ed8a5-782e-4f6c-8f36-e0288455901e\"\n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/content/v2/create", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v2", + "create" + ] + } + }, + "status": "Internal Server Error", + "code": 500, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"api.content.create\",\n \"ver\": \"1.0\",\n \"ts\": \"2020-12-10T08:51:51.647Z\",\n \"params\": {\n \"resmsgid\": \"f234a6f0-3ac4-11eb-b0a2-8d5c9f561887\",\n \"msgid\": null,\n \"status\": \"failed\",\n \"err\": null,\n \"errmsg\": null\n },\n \"responseCode\": \"SERVER_ERROR\",\n \"result\": {}\n}" + } + ] + }, + { + "name": "Upload URL", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json();\r", + "\r", + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "pm.test(\"Status code name has string OK\", function () {\r", + " pm.response.to.have.status(\"OK\");\r", + "});\r", + "pm.test(\"id should be api.content.upload.url\", function () {\r", + " pm.expect(jsonResponse.id).to.eql(\"api.content.upload.url\");\r", + "});\r", + "pm.test(\"ver should be 4.0\", function () {\r", + " pm.expect(jsonResponse.ver).to.eql(\"4.0\");\r", + "});\r", + "\r", + "pm.test(\"Params has keys: resmsgid , msgid , err , status , errmsg \", () => {\r", + " pm.expect(jsonResponse.params).to.have.all.keys('resmsgid', 'msgid','err','status','errmsg');\r", + " pm.expect(jsonResponse.params.resmsgid).to.be.a(\"string\");\r", + " pm.expect(jsonResponse.params.msgid).to.be.a('null');\r", + " pm.expect(jsonResponse.params.err).to.be.a('null');\r", + " pm.expect(jsonResponse.params.status).to.be.a(\"string\");\r", + " pm.expect(jsonResponse.params.errmsg).to.be.a('null');\r", + "});\r", + "\r", + "pm.test(\"Status is successful\", function () {\r", + " pm.expect(jsonResponse.params.status).to.be.equal(\"successful\");\r", + "});\r", + "\r", + "pm.test(\"ResponseCode is OK\", function () {\r", + " pm.expect(jsonResponse.responseCode).to.be.equal(\"OK\");\r", + "});\r", + "\r", + "\r", + "pm.test(\"Verify keys and data type of the response result\", () => {\r", + " pm.expect(jsonResponse.result).to.have.all.keys('identifier', 'url_expiry', 'pre_signed_url');\r", + "});\r", + "pm.collectionVariables.set(\"pre_signed_URL\",jsonResponse.result.pre_signed_url );\r", + "console.log(pm.collectionVariables.get(\"pre_signed_URL\"));\r", + "\r", + "\r", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "apikey", + "apikey": [ + { + "key": "key", + "value": "Authorization", + "type": "string" + }, + { + "key": "value", + "value": "", + "type": "string" + }, + { + "key": "in", + "value": "header", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "description": "(Required) The Content Type entity is the media type of the resource.Possible media types can be:-\n - Application/json", + "key": "Content-Type", + "value": "application/json" + }, + { + "description": "(Required) The Registered User ID to execute the API.", + "key": "X-Authenticated-Userid", + "value": "ea laborum" + }, + { + "description": "(Required) All content APIs require authorization for use. Specify the authorization key received from the administrator when placing the request for use of the API.", + "key": "Authorization", + "value": "ea laborum" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"content\": {\n \"fileName\":\"test.pdf\"\n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/content/v4/upload/url/{{copy_content}}", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v4", + "upload", + "url", + "{{copy_content}}" + ] + }, + "description": "This API is associated with uploading content on the Sunbird Platform .\n - The**_/upload/url/{content Id}_** endpoint executes \"Upload Content URL\" request based on parameters provided as metadata in the request body.\n - The endpoint for **Upload Content URL** is `/content/v2/upload/url`\n - It points to knowledge-mw-service - `/v2/content/upload/url`\n - {...}refers to a section of upload endpoint URL path that needs to be replaced by appropriate Id.\n - You need to provide a valid content Id value in {Content Id} field of API URL.\n - On Success api returns pre-signed-url link with come configured ttl against which file can be uploaded.\n - It is mandatory to provide values for parameters marked with *.\n - Mandatory fields cannot be null or empty." + }, + "response": [ + { + "name": "OK ! Successful operation.\"Content upload\" operation was successfully executed.", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource.Possible media types can be:-\n - Application/json", + "key": "Content-Type", + "value": "ea laborum" + }, + { + "description": "(Required) The Registered User ID to execute the API.", + "key": "X-Authenticated-Userid", + "value": "ea laborum" + }, + { + "description": "(Required) All content APIs require authorization for use. Specify the authorization key received from the administrator when placing the request for use of the API.", + "key": "Authorization", + "value": "ea laborum" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"content\": {\n \"fileName\": \"test.pdf\"\n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/content/v2/upload/url/:Content_Id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v2", + "upload", + "url", + ":Content_Id" + ], + "variable": [ + { + "key": "Content_Id", + "value": "ea laborum", + "description": "(Required) Please append a valid Content Id To the Request URL" + } + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"api.content.upload.url\",\n \"ver\": \"3.0\",\n \"ts\": \"2020-12-11T23:52:44ZZ\",\n \"params\": {\n \"resmsgid\": \"81e308fa-3e36-45ff-b295-e28e8f757dc7\",\n \"msgid\": null,\n \"err\": null,\n \"status\": \"successful\",\n \"errmsg\": null\n },\n \"responseCode\": \"OK\",\n \"result\": {\n \"identifier\": \"do_11317053041892556811094\",\n \"url_expiry\": \"54000\",\n \"pre_signed_url\": \"https://sunbirddev.blob.core.windows.net/sunbird-content-dev/content/assets/do_11317053041892556811094/10-page-pdf.pdf?sv=2017-04-17&se=2020-12-12T14%3A52%3A44Z&sr=b&sp=w&sig=Tlt6uWI/6lMeupkEbsTAmGajmo1qzw8HeUHrVwOm6yk%3D\"\n }\n}" + }, + { + "name": "BAD REQUEST. The 'Upload Url' operation failed ! The possible reason for failure is that you may have missed providing input for a mandatory parameter.", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource.Possible media types can be:-\n - Application/json", + "key": "Content-Type", + "value": "ea laborum" + }, + { + "description": "(Required) The Registered User ID to execute the API.", + "key": "X-Authenticated-Userid", + "value": "ea laborum" + }, + { + "description": "(Required) All content APIs require authorization for use. Specify the authorization key received from the administrator when placing the request for use of the API.", + "key": "Authorization", + "value": "ea laborum" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"content\": {\n \"fileName\": \"test.pdf\"\n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/content/v2/upload/url/:Content_Id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v2", + "upload", + "url", + ":Content_Id" + ], + "variable": [ + { + "key": "Content_Id", + "value": "ea laborum", + "description": "(Required) Please append a valid Content Id To the Request URL" + } + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"api.content.upload.url\",\n \"ver\": \"3.0\",\n \"ts\": \"2020-12-11T23:54:07ZZ\",\n \"params\": {\n \"resmsgid\": \"4edde64d-3116-4271-bcc1-a8ba0ec2d56b\",\n \"msgid\": null,\n \"err\": \"ERR_CONTENT_BLANK_FILE_NAME\",\n \"status\": \"failed\",\n \"errmsg\": \"File name is blank\"\n },\n \"responseCode\": \"CLIENT_ERROR\",\n \"result\": {\n \"messages\": null\n }\n}" + }, + { + "name": "RESOURCE NOT FOUND,**Content Id sent for generating upload url** operation failed !The possible reason for failure is that you may have provided wrong content id.", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource.Possible media types can be:-\n - Application/json", + "key": "Content-Type", + "value": "ea laborum" + }, + { + "description": "(Required) The Registered User ID to execute the API.", + "key": "X-Authenticated-Userid", + "value": "ea laborum" + }, + { + "description": "(Required) All content APIs require authorization for use. Specify the authorization key received from the administrator when placing the request for use of the API.", + "key": "Authorization", + "value": "ea laborum" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"content\": {\n \"fileName\": \"test.pdf\"\n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/content/v2/upload/url/:Content_Id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v2", + "upload", + "url", + ":Content_Id" + ], + "variable": [ + { + "key": "Content_Id", + "value": "ea laborum", + "description": "(Required) Please append a valid Content Id To the Request URL" + } + ] + } + }, + "status": "Not Found", + "code": 404, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"api.upload.url\",\n \"ver\": \"1.0\",\n \"ts\": \"2020-12-11T23:48:26.694Z\",\n \"params\": {\n \"resmsgid\": \"5cf72660-3c0b-11eb-b0a2-8d5c9f561887\",\n \"msgid\": null,\n \"status\": \"failed\",\n \"err\": \"NOT_FOUND\",\n \"errmsg\": \"Error! Node(s) doesn't Exists. | [Invalid Node Id.]: do_11254577204586086415\"\n },\n \"responseCode\": \"RESOURCE_NOT_FOUND\",\n \"result\": {}\n}" + }, + { + "name": "INTERNAL SERVER ERROR ! Looks like something went wrong! These errors are tracked automatically, but if the problem persists feel free to contact us. In the meantime, try refreshing.", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource.Possible media types can be:-\n - Application/json", + "key": "Content-Type", + "value": "ea laborum" + }, + { + "description": "(Required) The Registered User ID to execute the API.", + "key": "X-Authenticated-Userid", + "value": "ea laborum" + }, + { + "description": "(Required) All content APIs require authorization for use. Specify the authorization key received from the administrator when placing the request for use of the API.", + "key": "Authorization", + "value": "ea laborum" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"content\": {\n \"fileName\": \"test.pdf\"\n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/content/v2/upload/url/:Content_Id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v2", + "upload", + "url", + ":Content_Id" + ], + "variable": [ + { + "key": "Content_Id", + "value": "ea laborum", + "description": "(Required) Please append a valid Content Id To the Request URL" + } + ] + } + }, + "status": "Internal Server Error", + "code": 500, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"result\": {},\n \"id\": \"cupidatat reprehenderit dolor\",\n \"ver\": \"minim anim commodo\",\n \"ts\": \"commodo\",\n \"params\": {\n \"resmsgid\": \"pariatur repre\",\n \"msgid\": \"irure\",\n \"err\": \"consequat esse ea\",\n \"status\": \"esse\",\n \"errmsg\": \"aliqua laboris velit\"\n },\n \"responseCode\": \"reprehenderit dolor elit sunt dolore\"\n}" + } + ] + }, + { + "name": "Upload file to the URL", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 201\", function () {\r", + " pm.response.to.have.status(201);\r", + "});\r", + "\r", + "var fullUrl= pm.collectionVariables.get(\"pre_signed_URL\");\r", + "\r", + "// Find the index of '?' to get the position of the query parameters\r", + "var indexOfQuestionMark = fullUrl.indexOf('?');\r", + "\r", + "// Extract the partial URL without the query parameters\r", + "var partialUrl = indexOfQuestionMark !== -1 ? fullUrl.slice(0, indexOfQuestionMark) : fullUrl;\r", + "pm.collectionVariables.set(\"partial_URL\", partialUrl);\r", + "// Log the partial URL to the console (you can remove this line if not needed)\r", + "console.log(pm.collectionVariables.get(\"partial_URL\"));\r", + "\r", + "// Now you can use the 'partialUrl' variable in Postman as needed\r", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "PUT", + "header": [ + { + "key": "X-Ms-Blob-Type", + "value": "BlockBlob" + } + ], + "body": { + "mode": "formdata", + "formdata": [ + { + "key": "file", + "type": "file", + "src": "/C:/Users/Qualitrix/Downloads/pdf_233.pdf" + } + ] + }, + "url": { + "raw": "{{pre_signed_URL}}", + "host": [ + "{{pre_signed_URL}}" + ] + } + }, + "response": [] + }, + { + "name": "Update the content with URL and mime type", + "event": [ + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + }, + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json();\r", + "\r", + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "pm.test(\"Status code name has string OK\", function () {\r", + " pm.response.to.have.status(\"OK\");\r", + "});\r", + "pm.test(\"id should be api.content.upload\", function () {\r", + " pm.expect(jsonResponse.id).to.eql(\"api.content.upload\");\r", + "});\r", + "pm.test(\"ver should be 4.0\", function () {\r", + " pm.expect(jsonResponse.ver).to.eql(\"4.0\");\r", + "});\r", + "\r", + "pm.test(\"Params has keys: resmsgid , msgid , err , status , errmsg \", () => {\r", + " pm.expect(jsonResponse.params).to.have.all.keys('resmsgid', 'msgid','err','status','errmsg');\r", + " pm.expect(jsonResponse.params.resmsgid).to.be.a(\"string\");\r", + " pm.expect(jsonResponse.params.msgid).to.be.a('null');\r", + " pm.expect(jsonResponse.params.err).to.be.a('null');\r", + " pm.expect(jsonResponse.params.status).to.be.a(\"string\");\r", + " pm.expect(jsonResponse.params.errmsg).to.be.a('null');\r", + "});\r", + "\r", + "pm.test(\"Status is successful\", function () {\r", + " pm.expect(jsonResponse.params.status).to.be.equal(\"successful\");\r", + "});\r", + "\r", + "pm.test(\"ResponseCode is OK\", function () {\r", + " pm.expect(jsonResponse.responseCode).to.be.equal(\"OK\");\r", + "});\r", + "\r", + "pm.test(\"Result has keys: identifier , artifactUrl , content_url , node_id , versionKey \", () => {\r", + " pm.expect(jsonResponse.result).to.have.all.keys('identifier', 'artifactUrl','content_url','node_id','versionKey');\r", + " pm.expect(jsonResponse.result.identifier).to.be.a(\"string\");\r", + " pm.expect(jsonResponse.result.artifactUrl).to.be.a(\"string\");\r", + " pm.expect(jsonResponse.result.content_url).to.be.a(\"string\");\r", + " pm.expect(jsonResponse.result.node_id).to.be.a(\"string\");\r", + " pm.expect(jsonResponse.result.versionKey).to.be.a(\"string\");\r", + "});\r", + "\r", + "pm.test(`artifactUrl should be: ${pm.collectionVariables.get(\"partial_URL\")}`, function () {\r", + " pm.expect(jsonResponse.result.artifactUrl).to.be.equal(`${pm.collectionVariables.get(\"partial_URL\")}`);\r", + "});\r", + "\r", + "pm.test(`content_url should be: ${pm.collectionVariables.get(\"partial_URL\")}`, function () {\r", + " pm.expect(jsonResponse.result.content_url).to.be.equal(`${pm.collectionVariables.get(\"partial_URL\")}`);\r", + "});\r", + "\r", + "pm.test(`identifier should be: ${pm.collectionVariables.get(\"copy_content\")}`, function () {\r", + " pm.expect(jsonResponse.result.identifier).to.be.equal(`${pm.collectionVariables.get(\"copy_content\")}`);\r", + "});\r", + "\r", + "pm.test(`node_id should be: ${pm.collectionVariables.get(\"copy_content\")}`, function () {\r", + " pm.expect(jsonResponse.result.node_id).to.be.equal(`${pm.collectionVariables.get(\"copy_content\")}`);\r", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "user-id", + "value": "mahesh" + }, + { + "key": "Cookie", + "value": "connect.sid=s%3AnLNdCeYI27WUkZBIFdX1J5MKTM6ISEdJ.SFTq%2FeT2cVLh5TSEWmwZPCekWDSeNXILHPDyziKa26E" + }, + { + "key": "X-Channel-Id", + "value": "0137541424673095687" + }, + { + "key": "X-Authenticated-User-token", + "value": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImtpZCI6ImFjY2Vzc3YxX2tleTEifQ.eyJhdWQiOiJodHRwczovL2Rldi5zdW5iaXJkZWQub3JnL2F1dGgvcmVhbG1zL3N1bmJpcmQiLCJzdWIiOiJmOjVhOGEzZjJiLTM0MDktNDJlMC05MDAxLWY5MTNiYzBmZGUzMToxNTVjZTNjNS03MTNlLTQ3NDktYmMxYy05NWQwOWM2NDA5MTQiLCJyb2xlcyI6W3sicm9sZSI6IkNPTlRFTlRfQ1JFQVRPUiIsInNjb3BlIjpbeyJvcmdhbmlzYXRpb25JZCI6IjAxMzc1NDE0MjQ2NzMwOTU2ODcifV19LHsicm9sZSI6IkNPVVJTRV9NRU5UT1IiLCJzY29wZSI6W3sib3JnYW5pc2F0aW9uSWQiOiIwMTM3NTQxNDI0NjczMDk1Njg3In1dfSx7InJvbGUiOiJQVUJMSUMiLCJzY29wZSI6W119XSwiaXNzIjoiaHR0cHM6Ly9kZXYuc3VuYmlyZGVkLm9yZy9hdXRoL3JlYWxtcy9zdW5iaXJkIiwibmFtZSI6ImNvbnRlbnRDcmVhdG9yIiwidHlwIjoiQmVhcmVyIiwiZXhwIjoxNzAyMzI0NjU0LCJpYXQiOjE3MDIyODE0NTR9.MxiIhP6YJmI1XbozLNoJeQAbdQKs597f2mlNHWcJ-ZZIXvBx4BcX7T57B5xXGIT6LJ6YlS86saiG6SXHIG5ptgICphdefNysfVgkSUmqTsgzfzvjp2lzIw8Re7xi735Kd7B612y5Tkswm0ETP7NIeQ7-Tc_3h37GV04ISfx0LMD75UvgllxcDz91Bl6N3-WN4KwCeKIfJ-iZj-EJLwoBmJjGsgNCNTn5DTzF_joFcyett__WVc14Ex-BqRSq8Hr2fMVoHpNXze3QUJ7PcD4JRY2Ywg5R9VkHz3mkhY9kI1cWeHdQypeSsM8niQK1XCWJz_aTqsP35MshDnHkWhmDyg" + }, + { + "key": "Authorization", + "value": "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiIzZGNjMzY3OWIwYTE0NmU2YWYyZjlmZDA5NWU5NTlkNCJ9.0NZhX5sqUNy-GZUya90aQFkr5ZNiqfOuELYz_IvoyS8" + } + ], + "body": { + "mode": "formdata", + "formdata": [ + { + "key": "fileUrl", + "value": "{{partial_URL}}", + "type": "text" + }, + { + "key": "mimeType", + "value": "application/pdf", + "type": "text" + } + ] + }, + "url": { + "raw": "{{host}}/content/v4/upload/{{copy_content}}", + "host": [ + "{{host}}" + ], + "path": [ + "content", + "v4", + "upload", + "{{copy_content}}" + ] + } + }, + "response": [] + }, + { + "name": "Submit for Review", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json();\r", + "\r", + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "pm.test(\"Status code name has string OK\", function () {\r", + " pm.response.to.have.status(\"OK\");\r", + "});\r", + "pm.test(\"id should be api.content.review\", function () {\r", + " pm.expect(jsonResponse.id).to.eql(\"api.content.review\");\r", + "});\r", + "pm.test(\"ver should be 4.0\", function () {\r", + " pm.expect(jsonResponse.ver).to.eql(\"4.0\");\r", + "});\r", + "\r", + "pm.test(\"Params has keys: resmsgid , msgid , err , status , errmsg \", () => {\r", + " pm.expect(jsonResponse.params).to.have.all.keys('resmsgid', 'msgid','err','status','errmsg');\r", + " pm.expect(jsonResponse.params.resmsgid).to.be.a(\"string\");\r", + " pm.expect(jsonResponse.params.msgid).to.be.a('null');\r", + " pm.expect(jsonResponse.params.err).to.be.a('null');\r", + " pm.expect(jsonResponse.params.status).to.be.a(\"string\");\r", + " pm.expect(jsonResponse.params.errmsg).to.be.a('null');\r", + "});\r", + "\r", + "pm.test(\"Status is successful\", function () {\r", + " pm.expect(jsonResponse.params.status).to.be.equal(\"successful\");\r", + "});\r", + "\r", + "pm.test(\"ResponseCode is OK\", function () {\r", + " pm.expect(jsonResponse.responseCode).to.be.equal(\"OK\");\r", + "});\r", + "pm.test(\"Result has keys: identifier , versionKey\", () => {\r", + " pm.expect(jsonResponse.result).to.have.all.keys('identifier','versionKey');\r", + " pm.expect(jsonResponse.result.identifier).to.be.a(\"string\");\r", + " pm.expect(jsonResponse.result.versionKey).to.be.a(\"string\");\r", + "});\r", + "\r", + "pm.test(`identifier should be: ${pm.collectionVariables.get(\"copy_content\")}`, function () {\r", + " pm.expect(jsonResponse.result.identifier).to.be.equal(`${pm.collectionVariables.get(\"copy_content\")}`);\r", + "});\r", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "apikey", + "apikey": [ + { + "key": "value", + "value": "{{auth_token}}", + "type": "string" + }, + { + "key": "key", + "value": "Authorization", + "type": "string" + }, + { + "key": "in", + "value": "header", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "description": "(Required) The Content Type entity is the media type of the resource.Possible media types can be:-\n - Application/json", + "key": "Content-Type", + "value": "application/json" + }, + { + "description": "(Required) The Registered User ID to execute the API.", + "key": "X-Authenticated-User-token", + "value": "ea laborum" + }, + { + "description": "(Required) All content APIs require authorization for use. Specify the authorization key received from the administrator when placing the request for use of the API.", + "key": "Authorization", + "value": "ea laborum" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/content/v4/review/{{copy_content}}", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v4", + "review", + "{{copy_content}}" + ] + }, + "description": ">- This API is associated with Submission of content for Review on the Sunbird Platform .\n - The**_/review/{content Id}_** endpoint executes \"Submit for Review\" request based on parameters provided as metadata in the request body.\n - The endpoint for **Review Content** is `/content/v2/review`\n - It points to knowledge-mw-service - `/v2/content/review`\n - {...}refers to a section of review endpoint URL path that needs to be replaced by appropriate Id.\n - You need to provide a valid content Id value in {Content Id} field of API URL.\n - It is mandatory to provide values for parameters marked with *.\n - Mandatory fields cannot be null or empty." + }, + "response": [ + { + "name": "OK ! Successful operation.Content sent for review operation was successfully executed.", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource.Possible media types can be:-\n - Application/json", + "key": "Content-Type", + "value": "ea laborum" + }, + { + "description": "(Required) The Registered User ID to execute the API.", + "key": "X-Authenticated-User-token", + "value": "ea laborum" + }, + { + "description": "(Required) All content APIs require authorization for use. Specify the authorization key received from the administrator when placing the request for use of the API.", + "key": "Authorization", + "value": "ea laborum" + } + ], + "body": { + "mode": "raw", + "raw": "{}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/content/v2/review/:Content_Id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v2", + "review", + ":Content_Id" + ], + "variable": [ + { + "key": "Content_Id", + "value": "ea laborum", + "description": "(Required) Please append a valid Content Id To the Request URL" + } + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"ekstep.learning.content.review\",\n \"ver\": \"3.0\",\n \"ts\": \"2020-12-10T21:06:26ZZ\",\n \"params\": {\n \"resmsgid\": \"186cf9a9-8094-4cdd-926f-b77a030921d1\",\n \"msgid\": null,\n \"err\": null,\n \"status\": \"successful\",\n \"errmsg\": null\n },\n \"responseCode\": \"OK\",\n \"result\": {\n \"node_id\": \"do_1131697376667402241315\",\n \"versionKey\": \"1607634386533\"\n }\n}" + }, + { + "name": "RESOURCE NOT FOUND,**Content Send for Review** operation failed !The possible reason for failure is that you may have provided wrong content id.", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource.Possible media types can be:-\n - Application/json", + "key": "Content-Type", + "value": "ea laborum" + }, + { + "description": "(Required) The Registered User ID to execute the API.", + "key": "X-Authenticated-User-token", + "value": "ea laborum" + }, + { + "description": "(Required) All content APIs require authorization for use. Specify the authorization key received from the administrator when placing the request for use of the API.", + "key": "Authorization", + "value": "ea laborum" + } + ], + "body": { + "mode": "raw", + "raw": "{}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/content/v2/review/:Content_Id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v2", + "review", + ":Content_Id" + ], + "variable": [ + { + "key": "Content_Id", + "value": "ea laborum", + "description": "(Required) Please append a valid Content Id To the Request URL" + } + ] + } + }, + "status": "Not Found", + "code": 404, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"ekstep.learning.content.review\",\n \"ver\": \"3.0\",\n \"ts\": \"2020-12-10T21:06:54ZZ\",\n \"params\": {\n \"resmsgid\": \"944ac944-78d9-43e2-bfd5-337ab52b6552\",\n \"msgid\": null,\n \"err\": \"ERR_TAXONOMY_INVALID_CONTENT\",\n \"status\": \"failed\",\n \"errmsg\": \"Error! While Fetching the Content for Operation | [Content Id: do_11316973766674022413151]\"\n },\n \"responseCode\": \"CLIENT_ERROR\",\n \"result\": {}\n}" + }, + { + "name": "INTERNAL SERVER ERROR ! Looks like something went wrong! We track these errors automatically, but if the problem persists feel free to contact us. In the meantime, try refreshing.", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource.Possible media types can be:-\n - Application/json", + "key": "Content-Type", + "value": "ea laborum" + }, + { + "description": "(Required) The Registered User ID to execute the API.", + "key": "X-Authenticated-User-token", + "value": "ea laborum" + }, + { + "description": "(Required) All content APIs require authorization for use. Specify the authorization key received from the administrator when placing the request for use of the API.", + "key": "Authorization", + "value": "ea laborum" + } + ], + "body": { + "mode": "raw", + "raw": "{}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/content/v2/review/:Content_Id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v2", + "review", + ":Content_Id" + ], + "variable": [ + { + "key": "Content_Id", + "value": "ea laborum", + "description": "(Required) Please append a valid Content Id To the Request URL" + } + ] + } + }, + "status": "Internal Server Error", + "code": 500, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"result\": {},\n \"id\": \"cupidatat reprehenderit dolor\",\n \"ver\": \"minim anim commodo\",\n \"ts\": \"commodo\",\n \"params\": {\n \"resmsgid\": \"pariatur repre\",\n \"msgid\": \"irure\",\n \"err\": \"consequat esse ea\",\n \"status\": \"esse\",\n \"errmsg\": \"aliqua laboris velit\"\n },\n \"responseCode\": \"reprehenderit dolor elit sunt dolore\"\n}" + } + ] + }, + { + "name": "Publish Content", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json()\r", + "\r", + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "\r", + "pm.test(\"id has string - api.content.publish.public \", function () {\r", + " pm.expect(jsonResponse.id).to.be.equal(\"api.content.publish.public\");\r", + "});\r", + "\r", + "pm.test(\"Version is 4.0 \", function () {\r", + " pm.expect(jsonResponse.ver).to.be.equal(\"4.0\");\r", + "});\r", + "\r", + "pm.test(\"Verify keys and data type of the response result\", () => {\r", + " pm.expect(jsonResponse.params).to.have.all.keys('resmsgid','msgid','status', 'err','errmsg');\r", + " pm.expect(jsonResponse.params.resmsgid).to.be.a(\"string\");\r", + " pm.expect(jsonResponse.params.msgid).to.be.a(\"null\"); \r", + " pm.expect(jsonResponse.params.status).to.be.a(\"string\");\r", + " pm.expect(jsonResponse.params.err).to.be.a(\"null\");\r", + " pm.expect(jsonResponse.params.errmsg).to.be.a(\"null\");\r", + "});\r", + "\r", + "pm.test(\"Status is successful \", function () {\r", + " pm.expect(jsonResponse.params.status).to.be.equal(\"successful\");\r", + "});\r", + "\r", + "pm.test(\"ResponseCode is OK \", function () {\r", + " pm.expect(jsonResponse.responseCode).to.be.equal(\"OK\");\r", + "});\r", + "\r", + "pm.test(\"Verify keys and data type of the response result\", () => {\r", + " pm.expect(jsonResponse.result).to.have.all.keys('publishStatus','node_id');\r", + " pm.expect(jsonResponse.result.publishStatus).to.be.a('String');\r", + " pm.expect(jsonResponse.result.node_id).to.be.a('String');\r", + "});\r", + "\r", + "pm.test(\"node should be equal to \" + pm.collectionVariables.get(\"copy_content\"), () => {\r", + " pm.expect(jsonResponse.result.node_id).to.eql(pm.collectionVariables.get(\"copy_content\"));\r", + "});\r", + "pm.test(`publishStatus should be equal to Publish Event for Content Id ${pm.collectionVariables.get(\"copy_content\")} is pushed Successfully!`, () => {\r", + " pm.expect(jsonResponse.result.publishStatus).to.eql(`Publish Event for Content Id '${pm.collectionVariables.get(\"copy_content\")}' is pushed Successfully!`);\r", + "});\r", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "apikey", + "apikey": [ + { + "key": "key", + "value": "Authorization", + "type": "string" + }, + { + "key": "value", + "value": "", + "type": "string" + }, + { + "key": "in", + "value": "header", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "description": "(Required) The Content Type entity is the media type of the resource.Possible media types can be:-\n - Application/json\n - Multipart/form-data\n - Application/x-www-form-urlencoded", + "key": "Content-Type", + "value": "application/json" + }, + { + "description": "(Required) User Registered ID , which is used for logging In", + "key": "X-Authenticated-User-token", + "value": "ea laborum" + }, + { + "description": "(Required) Authorizing user in order to grant access.", + "key": "Authorization", + "value": "ea laborum" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"content\": {\n \"Publisher\": \"sunbird.publisher.create\",\n \"lastPublishedBy\": \"Ekstep\"\n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/content/v4/publish/{{copy_content}}", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v4", + "publish", + "{{copy_content}}" + ] + }, + "description": "This API is associated with publishing content on the Sunbird Platform .\n - **_/publish/_** endpoint executes the \"Publish Content\" request based on parameters provided as metadata in the request body.\n - The endpoint for **Publish Content** is `/content/v1/publish`\n - It points to knowledge-mw-service - `/v2/content/publish`\n - {...}refers to a section of review endpoint URL path that needs to be replaced by appropriate Id.\n - It is mandatory to provide values for parameters marked with *.\n - Mandatory fields cannot be null or empty." + }, + "response": [ + { + "name": "OK ! Successful operation.**Content publish operation was successfully executed.", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource.Possible media types can be:-\n - Application/json\n - Multipart/form-data\n - Application/x-www-form-urlencoded", + "key": "Content-Type", + "value": "ea laborum" + }, + { + "description": "(Required) User Registered ID , which is used for logging In", + "key": "X-Authenticated-User-token", + "value": "ea laborum" + }, + { + "description": "(Required) Authorizing user in order to grant access.", + "key": "Authorization", + "value": "ea laborum" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"content\": {\n \"lastPublishedBy\": \"Ekstep\"\n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/content/v1/publish/:Content_Id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v1", + "publish", + ":Content_Id" + ], + "variable": [ + { + "key": "Content_Id", + "value": "ea laborum", + "description": "(Required) Content Id to be published" + } + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"api.v3.publish\",\n \"ver\": \"1.0\",\n \"ts\": \"2020-12-10T21:41:23.491Z\",\n \"params\": {\n \"resmsgid\": \"72c4ef30-3b30-11eb-b0a2-8d5c9f561887\",\n \"msgid\": \"72979da0-3b30-11eb-b0a2-8d5c9f561887\",\n \"status\": \"successful\",\n \"err\": null,\n \"errmsg\": null\n },\n \"responseCode\": \"OK\",\n \"result\": {\n \"content_id\": \"do_21316975736724684813479\",\n \"publishStatus\": \"Publish Operation for Content Id 'do_21316975736724684813479' Started Successfully!\"\n }\n}" + }, + { + "name": "RESOURCE NOT FOUND,**Content Send for Review** operation failed !The possible reason for failure is that you may have provided wrong content id.", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource.Possible media types can be:-\n - Application/json\n - Multipart/form-data\n - Application/x-www-form-urlencoded", + "key": "Content-Type", + "value": "ea laborum" + }, + { + "description": "(Required) User Registered ID , which is used for logging In", + "key": "X-Authenticated-User-token", + "value": "ea laborum" + }, + { + "description": "(Required) Authorizing user in order to grant access.", + "key": "Authorization", + "value": "ea laborum" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"content\": {\n \"lastPublishedBy\": \"Ekstep\"\n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/content/v1/publish/:Content_Id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v1", + "publish", + ":Content_Id" + ], + "variable": [ + { + "key": "Content_Id", + "value": "ea laborum", + "description": "(Required) Content Id to be published" + } + ] + } + }, + "status": "Not Found", + "code": 404, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"api.v3.publish\",\n \"ver\": \"1.0\",\n \"ts\": \"2020-12-10T21:51:39.870Z\",\n \"params\": {\n \"resmsgid\": \"e228e7e0-3b31-11eb-b0a2-8d5c9f561887\",\n \"msgid\": null,\n \"status\": \"failed\",\n \"err\": \"NOT_FOUND\",\n \"errmsg\": \"Error! Node(s) doesn't Exists. | [Invalid Node Id.]: do_213169757367246848134791\"\n },\n \"responseCode\": \"RESOURCE_NOT_FOUND\",\n \"result\": {}\n}" + }, + { + "name": "INTERNAL SERVER ERROR ! Looks like something went wrong! We track these errors automatically, but if the problem persists feel free to contact us. In the meantime, try refreshing.", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource.Possible media types can be:-\n - Application/json\n - Multipart/form-data\n - Application/x-www-form-urlencoded", + "key": "Content-Type", + "value": "ea laborum" + }, + { + "description": "(Required) User Registered ID , which is used for logging In", + "key": "X-Authenticated-User-token", + "value": "ea laborum" + }, + { + "description": "(Required) Authorizing user in order to grant access.", + "key": "Authorization", + "value": "ea laborum" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"content\": {\n \"lastPublishedBy\": \"Ekstep\"\n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/content/v1/publish/:Content_Id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v1", + "publish", + ":Content_Id" + ], + "variable": [ + { + "key": "Content_Id", + "value": "ea laborum", + "description": "(Required) Content Id to be published" + } + ] + } + }, + "status": "Internal Server Error", + "code": 500, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"result\": {},\n \"id\": \"cupidatat reprehenderit dolor\",\n \"ver\": \"minim anim commodo\",\n \"ts\": \"commodo\",\n \"params\": {\n \"resmsgid\": \"pariatur repre\",\n \"msgid\": \"irure\",\n \"err\": \"consequat esse ea\",\n \"status\": \"esse\",\n \"errmsg\": \"aliqua laboris velit\"\n },\n \"responseCode\": \"reprehenderit dolor elit sunt dolore\"\n}" + } + ] + } + ] + }, + { + "name": "Positive", + "item": [ + { + "name": "Copy Valid Content", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json();\r", + "\r", + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "pm.test(\"Status code name has string OK\", function () {\r", + " pm.response.to.have.status(\"OK\");\r", + "});\r", + "pm.test(\"id should be api.content.copy\", function () {\r", + " pm.expect(jsonResponse.id).to.eql(\"api.content.copy\");\r", + "});\r", + "pm.test(\"ver should be 4.0\", function () {\r", + " pm.expect(jsonResponse.ver).to.eql(\"4.0\");\r", + "});\r", + "\r", + "pm.test(\"Params has keys: resmsgid , msgid , err , status , errmsg \", () => {\r", + " pm.expect(jsonResponse.params).to.have.all.keys('resmsgid', 'msgid','err','status','errmsg');\r", + " pm.expect(jsonResponse.params.resmsgid).to.be.a(\"string\");\r", + " pm.expect(jsonResponse.params.msgid).to.be.a('null');\r", + " pm.expect(jsonResponse.params.err).to.be.a('null');\r", + " pm.expect(jsonResponse.params.status).to.be.a(\"string\");\r", + " pm.expect(jsonResponse.params.errmsg).to.be.a('null');\r", + "});\r", + "\r", + "pm.test(\"Status is successful\", function () {\r", + " pm.expect(jsonResponse.params.status).to.be.equal(\"successful\");\r", + "});\r", + "\r", + "pm.test(\"ResponseCode is OK\", function () {\r", + " pm.expect(jsonResponse.responseCode).to.be.equal(\"OK\");\r", + "});\r", + "pm.test(\"Result has keys: identifier , node_id , versionKey\", () => {\r", + " pm.expect(jsonResponse.result).to.have.all.keys('node_id','versionKey');\r", + " pm.expect(jsonResponse.result.versionKey).to.be.a(\"string\");\r", + " pm.expect(jsonResponse.result.node_id).to.be.a('object');\r", + "});\r", + "pm.test(\r", + " // Check if \"node_id\" has exactly one key-value pair\r", + " pm.expect(Object.keys(jsonResponse.result.node_id)).to.have.length(1)\r", + ");\r", + "// Get the key and value from \"node_id\"\r", + "var nodeIdKey = Object.keys(jsonResponse.result.node_id)[0];\r", + "var nodeIdValue = jsonResponse.result.node_id[nodeIdKey];\r", + "pm.test(\r", + " // Validate the key and value format\r", + " pm.expect(nodeIdKey).to.match(/^do_\\d+$/) // Match the format \"do_\" followed by digits\r", + ");\r", + "pm.test(\r", + " pm.expect(nodeIdValue).to.match(/^do_\\d+$/) // Match the format \"do_\" followed by digits\r", + ");\r", + "" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "apikey", + "apikey": [ + { + "key": "key", + "value": "Authorization", + "type": "string" + }, + { + "key": "value", + "value": "", + "type": "string" + }, + { + "key": "in", + "value": "header", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "description": "(Required) The Content Type entity is the media type of the resource.Possible media types can be:-\n - Application/json", + "key": "Content-Type", + "value": "application/json" + }, + { + "description": "(Required) The Registered User ID to execute the API.", + "key": "X-Authenticated-User-token", + "value": "ea laborum" + }, + { + "description": "(Required) All content APIs require authorization for use. Specify the authorization key received from the administrator when placing the request for use of the API.", + "key": "Authorization", + "value": "ea laborum" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"content\": {\n \"mimeType\": \"application/pdf\",\n \"objectType\": \"Content\",\n \"createdBy\": \"user1\",\n \n \"createdFor\": [\n \"user2\"\n ],\n \"organisation\": [\n \"sunbird\"\n ],\n \"framework\": \"NCF\"\n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/content/v4/copy/{{copy_content}}", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v4", + "copy", + "{{copy_content}}" + ] + }, + "description": "This API is associated with copying a content on the Sunbird Platform .\n - The **_/copy/_**endpoint executes request for copy content, if content is found appropriate.\n - The endpoint for **Copy Content** is `/content/v2/copy`\n - It points to knowledge-mw-service - `/v2/content/copy`\n - It is mandatory to provide values for parameters marked with *.\n - Mandatory fields cannot be null or empty." + }, + "response": [ + { + "name": "OK ! Successful operation.\"Copy\" operation was successfully executed.", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource.Possible media types can be:-\n - Application/json", + "key": "Content-Type", + "value": "ea laborum" + }, + { + "description": "(Required) The Registered User ID to execute the API.", + "key": "X-Authenticated-User-token", + "value": "ea laborum" + }, + { + "description": "(Required) All content APIs require authorization for use. Specify the authorization key received from the administrator when placing the request for use of the API.", + "key": "Authorization", + "value": "ea laborum" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"content\": {\n \"createdBy\": \"user1\",\n \"createdFor\": [\n \"user2\"\n ],\n \"organisation\": [\n \"sunbird\"\n ],\n \"framework\": \"NCF\"\n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/content/v2/copy/:Content_Id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v2", + "copy", + ":Content_Id" + ], + "variable": [ + { + "key": "Content_Id", + "value": "ea laborum", + "description": "(Required) Please append a valid Content Id To the Request URL" + } + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"api.content.copy\",\n \"ver\": \"1.0\",\n \"ts\": \"2020-12-11T23:28:25.343Z\",\n \"params\": {\n \"resmsgid\": \"90e788f0-3c08-11eb-b0a2-8d5c9f561887\",\n \"msgid\": \"90b3f5d0-3c08-11eb-b0a2-8d5c9f561887\",\n \"status\": \"successful\",\n \"err\": null,\n \"errmsg\": null\n },\n \"responseCode\": \"OK\",\n \"result\": {\n \"node_id\": {\n \"do_21316884557433241613378\": \"do_21317051846683852813814\"\n },\n \"versionKey\": \"1607729305036\"\n }\n}" + }, + { + "name": "BAD REQUEST. The \"Copy Content\" operation failed ! The possible reason for failure is that you may have missed providing input for a mandatory parameter.", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource.Possible media types can be:-\n - Application/json", + "key": "Content-Type", + "value": "ea laborum" + }, + { + "description": "(Required) The Registered User ID to execute the API.", + "key": "X-Authenticated-User-token", + "value": "ea laborum" + }, + { + "description": "(Required) All content APIs require authorization for use. Specify the authorization key received from the administrator when placing the request for use of the API.", + "key": "Authorization", + "value": "ea laborum" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"content\": {\n \"createdBy\": \"user1\",\n \"createdFor\": [\n \"user2\"\n ],\n \"organisation\": [\n \"sunbird\"\n ],\n \"framework\": \"NCF\"\n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/content/v2/copy/:Content_Id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v2", + "copy", + ":Content_Id" + ], + "variable": [ + { + "key": "Content_Id", + "value": "ea laborum", + "description": "(Required) Please append a valid Content Id To the Request URL" + } + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"api.content.copy\",\n \"ver\": \"1.0\",\n \"ts\": \"2020-12-11T23:27:31.708Z\",\n \"params\": {\n \"resmsgid\": \"70ef7bc0-3c08-11eb-b0a2-8d5c9f561887\",\n \"msgid\": null,\n \"status\": \"failed\",\n \"err\": \"ERR_INVALID_REQUEST\",\n \"errmsg\": \"Please provide valid value for List(createdBy, createdFor, organisation, framework)\"\n },\n \"responseCode\": \"CLIENT_ERROR\",\n \"result\": {\n \"messages\": null\n }\n}" + }, + { + "name": "RESOURCE NOT FOUND,**Content Send for Copy** operation failed !The possible reason for failure is that you may have provided wrong content id.", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource.Possible media types can be:-\n - Application/json", + "key": "Content-Type", + "value": "ea laborum" + }, + { + "description": "(Required) The Registered User ID to execute the API.", + "key": "X-Authenticated-User-token", + "value": "ea laborum" + }, + { + "description": "(Required) All content APIs require authorization for use. Specify the authorization key received from the administrator when placing the request for use of the API.", + "key": "Authorization", + "value": "ea laborum" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"content\": {\n \"createdBy\": \"user1\",\n \"createdFor\": [\n \"user2\"\n ],\n \"organisation\": [\n \"sunbird\"\n ],\n \"framework\": \"NCF\"\n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/content/v2/copy/:Content_Id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v2", + "copy", + ":Content_Id" + ], + "variable": [ + { + "key": "Content_Id", + "value": "ea laborum", + "description": "(Required) Please append a valid Content Id To the Request URL" + } + ] + } + }, + "status": "Not Found", + "code": 404, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"api.content.copy\",\n \"ver\": \"1.0\",\n \"ts\": \"2020-12-11T23:28:36.863Z\",\n \"params\": {\n \"resmsgid\": \"97c558f0-3c08-11eb-b0a2-8d5c9f561887\",\n \"msgid\": null,\n \"status\": \"failed\",\n \"err\": \"NOT_FOUND\",\n \"errmsg\": \"Error! Node(s) doesn't Exists. | [Invalid Node Id.]: do_213168845574332416133781\"\n },\n \"responseCode\": \"RESOURCE_NOT_FOUND\",\n \"result\": {\n \"messages\": null\n }\n}" + }, + { + "name": "INTERNAL SERVER ERROR ! Looks like something went wrong! These errors are tracked automatically, but if the problem persists feel free to contact us. In the meantime, try refreshing.", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource.Possible media types can be:-\n - Application/json", + "key": "Content-Type", + "value": "ea laborum" + }, + { + "description": "(Required) The Registered User ID to execute the API.", + "key": "X-Authenticated-User-token", + "value": "ea laborum" + }, + { + "description": "(Required) All content APIs require authorization for use. Specify the authorization key received from the administrator when placing the request for use of the API.", + "key": "Authorization", + "value": "ea laborum" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"content\": {\n \"createdBy\": \"user1\",\n \"createdFor\": [\n \"user2\"\n ],\n \"organisation\": [\n \"sunbird\"\n ],\n \"framework\": \"NCF\"\n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/content/v2/copy/:Content_Id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v2", + "copy", + ":Content_Id" + ], + "variable": [ + { + "key": "Content_Id", + "value": "ea laborum", + "description": "(Required) Please append a valid Content Id To the Request URL" + } + ] + } + }, + "status": "Internal Server Error", + "code": 500, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"result\": {},\n \"id\": \"cupidatat reprehenderit dolor\",\n \"ver\": \"minim anim commodo\",\n \"ts\": \"commodo\",\n \"params\": {\n \"resmsgid\": \"pariatur repre\",\n \"msgid\": \"irure\",\n \"err\": \"consequat esse ea\",\n \"status\": \"esse\",\n \"errmsg\": \"aliqua laboris velit\"\n },\n \"responseCode\": \"reprehenderit dolor elit sunt dolore\"\n}" + } + ] + } + ] + }, + { + "name": "Negative", + "item": [ + { + "name": "Copy invalid Content", + "event": [ + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + }, + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json()\r", + "\r", + "//Verification\r", + "pm.test(\"Status code is 404\", function () {\r", + " pm.response.to.have.status(404)\r", + "});\r", + "pm.test(\"Params has keys: resmsgid , msgid , err , status , errmsg \", () => {\r", + " pm.expect(jsonResponse.params).to.have.all.keys('resmsgid', 'msgid','err','status','errmsg');\r", + " pm.expect(jsonResponse.params.resmsgid).to.be.a(\"string\");\r", + " pm.expect(jsonResponse.params.msgid).to.be.a('null');\r", + " pm.expect(jsonResponse.params.err).to.be.a('string');\r", + " pm.expect(jsonResponse.params.status).to.be.a(\"string\");\r", + " pm.expect(jsonResponse.params.errmsg).to.be.a('string');\r", + "});\r", + "//code name contains a string\r", + "tests[\"Status code name has string \\\"Not Found\\\"\"] = responseCode.name.has(\"Not Found\");\r", + "\r", + "pm.test(\"Test data type of the response and keys\", () => {\r", + " pm.expect(jsonResponse.result).to.be.an(\"object\");\r", + " pm.expect(jsonResponse.result).to.have.all.keys('messages');\r", + " pm.expect(jsonResponse.result.messages).to.be.null;\r", + "});\r", + "\r", + "//Validation\r", + "// Response body\r", + "pm.test(\"id should be api.content.copy\", () => {\r", + " pm.expect(jsonResponse.id).to.eql(\"api.content.copy\");\r", + "});\r", + "pm.test(\"ver should be 4.0\", () => {\r", + " pm.expect(jsonResponse.ver).to.eql(\"4.0\");\r", + "});\r", + "pm.test(\"responseCode should be RESOURCE_NOT_FOUND\", () => {\r", + " pm.expect(jsonResponse.responseCode).to.eql(\"RESOURCE_NOT_FOUND\");\r", + "});\r", + "\r", + "// Params\r", + "pm.test(\"params.err should be \\\"NOT_FOUND\\\"\", () => {\r", + " pm.expect(jsonResponse.params.err).to.eql(\"NOT_FOUND\");\r", + "});\r", + "pm.test(\"params.status should be \\\"failed\\\"\", () => {\r", + " pm.expect(jsonResponse.params.status).to.eql(\"failed\");\r", + "});\r", + "pm.test(`errmsg: Error! Node(s) doesn't Exists. | [Invalid Node Id.]: dummy`, () => {\r", + " pm.expect(jsonResponse.params.errmsg).to.eql(`Error! Node(s) doesn't Exists. | [Invalid Node Id.]: dummy`);\r", + "});\r", + "\r", + "// Result\r", + "pm.test(\"messages should be null\", () => {\r", + " pm.expect(jsonResponse.result.messages).to.eql(null);\r", + "});\r", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "apikey", + "apikey": [ + { + "key": "key", + "value": "Authorization", + "type": "string" + }, + { + "key": "value", + "value": "", + "type": "string" + }, + { + "key": "in", + "value": "header", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "description": "(Required) The Content Type entity is the media type of the resource.Possible media types can be:-\n - Application/json", + "key": "Content-Type", + "value": "application/json" + }, + { + "description": "(Required) The Registered User ID to execute the API.", + "key": "X-Authenticated-User-token", + "value": "ea laborum" + }, + { + "description": "(Required) All content APIs require authorization for use. Specify the authorization key received from the administrator when placing the request for use of the API.", + "key": "Authorization", + "value": "ea laborum" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"content\": {\n \"mimeType\": \"application/pdf\",\n \"objectType\": \"Content\",\n \"createdBy\": \"user1\",\n \n \"createdFor\": [\n \"user2\"\n ],\n \"organisation\": [\n \"sunbird\"\n ],\n \"framework\": \"NCF\"\n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/content/v4/copy/dummy", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v4", + "copy", + "dummy" + ] + }, + "description": "This API is associated with copying a content on the Sunbird Platform .\n - The **_/copy/_**endpoint executes request for copy content, if content is found appropriate.\n - The endpoint for **Copy Content** is `/content/v2/copy`\n - It points to knowledge-mw-service - `/v2/content/copy`\n - It is mandatory to provide values for parameters marked with *.\n - Mandatory fields cannot be null or empty." + }, + "response": [ + { + "name": "OK ! Successful operation.\"Copy\" operation was successfully executed.", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource.Possible media types can be:-\n - Application/json", + "key": "Content-Type", + "value": "ea laborum" + }, + { + "description": "(Required) The Registered User ID to execute the API.", + "key": "X-Authenticated-User-token", + "value": "ea laborum" + }, + { + "description": "(Required) All content APIs require authorization for use. Specify the authorization key received from the administrator when placing the request for use of the API.", + "key": "Authorization", + "value": "ea laborum" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"content\": {\n \"createdBy\": \"user1\",\n \"createdFor\": [\n \"user2\"\n ],\n \"organisation\": [\n \"sunbird\"\n ],\n \"framework\": \"NCF\"\n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/content/v2/copy/:Content_Id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v2", + "copy", + ":Content_Id" + ], + "variable": [ + { + "key": "Content_Id", + "value": "ea laborum", + "description": "(Required) Please append a valid Content Id To the Request URL" + } + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"api.content.copy\",\n \"ver\": \"1.0\",\n \"ts\": \"2020-12-11T23:28:25.343Z\",\n \"params\": {\n \"resmsgid\": \"90e788f0-3c08-11eb-b0a2-8d5c9f561887\",\n \"msgid\": \"90b3f5d0-3c08-11eb-b0a2-8d5c9f561887\",\n \"status\": \"successful\",\n \"err\": null,\n \"errmsg\": null\n },\n \"responseCode\": \"OK\",\n \"result\": {\n \"node_id\": {\n \"do_21316884557433241613378\": \"do_21317051846683852813814\"\n },\n \"versionKey\": \"1607729305036\"\n }\n}" + }, + { + "name": "BAD REQUEST. The \"Copy Content\" operation failed ! The possible reason for failure is that you may have missed providing input for a mandatory parameter.", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource.Possible media types can be:-\n - Application/json", + "key": "Content-Type", + "value": "ea laborum" + }, + { + "description": "(Required) The Registered User ID to execute the API.", + "key": "X-Authenticated-User-token", + "value": "ea laborum" + }, + { + "description": "(Required) All content APIs require authorization for use. Specify the authorization key received from the administrator when placing the request for use of the API.", + "key": "Authorization", + "value": "ea laborum" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"content\": {\n \"createdBy\": \"user1\",\n \"createdFor\": [\n \"user2\"\n ],\n \"organisation\": [\n \"sunbird\"\n ],\n \"framework\": \"NCF\"\n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/content/v2/copy/:Content_Id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v2", + "copy", + ":Content_Id" + ], + "variable": [ + { + "key": "Content_Id", + "value": "ea laborum", + "description": "(Required) Please append a valid Content Id To the Request URL" + } + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"api.content.copy\",\n \"ver\": \"1.0\",\n \"ts\": \"2020-12-11T23:27:31.708Z\",\n \"params\": {\n \"resmsgid\": \"70ef7bc0-3c08-11eb-b0a2-8d5c9f561887\",\n \"msgid\": null,\n \"status\": \"failed\",\n \"err\": \"ERR_INVALID_REQUEST\",\n \"errmsg\": \"Please provide valid value for List(createdBy, createdFor, organisation, framework)\"\n },\n \"responseCode\": \"CLIENT_ERROR\",\n \"result\": {\n \"messages\": null\n }\n}" + }, + { + "name": "RESOURCE NOT FOUND,**Content Send for Copy** operation failed !The possible reason for failure is that you may have provided wrong content id.", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource.Possible media types can be:-\n - Application/json", + "key": "Content-Type", + "value": "ea laborum" + }, + { + "description": "(Required) The Registered User ID to execute the API.", + "key": "X-Authenticated-User-token", + "value": "ea laborum" + }, + { + "description": "(Required) All content APIs require authorization for use. Specify the authorization key received from the administrator when placing the request for use of the API.", + "key": "Authorization", + "value": "ea laborum" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"content\": {\n \"createdBy\": \"user1\",\n \"createdFor\": [\n \"user2\"\n ],\n \"organisation\": [\n \"sunbird\"\n ],\n \"framework\": \"NCF\"\n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/content/v2/copy/:Content_Id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v2", + "copy", + ":Content_Id" + ], + "variable": [ + { + "key": "Content_Id", + "value": "ea laborum", + "description": "(Required) Please append a valid Content Id To the Request URL" + } + ] + } + }, + "status": "Not Found", + "code": 404, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"api.content.copy\",\n \"ver\": \"1.0\",\n \"ts\": \"2020-12-11T23:28:36.863Z\",\n \"params\": {\n \"resmsgid\": \"97c558f0-3c08-11eb-b0a2-8d5c9f561887\",\n \"msgid\": null,\n \"status\": \"failed\",\n \"err\": \"NOT_FOUND\",\n \"errmsg\": \"Error! Node(s) doesn't Exists. | [Invalid Node Id.]: do_213168845574332416133781\"\n },\n \"responseCode\": \"RESOURCE_NOT_FOUND\",\n \"result\": {\n \"messages\": null\n }\n}" + }, + { + "name": "INTERNAL SERVER ERROR ! Looks like something went wrong! These errors are tracked automatically, but if the problem persists feel free to contact us. In the meantime, try refreshing.", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource.Possible media types can be:-\n - Application/json", + "key": "Content-Type", + "value": "ea laborum" + }, + { + "description": "(Required) The Registered User ID to execute the API.", + "key": "X-Authenticated-User-token", + "value": "ea laborum" + }, + { + "description": "(Required) All content APIs require authorization for use. Specify the authorization key received from the administrator when placing the request for use of the API.", + "key": "Authorization", + "value": "ea laborum" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"content\": {\n \"createdBy\": \"user1\",\n \"createdFor\": [\n \"user2\"\n ],\n \"organisation\": [\n \"sunbird\"\n ],\n \"framework\": \"NCF\"\n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/content/v2/copy/:Content_Id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v2", + "copy", + ":Content_Id" + ], + "variable": [ + { + "key": "Content_Id", + "value": "ea laborum", + "description": "(Required) Please append a valid Content Id To the Request URL" + } + ] + } + }, + "status": "Internal Server Error", + "code": 500, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"result\": {},\n \"id\": \"cupidatat reprehenderit dolor\",\n \"ver\": \"minim anim commodo\",\n \"ts\": \"commodo\",\n \"params\": {\n \"resmsgid\": \"pariatur repre\",\n \"msgid\": \"irure\",\n \"err\": \"consequat esse ea\",\n \"status\": \"esse\",\n \"errmsg\": \"aliqua laboris velit\"\n },\n \"responseCode\": \"reprehenderit dolor elit sunt dolore\"\n}" + } + ] + }, + { + "name": "Copy Valid Content with missing fields", + "event": [ + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + }, + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json()\r", + "\r", + "//Verification\r", + "pm.test(\"Status code is 400\", function () {\r", + " pm.response.to.have.status(400)\r", + "});\r", + "pm.test(\"Params has keys: resmsgid , msgid , err , status , errmsg \", () => {\r", + " pm.expect(jsonResponse.params).to.have.all.keys('resmsgid', 'msgid','err','status','errmsg');\r", + " pm.expect(jsonResponse.params.resmsgid).to.be.a(\"string\");\r", + " pm.expect(jsonResponse.params.msgid).to.be.a('null');\r", + " pm.expect(jsonResponse.params.err).to.be.a('string');\r", + " pm.expect(jsonResponse.params.status).to.be.a(\"string\");\r", + " pm.expect(jsonResponse.params.errmsg).to.be.a('string');\r", + "});\r", + "//code name contains a string\r", + "tests[\"Status code name has string \\\"Bad Request\\\"\"] = responseCode.name.has(\"Bad Request\");\r", + "\r", + "pm.test(\"Test data type of the response and keys\", () => {\r", + " pm.expect(jsonResponse.result).to.be.an(\"object\");\r", + " pm.expect(jsonResponse.result).to.have.all.keys('messages');\r", + " pm.expect(jsonResponse.result.messages).to.be.null;\r", + "});\r", + "\r", + "//Validation\r", + "// Response body\r", + "pm.test(\"id should be api.content.copy\", function () {\r", + " pm.expect(jsonResponse.id).to.eql(\"api.content.copy\");\r", + "});\r", + "pm.test(\"ver should be 4.0\", () => {\r", + " pm.expect(jsonResponse.ver).to.eql(\"4.0\");\r", + "});\r", + "pm.test(\"responseCode should be CLIENT_ERROR\", () => {\r", + " pm.expect(jsonResponse.responseCode).to.eql(\"CLIENT_ERROR\");\r", + "});\r", + "\r", + "// Params\r", + "pm.test(`params.err should be \\\"ERR_INVALID_REQUEST\\\"`, () => {\r", + " pm.expect(jsonResponse.params.err).to.eql(\"ERR_INVALID_REQUEST\");\r", + "});\r", + "pm.test(\"params.status should be \\\"failed\\\"\", () => {\r", + " pm.expect(jsonResponse.params.status).to.eql(\"failed\");\r", + "});\r", + "pm.test(`errmsg: Please provide valid value for List(createdBy, createdFor, organisation, framework)`, () => {\r", + " pm.expect(jsonResponse.params.errmsg).to.eql(`Please provide valid value for List(createdBy, createdFor, organisation, framework)`);\r", + "});\r", + "\r", + "// Result\r", + "pm.test(\"messages should be null\", () => {\r", + " pm.expect(jsonResponse.result.messages).to.eql(null);\r", + "});\r", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "apikey", + "apikey": [ + { + "key": "key", + "value": "Authorization", + "type": "string" + }, + { + "key": "value", + "value": "", + "type": "string" + }, + { + "key": "in", + "value": "header", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "description": "(Required) The Content Type entity is the media type of the resource.Possible media types can be:-\n - Application/json", + "key": "Content-Type", + "value": "application/json" + }, + { + "description": "(Required) The Registered User ID to execute the API.", + "key": "X-Authenticated-User-token", + "value": "ea laborum" + }, + { + "description": "(Required) All content APIs require authorization for use. Specify the authorization key received from the administrator when placing the request for use of the API.", + "key": "Authorization", + "value": "ea laborum" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {}\n}\n", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/content/v4/copy/{{copy_content}}", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v4", + "copy", + "{{copy_content}}" + ] + }, + "description": "This API is associated with copying a content on the Sunbird Platform .\n - The **_/copy/_**endpoint executes request for copy content, if content is found appropriate.\n - The endpoint for **Copy Content** is `/content/v2/copy`\n - It points to knowledge-mw-service - `/v2/content/copy`\n - It is mandatory to provide values for parameters marked with *.\n - Mandatory fields cannot be null or empty." + }, + "response": [ + { + "name": "OK ! Successful operation.\"Copy\" operation was successfully executed.", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource.Possible media types can be:-\n - Application/json", + "key": "Content-Type", + "value": "ea laborum" + }, + { + "description": "(Required) The Registered User ID to execute the API.", + "key": "X-Authenticated-User-token", + "value": "ea laborum" + }, + { + "description": "(Required) All content APIs require authorization for use. Specify the authorization key received from the administrator when placing the request for use of the API.", + "key": "Authorization", + "value": "ea laborum" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"content\": {\n \"createdBy\": \"user1\",\n \"createdFor\": [\n \"user2\"\n ],\n \"organisation\": [\n \"sunbird\"\n ],\n \"framework\": \"NCF\"\n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/content/v2/copy/:Content_Id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v2", + "copy", + ":Content_Id" + ], + "variable": [ + { + "key": "Content_Id", + "value": "ea laborum", + "description": "(Required) Please append a valid Content Id To the Request URL" + } + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"api.content.copy\",\n \"ver\": \"1.0\",\n \"ts\": \"2020-12-11T23:28:25.343Z\",\n \"params\": {\n \"resmsgid\": \"90e788f0-3c08-11eb-b0a2-8d5c9f561887\",\n \"msgid\": \"90b3f5d0-3c08-11eb-b0a2-8d5c9f561887\",\n \"status\": \"successful\",\n \"err\": null,\n \"errmsg\": null\n },\n \"responseCode\": \"OK\",\n \"result\": {\n \"node_id\": {\n \"do_21316884557433241613378\": \"do_21317051846683852813814\"\n },\n \"versionKey\": \"1607729305036\"\n }\n}" + }, + { + "name": "BAD REQUEST. The \"Copy Content\" operation failed ! The possible reason for failure is that you may have missed providing input for a mandatory parameter.", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource.Possible media types can be:-\n - Application/json", + "key": "Content-Type", + "value": "ea laborum" + }, + { + "description": "(Required) The Registered User ID to execute the API.", + "key": "X-Authenticated-User-token", + "value": "ea laborum" + }, + { + "description": "(Required) All content APIs require authorization for use. Specify the authorization key received from the administrator when placing the request for use of the API.", + "key": "Authorization", + "value": "ea laborum" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"content\": {\n \"createdBy\": \"user1\",\n \"createdFor\": [\n \"user2\"\n ],\n \"organisation\": [\n \"sunbird\"\n ],\n \"framework\": \"NCF\"\n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/content/v2/copy/:Content_Id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v2", + "copy", + ":Content_Id" + ], + "variable": [ + { + "key": "Content_Id", + "value": "ea laborum", + "description": "(Required) Please append a valid Content Id To the Request URL" + } + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"api.content.copy\",\n \"ver\": \"1.0\",\n \"ts\": \"2020-12-11T23:27:31.708Z\",\n \"params\": {\n \"resmsgid\": \"70ef7bc0-3c08-11eb-b0a2-8d5c9f561887\",\n \"msgid\": null,\n \"status\": \"failed\",\n \"err\": \"ERR_INVALID_REQUEST\",\n \"errmsg\": \"Please provide valid value for List(createdBy, createdFor, organisation, framework)\"\n },\n \"responseCode\": \"CLIENT_ERROR\",\n \"result\": {\n \"messages\": null\n }\n}" + }, + { + "name": "RESOURCE NOT FOUND,**Content Send for Copy** operation failed !The possible reason for failure is that you may have provided wrong content id.", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource.Possible media types can be:-\n - Application/json", + "key": "Content-Type", + "value": "ea laborum" + }, + { + "description": "(Required) The Registered User ID to execute the API.", + "key": "X-Authenticated-User-token", + "value": "ea laborum" + }, + { + "description": "(Required) All content APIs require authorization for use. Specify the authorization key received from the administrator when placing the request for use of the API.", + "key": "Authorization", + "value": "ea laborum" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"content\": {\n \"createdBy\": \"user1\",\n \"createdFor\": [\n \"user2\"\n ],\n \"organisation\": [\n \"sunbird\"\n ],\n \"framework\": \"NCF\"\n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/content/v2/copy/:Content_Id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v2", + "copy", + ":Content_Id" + ], + "variable": [ + { + "key": "Content_Id", + "value": "ea laborum", + "description": "(Required) Please append a valid Content Id To the Request URL" + } + ] + } + }, + "status": "Not Found", + "code": 404, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"api.content.copy\",\n \"ver\": \"1.0\",\n \"ts\": \"2020-12-11T23:28:36.863Z\",\n \"params\": {\n \"resmsgid\": \"97c558f0-3c08-11eb-b0a2-8d5c9f561887\",\n \"msgid\": null,\n \"status\": \"failed\",\n \"err\": \"NOT_FOUND\",\n \"errmsg\": \"Error! Node(s) doesn't Exists. | [Invalid Node Id.]: do_213168845574332416133781\"\n },\n \"responseCode\": \"RESOURCE_NOT_FOUND\",\n \"result\": {\n \"messages\": null\n }\n}" + }, + { + "name": "INTERNAL SERVER ERROR ! Looks like something went wrong! These errors are tracked automatically, but if the problem persists feel free to contact us. In the meantime, try refreshing.", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource.Possible media types can be:-\n - Application/json", + "key": "Content-Type", + "value": "ea laborum" + }, + { + "description": "(Required) The Registered User ID to execute the API.", + "key": "X-Authenticated-User-token", + "value": "ea laborum" + }, + { + "description": "(Required) All content APIs require authorization for use. Specify the authorization key received from the administrator when placing the request for use of the API.", + "key": "Authorization", + "value": "ea laborum" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"content\": {\n \"createdBy\": \"user1\",\n \"createdFor\": [\n \"user2\"\n ],\n \"organisation\": [\n \"sunbird\"\n ],\n \"framework\": \"NCF\"\n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/content/v2/copy/:Content_Id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v2", + "copy", + ":Content_Id" + ], + "variable": [ + { + "key": "Content_Id", + "value": "ea laborum", + "description": "(Required) Please append a valid Content Id To the Request URL" + } + ] + } + }, + "status": "Internal Server Error", + "code": 500, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"result\": {},\n \"id\": \"cupidatat reprehenderit dolor\",\n \"ver\": \"minim anim commodo\",\n \"ts\": \"commodo\",\n \"params\": {\n \"resmsgid\": \"pariatur repre\",\n \"msgid\": \"irure\",\n \"err\": \"consequat esse ea\",\n \"status\": \"esse\",\n \"errmsg\": \"aliqua laboris velit\"\n },\n \"responseCode\": \"reprehenderit dolor elit sunt dolore\"\n}" + } + ] + } + ] + } + ] + }, + { + "name": "Import Content", + "item": [ + { + "name": "Pre requisite", + "item": [] + }, + { + "name": "Positive", + "item": [ + { + "name": "Import Valid Content", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json()\r", + "\r", + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "\r", + "pm.test(\"id has string - api.content.import\", function () {\r", + " pm.expect(jsonResponse.id).to.be.equal(\"api.content.import\");\r", + "});\r", + "\r", + "pm.test(\"Version is 4.0 \", function () {\r", + " pm.expect(jsonResponse.ver).to.be.equal(\"4.0\");\r", + "});\r", + "\r", + "pm.test(\"Verify keys and data type of the response result\", () => {\r", + " pm.expect(jsonResponse.params).to.have.all.keys('resmsgid','msgid','status', 'err','errmsg');\r", + " pm.expect(jsonResponse.params.resmsgid).to.be.a(\"string\");\r", + " pm.expect(jsonResponse.params.msgid).to.be.a(\"null\"); \r", + " pm.expect(jsonResponse.params.status).to.be.a(\"string\");\r", + " pm.expect(jsonResponse.params.err).to.be.a(\"null\");\r", + " pm.expect(jsonResponse.params.errmsg).to.be.a(\"null\");\r", + "});\r", + "\r", + "pm.test(\"Status is successful \", function () {\r", + " pm.expect(jsonResponse.params.status).to.be.equal(\"successful\");\r", + "});\r", + "\r", + "pm.test(\"ResponseCode is OK \", function () {\r", + " pm.expect(jsonResponse.responseCode).to.be.equal(\"OK\");\r", + "});\r", + "\r", + "pm.test(\"Verify keys and data type of the response result\", () => {\r", + " pm.expect(jsonResponse.result).to.have.all.keys('processId');\r", + " pm.expect(jsonResponse.result.processId).to.be.a('String');\r", + "});\r", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "X-Authenticated-User-token", + "value": "" + }, + { + "key": "Authorization", + "value": "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJxSVg4R1paOVg5eEQ4OGdENWU4WkZTN1FJTERueWxZdiJ9.iDXhLiLkRaDWTKcsstOhzJSvj4qWX_OuGUbCfHwIFeU" + }, + { + "key": "X-Channel-Id", + "value": "sunbird" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"content\": [\n {\n \"stage\": \"publish\",\n \"metadata\": {\n \"name\": \"content_11\",\n \"description\": \"MP3\",\n \"source\": \"https://drive.google.com/uc?export=download&id=16vH_ks10WSjfLLqqGdUE7ZECr8L_YU5T\",\n \"artifactUrl\": \"https://drive.google.com/uc?export=download&id=16vH_ks10WSjfLLqqGdUE7ZECr8L_YU5T\",\n \"appIcon\": \"https://drive.google.com/uc?export=download&id=1-dFzAeSNmx1ZRn77CEntyQA-VcBE0PKg\",\n \"code\": \"22a82329-f098-a984-05b9-f9ee84ff858d\",\n \"mimeType\": \"audio/mp3\",\n \"primaryCategory\": \"Learning Resource\",\n \"framework\": \"test\"\n }\n }\n ]\n }\n}" + }, + "url": { + "raw": "{{host}}/content/v4/import", + "host": [ + "{{host}}" + ], + "path": [ + "content", + "v4", + "import" + ] + }, + "description": "This API is associated with importing a content on the Sunbird Platform from different environment.\n - The **_/import/_**endpoint executes request for impoting content, if content is found appropriate.\n - The endpoint for **Import Content** is `/content/v2/import`\n - It points to content-service - `/content/v3/import`\n - It is mandatory to provide values for parameters marked with *.\n - Mandatory fields cannot be null or empty." + }, + "response": [ + { + "name": "OK ! Successful operation.\"Import\" operation was successfully executed.", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource.Possible media types can be:-\n - Application/json", + "key": "Content-Type", + "value": "ea laborum" + }, + { + "description": "(Required) All content APIs require authorization for use. Specify the authorization key received from the administrator when placing the request for use of the API.", + "key": "Authorization", + "value": "ea laborum" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"content\": [\n {\n \"source\": \"https://vdn.diksha.gov.in/api/content/v2/read/do_4313124780355543040126730\",\n \"metadata\": {},\n \"collection\": [\n {\n \"identifier\": \"do_3131112587361648641337\",\n \"unitId\": \"do_3131112587369922561425\"\n }\n ]\n }\n ]\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/content/v2/import", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v2", + "import" + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"api.content.import\",\n \"ver\": \"3.0\",\n \"ts\": \"2020-12-17T16:29:11ZZ\",\n \"params\": {\n \"resmsgid\": \"7cce8934-0a2f-46bf-a0ee-be5f49874cae\",\n \"msgid\": null,\n \"err\": null,\n \"status\": \"successful\",\n \"errmsg\": null\n },\n \"responseCode\": \"OK\",\n \"result\": {\n \"processId\": \"80a765c7-2202-4b3f-b473-448b5c2cd20e\"\n }\n}" + }, + { + "name": "BAD REQUEST. The \"Import Content\" operation failed ! The possible reason for failure is that you may have missed providing input for a mandatory parameter.", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource.Possible media types can be:-\n - Application/json", + "key": "Content-Type", + "value": "ea laborum" + }, + { + "description": "(Required) All content APIs require authorization for use. Specify the authorization key received from the administrator when placing the request for use of the API.", + "key": "Authorization", + "value": "ea laborum" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"content\": [\n {\n \"source\": \"https://vdn.diksha.gov.in/api/content/v2/read/do_4313124780355543040126730\",\n \"metadata\": {},\n \"collection\": [\n {\n \"identifier\": \"do_3131112587361648641337\",\n \"unitId\": \"do_3131112587369922561425\"\n }\n ]\n }\n ]\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/content/v2/import", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v2", + "import" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"api.content.import\",\n \"ver\": \"3.0\",\n \"ts\": \"2020-12-17T16:30:16ZZ\",\n \"params\": {\n \"resmsgid\": \"31f88a39-2514-4d86-b424-240166e315be\",\n \"msgid\": null,\n \"err\": \"ERR_REQUIRED_PROPS_VALIDATION\",\n \"status\": \"failed\",\n \"errmsg\": \"Validation Failed! Mandatory Properties Are [name, code, mimeType, primaryCategory, artifactUrl, framework]\"\n },\n \"responseCode\": \"CLIENT_ERROR\",\n \"result\": {\n \"messages\": null\n }\n}" + }, + { + "name": "INTERNAL SERVER ERROR ! Looks like something went wrong! These errors are tracked automatically, but if the problem persists feel free to contact us. In the meantime, try refreshing.", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource.Possible media types can be:-\n - Application/json", + "key": "Content-Type", + "value": "ea laborum" + }, + { + "description": "(Required) All content APIs require authorization for use. Specify the authorization key received from the administrator when placing the request for use of the API.", + "key": "Authorization", + "value": "ea laborum" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"content\": [\n {\n \"source\": \"https://vdn.diksha.gov.in/api/content/v2/read/do_4313124780355543040126730\",\n \"metadata\": {},\n \"collection\": [\n {\n \"identifier\": \"do_3131112587361648641337\",\n \"unitId\": \"do_3131112587369922561425\"\n }\n ]\n }\n ]\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/content/v2/import", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v2", + "import" + ] + } + }, + "status": "Internal Server Error", + "code": 500, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"result\": {},\n \"id\": \"cupidatat reprehenderit dolor\",\n \"ver\": \"minim anim commodo\",\n \"ts\": \"commodo\",\n \"params\": {\n \"resmsgid\": \"pariatur repre\",\n \"msgid\": \"irure\",\n \"err\": \"consequat esse ea\",\n \"status\": \"esse\",\n \"errmsg\": \"aliqua laboris velit\"\n },\n \"responseCode\": \"reprehenderit dolor elit sunt dolore\"\n}" + } + ] + } + ] + }, + { + "name": "Negative", + "item": [ + { + "name": "Import Content with missing mandatory fields", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json()\r", + "\r", + "pm.test(\"Status code is 400\", function () {\r", + " pm.response.to.have.status(400);\r", + "});\r", + "\r", + "pm.test(\"Status code name has string Bad Request\", function () {\r", + " pm.response.to.have.status(\"Bad Request\");\r", + "});\r", + "\r", + "pm.test(\"id has string - api.content.import\", function () {\r", + " pm.expect(jsonResponse.id).to.be.equal(\"api.content.import\");\r", + "});\r", + "\r", + "pm.test(\"Version is 4.0 \", function () {\r", + " pm.expect(jsonResponse.ver).to.be.equal(\"4.0\");\r", + "});\r", + "\r", + "pm.test(\"Params has keys: resmsgid , msgid , err , status , errmsg \", () => {\r", + " pm.expect(jsonResponse.params).to.have.all.keys('resmsgid', 'msgid','err','status','errmsg');\r", + " pm.expect(jsonResponse.params.resmsgid).to.be.a(\"string\");\r", + " pm.expect(jsonResponse.params.msgid).to.be.a('null');\r", + " pm.expect(jsonResponse.params.err).to.be.a('string');\r", + " pm.expect(jsonResponse.params.status).to.be.a(\"string\");\r", + " pm.expect(jsonResponse.params.errmsg).to.be.a('string');\r", + "});\r", + "\r", + "pm.test(\"err is ERR_REQUIRED_PROPS_VALIDATION\", function () {\r", + " pm.expect(jsonResponse.params.err).to.be.equal(\"ERR_REQUIRED_PROPS_VALIDATION\");\r", + "});\r", + "pm.test(`errmsg: Validation Failed! Mandatory Properties Are [\\\"name\\\",\\\"code\\\",\\\"mimeType\\\",\\\"primaryCategory\\\",\\\"artifactUrl\\\",\\\"framework\\\"]`, function () {\r", + " pm.expect(jsonResponse.params.errmsg).to.be.equal(`Validation Failed! Mandatory Properties Are [\\\"name\\\",\\\"code\\\",\\\"mimeType\\\",\\\"primaryCategory\\\",\\\"artifactUrl\\\",\\\"framework\\\"]`);\r", + "});\r", + "\r", + "pm.test(\"Status is failed\", function () {\r", + " pm.expect(jsonResponse.params.status).to.be.equal(\"failed\");\r", + "});\r", + "\r", + "pm.test(\"ResponseCode is CLIENT_ERROR\", function () {\r", + " pm.expect(jsonResponse.responseCode).to.be.equal(\"CLIENT_ERROR\");\r", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "X-Authenticated-User-token", + "value": "" + }, + { + "key": "Authorization", + "value": "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJxSVg4R1paOVg5eEQ4OGdENWU4WkZTN1FJTERueWxZdiJ9.iDXhLiLkRaDWTKcsstOhzJSvj4qWX_OuGUbCfHwIFeU" + }, + { + "key": "X-Channel-Id", + "value": "{{channel_id}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"content\": [\n {\n \n }\n ]\n }\n}" + }, + "url": { + "raw": "{{host}}/content/v4/import", + "host": [ + "{{host}}" + ], + "path": [ + "content", + "v4", + "import" + ] + }, + "description": "This API is associated with importing a content on the Sunbird Platform from different environment.\n - The **_/import/_**endpoint executes request for impoting content, if content is found appropriate.\n - The endpoint for **Import Content** is `/content/v2/import`\n - It points to content-service - `/content/v3/import`\n - It is mandatory to provide values for parameters marked with *.\n - Mandatory fields cannot be null or empty." + }, + "response": [ + { + "name": "OK ! Successful operation.\"Import\" operation was successfully executed.", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource.Possible media types can be:-\n - Application/json", + "key": "Content-Type", + "value": "ea laborum" + }, + { + "description": "(Required) All content APIs require authorization for use. Specify the authorization key received from the administrator when placing the request for use of the API.", + "key": "Authorization", + "value": "ea laborum" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"content\": [\n {\n \"source\": \"https://vdn.diksha.gov.in/api/content/v2/read/do_4313124780355543040126730\",\n \"metadata\": {},\n \"collection\": [\n {\n \"identifier\": \"do_3131112587361648641337\",\n \"unitId\": \"do_3131112587369922561425\"\n }\n ]\n }\n ]\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/content/v2/import", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v2", + "import" + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"api.content.import\",\n \"ver\": \"3.0\",\n \"ts\": \"2020-12-17T16:29:11ZZ\",\n \"params\": {\n \"resmsgid\": \"7cce8934-0a2f-46bf-a0ee-be5f49874cae\",\n \"msgid\": null,\n \"err\": null,\n \"status\": \"successful\",\n \"errmsg\": null\n },\n \"responseCode\": \"OK\",\n \"result\": {\n \"processId\": \"80a765c7-2202-4b3f-b473-448b5c2cd20e\"\n }\n}" + }, + { + "name": "BAD REQUEST. The \"Import Content\" operation failed ! The possible reason for failure is that you may have missed providing input for a mandatory parameter.", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource.Possible media types can be:-\n - Application/json", + "key": "Content-Type", + "value": "ea laborum" + }, + { + "description": "(Required) All content APIs require authorization for use. Specify the authorization key received from the administrator when placing the request for use of the API.", + "key": "Authorization", + "value": "ea laborum" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"content\": [\n {\n \"source\": \"https://vdn.diksha.gov.in/api/content/v2/read/do_4313124780355543040126730\",\n \"metadata\": {},\n \"collection\": [\n {\n \"identifier\": \"do_3131112587361648641337\",\n \"unitId\": \"do_3131112587369922561425\"\n }\n ]\n }\n ]\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/content/v2/import", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v2", + "import" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"api.content.import\",\n \"ver\": \"3.0\",\n \"ts\": \"2020-12-17T16:30:16ZZ\",\n \"params\": {\n \"resmsgid\": \"31f88a39-2514-4d86-b424-240166e315be\",\n \"msgid\": null,\n \"err\": \"ERR_REQUIRED_PROPS_VALIDATION\",\n \"status\": \"failed\",\n \"errmsg\": \"Validation Failed! Mandatory Properties Are [name, code, mimeType, primaryCategory, artifactUrl, framework]\"\n },\n \"responseCode\": \"CLIENT_ERROR\",\n \"result\": {\n \"messages\": null\n }\n}" + }, + { + "name": "INTERNAL SERVER ERROR ! Looks like something went wrong! These errors are tracked automatically, but if the problem persists feel free to contact us. In the meantime, try refreshing.", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource.Possible media types can be:-\n - Application/json", + "key": "Content-Type", + "value": "ea laborum" + }, + { + "description": "(Required) All content APIs require authorization for use. Specify the authorization key received from the administrator when placing the request for use of the API.", + "key": "Authorization", + "value": "ea laborum" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"content\": [\n {\n \"source\": \"https://vdn.diksha.gov.in/api/content/v2/read/do_4313124780355543040126730\",\n \"metadata\": {},\n \"collection\": [\n {\n \"identifier\": \"do_3131112587361648641337\",\n \"unitId\": \"do_3131112587369922561425\"\n }\n ]\n }\n ]\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/content/v2/import", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v2", + "import" + ] + } + }, + "status": "Internal Server Error", + "code": 500, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"result\": {},\n \"id\": \"cupidatat reprehenderit dolor\",\n \"ver\": \"minim anim commodo\",\n \"ts\": \"commodo\",\n \"params\": {\n \"resmsgid\": \"pariatur repre\",\n \"msgid\": \"irure\",\n \"err\": \"consequat esse ea\",\n \"status\": \"esse\",\n \"errmsg\": \"aliqua laboris velit\"\n },\n \"responseCode\": \"reprehenderit dolor elit sunt dolore\"\n}" + } + ] + }, + { + "name": "Import Content with missing Artifact URL", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json()\r", + "\r", + "pm.test(\"Status code is 400\", function () {\r", + " pm.response.to.have.status(400);\r", + "});\r", + "\r", + "pm.test(\"Status code name has string Bad Request\", function () {\r", + " pm.response.to.have.status(\"Bad Request\");\r", + "});\r", + "\r", + "pm.test(\"id has string - api.content.import\", function () {\r", + " pm.expect(jsonResponse.id).to.be.equal(\"api.content.import\");\r", + "});\r", + "\r", + "pm.test(\"Version is 4.0 \", function () {\r", + " pm.expect(jsonResponse.ver).to.be.equal(\"4.0\");\r", + "});\r", + "\r", + "pm.test(\"Params has keys: resmsgid , msgid , err , status , errmsg \", () => {\r", + " pm.expect(jsonResponse.params).to.have.all.keys('resmsgid', 'msgid','err','status','errmsg');\r", + " pm.expect(jsonResponse.params.resmsgid).to.be.a(\"string\");\r", + " pm.expect(jsonResponse.params.msgid).to.be.a('null');\r", + " pm.expect(jsonResponse.params.err).to.be.a('string');\r", + " pm.expect(jsonResponse.params.status).to.be.a(\"string\");\r", + " pm.expect(jsonResponse.params.errmsg).to.be.a('string');\r", + "});\r", + "\r", + "pm.test(\"err is ERR_REQUIRED_PROPS_VALIDATION\", function () {\r", + " pm.expect(jsonResponse.params.err).to.be.equal(\"ERR_REQUIRED_PROPS_VALIDATION\");\r", + "});\r", + "pm.test(`errmsg: Validation Failed! Mandatory Properties Are [\\\"name\\\",\\\"code\\\",\\\"mimeType\\\",\\\"primaryCategory\\\",\\\"artifactUrl\\\",\\\"framework\\\"] | Required Property's Missing For`, function () {\r", + " pm.expect(jsonResponse.params.errmsg).to.be.include(`Validation Failed! Mandatory Properties Are [\\\"name\\\",\\\"code\\\",\\\"mimeType\\\",\\\"primaryCategory\\\",\\\"artifactUrl\\\",\\\"framework\\\"] | Required Property's Missing For`);\r", + "});\r", + "\r", + "pm.test(\"Status is failed\", function () {\r", + " pm.expect(jsonResponse.params.status).to.be.equal(\"failed\");\r", + "});\r", + "\r", + "pm.test(\"ResponseCode is CLIENT_ERROR\", function () {\r", + " pm.expect(jsonResponse.responseCode).to.be.equal(\"CLIENT_ERROR\");\r", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "X-Authenticated-User-token", + "value": "" + }, + { + "key": "Authorization", + "value": "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJxSVg4R1paOVg5eEQ4OGdENWU4WkZTN1FJTERueWxZdiJ9.iDXhLiLkRaDWTKcsstOhzJSvj4qWX_OuGUbCfHwIFeU" + }, + { + "key": "X-Channel-Id", + "value": "{{channel_id}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"content\": [\n {\n \"metadata\": {\n \"name\": \"content_11\",\n \"code\": \"22a82329-f098-a984-05b9-f9ee84ff858d\",\n \"mimeType\": \"audio/mp3\",\n \"primaryCategory\": \"Learning Resource\",\n \"framework\": \"test\"\n }\n }\n ]\n }\n}" + }, + "url": { + "raw": "{{host}}/content/v4/import", + "host": [ + "{{host}}" + ], + "path": [ + "content", + "v4", + "import" + ] + }, + "description": "This API is associated with importing a content on the Sunbird Platform from different environment.\n - The **_/import/_**endpoint executes request for impoting content, if content is found appropriate.\n - The endpoint for **Import Content** is `/content/v2/import`\n - It points to content-service - `/content/v3/import`\n - It is mandatory to provide values for parameters marked with *.\n - Mandatory fields cannot be null or empty." + }, + "response": [ + { + "name": "OK ! Successful operation.\"Import\" operation was successfully executed.", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource.Possible media types can be:-\n - Application/json", + "key": "Content-Type", + "value": "ea laborum" + }, + { + "description": "(Required) All content APIs require authorization for use. Specify the authorization key received from the administrator when placing the request for use of the API.", + "key": "Authorization", + "value": "ea laborum" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"content\": [\n {\n \"source\": \"https://vdn.diksha.gov.in/api/content/v2/read/do_4313124780355543040126730\",\n \"metadata\": {},\n \"collection\": [\n {\n \"identifier\": \"do_3131112587361648641337\",\n \"unitId\": \"do_3131112587369922561425\"\n }\n ]\n }\n ]\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/content/v2/import", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v2", + "import" + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"api.content.import\",\n \"ver\": \"3.0\",\n \"ts\": \"2020-12-17T16:29:11ZZ\",\n \"params\": {\n \"resmsgid\": \"7cce8934-0a2f-46bf-a0ee-be5f49874cae\",\n \"msgid\": null,\n \"err\": null,\n \"status\": \"successful\",\n \"errmsg\": null\n },\n \"responseCode\": \"OK\",\n \"result\": {\n \"processId\": \"80a765c7-2202-4b3f-b473-448b5c2cd20e\"\n }\n}" + }, + { + "name": "BAD REQUEST. The \"Import Content\" operation failed ! The possible reason for failure is that you may have missed providing input for a mandatory parameter.", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource.Possible media types can be:-\n - Application/json", + "key": "Content-Type", + "value": "ea laborum" + }, + { + "description": "(Required) All content APIs require authorization for use. Specify the authorization key received from the administrator when placing the request for use of the API.", + "key": "Authorization", + "value": "ea laborum" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"content\": [\n {\n \"source\": \"https://vdn.diksha.gov.in/api/content/v2/read/do_4313124780355543040126730\",\n \"metadata\": {},\n \"collection\": [\n {\n \"identifier\": \"do_3131112587361648641337\",\n \"unitId\": \"do_3131112587369922561425\"\n }\n ]\n }\n ]\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/content/v2/import", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v2", + "import" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"api.content.import\",\n \"ver\": \"3.0\",\n \"ts\": \"2020-12-17T16:30:16ZZ\",\n \"params\": {\n \"resmsgid\": \"31f88a39-2514-4d86-b424-240166e315be\",\n \"msgid\": null,\n \"err\": \"ERR_REQUIRED_PROPS_VALIDATION\",\n \"status\": \"failed\",\n \"errmsg\": \"Validation Failed! Mandatory Properties Are [name, code, mimeType, primaryCategory, artifactUrl, framework]\"\n },\n \"responseCode\": \"CLIENT_ERROR\",\n \"result\": {\n \"messages\": null\n }\n}" + }, + { + "name": "INTERNAL SERVER ERROR ! Looks like something went wrong! These errors are tracked automatically, but if the problem persists feel free to contact us. In the meantime, try refreshing.", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource.Possible media types can be:-\n - Application/json", + "key": "Content-Type", + "value": "ea laborum" + }, + { + "description": "(Required) All content APIs require authorization for use. Specify the authorization key received from the administrator when placing the request for use of the API.", + "key": "Authorization", + "value": "ea laborum" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"content\": [\n {\n \"source\": \"https://vdn.diksha.gov.in/api/content/v2/read/do_4313124780355543040126730\",\n \"metadata\": {},\n \"collection\": [\n {\n \"identifier\": \"do_3131112587361648641337\",\n \"unitId\": \"do_3131112587369922561425\"\n }\n ]\n }\n ]\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/content/v2/import", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v2", + "import" + ] + } + }, + "status": "Internal Server Error", + "code": 500, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"result\": {},\n \"id\": \"cupidatat reprehenderit dolor\",\n \"ver\": \"minim anim commodo\",\n \"ts\": \"commodo\",\n \"params\": {\n \"resmsgid\": \"pariatur repre\",\n \"msgid\": \"irure\",\n \"err\": \"consequat esse ea\",\n \"status\": \"esse\",\n \"errmsg\": \"aliqua laboris velit\"\n },\n \"responseCode\": \"reprehenderit dolor elit sunt dolore\"\n}" + } + ] + }, + { + "name": "Import Content with missing Artifact URL Copy", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json()\r", + "\r", + "pm.test(\"Status code is 400\", function () {\r", + " pm.response.to.have.status(400);\r", + "});\r", + "\r", + "pm.test(\"Status code name has string Bad Request\", function () {\r", + " pm.response.to.have.status(\"Bad Request\");\r", + "});\r", + "\r", + "pm.test(\"id has string - api.content.import\", function () {\r", + " pm.expect(jsonResponse.id).to.be.equal(\"api.content.import\");\r", + "});\r", + "\r", + "pm.test(\"Version is 4.0 \", function () {\r", + " pm.expect(jsonResponse.ver).to.be.equal(\"4.0\");\r", + "});\r", + "\r", + "pm.test(\"Params has keys: resmsgid , msgid , err , status , errmsg \", () => {\r", + " pm.expect(jsonResponse.params).to.have.all.keys('resmsgid', 'msgid','err','status','errmsg');\r", + " pm.expect(jsonResponse.params.resmsgid).to.be.a(\"string\");\r", + " pm.expect(jsonResponse.params.msgid).to.be.a('null');\r", + " pm.expect(jsonResponse.params.err).to.be.a('string');\r", + " pm.expect(jsonResponse.params.status).to.be.a(\"string\");\r", + " pm.expect(jsonResponse.params.errmsg).to.be.a('string');\r", + "});\r", + "\r", + "pm.test(\"err is ERR_INVALID_IMPORT_REQUEST\", function () {\r", + " pm.expect(jsonResponse.params.err).to.be.equal(\"ERR_INVALID_IMPORT_REQUEST\");\r", + "});\r", + "pm.test(`errmsg: Invalid Request! Please Provide Valid Request.`, function () {\r", + " pm.expect(jsonResponse.params.errmsg).to.be.include(`Invalid Request! Please Provide Valid Request.`);\r", + "});\r", + "\r", + "pm.test(\"Status is failed\", function () {\r", + " pm.expect(jsonResponse.params.status).to.be.equal(\"failed\");\r", + "});\r", + "\r", + "pm.test(\"ResponseCode is CLIENT_ERROR\", function () {\r", + " pm.expect(jsonResponse.responseCode).to.be.equal(\"CLIENT_ERROR\");\r", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "X-Authenticated-User-token", + "value": "" + }, + { + "key": "Authorization", + "value": "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJxSVg4R1paOVg5eEQ4OGdENWU4WkZTN1FJTERueWxZdiJ9.iDXhLiLkRaDWTKcsstOhzJSvj4qWX_OuGUbCfHwIFeU" + }, + { + "key": "X-Channel-Id", + "value": "{{channel_id}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"content\": [\n \n ]\n }\n}" + }, + "url": { + "raw": "{{host}}/content/v4/import", + "host": [ + "{{host}}" + ], + "path": [ + "content", + "v4", + "import" + ] + }, + "description": "This API is associated with importing a content on the Sunbird Platform from different environment.\n - The **_/import/_**endpoint executes request for impoting content, if content is found appropriate.\n - The endpoint for **Import Content** is `/content/v2/import`\n - It points to content-service - `/content/v3/import`\n - It is mandatory to provide values for parameters marked with *.\n - Mandatory fields cannot be null or empty." + }, + "response": [ + { + "name": "OK ! Successful operation.\"Import\" operation was successfully executed.", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource.Possible media types can be:-\n - Application/json", + "key": "Content-Type", + "value": "ea laborum" + }, + { + "description": "(Required) All content APIs require authorization for use. Specify the authorization key received from the administrator when placing the request for use of the API.", + "key": "Authorization", + "value": "ea laborum" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"content\": [\n {\n \"source\": \"https://vdn.diksha.gov.in/api/content/v2/read/do_4313124780355543040126730\",\n \"metadata\": {},\n \"collection\": [\n {\n \"identifier\": \"do_3131112587361648641337\",\n \"unitId\": \"do_3131112587369922561425\"\n }\n ]\n }\n ]\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/content/v2/import", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v2", + "import" + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"api.content.import\",\n \"ver\": \"3.0\",\n \"ts\": \"2020-12-17T16:29:11ZZ\",\n \"params\": {\n \"resmsgid\": \"7cce8934-0a2f-46bf-a0ee-be5f49874cae\",\n \"msgid\": null,\n \"err\": null,\n \"status\": \"successful\",\n \"errmsg\": null\n },\n \"responseCode\": \"OK\",\n \"result\": {\n \"processId\": \"80a765c7-2202-4b3f-b473-448b5c2cd20e\"\n }\n}" + }, + { + "name": "BAD REQUEST. The \"Import Content\" operation failed ! The possible reason for failure is that you may have missed providing input for a mandatory parameter.", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource.Possible media types can be:-\n - Application/json", + "key": "Content-Type", + "value": "ea laborum" + }, + { + "description": "(Required) All content APIs require authorization for use. Specify the authorization key received from the administrator when placing the request for use of the API.", + "key": "Authorization", + "value": "ea laborum" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"content\": [\n {\n \"source\": \"https://vdn.diksha.gov.in/api/content/v2/read/do_4313124780355543040126730\",\n \"metadata\": {},\n \"collection\": [\n {\n \"identifier\": \"do_3131112587361648641337\",\n \"unitId\": \"do_3131112587369922561425\"\n }\n ]\n }\n ]\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/content/v2/import", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v2", + "import" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"api.content.import\",\n \"ver\": \"3.0\",\n \"ts\": \"2020-12-17T16:30:16ZZ\",\n \"params\": {\n \"resmsgid\": \"31f88a39-2514-4d86-b424-240166e315be\",\n \"msgid\": null,\n \"err\": \"ERR_REQUIRED_PROPS_VALIDATION\",\n \"status\": \"failed\",\n \"errmsg\": \"Validation Failed! Mandatory Properties Are [name, code, mimeType, primaryCategory, artifactUrl, framework]\"\n },\n \"responseCode\": \"CLIENT_ERROR\",\n \"result\": {\n \"messages\": null\n }\n}" + }, + { + "name": "INTERNAL SERVER ERROR ! Looks like something went wrong! These errors are tracked automatically, but if the problem persists feel free to contact us. In the meantime, try refreshing.", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource.Possible media types can be:-\n - Application/json", + "key": "Content-Type", + "value": "ea laborum" + }, + { + "description": "(Required) All content APIs require authorization for use. Specify the authorization key received from the administrator when placing the request for use of the API.", + "key": "Authorization", + "value": "ea laborum" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"content\": [\n {\n \"source\": \"https://vdn.diksha.gov.in/api/content/v2/read/do_4313124780355543040126730\",\n \"metadata\": {},\n \"collection\": [\n {\n \"identifier\": \"do_3131112587361648641337\",\n \"unitId\": \"do_3131112587369922561425\"\n }\n ]\n }\n ]\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/content/v2/import", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v2", + "import" + ] + } + }, + "status": "Internal Server Error", + "code": 500, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"result\": {},\n \"id\": \"cupidatat reprehenderit dolor\",\n \"ver\": \"minim anim commodo\",\n \"ts\": \"commodo\",\n \"params\": {\n \"resmsgid\": \"pariatur repre\",\n \"msgid\": \"irure\",\n \"err\": \"consequat esse ea\",\n \"status\": \"esse\",\n \"errmsg\": \"aliqua laboris velit\"\n },\n \"responseCode\": \"reprehenderit dolor elit sunt dolore\"\n}" + } + ] + } + ] + } + ] + } + ] + }, + { + "name": "v1", + "item": [ + { + "name": "lock", + "item": [ + { + "name": "Lock list", + "item": [ + { + "name": "Positive", + "item": [ + { + "name": "lock list", + "request": { + "method": "POST", + "header": [ + { + "description": "(Required) The Content Type entity is the media type of the resource", + "key": "Content-Type", + "value": "application/json" + }, + { + "description": "(Required) To make use of the API, you require authorization. Raise a request to the administrator for the use of the API. You will receive the authorization key. Specify the key received, here.", + "key": "Authorization", + "value": "ipsum voluptate qui" + }, + { + "key": "Accept", + "value": "application/json; charset=utf-8" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"filters\": {\n \"resourceId\": [\n \n ]\n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/lock/v4/list", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "lock", + "v4", + "list" + ] + }, + "description": "This API searches for a list of Locked resource by a user or system or service.\n - The **_lock/v1/list_** endpoint searches the list of Locked resource.\n - All fields marked with an * are mandatory\n - Required fields cannot be null or empty\n - Backend Route: http://knowledge-mw-service:5000/v1/lock/list" + }, + "response": [ + { + "name": "This represents the list response success", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "(Required) The Content Type entity is the media type of the resource", + "key": "Content-Type", + "value": "application/json" + }, + { + "description": "(Required) To make use of the API, you require authorization. Raise a request to the administrator for the use of the API. You will receive the authorization key. Specify the key received, here.", + "key": "Authorization", + "value": "ipsum voluptate qui" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"filters\": {\n \"resourceId\": [\n \"do_11319479631000371211\",\n \"do_11319851826161254418\",\n \"do_113107812356022272164\",\n \"do_1131983093687828481353\",\n \"do_113197939102253056140\",\n \"do_113197917149233152139\",\n \"do_113197913444737024138\",\n \"do_113197844509425664130\",\n \"do_113197903995772928137\"\n ]\n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/lock/v1/list", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "lock", + "v1", + "list" + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + } + ], + "cookie": [], + "body": "{\n \"id\": \"api.lock.list\",\n \"ver\": 1,\n \"ts\": \"2021-01-21T09:44:03.248Z\",\n \"params\": {\n \"resmsgid\": \"32228b00-5bcd-11eb-9b0c-abcfbdf41bc3\",\n \"msgid\": \"3247615a-0095-9236-9b6b-357d7b130b6e\",\n \"status\": \"successful\",\n \"err\": null,\n \"errmsg\": null\n },\n \"responseCode\": \"OK\",\n \"result\": {\n \"count\": 1,\n \"data\": [\n {\n \"lockId\": \"1d767439-a517-4433-bf46-fb0cca148d31\",\n \"resourceId\": \"do_11319479631000371211\",\n \"resourceType\": \"Content\",\n \"resourceInfo\": \"{\\\"contentType\\\":\\\"TextBook\\\",\\\"framework\\\":\\\"ekstep_ncert_k-12\\\",\\\"identifier\\\":\\\"do_11319479631000371211\\\",\\\"mimeType\\\":\\\"application/vnd.ekstep.content-collection\\\"}\",\n \"createdBy\": \"5a587cc1-e018-4859-a0a8-e842650b9d64\",\n \"creatorInfo\": \"{\\\"name\\\":\\\"N11\\\",\\\"id\\\":\\\"5a587cc1-e018-4859-a0a8-e842650b9d64\\\"}\",\n \"createdOn\": \"2021-01-21T09:22:12.577Z\",\n \"deviceId\": \"ad8ed16beb09e7c91534c2af80a1a41e\",\n \"expiresAt\": \"2021-01-21T10:26:27.591Z\"\n }\n ]\n }\n}" + }, + { + "name": "This represents the Internal Server Error", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "(Required) The Content Type entity is the media type of the resource", + "key": "Content-Type", + "value": "application/json" + }, + { + "description": "(Required) To make use of the API, you require authorization. Raise a request to the administrator for the use of the API. You will receive the authorization key. Specify the key received, here.", + "key": "Authorization", + "value": "ipsum voluptate qui" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"filters\": {\n \"resourceId\": [\n \"do_11319479631000371211\",\n \"do_11319851826161254418\",\n \"do_113107812356022272164\",\n \"do_1131983093687828481353\",\n \"do_113197939102253056140\",\n \"do_113197917149233152139\",\n \"do_113197913444737024138\",\n \"do_113197844509425664130\",\n \"do_113197903995772928137\"\n ]\n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/lock/v1/list", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "lock", + "v1", + "list" + ] + } + }, + "status": "Internal Server Error", + "code": 500, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"api.lock.list\",\n \"ver\": 1,\n \"ts\": \"2021-01-21T12:59:12.456Z\",\n \"params\": {\n \"resmsgid\": \"755de480-5be8-11eb-9b0c-abcfbdf41bc3\",\n \"msgid\": null,\n \"status\": \"failed\",\n \"err\": \"ERR_LISTING_LOCK_FAILED\",\n \"errmsg\": \"Listing lock failed\"\n },\n \"responseCode\": \"SERVER_ERROR\",\n \"result\": {}\n}" + } + ] + } + ] + }, + { + "name": "Negative", + "item": [] + } + ] + }, + { + "name": "Lock retire", + "item": [ + { + "name": "Positive", + "item": [ + { + "name": "Lock retire", + "request": { + "method": "DELETE", + "header": [ + { + "description": "(Required) The Content Type entity is the media type of the resource", + "key": "Content-Type", + "value": "application/json" + }, + { + "description": "(Required) To make use of the API, you require authorization. Raise a request to the administrator for the use of the API. You will receive the authorization key. Specify the key received, here.", + "key": "Authorization", + "value": "ipsum voluptate qui" + }, + { + "key": "Accept", + "value": "application/json; charset=utf-8" + } + ], + "url": { + "raw": "{{baseUrl}}/lock/v1/retire", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "lock", + "v1", + "retire" + ] + }, + "description": "This API used to retire the Locked resource by a user or system or service.\n - The **_lock/v1/retire_** endpoint used to retire the Locked resource by a user or system or service.\n - All fields marked with an * are mandatory\n - Required fields cannot be null or empty\n - Backend Route: http://knowledge-mw-service:5000/v1/lock/retire" + }, + "response": [ + { + "name": "This represents the retire success response", + "originalRequest": { + "method": "DELETE", + "header": [ + { + "description": "(Required) The Content Type entity is the media type of the resource", + "key": "Content-Type", + "value": "application/json" + }, + { + "description": "(Required) To make use of the API, you require authorization. Raise a request to the administrator for the use of the API. You will receive the authorization key. Specify the key received, here.", + "key": "Authorization", + "value": "ipsum voluptate qui" + } + ], + "url": { + "raw": "{{baseUrl}}/lock/v1/retire", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "lock", + "v1", + "retire" + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + } + ], + "cookie": [], + "body": "{\n \"id\": \"api.lock.retire\",\n \"ver\": 1,\n \"ts\": \"2021-01-21T11:07:24.864Z\",\n \"params\": {\n \"resmsgid\": \"d7549400-5bd8-11eb-9b0c-abcfbdf41bc3\",\n \"msgid\": \"eb729276-769e-8db2-477a-91548152908b\",\n \"status\": \"successful\",\n \"err\": null,\n \"errmsg\": null\n },\n \"responseCode\": \"OK\",\n \"result\": {}\n}" + }, + { + "name": "This represents the retire Bad Request", + "originalRequest": { + "method": "DELETE", + "header": [ + { + "description": "(Required) The Content Type entity is the media type of the resource", + "key": "Content-Type", + "value": "application/json" + }, + { + "description": "(Required) To make use of the API, you require authorization. Raise a request to the administrator for the use of the API. You will receive the authorization key. Specify the key received, here.", + "key": "Authorization", + "value": "ipsum voluptate qui" + } + ], + "url": { + "raw": "{{baseUrl}}/lock/v1/retire", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "lock", + "v1", + "retire" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"api.lock.retire\",\n \"ver\": 1,\n \"ts\": \"2021-01-21T11:08:43.618Z\",\n \"params\": {\n \"resmsgid\": \"0645ca40-5bd9-11eb-9b0c-abcfbdf41bc3\",\n \"msgid\": null,\n \"status\": \"failed\",\n \"err\": \"ERR_LOCK_RETIRING_FAILED\",\n \"errmsg\": \"Resource is not locked\"\n },\n \"responseCode\": \"CLIENT_ERROR\",\n \"result\": {}\n}" + } + ] + } + ] + }, + { + "name": "Negative", + "item": [] + } + ] + }, + { + "name": "Lock Create", + "item": [ + { + "name": "Positive", + "item": [ + { + "name": "Lock create", + "request": { + "method": "POST", + "header": [ + { + "description": "(Required) The Content Type entity is the media type of the resource", + "key": "Content-Type", + "value": "application/json" + }, + { + "description": "(Required) To make use of the API, you require authorization. Raise a request to the administrator for the use of the API. You will receive the authorization key. Specify the key received, here.", + "key": "Authorization", + "value": "ipsum voluptate qui" + }, + { + "key": "Accept", + "value": "application/json; charset=utf-8" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"resourceId\": \"do_11319479631000371211\",\n \"resourceType\": \"Content\",\n \"resourceInfo\": \"{\\\"contentType\\\":\\\"TextBook\\\",\\\"framework\\\":\\\"ekstep_ncert_k-12\\\",\\\"identifier\\\":\\\"do_11319479631000371211\\\",\\\"mimeType\\\":\\\"application/vnd.ekstep.content-collection\\\"}\",\n \"creatorInfo\": \"{\\\"name\\\":\\\"N11\\\",\\\"id\\\":\\\"5a587cc1-e018-4859-a0a8-e842650b9d64\\\"}\",\n \"createdBy\": \"5a587cc1-e018-4859-a0a8-e842650b9d64\",\n \"isRootOrgAdmin\": true\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/lock/v1/create", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "lock", + "v1", + "create" + ] + }, + "description": "This API used to create the Lock resource by a user or system or service.\n - The **_lock/v1/create_** endpoint search the bulk job approve of the content.\n - All fields marked with an * are mandatory\n - Required fields cannot be null or empty\n - Backend Route: http://knowledge-mw-service:5000/v1/lock/create" + }, + "response": [ + { + "name": "This represents the create response body 200", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "(Required) The Content Type entity is the media type of the resource", + "key": "Content-Type", + "value": "application/json" + }, + { + "description": "(Required) To make use of the API, you require authorization. Raise a request to the administrator for the use of the API. You will receive the authorization key. Specify the key received, here.", + "key": "Authorization", + "value": "ipsum voluptate qui" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"resourceId\": \"do_11319479631000371211\",\n \"resourceType\": \"Content\",\n \"resourceInfo\": \"{\\\"contentType\\\":\\\"TextBook\\\",\\\"framework\\\":\\\"ekstep_ncert_k-12\\\",\\\"identifier\\\":\\\"do_11319479631000371211\\\",\\\"mimeType\\\":\\\"application/vnd.ekstep.content-collection\\\"}\",\n \"creatorInfo\": \"{\\\"name\\\":\\\"N11\\\",\\\"id\\\":\\\"5a587cc1-e018-4859-a0a8-e842650b9d64\\\"}\",\n \"createdBy\": \"5a587cc1-e018-4859-a0a8-e842650b9d64\",\n \"isRootOrgAdmin\": true\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/lock/v1/create", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "lock", + "v1", + "create" + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + } + ], + "cookie": [], + "body": "{\n \"id\": \"api.lock.create\",\n \"ver\": 1,\n \"ts\": \"2021-01-21T11:14:46.643Z\",\n \"params\": {\n \"resmsgid\": \"dea6b430-5bd9-11eb-9b0c-abcfbdf41bc3\",\n \"msgid\": \"33e7b5d4-7662-bab6-1c06-72e71b8b8221\",\n \"status\": \"successful\",\n \"err\": null,\n \"errmsg\": null\n },\n \"responseCode\": \"OK\",\n \"result\": {\n \"lockKey\": \"bad55f24-8081-4d03-baab-364296062b47\",\n \"expiresAt\": \"2021-01-21T12:14:46.594Z\",\n \"expiresIn\": 60\n }\n}" + }, + { + "name": "This represents the create response Bad Request", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "(Required) The Content Type entity is the media type of the resource", + "key": "Content-Type", + "value": "application/json" + }, + { + "description": "(Required) To make use of the API, you require authorization. Raise a request to the administrator for the use of the API. You will receive the authorization key. Specify the key received, here.", + "key": "Authorization", + "value": "ipsum voluptate qui" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"resourceId\": \"do_11319479631000371211\",\n \"resourceType\": \"Content\",\n \"resourceInfo\": \"{\\\"contentType\\\":\\\"TextBook\\\",\\\"framework\\\":\\\"ekstep_ncert_k-12\\\",\\\"identifier\\\":\\\"do_11319479631000371211\\\",\\\"mimeType\\\":\\\"application/vnd.ekstep.content-collection\\\"}\",\n \"creatorInfo\": \"{\\\"name\\\":\\\"N11\\\",\\\"id\\\":\\\"5a587cc1-e018-4859-a0a8-e842650b9d64\\\"}\",\n \"createdBy\": \"5a587cc1-e018-4859-a0a8-e842650b9d64\",\n \"isRootOrgAdmin\": true\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/lock/v1/create", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "lock", + "v1", + "create" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"api.lock.create\",\n \"ver\": 1,\n \"ts\": \"2021-01-21T13:09:44.935Z\",\n \"params\": {\n \"resmsgid\": \"ee5a8770-5be9-11eb-9b0c-abcfbdf41bc3\",\n \"msgid\": null,\n \"status\": \"failed\",\n \"err\": \"ERR_LOCK_CREATION_FIELDS_MISSING\",\n \"errmsg\": \"\\\"resourceInfo\\\" is required\"\n },\n \"responseCode\": \"CLIENT_ERROR\",\n \"result\": {}\n}" + } + ] + } + ] + }, + { + "name": "Negative", + "item": [] + } + ] + }, + { + "name": "Lock Refresh", + "item": [ + { + "name": "Positive", + "item": [ + { + "name": "Lock Refresh", + "request": { + "method": "PATCH", + "header": [ + { + "description": "(Required) The Content Type entity is the media type of the resource", + "key": "Content-Type", + "value": "application/json" + }, + { + "description": "(Required) To make use of the API, you require authorization. Raise a request to the administrator for the use of the API. You will receive the authorization key. Specify the key received, here.", + "key": "Authorization", + "value": "ipsum voluptate qui" + }, + { + "key": "Accept", + "value": "application/json; charset=utf-8" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"resourceId\": \"do_11316513466772684811649\",\n \"resourceType\": \"Content\",\n \"lockId\": \"0e6b1631-93e6-4726-9dcf-0debdba37aa1\"\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/lock/v1/refresh", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "lock", + "v1", + "refresh" + ] + }, + "description": "This API used to refresh the Locked resource by a user or system or service.\n - The **_lock/v1/refresh_** endpoint refresh the Locked resource by a user or system or service.\n - All fields marked with an * are mandatory\n - Required fields cannot be null or empty\n - Backend Route: http://knowledge-mw-service:5000/v1/lock/refresh" + }, + "response": [ + { + "name": "This represents the refresh response 200", + "originalRequest": { + "method": "PATCH", + "header": [ + { + "description": "(Required) The Content Type entity is the media type of the resource", + "key": "Content-Type", + "value": "application/json" + }, + { + "description": "(Required) To make use of the API, you require authorization. Raise a request to the administrator for the use of the API. You will receive the authorization key. Specify the key received, here.", + "key": "Authorization", + "value": "ipsum voluptate qui" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"resourceId\": \"do_11316513466772684811649\",\n \"resourceType\": \"Content\",\n \"lockId\": \"0e6b1631-93e6-4726-9dcf-0debdba37aa1\"\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/lock/v1/refresh", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "lock", + "v1", + "refresh" + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + } + ], + "cookie": [], + "body": "{\n \"id\": \"api.v1.refresh\",\n \"ver\": 1,\n \"ts\": \"2021-01-21T11:24:31.981Z\",\n \"params\": {\n \"resmsgid\": \"3b8a31d0-5bdb-11eb-9b0c-abcfbdf41bc3\",\n \"msgid\": \"3a33a280-5bdb-11eb-9b0c-abcfbdf41bc3\",\n \"status\": \"successful\",\n \"err\": null,\n \"errmsg\": null\n },\n \"responseCode\": \"OK\",\n \"result\": {\n \"lockKey\": \"0e6b1631-93e6-4726-9dcf-0debdba37aa1\",\n \"expiresAt\": \"2021-01-21T12:24:29.738Z\",\n \"expiresIn\": 60\n }\n}" + }, + { + "name": "This represents the refresh response for Bad Request", + "originalRequest": { + "method": "PATCH", + "header": [ + { + "description": "(Required) The Content Type entity is the media type of the resource", + "key": "Content-Type", + "value": "application/json" + }, + { + "description": "(Required) To make use of the API, you require authorization. Raise a request to the administrator for the use of the API. You will receive the authorization key. Specify the key received, here.", + "key": "Authorization", + "value": "ipsum voluptate qui" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"resourceId\": \"do_11316513466772684811649\",\n \"resourceType\": \"Content\",\n \"lockId\": \"0e6b1631-93e6-4726-9dcf-0debdba37aa1\"\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/lock/v1/refresh", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "lock", + "v1", + "refresh" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"api.v1.refresh\",\n \"ver\": 1,\n \"ts\": \"2021-01-21T11:27:46.193Z\",\n \"params\": {\n \"resmsgid\": \"af4c9810-5bdb-11eb-9b0c-abcfbdf41bc3\",\n \"msgid\": null,\n \"status\": \"failed\",\n \"err\": \"ERR_LOCK_REFRESHING_FIELDS_MISSING\",\n \"errmsg\": \"\\\"resourceId\\\" is required\"\n },\n \"responseCode\": \"CLIENT_ERROR\",\n \"result\": {}\n}" + } + ] + } + ] + }, + { + "name": "Negative", + "item": [] + } + ] + } + ], + "description": "This services explains the design of lock service and types of locks that are possible with mechanisms to lock a resource and unlock it with different possibilities.\n\nContact Support: \nEmail: [info@sunbird.org](https://desktop.postman.com/?desktopVersion=10.6.0&userId=1419050&teamId=304931)" + }, + { + "name": "Search Content", + "item": [ + { + "name": "Positive", + "item": [ + { + "name": "Search Content", + "request": { + "auth": { + "type": "apikey", + "apikey": [ + { + "key": "key", + "value": "Authorization", + "type": "string" + }, + { + "key": "value", + "value": "", + "type": "string" + }, + { + "key": "in", + "value": "header", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "description": "The Content Type entity is the media type of the resource.Possible media types can be:-\n - Application/json", + "key": "Content-Type", + "value": "ea laborum" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"filters\": {\n \"objectType\": \"Content\",\n \"status\": []\n },\n \"limit\": 1\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/content/v1/search", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v1", + "search" + ] + }, + "description": "This API is associated with Searching Object created as part of sourcing object creation on the Sunbird Platform.\n - The endpoint for **Content Search** is `/content/v1/search`\n - It points to knowledge-mw-service - `/v1/search`\n - It is mandatory to provide values for parameters marked with *.\n - Mandatory fields cannot be null or empty." + }, + "response": [ + { + "name": "SUCCESS. The **Content Search** operation was successful!", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "The Content Type entity is the media type of the resource.Possible media types can be:-\n - Application/json", + "key": "Content-Type", + "value": "ea laborum" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"filters\": {\n \"objectType\": \"Content\",\n \"status\": []\n },\n \"limit\": 1\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/content/v1/search", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v1", + "search" + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"api.content.search\",\n \"ver\": \"1.0\",\n \"ts\": \"2020-12-22T06:24:45.025Z\",\n \"params\": {\n \"resmsgid\": \"62160510-441e-11eb-9b0c-abcfbdf41bc3\",\n \"msgid\": \"620ae180-441e-11eb-9b0c-abcfbdf41bc3\",\n \"status\": \"successful\",\n \"err\": null,\n \"errmsg\": null\n },\n \"responseCode\": \"OK\",\n \"result\": {\n \"count\": 480465,\n \"content\": [\n {\n \"code\": \"org.ekstep.jun16.story.test05\",\n \"subject\": [\n \"literacy\"\n ],\n \"flags\": [\n \"Test case\"\n ],\n \"channel\": \"in.ekstep\",\n \"downloadUrl\": \"https://ekstep-public-dev.s3-ap-south-1.amazonaws.com/ecar_files/org.ekstep.jun16.story.test05/vrgaatiil-upkrmclassroom-activities_1498725323304_org.ekstep.jun16.story.test05_1.0.ecar\",\n \"description\": \"शेर का साथी हाथी\",\n \"lastFlaggedOn\": \"2017-12-27T13:30:48.942+0000\",\n \"language\": [\n \"English\"\n ],\n \"variants\": {\n \"spine\": {\n \"ecarUrl\": \"https://ekstep-public-dev.s3-ap-south-1.amazonaws.com/ecar_files/org.ekstep.jun16.story.test05/vrgaatiil-upkrmclassroom-activities_1498725324677_org.ekstep.jun16.story.test05_1.0_spine.ecar\",\n \"size\": 851\n }\n },\n \"mimeType\": \"application/vnd.ekstep.ecml-archive\",\n \"flaggedBy\": [\n \"Test case\"\n ],\n \"idealScreenSize\": \"normal\",\n \"createdOn\": \"2017-06-29T07:44:15.875+0000\",\n \"objectType\": \"Content\",\n \"collections\": [\n \"do_11228062262625075214\"\n ],\n \"appId\": \"ekstep_portal\",\n \"contentDisposition\": \"inline\",\n \"contentEncoding\": \"gzip\",\n \"artifactUrl\": \"https://ekstep-public-dev.s3-ap-south-1.amazonaws.com/content/org.ekstep.jun16.story.test05/artifact/1485166711340_do_30102464_1498725273215.zip\",\n \"lastUpdatedOn\": \"2017-12-27T13:30:48.968+0000\",\n \"SYS_INTERNAL_LAST_UPDATED_ON\": \"2018-01-09T18:41:32.368+0000\",\n \"primaryCategory\": \"Story\",\n \"owner\": \"EkStep\",\n \"lastUpdatedBy\": \"Test case\",\n \"identifier\": \"org.ekstep.jun16.story.test05\",\n \"audience\": [\n \"Learner\"\n ],\n \"flagReasons\": [\n \"Copyright Violation\"\n ],\n \"visibility\": \"default\",\n \"os\": [\n \"All\"\n ],\n \"consumerId\": \"72e54829-6402-4cf0-888e-9b30733c1b88\",\n \"mediaType\": \"content\",\n \"osId\": \"org.ekstep.quiz.app\",\n \"graph_id\": \"domain\",\n \"nodeType\": \"DATA_NODE\",\n \"pkgVersion\": 1,\n \"versionKey\": \"1515523292368\",\n \"prevState\": \"Draft\",\n \"idealScreenDensity\": \"hdpi\",\n \"dialcodes\": [\n \"DAKDF\",\n \"FSDFDSA\"\n ],\n \"s3Key\": \"ecar_files/org.ekstep.jun16.story.test05/vrgaatiil-upkrmclassroom-activities_1498725323304_org.ekstep.jun16.story.test05_1.0.ecar\",\n \"size\": 9983654,\n \"lastPublishedOn\": \"2017-06-29T08:35:23.302+0000\",\n \"compatibilityLevel\": 1,\n \"name\": \"\\tवर्गातील उपक्रम(Classroom Activities)\",\n \"resourceType\": \"Story\",\n \"status\": \"Flagged\",\n \"node_id\": 105761\n }\n ]\n }\n}" + }, + { + "name": "BAD REQUEST. The **Content Search** operation failed. You may have missed input for a mandatory parameter - Content-Type in header", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "The Content Type entity is the media type of the resource.Possible media types can be:-\n - Application/json", + "key": "Content-Type", + "value": "ea laborum" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"filters\": {\n \"objectType\": \"Content\",\n \"status\": []\n },\n \"limit\": 1\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/content/v1/search", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v1", + "search" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"api.content.search\",\n \"ver\": \"1.0\",\n \"ts\": \"2020-12-21T11:46:50.400Z\",\n \"params\": {\n \"resmsgid\": \"367e7a00-4382-11eb-9b0c-abcfbdf41bc3\",\n \"msgid\": null,\n \"status\": \"failed\",\n \"err\": \"ERR_CONTENT_SEARCH_FIELDS_MISSING\",\n \"errmsg\": \"Required fields for search content are missing\"\n },\n \"responseCode\": \"CLIENT_ERROR\",\n \"result\": {}\n}" + }, + { + "name": "'INTERNAL SERVER ERROR. We track these errors automatically and try to set it right at the earliest. Try refreshing the page. If the problem persists contact us at info@sunbird.org.'", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "The Content Type entity is the media type of the resource.Possible media types can be:-\n - Application/json", + "key": "Content-Type", + "value": "ea laborum" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"filters\": {\n \"objectType\": \"Content\",\n \"status\": []\n },\n \"limit\": 1\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/content/v1/search", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v1", + "search" + ] + } + }, + "status": "Internal Server Error", + "code": 500, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"api.content.search\",\n \"ver\": \"1.0\",\n \"ts\": \"2020-12-10T08:51:51.647Z\",\n \"params\": {\n \"resmsgid\": \"f234a6f0-3ac4-11eb-b0a2-8d5c9f561887\",\n \"msgid\": null,\n \"status\": \"failed\",\n \"err\": null,\n \"errmsg\": null\n },\n \"responseCode\": \"SERVER_ERROR\",\n \"result\": {}\n}" + } + ] + } + ] + }, + { + "name": "Negative", + "item": [] + } + ] + }, + { + "name": "Read Private Content", + "item": [ + { + "name": "Positive", + "item": [ + { + "name": "Read Private Content", + "request": { + "auth": { + "type": "apikey", + "apikey": [ + { + "key": "key", + "value": "Authorization", + "type": "string" + }, + { + "key": "value", + "value": "", + "type": "string" + }, + { + "key": "in", + "value": "header", + "type": "string" + } + ] + }, + "method": "GET", + "header": [ + { + "description": "The Content Type entity is the media type of the resource.Possible media types can be:-\n - Application/json", + "key": "Content-Type", + "value": "ea laborum" + }, + { + "description": "(Required) Represents a physical location (e.g: state) uniquely to which the user belongs.", + "key": "x-channel-id", + "value": "ea laborum" + }, + { + "description": "(Required) To make use of the API, you require authorization. Raise a request to the administrator for the use of the API. You will receive the authorization key. Specify the key received, here.", + "key": "Authorization", + "value": "ea laborum" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "url": { + "raw": "{{baseUrl}}/content/v1/private/read/:Content_Id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v1", + "private", + "read", + ":Content_Id" + ], + "variable": [ + { + "key": "Content_Id", + "value": "ea laborum", + "description": "(Required) Please append a valid Content Id To the Request URL" + } + ] + }, + "description": "This API is associated with viewing and reading out the private and public contents on the Sunbird Platform.\n - The **_/private/read/{contentId}_** endpoint executes request for fetching the private and public contents to be viewed and read.\n - The endpoint for **Read Private Content** is `/content/v1/private/read`\n - It points to content-service - `/content/v4/private/read`\n - {...}refers to a section of reject endpoint URL path that needs to be replaced by appropriate Id.\n - You need to provide a valid content Id value in {Content Id} field of API URL.\n - It is mandatory to provide values for parameters marked with *.\n - Mandatory fields cannot be null or empty." + }, + "response": [ + { + "name": "OK ! Successful operation.\"Read Private content\" operation was successfully executed. For all possible metadata, please [refer](https://github.com/project-sunbird/knowledge-platform/blob/master/schemas/content/1.0/schema.json)", + "originalRequest": { + "method": "GET", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "The Content Type entity is the media type of the resource.Possible media types can be:-\n - Application/json", + "key": "Content-Type", + "value": "ea laborum" + }, + { + "description": "(Required) Represents a physical location (e.g: state) uniquely to which the user belongs.", + "key": "x-channel-id", + "value": "ea laborum" + }, + { + "description": "(Required) To make use of the API, you require authorization. Raise a request to the administrator for the use of the API. You will receive the authorization key. Specify the key received, here.", + "key": "Authorization", + "value": "ea laborum" + } + ], + "url": { + "raw": "{{baseUrl}}/content/v1/private/read/:Content_Id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v1", + "private", + "read", + ":Content_Id" + ], + "variable": [ + { + "key": "Content_Id", + "value": "ea laborum", + "description": "(Required) Please append a valid Content Id To the Request URL" + } + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"api.content.private.read\",\n \"ver\": \"4.0\",\n \"ts\": \"2021-09-20T20:12:52Z+05:30\",\n \"params\": {\n \"resmsgid\": \"a31dbba1-c3bf-4c3d-a028-f3e5b7de4b57\",\n \"msgid\": null,\n \"err\": null,\n \"status\": \"successful\",\n \"errmsg\": null\n },\n \"responseCode\": \"OK\",\n \"result\": {\n \"content\": {\n \"ownershipType\": [\n \"createdBy\"\n ],\n \"code\": \"name\",\n \"interceptionPoints\": {},\n \"credentials\": {\n \"enabled\": \"No\"\n },\n \"channel\": \"abc-123\",\n \"language\": [\n \"English\"\n ],\n \"mimeType\": \"application/pdf\",\n \"idealScreenSize\": \"normal\",\n \"createdOn\": \"2021-08-30T13:11:08.485+0530\",\n \"objectType\": \"Content\",\n \"primaryCategory\": \"Learning Resource\",\n \"contentDisposition\": \"inline\",\n \"lastUpdatedOn\": \"2021-08-30T13:11:08.485+0530\",\n \"contentEncoding\": \"identity\",\n \"dialcodeRequired\": \"No\",\n \"trackable\": {\n \"enabled\": \"No\",\n \"autoBatch\": \"No\"\n },\n \"identifier\": \"do_11335549352263680012\",\n \"lastStatusChangedOn\": \"2021-08-30T13:11:08.485+0530\",\n \"audience\": [\n \"Student\"\n ],\n \"os\": [\n \"All\"\n ],\n \"visibility\": \"Private\",\n \"discussionForum\": {\n \"enabled\": \"No\"\n },\n \"mediaType\": \"content\",\n \"osId\": \"org.ekstep.quiz.app\",\n \"languageCode\": [\n \"en\"\n ],\n \"version\": 2,\n \"versionKey\": \"1630309268485\",\n \"license\": \"CC BY 4.0\",\n \"idealScreenDensity\": \"hdpi\",\n \"framework\": \"NCF\",\n \"compatibilityLevel\": 1,\n \"name\": \"Untitled Resource\",\n \"status\": \"Draft\"\n }\n }\n}" + }, + { + "name": "RESOURCE NOT FOUND,**Content Private Read** operation failed !The possible reason for failure is that you may have provided wrong content id.", + "originalRequest": { + "method": "GET", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "The Content Type entity is the media type of the resource.Possible media types can be:-\n - Application/json", + "key": "Content-Type", + "value": "ea laborum" + }, + { + "description": "(Required) Represents a physical location (e.g: state) uniquely to which the user belongs.", + "key": "x-channel-id", + "value": "ea laborum" + }, + { + "description": "(Required) To make use of the API, you require authorization. Raise a request to the administrator for the use of the API. You will receive the authorization key. Specify the key received, here.", + "key": "Authorization", + "value": "ea laborum" + } + ], + "url": { + "raw": "{{baseUrl}}/content/v1/private/read/:Content_Id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v1", + "private", + "read", + ":Content_Id" + ], + "variable": [ + { + "key": "Content_Id", + "value": "ea laborum", + "description": "(Required) Please append a valid Content Id To the Request URL" + } + ] + } + }, + "status": "Not Found", + "code": 404, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"api.content.private.read\",\n \"ver\": \"4.0\",\n \"ts\": \"2021-09-20T21:07:50Z+05:30\",\n \"params\": {\n \"resmsgid\": \"a8bb809b-c2e1-4749-b05b-b2cd7dc1ca49\",\n \"msgid\": null,\n \"err\": \"NOT_FOUND\",\n \"status\": \"failed\",\n \"errmsg\": \"Error! Node(s) doesn't Exists. | [Invalid Node Id.]: do_11335549352263680013\"\n },\n \"responseCode\": \"RESOURCE_NOT_FOUND\",\n \"result\": {\n \"messages\": null\n }\n}" + }, + { + "name": "INTERNAL SERVER ERROR ! Looks like something went wrong! These errors are tracked automatically, but if the problem persists feel free to contact us. In the meantime, try refreshing.", + "originalRequest": { + "method": "GET", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "The Content Type entity is the media type of the resource.Possible media types can be:-\n - Application/json", + "key": "Content-Type", + "value": "ea laborum" + }, + { + "description": "(Required) Represents a physical location (e.g: state) uniquely to which the user belongs.", + "key": "x-channel-id", + "value": "ea laborum" + }, + { + "description": "(Required) To make use of the API, you require authorization. Raise a request to the administrator for the use of the API. You will receive the authorization key. Specify the key received, here.", + "key": "Authorization", + "value": "ea laborum" + } + ], + "url": { + "raw": "{{baseUrl}}/content/v1/private/read/:Content_Id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v1", + "private", + "read", + ":Content_Id" + ], + "variable": [ + { + "key": "Content_Id", + "value": "ea laborum", + "description": "(Required) Please append a valid Content Id To the Request URL" + } + ] + } + }, + "status": "Internal Server Error", + "code": 500, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"result\": {},\n \"id\": \"cupidatat reprehenderit dolor\",\n \"ver\": \"minim anim commodo\",\n \"ts\": \"commodo\",\n \"params\": {\n \"resmsgid\": \"pariatur repre\",\n \"msgid\": \"irure\",\n \"err\": \"consequat esse ea\",\n \"status\": \"esse\",\n \"errmsg\": \"aliqua laboris velit\"\n },\n \"responseCode\": \"reprehenderit dolor elit sunt dolore\"\n}" + } + ] + } + ] + }, + { + "name": "Negative", + "item": [] + } + ] + }, + { + "name": "Url Fetch Metadata", + "request": { + "auth": { + "type": "apikey", + "apikey": [ + { + "key": "key", + "value": "Authorization", + "type": "string" + }, + { + "key": "value", + "value": "", + "type": "string" + }, + { + "key": "in", + "value": "header", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "description": "(Required) The Content Type entity is the media type of the resource.Possible media types can be:-\n - Application/json", + "key": "Content-Type", + "value": "application/json" + }, + { + "description": "(Required) To make use of the API, you require authorization. Raise a request to the administrator for the use of the API. You will receive the authorization key. Specify the key received, here.", + "key": "Authorization", + "value": "ea laborum" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"url\": \"https://github.com/project-sunbird/sunbird.org-docs\"\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/content/v4/fetchmeta", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v4", + "fetchmeta" + ] + }, + "description": "This API is associated with fetching url metadata details on the Sunbird Platform.\n - The endpoint for **Create Content** is `/content/v1/fetchmeta`\n - It points to knowledge-mw-service - `/v1/url/fetchmeta`\n - It is mandatory to provide values for parameters marked with *.\n - Mandatory fields cannot be null or empty." + }, + "response": [ + { + "name": "SUCCESS. The **URL Fetch Metadata** operation was successful!", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource.Possible media types can be:-\n - Application/json", + "key": "Content-Type", + "value": "ea laborum" + }, + { + "description": "(Required) To make use of the API, you require authorization. Raise a request to the administrator for the use of the API. You will receive the authorization key. Specify the key received, here.", + "key": "Authorization", + "value": "ea laborum" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"url\": \"https://github.com/project-sunbird/sunbird.org-docs\"\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/content/v1/fetchmeta", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v1", + "fetchmeta" + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"ts\": \"2021-02-02T08:38:20.329Z\",\n \"params\": {\n \"resmsgid\": \"00edd990-6532-11eb-9dac-65b700f4c009\",\n \"msgid\": null,\n \"status\": \"successful\",\n \"err\": null,\n \"errmsg\": null\n },\n \"responseCode\": \"OK\",\n \"result\": {\n \"url\": \"https://github.com/project-sunbird/sunbird.org-docs\",\n \"canonical\": \"https://github.com/project-sunbird/sunbird.org-docs\",\n \"title\": \"project-sunbird/sunbird.org-docs\",\n \"image\": \"https://avatars.githubusercontent.com/u/26705730?s=400&v=4\",\n \"author\": \"\",\n \"description\": \"Repository for documentation on sunbird.org. Contribute to project-sunbird/sunbird.org-docs development by creating an account on GitHub.\",\n \"keywords\": \"\",\n \"source\": \"github.com\",\n \"og:url\": \"https://github.com/project-sunbird/sunbird.org-docs\",\n \"og:locale\": \"\",\n \"og:locale:alternate\": \"\",\n \"og:title\": \"project-sunbird/sunbird.org-docs\",\n \"og:type\": \"object\",\n \"og:description\": \"Repository for documentation on sunbird.org. Contribute to project-sunbird/sunbird.org-docs development by creating an account on GitHub.\",\n \"og:determiner\": \"\",\n \"og:site_name\": \"GitHub\",\n \"og:image\": \"https://avatars.githubusercontent.com/u/26705730?s=400&v=4\",\n \"og:image:secure_url\": \"\",\n \"og:image:type\": \"\",\n \"og:image:width\": \"\",\n \"og:image:height\": \"\",\n \"price\": \"\",\n \"priceCurrency\": \"\",\n \"availability\": \"\"\n }\n}" + }, + { + "name": "'BAD REQUEST. The **URL Fetch Metadata** operation failed. You may have missed input for a mandatory parameter.'", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource.Possible media types can be:-\n - Application/json", + "key": "Content-Type", + "value": "ea laborum" + }, + { + "description": "(Required) To make use of the API, you require authorization. Raise a request to the administrator for the use of the API. You will receive the authorization key. Specify the key received, here.", + "key": "Authorization", + "value": "ea laborum" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"url\": \"https://github.com/project-sunbird/sunbird.org-docs\"\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/content/v1/fetchmeta", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v1", + "fetchmeta" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"ts\": \"2021-02-02T08:53:31.808Z\",\n \"params\": {\n \"resmsgid\": \"20368200-6534-11eb-9dac-65b700f4c009\",\n \"msgid\": null,\n \"status\": \"failed\",\n \"err\": \"ERR_FETCH_URLMETA_MISSING\",\n \"errmsg\": \"Required fields for fetching url meta data are missing\"\n },\n \"responseCode\": \"CLIENT_ERROR\"\n}" + }, + { + "name": "'INTERNAL SERVER ERROR. We track these errors automatically and try to set it right at the earliest. Try refreshing the page. If the problem persists contact us at info@sunbird.org.'", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource.Possible media types can be:-\n - Application/json", + "key": "Content-Type", + "value": "ea laborum" + }, + { + "description": "(Required) To make use of the API, you require authorization. Raise a request to the administrator for the use of the API. You will receive the authorization key. Specify the key received, here.", + "key": "Authorization", + "value": "ea laborum" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"url\": \"https://github.com/project-sunbird/sunbird.org-docs\"\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/content/v1/fetchmeta", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v1", + "fetchmeta" + ] + } + }, + "status": "Internal Server Error", + "code": 500, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"ts\": \"2021-02-02T08:57:49.620Z\",\n \"params\": {\n \"resmsgid\": \"b9e17f40-6534-11eb-9dac-65b700f4c009\",\n \"msgid\": null,\n \"status\": \"failed\",\n \"err\": \"ERR_FETCH_URLMETA_FAILED\",\n \"errmsg\": \"Unable to load the url metadata\"\n }\n}" + } + ] + }, + { + "name": "Reject Flag", + "request": { + "auth": { + "type": "apikey", + "apikey": [ + { + "key": "key", + "value": "Authorization", + "type": "string" + }, + { + "key": "value", + "value": "", + "type": "string" + }, + { + "key": "in", + "value": "header", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "description": "(Required) The Content Type entity is the media type of the resource.Possible media types can be:- \n - Application/json", + "key": "Content-Type", + "value": "nisi amet " + }, + { + "description": "(Required) The Registered User ID to execute the API.", + "key": "X-Authenticated-User-token", + "value": "nisi amet " + }, + { + "description": "(Required) All content APIs require authorization for use. Specify the authorization key received from the administrator when placing the request for use of the API.", + "key": "Authorization", + "value": "nisi amet " + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/content/v1/flag/reject/:Content_Id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v1", + "flag", + "reject", + ":Content_Id" + ], + "variable": [ + { + "key": "Content_Id", + "value": "nisi amet ", + "description": "(Required) Please append a valid Content Id To the Request URL" + } + ] + }, + "description": "This API is associated with setting Reject Flag for content under review process on the Sunbird Platform .\n - The **_/flag/reject/_**endpoint executes request for flagging content under review to \"Reject flag\", if content is found in-appropriate.\n - The endpoint for **Flag Reject Content** is `/content/v1/flag/reject`\n - It points to knowledge-mw-service - `/v1/content/flag/reject`\n - It is mandatory to provide values for parameters marked with *. \n - Mandatory fields cannot be null or empty." + }, + "response": [ + { + "name": "OK ! Successful operation.\"Reject Flag\" operation was successfully executed.", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource.Possible media types can be:- \n - Application/json", + "key": "Content-Type", + "value": "nisi amet " + }, + { + "description": "(Required) The Registered User ID to execute the API.", + "key": "X-Authenticated-User-token", + "value": "nisi amet " + }, + { + "description": "(Required) All content APIs require authorization for use. Specify the authorization key received from the administrator when placing the request for use of the API.", + "key": "Authorization", + "value": "nisi amet " + } + ], + "body": { + "mode": "raw", + "raw": "{}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/content/v1/flag/reject/:Content_Id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v1", + "flag", + "reject", + ":Content_Id" + ], + "variable": [ + { + "key": "Content_Id", + "value": "nisi amet ", + "description": "(Required) Please append a valid Content Id To the Request URL" + } + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"result\": {\n \"node_id\": \"ex reprehenderit magna eiusmod\",\n \"content_id\": \"adipisicing velit ullamco\",\n \"versionKey\": \"pari\"\n },\n \"id\": \"cupidatat dolore elit\",\n \"ver\": \"nostrud exercitation dolore labore minim\",\n \"ts\": \"nisi\",\n \"params\": {\n \"resmsgid\": \"ea officia voluptate\",\n \"msgid\": \"fugiat consequat\",\n \"err\": \"do non minim\",\n \"status\": \"in enim\",\n \"errmsg\": \"mollit eu quis\"\n },\n \"responseCode\": \"consectetur voluptate\"\n}" + }, + { + "name": "ERR CONTENT NOT FLAGGED! Looks like contentId is not in flagged status.", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource.Possible media types can be:- \n - Application/json", + "key": "Content-Type", + "value": "nisi amet " + }, + { + "description": "(Required) The Registered User ID to execute the API.", + "key": "X-Authenticated-User-token", + "value": "nisi amet " + }, + { + "description": "(Required) All content APIs require authorization for use. Specify the authorization key received from the administrator when placing the request for use of the API.", + "key": "Authorization", + "value": "nisi amet " + } + ], + "body": { + "mode": "raw", + "raw": "{}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/content/v1/flag/reject/:Content_Id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v1", + "flag", + "reject", + ":Content_Id" + ], + "variable": [ + { + "key": "Content_Id", + "value": "nisi amet ", + "description": "(Required) Please append a valid Content Id To the Request URL" + } + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"result\": {},\n \"id\": \"voluptate culpa Excepteur minim\",\n \"ver\": \"Duis\",\n \"ts\": \"exercitation cupidatat aute repr\",\n \"params\": {\n \"resmsgid\": \"do Duis cupidatat nostrud\",\n \"msgid\": \"laboris veniam \",\n \"err\": \"ut ad pariatur adipisicing enim\",\n \"status\": \"sit sunt aliqua\",\n \"errmsg\": \"elit dolore irure\"\n },\n \"responseCode\": \"occaecat\"\n}" + }, + { + "name": "RESOURCE NOT FOUND,**Content Send for Flag Reject** operation failed !The possible reason for failure is that you may have provided wrong content id.", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource.Possible media types can be:- \n - Application/json", + "key": "Content-Type", + "value": "nisi amet " + }, + { + "description": "(Required) The Registered User ID to execute the API.", + "key": "X-Authenticated-User-token", + "value": "nisi amet " + }, + { + "description": "(Required) All content APIs require authorization for use. Specify the authorization key received from the administrator when placing the request for use of the API.", + "key": "Authorization", + "value": "nisi amet " + } + ], + "body": { + "mode": "raw", + "raw": "{}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/content/v1/flag/reject/:Content_Id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v1", + "flag", + "reject", + ":Content_Id" + ], + "variable": [ + { + "key": "Content_Id", + "value": "nisi amet ", + "description": "(Required) Please append a valid Content Id To the Request URL" + } + ] + } + }, + "status": "Not Found", + "code": 404, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"result\": {},\n \"id\": \"voluptate culpa Excepteur minim\",\n \"ver\": \"Duis\",\n \"ts\": \"exercitation cupidatat aute repr\",\n \"params\": {\n \"resmsgid\": \"do Duis cupidatat nostrud\",\n \"msgid\": \"laboris veniam \",\n \"err\": \"ut ad pariatur adipisicing enim\",\n \"status\": \"sit sunt aliqua\",\n \"errmsg\": \"elit dolore irure\"\n },\n \"responseCode\": \"occaecat\"\n}" + }, + { + "name": "INTERNAL SERVER ERROR ! Looks like something went wrong! These errors are tracked automatically, but if the problem persists feel free to contact us. In the meantime, try refreshing.", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource.Possible media types can be:- \n - Application/json", + "key": "Content-Type", + "value": "nisi amet " + }, + { + "description": "(Required) The Registered User ID to execute the API.", + "key": "X-Authenticated-User-token", + "value": "nisi amet " + }, + { + "description": "(Required) All content APIs require authorization for use. Specify the authorization key received from the administrator when placing the request for use of the API.", + "key": "Authorization", + "value": "nisi amet " + } + ], + "body": { + "mode": "raw", + "raw": "{}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/content/v1/flag/reject/:Content_Id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v1", + "flag", + "reject", + ":Content_Id" + ], + "variable": [ + { + "key": "Content_Id", + "value": "nisi amet ", + "description": "(Required) Please append a valid Content Id To the Request URL" + } + ] + } + }, + "status": "Internal Server Error", + "code": 500, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"result\": {},\n \"id\": \"voluptate culpa Excepteur minim\",\n \"ver\": \"Duis\",\n \"ts\": \"exercitation cupidatat aute repr\",\n \"params\": {\n \"resmsgid\": \"do Duis cupidatat nostrud\",\n \"msgid\": \"laboris veniam \",\n \"err\": \"ut ad pariatur adipisicing enim\",\n \"status\": \"sit sunt aliqua\",\n \"errmsg\": \"elit dolore irure\"\n },\n \"responseCode\": \"occaecat\"\n}" + } + ] + } + ] + } + ] + } + ], + "variable": [ + { + "key": "baseUrl", + "value": "https://staging.sunbirded.org/api", + "type": "string" + }, + { + "key": "upload_content_id", + "value": "" + }, + { + "key": "update_content_id", + "value": "" + }, + { + "key": "updatecontent_versionkey", + "value": "" + }, + { + "key": "update_content", + "value": "" + }, + { + "key": "update_versionkey", + "value": "" + }, + { + "key": "content_update", + "value": "" + }, + { + "key": "versionkey_update", + "value": "" + }, + { + "key": "read_content", + "value": "" + }, + { + "key": "identifier", + "value": "" + }, + { + "key": "submit_content", + "value": "" + }, + { + "key": "submit_content_neg", + "value": "" + }, + { + "key": "content_id", + "value": "" + }, + { + "key": "versionKey", + "value": "" + }, + { + "key": "pre_signed_URL", + "value": "" + }, + { + "key": "id", + "value": "" + }, + { + "key": "partial_URL", + "value": "" + }, + { + "key": "content_id_01", + "value": "" + }, + { + "key": "publish_content", + "value": "" + }, + { + "key": "reject_content", + "value": "" + }, + { + "key": "retire_content", + "value": "" + }, + { + "key": "retire_draft", + "value": "" + }, + { + "key": "discard_content", + "value": "" + }, + { + "key": "discard_livecontent", + "value": "" + }, + { + "key": "copy_content", + "value": "" + }, + { + "key": "pre_content_id", + "value": "" + }, + { + "key": "flag_content_id", + "value": "" + }, + { + "key": "flag_accept_content_id", + "value": "" + }, + { + "key": "content_id_02", + "value": "" + }, + { + "key": "content_id_03", + "value": "" + }, + { + "key": "content_wo_url", + "value": "" + } + ] +} \ No newline at end of file diff --git a/content-api/api-tests/Reports/Sunbird Content Management API(s)_V1.postman_test_run.json b/content-api/api-tests/Reports/Sunbird Content Management API(s)_V1.postman_test_run.json new file mode 100644 index 000000000..d392f6c61 --- /dev/null +++ b/content-api/api-tests/Reports/Sunbird Content Management API(s)_V1.postman_test_run.json @@ -0,0 +1,6894 @@ +{ + "id": "d718f90f-e2a2-4599-8f85-3fbadee05706", + "name": "Sunbird Content Management API(s)_V1", + "timestamp": "2024-01-11T06:30:30.992Z", + "collection_id": "19432603-3a33b6a7-0451-41d4-a2e2-b7233c507254", + "folder_id": 0, + "environment_id": "19432603-1f803966-ff65-4348-b719-1dddf67c3688", + "totalPass": 734, + "delay": 0, + "persist": true, + "status": "finished", + "startedAt": "2024-01-11T06:30:10.411Z", + "totalFail": 0, + "results": [ + { + "id": "e0531555-5b64-4dba-8914-c94cf6efa641", + "name": "Create content", + "url": "http://20.207.120.49/content/v4/create", + "time": 171, + "responseCode": { + "code": 200, + "name": "OK" + }, + "tests": {}, + "testPassFailCounts": {}, + "times": [ + 171 + ], + "allTests": [ + {} + ] + }, + { + "id": "2417a770-1de7-42f5-8c0f-a65e44fabfd0", + "name": "Upload Content with valid file", + "url": "http://20.207.120.49/content/v4/upload/do_2139669881759252481164", + "time": 312, + "responseCode": { + "code": 500, + "name": "Internal Server Error" + }, + "tests": {}, + "testPassFailCounts": {}, + "times": [ + 312 + ], + "allTests": [ + {} + ] + }, + { + "id": "76ba37f5-a562-4f7d-a57f-b81c950a9797", + "name": "Upload Content with invalid file", + "url": "http://20.207.120.49/content/v4/upload/do_2139669881759252481164", + "time": 122, + "responseCode": { + "code": 500, + "name": "Internal Server Error" + }, + "tests": {}, + "testPassFailCounts": {}, + "times": [ + 122 + ], + "allTests": [ + {} + ] + }, + { + "id": "b443e65f-d76b-4028-8288-6d3d3dd1a237", + "name": "Create content", + "url": "http://20.207.120.49/content/v4/create", + "time": 99, + "responseCode": { + "code": 200, + "name": "OK" + }, + "tests": { + "Status code is 200": true, + "Status code name has string OK": true, + "id should be api.content.create": true, + "ver should be 4.0": true, + "Params has keys: resmsgid , msgid , err , status , errmsg ": true, + "Status is successful": true, + "ResponseCode is OK": true + }, + "testPassFailCounts": { + "Status code is 200": { + "pass": 1, + "fail": 0 + }, + "Status code name has string OK": { + "pass": 1, + "fail": 0 + }, + "id should be api.content.create": { + "pass": 1, + "fail": 0 + }, + "ver should be 4.0": { + "pass": 1, + "fail": 0 + }, + "Params has keys: resmsgid , msgid , err , status , errmsg ": { + "pass": 1, + "fail": 0 + }, + "Status is successful": { + "pass": 1, + "fail": 0 + }, + "ResponseCode is OK": { + "pass": 1, + "fail": 0 + } + }, + "times": [ + 99 + ], + "allTests": [ + { + "Status code is 200": true, + "Status code name has string OK": true, + "id should be api.content.create": true, + "ver should be 4.0": true, + "Params has keys: resmsgid , msgid , err , status , errmsg ": true, + "Status is successful": true, + "ResponseCode is OK": true + } + ] + }, + { + "id": "f27343cb-3121-4c6e-9da3-bd101c144435", + "name": "Upload URL", + "url": "http://20.207.120.49/content/v4/upload/url/do_2139669881823150081165", + "time": 99, + "responseCode": { + "code": 200, + "name": "OK" + }, + "tests": { + "Status code is 200": true, + "Status code name has string OK": true, + "id should be api.content.upload.url": true, + "ver should be 4.0": true, + "Params has keys: resmsgid , msgid , err , status , errmsg ": true, + "Status is successful": true, + "ResponseCode is OK": true, + "Verify keys and data type of the response result": true + }, + "testPassFailCounts": { + "Status code is 200": { + "pass": 1, + "fail": 0 + }, + "Status code name has string OK": { + "pass": 1, + "fail": 0 + }, + "id should be api.content.upload.url": { + "pass": 1, + "fail": 0 + }, + "ver should be 4.0": { + "pass": 1, + "fail": 0 + }, + "Params has keys: resmsgid , msgid , err , status , errmsg ": { + "pass": 1, + "fail": 0 + }, + "Status is successful": { + "pass": 1, + "fail": 0 + }, + "ResponseCode is OK": { + "pass": 1, + "fail": 0 + }, + "Verify keys and data type of the response result": { + "pass": 1, + "fail": 0 + } + }, + "times": [ + 99 + ], + "allTests": [ + { + "Status code is 200": true, + "Status code name has string OK": true, + "id should be api.content.upload.url": true, + "ver should be 4.0": true, + "Params has keys: resmsgid , msgid , err , status , errmsg ": true, + "Status is successful": true, + "ResponseCode is OK": true, + "Verify keys and data type of the response result": true + } + ] + }, + { + "id": "49fc6d78-a868-44f7-a119-764dc783fdcf", + "name": "Upload file to the URL", + "url": "https://knowlgdevbad2564c.blob.core.windows.net/sunbird-content-staging-knowlg/content/assets/do_2139669881823150081165/test.pdf?sv=2017-04-17&se=2024-01-11T21%3A30%3A12Z&sr=b&sp=w&sig=HKBuhg2xvj2IlO3e38I7HpSUw3g3md3/hix/QohJbyY%3D", + "time": 382, + "responseCode": { + "code": 201, + "name": "Created" + }, + "tests": { + "Status code is 201": true + }, + "testPassFailCounts": { + "Status code is 201": { + "pass": 1, + "fail": 0 + } + }, + "times": [ + 382 + ], + "allTests": [ + { + "Status code is 201": true + } + ] + }, + { + "id": "e8410bfe-e9b0-4a37-9223-efd544d9de44", + "name": "Update the content with valid URL and mime type", + "url": "http://20.207.120.49/content/v4/upload/do_2139669881823150081165", + "time": 181, + "responseCode": { + "code": 200, + "name": "OK" + }, + "tests": { + "Status code is 200": true, + "Status code name has string OK": true, + "id should be api.content.upload": true, + "ver should be 4.0": true, + "Params has keys: resmsgid , msgid , err , status , errmsg ": true, + "Status is successful": true, + "ResponseCode is OK": true, + "Result has keys: identifier , artifactUrl , content_url , node_id , versionKey ": true, + "artifactUrl should be: https://knowlgdevbad2564c.blob.core.windows.net/sunbird-content-staging-knowlg/content/assets/do_2139669881823150081165/test.pdf": true, + "content_url should be: https://knowlgdevbad2564c.blob.core.windows.net/sunbird-content-staging-knowlg/content/assets/do_2139669881823150081165/test.pdf": true, + "identifier should be: do_2139669881823150081165": true, + "node_id should be: do_2139669881823150081165": true + }, + "testPassFailCounts": { + "Status code is 200": { + "pass": 1, + "fail": 0 + }, + "Status code name has string OK": { + "pass": 1, + "fail": 0 + }, + "id should be api.content.upload": { + "pass": 1, + "fail": 0 + }, + "ver should be 4.0": { + "pass": 1, + "fail": 0 + }, + "Params has keys: resmsgid , msgid , err , status , errmsg ": { + "pass": 1, + "fail": 0 + }, + "Status is successful": { + "pass": 1, + "fail": 0 + }, + "ResponseCode is OK": { + "pass": 1, + "fail": 0 + }, + "Result has keys: identifier , artifactUrl , content_url , node_id , versionKey ": { + "pass": 1, + "fail": 0 + }, + "artifactUrl should be: https://knowlgdevbad2564c.blob.core.windows.net/sunbird-content-staging-knowlg/content/assets/do_2139669881823150081165/test.pdf": { + "pass": 1, + "fail": 0 + }, + "content_url should be: https://knowlgdevbad2564c.blob.core.windows.net/sunbird-content-staging-knowlg/content/assets/do_2139669881823150081165/test.pdf": { + "pass": 1, + "fail": 0 + }, + "identifier should be: do_2139669881823150081165": { + "pass": 1, + "fail": 0 + }, + "node_id should be: do_2139669881823150081165": { + "pass": 1, + "fail": 0 + } + }, + "times": [ + 181 + ], + "allTests": [ + { + "Status code is 200": true, + "Status code name has string OK": true, + "id should be api.content.upload": true, + "ver should be 4.0": true, + "Params has keys: resmsgid , msgid , err , status , errmsg ": true, + "Status is successful": true, + "ResponseCode is OK": true, + "Result has keys: identifier , artifactUrl , content_url , node_id , versionKey ": true, + "artifactUrl should be: https://knowlgdevbad2564c.blob.core.windows.net/sunbird-content-staging-knowlg/content/assets/do_2139669881823150081165/test.pdf": true, + "content_url should be: https://knowlgdevbad2564c.blob.core.windows.net/sunbird-content-staging-knowlg/content/assets/do_2139669881823150081165/test.pdf": true, + "identifier should be: do_2139669881823150081165": true, + "node_id should be: do_2139669881823150081165": true + } + ] + }, + { + "id": "d8fd3947-5059-40ae-b7d1-aceca4f27b6e", + "name": "Upload the content with Valid url and no mime type", + "url": "http://20.207.120.49/content/v4/upload/do_21396570071209574418", + "time": 148, + "responseCode": { + "code": 200, + "name": "OK" + }, + "tests": { + "Status code is 200": true, + "Status code name has string OK": true, + "id should be api.content.upload": true, + "ver should be 4.0": true, + "Params has keys: resmsgid , msgid , err , status , errmsg ": true, + "Status is successful": true, + "ResponseCode is OK": true, + "Result has keys: identifier , artifactUrl , content_url , node_id , versionKey ": true, + "artifactUrl should be: https://knowlgdevbad2564c.blob.core.windows.net/sunbird-content-staging-knowlg/content/assets/do_2139669881823150081165/test.pdf": true, + "content_url should be: https://knowlgdevbad2564c.blob.core.windows.net/sunbird-content-staging-knowlg/content/assets/do_2139669881823150081165/test.pdf": true, + "identifier should be: do_21396570071209574418": true, + "node_id should be: do_21396570071209574418": true + }, + "testPassFailCounts": { + "Status code is 200": { + "pass": 1, + "fail": 0 + }, + "Status code name has string OK": { + "pass": 1, + "fail": 0 + }, + "id should be api.content.upload": { + "pass": 1, + "fail": 0 + }, + "ver should be 4.0": { + "pass": 1, + "fail": 0 + }, + "Params has keys: resmsgid , msgid , err , status , errmsg ": { + "pass": 1, + "fail": 0 + }, + "Status is successful": { + "pass": 1, + "fail": 0 + }, + "ResponseCode is OK": { + "pass": 1, + "fail": 0 + }, + "Result has keys: identifier , artifactUrl , content_url , node_id , versionKey ": { + "pass": 1, + "fail": 0 + }, + "artifactUrl should be: https://knowlgdevbad2564c.blob.core.windows.net/sunbird-content-staging-knowlg/content/assets/do_2139669881823150081165/test.pdf": { + "pass": 1, + "fail": 0 + }, + "content_url should be: https://knowlgdevbad2564c.blob.core.windows.net/sunbird-content-staging-knowlg/content/assets/do_2139669881823150081165/test.pdf": { + "pass": 1, + "fail": 0 + }, + "identifier should be: do_21396570071209574418": { + "pass": 1, + "fail": 0 + }, + "node_id should be: do_21396570071209574418": { + "pass": 1, + "fail": 0 + } + }, + "times": [ + 148 + ], + "allTests": [ + { + "Status code is 200": true, + "Status code name has string OK": true, + "id should be api.content.upload": true, + "ver should be 4.0": true, + "Params has keys: resmsgid , msgid , err , status , errmsg ": true, + "Status is successful": true, + "ResponseCode is OK": true, + "Result has keys: identifier , artifactUrl , content_url , node_id , versionKey ": true, + "artifactUrl should be: https://knowlgdevbad2564c.blob.core.windows.net/sunbird-content-staging-knowlg/content/assets/do_2139669881823150081165/test.pdf": true, + "content_url should be: https://knowlgdevbad2564c.blob.core.windows.net/sunbird-content-staging-knowlg/content/assets/do_2139669881823150081165/test.pdf": true, + "identifier should be: do_21396570071209574418": true, + "node_id should be: do_21396570071209574418": true + } + ] + }, + { + "id": "d32f4f4e-dafd-4822-bf0d-499a9ab87b53", + "name": "Upload the content with invalid url and valid mime type", + "url": "http://20.207.120.49/content/v4/upload/do_21396570071209574418", + "time": 118, + "responseCode": { + "code": 400, + "name": "Bad Request" + }, + "tests": { + "Status code is 400": true, + "Status code name has string Bad Request": true, + "id should be api.content.upload": true, + "ver should be 4.0": true, + "Params has keys: resmsgid , msgid , err , status , errmsg ": true, + "err is ERR_INVALID_FILE_URL": true, + "errmsg: Please Provide Valid File Url!": true, + "Status is failed": true, + "ResponseCode is CLIENT_ERROR": true + }, + "testPassFailCounts": { + "Status code is 400": { + "pass": 1, + "fail": 0 + }, + "Status code name has string Bad Request": { + "pass": 1, + "fail": 0 + }, + "id should be api.content.upload": { + "pass": 1, + "fail": 0 + }, + "ver should be 4.0": { + "pass": 1, + "fail": 0 + }, + "Params has keys: resmsgid , msgid , err , status , errmsg ": { + "pass": 1, + "fail": 0 + }, + "err is ERR_INVALID_FILE_URL": { + "pass": 1, + "fail": 0 + }, + "errmsg: Please Provide Valid File Url!": { + "pass": 1, + "fail": 0 + }, + "Status is failed": { + "pass": 1, + "fail": 0 + }, + "ResponseCode is CLIENT_ERROR": { + "pass": 1, + "fail": 0 + } + }, + "times": [ + 118 + ], + "allTests": [ + { + "Status code is 400": true, + "Status code name has string Bad Request": true, + "id should be api.content.upload": true, + "ver should be 4.0": true, + "Params has keys: resmsgid , msgid , err , status , errmsg ": true, + "err is ERR_INVALID_FILE_URL": true, + "errmsg: Please Provide Valid File Url!": true, + "Status is failed": true, + "ResponseCode is CLIENT_ERROR": true + } + ] + }, + { + "id": "75e013e1-87e9-4d3d-afd4-570900130b12", + "name": "Create content", + "url": "http://20.207.120.49/content/v4/create", + "time": 157, + "responseCode": { + "code": 200, + "name": "OK" + }, + "tests": { + "Status code is 200": true, + "Status code name has string OK": true, + "id should be api.content.create": true, + "ver should be 4.0": true, + "Params has keys: resmsgid , msgid , err , status , errmsg ": true, + "Status is successful": true, + "ResponseCode is OK": true + }, + "testPassFailCounts": { + "Status code is 200": { + "pass": 1, + "fail": 0 + }, + "Status code name has string OK": { + "pass": 1, + "fail": 0 + }, + "id should be api.content.create": { + "pass": 1, + "fail": 0 + }, + "ver should be 4.0": { + "pass": 1, + "fail": 0 + }, + "Params has keys: resmsgid , msgid , err , status , errmsg ": { + "pass": 1, + "fail": 0 + }, + "Status is successful": { + "pass": 1, + "fail": 0 + }, + "ResponseCode is OK": { + "pass": 1, + "fail": 0 + } + }, + "times": [ + 157 + ], + "allTests": [ + { + "Status code is 200": true, + "Status code name has string OK": true, + "id should be api.content.create": true, + "ver should be 4.0": true, + "Params has keys: resmsgid , msgid , err , status , errmsg ": true, + "Status is successful": true, + "ResponseCode is OK": true + } + ] + }, + { + "id": "752bde5f-efd7-4bf0-ae58-f1bdd9da8524", + "name": "Flag valid Content", + "url": "http://20.207.120.49/content/v2/flag/do_2139669881958973441166", + "time": 104, + "responseCode": { + "code": 404, + "name": "Not Found" + }, + "tests": {}, + "testPassFailCounts": {}, + "times": [ + 104 + ], + "allTests": [ + {} + ] + }, + { + "id": "4076be5e-bbbf-4269-96c9-8eaf16a00586", + "name": "Flag invalid Content", + "url": "http://20.207.120.49/content/v2/flag/dummy", + "time": 75, + "responseCode": { + "code": 404, + "name": "Not Found" + }, + "tests": {}, + "testPassFailCounts": {}, + "times": [ + 75 + ], + "allTests": [ + {} + ] + }, + { + "id": "816b8cf6-e7a1-480f-8bdd-f36c354f7807", + "name": "Create content", + "url": "http://20.207.120.49/content/v4/create", + "time": 124, + "responseCode": { + "code": 200, + "name": "OK" + }, + "tests": { + "Status code is 200": true, + "Status code name has string OK": true, + "id should be api.content.create": true, + "ver should be 4.0": true, + "Params has keys: resmsgid , msgid , err , status , errmsg ": true, + "Status is successful": true, + "ResponseCode is OK": true + }, + "testPassFailCounts": { + "Status code is 200": { + "pass": 1, + "fail": 0 + }, + "Status code name has string OK": { + "pass": 1, + "fail": 0 + }, + "id should be api.content.create": { + "pass": 1, + "fail": 0 + }, + "ver should be 4.0": { + "pass": 1, + "fail": 0 + }, + "Params has keys: resmsgid , msgid , err , status , errmsg ": { + "pass": 1, + "fail": 0 + }, + "Status is successful": { + "pass": 1, + "fail": 0 + }, + "ResponseCode is OK": { + "pass": 1, + "fail": 0 + } + }, + "times": [ + 124 + ], + "allTests": [ + { + "Status code is 200": true, + "Status code name has string OK": true, + "id should be api.content.create": true, + "ver should be 4.0": true, + "Params has keys: resmsgid , msgid , err , status , errmsg ": true, + "Status is successful": true, + "ResponseCode is OK": true + } + ] + }, + { + "id": "90cdd04f-9edb-4b69-aa48-8e51062e3f36", + "name": "Flag valid Content Copy", + "url": "http://20.207.120.49/content/v2/flag/do_2139669882002472961167", + "time": 67, + "responseCode": { + "code": 404, + "name": "Not Found" + }, + "tests": {}, + "testPassFailCounts": {}, + "times": [ + 67 + ], + "allTests": [ + {} + ] + }, + { + "id": "b6bc2732-db0e-42fb-ab05-2cb1619c4540", + "name": "Flag accept valid content id", + "url": "http://20.207.120.49/content/v2/flag/accept/do_2139669882002472961167", + "time": 60, + "responseCode": { + "code": 404, + "name": "Not Found" + }, + "tests": {}, + "testPassFailCounts": {}, + "times": [ + 60 + ], + "allTests": [ + {} + ] + }, + { + "id": "d8915731-839c-4887-9c17-5cb2f9736bf8", + "name": "Flag accept invalid content id", + "url": "http://20.207.120.49/content/v2/flag/accept/do_2139669882002472961167", + "time": 75, + "responseCode": { + "code": 404, + "name": "Not Found" + }, + "tests": {}, + "testPassFailCounts": {}, + "times": [ + 75 + ], + "allTests": [ + {} + ] + }, + { + "id": "4919a05c-945f-45b6-b4ea-349884bba956", + "name": "Create content with minimal required attribute", + "url": "http://20.207.120.49/content/v4/create", + "time": 117, + "responseCode": { + "code": 200, + "name": "OK" + }, + "tests": { + "Status code is 200": true, + "Status code name has string OK": true, + "id should be api.content.create": true, + "ver should be 4.0": true, + "Params has keys: resmsgid , msgid , err , status , errmsg ": true, + "Status is successful": true, + "ResponseCode is OK": true, + "Result has keys: identifier , node_id , versionKey": true + }, + "testPassFailCounts": { + "Status code is 200": { + "pass": 1, + "fail": 0 + }, + "Status code name has string OK": { + "pass": 1, + "fail": 0 + }, + "id should be api.content.create": { + "pass": 1, + "fail": 0 + }, + "ver should be 4.0": { + "pass": 1, + "fail": 0 + }, + "Params has keys: resmsgid , msgid , err , status , errmsg ": { + "pass": 1, + "fail": 0 + }, + "Status is successful": { + "pass": 1, + "fail": 0 + }, + "ResponseCode is OK": { + "pass": 1, + "fail": 0 + }, + "Result has keys: identifier , node_id , versionKey": { + "pass": 1, + "fail": 0 + } + }, + "times": [ + 117 + ], + "allTests": [ + { + "Status code is 200": true, + "Status code name has string OK": true, + "id should be api.content.create": true, + "ver should be 4.0": true, + "Params has keys: resmsgid , msgid , err , status , errmsg ": true, + "Status is successful": true, + "ResponseCode is OK": true, + "Result has keys: identifier , node_id , versionKey": true + } + ] + }, + { + "id": "e2c6b0a4-5d6a-4dcc-b27a-9300c5d7aeb5", + "name": "Create content with identifier", + "url": "http://20.207.120.49/content/v4/create", + "time": 102, + "responseCode": { + "code": 200, + "name": "OK" + }, + "tests": { + "Status code is 200": true, + "Status code name has string OK": true, + "id should be api.content.create": true, + "ver should be 4.0": true, + "Params has keys: resmsgid , msgid , err , status , errmsg ": true, + "Status is successful": true, + "ResponseCode is OK": true, + "Result has keys: identifier , node_id , versionKey": true, + "identifier should be equal to some_identifier07": true, + "node_id should be equal to some_identifier07": true + }, + "testPassFailCounts": { + "Status code is 200": { + "pass": 1, + "fail": 0 + }, + "Status code name has string OK": { + "pass": 1, + "fail": 0 + }, + "id should be api.content.create": { + "pass": 1, + "fail": 0 + }, + "ver should be 4.0": { + "pass": 1, + "fail": 0 + }, + "Params has keys: resmsgid , msgid , err , status , errmsg ": { + "pass": 1, + "fail": 0 + }, + "Status is successful": { + "pass": 1, + "fail": 0 + }, + "ResponseCode is OK": { + "pass": 1, + "fail": 0 + }, + "Result has keys: identifier , node_id , versionKey": { + "pass": 1, + "fail": 0 + }, + "identifier should be equal to some_identifier07": { + "pass": 1, + "fail": 0 + }, + "node_id should be equal to some_identifier07": { + "pass": 1, + "fail": 0 + } + }, + "times": [ + 102 + ], + "allTests": [ + { + "Status code is 200": true, + "Status code name has string OK": true, + "id should be api.content.create": true, + "ver should be 4.0": true, + "Params has keys: resmsgid , msgid , err , status , errmsg ": true, + "Status is successful": true, + "ResponseCode is OK": true, + "Result has keys: identifier , node_id , versionKey": true, + "identifier should be equal to some_identifier07": true, + "node_id should be equal to some_identifier07": true + } + ] + }, + { + "id": "763df56d-b2f0-4edb-9641-b29217a70f76", + "name": "Create content with external fields", + "url": "http://20.207.120.49/content/v4/create", + "time": 121, + "responseCode": { + "code": 200, + "name": "OK" + }, + "tests": { + "Status code is 200": true, + "Status code name has string OK": true, + "id should be api.content.create": true, + "ver should be 4.0": true, + "Params has keys: resmsgid , msgid , err , status , errmsg ": true, + "Status is successful": true, + "ResponseCode is OK": true, + "Result has keys: identifier , node_id , versionKey": true + }, + "testPassFailCounts": { + "Status code is 200": { + "pass": 1, + "fail": 0 + }, + "Status code name has string OK": { + "pass": 1, + "fail": 0 + }, + "id should be api.content.create": { + "pass": 1, + "fail": 0 + }, + "ver should be 4.0": { + "pass": 1, + "fail": 0 + }, + "Params has keys: resmsgid , msgid , err , status , errmsg ": { + "pass": 1, + "fail": 0 + }, + "Status is successful": { + "pass": 1, + "fail": 0 + }, + "ResponseCode is OK": { + "pass": 1, + "fail": 0 + }, + "Result has keys: identifier , node_id , versionKey": { + "pass": 1, + "fail": 0 + } + }, + "times": [ + 121 + ], + "allTests": [ + { + "Status code is 200": true, + "Status code name has string OK": true, + "id should be api.content.create": true, + "ver should be 4.0": true, + "Params has keys: resmsgid , msgid , err , status , errmsg ": true, + "Status is successful": true, + "ResponseCode is OK": true, + "Result has keys: identifier , node_id , versionKey": true + } + ] + }, + { + "id": "5d8cd160-7d8d-48e4-b5d2-1c0be422cdfa", + "name": "Create content with Special character in name", + "url": "http://20.207.120.49/content/v4/create", + "time": 200, + "responseCode": { + "code": 200, + "name": "OK" + }, + "tests": { + "Status code is 200": true, + "Status code name has string OK": true, + "id should be api.content.create": true, + "ver should be 4.0": true, + "Params has keys: resmsgid , msgid , err , status , errmsg ": true, + "Status is successful": true, + "ResponseCode is OK": true, + "Result has keys: identifier , node_id , versionKey": true + }, + "testPassFailCounts": { + "Status code is 200": { + "pass": 1, + "fail": 0 + }, + "Status code name has string OK": { + "pass": 1, + "fail": 0 + }, + "id should be api.content.create": { + "pass": 1, + "fail": 0 + }, + "ver should be 4.0": { + "pass": 1, + "fail": 0 + }, + "Params has keys: resmsgid , msgid , err , status , errmsg ": { + "pass": 1, + "fail": 0 + }, + "Status is successful": { + "pass": 1, + "fail": 0 + }, + "ResponseCode is OK": { + "pass": 1, + "fail": 0 + }, + "Result has keys: identifier , node_id , versionKey": { + "pass": 1, + "fail": 0 + } + }, + "times": [ + 200 + ], + "allTests": [ + { + "Status code is 200": true, + "Status code name has string OK": true, + "id should be api.content.create": true, + "ver should be 4.0": true, + "Params has keys: resmsgid , msgid , err , status , errmsg ": true, + "Status is successful": true, + "ResponseCode is OK": true, + "Result has keys: identifier , node_id , versionKey": true + } + ] + }, + { + "id": "59bb505f-7868-4ab8-9e7b-81e47815c2c8", + "name": "Create content with missing channel", + "url": "http://20.207.120.49/content/v4/create", + "time": 79, + "responseCode": { + "code": 400, + "name": "Bad Request" + }, + "tests": { + "Status code is 400": true, + "id should be api.content.create": true, + "ver should be 4.0": true, + "Params has keys: resmsgid , msgid , err , status , errmsg ": true, + "Verify keys and data type of the response result": true, + "responseCode should be \"CLIENT_ERROR\"": true, + "params.err should be \"CLIENT_ERROR\"": true, + "params.errmsg should be \"Validation Errors\"": true, + "result body should include messages \"Required Metadata channel not set\"": true, + "Status code name has string \"Bad Request\"": true + }, + "testPassFailCounts": { + "Status code is 400": { + "pass": 1, + "fail": 0 + }, + "id should be api.content.create": { + "pass": 1, + "fail": 0 + }, + "ver should be 4.0": { + "pass": 1, + "fail": 0 + }, + "Params has keys: resmsgid , msgid , err , status , errmsg ": { + "pass": 1, + "fail": 0 + }, + "Verify keys and data type of the response result": { + "pass": 1, + "fail": 0 + }, + "responseCode should be \"CLIENT_ERROR\"": { + "pass": 1, + "fail": 0 + }, + "params.err should be \"CLIENT_ERROR\"": { + "pass": 1, + "fail": 0 + }, + "params.errmsg should be \"Validation Errors\"": { + "pass": 1, + "fail": 0 + }, + "result body should include messages \"Required Metadata channel not set\"": { + "pass": 1, + "fail": 0 + }, + "Status code name has string \"Bad Request\"": { + "pass": 1, + "fail": 0 + } + }, + "times": [ + 79 + ], + "allTests": [ + { + "Status code is 400": true, + "id should be api.content.create": true, + "ver should be 4.0": true, + "Params has keys: resmsgid , msgid , err , status , errmsg ": true, + "Verify keys and data type of the response result": true, + "responseCode should be \"CLIENT_ERROR\"": true, + "params.err should be \"CLIENT_ERROR\"": true, + "params.errmsg should be \"Validation Errors\"": true, + "result body should include messages \"Required Metadata channel not set\"": true, + "Status code name has string \"Bad Request\"": true + } + ] + }, + { + "id": "540ca9e4-56fe-4b10-b18b-b9950b15ec03", + "name": "Create content with empty channel", + "url": "http://20.207.120.49/content/v4/create", + "time": 90, + "responseCode": { + "code": 400, + "name": "Bad Request" + }, + "tests": { + "Status code is 400": true, + "id should be api.content.create": true, + "ver should be 4.0": true, + "Params has keys: resmsgid , msgid , err , status , errmsg ": true, + "Verify keys and data type of the response result": true, + "responseCode should be \"CLIENT_ERROR\"": true, + "params.err should be \"CLIENT_ERROR\"": true, + "params.errmsg should be \"Validation Errors\"": true, + "result body should include messages \"Required Metadata channel not set\"": true, + "Status code name has string \"Bad Request\"": true + }, + "testPassFailCounts": { + "Status code is 400": { + "pass": 1, + "fail": 0 + }, + "id should be api.content.create": { + "pass": 1, + "fail": 0 + }, + "ver should be 4.0": { + "pass": 1, + "fail": 0 + }, + "Params has keys: resmsgid , msgid , err , status , errmsg ": { + "pass": 1, + "fail": 0 + }, + "Verify keys and data type of the response result": { + "pass": 1, + "fail": 0 + }, + "responseCode should be \"CLIENT_ERROR\"": { + "pass": 1, + "fail": 0 + }, + "params.err should be \"CLIENT_ERROR\"": { + "pass": 1, + "fail": 0 + }, + "params.errmsg should be \"Validation Errors\"": { + "pass": 1, + "fail": 0 + }, + "result body should include messages \"Required Metadata channel not set\"": { + "pass": 1, + "fail": 0 + }, + "Status code name has string \"Bad Request\"": { + "pass": 1, + "fail": 0 + } + }, + "times": [ + 90 + ], + "allTests": [ + { + "Status code is 400": true, + "id should be api.content.create": true, + "ver should be 4.0": true, + "Params has keys: resmsgid , msgid , err , status , errmsg ": true, + "Verify keys and data type of the response result": true, + "responseCode should be \"CLIENT_ERROR\"": true, + "params.err should be \"CLIENT_ERROR\"": true, + "params.errmsg should be \"Validation Errors\"": true, + "result body should include messages \"Required Metadata channel not set\"": true, + "Status code name has string \"Bad Request\"": true + } + ] + }, + { + "id": "f49a6769-b1d0-417b-abd4-ae6430e738df", + "name": "Create content with missing name", + "url": "http://20.207.120.49/content/v4/create", + "time": 81, + "responseCode": { + "code": 400, + "name": "Bad Request" + }, + "tests": { + "Status code is 400": true, + "id should be api.content.create": true, + "ver should be 4.0": true, + "Params has keys: resmsgid , msgid , err , status , errmsg ": true, + "Verify keys and data type of the response result": true, + "responseCode should be \"CLIENT_ERROR\"": true, + "params.err should be \"CLIENT_ERROR\"": true, + "params.errmsg should be \"Validation Errors\"": true, + "result body should include messages \"Required Metadata name not set\"": true, + "Status code name has string \"Bad Request\"": true + }, + "testPassFailCounts": { + "Status code is 400": { + "pass": 1, + "fail": 0 + }, + "id should be api.content.create": { + "pass": 1, + "fail": 0 + }, + "ver should be 4.0": { + "pass": 1, + "fail": 0 + }, + "Params has keys: resmsgid , msgid , err , status , errmsg ": { + "pass": 1, + "fail": 0 + }, + "Verify keys and data type of the response result": { + "pass": 1, + "fail": 0 + }, + "responseCode should be \"CLIENT_ERROR\"": { + "pass": 1, + "fail": 0 + }, + "params.err should be \"CLIENT_ERROR\"": { + "pass": 1, + "fail": 0 + }, + "params.errmsg should be \"Validation Errors\"": { + "pass": 1, + "fail": 0 + }, + "result body should include messages \"Required Metadata name not set\"": { + "pass": 1, + "fail": 0 + }, + "Status code name has string \"Bad Request\"": { + "pass": 1, + "fail": 0 + } + }, + "times": [ + 81 + ], + "allTests": [ + { + "Status code is 400": true, + "id should be api.content.create": true, + "ver should be 4.0": true, + "Params has keys: resmsgid , msgid , err , status , errmsg ": true, + "Verify keys and data type of the response result": true, + "responseCode should be \"CLIENT_ERROR\"": true, + "params.err should be \"CLIENT_ERROR\"": true, + "params.errmsg should be \"Validation Errors\"": true, + "result body should include messages \"Required Metadata name not set\"": true, + "Status code name has string \"Bad Request\"": true + } + ] + }, + { + "id": "cee864fa-a405-4b52-ade5-9160b6bc0f2c", + "name": "Create content with name: invalid datatype", + "url": "http://20.207.120.49/content/v4/create", + "time": 139, + "responseCode": { + "code": 400, + "name": "Bad Request" + }, + "tests": { + "Status code is 400": true, + "id should be api.content.create": true, + "ver should be 4.0": true, + "Params has keys: resmsgid , msgid , err , status , errmsg ": true, + "Verify keys and data type of the response result": true, + "responseCode should be \"CLIENT_ERROR\"": true, + "params.err should be \"CLIENT_ERROR\"": true, + "params.errmsg should be \"Validation Errors\"": true, + "result body should include messages \"Metadata name should be a/an String value\"": true, + "Status code name has string \"Bad Request\"": true + }, + "testPassFailCounts": { + "Status code is 400": { + "pass": 1, + "fail": 0 + }, + "id should be api.content.create": { + "pass": 1, + "fail": 0 + }, + "ver should be 4.0": { + "pass": 1, + "fail": 0 + }, + "Params has keys: resmsgid , msgid , err , status , errmsg ": { + "pass": 1, + "fail": 0 + }, + "Verify keys and data type of the response result": { + "pass": 1, + "fail": 0 + }, + "responseCode should be \"CLIENT_ERROR\"": { + "pass": 1, + "fail": 0 + }, + "params.err should be \"CLIENT_ERROR\"": { + "pass": 1, + "fail": 0 + }, + "params.errmsg should be \"Validation Errors\"": { + "pass": 1, + "fail": 0 + }, + "result body should include messages \"Metadata name should be a/an String value\"": { + "pass": 1, + "fail": 0 + }, + "Status code name has string \"Bad Request\"": { + "pass": 1, + "fail": 0 + } + }, + "times": [ + 139 + ], + "allTests": [ + { + "Status code is 400": true, + "id should be api.content.create": true, + "ver should be 4.0": true, + "Params has keys: resmsgid , msgid , err , status , errmsg ": true, + "Verify keys and data type of the response result": true, + "responseCode should be \"CLIENT_ERROR\"": true, + "params.err should be \"CLIENT_ERROR\"": true, + "params.errmsg should be \"Validation Errors\"": true, + "result body should include messages \"Metadata name should be a/an String value\"": true, + "Status code name has string \"Bad Request\"": true + } + ] + }, + { + "id": "a02d4ea1-b38b-49a6-9a79-a17fbf73554a", + "name": "Create content with name empty", + "url": "http://20.207.120.49/content/v4/create", + "time": 72, + "responseCode": { + "code": 400, + "name": "Bad Request" + }, + "tests": { + "Status code is 400": true, + "id should be api.content.create": true, + "ver should be 4.0": true, + "Params has keys: resmsgid , msgid , err , status , errmsg ": true, + "Verify keys and data type of the response result": true, + "responseCode should be \"CLIENT_ERROR\"": true, + "params.err should be \"CLIENT_ERROR\"": true, + "params.errmsg should be \"Validation Errors\"": true, + "result body should include messages \"Required Metadata name not set\"": true, + "Status code name has string \"Bad Request\"": true + }, + "testPassFailCounts": { + "Status code is 400": { + "pass": 1, + "fail": 0 + }, + "id should be api.content.create": { + "pass": 1, + "fail": 0 + }, + "ver should be 4.0": { + "pass": 1, + "fail": 0 + }, + "Params has keys: resmsgid , msgid , err , status , errmsg ": { + "pass": 1, + "fail": 0 + }, + "Verify keys and data type of the response result": { + "pass": 1, + "fail": 0 + }, + "responseCode should be \"CLIENT_ERROR\"": { + "pass": 1, + "fail": 0 + }, + "params.err should be \"CLIENT_ERROR\"": { + "pass": 1, + "fail": 0 + }, + "params.errmsg should be \"Validation Errors\"": { + "pass": 1, + "fail": 0 + }, + "result body should include messages \"Required Metadata name not set\"": { + "pass": 1, + "fail": 0 + }, + "Status code name has string \"Bad Request\"": { + "pass": 1, + "fail": 0 + } + }, + "times": [ + 72 + ], + "allTests": [ + { + "Status code is 400": true, + "id should be api.content.create": true, + "ver should be 4.0": true, + "Params has keys: resmsgid , msgid , err , status , errmsg ": true, + "Verify keys and data type of the response result": true, + "responseCode should be \"CLIENT_ERROR\"": true, + "params.err should be \"CLIENT_ERROR\"": true, + "params.errmsg should be \"Validation Errors\"": true, + "result body should include messages \"Required Metadata name not set\"": true, + "Status code name has string \"Bad Request\"": true + } + ] + }, + { + "id": "07d3cb60-e883-40ce-a0b6-d187e70a64be", + "name": "Create content with missing code", + "url": "http://20.207.120.49/content/v4/create", + "time": 77, + "responseCode": { + "code": 400, + "name": "Bad Request" + }, + "tests": { + "Status code is 400": true, + "id should be api.content.create": true, + "ver should be 4.0": true, + "Params has keys: resmsgid , msgid , err , status , errmsg ": true, + "Verify keys and data type of the response result": true, + "responseCode should be \"CLIENT_ERROR\"": true, + "params.err should be \"CLIENT_ERROR\"": true, + "params.errmsg should be \"Validation Errors\"": true, + "result body should include messages \"Required Metadata code not set\"": true, + "Status code name has string \"Bad Request\"": true + }, + "testPassFailCounts": { + "Status code is 400": { + "pass": 1, + "fail": 0 + }, + "id should be api.content.create": { + "pass": 1, + "fail": 0 + }, + "ver should be 4.0": { + "pass": 1, + "fail": 0 + }, + "Params has keys: resmsgid , msgid , err , status , errmsg ": { + "pass": 1, + "fail": 0 + }, + "Verify keys and data type of the response result": { + "pass": 1, + "fail": 0 + }, + "responseCode should be \"CLIENT_ERROR\"": { + "pass": 1, + "fail": 0 + }, + "params.err should be \"CLIENT_ERROR\"": { + "pass": 1, + "fail": 0 + }, + "params.errmsg should be \"Validation Errors\"": { + "pass": 1, + "fail": 0 + }, + "result body should include messages \"Required Metadata code not set\"": { + "pass": 1, + "fail": 0 + }, + "Status code name has string \"Bad Request\"": { + "pass": 1, + "fail": 0 + } + }, + "times": [ + 77 + ], + "allTests": [ + { + "Status code is 400": true, + "id should be api.content.create": true, + "ver should be 4.0": true, + "Params has keys: resmsgid , msgid , err , status , errmsg ": true, + "Verify keys and data type of the response result": true, + "responseCode should be \"CLIENT_ERROR\"": true, + "params.err should be \"CLIENT_ERROR\"": true, + "params.errmsg should be \"Validation Errors\"": true, + "result body should include messages \"Required Metadata code not set\"": true, + "Status code name has string \"Bad Request\"": true + } + ] + }, + { + "id": "e8ad383b-903b-4a5e-8f5d-ae8f32cc2a6f", + "name": "Create content with missing mimeType", + "url": "http://20.207.120.49/content/v4/create", + "time": 124, + "responseCode": { + "code": 400, + "name": "Bad Request" + }, + "tests": { + "Status code is 400": true, + "id should be api.content.create": true, + "ver should be 4.0": true, + "Params has keys: resmsgid , msgid , err , status , errmsg ": true, + "Verify keys and data type of the response result": true, + "responseCode should be \"CLIENT_ERROR\"": true, + "params.err should be \"CLIENT_ERROR\"": true, + "params.errmsg should be \"Validation Errors\"": true, + "result body should include messages \"Required Metadata mimeType not set\"": true, + "Status code name has string \"Bad Request\"": true + }, + "testPassFailCounts": { + "Status code is 400": { + "pass": 1, + "fail": 0 + }, + "id should be api.content.create": { + "pass": 1, + "fail": 0 + }, + "ver should be 4.0": { + "pass": 1, + "fail": 0 + }, + "Params has keys: resmsgid , msgid , err , status , errmsg ": { + "pass": 1, + "fail": 0 + }, + "Verify keys and data type of the response result": { + "pass": 1, + "fail": 0 + }, + "responseCode should be \"CLIENT_ERROR\"": { + "pass": 1, + "fail": 0 + }, + "params.err should be \"CLIENT_ERROR\"": { + "pass": 1, + "fail": 0 + }, + "params.errmsg should be \"Validation Errors\"": { + "pass": 1, + "fail": 0 + }, + "result body should include messages \"Required Metadata mimeType not set\"": { + "pass": 1, + "fail": 0 + }, + "Status code name has string \"Bad Request\"": { + "pass": 1, + "fail": 0 + } + }, + "times": [ + 124 + ], + "allTests": [ + { + "Status code is 400": true, + "id should be api.content.create": true, + "ver should be 4.0": true, + "Params has keys: resmsgid , msgid , err , status , errmsg ": true, + "Verify keys and data type of the response result": true, + "responseCode should be \"CLIENT_ERROR\"": true, + "params.err should be \"CLIENT_ERROR\"": true, + "params.errmsg should be \"Validation Errors\"": true, + "result body should include messages \"Required Metadata mimeType not set\"": true, + "Status code name has string \"Bad Request\"": true + } + ] + }, + { + "id": "37ba844e-63fa-43cb-9a6e-c126eb783508", + "name": "Create content with invalid mimeType", + "url": "http://20.207.120.49/content/v4/create", + "time": 118, + "responseCode": { + "code": 400, + "name": "Bad Request" + }, + "tests": { + "Status code is 400": true, + "id should be api.content.create": true, + "ver should be 4.0": true, + "Params has keys: resmsgid , msgid , err , status , errmsg ": true, + "Verify keys and data type of the response result": true, + "responseCode should be \"CLIENT_ERROR\"": true, + "params.err should be \"CLIENT_ERROR\"": true, + "params.errmsg should be \"Validation Errors\"": true, + "result body should include messages \"Metadata mimeType should be one of: [application/vnd.ekstep.ecml-archive, application/vnd.ekstep.html-archive, application/vnd.android.package-archive, application/vnd.ekstep.content-archive, application/vnd.ekstep.content-collection, application/vnd.ekstep.plugin-archive, application/vnd.ekstep.h5p-archive, application/epub, text/x-url, video/x-youtube, application/octet-stream, application/msword, application/pdf, image/jpeg, image/jpg, image/png, image/tiff, image/bmp, image/gif, image/svg+xml, video/avi, video/mpeg, video/quicktime, video/3gpp, video/mp4, video/ogg, video/webm, audio/mp3, audio/mp4, audio/mpeg, audio/ogg, audio/webm, audio/x-wav, audio/wav, application/json, application/quiz]\"": true, + "Status code name has string \"Bad Request\"": true + }, + "testPassFailCounts": { + "Status code is 400": { + "pass": 1, + "fail": 0 + }, + "id should be api.content.create": { + "pass": 1, + "fail": 0 + }, + "ver should be 4.0": { + "pass": 1, + "fail": 0 + }, + "Params has keys: resmsgid , msgid , err , status , errmsg ": { + "pass": 1, + "fail": 0 + }, + "Verify keys and data type of the response result": { + "pass": 1, + "fail": 0 + }, + "responseCode should be \"CLIENT_ERROR\"": { + "pass": 1, + "fail": 0 + }, + "params.err should be \"CLIENT_ERROR\"": { + "pass": 1, + "fail": 0 + }, + "params.errmsg should be \"Validation Errors\"": { + "pass": 1, + "fail": 0 + }, + "result body should include messages \"Metadata mimeType should be one of: [application/vnd.ekstep.ecml-archive, application/vnd.ekstep.html-archive, application/vnd.android.package-archive, application/vnd.ekstep.content-archive, application/vnd.ekstep.content-collection, application/vnd.ekstep.plugin-archive, application/vnd.ekstep.h5p-archive, application/epub, text/x-url, video/x-youtube, application/octet-stream, application/msword, application/pdf, image/jpeg, image/jpg, image/png, image/tiff, image/bmp, image/gif, image/svg+xml, video/avi, video/mpeg, video/quicktime, video/3gpp, video/mp4, video/ogg, video/webm, audio/mp3, audio/mp4, audio/mpeg, audio/ogg, audio/webm, audio/x-wav, audio/wav, application/json, application/quiz]\"": { + "pass": 1, + "fail": 0 + }, + "Status code name has string \"Bad Request\"": { + "pass": 1, + "fail": 0 + } + }, + "times": [ + 118 + ], + "allTests": [ + { + "Status code is 400": true, + "id should be api.content.create": true, + "ver should be 4.0": true, + "Params has keys: resmsgid , msgid , err , status , errmsg ": true, + "Verify keys and data type of the response result": true, + "responseCode should be \"CLIENT_ERROR\"": true, + "params.err should be \"CLIENT_ERROR\"": true, + "params.errmsg should be \"Validation Errors\"": true, + "result body should include messages \"Metadata mimeType should be one of: [application/vnd.ekstep.ecml-archive, application/vnd.ekstep.html-archive, application/vnd.android.package-archive, application/vnd.ekstep.content-archive, application/vnd.ekstep.content-collection, application/vnd.ekstep.plugin-archive, application/vnd.ekstep.h5p-archive, application/epub, text/x-url, video/x-youtube, application/octet-stream, application/msword, application/pdf, image/jpeg, image/jpg, image/png, image/tiff, image/bmp, image/gif, image/svg+xml, video/avi, video/mpeg, video/quicktime, video/3gpp, video/mp4, video/ogg, video/webm, audio/mp3, audio/mp4, audio/mpeg, audio/ogg, audio/webm, audio/x-wav, audio/wav, application/json, application/quiz]\"": true, + "Status code name has string \"Bad Request\"": true + } + ] + }, + { + "id": "684c3d80-d6ae-45d5-9ff0-61f4477546e6", + "name": "Create content with primaryCategory", + "url": "http://20.207.120.49/content/v4/create", + "time": 93, + "responseCode": { + "code": 400, + "name": "Bad Request" + }, + "tests": { + "Status code is 400": true, + "id should be api.content.create": true, + "ver should be 4.0": true, + "Params has keys: resmsgid , msgid , err , status , errmsg ": true, + "Verify keys and data type of the response result": true, + "responseCode should be \"CLIENT_ERROR\"": true, + "params.err should be \"VALIDATION_ERROR\"": true, + "params.errmsg should be \"primaryCategory is a mandatory parameter\"": true, + "result body should be empty": true, + "Status code name has string \"Bad Request\"": true + }, + "testPassFailCounts": { + "Status code is 400": { + "pass": 1, + "fail": 0 + }, + "id should be api.content.create": { + "pass": 1, + "fail": 0 + }, + "ver should be 4.0": { + "pass": 1, + "fail": 0 + }, + "Params has keys: resmsgid , msgid , err , status , errmsg ": { + "pass": 1, + "fail": 0 + }, + "Verify keys and data type of the response result": { + "pass": 1, + "fail": 0 + }, + "responseCode should be \"CLIENT_ERROR\"": { + "pass": 1, + "fail": 0 + }, + "params.err should be \"VALIDATION_ERROR\"": { + "pass": 1, + "fail": 0 + }, + "params.errmsg should be \"primaryCategory is a mandatory parameter\"": { + "pass": 1, + "fail": 0 + }, + "result body should be empty": { + "pass": 1, + "fail": 0 + }, + "Status code name has string \"Bad Request\"": { + "pass": 1, + "fail": 0 + } + }, + "times": [ + 93 + ], + "allTests": [ + { + "Status code is 400": true, + "id should be api.content.create": true, + "ver should be 4.0": true, + "Params has keys: resmsgid , msgid , err , status , errmsg ": true, + "Verify keys and data type of the response result": true, + "responseCode should be \"CLIENT_ERROR\"": true, + "params.err should be \"VALIDATION_ERROR\"": true, + "params.errmsg should be \"primaryCategory is a mandatory parameter\"": true, + "result body should be empty": true, + "Status code name has string \"Bad Request\"": true + } + ] + }, + { + "id": "e7b12704-f8fa-4519-94a8-74c05e81ab55", + "name": "Create content with Invalid subject", + "url": "http://20.207.120.49/content/v4/create", + "time": 81, + "responseCode": { + "code": 400, + "name": "Bad Request" + }, + "tests": { + "Status code is 400": true, + "id should be api.content.create": true, + "ver should be 4.0": true, + "Params has keys: resmsgid , msgid , err , status , errmsg ": true, + "Verify keys and data type of the response result": true, + "responseCode should be \"CLIENT_ERROR\"": true, + "params.err should be \"CLIENT_ERROR\"": true, + "params.errmsg should be \"Validation Errors.\"": true, + "result body should include messages \"subject range data is empty from the given framework.\"": true, + "Status code name has string \"Bad Request\"": true + }, + "testPassFailCounts": { + "Status code is 400": { + "pass": 1, + "fail": 0 + }, + "id should be api.content.create": { + "pass": 1, + "fail": 0 + }, + "ver should be 4.0": { + "pass": 1, + "fail": 0 + }, + "Params has keys: resmsgid , msgid , err , status , errmsg ": { + "pass": 1, + "fail": 0 + }, + "Verify keys and data type of the response result": { + "pass": 1, + "fail": 0 + }, + "responseCode should be \"CLIENT_ERROR\"": { + "pass": 1, + "fail": 0 + }, + "params.err should be \"CLIENT_ERROR\"": { + "pass": 1, + "fail": 0 + }, + "params.errmsg should be \"Validation Errors.\"": { + "pass": 1, + "fail": 0 + }, + "result body should include messages \"subject range data is empty from the given framework.\"": { + "pass": 1, + "fail": 0 + }, + "Status code name has string \"Bad Request\"": { + "pass": 1, + "fail": 0 + } + }, + "times": [ + 81 + ], + "allTests": [ + { + "Status code is 400": true, + "id should be api.content.create": true, + "ver should be 4.0": true, + "Params has keys: resmsgid , msgid , err , status , errmsg ": true, + "Verify keys and data type of the response result": true, + "responseCode should be \"CLIENT_ERROR\"": true, + "params.err should be \"CLIENT_ERROR\"": true, + "params.errmsg should be \"Validation Errors.\"": true, + "result body should include messages \"subject range data is empty from the given framework.\"": true, + "Status code name has string \"Bad Request\"": true + } + ] + }, + { + "id": "0eb6396c-43b8-427f-aaec-cf4439dd5689", + "name": "Create content with Invalid primaryCategory", + "url": "http://20.207.120.49/content/v4/create", + "time": 126, + "responseCode": { + "code": 404, + "name": "Not Found" + }, + "tests": { + "Status code is 404": true, + "id should be api.content.create": true, + "ver should be 4.0": true, + "Params has keys: resmsgid , msgid , err , status , errmsg ": true, + "Verify keys and data type of the response result": true, + "responseCode should be RESOURCE_NOT_FOUND": true, + "params.err should be \"404\"": true, + "params.errmsg should be \"Entry is not found in cassandra for content with identifier:: obj-cat:aabaa_content_all {}\"": true, + "messages should be null": true, + "Status code name has string \"Not Found\"": true + }, + "testPassFailCounts": { + "Status code is 404": { + "pass": 1, + "fail": 0 + }, + "id should be api.content.create": { + "pass": 1, + "fail": 0 + }, + "ver should be 4.0": { + "pass": 1, + "fail": 0 + }, + "Params has keys: resmsgid , msgid , err , status , errmsg ": { + "pass": 1, + "fail": 0 + }, + "Verify keys and data type of the response result": { + "pass": 1, + "fail": 0 + }, + "responseCode should be RESOURCE_NOT_FOUND": { + "pass": 1, + "fail": 0 + }, + "params.err should be \"404\"": { + "pass": 1, + "fail": 0 + }, + "params.errmsg should be \"Entry is not found in cassandra for content with identifier:: obj-cat:aabaa_content_all {}\"": { + "pass": 1, + "fail": 0 + }, + "messages should be null": { + "pass": 1, + "fail": 0 + }, + "Status code name has string \"Not Found\"": { + "pass": 1, + "fail": 0 + } + }, + "times": [ + 126 + ], + "allTests": [ + { + "Status code is 404": true, + "id should be api.content.create": true, + "ver should be 4.0": true, + "Params has keys: resmsgid , msgid , err , status , errmsg ": true, + "Verify keys and data type of the response result": true, + "responseCode should be RESOURCE_NOT_FOUND": true, + "params.err should be \"404\"": true, + "params.errmsg should be \"Entry is not found in cassandra for content with identifier:: obj-cat:aabaa_content_all {}\"": true, + "messages should be null": true, + "Status code name has string \"Not Found\"": true + } + ] + }, + { + "id": "9c3e71db-a08e-4bbb-aec9-225df9e91b73", + "name": "Create content which already exists", + "url": "http://20.207.120.49/content/v4/create", + "time": 106, + "responseCode": { + "code": 400, + "name": "Bad Request" + }, + "tests": { + "Status code is 400": true, + "Status code name has string Bad Request": true, + "id should be api.content.create": true, + "ver should be 4.0": true, + "Params has keys: resmsgid , msgid , err , status , errmsg ": true, + "err is CONSTRAINT_VALIDATION_FAILED": true, + "errmsg: Object already exists with identifier: some_identifier07": true, + "Status is failed": true, + "ResponseCode is CLIENT_ERROR": true + }, + "testPassFailCounts": { + "Status code is 400": { + "pass": 1, + "fail": 0 + }, + "Status code name has string Bad Request": { + "pass": 1, + "fail": 0 + }, + "id should be api.content.create": { + "pass": 1, + "fail": 0 + }, + "ver should be 4.0": { + "pass": 1, + "fail": 0 + }, + "Params has keys: resmsgid , msgid , err , status , errmsg ": { + "pass": 1, + "fail": 0 + }, + "err is CONSTRAINT_VALIDATION_FAILED": { + "pass": 1, + "fail": 0 + }, + "errmsg: Object already exists with identifier: some_identifier07": { + "pass": 1, + "fail": 0 + }, + "Status is failed": { + "pass": 1, + "fail": 0 + }, + "ResponseCode is CLIENT_ERROR": { + "pass": 1, + "fail": 0 + } + }, + "times": [ + 106 + ], + "allTests": [ + { + "Status code is 400": true, + "Status code name has string Bad Request": true, + "id should be api.content.create": true, + "ver should be 4.0": true, + "Params has keys: resmsgid , msgid , err , status , errmsg ": true, + "err is CONSTRAINT_VALIDATION_FAILED": true, + "errmsg: Object already exists with identifier: some_identifier07": true, + "Status is failed": true, + "ResponseCode is CLIENT_ERROR": true + } + ] + }, + { + "id": "c59ba53c-cfb6-46bf-bdaa-aca28f3380ac", + "name": "Create Content", + "url": "http://20.207.120.49/content/v4/create", + "time": 110, + "responseCode": { + "code": 200, + "name": "OK" + }, + "tests": {}, + "testPassFailCounts": {}, + "times": [ + 110 + ], + "allTests": [ + {} + ] + }, + { + "id": "c6da426a-cfec-4535-a8ec-baa2d837f3b6", + "name": "Create Content", + "url": "http://20.207.120.49/content/v4/create", + "time": 100, + "responseCode": { + "code": 200, + "name": "OK" + }, + "tests": {}, + "testPassFailCounts": {}, + "times": [ + 100 + ], + "allTests": [ + {} + ] + }, + { + "id": "6f1b65ae-d56f-4bd2-9f44-28a1b690ca92", + "name": "Create Content for invalid primaryCategory", + "url": "http://20.207.120.49/content/v4/create", + "time": 121, + "responseCode": { + "code": 200, + "name": "OK" + }, + "tests": {}, + "testPassFailCounts": {}, + "times": [ + 121 + ], + "allTests": [ + {} + ] + }, + { + "id": "ad83e2ed-019c-4cf6-ad27-ab2719e6d6fa", + "name": "Update existing data or add new data", + "url": "http://20.207.120.49/content/v4/update/do_2139669882303037441182", + "time": 135, + "responseCode": { + "code": 200, + "name": "OK" + }, + "tests": { + "Status code is 200": true, + "Status code name has string OK": true, + "id should be api.content.update": true, + "ver should be 4.0": true, + "Params has keys: resmsgid , msgid , err , status , errmsg ": true, + "Status is successful": true, + "ResponseCode is OK": true, + "Result has keys: identifier , node_id , versionKey": true, + "identifier should be equal to do_2139669882303037441182": true, + "node_id should be equal to do_2139669882303037441182": true + }, + "testPassFailCounts": { + "Status code is 200": { + "pass": 1, + "fail": 0 + }, + "Status code name has string OK": { + "pass": 1, + "fail": 0 + }, + "id should be api.content.update": { + "pass": 1, + "fail": 0 + }, + "ver should be 4.0": { + "pass": 1, + "fail": 0 + }, + "Params has keys: resmsgid , msgid , err , status , errmsg ": { + "pass": 1, + "fail": 0 + }, + "Status is successful": { + "pass": 1, + "fail": 0 + }, + "ResponseCode is OK": { + "pass": 1, + "fail": 0 + }, + "Result has keys: identifier , node_id , versionKey": { + "pass": 1, + "fail": 0 + }, + "identifier should be equal to do_2139669882303037441182": { + "pass": 1, + "fail": 0 + }, + "node_id should be equal to do_2139669882303037441182": { + "pass": 1, + "fail": 0 + } + }, + "times": [ + 135 + ], + "allTests": [ + { + "Status code is 200": true, + "Status code name has string OK": true, + "id should be api.content.update": true, + "ver should be 4.0": true, + "Params has keys: resmsgid , msgid , err , status , errmsg ": true, + "Status is successful": true, + "ResponseCode is OK": true, + "Result has keys: identifier , node_id , versionKey": true, + "identifier should be equal to do_2139669882303037441182": true, + "node_id should be equal to do_2139669882303037441182": true + } + ] + }, + { + "id": "4c302c74-b349-4f58-b08f-48b90c4010a9", + "name": "Update special character in name", + "url": "http://20.207.120.49/content/v4/update/do_2139669882318028801183", + "time": 145, + "responseCode": { + "code": 200, + "name": "OK" + }, + "tests": { + "Verify keys and data type of the response result": true, + "id should be api.content.update": true, + "ver should be 4.0": true, + "Result has keys: identifier , node_id , versionKey": true, + "identifier should be equal to do_2139669882318028801183": true, + "node_id should be equal to do_2139669882318028801183": true + }, + "testPassFailCounts": { + "Verify keys and data type of the response result": { + "pass": 1, + "fail": 0 + }, + "id should be api.content.update": { + "pass": 1, + "fail": 0 + }, + "ver should be 4.0": { + "pass": 1, + "fail": 0 + }, + "Result has keys: identifier , node_id , versionKey": { + "pass": 1, + "fail": 0 + }, + "identifier should be equal to do_2139669882318028801183": { + "pass": 1, + "fail": 0 + }, + "node_id should be equal to do_2139669882318028801183": { + "pass": 1, + "fail": 0 + } + }, + "times": [ + 145 + ], + "allTests": [ + { + "Verify keys and data type of the response result": true, + "id should be api.content.update": true, + "ver should be 4.0": true, + "Result has keys: identifier , node_id , versionKey": true, + "identifier should be equal to do_2139669882318028801183": true, + "node_id should be equal to do_2139669882318028801183": true + } + ] + }, + { + "id": "ad37ce29-bb18-494c-b03f-820743f4d02e", + "name": "Update content Invalid versionKey", + "url": "http://20.207.120.49/content/v4/update/do_2139669882303037441182", + "time": 80, + "responseCode": { + "code": 400, + "name": "Bad Request" + }, + "tests": { + "Status code is 400": true, + "id should be api.content.update": true, + "Params has keys: resmsgid , msgid , err , status , errmsg ": true, + "ver should be 4.0": true, + "Content-Encoding header should not present": true, + "Verify keys and data type of the response result": true, + "responseCode should be CLIENT_ERROR": true, + "params.err should be CLIENT_ERROR": true, + "params.status should be failed": true, + "params.errmsg should be \"Invalid version Key\"": true, + "messages should be null": true, + "Status code name has string Bad Request": true + }, + "testPassFailCounts": { + "Status code is 400": { + "pass": 1, + "fail": 0 + }, + "id should be api.content.update": { + "pass": 1, + "fail": 0 + }, + "Params has keys: resmsgid , msgid , err , status , errmsg ": { + "pass": 1, + "fail": 0 + }, + "ver should be 4.0": { + "pass": 1, + "fail": 0 + }, + "Content-Encoding header should not present": { + "pass": 1, + "fail": 0 + }, + "Verify keys and data type of the response result": { + "pass": 1, + "fail": 0 + }, + "responseCode should be CLIENT_ERROR": { + "pass": 1, + "fail": 0 + }, + "params.err should be CLIENT_ERROR": { + "pass": 1, + "fail": 0 + }, + "params.status should be failed": { + "pass": 1, + "fail": 0 + }, + "params.errmsg should be \"Invalid version Key\"": { + "pass": 1, + "fail": 0 + }, + "messages should be null": { + "pass": 1, + "fail": 0 + }, + "Status code name has string Bad Request": { + "pass": 1, + "fail": 0 + } + }, + "times": [ + 80 + ], + "allTests": [ + { + "Status code is 400": true, + "id should be api.content.update": true, + "Params has keys: resmsgid , msgid , err , status , errmsg ": true, + "ver should be 4.0": true, + "Content-Encoding header should not present": true, + "Verify keys and data type of the response result": true, + "responseCode should be CLIENT_ERROR": true, + "params.err should be CLIENT_ERROR": true, + "params.status should be failed": true, + "params.errmsg should be \"Invalid version Key\"": true, + "messages should be null": true, + "Status code name has string Bad Request": true + } + ] + }, + { + "id": "cce4163f-828d-465d-9075-d2290bd5d4e3", + "name": "Update content with Empty name", + "url": "http://20.207.120.49/content/v4/update/do_2139669882303037441182", + "time": 92, + "responseCode": { + "code": 400, + "name": "Bad Request" + }, + "tests": { + "Status code is 400": true, + "ver should be 4.0": true, + "id should be api.content.update": true, + "Params has keys: resmsgid , msgid , err , status , errmsg ": true, + "Verify keys and data type of the response result": true, + "responseCode should be \"CLIENT_ERROR\"": true, + "params.err should be \"CLIENT_ERROR\"": true, + "params.errmsg should be \"Validation Errors\"": true, + "result body should include messages \"Required Metadata name not set\"": true, + "Status code name has string \"Bad Request\"": true + }, + "testPassFailCounts": { + "Status code is 400": { + "pass": 1, + "fail": 0 + }, + "ver should be 4.0": { + "pass": 1, + "fail": 0 + }, + "id should be api.content.update": { + "pass": 1, + "fail": 0 + }, + "Params has keys: resmsgid , msgid , err , status , errmsg ": { + "pass": 1, + "fail": 0 + }, + "Verify keys and data type of the response result": { + "pass": 1, + "fail": 0 + }, + "responseCode should be \"CLIENT_ERROR\"": { + "pass": 1, + "fail": 0 + }, + "params.err should be \"CLIENT_ERROR\"": { + "pass": 1, + "fail": 0 + }, + "params.errmsg should be \"Validation Errors\"": { + "pass": 1, + "fail": 0 + }, + "result body should include messages \"Required Metadata name not set\"": { + "pass": 1, + "fail": 0 + }, + "Status code name has string \"Bad Request\"": { + "pass": 1, + "fail": 0 + } + }, + "times": [ + 92 + ], + "allTests": [ + { + "Status code is 400": true, + "ver should be 4.0": true, + "id should be api.content.update": true, + "Params has keys: resmsgid , msgid , err , status , errmsg ": true, + "Verify keys and data type of the response result": true, + "responseCode should be \"CLIENT_ERROR\"": true, + "params.err should be \"CLIENT_ERROR\"": true, + "params.errmsg should be \"Validation Errors\"": true, + "result body should include messages \"Required Metadata name not set\"": true, + "Status code name has string \"Bad Request\"": true + } + ] + }, + { + "id": "fc71ffa7-b858-4933-9cbf-9e3301fe01fb", + "name": "Update content with Invalid content id", + "url": "http://20.207.120.49/content/v4/update/do_21357909972698726412211", + "time": 75, + "responseCode": { + "code": 404, + "name": "Not Found" + }, + "tests": { + "Status code is 404": true, + "ver should be 4.0": true, + "id should be api.content.update": true, + "Params has keys: resmsgid , msgid , err , status , errmsg ": true, + "Verify keys and data type of the response result": true, + "responseCode should be RESOURCE_NOT_FOUND": true, + "params.err should be NOT_FOUND": true, + "params.errmsg should be \"Error! Node(s) doesn't Exists. | [Invalid Node Id.]: do_21357909972698726412211\"": true, + "messages should be null": true, + "Status code name has string \"Not Found\"": true + }, + "testPassFailCounts": { + "Status code is 404": { + "pass": 1, + "fail": 0 + }, + "ver should be 4.0": { + "pass": 1, + "fail": 0 + }, + "id should be api.content.update": { + "pass": 1, + "fail": 0 + }, + "Params has keys: resmsgid , msgid , err , status , errmsg ": { + "pass": 1, + "fail": 0 + }, + "Verify keys and data type of the response result": { + "pass": 1, + "fail": 0 + }, + "responseCode should be RESOURCE_NOT_FOUND": { + "pass": 1, + "fail": 0 + }, + "params.err should be NOT_FOUND": { + "pass": 1, + "fail": 0 + }, + "params.errmsg should be \"Error! Node(s) doesn't Exists. | [Invalid Node Id.]: do_21357909972698726412211\"": { + "pass": 1, + "fail": 0 + }, + "messages should be null": { + "pass": 1, + "fail": 0 + }, + "Status code name has string \"Not Found\"": { + "pass": 1, + "fail": 0 + } + }, + "times": [ + 75 + ], + "allTests": [ + { + "Status code is 404": true, + "ver should be 4.0": true, + "id should be api.content.update": true, + "Params has keys: resmsgid , msgid , err , status , errmsg ": true, + "Verify keys and data type of the response result": true, + "responseCode should be RESOURCE_NOT_FOUND": true, + "params.err should be NOT_FOUND": true, + "params.errmsg should be \"Error! Node(s) doesn't Exists. | [Invalid Node Id.]: do_21357909972698726412211\"": true, + "messages should be null": true, + "Status code name has string \"Not Found\"": true + } + ] + }, + { + "id": "776e4fd6-a040-4820-85ff-4140fb062833", + "name": "Update content with Invalid primaryCategory", + "url": "http://20.207.120.49/content/v4/update/do_2139669882333921281184", + "time": 152, + "responseCode": { + "code": 404, + "name": "Not Found" + }, + "tests": { + "Status code is 404": true, + "ver should be 4.0": true, + "id should be api.content.update": true, + "Params has keys: resmsgid , msgid , err , status , errmsg ": true, + "Verify keys and data type of the response result": true, + "responseCode should be RESOURCE_NOT_FOUND": true, + "params.err should be \"404\"": true, + "params.status should be \"failed\"": true, + "params.errmsg should be \"Entry is not found in cassandra for content with identifier: obj-cat:abcd_content_all {}\"": true, + "messages should be null": true, + "Status code name has string \"Not Found\"": true + }, + "testPassFailCounts": { + "Status code is 404": { + "pass": 1, + "fail": 0 + }, + "ver should be 4.0": { + "pass": 1, + "fail": 0 + }, + "id should be api.content.update": { + "pass": 1, + "fail": 0 + }, + "Params has keys: resmsgid , msgid , err , status , errmsg ": { + "pass": 1, + "fail": 0 + }, + "Verify keys and data type of the response result": { + "pass": 1, + "fail": 0 + }, + "responseCode should be RESOURCE_NOT_FOUND": { + "pass": 1, + "fail": 0 + }, + "params.err should be \"404\"": { + "pass": 1, + "fail": 0 + }, + "params.status should be \"failed\"": { + "pass": 1, + "fail": 0 + }, + "params.errmsg should be \"Entry is not found in cassandra for content with identifier: obj-cat:abcd_content_all {}\"": { + "pass": 1, + "fail": 0 + }, + "messages should be null": { + "pass": 1, + "fail": 0 + }, + "Status code name has string \"Not Found\"": { + "pass": 1, + "fail": 0 + } + }, + "times": [ + 152 + ], + "allTests": [ + { + "Status code is 404": true, + "ver should be 4.0": true, + "id should be api.content.update": true, + "Params has keys: resmsgid , msgid , err , status , errmsg ": true, + "Verify keys and data type of the response result": true, + "responseCode should be RESOURCE_NOT_FOUND": true, + "params.err should be \"404\"": true, + "params.status should be \"failed\"": true, + "params.errmsg should be \"Entry is not found in cassandra for content with identifier: obj-cat:abcd_content_all {}\"": true, + "messages should be null": true, + "Status code name has string \"Not Found\"": true + } + ] + }, + { + "id": "9c358cd1-39a1-40ef-832a-5e58b061b586", + "name": "Create Content", + "url": "http://20.207.120.49/content/v4/create", + "time": 93, + "responseCode": { + "code": 200, + "name": "OK" + }, + "tests": {}, + "testPassFailCounts": {}, + "times": [ + 93 + ], + "allTests": [ + {} + ] + }, + { + "id": "ae9c5dba-9bbe-4fa7-9d77-b85bf7595e0f", + "name": "Read all data except external data", + "url": "http://20.207.120.49/content/v4/read/do_2139669882441318401185", + "time": 60, + "responseCode": { + "code": 200, + "name": "OK" + }, + "tests": { + "Verify keys and data type of the response result": true, + "Status code is 200": true, + "Status code name has string OK": true, + "id should be api.content.read": true, + "ver should be 4.0": true, + "identifier should be equal to do_2139669882441318401185": true, + "objectType should be Content": true, + "visibility should be Default": true, + "compatibilityLevel should be 1": true, + "status should be Draft": true + }, + "testPassFailCounts": { + "Verify keys and data type of the response result": { + "pass": 1, + "fail": 0 + }, + "Status code is 200": { + "pass": 1, + "fail": 0 + }, + "Status code name has string OK": { + "pass": 1, + "fail": 0 + }, + "id should be api.content.read": { + "pass": 1, + "fail": 0 + }, + "ver should be 4.0": { + "pass": 1, + "fail": 0 + }, + "identifier should be equal to do_2139669882441318401185": { + "pass": 1, + "fail": 0 + }, + "objectType should be Content": { + "pass": 1, + "fail": 0 + }, + "visibility should be Default": { + "pass": 1, + "fail": 0 + }, + "compatibilityLevel should be 1": { + "pass": 1, + "fail": 0 + }, + "status should be Draft": { + "pass": 1, + "fail": 0 + } + }, + "times": [ + 60 + ], + "allTests": [ + { + "Verify keys and data type of the response result": true, + "Status code is 200": true, + "Status code name has string OK": true, + "id should be api.content.read": true, + "ver should be 4.0": true, + "identifier should be equal to do_2139669882441318401185": true, + "objectType should be Content": true, + "visibility should be Default": true, + "compatibilityLevel should be 1": true, + "status should be Draft": true + } + ] + }, + { + "id": "efbe493a-7190-4a89-b021-a6197772b127", + "name": "Read specific attributes by sending fields query params", + "url": "http://20.207.120.49/content/v4/read/do_2139669882441318401185?fields=name,primaryCategory,body", + "time": 63, + "responseCode": { + "code": 200, + "name": "OK" + }, + "tests": { + "Status code is 200": true, + "Status code name has string OK": true, + "Verify keys and data type of the response result": true, + "id should be api.content.read": true, + "ver should be 4.0": true, + "identifier should be equal to do_2139669882441318401185": true + }, + "testPassFailCounts": { + "Status code is 200": { + "pass": 1, + "fail": 0 + }, + "Status code name has string OK": { + "pass": 1, + "fail": 0 + }, + "Verify keys and data type of the response result": { + "pass": 1, + "fail": 0 + }, + "id should be api.content.read": { + "pass": 1, + "fail": 0 + }, + "ver should be 4.0": { + "pass": 1, + "fail": 0 + }, + "identifier should be equal to do_2139669882441318401185": { + "pass": 1, + "fail": 0 + } + }, + "times": [ + 63 + ], + "allTests": [ + { + "Status code is 200": true, + "Status code name has string OK": true, + "Verify keys and data type of the response result": true, + "id should be api.content.read": true, + "ver should be 4.0": true, + "identifier should be equal to do_2139669882441318401185": true + } + ] + }, + { + "id": "f0f49c82-729d-4b4a-9fb4-83f7146f61a2", + "name": "Read invalid content", + "url": "http://20.207.120.49/content/v4/read/do_42353245436534", + "time": 57, + "responseCode": { + "code": 404, + "name": "Not Found" + }, + "tests": { + "Status code is 404": true, + "Params has keys: resmsgid , msgid , err , status , errmsg ": true, + "Test data type of the response and keys": true, + "id should be api.content.read": true, + "ver should be 4.0": true, + "responseCode should be RESOURCE_NOT_FOUND": true, + "params.err should be \"NOT_FOUND\"": true, + "params.status should be \"failed\"": true, + "params.errmsg should be \"Error! Node(s) doesn't Exists. | [Invalid Node Id.]: do_42353245436534\"": true, + "messages should be null": true, + "Status code name has string \"Not Found\"": true + }, + "testPassFailCounts": { + "Status code is 404": { + "pass": 1, + "fail": 0 + }, + "Params has keys: resmsgid , msgid , err , status , errmsg ": { + "pass": 1, + "fail": 0 + }, + "Test data type of the response and keys": { + "pass": 1, + "fail": 0 + }, + "id should be api.content.read": { + "pass": 1, + "fail": 0 + }, + "ver should be 4.0": { + "pass": 1, + "fail": 0 + }, + "responseCode should be RESOURCE_NOT_FOUND": { + "pass": 1, + "fail": 0 + }, + "params.err should be \"NOT_FOUND\"": { + "pass": 1, + "fail": 0 + }, + "params.status should be \"failed\"": { + "pass": 1, + "fail": 0 + }, + "params.errmsg should be \"Error! Node(s) doesn't Exists. | [Invalid Node Id.]: do_42353245436534\"": { + "pass": 1, + "fail": 0 + }, + "messages should be null": { + "pass": 1, + "fail": 0 + }, + "Status code name has string \"Not Found\"": { + "pass": 1, + "fail": 0 + } + }, + "times": [ + 57 + ], + "allTests": [ + { + "Status code is 404": true, + "Params has keys: resmsgid , msgid , err , status , errmsg ": true, + "Test data type of the response and keys": true, + "id should be api.content.read": true, + "ver should be 4.0": true, + "responseCode should be RESOURCE_NOT_FOUND": true, + "params.err should be \"NOT_FOUND\"": true, + "params.status should be \"failed\"": true, + "params.errmsg should be \"Error! Node(s) doesn't Exists. | [Invalid Node Id.]: do_42353245436534\"": true, + "messages should be null": true, + "Status code name has string \"Not Found\"": true + } + ] + }, + { + "id": "013a26b0-e16f-48ca-b4d0-4b35813ef2eb", + "name": "Create Content", + "url": "http://20.207.120.49/content/v4/create", + "time": 118, + "responseCode": { + "code": 200, + "name": "OK" + }, + "tests": {}, + "testPassFailCounts": {}, + "times": [ + 118 + ], + "allTests": [ + {} + ] + }, + { + "id": "61a70f42-5935-4ee5-b2b5-d953bc1504b9", + "name": "Upload URL Copy", + "url": "http://20.207.120.49/content/v4/upload/url/do_2139669882491289601186", + "time": 98, + "responseCode": { + "code": 200, + "name": "OK" + }, + "tests": { + "Status code is 200": true, + "Status code name has string OK": true, + "id should be api.content.upload.url": true, + "ver should be 4.0": true, + "Params has keys: resmsgid , msgid , err , status , errmsg ": true, + "Status is successful": true, + "ResponseCode is OK": true, + "Verify keys and data type of the response result": true + }, + "testPassFailCounts": { + "Status code is 200": { + "pass": 1, + "fail": 0 + }, + "Status code name has string OK": { + "pass": 1, + "fail": 0 + }, + "id should be api.content.upload.url": { + "pass": 1, + "fail": 0 + }, + "ver should be 4.0": { + "pass": 1, + "fail": 0 + }, + "Params has keys: resmsgid , msgid , err , status , errmsg ": { + "pass": 1, + "fail": 0 + }, + "Status is successful": { + "pass": 1, + "fail": 0 + }, + "ResponseCode is OK": { + "pass": 1, + "fail": 0 + }, + "Verify keys and data type of the response result": { + "pass": 1, + "fail": 0 + } + }, + "times": [ + 98 + ], + "allTests": [ + { + "Status code is 200": true, + "Status code name has string OK": true, + "id should be api.content.upload.url": true, + "ver should be 4.0": true, + "Params has keys: resmsgid , msgid , err , status , errmsg ": true, + "Status is successful": true, + "ResponseCode is OK": true, + "Verify keys and data type of the response result": true + } + ] + }, + { + "id": "edba766e-ffb2-40fc-9e6e-3298c7ee1b41", + "name": "Upload file to the URL Copy", + "url": "https://knowlgdevbad2564c.blob.core.windows.net/sunbird-content-staging-knowlg/content/assets/do_2139669882491289601186/test.pdf?sv=2017-04-17&se=2024-01-11T21%3A30%3A20Z&sr=b&sp=w&sig=32/WsORWPaypAOrOZ7vA92jkJK0yE8Fw1ohkJRKHtTE%3D", + "time": 42, + "responseCode": { + "code": 201, + "name": "Created" + }, + "tests": { + "Status code is 201": true + }, + "testPassFailCounts": { + "Status code is 201": { + "pass": 1, + "fail": 0 + } + }, + "times": [ + 42 + ], + "allTests": [ + { + "Status code is 201": true + } + ] + }, + { + "id": "1dfb22f6-3508-439a-891f-c51af43b099b", + "name": "Update the content with valid URL and mime type Copy", + "url": "http://20.207.120.49/content/v4/upload/do_2139669882491289601186", + "time": 148, + "responseCode": { + "code": 200, + "name": "OK" + }, + "tests": { + "Status code is 200": true, + "Status code name has string OK": true, + "id should be api.content.upload": true, + "ver should be 4.0": true, + "Params has keys: resmsgid , msgid , err , status , errmsg ": true, + "Status is successful": true, + "ResponseCode is OK": true, + "Result has keys: identifier , artifactUrl , content_url , node_id , versionKey ": true, + "artifactUrl should be: https://knowlgdevbad2564c.blob.core.windows.net/sunbird-content-staging-knowlg/content/assets/do_2139669882491289601186/test.pdf": true, + "content_url should be: https://knowlgdevbad2564c.blob.core.windows.net/sunbird-content-staging-knowlg/content/assets/do_2139669882491289601186/test.pdf": true, + "identifier should be: do_2139669882491289601186": true, + "node_id should be: do_2139669882491289601186": true + }, + "testPassFailCounts": { + "Status code is 200": { + "pass": 1, + "fail": 0 + }, + "Status code name has string OK": { + "pass": 1, + "fail": 0 + }, + "id should be api.content.upload": { + "pass": 1, + "fail": 0 + }, + "ver should be 4.0": { + "pass": 1, + "fail": 0 + }, + "Params has keys: resmsgid , msgid , err , status , errmsg ": { + "pass": 1, + "fail": 0 + }, + "Status is successful": { + "pass": 1, + "fail": 0 + }, + "ResponseCode is OK": { + "pass": 1, + "fail": 0 + }, + "Result has keys: identifier , artifactUrl , content_url , node_id , versionKey ": { + "pass": 1, + "fail": 0 + }, + "artifactUrl should be: https://knowlgdevbad2564c.blob.core.windows.net/sunbird-content-staging-knowlg/content/assets/do_2139669882491289601186/test.pdf": { + "pass": 1, + "fail": 0 + }, + "content_url should be: https://knowlgdevbad2564c.blob.core.windows.net/sunbird-content-staging-knowlg/content/assets/do_2139669882491289601186/test.pdf": { + "pass": 1, + "fail": 0 + }, + "identifier should be: do_2139669882491289601186": { + "pass": 1, + "fail": 0 + }, + "node_id should be: do_2139669882491289601186": { + "pass": 1, + "fail": 0 + } + }, + "times": [ + 148 + ], + "allTests": [ + { + "Status code is 200": true, + "Status code name has string OK": true, + "id should be api.content.upload": true, + "ver should be 4.0": true, + "Params has keys: resmsgid , msgid , err , status , errmsg ": true, + "Status is successful": true, + "ResponseCode is OK": true, + "Result has keys: identifier , artifactUrl , content_url , node_id , versionKey ": true, + "artifactUrl should be: https://knowlgdevbad2564c.blob.core.windows.net/sunbird-content-staging-knowlg/content/assets/do_2139669882491289601186/test.pdf": true, + "content_url should be: https://knowlgdevbad2564c.blob.core.windows.net/sunbird-content-staging-knowlg/content/assets/do_2139669882491289601186/test.pdf": true, + "identifier should be: do_2139669882491289601186": true, + "node_id should be: do_2139669882491289601186": true + } + ] + }, + { + "id": "d27d3ffc-1893-42c3-9f8d-2e84e49a9772", + "name": "Create content for negative scenario", + "url": "http://20.207.120.49/content/v4/create", + "time": 95, + "responseCode": { + "code": 200, + "name": "OK" + }, + "tests": {}, + "testPassFailCounts": {}, + "times": [ + 95 + ], + "allTests": [ + {} + ] + }, + { + "id": "dd04a728-de9d-4d3f-bd66-d694fc39bc16", + "name": "Submit for Review", + "url": "http://20.207.120.49/content/v4/review/do_2139669882491289601186", + "time": 146, + "responseCode": { + "code": 200, + "name": "OK" + }, + "tests": { + "Status code is 200": true, + "Status code name has string OK": true, + "id should be api.content.review": true, + "ver should be 4.0": true, + "Params has keys: resmsgid , msgid , err , status , errmsg ": true, + "Status is successful": true, + "ResponseCode is OK": true, + "Result has keys: identifier , versionKey": true, + "identifier should be: do_2139669882491289601186": true + }, + "testPassFailCounts": { + "Status code is 200": { + "pass": 1, + "fail": 0 + }, + "Status code name has string OK": { + "pass": 1, + "fail": 0 + }, + "id should be api.content.review": { + "pass": 1, + "fail": 0 + }, + "ver should be 4.0": { + "pass": 1, + "fail": 0 + }, + "Params has keys: resmsgid , msgid , err , status , errmsg ": { + "pass": 1, + "fail": 0 + }, + "Status is successful": { + "pass": 1, + "fail": 0 + }, + "ResponseCode is OK": { + "pass": 1, + "fail": 0 + }, + "Result has keys: identifier , versionKey": { + "pass": 1, + "fail": 0 + }, + "identifier should be: do_2139669882491289601186": { + "pass": 1, + "fail": 0 + } + }, + "times": [ + 146 + ], + "allTests": [ + { + "Status code is 200": true, + "Status code name has string OK": true, + "id should be api.content.review": true, + "ver should be 4.0": true, + "Params has keys: resmsgid , msgid , err , status , errmsg ": true, + "Status is successful": true, + "ResponseCode is OK": true, + "Result has keys: identifier , versionKey": true, + "identifier should be: do_2139669882491289601186": true + } + ] + }, + { + "id": "c7b73ea9-144a-4a10-83e0-a95be30efa1b", + "name": "Submit invalid content for review", + "url": "http://20.207.120.49/content/v4/review/dummy", + "time": 73, + "responseCode": { + "code": 404, + "name": "Not Found" + }, + "tests": { + "Status code is 404": true, + "Params has keys: resmsgid , msgid , err , status , errmsg ": true, + "Test data type of the response and keys": true, + "id should be api.content.review": true, + "ver should be 4.0": true, + "responseCode should be RESOURCE_NOT_FOUND": true, + "params.err should be \"NOT_FOUND\"": true, + "params.status should be \"failed\"": true, + "Error! Node(s) doesn't Exists. | [Invalid Node Id.]: dummy": true, + "messages should be null": true, + "Status code name has string \"Not Found\"": true + }, + "testPassFailCounts": { + "Status code is 404": { + "pass": 1, + "fail": 0 + }, + "Params has keys: resmsgid , msgid , err , status , errmsg ": { + "pass": 1, + "fail": 0 + }, + "Test data type of the response and keys": { + "pass": 1, + "fail": 0 + }, + "id should be api.content.review": { + "pass": 1, + "fail": 0 + }, + "ver should be 4.0": { + "pass": 1, + "fail": 0 + }, + "responseCode should be RESOURCE_NOT_FOUND": { + "pass": 1, + "fail": 0 + }, + "params.err should be \"NOT_FOUND\"": { + "pass": 1, + "fail": 0 + }, + "params.status should be \"failed\"": { + "pass": 1, + "fail": 0 + }, + "Error! Node(s) doesn't Exists. | [Invalid Node Id.]: dummy": { + "pass": 1, + "fail": 0 + }, + "messages should be null": { + "pass": 1, + "fail": 0 + }, + "Status code name has string \"Not Found\"": { + "pass": 1, + "fail": 0 + } + }, + "times": [ + 73 + ], + "allTests": [ + { + "Status code is 404": true, + "Params has keys: resmsgid , msgid , err , status , errmsg ": true, + "Test data type of the response and keys": true, + "id should be api.content.review": true, + "ver should be 4.0": true, + "responseCode should be RESOURCE_NOT_FOUND": true, + "params.err should be \"NOT_FOUND\"": true, + "params.status should be \"failed\"": true, + "Error! Node(s) doesn't Exists. | [Invalid Node Id.]: dummy": true, + "messages should be null": true, + "Status code name has string \"Not Found\"": true + } + ] + }, + { + "id": "bed4440b-ee2f-4275-ad8b-8ff8e49e4510", + "name": "Submit content for review without artifactr URL", + "url": "http://20.207.120.49/content/v4/review/do_2139669882549944321187", + "time": 82, + "responseCode": { + "code": 400, + "name": "Bad Request" + }, + "tests": { + "Status code is 400": true, + "Params has keys: resmsgid , msgid , err , status , errmsg ": true, + "Test data type of the response and keys": true, + "id should be api.content.review": true, + "ver should be 4.0": true, + "responseCode should be CLIENT_ERROR": true, + "params.err should be \"VALIDATOR_ERROR\"": true, + "params.status should be \"failed\"": true, + "Error! Missing One or More Required Fields in Object. | [Either artifactUrl is missing or invalid!]\"": true, + "messages should be null": true, + "Status code name has string \"Bad Request\"": true + }, + "testPassFailCounts": { + "Status code is 400": { + "pass": 1, + "fail": 0 + }, + "Params has keys: resmsgid , msgid , err , status , errmsg ": { + "pass": 1, + "fail": 0 + }, + "Test data type of the response and keys": { + "pass": 1, + "fail": 0 + }, + "id should be api.content.review": { + "pass": 1, + "fail": 0 + }, + "ver should be 4.0": { + "pass": 1, + "fail": 0 + }, + "responseCode should be CLIENT_ERROR": { + "pass": 1, + "fail": 0 + }, + "params.err should be \"VALIDATOR_ERROR\"": { + "pass": 1, + "fail": 0 + }, + "params.status should be \"failed\"": { + "pass": 1, + "fail": 0 + }, + "Error! Missing One or More Required Fields in Object. | [Either artifactUrl is missing or invalid!]\"": { + "pass": 1, + "fail": 0 + }, + "messages should be null": { + "pass": 1, + "fail": 0 + }, + "Status code name has string \"Bad Request\"": { + "pass": 1, + "fail": 0 + } + }, + "times": [ + 82 + ], + "allTests": [ + { + "Status code is 400": true, + "Params has keys: resmsgid , msgid , err , status , errmsg ": true, + "Test data type of the response and keys": true, + "id should be api.content.review": true, + "ver should be 4.0": true, + "responseCode should be CLIENT_ERROR": true, + "params.err should be \"VALIDATOR_ERROR\"": true, + "params.status should be \"failed\"": true, + "Error! Missing One or More Required Fields in Object. | [Either artifactUrl is missing or invalid!]\"": true, + "messages should be null": true, + "Status code name has string \"Bad Request\"": true + } + ] + }, + { + "id": "0484a859-d4d4-4bd0-8c2c-9fe53ed0d76c", + "name": "Create Content", + "url": "http://20.207.120.49/content/v4/create", + "time": 102, + "responseCode": { + "code": 200, + "name": "OK" + }, + "tests": {}, + "testPassFailCounts": {}, + "times": [ + 102 + ], + "allTests": [ + {} + ] + }, + { + "id": "fe83f146-ec9a-4ee0-9560-b6538557b330", + "name": "Upload URL", + "url": "http://20.207.120.49/content/v4/upload/url/do_2139669882608599041188", + "time": 79, + "responseCode": { + "code": 200, + "name": "OK" + }, + "tests": { + "Status code is 200": true, + "Status code name has string OK": true, + "id should be api.content.upload.url": true, + "ver should be 4.0": true, + "Params has keys: resmsgid , msgid , err , status , errmsg ": true, + "Status is successful": true, + "ResponseCode is OK": true, + "Verify keys and data type of the response result": true + }, + "testPassFailCounts": { + "Status code is 200": { + "pass": 1, + "fail": 0 + }, + "Status code name has string OK": { + "pass": 1, + "fail": 0 + }, + "id should be api.content.upload.url": { + "pass": 1, + "fail": 0 + }, + "ver should be 4.0": { + "pass": 1, + "fail": 0 + }, + "Params has keys: resmsgid , msgid , err , status , errmsg ": { + "pass": 1, + "fail": 0 + }, + "Status is successful": { + "pass": 1, + "fail": 0 + }, + "ResponseCode is OK": { + "pass": 1, + "fail": 0 + }, + "Verify keys and data type of the response result": { + "pass": 1, + "fail": 0 + } + }, + "times": [ + 79 + ], + "allTests": [ + { + "Status code is 200": true, + "Status code name has string OK": true, + "id should be api.content.upload.url": true, + "ver should be 4.0": true, + "Params has keys: resmsgid , msgid , err , status , errmsg ": true, + "Status is successful": true, + "ResponseCode is OK": true, + "Verify keys and data type of the response result": true + } + ] + }, + { + "id": "432905a8-2546-4d1d-a85b-6ada019ee1b0", + "name": "Upload file to the URL", + "url": "https://knowlgdevbad2564c.blob.core.windows.net/sunbird-content-staging-knowlg/content/assets/do_2139669882608599041188/test.pdf?sv=2017-04-17&se=2024-01-11T21%3A30%3A21Z&sr=b&sp=w&sig=zjfQq%2Bg5YMAdIc0HtE61NoPK%2B7F1WCUItGb5rvyqsUA%3D", + "time": 40, + "responseCode": { + "code": 201, + "name": "Created" + }, + "tests": { + "Status code is 201": true + }, + "testPassFailCounts": { + "Status code is 201": { + "pass": 1, + "fail": 0 + } + }, + "times": [ + 40 + ], + "allTests": [ + { + "Status code is 201": true + } + ] + }, + { + "id": "ac6cbb41-03e8-43ec-9197-4ac621b07f19", + "name": "Update the content with URL and mime type", + "url": "http://20.207.120.49/content/v4/upload/do_2139669882608599041188", + "time": 148, + "responseCode": { + "code": 200, + "name": "OK" + }, + "tests": { + "Status code is 200": true, + "Status code name has string OK": true, + "id should be api.content.upload": true, + "ver should be 4.0": true, + "Params has keys: resmsgid , msgid , err , status , errmsg ": true, + "Status is successful": true, + "ResponseCode is OK": true, + "Result has keys: identifier , artifactUrl , content_url , node_id , versionKey ": true, + "artifactUrl should be: https://knowlgdevbad2564c.blob.core.windows.net/sunbird-content-staging-knowlg/content/assets/do_2139669882608599041188/test.pdf": true, + "content_url should be: https://knowlgdevbad2564c.blob.core.windows.net/sunbird-content-staging-knowlg/content/assets/do_2139669882608599041188/test.pdf": true, + "identifier should be: do_2139669882608599041188": true, + "node_id should be: do_2139669882608599041188": true + }, + "testPassFailCounts": { + "Status code is 200": { + "pass": 1, + "fail": 0 + }, + "Status code name has string OK": { + "pass": 1, + "fail": 0 + }, + "id should be api.content.upload": { + "pass": 1, + "fail": 0 + }, + "ver should be 4.0": { + "pass": 1, + "fail": 0 + }, + "Params has keys: resmsgid , msgid , err , status , errmsg ": { + "pass": 1, + "fail": 0 + }, + "Status is successful": { + "pass": 1, + "fail": 0 + }, + "ResponseCode is OK": { + "pass": 1, + "fail": 0 + }, + "Result has keys: identifier , artifactUrl , content_url , node_id , versionKey ": { + "pass": 1, + "fail": 0 + }, + "artifactUrl should be: https://knowlgdevbad2564c.blob.core.windows.net/sunbird-content-staging-knowlg/content/assets/do_2139669882608599041188/test.pdf": { + "pass": 1, + "fail": 0 + }, + "content_url should be: https://knowlgdevbad2564c.blob.core.windows.net/sunbird-content-staging-knowlg/content/assets/do_2139669882608599041188/test.pdf": { + "pass": 1, + "fail": 0 + }, + "identifier should be: do_2139669882608599041188": { + "pass": 1, + "fail": 0 + }, + "node_id should be: do_2139669882608599041188": { + "pass": 1, + "fail": 0 + } + }, + "times": [ + 148 + ], + "allTests": [ + { + "Status code is 200": true, + "Status code name has string OK": true, + "id should be api.content.upload": true, + "ver should be 4.0": true, + "Params has keys: resmsgid , msgid , err , status , errmsg ": true, + "Status is successful": true, + "ResponseCode is OK": true, + "Result has keys: identifier , artifactUrl , content_url , node_id , versionKey ": true, + "artifactUrl should be: https://knowlgdevbad2564c.blob.core.windows.net/sunbird-content-staging-knowlg/content/assets/do_2139669882608599041188/test.pdf": true, + "content_url should be: https://knowlgdevbad2564c.blob.core.windows.net/sunbird-content-staging-knowlg/content/assets/do_2139669882608599041188/test.pdf": true, + "identifier should be: do_2139669882608599041188": true, + "node_id should be: do_2139669882608599041188": true + } + ] + }, + { + "id": "918e5534-c19c-4ed4-a373-fdecf602f12f", + "name": "Submit for Review", + "url": "http://20.207.120.49/content/v4/review/do_2139669882608599041188", + "time": 141, + "responseCode": { + "code": 200, + "name": "OK" + }, + "tests": { + "Status code is 200": true, + "Status code name has string OK": true, + "id should be api.content.review": true, + "ver should be 4.0": true, + "Params has keys: resmsgid , msgid , err , status , errmsg ": true, + "Status is successful": true, + "ResponseCode is OK": true, + "Result has keys: identifier , versionKey": true, + "identifier should be: do_2139669882608599041188": true + }, + "testPassFailCounts": { + "Status code is 200": { + "pass": 1, + "fail": 0 + }, + "Status code name has string OK": { + "pass": 1, + "fail": 0 + }, + "id should be api.content.review": { + "pass": 1, + "fail": 0 + }, + "ver should be 4.0": { + "pass": 1, + "fail": 0 + }, + "Params has keys: resmsgid , msgid , err , status , errmsg ": { + "pass": 1, + "fail": 0 + }, + "Status is successful": { + "pass": 1, + "fail": 0 + }, + "ResponseCode is OK": { + "pass": 1, + "fail": 0 + }, + "Result has keys: identifier , versionKey": { + "pass": 1, + "fail": 0 + }, + "identifier should be: do_2139669882608599041188": { + "pass": 1, + "fail": 0 + } + }, + "times": [ + 141 + ], + "allTests": [ + { + "Status code is 200": true, + "Status code name has string OK": true, + "id should be api.content.review": true, + "ver should be 4.0": true, + "Params has keys: resmsgid , msgid , err , status , errmsg ": true, + "Status is successful": true, + "ResponseCode is OK": true, + "Result has keys: identifier , versionKey": true, + "identifier should be: do_2139669882608599041188": true + } + ] + }, + { + "id": "96c68536-10b7-4302-8bc9-383716adee26", + "name": "Create content for negative scenario", + "url": "http://20.207.120.49/content/v4/create", + "time": 97, + "responseCode": { + "code": 200, + "name": "OK" + }, + "tests": {}, + "testPassFailCounts": {}, + "times": [ + 97 + ], + "allTests": [ + {} + ] + }, + { + "id": "86b6590f-2362-44a2-94d6-b4466f67f5c8", + "name": "Publish Content", + "url": "http://20.207.120.49/content/v4/publish/do_2139669882608599041188", + "time": 85, + "responseCode": { + "code": 200, + "name": "OK" + }, + "tests": { + "Status code is 200": true, + "id has string - api.content.publish.public ": true, + "Version is 4.0 ": true, + "Verify keys and data type of the response result": true, + "Status is successful ": true, + "ResponseCode is OK ": true, + "node should be equal to do_2139669882608599041188": true, + "publishStatus should be equal to Publish Event for Content Id do_2139669882608599041188 is pushed Successfully!": true + }, + "testPassFailCounts": { + "Status code is 200": { + "pass": 1, + "fail": 0 + }, + "id has string - api.content.publish.public ": { + "pass": 1, + "fail": 0 + }, + "Version is 4.0 ": { + "pass": 1, + "fail": 0 + }, + "Verify keys and data type of the response result": { + "pass": 1, + "fail": 0 + }, + "Status is successful ": { + "pass": 1, + "fail": 0 + }, + "ResponseCode is OK ": { + "pass": 1, + "fail": 0 + }, + "node should be equal to do_2139669882608599041188": { + "pass": 1, + "fail": 0 + }, + "publishStatus should be equal to Publish Event for Content Id do_2139669882608599041188 is pushed Successfully!": { + "pass": 1, + "fail": 0 + } + }, + "times": [ + 85 + ], + "allTests": [ + { + "Status code is 200": true, + "id has string - api.content.publish.public ": true, + "Version is 4.0 ": true, + "Verify keys and data type of the response result": true, + "Status is successful ": true, + "ResponseCode is OK ": true, + "node should be equal to do_2139669882608599041188": true, + "publishStatus should be equal to Publish Event for Content Id do_2139669882608599041188 is pushed Successfully!": true + } + ] + }, + { + "id": "a076a6c7-4c84-4508-9964-2c204c989028", + "name": "Publish content without artifact URL", + "url": "http://20.207.120.49/content/v4/publish/do_2139669882682490881189", + "time": 89, + "responseCode": { + "code": 400, + "name": "Bad Request" + }, + "tests": { + "Status code is 400": true, + "Params has keys: resmsgid , msgid , err , status , errmsg ": true, + "Test data type of the response and keys": true, + "id should be api.content.publish.public": true, + "ver should be 4.0": true, + "responseCode should be CLIENT_ERROR": true, + "params.err should be \"VALIDATOR_ERROR\"": true, + "params.status should be \"failed\"": true, + "Error! Missing One or More Required Fields in Object. | [Either artifactUrl is missing or invalid!]\"": true, + "messages should be null": true, + "Status code name has string \"Bad Request\"": true + }, + "testPassFailCounts": { + "Status code is 400": { + "pass": 1, + "fail": 0 + }, + "Params has keys: resmsgid , msgid , err , status , errmsg ": { + "pass": 1, + "fail": 0 + }, + "Test data type of the response and keys": { + "pass": 1, + "fail": 0 + }, + "id should be api.content.publish.public": { + "pass": 1, + "fail": 0 + }, + "ver should be 4.0": { + "pass": 1, + "fail": 0 + }, + "responseCode should be CLIENT_ERROR": { + "pass": 1, + "fail": 0 + }, + "params.err should be \"VALIDATOR_ERROR\"": { + "pass": 1, + "fail": 0 + }, + "params.status should be \"failed\"": { + "pass": 1, + "fail": 0 + }, + "Error! Missing One or More Required Fields in Object. | [Either artifactUrl is missing or invalid!]\"": { + "pass": 1, + "fail": 0 + }, + "messages should be null": { + "pass": 1, + "fail": 0 + }, + "Status code name has string \"Bad Request\"": { + "pass": 1, + "fail": 0 + } + }, + "times": [ + 89 + ], + "allTests": [ + { + "Status code is 400": true, + "Params has keys: resmsgid , msgid , err , status , errmsg ": true, + "Test data type of the response and keys": true, + "id should be api.content.publish.public": true, + "ver should be 4.0": true, + "responseCode should be CLIENT_ERROR": true, + "params.err should be \"VALIDATOR_ERROR\"": true, + "params.status should be \"failed\"": true, + "Error! Missing One or More Required Fields in Object. | [Either artifactUrl is missing or invalid!]\"": true, + "messages should be null": true, + "Status code name has string \"Bad Request\"": true + } + ] + }, + { + "id": "8a6ad455-3fa6-4d75-8202-d08037a5c2d7", + "name": "Publish invalid content", + "url": "http://20.207.120.49/content/v4/publish/dummy", + "time": 77, + "responseCode": { + "code": 404, + "name": "Not Found" + }, + "tests": { + "Status code is 404": true, + "Params has keys: resmsgid , msgid , err , status , errmsg ": true, + "Test data type of the response and keys": true, + "id should be api.content.publish.public": true, + "ver should be 4.0": true, + "responseCode should be RESOURCE_NOT_FOUND": true, + "params.err should be \"NOT_FOUND\"": true, + "params.status should be \"failed\"": true, + "Error! Node(s) doesn't Exists. | [Invalid Node Id.]: dummy": true, + "messages should be null": true, + "Status code name has string \"Not Found\"": true + }, + "testPassFailCounts": { + "Status code is 404": { + "pass": 1, + "fail": 0 + }, + "Params has keys: resmsgid , msgid , err , status , errmsg ": { + "pass": 1, + "fail": 0 + }, + "Test data type of the response and keys": { + "pass": 1, + "fail": 0 + }, + "id should be api.content.publish.public": { + "pass": 1, + "fail": 0 + }, + "ver should be 4.0": { + "pass": 1, + "fail": 0 + }, + "responseCode should be RESOURCE_NOT_FOUND": { + "pass": 1, + "fail": 0 + }, + "params.err should be \"NOT_FOUND\"": { + "pass": 1, + "fail": 0 + }, + "params.status should be \"failed\"": { + "pass": 1, + "fail": 0 + }, + "Error! Node(s) doesn't Exists. | [Invalid Node Id.]: dummy": { + "pass": 1, + "fail": 0 + }, + "messages should be null": { + "pass": 1, + "fail": 0 + }, + "Status code name has string \"Not Found\"": { + "pass": 1, + "fail": 0 + } + }, + "times": [ + 77 + ], + "allTests": [ + { + "Status code is 404": true, + "Params has keys: resmsgid , msgid , err , status , errmsg ": true, + "Test data type of the response and keys": true, + "id should be api.content.publish.public": true, + "ver should be 4.0": true, + "responseCode should be RESOURCE_NOT_FOUND": true, + "params.err should be \"NOT_FOUND\"": true, + "params.status should be \"failed\"": true, + "Error! Node(s) doesn't Exists. | [Invalid Node Id.]: dummy": true, + "messages should be null": true, + "Status code name has string \"Not Found\"": true + } + ] + }, + { + "id": "d5bdbe0a-5865-4a5d-9844-b6e1fd142a9f", + "name": "Create Content", + "url": "http://20.207.120.49/content/v4/create", + "time": 119, + "responseCode": { + "code": 200, + "name": "OK" + }, + "tests": {}, + "testPassFailCounts": {}, + "times": [ + 119 + ], + "allTests": [ + {} + ] + }, + { + "id": "b28e70ae-388f-40e8-852c-db8521375ca0", + "name": "Upload URL", + "url": "http://20.207.120.49/content/v4/upload/url/do_2139669882739671041190", + "time": 100, + "responseCode": { + "code": 200, + "name": "OK" + }, + "tests": { + "Status code is 200": true, + "Status code name has string OK": true, + "id should be api.content.upload.url": true, + "ver should be 4.0": true, + "Params has keys: resmsgid , msgid , err , status , errmsg ": true, + "Status is successful": true, + "ResponseCode is OK": true, + "Verify keys and data type of the response result": true + }, + "testPassFailCounts": { + "Status code is 200": { + "pass": 1, + "fail": 0 + }, + "Status code name has string OK": { + "pass": 1, + "fail": 0 + }, + "id should be api.content.upload.url": { + "pass": 1, + "fail": 0 + }, + "ver should be 4.0": { + "pass": 1, + "fail": 0 + }, + "Params has keys: resmsgid , msgid , err , status , errmsg ": { + "pass": 1, + "fail": 0 + }, + "Status is successful": { + "pass": 1, + "fail": 0 + }, + "ResponseCode is OK": { + "pass": 1, + "fail": 0 + }, + "Verify keys and data type of the response result": { + "pass": 1, + "fail": 0 + } + }, + "times": [ + 100 + ], + "allTests": [ + { + "Status code is 200": true, + "Status code name has string OK": true, + "id should be api.content.upload.url": true, + "ver should be 4.0": true, + "Params has keys: resmsgid , msgid , err , status , errmsg ": true, + "Status is successful": true, + "ResponseCode is OK": true, + "Verify keys and data type of the response result": true + } + ] + }, + { + "id": "d1fd2b59-37de-47ac-9825-bfb04a6c27a3", + "name": "Upload file to the URL", + "url": "https://knowlgdevbad2564c.blob.core.windows.net/sunbird-content-staging-knowlg/content/assets/do_2139669882739671041190/test.pdf?sv=2017-04-17&se=2024-01-11T21%3A30%3A23Z&sr=b&sp=w&sig=KhIVsW7DBDMK7CFwf8aCPRy%2BV1U%2B8YJt6/14SiF3Y2U%3D", + "time": 42, + "responseCode": { + "code": 201, + "name": "Created" + }, + "tests": { + "Status code is 201": true + }, + "testPassFailCounts": { + "Status code is 201": { + "pass": 1, + "fail": 0 + } + }, + "times": [ + 42 + ], + "allTests": [ + { + "Status code is 201": true + } + ] + }, + { + "id": "6f40dae4-e936-48ae-83a3-c8235cce07e4", + "name": "Update the content with URL and mime type", + "url": "http://20.207.120.49/content/v4/upload/do_2139669882739671041190", + "time": 166, + "responseCode": { + "code": 200, + "name": "OK" + }, + "tests": { + "Status code is 200": true, + "Status code name has string OK": true, + "id should be api.content.upload": true, + "ver should be 4.0": true, + "Params has keys: resmsgid , msgid , err , status , errmsg ": true, + "Status is successful": true, + "ResponseCode is OK": true, + "Result has keys: identifier , artifactUrl , content_url , node_id , versionKey ": true, + "artifactUrl should be: https://knowlgdevbad2564c.blob.core.windows.net/sunbird-content-staging-knowlg/content/assets/do_2139669882739671041190/test.pdf": true, + "content_url should be: https://knowlgdevbad2564c.blob.core.windows.net/sunbird-content-staging-knowlg/content/assets/do_2139669882739671041190/test.pdf": true, + "identifier should be: do_2139669882739671041190": true, + "node_id should be: do_2139669882739671041190": true + }, + "testPassFailCounts": { + "Status code is 200": { + "pass": 1, + "fail": 0 + }, + "Status code name has string OK": { + "pass": 1, + "fail": 0 + }, + "id should be api.content.upload": { + "pass": 1, + "fail": 0 + }, + "ver should be 4.0": { + "pass": 1, + "fail": 0 + }, + "Params has keys: resmsgid , msgid , err , status , errmsg ": { + "pass": 1, + "fail": 0 + }, + "Status is successful": { + "pass": 1, + "fail": 0 + }, + "ResponseCode is OK": { + "pass": 1, + "fail": 0 + }, + "Result has keys: identifier , artifactUrl , content_url , node_id , versionKey ": { + "pass": 1, + "fail": 0 + }, + "artifactUrl should be: https://knowlgdevbad2564c.blob.core.windows.net/sunbird-content-staging-knowlg/content/assets/do_2139669882739671041190/test.pdf": { + "pass": 1, + "fail": 0 + }, + "content_url should be: https://knowlgdevbad2564c.blob.core.windows.net/sunbird-content-staging-knowlg/content/assets/do_2139669882739671041190/test.pdf": { + "pass": 1, + "fail": 0 + }, + "identifier should be: do_2139669882739671041190": { + "pass": 1, + "fail": 0 + }, + "node_id should be: do_2139669882739671041190": { + "pass": 1, + "fail": 0 + } + }, + "times": [ + 166 + ], + "allTests": [ + { + "Status code is 200": true, + "Status code name has string OK": true, + "id should be api.content.upload": true, + "ver should be 4.0": true, + "Params has keys: resmsgid , msgid , err , status , errmsg ": true, + "Status is successful": true, + "ResponseCode is OK": true, + "Result has keys: identifier , artifactUrl , content_url , node_id , versionKey ": true, + "artifactUrl should be: https://knowlgdevbad2564c.blob.core.windows.net/sunbird-content-staging-knowlg/content/assets/do_2139669882739671041190/test.pdf": true, + "content_url should be: https://knowlgdevbad2564c.blob.core.windows.net/sunbird-content-staging-knowlg/content/assets/do_2139669882739671041190/test.pdf": true, + "identifier should be: do_2139669882739671041190": true, + "node_id should be: do_2139669882739671041190": true + } + ] + }, + { + "id": "f3bd2d5f-0f13-461b-b67f-3a6bb6b7c305", + "name": "Submit for Review Copy", + "url": "http://20.207.120.49/content/v4/review/do_2139669882739671041190", + "time": 159, + "responseCode": { + "code": 200, + "name": "OK" + }, + "tests": { + "Status code is 200": true, + "Status code name has string OK": true, + "id should be api.content.review": true, + "ver should be 4.0": true, + "Params has keys: resmsgid , msgid , err , status , errmsg ": true, + "Status is successful": true, + "ResponseCode is OK": true, + "Result has keys: identifier , versionKey": true, + "identifier should be: do_2139669882739671041190": true + }, + "testPassFailCounts": { + "Status code is 200": { + "pass": 1, + "fail": 0 + }, + "Status code name has string OK": { + "pass": 1, + "fail": 0 + }, + "id should be api.content.review": { + "pass": 1, + "fail": 0 + }, + "ver should be 4.0": { + "pass": 1, + "fail": 0 + }, + "Params has keys: resmsgid , msgid , err , status , errmsg ": { + "pass": 1, + "fail": 0 + }, + "Status is successful": { + "pass": 1, + "fail": 0 + }, + "ResponseCode is OK": { + "pass": 1, + "fail": 0 + }, + "Result has keys: identifier , versionKey": { + "pass": 1, + "fail": 0 + }, + "identifier should be: do_2139669882739671041190": { + "pass": 1, + "fail": 0 + } + }, + "times": [ + 159 + ], + "allTests": [ + { + "Status code is 200": true, + "Status code name has string OK": true, + "id should be api.content.review": true, + "ver should be 4.0": true, + "Params has keys: resmsgid , msgid , err , status , errmsg ": true, + "Status is successful": true, + "ResponseCode is OK": true, + "Result has keys: identifier , versionKey": true, + "identifier should be: do_2139669882739671041190": true + } + ] + }, + { + "id": "2c4d97c8-c6aa-49db-af55-ab0db27f6c02", + "name": "Reject Valid Content during review", + "url": "http://20.207.120.49/content/v4/reject/do_2139669882739671041190", + "time": 145, + "responseCode": { + "code": 200, + "name": "OK" + }, + "tests": { + "Status code is 200": true, + "Status code name has string OK": true, + "id should be api.content.review.reject": true, + "ver should be 4.0": true, + "Params has keys: resmsgid , msgid , err , status , errmsg ": true, + "Status is successful": true, + "ResponseCode is OK": true, + "Result has keys: identifier , node_id ": true, + "identifier should be: do_2139669882739671041190": true + }, + "testPassFailCounts": { + "Status code is 200": { + "pass": 1, + "fail": 0 + }, + "Status code name has string OK": { + "pass": 1, + "fail": 0 + }, + "id should be api.content.review.reject": { + "pass": 1, + "fail": 0 + }, + "ver should be 4.0": { + "pass": 1, + "fail": 0 + }, + "Params has keys: resmsgid , msgid , err , status , errmsg ": { + "pass": 1, + "fail": 0 + }, + "Status is successful": { + "pass": 1, + "fail": 0 + }, + "ResponseCode is OK": { + "pass": 1, + "fail": 0 + }, + "Result has keys: identifier , node_id ": { + "pass": 1, + "fail": 0 + }, + "identifier should be: do_2139669882739671041190": { + "pass": 1, + "fail": 0 + } + }, + "times": [ + 145 + ], + "allTests": [ + { + "Status code is 200": true, + "Status code name has string OK": true, + "id should be api.content.review.reject": true, + "ver should be 4.0": true, + "Params has keys: resmsgid , msgid , err , status , errmsg ": true, + "Status is successful": true, + "ResponseCode is OK": true, + "Result has keys: identifier , node_id ": true, + "identifier should be: do_2139669882739671041190": true + } + ] + }, + { + "id": "e07165a3-a4dd-45bc-ada9-59f88190a15d", + "name": "Reject invalid Content during review", + "url": "http://20.207.120.49/content/v4/reject/dummy", + "time": 83, + "responseCode": { + "code": 404, + "name": "Not Found" + }, + "tests": { + "Status code is 404": true, + "Params has keys: resmsgid , msgid , err , status , errmsg ": true, + "Test data type of the response and keys": true, + "id should be api.content.review.reject": true, + "ver should be 4.0": true, + "responseCode should be RESOURCE_NOT_FOUND": true, + "params.err should be \"NOT_FOUND\"": true, + "params.status should be \"failed\"": true, + "Error! Node(s) doesn't Exists. | [Invalid Node Id.]: dummy": true, + "messages should be null": true, + "Status code name has string \"Not Found\"": true + }, + "testPassFailCounts": { + "Status code is 404": { + "pass": 1, + "fail": 0 + }, + "Params has keys: resmsgid , msgid , err , status , errmsg ": { + "pass": 1, + "fail": 0 + }, + "Test data type of the response and keys": { + "pass": 1, + "fail": 0 + }, + "id should be api.content.review.reject": { + "pass": 1, + "fail": 0 + }, + "ver should be 4.0": { + "pass": 1, + "fail": 0 + }, + "responseCode should be RESOURCE_NOT_FOUND": { + "pass": 1, + "fail": 0 + }, + "params.err should be \"NOT_FOUND\"": { + "pass": 1, + "fail": 0 + }, + "params.status should be \"failed\"": { + "pass": 1, + "fail": 0 + }, + "Error! Node(s) doesn't Exists. | [Invalid Node Id.]: dummy": { + "pass": 1, + "fail": 0 + }, + "messages should be null": { + "pass": 1, + "fail": 0 + }, + "Status code name has string \"Not Found\"": { + "pass": 1, + "fail": 0 + } + }, + "times": [ + 83 + ], + "allTests": [ + { + "Status code is 404": true, + "Params has keys: resmsgid , msgid , err , status , errmsg ": true, + "Test data type of the response and keys": true, + "id should be api.content.review.reject": true, + "ver should be 4.0": true, + "responseCode should be RESOURCE_NOT_FOUND": true, + "params.err should be \"NOT_FOUND\"": true, + "params.status should be \"failed\"": true, + "Error! Node(s) doesn't Exists. | [Invalid Node Id.]: dummy": true, + "messages should be null": true, + "Status code name has string \"Not Found\"": true + } + ] + }, + { + "id": "b62e502e-e0c9-4092-a967-4097b2ed9bae", + "name": "Create Content", + "url": "http://20.207.120.49/content/v4/create", + "time": 108, + "responseCode": { + "code": 200, + "name": "OK" + }, + "tests": {}, + "testPassFailCounts": {}, + "times": [ + 108 + ], + "allTests": [ + {} + ] + }, + { + "id": "3da36533-9fb1-4881-ae9d-c45a8c21da48", + "name": "Upload URL", + "url": "http://20.207.120.49/content/v4/upload/url/do_2139669882851328001191", + "time": 106, + "responseCode": { + "code": 200, + "name": "OK" + }, + "tests": { + "Status code is 200": true, + "Status code name has string OK": true, + "id should be api.content.upload.url": true, + "ver should be 4.0": true, + "Params has keys: resmsgid , msgid , err , status , errmsg ": true, + "Status is successful": true, + "ResponseCode is OK": true, + "Verify keys and data type of the response result": true + }, + "testPassFailCounts": { + "Status code is 200": { + "pass": 1, + "fail": 0 + }, + "Status code name has string OK": { + "pass": 1, + "fail": 0 + }, + "id should be api.content.upload.url": { + "pass": 1, + "fail": 0 + }, + "ver should be 4.0": { + "pass": 1, + "fail": 0 + }, + "Params has keys: resmsgid , msgid , err , status , errmsg ": { + "pass": 1, + "fail": 0 + }, + "Status is successful": { + "pass": 1, + "fail": 0 + }, + "ResponseCode is OK": { + "pass": 1, + "fail": 0 + }, + "Verify keys and data type of the response result": { + "pass": 1, + "fail": 0 + } + }, + "times": [ + 106 + ], + "allTests": [ + { + "Status code is 200": true, + "Status code name has string OK": true, + "id should be api.content.upload.url": true, + "ver should be 4.0": true, + "Params has keys: resmsgid , msgid , err , status , errmsg ": true, + "Status is successful": true, + "ResponseCode is OK": true, + "Verify keys and data type of the response result": true + } + ] + }, + { + "id": "6aba0498-231a-46f7-bbdc-a76070be8a14", + "name": "Upload file to the URL", + "url": "https://knowlgdevbad2564c.blob.core.windows.net/sunbird-content-staging-knowlg/content/assets/do_2139669882851328001191/test.pdf?sv=2017-04-17&se=2024-01-11T21%3A30%3A24Z&sr=b&sp=w&sig=vqV95O7QnK80qFdQgIkPCcAWDg3jw/LzGq/klfYBLu8%3D", + "time": 43, + "responseCode": { + "code": 201, + "name": "Created" + }, + "tests": { + "Status code is 201": true + }, + "testPassFailCounts": { + "Status code is 201": { + "pass": 1, + "fail": 0 + } + }, + "times": [ + 43 + ], + "allTests": [ + { + "Status code is 201": true + } + ] + }, + { + "id": "e99174e8-45a3-4a06-bc14-b0b35ee21fbd", + "name": "Update the content with URL and mime type", + "url": "http://20.207.120.49/content/v4/upload/do_2139669882851328001191", + "time": 198, + "responseCode": { + "code": 200, + "name": "OK" + }, + "tests": { + "Status code is 200": true, + "Status code name has string OK": true, + "id should be api.content.upload": true, + "ver should be 4.0": true, + "Params has keys: resmsgid , msgid , err , status , errmsg ": true, + "Status is successful": true, + "ResponseCode is OK": true, + "Result has keys: identifier , artifactUrl , content_url , node_id , versionKey ": true, + "artifactUrl should be: https://knowlgdevbad2564c.blob.core.windows.net/sunbird-content-staging-knowlg/content/assets/do_2139669882851328001191/test.pdf": true, + "content_url should be: https://knowlgdevbad2564c.blob.core.windows.net/sunbird-content-staging-knowlg/content/assets/do_2139669882851328001191/test.pdf": true, + "identifier should be: do_2139669882851328001191": true, + "node_id should be: do_2139669882851328001191": true + }, + "testPassFailCounts": { + "Status code is 200": { + "pass": 1, + "fail": 0 + }, + "Status code name has string OK": { + "pass": 1, + "fail": 0 + }, + "id should be api.content.upload": { + "pass": 1, + "fail": 0 + }, + "ver should be 4.0": { + "pass": 1, + "fail": 0 + }, + "Params has keys: resmsgid , msgid , err , status , errmsg ": { + "pass": 1, + "fail": 0 + }, + "Status is successful": { + "pass": 1, + "fail": 0 + }, + "ResponseCode is OK": { + "pass": 1, + "fail": 0 + }, + "Result has keys: identifier , artifactUrl , content_url , node_id , versionKey ": { + "pass": 1, + "fail": 0 + }, + "artifactUrl should be: https://knowlgdevbad2564c.blob.core.windows.net/sunbird-content-staging-knowlg/content/assets/do_2139669882851328001191/test.pdf": { + "pass": 1, + "fail": 0 + }, + "content_url should be: https://knowlgdevbad2564c.blob.core.windows.net/sunbird-content-staging-knowlg/content/assets/do_2139669882851328001191/test.pdf": { + "pass": 1, + "fail": 0 + }, + "identifier should be: do_2139669882851328001191": { + "pass": 1, + "fail": 0 + }, + "node_id should be: do_2139669882851328001191": { + "pass": 1, + "fail": 0 + } + }, + "times": [ + 198 + ], + "allTests": [ + { + "Status code is 200": true, + "Status code name has string OK": true, + "id should be api.content.upload": true, + "ver should be 4.0": true, + "Params has keys: resmsgid , msgid , err , status , errmsg ": true, + "Status is successful": true, + "ResponseCode is OK": true, + "Result has keys: identifier , artifactUrl , content_url , node_id , versionKey ": true, + "artifactUrl should be: https://knowlgdevbad2564c.blob.core.windows.net/sunbird-content-staging-knowlg/content/assets/do_2139669882851328001191/test.pdf": true, + "content_url should be: https://knowlgdevbad2564c.blob.core.windows.net/sunbird-content-staging-knowlg/content/assets/do_2139669882851328001191/test.pdf": true, + "identifier should be: do_2139669882851328001191": true, + "node_id should be: do_2139669882851328001191": true + } + ] + }, + { + "id": "d6847c1b-2446-4c49-aae1-79e173910ee3", + "name": "Submit for Review", + "url": "http://20.207.120.49/content/v4/review/do_2139669882851328001191", + "time": 161, + "responseCode": { + "code": 200, + "name": "OK" + }, + "tests": { + "Status code is 200": true, + "Status code name has string OK": true, + "id should be api.content.review": true, + "ver should be 4.0": true, + "Params has keys: resmsgid , msgid , err , status , errmsg ": true, + "Status is successful": true, + "ResponseCode is OK": true, + "Result has keys: identifier , versionKey": true, + "identifier should be: do_2139669882851328001191": true + }, + "testPassFailCounts": { + "Status code is 200": { + "pass": 1, + "fail": 0 + }, + "Status code name has string OK": { + "pass": 1, + "fail": 0 + }, + "id should be api.content.review": { + "pass": 1, + "fail": 0 + }, + "ver should be 4.0": { + "pass": 1, + "fail": 0 + }, + "Params has keys: resmsgid , msgid , err , status , errmsg ": { + "pass": 1, + "fail": 0 + }, + "Status is successful": { + "pass": 1, + "fail": 0 + }, + "ResponseCode is OK": { + "pass": 1, + "fail": 0 + }, + "Result has keys: identifier , versionKey": { + "pass": 1, + "fail": 0 + }, + "identifier should be: do_2139669882851328001191": { + "pass": 1, + "fail": 0 + } + }, + "times": [ + 161 + ], + "allTests": [ + { + "Status code is 200": true, + "Status code name has string OK": true, + "id should be api.content.review": true, + "ver should be 4.0": true, + "Params has keys: resmsgid , msgid , err , status , errmsg ": true, + "Status is successful": true, + "ResponseCode is OK": true, + "Result has keys: identifier , versionKey": true, + "identifier should be: do_2139669882851328001191": true + } + ] + }, + { + "id": "0dd80703-93ff-408e-84cc-530cded60e59", + "name": "Publish Content", + "url": "http://20.207.120.49/content/v4/publish/do_2139669882851328001191", + "time": 90, + "responseCode": { + "code": 200, + "name": "OK" + }, + "tests": { + "Status code is 200": true, + "id has string - api.content.publish.public ": true, + "Version is 4.0 ": true, + "Verify keys and data type of the response result": true, + "Status is successful ": true, + "ResponseCode is OK ": true, + "node should be equal to do_2139669882851328001191": true, + "publishStatus should be equal to Publish Event for Content Id do_2139669882851328001191 is pushed Successfully!": true + }, + "testPassFailCounts": { + "Status code is 200": { + "pass": 1, + "fail": 0 + }, + "id has string - api.content.publish.public ": { + "pass": 1, + "fail": 0 + }, + "Version is 4.0 ": { + "pass": 1, + "fail": 0 + }, + "Verify keys and data type of the response result": { + "pass": 1, + "fail": 0 + }, + "Status is successful ": { + "pass": 1, + "fail": 0 + }, + "ResponseCode is OK ": { + "pass": 1, + "fail": 0 + }, + "node should be equal to do_2139669882851328001191": { + "pass": 1, + "fail": 0 + }, + "publishStatus should be equal to Publish Event for Content Id do_2139669882851328001191 is pushed Successfully!": { + "pass": 1, + "fail": 0 + } + }, + "times": [ + 90 + ], + "allTests": [ + { + "Status code is 200": true, + "id has string - api.content.publish.public ": true, + "Version is 4.0 ": true, + "Verify keys and data type of the response result": true, + "Status is successful ": true, + "ResponseCode is OK ": true, + "node should be equal to do_2139669882851328001191": true, + "publishStatus should be equal to Publish Event for Content Id do_2139669882851328001191 is pushed Successfully!": true + } + ] + }, + { + "id": "335eb63f-e70f-4722-9e5d-68f8afce4000", + "name": "Create content for negative scenario", + "url": "http://20.207.120.49/content/v4/create", + "time": 156, + "responseCode": { + "code": 200, + "name": "OK" + }, + "tests": {}, + "testPassFailCounts": {}, + "times": [ + 156 + ], + "allTests": [ + {} + ] + }, + { + "id": "c2843d38-1d66-4307-86ce-15bbda40af1a", + "name": "Retire a Live Content", + "url": "http://20.207.120.49/content/v4/retire/do_2139669882851328001191", + "time": 63, + "responseCode": { + "code": 200, + "name": "OK" + }, + "tests": { + "Status code is 200": true, + "Status code name has string OK": true, + "id should be api.content.retire": true, + "ver should be 4.0": true, + "Params has keys: resmsgid , msgid , err , status , errmsg ": true, + "Status is successful": true, + "ResponseCode is OK": true, + "Result has keys: identifier , node_id ": true, + "identifier should be: do_2139669882851328001191": true + }, + "testPassFailCounts": { + "Status code is 200": { + "pass": 1, + "fail": 0 + }, + "Status code name has string OK": { + "pass": 1, + "fail": 0 + }, + "id should be api.content.retire": { + "pass": 1, + "fail": 0 + }, + "ver should be 4.0": { + "pass": 1, + "fail": 0 + }, + "Params has keys: resmsgid , msgid , err , status , errmsg ": { + "pass": 1, + "fail": 0 + }, + "Status is successful": { + "pass": 1, + "fail": 0 + }, + "ResponseCode is OK": { + "pass": 1, + "fail": 0 + }, + "Result has keys: identifier , node_id ": { + "pass": 1, + "fail": 0 + }, + "identifier should be: do_2139669882851328001191": { + "pass": 1, + "fail": 0 + } + }, + "times": [ + 63 + ], + "allTests": [ + { + "Status code is 200": true, + "Status code name has string OK": true, + "id should be api.content.retire": true, + "ver should be 4.0": true, + "Params has keys: resmsgid , msgid , err , status , errmsg ": true, + "Status is successful": true, + "ResponseCode is OK": true, + "Result has keys: identifier , node_id ": true, + "identifier should be: do_2139669882851328001191": true + } + ] + }, + { + "id": "fb65e4e6-1ae3-4cbb-91e3-95f039a4ccd7", + "name": "Retire a draft Content", + "url": "http://20.207.120.49/content/v4/retire/do_2139669882946027521192", + "time": 69, + "responseCode": { + "code": 200, + "name": "OK" + }, + "tests": { + "Status code is 200": true, + "Status code name has string OK": true, + "id should be api.content.retire": true, + "ver should be 4.0": true, + "Params has keys: resmsgid , msgid , err , status , errmsg ": true, + "Status is successful": true, + "ResponseCode is OK": true, + "Result has keys: identifier , node_id ": true, + "identifier should be: do_2139669882946027521192": true + }, + "testPassFailCounts": { + "Status code is 200": { + "pass": 1, + "fail": 0 + }, + "Status code name has string OK": { + "pass": 1, + "fail": 0 + }, + "id should be api.content.retire": { + "pass": 1, + "fail": 0 + }, + "ver should be 4.0": { + "pass": 1, + "fail": 0 + }, + "Params has keys: resmsgid , msgid , err , status , errmsg ": { + "pass": 1, + "fail": 0 + }, + "Status is successful": { + "pass": 1, + "fail": 0 + }, + "ResponseCode is OK": { + "pass": 1, + "fail": 0 + }, + "Result has keys: identifier , node_id ": { + "pass": 1, + "fail": 0 + }, + "identifier should be: do_2139669882946027521192": { + "pass": 1, + "fail": 0 + } + }, + "times": [ + 69 + ], + "allTests": [ + { + "Status code is 200": true, + "Status code name has string OK": true, + "id should be api.content.retire": true, + "ver should be 4.0": true, + "Params has keys: resmsgid , msgid , err , status , errmsg ": true, + "Status is successful": true, + "ResponseCode is OK": true, + "Result has keys: identifier , node_id ": true, + "identifier should be: do_2139669882946027521192": true + } + ] + }, + { + "id": "f975b7b2-1e7e-4848-9af7-83908a94076d", + "name": "Retire Content which is already retired", + "url": "http://20.207.120.49/content/v4/retire/do_2139669882851328001191", + "time": 50, + "responseCode": { + "code": 400, + "name": "Bad Request" + }, + "tests": { + "Status code is 400": true, + "Params has keys: resmsgid , msgid , err , status , errmsg ": true, + "Test data type of the response and keys": true, + "id should be api.content.retire": true, + "ver should be 4.0": true, + "responseCode should be CLIENT_ERROR": true, + "params.err should be \"ERR_CONTENT_RETIRE\"": true, + "params.status should be \"failed\"": true, + "errmsg: Content with Identifier do_2139669882851328001191 is already Retired.": true, + "messages should be null": true, + "Status code name has string \"Bad Request\"": true + }, + "testPassFailCounts": { + "Status code is 400": { + "pass": 1, + "fail": 0 + }, + "Params has keys: resmsgid , msgid , err , status , errmsg ": { + "pass": 1, + "fail": 0 + }, + "Test data type of the response and keys": { + "pass": 1, + "fail": 0 + }, + "id should be api.content.retire": { + "pass": 1, + "fail": 0 + }, + "ver should be 4.0": { + "pass": 1, + "fail": 0 + }, + "responseCode should be CLIENT_ERROR": { + "pass": 1, + "fail": 0 + }, + "params.err should be \"ERR_CONTENT_RETIRE\"": { + "pass": 1, + "fail": 0 + }, + "params.status should be \"failed\"": { + "pass": 1, + "fail": 0 + }, + "errmsg: Content with Identifier do_2139669882851328001191 is already Retired.": { + "pass": 1, + "fail": 0 + }, + "messages should be null": { + "pass": 1, + "fail": 0 + }, + "Status code name has string \"Bad Request\"": { + "pass": 1, + "fail": 0 + } + }, + "times": [ + 50 + ], + "allTests": [ + { + "Status code is 400": true, + "Params has keys: resmsgid , msgid , err , status , errmsg ": true, + "Test data type of the response and keys": true, + "id should be api.content.retire": true, + "ver should be 4.0": true, + "responseCode should be CLIENT_ERROR": true, + "params.err should be \"ERR_CONTENT_RETIRE\"": true, + "params.status should be \"failed\"": true, + "errmsg: Content with Identifier do_2139669882851328001191 is already Retired.": true, + "messages should be null": true, + "Status code name has string \"Bad Request\"": true + } + ] + }, + { + "id": "d28cdd62-9094-449b-88d8-2b183318ec39", + "name": "Retire an invalid content", + "url": "http://20.207.120.49/content/v4/retire/dummy", + "time": 52, + "responseCode": { + "code": 404, + "name": "Not Found" + }, + "tests": { + "Status code is 404": true, + "Params has keys: resmsgid , msgid , err , status , errmsg ": true, + "Test data type of the response and keys": true, + "id should be api.content.retire": true, + "ver should be 4.0": true, + "responseCode should be RESOURCE_NOT_FOUND": true, + "params.err should be \"NOT_FOUND\"": true, + "params.status should be \"failed\"": true, + "Error! Node(s) doesn't Exists. | [Invalid Node Id.]: dummy": true, + "messages should be null": true, + "Status code name has string \"Not Found\"": true + }, + "testPassFailCounts": { + "Status code is 404": { + "pass": 1, + "fail": 0 + }, + "Params has keys: resmsgid , msgid , err , status , errmsg ": { + "pass": 1, + "fail": 0 + }, + "Test data type of the response and keys": { + "pass": 1, + "fail": 0 + }, + "id should be api.content.retire": { + "pass": 1, + "fail": 0 + }, + "ver should be 4.0": { + "pass": 1, + "fail": 0 + }, + "responseCode should be RESOURCE_NOT_FOUND": { + "pass": 1, + "fail": 0 + }, + "params.err should be \"NOT_FOUND\"": { + "pass": 1, + "fail": 0 + }, + "params.status should be \"failed\"": { + "pass": 1, + "fail": 0 + }, + "Error! Node(s) doesn't Exists. | [Invalid Node Id.]: dummy": { + "pass": 1, + "fail": 0 + }, + "messages should be null": { + "pass": 1, + "fail": 0 + }, + "Status code name has string \"Not Found\"": { + "pass": 1, + "fail": 0 + } + }, + "times": [ + 52 + ], + "allTests": [ + { + "Status code is 404": true, + "Params has keys: resmsgid , msgid , err , status , errmsg ": true, + "Test data type of the response and keys": true, + "id should be api.content.retire": true, + "ver should be 4.0": true, + "responseCode should be RESOURCE_NOT_FOUND": true, + "params.err should be \"NOT_FOUND\"": true, + "params.status should be \"failed\"": true, + "Error! Node(s) doesn't Exists. | [Invalid Node Id.]: dummy": true, + "messages should be null": true, + "Status code name has string \"Not Found\"": true + } + ] + }, + { + "id": "cb4495f7-94a5-4654-9fed-8ab70868eb23", + "name": "Create draft content", + "url": "http://20.207.120.49/content/v4/create", + "time": 109, + "responseCode": { + "code": 200, + "name": "OK" + }, + "tests": {}, + "testPassFailCounts": {}, + "times": [ + 109 + ], + "allTests": [ + {} + ] + }, + { + "id": "7e8a3f2d-c2e6-4f93-8667-66fe7b805d52", + "name": "Create Content", + "url": "http://20.207.120.49/content/v4/create", + "time": 105, + "responseCode": { + "code": 200, + "name": "OK" + }, + "tests": {}, + "testPassFailCounts": {}, + "times": [ + 105 + ], + "allTests": [ + {} + ] + }, + { + "id": "2fc50dc9-8c17-4fd7-bc29-77e6dd6d307d", + "name": "Upload URL", + "url": "http://20.207.120.49/content/v4/upload/url/do_2139669883022458881194", + "time": 88, + "responseCode": { + "code": 200, + "name": "OK" + }, + "tests": { + "Status code is 200": true, + "Status code name has string OK": true, + "id should be api.content.upload.url": true, + "ver should be 4.0": true, + "Params has keys: resmsgid , msgid , err , status , errmsg ": true, + "Status is successful": true, + "ResponseCode is OK": true, + "Verify keys and data type of the response result": true + }, + "testPassFailCounts": { + "Status code is 200": { + "pass": 1, + "fail": 0 + }, + "Status code name has string OK": { + "pass": 1, + "fail": 0 + }, + "id should be api.content.upload.url": { + "pass": 1, + "fail": 0 + }, + "ver should be 4.0": { + "pass": 1, + "fail": 0 + }, + "Params has keys: resmsgid , msgid , err , status , errmsg ": { + "pass": 1, + "fail": 0 + }, + "Status is successful": { + "pass": 1, + "fail": 0 + }, + "ResponseCode is OK": { + "pass": 1, + "fail": 0 + }, + "Verify keys and data type of the response result": { + "pass": 1, + "fail": 0 + } + }, + "times": [ + 88 + ], + "allTests": [ + { + "Status code is 200": true, + "Status code name has string OK": true, + "id should be api.content.upload.url": true, + "ver should be 4.0": true, + "Params has keys: resmsgid , msgid , err , status , errmsg ": true, + "Status is successful": true, + "ResponseCode is OK": true, + "Verify keys and data type of the response result": true + } + ] + }, + { + "id": "d7f392a9-45a5-4785-a194-ab65c547ca6f", + "name": "Upload file to the URL", + "url": "https://knowlgdevbad2564c.blob.core.windows.net/sunbird-content-staging-knowlg/content/assets/do_2139669883022458881194/test.pdf?sv=2017-04-17&se=2024-01-11T21%3A30%3A26Z&sr=b&sp=w&sig=1cHVj%2B1opc%2Bh3K8tlXSBTk7wrTSnRhlgFQl0TxULygo%3D", + "time": 72, + "responseCode": { + "code": 201, + "name": "Created" + }, + "tests": { + "Status code is 201": true + }, + "testPassFailCounts": { + "Status code is 201": { + "pass": 1, + "fail": 0 + } + }, + "times": [ + 72 + ], + "allTests": [ + { + "Status code is 201": true + } + ] + }, + { + "id": "7fdf72c2-dc74-4e0a-8aa6-13123b9392f0", + "name": "Update the content with URL and mime type", + "url": "http://20.207.120.49/content/v4/upload/do_2139669883022458881194", + "time": 193, + "responseCode": { + "code": 200, + "name": "OK" + }, + "tests": { + "Status code is 200": true, + "Status code name has string OK": true, + "id should be api.content.upload": true, + "ver should be 4.0": true, + "Params has keys: resmsgid , msgid , err , status , errmsg ": true, + "Status is successful": true, + "ResponseCode is OK": true, + "Result has keys: identifier , artifactUrl , content_url , node_id , versionKey ": true, + "artifactUrl should be: https://knowlgdevbad2564c.blob.core.windows.net/sunbird-content-staging-knowlg/content/assets/do_2139669883022458881194/test.pdf": true, + "content_url should be: https://knowlgdevbad2564c.blob.core.windows.net/sunbird-content-staging-knowlg/content/assets/do_2139669883022458881194/test.pdf": true, + "identifier should be: do_2139669883022458881194": true, + "node_id should be: do_2139669883022458881194": true + }, + "testPassFailCounts": { + "Status code is 200": { + "pass": 1, + "fail": 0 + }, + "Status code name has string OK": { + "pass": 1, + "fail": 0 + }, + "id should be api.content.upload": { + "pass": 1, + "fail": 0 + }, + "ver should be 4.0": { + "pass": 1, + "fail": 0 + }, + "Params has keys: resmsgid , msgid , err , status , errmsg ": { + "pass": 1, + "fail": 0 + }, + "Status is successful": { + "pass": 1, + "fail": 0 + }, + "ResponseCode is OK": { + "pass": 1, + "fail": 0 + }, + "Result has keys: identifier , artifactUrl , content_url , node_id , versionKey ": { + "pass": 1, + "fail": 0 + }, + "artifactUrl should be: https://knowlgdevbad2564c.blob.core.windows.net/sunbird-content-staging-knowlg/content/assets/do_2139669883022458881194/test.pdf": { + "pass": 1, + "fail": 0 + }, + "content_url should be: https://knowlgdevbad2564c.blob.core.windows.net/sunbird-content-staging-knowlg/content/assets/do_2139669883022458881194/test.pdf": { + "pass": 1, + "fail": 0 + }, + "identifier should be: do_2139669883022458881194": { + "pass": 1, + "fail": 0 + }, + "node_id should be: do_2139669883022458881194": { + "pass": 1, + "fail": 0 + } + }, + "times": [ + 193 + ], + "allTests": [ + { + "Status code is 200": true, + "Status code name has string OK": true, + "id should be api.content.upload": true, + "ver should be 4.0": true, + "Params has keys: resmsgid , msgid , err , status , errmsg ": true, + "Status is successful": true, + "ResponseCode is OK": true, + "Result has keys: identifier , artifactUrl , content_url , node_id , versionKey ": true, + "artifactUrl should be: https://knowlgdevbad2564c.blob.core.windows.net/sunbird-content-staging-knowlg/content/assets/do_2139669883022458881194/test.pdf": true, + "content_url should be: https://knowlgdevbad2564c.blob.core.windows.net/sunbird-content-staging-knowlg/content/assets/do_2139669883022458881194/test.pdf": true, + "identifier should be: do_2139669883022458881194": true, + "node_id should be: do_2139669883022458881194": true + } + ] + }, + { + "id": "a6d8e9a5-4188-4f3d-8b79-ef7ae040ebcf", + "name": "Submit for Review", + "url": "http://20.207.120.49/content/v4/review/do_2139669883022458881194", + "time": 157, + "responseCode": { + "code": 200, + "name": "OK" + }, + "tests": { + "Status code is 200": true, + "Status code name has string OK": true, + "id should be api.content.review": true, + "ver should be 4.0": true, + "Params has keys: resmsgid , msgid , err , status , errmsg ": true, + "Status is successful": true, + "ResponseCode is OK": true, + "Result has keys: identifier , versionKey": true, + "identifier should be: do_2139669883022458881194": true + }, + "testPassFailCounts": { + "Status code is 200": { + "pass": 1, + "fail": 0 + }, + "Status code name has string OK": { + "pass": 1, + "fail": 0 + }, + "id should be api.content.review": { + "pass": 1, + "fail": 0 + }, + "ver should be 4.0": { + "pass": 1, + "fail": 0 + }, + "Params has keys: resmsgid , msgid , err , status , errmsg ": { + "pass": 1, + "fail": 0 + }, + "Status is successful": { + "pass": 1, + "fail": 0 + }, + "ResponseCode is OK": { + "pass": 1, + "fail": 0 + }, + "Result has keys: identifier , versionKey": { + "pass": 1, + "fail": 0 + }, + "identifier should be: do_2139669883022458881194": { + "pass": 1, + "fail": 0 + } + }, + "times": [ + 157 + ], + "allTests": [ + { + "Status code is 200": true, + "Status code name has string OK": true, + "id should be api.content.review": true, + "ver should be 4.0": true, + "Params has keys: resmsgid , msgid , err , status , errmsg ": true, + "Status is successful": true, + "ResponseCode is OK": true, + "Result has keys: identifier , versionKey": true, + "identifier should be: do_2139669883022458881194": true + } + ] + }, + { + "id": "adebec16-a988-4eeb-88b3-3df5b808b498", + "name": "Publish Content", + "url": "http://20.207.120.49/content/v4/publish/do_2139669883022458881194", + "time": 77, + "responseCode": { + "code": 200, + "name": "OK" + }, + "tests": { + "Status code is 200": true, + "id has string - api.content.publish.public ": true, + "Version is 4.0 ": true, + "Verify keys and data type of the response result": true, + "Status is successful ": true, + "ResponseCode is OK ": true, + "node should be equal to do_2139669883022458881194": true, + "publishStatus should be equal to Publish Event for Content Id do_2139669883022458881194 is pushed Successfully!": true + }, + "testPassFailCounts": { + "Status code is 200": { + "pass": 1, + "fail": 0 + }, + "id has string - api.content.publish.public ": { + "pass": 1, + "fail": 0 + }, + "Version is 4.0 ": { + "pass": 1, + "fail": 0 + }, + "Verify keys and data type of the response result": { + "pass": 1, + "fail": 0 + }, + "Status is successful ": { + "pass": 1, + "fail": 0 + }, + "ResponseCode is OK ": { + "pass": 1, + "fail": 0 + }, + "node should be equal to do_2139669883022458881194": { + "pass": 1, + "fail": 0 + }, + "publishStatus should be equal to Publish Event for Content Id do_2139669883022458881194 is pushed Successfully!": { + "pass": 1, + "fail": 0 + } + }, + "times": [ + 77 + ], + "allTests": [ + { + "Status code is 200": true, + "id has string - api.content.publish.public ": true, + "Version is 4.0 ": true, + "Verify keys and data type of the response result": true, + "Status is successful ": true, + "ResponseCode is OK ": true, + "node should be equal to do_2139669883022458881194": true, + "publishStatus should be equal to Publish Event for Content Id do_2139669883022458881194 is pushed Successfully!": true + } + ] + }, + { + "id": "77973bf5-c861-4005-8701-1746c00c6ae5", + "name": "Discard a Draft content", + "url": "http://20.207.120.49/content/v4/discard/do_2139669883006894081193", + "time": 99, + "responseCode": { + "code": 200, + "name": "OK" + }, + "tests": { + "Status code is 200": true, + "id has string - api.content.discard ": true, + "Version is 4.0 ": true, + "Verify keys and data type of the response result": true, + "Status is successful ": true, + "ResponseCode is OK ": true, + "message: Draft version of the content with id : do_2139669883006894081193 is discarded": true, + "identifier should be: do_2139669883006894081193": true + }, + "testPassFailCounts": { + "Status code is 200": { + "pass": 1, + "fail": 0 + }, + "id has string - api.content.discard ": { + "pass": 1, + "fail": 0 + }, + "Version is 4.0 ": { + "pass": 1, + "fail": 0 + }, + "Verify keys and data type of the response result": { + "pass": 1, + "fail": 0 + }, + "Status is successful ": { + "pass": 1, + "fail": 0 + }, + "ResponseCode is OK ": { + "pass": 1, + "fail": 0 + }, + "message: Draft version of the content with id : do_2139669883006894081193 is discarded": { + "pass": 1, + "fail": 0 + }, + "identifier should be: do_2139669883006894081193": { + "pass": 1, + "fail": 0 + } + }, + "times": [ + 99 + ], + "allTests": [ + { + "Status code is 200": true, + "id has string - api.content.discard ": true, + "Version is 4.0 ": true, + "Verify keys and data type of the response result": true, + "Status is successful ": true, + "ResponseCode is OK ": true, + "message: Draft version of the content with id : do_2139669883006894081193 is discarded": true, + "identifier should be: do_2139669883006894081193": true + } + ] + }, + { + "id": "b3bd39a7-3cb0-4bcd-88e5-1bee67d3be22", + "name": "Discard a Live content", + "url": "http://20.207.120.49/content/v4/discard/do_2139669883022458881194", + "time": 60, + "responseCode": { + "code": 400, + "name": "Bad Request" + }, + "tests": { + "Status code is 400": true, + "Params has keys: resmsgid , msgid , err , status , errmsg ": true, + "Test data type of the response and keys": true, + "id should be api.content.discard": true, + "ver should be 4.0": true, + "responseCode should be CLIENT_ERROR": true, + "params.err should be \"ERR_CONTENT_NOT_DRAFT\"": true, + "params.status should be \"failed\"": true, + "errmsg: No changes to discard for content with content id: do_2139669883022458881194 since content status isnt draft": true, + "messages should be null": true, + "Status code name has string \"Bad Request\"": true + }, + "testPassFailCounts": { + "Status code is 400": { + "pass": 1, + "fail": 0 + }, + "Params has keys: resmsgid , msgid , err , status , errmsg ": { + "pass": 1, + "fail": 0 + }, + "Test data type of the response and keys": { + "pass": 1, + "fail": 0 + }, + "id should be api.content.discard": { + "pass": 1, + "fail": 0 + }, + "ver should be 4.0": { + "pass": 1, + "fail": 0 + }, + "responseCode should be CLIENT_ERROR": { + "pass": 1, + "fail": 0 + }, + "params.err should be \"ERR_CONTENT_NOT_DRAFT\"": { + "pass": 1, + "fail": 0 + }, + "params.status should be \"failed\"": { + "pass": 1, + "fail": 0 + }, + "errmsg: No changes to discard for content with content id: do_2139669883022458881194 since content status isnt draft": { + "pass": 1, + "fail": 0 + }, + "messages should be null": { + "pass": 1, + "fail": 0 + }, + "Status code name has string \"Bad Request\"": { + "pass": 1, + "fail": 0 + } + }, + "times": [ + 60 + ], + "allTests": [ + { + "Status code is 400": true, + "Params has keys: resmsgid , msgid , err , status , errmsg ": true, + "Test data type of the response and keys": true, + "id should be api.content.discard": true, + "ver should be 4.0": true, + "responseCode should be CLIENT_ERROR": true, + "params.err should be \"ERR_CONTENT_NOT_DRAFT\"": true, + "params.status should be \"failed\"": true, + "errmsg: No changes to discard for content with content id: do_2139669883022458881194 since content status isnt draft": true, + "messages should be null": true, + "Status code name has string \"Bad Request\"": true + } + ] + }, + { + "id": "81729479-8cc5-413b-be18-def081a4ac69", + "name": "Discard a discarded content", + "url": "http://20.207.120.49/content/v4/discard/do_2139669883006894081193", + "time": 55, + "responseCode": { + "code": 404, + "name": "Not Found" + }, + "tests": { + "Status code is 404": true, + "Params has keys: resmsgid , msgid , err , status , errmsg ": true, + "Test data type of the response and keys": true, + "id should be api.content.discard": true, + "ver should be 4.0": true, + "responseCode should be RESOURCE_NOT_FOUND": true, + "params.err should be \"NOT_FOUND\"": true, + "params.status should be \"failed\"": true, + "errmsg: Error! Node(s) doesn't Exists. | [Invalid Node Id.]: do_2139669883006894081193": true, + "messages should be null": true, + "Status code name has string \"Not Found\"": true + }, + "testPassFailCounts": { + "Status code is 404": { + "pass": 1, + "fail": 0 + }, + "Params has keys: resmsgid , msgid , err , status , errmsg ": { + "pass": 1, + "fail": 0 + }, + "Test data type of the response and keys": { + "pass": 1, + "fail": 0 + }, + "id should be api.content.discard": { + "pass": 1, + "fail": 0 + }, + "ver should be 4.0": { + "pass": 1, + "fail": 0 + }, + "responseCode should be RESOURCE_NOT_FOUND": { + "pass": 1, + "fail": 0 + }, + "params.err should be \"NOT_FOUND\"": { + "pass": 1, + "fail": 0 + }, + "params.status should be \"failed\"": { + "pass": 1, + "fail": 0 + }, + "errmsg: Error! Node(s) doesn't Exists. | [Invalid Node Id.]: do_2139669883006894081193": { + "pass": 1, + "fail": 0 + }, + "messages should be null": { + "pass": 1, + "fail": 0 + }, + "Status code name has string \"Not Found\"": { + "pass": 1, + "fail": 0 + } + }, + "times": [ + 55 + ], + "allTests": [ + { + "Status code is 404": true, + "Params has keys: resmsgid , msgid , err , status , errmsg ": true, + "Test data type of the response and keys": true, + "id should be api.content.discard": true, + "ver should be 4.0": true, + "responseCode should be RESOURCE_NOT_FOUND": true, + "params.err should be \"NOT_FOUND\"": true, + "params.status should be \"failed\"": true, + "errmsg: Error! Node(s) doesn't Exists. | [Invalid Node Id.]: do_2139669883006894081193": true, + "messages should be null": true, + "Status code name has string \"Not Found\"": true + } + ] + }, + { + "id": "1c3b68d2-9ca6-405b-8c93-4980b4d8709b", + "name": "Discard an invalid content", + "url": "http://20.207.120.49/content/v4/discard/dummy", + "time": 51, + "responseCode": { + "code": 404, + "name": "Not Found" + }, + "tests": { + "Status code is 404": true, + "Params has keys: resmsgid , msgid , err , status , errmsg ": true, + "Test data type of the response and keys": true, + "id should be api.content.discard": true, + "ver should be 4.0": true, + "responseCode should be RESOURCE_NOT_FOUND": true, + "params.err should be \"NOT_FOUND\"": true, + "params.status should be \"failed\"": true, + "errmsg: Error! Node(s) doesn't Exists. | [Invalid Node Id.]: dummy": true, + "messages should be null": true, + "Status code name has string \"Not Found\"": true + }, + "testPassFailCounts": { + "Status code is 404": { + "pass": 1, + "fail": 0 + }, + "Params has keys: resmsgid , msgid , err , status , errmsg ": { + "pass": 1, + "fail": 0 + }, + "Test data type of the response and keys": { + "pass": 1, + "fail": 0 + }, + "id should be api.content.discard": { + "pass": 1, + "fail": 0 + }, + "ver should be 4.0": { + "pass": 1, + "fail": 0 + }, + "responseCode should be RESOURCE_NOT_FOUND": { + "pass": 1, + "fail": 0 + }, + "params.err should be \"NOT_FOUND\"": { + "pass": 1, + "fail": 0 + }, + "params.status should be \"failed\"": { + "pass": 1, + "fail": 0 + }, + "errmsg: Error! Node(s) doesn't Exists. | [Invalid Node Id.]: dummy": { + "pass": 1, + "fail": 0 + }, + "messages should be null": { + "pass": 1, + "fail": 0 + }, + "Status code name has string \"Not Found\"": { + "pass": 1, + "fail": 0 + } + }, + "times": [ + 51 + ], + "allTests": [ + { + "Status code is 404": true, + "Params has keys: resmsgid , msgid , err , status , errmsg ": true, + "Test data type of the response and keys": true, + "id should be api.content.discard": true, + "ver should be 4.0": true, + "responseCode should be RESOURCE_NOT_FOUND": true, + "params.err should be \"NOT_FOUND\"": true, + "params.status should be \"failed\"": true, + "errmsg: Error! Node(s) doesn't Exists. | [Invalid Node Id.]: dummy": true, + "messages should be null": true, + "Status code name has string \"Not Found\"": true + } + ] + }, + { + "id": "e5e5833e-ad36-4f81-935d-679588d5c3d5", + "name": "Create Content", + "url": "http://20.207.120.49/content/v4/create", + "time": 203, + "responseCode": { + "code": 200, + "name": "OK" + }, + "tests": {}, + "testPassFailCounts": {}, + "times": [ + 203 + ], + "allTests": [ + {} + ] + }, + { + "id": "d1b3fdb0-7352-418d-8a60-b587b3e24f19", + "name": "Upload URL", + "url": "http://20.207.120.49/content/v4/upload/url/do_2139669883165655041195", + "time": 102, + "responseCode": { + "code": 200, + "name": "OK" + }, + "tests": { + "Status code is 200": true, + "Status code name has string OK": true, + "id should be api.content.upload.url": true, + "ver should be 4.0": true, + "Params has keys: resmsgid , msgid , err , status , errmsg ": true, + "Status is successful": true, + "ResponseCode is OK": true, + "Verify keys and data type of the response result": true + }, + "testPassFailCounts": { + "Status code is 200": { + "pass": 1, + "fail": 0 + }, + "Status code name has string OK": { + "pass": 1, + "fail": 0 + }, + "id should be api.content.upload.url": { + "pass": 1, + "fail": 0 + }, + "ver should be 4.0": { + "pass": 1, + "fail": 0 + }, + "Params has keys: resmsgid , msgid , err , status , errmsg ": { + "pass": 1, + "fail": 0 + }, + "Status is successful": { + "pass": 1, + "fail": 0 + }, + "ResponseCode is OK": { + "pass": 1, + "fail": 0 + }, + "Verify keys and data type of the response result": { + "pass": 1, + "fail": 0 + } + }, + "times": [ + 102 + ], + "allTests": [ + { + "Status code is 200": true, + "Status code name has string OK": true, + "id should be api.content.upload.url": true, + "ver should be 4.0": true, + "Params has keys: resmsgid , msgid , err , status , errmsg ": true, + "Status is successful": true, + "ResponseCode is OK": true, + "Verify keys and data type of the response result": true + } + ] + }, + { + "id": "44aac33c-e0c7-4389-bb25-6cd343d58e3e", + "name": "Upload file to the URL", + "url": "https://knowlgdevbad2564c.blob.core.windows.net/sunbird-content-staging-knowlg/content/assets/do_2139669883165655041195/test.pdf?sv=2017-04-17&se=2024-01-11T21%3A30%3A28Z&sr=b&sp=w&sig=GZWnywokpRykLs0ctvQIzRmUXhQJIjzZJuoPiWNm6QM%3D", + "time": 50, + "responseCode": { + "code": 201, + "name": "Created" + }, + "tests": { + "Status code is 201": true + }, + "testPassFailCounts": { + "Status code is 201": { + "pass": 1, + "fail": 0 + } + }, + "times": [ + 50 + ], + "allTests": [ + { + "Status code is 201": true + } + ] + }, + { + "id": "2546c25d-c5a7-4a95-a823-0f95eb352191", + "name": "Update the content with URL and mime type", + "url": "http://20.207.120.49/content/v4/upload/do_2139669883165655041195", + "time": 169, + "responseCode": { + "code": 200, + "name": "OK" + }, + "tests": { + "Status code is 200": true, + "Status code name has string OK": true, + "id should be api.content.upload": true, + "ver should be 4.0": true, + "Params has keys: resmsgid , msgid , err , status , errmsg ": true, + "Status is successful": true, + "ResponseCode is OK": true, + "Result has keys: identifier , artifactUrl , content_url , node_id , versionKey ": true, + "artifactUrl should be: https://knowlgdevbad2564c.blob.core.windows.net/sunbird-content-staging-knowlg/content/assets/do_2139669883165655041195/test.pdf": true, + "content_url should be: https://knowlgdevbad2564c.blob.core.windows.net/sunbird-content-staging-knowlg/content/assets/do_2139669883165655041195/test.pdf": true, + "identifier should be: do_2139669883165655041195": true, + "node_id should be: do_2139669883165655041195": true + }, + "testPassFailCounts": { + "Status code is 200": { + "pass": 1, + "fail": 0 + }, + "Status code name has string OK": { + "pass": 1, + "fail": 0 + }, + "id should be api.content.upload": { + "pass": 1, + "fail": 0 + }, + "ver should be 4.0": { + "pass": 1, + "fail": 0 + }, + "Params has keys: resmsgid , msgid , err , status , errmsg ": { + "pass": 1, + "fail": 0 + }, + "Status is successful": { + "pass": 1, + "fail": 0 + }, + "ResponseCode is OK": { + "pass": 1, + "fail": 0 + }, + "Result has keys: identifier , artifactUrl , content_url , node_id , versionKey ": { + "pass": 1, + "fail": 0 + }, + "artifactUrl should be: https://knowlgdevbad2564c.blob.core.windows.net/sunbird-content-staging-knowlg/content/assets/do_2139669883165655041195/test.pdf": { + "pass": 1, + "fail": 0 + }, + "content_url should be: https://knowlgdevbad2564c.blob.core.windows.net/sunbird-content-staging-knowlg/content/assets/do_2139669883165655041195/test.pdf": { + "pass": 1, + "fail": 0 + }, + "identifier should be: do_2139669883165655041195": { + "pass": 1, + "fail": 0 + }, + "node_id should be: do_2139669883165655041195": { + "pass": 1, + "fail": 0 + } + }, + "times": [ + 169 + ], + "allTests": [ + { + "Status code is 200": true, + "Status code name has string OK": true, + "id should be api.content.upload": true, + "ver should be 4.0": true, + "Params has keys: resmsgid , msgid , err , status , errmsg ": true, + "Status is successful": true, + "ResponseCode is OK": true, + "Result has keys: identifier , artifactUrl , content_url , node_id , versionKey ": true, + "artifactUrl should be: https://knowlgdevbad2564c.blob.core.windows.net/sunbird-content-staging-knowlg/content/assets/do_2139669883165655041195/test.pdf": true, + "content_url should be: https://knowlgdevbad2564c.blob.core.windows.net/sunbird-content-staging-knowlg/content/assets/do_2139669883165655041195/test.pdf": true, + "identifier should be: do_2139669883165655041195": true, + "node_id should be: do_2139669883165655041195": true + } + ] + }, + { + "id": "a460684e-426f-46dc-acf5-9b9c58e471f6", + "name": "Submit for Review", + "url": "http://20.207.120.49/content/v4/review/do_2139669883165655041195", + "time": 178, + "responseCode": { + "code": 200, + "name": "OK" + }, + "tests": { + "Status code is 200": true, + "Status code name has string OK": true, + "id should be api.content.review": true, + "ver should be 4.0": true, + "Params has keys: resmsgid , msgid , err , status , errmsg ": true, + "Status is successful": true, + "ResponseCode is OK": true, + "Result has keys: identifier , versionKey": true, + "identifier should be: do_2139669883165655041195": true + }, + "testPassFailCounts": { + "Status code is 200": { + "pass": 1, + "fail": 0 + }, + "Status code name has string OK": { + "pass": 1, + "fail": 0 + }, + "id should be api.content.review": { + "pass": 1, + "fail": 0 + }, + "ver should be 4.0": { + "pass": 1, + "fail": 0 + }, + "Params has keys: resmsgid , msgid , err , status , errmsg ": { + "pass": 1, + "fail": 0 + }, + "Status is successful": { + "pass": 1, + "fail": 0 + }, + "ResponseCode is OK": { + "pass": 1, + "fail": 0 + }, + "Result has keys: identifier , versionKey": { + "pass": 1, + "fail": 0 + }, + "identifier should be: do_2139669883165655041195": { + "pass": 1, + "fail": 0 + } + }, + "times": [ + 178 + ], + "allTests": [ + { + "Status code is 200": true, + "Status code name has string OK": true, + "id should be api.content.review": true, + "ver should be 4.0": true, + "Params has keys: resmsgid , msgid , err , status , errmsg ": true, + "Status is successful": true, + "ResponseCode is OK": true, + "Result has keys: identifier , versionKey": true, + "identifier should be: do_2139669883165655041195": true + } + ] + }, + { + "id": "e5f248f9-10d9-4284-8c23-26f428133c5d", + "name": "Publish Content", + "url": "http://20.207.120.49/content/v4/publish/do_2139669883165655041195", + "time": 75, + "responseCode": { + "code": 200, + "name": "OK" + }, + "tests": { + "Status code is 200": true, + "id has string - api.content.publish.public ": true, + "Version is 4.0 ": true, + "Verify keys and data type of the response result": true, + "Status is successful ": true, + "ResponseCode is OK ": true, + "node should be equal to do_2139669883165655041195": true, + "publishStatus should be equal to Publish Event for Content Id do_2139669883165655041195 is pushed Successfully!": true + }, + "testPassFailCounts": { + "Status code is 200": { + "pass": 1, + "fail": 0 + }, + "id has string - api.content.publish.public ": { + "pass": 1, + "fail": 0 + }, + "Version is 4.0 ": { + "pass": 1, + "fail": 0 + }, + "Verify keys and data type of the response result": { + "pass": 1, + "fail": 0 + }, + "Status is successful ": { + "pass": 1, + "fail": 0 + }, + "ResponseCode is OK ": { + "pass": 1, + "fail": 0 + }, + "node should be equal to do_2139669883165655041195": { + "pass": 1, + "fail": 0 + }, + "publishStatus should be equal to Publish Event for Content Id do_2139669883165655041195 is pushed Successfully!": { + "pass": 1, + "fail": 0 + } + }, + "times": [ + 75 + ], + "allTests": [ + { + "Status code is 200": true, + "id has string - api.content.publish.public ": true, + "Version is 4.0 ": true, + "Verify keys and data type of the response result": true, + "Status is successful ": true, + "ResponseCode is OK ": true, + "node should be equal to do_2139669883165655041195": true, + "publishStatus should be equal to Publish Event for Content Id do_2139669883165655041195 is pushed Successfully!": true + } + ] + }, + { + "id": "e8bea0d9-37e3-4d20-8714-5172c5e6230c", + "name": "Copy Valid Content", + "url": "http://20.207.120.49/content/v4/copy/do_2139669883165655041195", + "time": 242, + "responseCode": { + "code": 200, + "name": "OK" + }, + "tests": { + "Status code is 200": true, + "Status code name has string OK": true, + "id should be api.content.copy": true, + "ver should be 4.0": true, + "Params has keys: resmsgid , msgid , err , status , errmsg ": true, + "Status is successful": true, + "ResponseCode is OK": true, + "Result has keys: identifier , node_id , versionKey": true, + "[object Object]": true + }, + "testPassFailCounts": { + "Status code is 200": { + "pass": 1, + "fail": 0 + }, + "Status code name has string OK": { + "pass": 1, + "fail": 0 + }, + "id should be api.content.copy": { + "pass": 1, + "fail": 0 + }, + "ver should be 4.0": { + "pass": 1, + "fail": 0 + }, + "Params has keys: resmsgid , msgid , err , status , errmsg ": { + "pass": 1, + "fail": 0 + }, + "Status is successful": { + "pass": 1, + "fail": 0 + }, + "ResponseCode is OK": { + "pass": 1, + "fail": 0 + }, + "Result has keys: identifier , node_id , versionKey": { + "pass": 1, + "fail": 0 + }, + "[object Object]": { + "pass": 1, + "fail": 0 + } + }, + "times": [ + 242 + ], + "allTests": [ + { + "Status code is 200": true, + "Status code name has string OK": true, + "id should be api.content.copy": true, + "ver should be 4.0": true, + "Params has keys: resmsgid , msgid , err , status , errmsg ": true, + "Status is successful": true, + "ResponseCode is OK": true, + "Result has keys: identifier , node_id , versionKey": true, + "[object Object]": true + } + ] + }, + { + "id": "4eb62051-c0c0-481d-87d0-47d5fa7e9f51", + "name": "Copy invalid Content", + "url": "http://20.207.120.49/content/v4/copy/dummy", + "time": 99, + "responseCode": { + "code": 404, + "name": "Not Found" + }, + "tests": { + "Status code is 404": true, + "Params has keys: resmsgid , msgid , err , status , errmsg ": true, + "Test data type of the response and keys": true, + "id should be api.content.copy": true, + "ver should be 4.0": true, + "responseCode should be RESOURCE_NOT_FOUND": true, + "params.err should be \"NOT_FOUND\"": true, + "params.status should be \"failed\"": true, + "errmsg: Error! Node(s) doesn't Exists. | [Invalid Node Id.]: dummy": true, + "messages should be null": true, + "Status code name has string \"Not Found\"": true + }, + "testPassFailCounts": { + "Status code is 404": { + "pass": 1, + "fail": 0 + }, + "Params has keys: resmsgid , msgid , err , status , errmsg ": { + "pass": 1, + "fail": 0 + }, + "Test data type of the response and keys": { + "pass": 1, + "fail": 0 + }, + "id should be api.content.copy": { + "pass": 1, + "fail": 0 + }, + "ver should be 4.0": { + "pass": 1, + "fail": 0 + }, + "responseCode should be RESOURCE_NOT_FOUND": { + "pass": 1, + "fail": 0 + }, + "params.err should be \"NOT_FOUND\"": { + "pass": 1, + "fail": 0 + }, + "params.status should be \"failed\"": { + "pass": 1, + "fail": 0 + }, + "errmsg: Error! Node(s) doesn't Exists. | [Invalid Node Id.]: dummy": { + "pass": 1, + "fail": 0 + }, + "messages should be null": { + "pass": 1, + "fail": 0 + }, + "Status code name has string \"Not Found\"": { + "pass": 1, + "fail": 0 + } + }, + "times": [ + 99 + ], + "allTests": [ + { + "Status code is 404": true, + "Params has keys: resmsgid , msgid , err , status , errmsg ": true, + "Test data type of the response and keys": true, + "id should be api.content.copy": true, + "ver should be 4.0": true, + "responseCode should be RESOURCE_NOT_FOUND": true, + "params.err should be \"NOT_FOUND\"": true, + "params.status should be \"failed\"": true, + "errmsg: Error! Node(s) doesn't Exists. | [Invalid Node Id.]: dummy": true, + "messages should be null": true, + "Status code name has string \"Not Found\"": true + } + ] + }, + { + "id": "5a568218-c94c-439e-b76f-20c60d6b530c", + "name": "Copy Valid Content with missing fields", + "url": "http://20.207.120.49/content/v4/copy/do_2139669883165655041195", + "time": 71, + "responseCode": { + "code": 400, + "name": "Bad Request" + }, + "tests": { + "Status code is 400": true, + "Params has keys: resmsgid , msgid , err , status , errmsg ": true, + "Test data type of the response and keys": true, + "id should be api.content.copy": true, + "ver should be 4.0": true, + "responseCode should be CLIENT_ERROR": true, + "params.err should be \"ERR_INVALID_REQUEST\"": true, + "params.status should be \"failed\"": true, + "errmsg: Please provide valid value for List(createdBy, createdFor, organisation, framework)": true, + "messages should be null": true, + "Status code name has string \"Bad Request\"": true + }, + "testPassFailCounts": { + "Status code is 400": { + "pass": 1, + "fail": 0 + }, + "Params has keys: resmsgid , msgid , err , status , errmsg ": { + "pass": 1, + "fail": 0 + }, + "Test data type of the response and keys": { + "pass": 1, + "fail": 0 + }, + "id should be api.content.copy": { + "pass": 1, + "fail": 0 + }, + "ver should be 4.0": { + "pass": 1, + "fail": 0 + }, + "responseCode should be CLIENT_ERROR": { + "pass": 1, + "fail": 0 + }, + "params.err should be \"ERR_INVALID_REQUEST\"": { + "pass": 1, + "fail": 0 + }, + "params.status should be \"failed\"": { + "pass": 1, + "fail": 0 + }, + "errmsg: Please provide valid value for List(createdBy, createdFor, organisation, framework)": { + "pass": 1, + "fail": 0 + }, + "messages should be null": { + "pass": 1, + "fail": 0 + }, + "Status code name has string \"Bad Request\"": { + "pass": 1, + "fail": 0 + } + }, + "times": [ + 71 + ], + "allTests": [ + { + "Status code is 400": true, + "Params has keys: resmsgid , msgid , err , status , errmsg ": true, + "Test data type of the response and keys": true, + "id should be api.content.copy": true, + "ver should be 4.0": true, + "responseCode should be CLIENT_ERROR": true, + "params.err should be \"ERR_INVALID_REQUEST\"": true, + "params.status should be \"failed\"": true, + "errmsg: Please provide valid value for List(createdBy, createdFor, organisation, framework)": true, + "messages should be null": true, + "Status code name has string \"Bad Request\"": true + } + ] + }, + { + "id": "8b258be8-91f2-4d14-8072-def18e7f8500", + "name": "Import Valid Content", + "url": "http://20.207.120.49/content/v4/import", + "time": 82, + "responseCode": { + "code": 200, + "name": "OK" + }, + "tests": { + "Status code is 200": true, + "id has string - api.content.import": true, + "Version is 4.0 ": true, + "Verify keys and data type of the response result": true, + "Status is successful ": true, + "ResponseCode is OK ": true + }, + "testPassFailCounts": { + "Status code is 200": { + "pass": 1, + "fail": 0 + }, + "id has string - api.content.import": { + "pass": 1, + "fail": 0 + }, + "Version is 4.0 ": { + "pass": 1, + "fail": 0 + }, + "Verify keys and data type of the response result": { + "pass": 1, + "fail": 0 + }, + "Status is successful ": { + "pass": 1, + "fail": 0 + }, + "ResponseCode is OK ": { + "pass": 1, + "fail": 0 + } + }, + "times": [ + 82 + ], + "allTests": [ + { + "Status code is 200": true, + "id has string - api.content.import": true, + "Version is 4.0 ": true, + "Verify keys and data type of the response result": true, + "Status is successful ": true, + "ResponseCode is OK ": true + } + ] + }, + { + "id": "7b62a38b-b1a7-462c-b456-df2c49635f37", + "name": "Import Content with missing mandatory fields", + "url": "http://20.207.120.49/content/v4/import", + "time": 74, + "responseCode": { + "code": 400, + "name": "Bad Request" + }, + "tests": { + "Status code is 400": true, + "Status code name has string Bad Request": true, + "id has string - api.content.import": true, + "Version is 4.0 ": true, + "Params has keys: resmsgid , msgid , err , status , errmsg ": true, + "err is ERR_REQUIRED_PROPS_VALIDATION": true, + "errmsg: Validation Failed! Mandatory Properties Are [\"name\",\"code\",\"mimeType\",\"primaryCategory\",\"artifactUrl\",\"framework\"]": true, + "Status is failed": true, + "ResponseCode is CLIENT_ERROR": true + }, + "testPassFailCounts": { + "Status code is 400": { + "pass": 1, + "fail": 0 + }, + "Status code name has string Bad Request": { + "pass": 1, + "fail": 0 + }, + "id has string - api.content.import": { + "pass": 1, + "fail": 0 + }, + "Version is 4.0 ": { + "pass": 1, + "fail": 0 + }, + "Params has keys: resmsgid , msgid , err , status , errmsg ": { + "pass": 1, + "fail": 0 + }, + "err is ERR_REQUIRED_PROPS_VALIDATION": { + "pass": 1, + "fail": 0 + }, + "errmsg: Validation Failed! Mandatory Properties Are [\"name\",\"code\",\"mimeType\",\"primaryCategory\",\"artifactUrl\",\"framework\"]": { + "pass": 1, + "fail": 0 + }, + "Status is failed": { + "pass": 1, + "fail": 0 + }, + "ResponseCode is CLIENT_ERROR": { + "pass": 1, + "fail": 0 + } + }, + "times": [ + 74 + ], + "allTests": [ + { + "Status code is 400": true, + "Status code name has string Bad Request": true, + "id has string - api.content.import": true, + "Version is 4.0 ": true, + "Params has keys: resmsgid , msgid , err , status , errmsg ": true, + "err is ERR_REQUIRED_PROPS_VALIDATION": true, + "errmsg: Validation Failed! Mandatory Properties Are [\"name\",\"code\",\"mimeType\",\"primaryCategory\",\"artifactUrl\",\"framework\"]": true, + "Status is failed": true, + "ResponseCode is CLIENT_ERROR": true + } + ] + }, + { + "id": "bd19ca27-13fc-45a5-975c-2c3007c1f2d2", + "name": "Import Content with missing Artifact URL", + "url": "http://20.207.120.49/content/v4/import", + "time": 88, + "responseCode": { + "code": 400, + "name": "Bad Request" + }, + "tests": { + "Status code is 400": true, + "Status code name has string Bad Request": true, + "id has string - api.content.import": true, + "Version is 4.0 ": true, + "Params has keys: resmsgid , msgid , err , status , errmsg ": true, + "err is ERR_REQUIRED_PROPS_VALIDATION": true, + "errmsg: Validation Failed! Mandatory Properties Are [\"name\",\"code\",\"mimeType\",\"primaryCategory\",\"artifactUrl\",\"framework\"] | Required Property's Missing For": true, + "Status is failed": true, + "ResponseCode is CLIENT_ERROR": true + }, + "testPassFailCounts": { + "Status code is 400": { + "pass": 1, + "fail": 0 + }, + "Status code name has string Bad Request": { + "pass": 1, + "fail": 0 + }, + "id has string - api.content.import": { + "pass": 1, + "fail": 0 + }, + "Version is 4.0 ": { + "pass": 1, + "fail": 0 + }, + "Params has keys: resmsgid , msgid , err , status , errmsg ": { + "pass": 1, + "fail": 0 + }, + "err is ERR_REQUIRED_PROPS_VALIDATION": { + "pass": 1, + "fail": 0 + }, + "errmsg: Validation Failed! Mandatory Properties Are [\"name\",\"code\",\"mimeType\",\"primaryCategory\",\"artifactUrl\",\"framework\"] | Required Property's Missing For": { + "pass": 1, + "fail": 0 + }, + "Status is failed": { + "pass": 1, + "fail": 0 + }, + "ResponseCode is CLIENT_ERROR": { + "pass": 1, + "fail": 0 + } + }, + "times": [ + 88 + ], + "allTests": [ + { + "Status code is 400": true, + "Status code name has string Bad Request": true, + "id has string - api.content.import": true, + "Version is 4.0 ": true, + "Params has keys: resmsgid , msgid , err , status , errmsg ": true, + "err is ERR_REQUIRED_PROPS_VALIDATION": true, + "errmsg: Validation Failed! Mandatory Properties Are [\"name\",\"code\",\"mimeType\",\"primaryCategory\",\"artifactUrl\",\"framework\"] | Required Property's Missing For": true, + "Status is failed": true, + "ResponseCode is CLIENT_ERROR": true + } + ] + }, + { + "id": "796de2f2-15aa-4bf5-a158-dac13094efe9", + "name": "Import Content with missing Artifact URL Copy", + "url": "http://20.207.120.49/content/v4/import", + "time": 77, + "responseCode": { + "code": 400, + "name": "Bad Request" + }, + "tests": { + "Status code is 400": true, + "Status code name has string Bad Request": true, + "id has string - api.content.import": true, + "Version is 4.0 ": true, + "Params has keys: resmsgid , msgid , err , status , errmsg ": true, + "err is ERR_INVALID_IMPORT_REQUEST": true, + "errmsg: Invalid Request! Please Provide Valid Request.": true, + "Status is failed": true, + "ResponseCode is CLIENT_ERROR": true + }, + "testPassFailCounts": { + "Status code is 400": { + "pass": 1, + "fail": 0 + }, + "Status code name has string Bad Request": { + "pass": 1, + "fail": 0 + }, + "id has string - api.content.import": { + "pass": 1, + "fail": 0 + }, + "Version is 4.0 ": { + "pass": 1, + "fail": 0 + }, + "Params has keys: resmsgid , msgid , err , status , errmsg ": { + "pass": 1, + "fail": 0 + }, + "err is ERR_INVALID_IMPORT_REQUEST": { + "pass": 1, + "fail": 0 + }, + "errmsg: Invalid Request! Please Provide Valid Request.": { + "pass": 1, + "fail": 0 + }, + "Status is failed": { + "pass": 1, + "fail": 0 + }, + "ResponseCode is CLIENT_ERROR": { + "pass": 1, + "fail": 0 + } + }, + "times": [ + 77 + ], + "allTests": [ + { + "Status code is 400": true, + "Status code name has string Bad Request": true, + "id has string - api.content.import": true, + "Version is 4.0 ": true, + "Params has keys: resmsgid , msgid , err , status , errmsg ": true, + "err is ERR_INVALID_IMPORT_REQUEST": true, + "errmsg: Invalid Request! Please Provide Valid Request.": true, + "Status is failed": true, + "ResponseCode is CLIENT_ERROR": true + } + ] + } + ], + "count": 1, + "totalTime": 11449, + "collection": { + "requests": [ + { + "id": "e0531555-5b64-4dba-8914-c94cf6efa641", + "method": "POST" + }, + { + "id": "2417a770-1de7-42f5-8c0f-a65e44fabfd0", + "method": "POST" + }, + { + "id": "76ba37f5-a562-4f7d-a57f-b81c950a9797", + "method": "POST" + }, + { + "id": "b443e65f-d76b-4028-8288-6d3d3dd1a237", + "method": "POST" + }, + { + "id": "f27343cb-3121-4c6e-9da3-bd101c144435", + "method": "POST" + }, + { + "id": "49fc6d78-a868-44f7-a119-764dc783fdcf", + "method": "PUT" + }, + { + "id": "e8410bfe-e9b0-4a37-9223-efd544d9de44", + "method": "POST" + }, + { + "id": "d8fd3947-5059-40ae-b7d1-aceca4f27b6e", + "method": "POST" + }, + { + "id": "d32f4f4e-dafd-4822-bf0d-499a9ab87b53", + "method": "POST" + }, + { + "id": "75e013e1-87e9-4d3d-afd4-570900130b12", + "method": "POST" + }, + { + "id": "752bde5f-efd7-4bf0-ae58-f1bdd9da8524", + "method": "POST" + }, + { + "id": "4076be5e-bbbf-4269-96c9-8eaf16a00586", + "method": "POST" + }, + { + "id": "816b8cf6-e7a1-480f-8bdd-f36c354f7807", + "method": "POST" + }, + { + "id": "90cdd04f-9edb-4b69-aa48-8e51062e3f36", + "method": "POST" + }, + { + "id": "b6bc2732-db0e-42fb-ab05-2cb1619c4540", + "method": "POST" + }, + { + "id": "d8915731-839c-4887-9c17-5cb2f9736bf8", + "method": "POST" + }, + { + "id": "4919a05c-945f-45b6-b4ea-349884bba956", + "method": "POST" + }, + { + "id": "e2c6b0a4-5d6a-4dcc-b27a-9300c5d7aeb5", + "method": "POST" + }, + { + "id": "763df56d-b2f0-4edb-9641-b29217a70f76", + "method": "POST" + }, + { + "id": "5d8cd160-7d8d-48e4-b5d2-1c0be422cdfa", + "method": "POST" + }, + { + "id": "59bb505f-7868-4ab8-9e7b-81e47815c2c8", + "method": "POST" + }, + { + "id": "540ca9e4-56fe-4b10-b18b-b9950b15ec03", + "method": "POST" + }, + { + "id": "f49a6769-b1d0-417b-abd4-ae6430e738df", + "method": "POST" + }, + { + "id": "cee864fa-a405-4b52-ade5-9160b6bc0f2c", + "method": "POST" + }, + { + "id": "a02d4ea1-b38b-49a6-9a79-a17fbf73554a", + "method": "POST" + }, + { + "id": "07d3cb60-e883-40ce-a0b6-d187e70a64be", + "method": "POST" + }, + { + "id": "e8ad383b-903b-4a5e-8f5d-ae8f32cc2a6f", + "method": "POST" + }, + { + "id": "37ba844e-63fa-43cb-9a6e-c126eb783508", + "method": "POST" + }, + { + "id": "684c3d80-d6ae-45d5-9ff0-61f4477546e6", + "method": "POST" + }, + { + "id": "e7b12704-f8fa-4519-94a8-74c05e81ab55", + "method": "POST" + }, + { + "id": "0eb6396c-43b8-427f-aaec-cf4439dd5689", + "method": "POST" + }, + { + "id": "9c3e71db-a08e-4bbb-aec9-225df9e91b73", + "method": "POST" + }, + { + "id": "c59ba53c-cfb6-46bf-bdaa-aca28f3380ac", + "method": "POST" + }, + { + "id": "c6da426a-cfec-4535-a8ec-baa2d837f3b6", + "method": "POST" + }, + { + "id": "6f1b65ae-d56f-4bd2-9f44-28a1b690ca92", + "method": "POST" + }, + { + "id": "ad83e2ed-019c-4cf6-ad27-ab2719e6d6fa", + "method": "PATCH" + }, + { + "id": "4c302c74-b349-4f58-b08f-48b90c4010a9", + "method": "PATCH" + }, + { + "id": "ad37ce29-bb18-494c-b03f-820743f4d02e", + "method": "PATCH" + }, + { + "id": "cce4163f-828d-465d-9075-d2290bd5d4e3", + "method": "PATCH" + }, + { + "id": "fc71ffa7-b858-4933-9cbf-9e3301fe01fb", + "method": "PATCH" + }, + { + "id": "776e4fd6-a040-4820-85ff-4140fb062833", + "method": "PATCH" + }, + { + "id": "9c358cd1-39a1-40ef-832a-5e58b061b586", + "method": "POST" + }, + { + "id": "ae9c5dba-9bbe-4fa7-9d77-b85bf7595e0f", + "method": "GET" + }, + { + "id": "efbe493a-7190-4a89-b021-a6197772b127", + "method": "GET" + }, + { + "id": "f0f49c82-729d-4b4a-9fb4-83f7146f61a2", + "method": "GET" + }, + { + "id": "013a26b0-e16f-48ca-b4d0-4b35813ef2eb", + "method": "POST" + }, + { + "id": "61a70f42-5935-4ee5-b2b5-d953bc1504b9", + "method": "POST" + }, + { + "id": "edba766e-ffb2-40fc-9e6e-3298c7ee1b41", + "method": "PUT" + }, + { + "id": "1dfb22f6-3508-439a-891f-c51af43b099b", + "method": "POST" + }, + { + "id": "d27d3ffc-1893-42c3-9f8d-2e84e49a9772", + "method": "POST" + }, + { + "id": "dd04a728-de9d-4d3f-bd66-d694fc39bc16", + "method": "POST" + }, + { + "id": "c7b73ea9-144a-4a10-83e0-a95be30efa1b", + "method": "POST" + }, + { + "id": "bed4440b-ee2f-4275-ad8b-8ff8e49e4510", + "method": "POST" + }, + { + "id": "0484a859-d4d4-4bd0-8c2c-9fe53ed0d76c", + "method": "POST" + }, + { + "id": "fe83f146-ec9a-4ee0-9560-b6538557b330", + "method": "POST" + }, + { + "id": "432905a8-2546-4d1d-a85b-6ada019ee1b0", + "method": "PUT" + }, + { + "id": "ac6cbb41-03e8-43ec-9197-4ac621b07f19", + "method": "POST" + }, + { + "id": "918e5534-c19c-4ed4-a373-fdecf602f12f", + "method": "POST" + }, + { + "id": "96c68536-10b7-4302-8bc9-383716adee26", + "method": "POST" + }, + { + "id": "86b6590f-2362-44a2-94d6-b4466f67f5c8", + "method": "POST" + }, + { + "id": "a076a6c7-4c84-4508-9964-2c204c989028", + "method": "POST" + }, + { + "id": "8a6ad455-3fa6-4d75-8202-d08037a5c2d7", + "method": "POST" + }, + { + "id": "d5bdbe0a-5865-4a5d-9844-b6e1fd142a9f", + "method": "POST" + }, + { + "id": "b28e70ae-388f-40e8-852c-db8521375ca0", + "method": "POST" + }, + { + "id": "d1fd2b59-37de-47ac-9825-bfb04a6c27a3", + "method": "PUT" + }, + { + "id": "6f40dae4-e936-48ae-83a3-c8235cce07e4", + "method": "POST" + }, + { + "id": "f3bd2d5f-0f13-461b-b67f-3a6bb6b7c305", + "method": "POST" + }, + { + "id": "2c4d97c8-c6aa-49db-af55-ab0db27f6c02", + "method": "POST" + }, + { + "id": "e07165a3-a4dd-45bc-ada9-59f88190a15d", + "method": "POST" + }, + { + "id": "b62e502e-e0c9-4092-a967-4097b2ed9bae", + "method": "POST" + }, + { + "id": "3da36533-9fb1-4881-ae9d-c45a8c21da48", + "method": "POST" + }, + { + "id": "6aba0498-231a-46f7-bbdc-a76070be8a14", + "method": "PUT" + }, + { + "id": "e99174e8-45a3-4a06-bc14-b0b35ee21fbd", + "method": "POST" + }, + { + "id": "d6847c1b-2446-4c49-aae1-79e173910ee3", + "method": "POST" + }, + { + "id": "0dd80703-93ff-408e-84cc-530cded60e59", + "method": "POST" + }, + { + "id": "335eb63f-e70f-4722-9e5d-68f8afce4000", + "method": "POST" + }, + { + "id": "c2843d38-1d66-4307-86ce-15bbda40af1a", + "method": "DELETE" + }, + { + "id": "fb65e4e6-1ae3-4cbb-91e3-95f039a4ccd7", + "method": "DELETE" + }, + { + "id": "f975b7b2-1e7e-4848-9af7-83908a94076d", + "method": "DELETE" + }, + { + "id": "d28cdd62-9094-449b-88d8-2b183318ec39", + "method": "DELETE" + }, + { + "id": "cb4495f7-94a5-4654-9fed-8ab70868eb23", + "method": "POST" + }, + { + "id": "7e8a3f2d-c2e6-4f93-8667-66fe7b805d52", + "method": "POST" + }, + { + "id": "2fc50dc9-8c17-4fd7-bc29-77e6dd6d307d", + "method": "POST" + }, + { + "id": "d7f392a9-45a5-4785-a194-ab65c547ca6f", + "method": "PUT" + }, + { + "id": "7fdf72c2-dc74-4e0a-8aa6-13123b9392f0", + "method": "POST" + }, + { + "id": "a6d8e9a5-4188-4f3d-8b79-ef7ae040ebcf", + "method": "POST" + }, + { + "id": "adebec16-a988-4eeb-88b3-3df5b808b498", + "method": "POST" + }, + { + "id": "77973bf5-c861-4005-8701-1746c00c6ae5", + "method": "DELETE" + }, + { + "id": "b3bd39a7-3cb0-4bcd-88e5-1bee67d3be22", + "method": "DELETE" + }, + { + "id": "81729479-8cc5-413b-be18-def081a4ac69", + "method": "DELETE" + }, + { + "id": "1c3b68d2-9ca6-405b-8c93-4980b4d8709b", + "method": "DELETE" + }, + { + "id": "e5e5833e-ad36-4f81-935d-679588d5c3d5", + "method": "POST" + }, + { + "id": "d1b3fdb0-7352-418d-8a60-b587b3e24f19", + "method": "POST" + }, + { + "id": "44aac33c-e0c7-4389-bb25-6cd343d58e3e", + "method": "PUT" + }, + { + "id": "2546c25d-c5a7-4a95-a823-0f95eb352191", + "method": "POST" + }, + { + "id": "a460684e-426f-46dc-acf5-9b9c58e471f6", + "method": "POST" + }, + { + "id": "e5f248f9-10d9-4284-8c23-26f428133c5d", + "method": "POST" + }, + { + "id": "e8bea0d9-37e3-4d20-8714-5172c5e6230c", + "method": "POST" + }, + { + "id": "4eb62051-c0c0-481d-87d0-47d5fa7e9f51", + "method": "POST" + }, + { + "id": "5a568218-c94c-439e-b76f-20c60d6b530c", + "method": "POST" + }, + { + "id": "8b258be8-91f2-4d14-8072-def18e7f8500", + "method": "POST" + }, + { + "id": "7b62a38b-b1a7-462c-b456-df2c49635f37", + "method": "POST" + }, + { + "id": "bd19ca27-13fc-45a5-975c-2c3007c1f2d2", + "method": "POST" + }, + { + "id": "796de2f2-15aa-4bf5-a158-dac13094efe9", + "method": "POST" + } + ] + } +} \ No newline at end of file diff --git a/taxonomy-api/api-tests/Collections/Framework API(s).postman_collection.json b/taxonomy-api/api-tests/Collections/Framework API(s).postman_collection.json index cb1003a02..4a5e85aec 100644 --- a/taxonomy-api/api-tests/Collections/Framework API(s).postman_collection.json +++ b/taxonomy-api/api-tests/Collections/Framework API(s).postman_collection.json @@ -1,11 +1,11 @@ { "info": { - "_postman_id": "cf546380-1eff-4ed7-92ee-ee2d382986f7", + "_postman_id": "cfaa96c3-6dd5-46c6-948f-2a3b33524d75", "name": "Framework API(s)", - "description": "The Framework API resources is basically a supporting data structure which serves as a template \n- It can be used in places where the structure remains the same but only the usage changes as per the requirement.\n- These resources are used to create, update, read, search, the objects like channels, frameworks, catergories, terms\n- The Hierarchy is as: Framework-->Category-->Terms\n - Category: An abstract classification of the terms partitioned according to requirement\n - Terms: Refers to a keyword or a phrase to descibe a Concept\n- [TestCases](https://www.getpostman.com/collections/10a84f4c27c0b45f690b)", + "description": "The Framework API resources is basically a supporting data structure which serves as a template\n\n- It can be used in places where the structure remains the same but only the usage changes as per the requirement.\n- These resources are used to create, update, read, search, the objects like channels, frameworks, catergories, terms\n- The Hierarchy is as: FrameworkCategoryTerms\n - Category: An abstract classification of the terms partitioned according to requirement\n - Terms: Refers to a keyword or a phrase to descibe a Concept\n- [TestCases](https://www.getpostman.com/collections/10a84f4c27c0b45f690b)", "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json", "_exporter_id": "19432603", - "_collection_link": "https://blue-flare-639335.postman.co/workspace/API-automation-Knowlg~3ae6d444-e850-468d-bdb0-8be163d62aea/collection/19432603-cf546380-1eff-4ed7-92ee-ee2d382986f7?action=share&source=collection_link&creator=19432603" + "_collection_link": "https://blue-flare-639335.postman.co/workspace/API-automation-Knowlg~3ae6d444-e850-468d-bdb0-8be163d62aea/collection/19432603-cfaa96c3-6dd5-46c6-948f-2a3b33524d75?action=share&source=collection_link&creator=19432603" }, "item": [ { @@ -21,7 +21,64 @@ "name": "Positive", "item": [ { - "name": "Create Channel", + "name": "Create Channel with mandatory fields", + "event": [ + { + "listen": "prerequest", + "script": { + "exec": [ + "pm.environment.set(\"channel\", \"channel_ch4\");" + ], + "type": "text/javascript" + } + }, + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json()\r", + "\r", + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "\r", + "pm.test(\"id has string - api.channel.create \", function () {\r", + " pm.expect(jsonResponse.id).to.be.equal(\"api.channel.create\");\r", + "});\r", + "\r", + "pm.test(\"Version is 3.0 \", function () {\r", + " pm.expect(jsonResponse.ver).to.be.equal(\"3.0\");\r", + "});\r", + "\r", + "pm.test(\"Verify keys and data type of the response result\", () => {\r", + " pm.expect(jsonResponse.params).to.have.all.keys('resmsgid','msgid','status', 'err','errmsg');\r", + " pm.expect(jsonResponse.params.resmsgid).to.be.a(\"string\");\r", + " pm.expect(jsonResponse.params.msgid).to.be.a(\"null\"); \r", + " pm.expect(jsonResponse.params.status).to.be.a(\"string\");\r", + " pm.expect(jsonResponse.params.err).to.be.a(\"null\");\r", + " pm.expect(jsonResponse.params.errmsg).to.be.a(\"null\");\r", + "});\r", + "\r", + "pm.test(\"Status is successful \", function () {\r", + " pm.expect(jsonResponse.params.status).to.be.equal(\"successful\");\r", + "});\r", + "\r", + "pm.test(\"ResponseCode is OK \", function () {\r", + " pm.expect(jsonResponse.responseCode).to.be.equal(\"OK\");\r", + "});\r", + "\r", + "pm.test(\"Verify keys and data type of the response result\", () => {\r", + " pm.expect(jsonResponse.result).to.have.all.keys('identifier','node_id');\r", + " pm.expect(jsonResponse.result.node_id).to.be.a('String');\r", + " pm.expect(jsonResponse.result.identifier).to.be.a('String');\r", + "});\r", + "\r", + "" + ], + "type": "text/javascript" + } + } + ], "request": { "auth": { "type": "apikey", @@ -56,7 +113,7 @@ ], "body": { "mode": "raw", - "raw": "{\n \"request\": {\n \"channel\": {\n \"name\": \"Channel Name\",\n \"code\": \"channel-id\"\n }\n }\n}", + "raw": "{\n \"request\": {\n \"channel\": {\n \"name\": \"Channel Name\",\n \"code\": \"{{channel}}\"\n }\n }\n}", "options": { "raw": { "language": "json" @@ -64,18 +121,13 @@ } }, "url": { - "raw": "http://4.224.0.244//channel/v1/create", - "protocol": "http", + "raw": "{{host}}/channel/v3/create", "host": [ - "4", - "224", - "0", - "244" + "{{host}}" ], "path": [ - "", "channel", - "v1", + "v3", "create" ] }, @@ -245,111 +297,464 @@ "body": "" } ] + }, + { + "name": "Create a channel with all fields", + "event": [ + { + "listen": "prerequest", + "script": { + "exec": [ + "pm.environment.set(\"channel2\", \"channel_ch0\");" + ], + "type": "text/javascript" + } + }, + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json()\r", + "\r", + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "\r", + "pm.test(\"id has string - api.channel.create \", function () {\r", + " pm.expect(jsonResponse.id).to.be.equal(\"api.channel.create\");\r", + "});\r", + "\r", + "pm.test(\"Version is 3.0 \", function () {\r", + " pm.expect(jsonResponse.ver).to.be.equal(\"3.0\");\r", + "});\r", + "\r", + "pm.test(\"Verify keys and data type of the response result\", () => {\r", + " pm.expect(jsonResponse.params).to.have.all.keys('resmsgid','msgid','status', 'err','errmsg');\r", + " pm.expect(jsonResponse.params.resmsgid).to.be.a(\"string\");\r", + " pm.expect(jsonResponse.params.msgid).to.be.a(\"null\"); \r", + " pm.expect(jsonResponse.params.status).to.be.a(\"string\");\r", + " pm.expect(jsonResponse.params.err).to.be.a(\"null\");\r", + " pm.expect(jsonResponse.params.errmsg).to.be.a(\"null\");\r", + "});\r", + "\r", + "pm.test(\"Status is successful \", function () {\r", + " pm.expect(jsonResponse.params.status).to.be.equal(\"successful\");\r", + "});\r", + "\r", + "pm.test(\"ResponseCode is OK \", function () {\r", + " pm.expect(jsonResponse.responseCode).to.be.equal(\"OK\");\r", + "});\r", + "\r", + "pm.test(\"Verify keys and data type of the response result\", () => {\r", + " pm.expect(jsonResponse.result).to.have.all.keys('identifier','node_id');\r", + " pm.expect(jsonResponse.result.node_id).to.be.a('String');\r", + " pm.expect(jsonResponse.result.identifier).to.be.a('String');\r", + "});\r", + "\r", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "{{apiKey}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"channel\": {\n \"name\": \"Channel Name\",\n \"code\": \"{{channel2}}\",\n \"description\":\"Channel description\"\n }\n }\n}" + }, + "url": { + "raw": "{{host}}/channel/v3/create", + "host": [ + "{{host}}" + ], + "path": [ + "channel", + "v3", + "create" + ] + } + }, + "response": [] } - ] + ], + "description": "1. Channel name has to be updated in both scenarios (Positive) evertime before running the collection" }, { "name": "Negative", - "item": [] - } - ] - }, - { - "name": "Read Channel", - "item": [ - { - "name": "Positive", "item": [ { - "name": "Get a Channel", + "name": "Create a Channel with missing mandatory fields", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json()\r", + "\r", + "pm.test(\"Status code is 400\", function () {\r", + " pm.response.to.have.status(400);\r", + "});\r", + "\r", + "pm.test(\"Status code name has string\", function () {\r", + " pm.response.to.have.status(\"Bad Request\");\r", + "});\r", + "pm.test(\"id has string - api.channel.create \", function () {\r", + " pm.expect(jsonResponse.id).to.be.equal(\"api.channel.create\");\r", + "});\r", + "\r", + "pm.test(\"Version is 3.0 \", function () {\r", + " pm.expect(jsonResponse.ver).to.be.equal(\"3.0\");\r", + "});\r", + "\r", + "pm.test(\"Verify keys and data type of the response result\", () => {\r", + " pm.expect(jsonResponse.params).to.have.all.keys('resmsgid','msgid','status', 'err','errmsg');\r", + " pm.expect(jsonResponse.params.resmsgid).to.be.a(\"String\");\r", + " pm.expect(jsonResponse.params.msgid).to.be.a(\"null\");\r", + " pm.expect(jsonResponse.params.status).to.be.a(\"String\");\r", + " pm.expect(jsonResponse.params.err).to.be.a(\"String\");\r", + " pm.expect(jsonResponse.params.errmsg).to.be.a(\"String\");\r", + "});\r", + "\r", + "pm.test(\"Status has string \", function () {\r", + " pm.expect(jsonResponse.params.status).to.be.equal(\"failed\");\r", + "});\r", + "\r", + "pm.test(\"Err has string: ERR_CODE_IS_REQUIRED\", function () {\r", + " pm.expect(jsonResponse.params.err).to.be.equal(\"ERR_CODE_IS_REQUIRED\");\r", + "});\r", + "\r", + "pm.test(\"errmsg has string\", function () {\r", + " pm.expect(jsonResponse.params.errmsg).to.be.equal(\"Code is required for creating a channel\");\r", + "});\r", + "\r", + "pm.test(\"Responsecode has string\", function () {\r", + " pm.expect(jsonResponse.responseCode).to.be.equal(\"CLIENT_ERROR\");\r", + "});\r", + "\r", + "\r", + "\r", + "\r", + "\r", + "" + ], + "type": "text/javascript" + } + } + ], "request": { - "auth": { - "type": "apikey", - "apikey": [ - { - "key": "key", - "value": "Authorization", - "type": "string" - }, - { - "key": "value", - "value": "{{apiKey}}", - "type": "string" - }, - { - "key": "in", - "value": "header", - "type": "string" - } - ] - }, - "method": "GET", + "method": "POST", "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, { "key": "Accept", "value": "application/json" + }, + { + "key": "Authorization", + "value": "{{apiKey}}" } ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"channel\": {\n \"name\": \"Channel Name\"\n \n }\n }\n}" + }, "url": { - "raw": "{{baseUrl}}/channel/v1/read/:ID", + "raw": "{{host}}/channel/v3/create", "host": [ - "{{baseUrl}}" + "{{host}}" ], "path": [ "channel", - "v1", - "read", - ":ID" - ], - "variable": [ - { - "key": "ID", - "value": "Ut enim offici", - "description": "(Required) Unique identifier of the channel to get" - } + "v3", + "create" ] - }, - "description": "This API is associated with fetching a channel by a specific channel ID\n - The endpoint for **Get a Channel** is `/channel/v1/read/{ID}`\n - It points to knowledge-mw-service - `/v1/channel/read/{ID}` \n - The fields marked with an asterisk (*) are mandatory. They cannot be null or empty." + } }, - "response": [ + "response": [] + }, + { + "name": "Create an existing channel", + "event": [ { - "name": "OK ! Successful operation. **Channel Read** operation was successfully executed. \\n Please refer for different additional [metadata](https://github.com/project-sunbird/knowledge-platform/blob/release-3.5.0/schemas/content/1.0/schema.json)", - "originalRequest": { - "method": "GET", - "header": [ - { - "description": "Added as a part of security scheme: apikey", - "key": "Authorization", - "value": "" - }, - { - "description": "(Required) The Content Type entity is the media type of the resource\n Possible media types can be:- \n \n - application/json\n - multipart/form-data\n - application/x-www-form-urlencoded", - "key": "Content-Type", - "value": "Ut enim offici" - }, - { - "description": "(Required) To make use of the API, you require authorization. Raise a request to the administrator for the use of the API. You will receive the authorization key. Specify the key received, here.", + "listen": "prerequest", + "script": { + "exec": [ + "pm.environment.get(\"channel\");" + ], + "type": "text/javascript" + } + }, + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json()\r", + "\r", + "pm.test(\"Status code is 400\", function () {\r", + " pm.response.to.have.status(400);\r", + "});\r", + "\r", + "pm.test(\"Status code name has string\", function () {\r", + " pm.response.to.have.status(\"Bad Request\");\r", + "});\r", + "pm.test(\"id has string - api.channel.create \", function () {\r", + " pm.expect(jsonResponse.id).to.be.equal(\"api.channel.create\");\r", + "});\r", + "\r", + "pm.test(\"Version is 3.0 \", function () {\r", + " pm.expect(jsonResponse.ver).to.be.equal(\"3.0\");\r", + "});\r", + "\r", + "pm.test(\"Verify keys and data type of the response result\", () => {\r", + " pm.expect(jsonResponse.params).to.have.all.keys('resmsgid','msgid','status', 'err','errmsg');\r", + " pm.expect(jsonResponse.params.resmsgid).to.be.a(\"String\");\r", + " pm.expect(jsonResponse.params.msgid).to.be.a(\"null\");\r", + " pm.expect(jsonResponse.params.status).to.be.a(\"String\");\r", + " pm.expect(jsonResponse.params.err).to.be.a(\"String\");\r", + " pm.expect(jsonResponse.params.errmsg).to.be.a(\"String\");\r", + "});\r", + "\r", + "pm.test(\"Status has string \", function () {\r", + " pm.expect(jsonResponse.params.status).to.be.equal(\"failed\");\r", + "});\r", + "\r", + "pm.test(\"Err has string: CONSTRAINT_VALIDATION_FAILED\", function () {\r", + " pm.expect(jsonResponse.params.err).to.be.equal(\"CONSTRAINT_VALIDATION_FAILED\");\r", + "});\r", + "\r", + "pm.test(\"errmsg has string\", function () {\r", + " pm.expect(jsonResponse.params.errmsg).to.be.equal(\"Object already exists with identifier: channel_ch1\");\r", + "});\r", + "\r", + "pm.test(\"Responsecode has string\", function () {\r", + " pm.expect(jsonResponse.responseCode).to.be.equal(\"CLIENT_ERROR\");\r", + "});\r", + "\r", + "\r", + "\r", + "\r", + "\r", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "{{apiKey}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"channel\": {\n \"name\": \"Channel Name\",\n \"code\": \"{{channel}}\"\n }\n }\n}" + }, + "url": { + "raw": "{{host}}/channel/v3/create", + "host": [ + "{{host}}" + ], + "path": [ + "channel", + "v3", + "create" + ] + } + }, + "response": [] + } + ] + } + ] + }, + { + "name": "Read Channel", + "item": [ + { + "name": "Pre requisite", + "item": [ + { + "name": "Create Channel", + "event": [ + { + "listen": "prerequest", + "script": { + "exec": [ + "pm.environment.set(\"channel\", \"channel_ch5\");" + ], + "type": "text/javascript" + } + }, + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json()\r", + "\r", + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "\r", + "pm.test(\"id has string - api.channel.create \", function () {\r", + " pm.expect(jsonResponse.id).to.be.equal(\"api.channel.create\");\r", + "});\r", + "\r", + "pm.test(\"Version is 3.0 \", function () {\r", + " pm.expect(jsonResponse.ver).to.be.equal(\"3.0\");\r", + "});\r", + "\r", + "pm.test(\"Verify keys and data type of the response result\", () => {\r", + " pm.expect(jsonResponse.params).to.have.all.keys('resmsgid','msgid','status', 'err','errmsg');\r", + " pm.expect(jsonResponse.params.resmsgid).to.be.a(\"string\");\r", + " pm.expect(jsonResponse.params.msgid).to.be.a(\"null\"); \r", + " pm.expect(jsonResponse.params.status).to.be.a(\"string\");\r", + " pm.expect(jsonResponse.params.err).to.be.a(\"null\");\r", + " pm.expect(jsonResponse.params.errmsg).to.be.a(\"null\");\r", + "});\r", + "\r", + "pm.test(\"Status is successful \", function () {\r", + " pm.expect(jsonResponse.params.status).to.be.equal(\"successful\");\r", + "});\r", + "\r", + "pm.test(\"ResponseCode is OK \", function () {\r", + " pm.expect(jsonResponse.responseCode).to.be.equal(\"OK\");\r", + "});\r", + "\r", + "pm.test(\"Verify keys and data type of the response result\", () => {\r", + " pm.expect(jsonResponse.result).to.have.all.keys('identifier','node_id');\r", + " pm.expect(jsonResponse.result.node_id).to.be.a('String');\r", + " pm.expect(jsonResponse.result.identifier).to.be.a('String');\r", + "});\r", + "\r", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "apikey", + "apikey": [ + { + "key": "key", + "value": "Authorization", + "type": "string" + }, + { + "key": "value", + "value": "{{apiKey}}", + "type": "string" + }, + { + "key": "in", + "value": "header", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"channel\": {\n \"name\": \"Channel Name\",\n \"code\": \"{{channel}}\"\n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{host}}/channel/v3/create", + "host": [ + "{{host}}" + ], + "path": [ + "channel", + "v3", + "create" + ] + }, + "description": "This API is used for creating a channel \n - The endpoint for **Create Channel** is `/channel/v1/create`\n - It points to knowledge-mw-service - `/v1/channel/create`\n - The fields marked with an asterisk (*) are mandatory. They cannot be null or empty." + }, + "response": [ + { + "name": "OK ! Successful operation.\"Create channel\" operation was successfully executed.", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource\n Possible media types can be:- \n - application/json", + "key": "Content-Type", + "value": "Ut enim offici" + }, + { + "description": "(Required) To make use of the API, you require bearer authorization. Raise a request to the administrator for the use of the API. You will receive the authorization key. Specify the key received, here.", "key": "Authorization", "value": "Ut enim offici" } ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"channel\": {\n \"name\": \"Channel Name\",\n \"code\": \"channel-id\"\n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, "url": { - "raw": "{{baseUrl}}/channel/v1/read/:ID", + "raw": "{{baseUrl}}/channel/v1/create", "host": [ "{{baseUrl}}" ], "path": [ "channel", "v1", - "read", - ":ID" - ], - "variable": [ - { - "key": "ID", - "value": "Ut enim offici", - "description": "(Required) Unique identifier of the channel to get" - } + "create" ] } }, @@ -363,12 +768,12 @@ } ], "cookie": [], - "body": "{\n \"id\": \"api.channel.read\",\n \"ver\": \"3.0\",\n \"ts\": \"2020-12-14T08:33:50ZZ\",\n \"params\": {\n \"resmsgid\": \"02c742d2-57e1-4441-aa31-0ce339c3917b\",\n \"msgid\": null,\n \"err\": null,\n \"status\": \"successful\",\n \"errmsg\": null\n },\n \"responseCode\": \"OK\",\n \"result\": {\n \"channel\": {\n \"identifier\": \"channel-405\",\n \"lastStatusChangedOn\": \"2020-12-14T08:27:49.490+0000\",\n \"code\": \"channel-405\",\n \"consumerId\": \"7411b6bd-89f3-40ec-98d1-229dc64ce77d\",\n \"assetAdditionalCategories\": [],\n \"autoCreateBatch\": \"Enabled\",\n \"languageCode\": [],\n \"suggested_frameworks\": [\n {\n \"identifier\": \"NCF\",\n \"code\": \"NCF\",\n \"name\": \"NCF\",\n \"objectType\": \"Framework\"\n }\n ],\n \"createdOn\": \"2020-12-14T08:27:49.490+0000\",\n \"objectType\": \"Channel\",\n \"versionKey\": \"1607934825088\",\n \"collectionPrimaryCategories\": [\n \"Content Playlist\",\n \"Course\",\n \"Digital Textbook\",\n \"Explanation Content\"\n ],\n \"contentPrimaryCategories\": [\n \"Course Assessment\",\n \"eTextbook\",\n \"Explanation Content\",\n \"Learning Resource\",\n \"Practice Question Set\",\n \"Teacher Resource\"\n ],\n \"name\": \"Channel without Default License\",\n \"lastUpdatedOn\": \"2020-12-14T08:33:45.088+0000\",\n \"defaultCourseFramework\": \"TPD\",\n \"collectionAdditionalCategories\": [\n \"Textbook\",\n \"Lesson Plan\",\n \"TV Lesson\"\n ],\n \"assetPrimaryCategories\": [\n \"Asset\",\n \"CertAsset\",\n \"Certificate Template\"\n ],\n \"contentAdditionalCategories\": [\n \"Classroom Teaching Video\",\n \"Concept Map\",\n \"Curiosity Question Set\",\n \"Experiential Resource\",\n \"Explanation Video\",\n \"Focus Spot\",\n \"Learning Outcome Definition\",\n \"Lesson Plan\",\n \"Marking Scheme Rubric\",\n \"Pedagogy Flow\",\n \"Previous Board Exam Papers\",\n \"TV Lesson\",\n \"Textbook\"\n ],\n \"status\": \"Live\",\n \"defaultFramework\": \"NCF\"\n }\n }\n}" + "body": "{\n \"id\": \"api.channel.create\",\n \"ver\": \"1.0\",\n \"ts\": \"2020-12-14T08:27:27.810Z\",\n \"params\": {\n \"resmsgid\": \"3357da20-3de6-11eb-9ff3-67c41480f6aa\",\n \"msgid\": \"3353bb70-3de6-11eb-9ff3-67c41480f6aa\",\n \"status\": \"successful\",\n \"err\": null,\n \"errmsg\": null\n },\n \"responseCode\": \"OK\",\n \"result\": {\n \"identifier\": \"channel-id\",\n \"node_id\": \"channel-id\"\n }\n}" }, { - "name": "RESOURCE NOT FOUND. The **Channel Read** operation failed ! The possible reason for failure is that you may have passed invalid channel id.", + "name": "BAD REQUEST. The \"Create Channel\" operation failed ! The possible reason for failure is that you may have missed providing input for a mandatory parameter or providing some wrong request.", "originalRequest": { - "method": "GET", + "method": "POST", "header": [ { "description": "Added as a part of security scheme: apikey", @@ -376,38 +781,39 @@ "value": "" }, { - "description": "(Required) The Content Type entity is the media type of the resource\n Possible media types can be:- \n \n - application/json\n - multipart/form-data\n - application/x-www-form-urlencoded", + "description": "(Required) The Content Type entity is the media type of the resource\n Possible media types can be:- \n - application/json", "key": "Content-Type", "value": "Ut enim offici" }, { - "description": "(Required) To make use of the API, you require authorization. Raise a request to the administrator for the use of the API. You will receive the authorization key. Specify the key received, here.", + "description": "(Required) To make use of the API, you require bearer authorization. Raise a request to the administrator for the use of the API. You will receive the authorization key. Specify the key received, here.", "key": "Authorization", "value": "Ut enim offici" } ], - "url": { - "raw": "{{baseUrl}}/channel/v1/read/:ID", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "channel", - "v1", - "read", - ":ID" - ], - "variable": [ - { - "key": "ID", - "value": "Ut enim offici", - "description": "(Required) Unique identifier of the channel to get" + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"channel\": {\n \"name\": \"Channel Name\",\n \"code\": \"channel-id\"\n }\n }\n}", + "options": { + "raw": { + "language": "json" } + } + }, + "url": { + "raw": "{{baseUrl}}/channel/v1/create", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "channel", + "v1", + "create" ] } }, - "status": "Not Found", - "code": 404, + "status": "Bad Request", + "code": 400, "_postman_previewlanguage": "json", "header": [ { @@ -416,12 +822,12 @@ } ], "cookie": [], - "body": "{\n \"id\": \"api.channel.read\",\n \"ver\": \"3.0\",\n \"ts\": \"2020-12-14T08:36:08ZZ\",\n \"params\": {\n \"resmsgid\": \"e54ff3af-4026-420e-9412-0fcd3eba1674\",\n \"msgid\": null,\n \"err\": \"NOT_FOUND\",\n \"status\": \"failed\",\n \"errmsg\": \"Error! Node(s) doesn't Exists. | [Invalid Node Id.]: channel-407\"\n },\n \"responseCode\": \"RESOURCE_NOT_FOUND\",\n \"result\": {\n \"messages\": null\n }\n}" + "body": "{\n \"id\": \"api.channel.create\",\n \"ver\": \"1.0\",\n \"ts\": \"2020-12-14T08:26:15.914Z\",\n \"params\": {\n \"resmsgid\": \"087d64a0-3de6-11eb-9ff3-67c41480f6aa\",\n \"msgid\": null,\n \"status\": \"failed\",\n \"err\": \"CONSTRAINT_VALIDATION_FAILED\",\n \"errmsg\": \"Object already exists with identifier: channel-id\"\n },\n \"responseCode\": \"CLIENT_ERROR\",\n \"result\": {\n \"messages\": null\n }\n}" }, { "name": "INTERNAL SERVER ERROR ! Looks like something went wrong! These errors are tracked automatically, but if the problem persists feel free to contact us. In the meantime, try refreshing.", "originalRequest": { - "method": "GET", + "method": "POST", "header": [ { "description": "Added as a part of security scheme: apikey", @@ -429,33 +835,34 @@ "value": "" }, { - "description": "(Required) The Content Type entity is the media type of the resource\n Possible media types can be:- \n \n - application/json\n - multipart/form-data\n - application/x-www-form-urlencoded", + "description": "(Required) The Content Type entity is the media type of the resource\n Possible media types can be:- \n - application/json", "key": "Content-Type", "value": "Ut enim offici" }, { - "description": "(Required) To make use of the API, you require authorization. Raise a request to the administrator for the use of the API. You will receive the authorization key. Specify the key received, here.", + "description": "(Required) To make use of the API, you require bearer authorization. Raise a request to the administrator for the use of the API. You will receive the authorization key. Specify the key received, here.", "key": "Authorization", "value": "Ut enim offici" } ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"channel\": {\n \"name\": \"Channel Name\",\n \"code\": \"channel-id\"\n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, "url": { - "raw": "{{baseUrl}}/channel/v1/read/:ID", + "raw": "{{baseUrl}}/channel/v1/create", "host": [ "{{baseUrl}}" ], "path": [ "channel", "v1", - "read", - ":ID" - ], - "variable": [ - { - "key": "ID", - "value": "Ut enim offici", - "description": "(Required) Unique identifier of the channel to get" - } + "create" ] } }, @@ -475,20 +882,11 @@ } ] }, - { - "name": "Negative", - "item": [] - } - ] - }, - { - "name": "Update Channel", - "item": [ { "name": "Positive", "item": [ { - "name": "Update Channel", + "name": "Read a valid channel id", "request": { "auth": { "type": "apikey", @@ -510,52 +908,32 @@ } ] }, - "method": "PATCH", + "method": "GET", "header": [ - { - "key": "Content-Type", - "value": "application/json" - }, { "key": "Accept", "value": "application/json" } ], - "body": { - "mode": "raw", - "raw": "{\n \"request\": {\n \"channel\": {\n \"description\": \"Updated channel description\"\n }\n }\n}", - "options": { - "raw": { - "language": "json" - } - } - }, "url": { - "raw": "{{baseUrl}}/channel/v1/update/:ID", + "raw": "{{baseUrl}}/channel/v3/read/{{channel}}", "host": [ "{{baseUrl}}" ], "path": [ "channel", - "v1", - "update", - ":ID" - ], - "variable": [ - { - "key": "ID", - "value": "Ut enim offici", - "description": "(Required) Unique identifier of the channel to be updated" - } + "v3", + "read", + "{{channel}}" ] }, - "description": "This API is associated with updating a specific channel\n - The endpoint for **Update Channel** is `/channel/v1/update/{ID}`\n - It points to knowledge-mw-service - `/v1/channel/update/{ID}`\n - The fields marked with an asterisk (*) are mandatory. They cannot be null or empty." + "description": "This API is associated with fetching a channel by a specific channel ID\n - The endpoint for **Get a Channel** is `/channel/v1/read/{ID}`\n - It points to knowledge-mw-service - `/v1/channel/read/{ID}` \n - The fields marked with an asterisk (*) are mandatory. They cannot be null or empty." }, "response": [ { - "name": "OK ! Successful operation.\"Update channel by ID\" operation was successfully executed.", + "name": "OK ! Successful operation. **Channel Read** operation was successfully executed. \\n Please refer for different additional [metadata](https://github.com/project-sunbird/knowledge-platform/blob/release-3.5.0/schemas/content/1.0/schema.json)", "originalRequest": { - "method": "PATCH", + "method": "GET", "header": [ { "description": "Added as a part of security scheme: apikey", @@ -563,7 +941,7 @@ "value": "" }, { - "description": "(Required) The Content Type entity is the media type of the resource.\n Possible media types can be:- \n - application/json\n - multipart/form-data\n - application/x-www-form-urlencoded", + "description": "(Required) The Content Type entity is the media type of the resource\n Possible media types can be:- \n \n - application/json\n - multipart/form-data\n - application/x-www-form-urlencoded", "key": "Content-Type", "value": "Ut enim offici" }, @@ -573,31 +951,22 @@ "value": "Ut enim offici" } ], - "body": { - "mode": "raw", - "raw": "{\n \"request\": {\n \"channel\": {\n \"description\": \"Updated channel description\"\n }\n }\n}", - "options": { - "raw": { - "language": "json" - } - } - }, "url": { - "raw": "{{baseUrl}}/channel/v1/update/:ID", + "raw": "{{baseUrl}}/channel/v1/read/:ID", "host": [ "{{baseUrl}}" ], "path": [ "channel", "v1", - "update", + "read", ":ID" ], "variable": [ { "key": "ID", "value": "Ut enim offici", - "description": "(Required) Unique identifier of the channel to be updated" + "description": "(Required) Unique identifier of the channel to get" } ] } @@ -612,74 +981,12 @@ } ], "cookie": [], - "body": "{\n \"id\": \"api.channel.update\",\n \"ver\": \"1.0\",\n \"ts\": \"2020-12-14T08:29:24.724Z\",\n \"params\": {\n \"resmsgid\": \"79078340-3de6-11eb-9ff3-67c41480f6aa\",\n \"msgid\": \"78fef7c0-3de6-11eb-9ff3-67c41480f6aa\",\n \"status\": \"successful\",\n \"err\": null,\n \"errmsg\": null\n },\n \"responseCode\": \"OK\",\n \"result\": {\n \"identifier\": \"channel-405\",\n \"node_id\": \"channel-405\"\n }\n}" - }, - { - "name": "BAD REQUEST. The **Update Channel\" operation failed ! The possible reason for failure is that you may have missed providing input for a mandatory parameter.", - "originalRequest": { - "method": "PATCH", - "header": [ - { - "description": "Added as a part of security scheme: apikey", - "key": "Authorization", - "value": "" - }, - { - "description": "(Required) The Content Type entity is the media type of the resource.\n Possible media types can be:- \n - application/json\n - multipart/form-data\n - application/x-www-form-urlencoded", - "key": "Content-Type", - "value": "Ut enim offici" - }, - { - "description": "(Required) To make use of the API, you require authorization. Raise a request to the administrator for the use of the API. You will receive the authorization key. Specify the key received, here.", - "key": "Authorization", - "value": "Ut enim offici" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"request\": {\n \"channel\": {\n \"description\": \"Updated channel description\"\n }\n }\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{baseUrl}}/channel/v1/update/:ID", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "channel", - "v1", - "update", - ":ID" - ], - "variable": [ - { - "key": "ID", - "value": "Ut enim offici", - "description": "(Required) Unique identifier of the channel to be updated" - } - ] - } - }, - "status": "Bad Request", - "code": 400, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "Content-Type", - "value": "application/json" - } - ], - "cookie": [], - "body": "{\n \"ts\": 79777367,\n \"id\": \"Lorem in dolore ex ullamco\",\n \"params\": {\n \"msgid\": \"in mollit commodo\",\n \"resmsgid\": \"fugiat deserunt Lorem\",\n \"status\": \"failed\",\n \"err\": \"ut dolor et repreh\",\n \"errmsg\": \"ut enim \"\n },\n \"ver\": \"reprehenderit laboris\",\n \"responseCode\": \"proident qui minim\",\n \"result\": {}\n}" + "body": "{\n \"id\": \"api.channel.read\",\n \"ver\": \"3.0\",\n \"ts\": \"2020-12-14T08:33:50ZZ\",\n \"params\": {\n \"resmsgid\": \"02c742d2-57e1-4441-aa31-0ce339c3917b\",\n \"msgid\": null,\n \"err\": null,\n \"status\": \"successful\",\n \"errmsg\": null\n },\n \"responseCode\": \"OK\",\n \"result\": {\n \"channel\": {\n \"identifier\": \"channel-405\",\n \"lastStatusChangedOn\": \"2020-12-14T08:27:49.490+0000\",\n \"code\": \"channel-405\",\n \"consumerId\": \"7411b6bd-89f3-40ec-98d1-229dc64ce77d\",\n \"assetAdditionalCategories\": [],\n \"autoCreateBatch\": \"Enabled\",\n \"languageCode\": [],\n \"suggested_frameworks\": [\n {\n \"identifier\": \"NCF\",\n \"code\": \"NCF\",\n \"name\": \"NCF\",\n \"objectType\": \"Framework\"\n }\n ],\n \"createdOn\": \"2020-12-14T08:27:49.490+0000\",\n \"objectType\": \"Channel\",\n \"versionKey\": \"1607934825088\",\n \"collectionPrimaryCategories\": [\n \"Content Playlist\",\n \"Course\",\n \"Digital Textbook\",\n \"Explanation Content\"\n ],\n \"contentPrimaryCategories\": [\n \"Course Assessment\",\n \"eTextbook\",\n \"Explanation Content\",\n \"Learning Resource\",\n \"Practice Question Set\",\n \"Teacher Resource\"\n ],\n \"name\": \"Channel without Default License\",\n \"lastUpdatedOn\": \"2020-12-14T08:33:45.088+0000\",\n \"defaultCourseFramework\": \"TPD\",\n \"collectionAdditionalCategories\": [\n \"Textbook\",\n \"Lesson Plan\",\n \"TV Lesson\"\n ],\n \"assetPrimaryCategories\": [\n \"Asset\",\n \"CertAsset\",\n \"Certificate Template\"\n ],\n \"contentAdditionalCategories\": [\n \"Classroom Teaching Video\",\n \"Concept Map\",\n \"Curiosity Question Set\",\n \"Experiential Resource\",\n \"Explanation Video\",\n \"Focus Spot\",\n \"Learning Outcome Definition\",\n \"Lesson Plan\",\n \"Marking Scheme Rubric\",\n \"Pedagogy Flow\",\n \"Previous Board Exam Papers\",\n \"TV Lesson\",\n \"Textbook\"\n ],\n \"status\": \"Live\",\n \"defaultFramework\": \"NCF\"\n }\n }\n}" }, { - "name": "RESOURCE NOT FOUND. The \"update channel by ID\" operation failed ! The possible reason for failure is that you may have passed invalid channel id.", + "name": "RESOURCE NOT FOUND. The **Channel Read** operation failed ! The possible reason for failure is that you may have passed invalid channel id.", "originalRequest": { - "method": "PATCH", + "method": "GET", "header": [ { "description": "Added as a part of security scheme: apikey", @@ -687,7 +994,7 @@ "value": "" }, { - "description": "(Required) The Content Type entity is the media type of the resource.\n Possible media types can be:- \n - application/json\n - multipart/form-data\n - application/x-www-form-urlencoded", + "description": "(Required) The Content Type entity is the media type of the resource\n Possible media types can be:- \n \n - application/json\n - multipart/form-data\n - application/x-www-form-urlencoded", "key": "Content-Type", "value": "Ut enim offici" }, @@ -697,31 +1004,22 @@ "value": "Ut enim offici" } ], - "body": { - "mode": "raw", - "raw": "{\n \"request\": {\n \"channel\": {\n \"description\": \"Updated channel description\"\n }\n }\n}", - "options": { - "raw": { - "language": "json" - } - } - }, "url": { - "raw": "{{baseUrl}}/channel/v1/update/:ID", + "raw": "{{baseUrl}}/channel/v1/read/:ID", "host": [ "{{baseUrl}}" ], "path": [ "channel", "v1", - "update", + "read", ":ID" ], "variable": [ { "key": "ID", "value": "Ut enim offici", - "description": "(Required) Unique identifier of the channel to be updated" + "description": "(Required) Unique identifier of the channel to get" } ] } @@ -736,12 +1034,12 @@ } ], "cookie": [], - "body": "{\n \"id\": \"api.channel.update\",\n \"ver\": \"1.0\",\n \"ts\": \"2020-12-14T08:30:44.219Z\",\n \"params\": {\n \"resmsgid\": \"a8697cb0-3de6-11eb-9ff3-67c41480f6aa\",\n \"msgid\": null,\n \"status\": \"failed\",\n \"err\": \"NOT_FOUND\",\n \"errmsg\": \"Error! Node(s) doesn't Exists. | [Invalid Node Id.]: channel-406\"\n },\n \"responseCode\": \"RESOURCE_NOT_FOUND\",\n \"result\": {\n \"messages\": null\n }\n}" + "body": "{\n \"id\": \"api.channel.read\",\n \"ver\": \"3.0\",\n \"ts\": \"2020-12-14T08:36:08ZZ\",\n \"params\": {\n \"resmsgid\": \"e54ff3af-4026-420e-9412-0fcd3eba1674\",\n \"msgid\": null,\n \"err\": \"NOT_FOUND\",\n \"status\": \"failed\",\n \"errmsg\": \"Error! Node(s) doesn't Exists. | [Invalid Node Id.]: channel-407\"\n },\n \"responseCode\": \"RESOURCE_NOT_FOUND\",\n \"result\": {\n \"messages\": null\n }\n}" }, { "name": "INTERNAL SERVER ERROR ! Looks like something went wrong! These errors are tracked automatically, but if the problem persists feel free to contact us. In the meantime, try refreshing.", "originalRequest": { - "method": "PATCH", + "method": "GET", "header": [ { "description": "Added as a part of security scheme: apikey", @@ -749,7 +1047,7 @@ "value": "" }, { - "description": "(Required) The Content Type entity is the media type of the resource.\n Possible media types can be:- \n - application/json\n - multipart/form-data\n - application/x-www-form-urlencoded", + "description": "(Required) The Content Type entity is the media type of the resource\n Possible media types can be:- \n \n - application/json\n - multipart/form-data\n - application/x-www-form-urlencoded", "key": "Content-Type", "value": "Ut enim offici" }, @@ -759,31 +1057,22 @@ "value": "Ut enim offici" } ], - "body": { - "mode": "raw", - "raw": "{\n \"request\": {\n \"channel\": {\n \"description\": \"Updated channel description\"\n }\n }\n}", - "options": { - "raw": { - "language": "json" - } - } - }, "url": { - "raw": "{{baseUrl}}/channel/v1/update/:ID", + "raw": "{{baseUrl}}/channel/v1/read/:ID", "host": [ "{{baseUrl}}" ], "path": [ "channel", "v1", - "update", + "read", ":ID" ], "variable": [ { "key": "ID", "value": "Ut enim offici", - "description": "(Required) Unique identifier of the channel to be updated" + "description": "(Required) Unique identifier of the channel to get" } ] } @@ -806,188 +1095,128 @@ }, { "name": "Negative", - "item": [] - } - ] - }, - { - "name": "List Channel", - "item": [ - { - "name": "Positive", - "item": [] - }, - { - "name": "Negative", - "item": [] - } - ] - } - ] - }, - { - "name": "Channel Category", - "item": [ - { - "name": "Create Channel Category", - "item": [ - { - "name": "Positive", - "item": [] - }, - { - "name": "Negative", - "item": [] - } - ] - }, - { - "name": "Read Channel category", - "item": [ - { - "name": "Positive", - "item": [] - }, - { - "name": "Negative", - "item": [] - } - ] - }, - { - "name": "Search Channel category", - "item": [ - { - "name": "Positive", - "item": [] - }, - { - "name": "Negative", - "item": [] - } - ] - }, - { - "name": "Update Channel category", - "item": [ - { - "name": "Positive", - "item": [] - }, - { - "name": "Negative", - "item": [] - } - ] - }, - { - "name": "Delete Channel Category", - "item": [ - { - "name": "Positive", - "item": [] - }, - { - "name": "Negative", - "item": [] - } - ] - } - ] - }, - { - "name": "Channel Term", - "item": [ - { - "name": "Create Channel term", - "item": [ - { - "name": "Positive", - "item": [] - }, - { - "name": "Negative", - "item": [] - } - ] - }, - { - "name": "Read Channel term", - "item": [ - { - "name": "Positive", - "item": [] - }, - { - "name": "Negative", - "item": [] - } - ] - }, - { - "name": "Search Channel term", - "item": [ - { - "name": "Positive", - "item": [] - }, - { - "name": "Negative", - "item": [] - } - ] - }, - { - "name": "Update Channel term", - "item": [ - { - "name": "Positive", - "item": [] - }, - { - "name": "Negative", - "item": [] + "item": [ + { + "name": "Read an invalid channel id", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json()\r", + "\r", + "pm.test(\"Status code is 404\", function () {\r", + " pm.response.to.have.status(404);\r", + "});\r", + "\r", + "pm.test(\"Status code name has string: Not Found\", function () {\r", + " pm.response.to.have.status(\"Not Found\");\r", + "});\r", + "pm.test(\"id has string - api.channel.read \", function () {\r", + " pm.expect(jsonResponse.id).to.be.equal(\"api.channel.read\");\r", + "});\r", + "\r", + "pm.test(\"Version is 3.0 \", function () {\r", + " pm.expect(jsonResponse.ver).to.be.equal(\"3.0\");\r", + "});\r", + "pm.test(\"Verify keys and data type of the response result\", () => {\r", + " pm.expect(jsonResponse.params).to.have.all.keys('resmsgid','msgid','err','status','errmsg');\r", + " pm.expect(jsonResponse.params.resmsgid).to.be.a(\"String\");\r", + " pm.expect(jsonResponse.params.msgid).to.be.a(\"null\");\r", + " pm.expect(jsonResponse.params.err).to.be.a(\"String\");\r", + " pm.expect(jsonResponse.params.status).to.be.a(\"String\");\r", + " pm.expect(jsonResponse.params.errmsg).to.be.a(\"String\");\r", + " });\r", + "\r", + "pm.test(\"Err has string\", function () {\r", + " pm.expect(jsonResponse.params.err).to.be.equal(\"NOT_FOUND\");\r", + "});\r", + "pm.test(\"Status has string\", function () {\r", + " pm.expect(jsonResponse.params.status).to.be.equal(\"failed\");\r", + "});\r", + "pm.test(\"errmsg has string\", function () {\r", + " pm.expect(jsonResponse.params.errmsg).to.be.include(\"Error! Node(s) doesn't Exists. | [Invalid Node Id.]: \");\r", + "});\r", + "pm.test(\"responseCode has string\", function () {\r", + " pm.expect(jsonResponse.responseCode).to.be.equal(\"RESOURCE_NOT_FOUND\");\r", + "});\r", + "\r", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "apikey", + "apikey": [ + { + "key": "value", + "value": "{{auth_token}}", + "type": "string" + }, + { + "key": "key", + "value": "Authorization", + "type": "string" + }, + { + "key": "in", + "value": "header", + "type": "string" + } + ] + }, + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "{{apiKey}}" + }, + { + "key": "Content-Type", + "value": "application/json", + "type": "text" + } + ], + "url": { + "raw": "{{host}}/channel/v3/read/dummy", + "host": [ + "{{host}}" + ], + "path": [ + "channel", + "v3", + "read", + "dummy" + ] + } + }, + "response": [] + } + ] } ] }, { - "name": "Delete Channel term", - "item": [ - { - "name": "Positive", - "item": [] - }, - { - "name": "Negative", - "item": [] - } - ] - } - ] - } - ] - }, - { - "name": "framework/v1", - "item": [ - { - "name": "framework", - "item": [ - { - "name": "Create a Framework", + "name": "Update Channel", "item": [ { - "name": "Positive", + "name": "Pre requisite", "item": [ { - "name": "Create a framework with valid mandatory fields", + "name": "Create Channel", "event": [ { "listen": "prerequest", "script": { "exec": [ - "pm.environment.set(\"name\", \"Framework111\");\r", - "pm.environment.set(\"code\", \"Framework111\");" + "pm.environment.set(\"channel\", \"channel_ch4\");" ], "type": "text/javascript" } @@ -1002,25 +1231,36 @@ " pm.response.to.have.status(200);\r", "});\r", "\r", + "pm.test(\"id has string - api.channel.create \", function () {\r", + " pm.expect(jsonResponse.id).to.be.equal(\"api.channel.create\");\r", + "});\r", + "\r", + "pm.test(\"Version is 3.0 \", function () {\r", + " pm.expect(jsonResponse.ver).to.be.equal(\"3.0\");\r", + "});\r", + "\r", "pm.test(\"Verify keys and data type of the response result\", () => {\r", " pm.expect(jsonResponse.params).to.have.all.keys('resmsgid','msgid','status', 'err','errmsg');\r", - " pm.expect(jsonResponse.params.status).to.be.a(\"String\");\r", + " pm.expect(jsonResponse.params.resmsgid).to.be.a(\"string\");\r", + " pm.expect(jsonResponse.params.msgid).to.be.a(\"null\"); \r", + " pm.expect(jsonResponse.params.status).to.be.a(\"string\");\r", " pm.expect(jsonResponse.params.err).to.be.a(\"null\");\r", " pm.expect(jsonResponse.params.errmsg).to.be.a(\"null\");\r", "});\r", "\r", - "pm.test(\"Status has string \", function () {\r", + "pm.test(\"Status is successful \", function () {\r", " pm.expect(jsonResponse.params.status).to.be.equal(\"successful\");\r", "});\r", "\r", - "pm.test(\"Verify keys and data type of the response result\", () => {\r", - " pm.expect(jsonResponse.result).to.have.all.keys('node_id', 'versionKey');\r", - " pm.expect(jsonResponse.result.node_id).to.be.a(\"String\");\r", - " pm.expect(jsonResponse.result.versionKey).to.be.a(\"string\");\r", + "pm.test(\"ResponseCode is OK \", function () {\r", + " pm.expect(jsonResponse.responseCode).to.be.equal(\"OK\");\r", "});\r", "\r", - "pm.globals.set(\"node_id\",jsonResponse.result.node_id);\r", - "console.log(pm.globals.get(\"node_id\"));\r", + "pm.test(\"Verify keys and data type of the response result\", () => {\r", + " pm.expect(jsonResponse.result).to.have.all.keys('identifier','node_id');\r", + " pm.expect(jsonResponse.result.node_id).to.be.a('String');\r", + " pm.expect(jsonResponse.result.identifier).to.be.a('String');\r", + "});\r", "\r", "" ], @@ -1028,21 +1268,18 @@ } } ], - "protocolProfileBehavior": { - "disabledSystemHeaders": {} - }, "request": { "auth": { "type": "apikey", "apikey": [ { - "key": "value", - "value": "{{auth_token}}", + "key": "key", + "value": "Authorization", "type": "string" }, { - "key": "key", - "value": "Authorization", + "key": "value", + "value": "{{apiKey}}", "type": "string" }, { @@ -1055,29 +1292,17 @@ "method": "POST", "header": [ { - "description": "(Required) It is the Unique Id to identify the root organisation to which the user belongs", - "key": "X-Channel-Id", - "value": "{{X-Channel-Id}}" - }, - { - "key": "", - "value": "", - "disabled": true + "key": "Content-Type", + "value": "application/json" }, { "key": "Accept", "value": "application/json" - }, - { - "key": "Authorization", - "value": "", - "type": "text", - "disabled": true } ], "body": { "mode": "raw", - "raw": "{\n \"request\": {\n \"framework\": {\n \"name\": \"{{name}}\",\n \"code\": \"{{code}}\",\n \"description\":\"description\"\n }\n }\n}", + "raw": "{\n \"request\": {\n \"channel\": {\n \"name\": \"Channel Name\",\n \"code\": \"{{channel}}\"\n }\n }\n}", "options": { "raw": { "language": "json" @@ -1085,21 +1310,21 @@ } }, "url": { - "raw": "{{host}}/framework/v3/create", + "raw": "{{host}}/channel/v3/create", "host": [ "{{host}}" ], "path": [ - "framework", + "channel", "v3", "create" ] }, - "description": "This API is associated with creating a new framework on the Sunbird Platform.\n - The endpoint for **Create a Framework** is `/framework/v1/create`\n - It points to knowledge-mw-service - `/v1/framework/create`\n - The fields marked with an asterisk (*) are mandatory. They cannot be null or empty." + "description": "This API is used for creating a channel \n - The endpoint for **Create Channel** is `/channel/v1/create`\n - It points to knowledge-mw-service - `/v1/channel/create`\n - The fields marked with an asterisk (*) are mandatory. They cannot be null or empty." }, "response": [ { - "name": "OK ! Successful operation.\"create framework\" operation was successfully executed.", + "name": "OK ! Successful operation.\"Create channel\" operation was successfully executed.", "originalRequest": { "method": "POST", "header": [ @@ -1114,19 +1339,14 @@ "value": "Ut enim offici" }, { - "description": "(Required) To make use of the API, you require authorization. Raise a request to the administrator for the use of the API. You will receive the authorization key. Specify the key received, here.", + "description": "(Required) To make use of the API, you require bearer authorization. Raise a request to the administrator for the use of the API. You will receive the authorization key. Specify the key received, here.", "key": "Authorization", "value": "Ut enim offici" - }, - { - "description": "(Required) It is the Unique Id to identify the root organisation to which the user belongs", - "key": "X-Channel-Id", - "value": "Ut enim offici" } ], "body": { "mode": "raw", - "raw": "{\n \"request\": {\n \"framework\": {\n \"name\": \"Framework Name\",\n \"code\": \"dummy_framework\",\n \"channels\": [\n {\n \"identifier\": \"in.ekstep\"\n }\n ]\n }\n }\n}", + "raw": "{\n \"request\": {\n \"channel\": {\n \"name\": \"Channel Name\",\n \"code\": \"channel-id\"\n }\n }\n}", "options": { "raw": { "language": "json" @@ -1134,12 +1354,12 @@ } }, "url": { - "raw": "{{baseUrl}}/framework/v1/create", + "raw": "{{baseUrl}}/channel/v1/create", "host": [ "{{baseUrl}}" ], "path": [ - "framework", + "channel", "v1", "create" ] @@ -1155,10 +1375,10 @@ } ], "cookie": [], - "body": "{\n \"id\": \"api.framework.create\",\n \"ver\": \"1.0\",\n \"ts\": \"2020-12-14T09:49:06.794Z\",\n \"params\": {\n \"resmsgid\": \"9b5d7ca0-3df1-11eb-9ff3-67c41480f6aa\",\n \"msgid\": \"9b4a90e0-3df1-11eb-9ff3-67c41480f6aa\",\n \"status\": \"successful\",\n \"err\": null,\n \"errmsg\": null\n },\n \"responseCode\": \"OK\",\n \"result\": {\n \"node_id\": \"dummy_framework\",\n \"versionKey\": \"1607939346678\"\n }\n}" + "body": "{\n \"id\": \"api.channel.create\",\n \"ver\": \"1.0\",\n \"ts\": \"2020-12-14T08:27:27.810Z\",\n \"params\": {\n \"resmsgid\": \"3357da20-3de6-11eb-9ff3-67c41480f6aa\",\n \"msgid\": \"3353bb70-3de6-11eb-9ff3-67c41480f6aa\",\n \"status\": \"successful\",\n \"err\": null,\n \"errmsg\": null\n },\n \"responseCode\": \"OK\",\n \"result\": {\n \"identifier\": \"channel-id\",\n \"node_id\": \"channel-id\"\n }\n}" }, { - "name": "BAD REQUEST. The \"create framework\" operation failed ! The possible reason for failure is that you may have missed providing input for a mandatory parameter.", + "name": "BAD REQUEST. The \"Create Channel\" operation failed ! The possible reason for failure is that you may have missed providing input for a mandatory parameter or providing some wrong request.", "originalRequest": { "method": "POST", "header": [ @@ -1173,19 +1393,14 @@ "value": "Ut enim offici" }, { - "description": "(Required) To make use of the API, you require authorization. Raise a request to the administrator for the use of the API. You will receive the authorization key. Specify the key received, here.", + "description": "(Required) To make use of the API, you require bearer authorization. Raise a request to the administrator for the use of the API. You will receive the authorization key. Specify the key received, here.", "key": "Authorization", "value": "Ut enim offici" - }, - { - "description": "(Required) It is the Unique Id to identify the root organisation to which the user belongs", - "key": "X-Channel-Id", - "value": "Ut enim offici" } ], "body": { "mode": "raw", - "raw": "{\n \"request\": {\n \"framework\": {\n \"name\": \"Framework Name\",\n \"code\": \"dummy_framework\",\n \"channels\": [\n {\n \"identifier\": \"in.ekstep\"\n }\n ]\n }\n }\n}", + "raw": "{\n \"request\": {\n \"channel\": {\n \"name\": \"Channel Name\",\n \"code\": \"channel-id\"\n }\n }\n}", "options": { "raw": { "language": "json" @@ -1193,12 +1408,12 @@ } }, "url": { - "raw": "{{baseUrl}}/framework/v1/create", + "raw": "{{baseUrl}}/channel/v1/create", "host": [ "{{baseUrl}}" ], "path": [ - "framework", + "channel", "v1", "create" ] @@ -1214,7 +1429,7 @@ } ], "cookie": [], - "body": "{\n \"id\": \"api.framework.create\",\n \"ver\": \"1.0\",\n \"ts\": \"2020-12-14T09:50:45.249Z\",\n \"params\": {\n \"resmsgid\": \"d60c8710-3df1-11eb-9ff3-67c41480f6aa\",\n \"msgid\": null,\n \"status\": \"failed\",\n \"err\": \"CONSTRAINT_VALIDATION_FAILED\",\n \"errmsg\": \"Object already exists with identifier: dummy_framework\"\n },\n \"responseCode\": \"CLIENT_ERROR\",\n \"result\": {}\n}" + "body": "{\n \"id\": \"api.channel.create\",\n \"ver\": \"1.0\",\n \"ts\": \"2020-12-14T08:26:15.914Z\",\n \"params\": {\n \"resmsgid\": \"087d64a0-3de6-11eb-9ff3-67c41480f6aa\",\n \"msgid\": null,\n \"status\": \"failed\",\n \"err\": \"CONSTRAINT_VALIDATION_FAILED\",\n \"errmsg\": \"Object already exists with identifier: channel-id\"\n },\n \"responseCode\": \"CLIENT_ERROR\",\n \"result\": {\n \"messages\": null\n }\n}" }, { "name": "INTERNAL SERVER ERROR ! Looks like something went wrong! These errors are tracked automatically, but if the problem persists feel free to contact us. In the meantime, try refreshing.", @@ -1232,19 +1447,14 @@ "value": "Ut enim offici" }, { - "description": "(Required) To make use of the API, you require authorization. Raise a request to the administrator for the use of the API. You will receive the authorization key. Specify the key received, here.", + "description": "(Required) To make use of the API, you require bearer authorization. Raise a request to the administrator for the use of the API. You will receive the authorization key. Specify the key received, here.", "key": "Authorization", "value": "Ut enim offici" - }, - { - "description": "(Required) It is the Unique Id to identify the root organisation to which the user belongs", - "key": "X-Channel-Id", - "value": "Ut enim offici" } ], "body": { "mode": "raw", - "raw": "{\n \"request\": {\n \"framework\": {\n \"name\": \"Framework Name\",\n \"code\": \"dummy_framework\",\n \"channels\": [\n {\n \"identifier\": \"in.ekstep\"\n }\n ]\n }\n }\n}", + "raw": "{\n \"request\": {\n \"channel\": {\n \"name\": \"Channel Name\",\n \"code\": \"channel-id\"\n }\n }\n}", "options": { "raw": { "language": "json" @@ -1252,12 +1462,12 @@ } }, "url": { - "raw": "{{baseUrl}}/framework/v1/create", + "raw": "{{baseUrl}}/channel/v1/create", "host": [ "{{baseUrl}}" ], "path": [ - "framework", + "channel", "v1", "create" ] @@ -1276,188 +1486,26 @@ "body": "" } ] - }, - { - "name": "Create a framework with all valid fields", - "event": [ - { - "listen": "prerequest", - "script": { - "exec": [ - "pm.environment.set(\"name1\", \"Framework112\");\r", - "pm.environment.set(\"code1\", \"Framework112\");" - ], - "type": "text/javascript" - } - }, - { - "listen": "test", - "script": { - "exec": [ - "let jsonResponse = pm.response.json()\r", - "\r", - "pm.test(\"Status code is 200\", function () {\r", - " pm.response.to.have.status(200);\r", - "});\r", - "\r", - "pm.test(\"Verify keys and data type of the response result\", () => {\r", - " pm.expect(jsonResponse.params).to.have.all.keys('resmsgid','msgid','status', 'err','errmsg');\r", - " pm.expect(jsonResponse.params.status).to.be.a(\"String\");\r", - " pm.expect(jsonResponse.params.err).to.be.a(\"null\");\r", - " pm.expect(jsonResponse.params.errmsg).to.be.a(\"null\");\r", - "});\r", - "\r", - "pm.test(\"Status has string \", function () {\r", - " pm.expect(jsonResponse.params.status).to.be.equal(\"successful\");\r", - "});\r", - "\r", - "pm.test(\"Verify keys and data type of the response result\", () => {\r", - " pm.expect(jsonResponse.result).to.have.all.keys('node_id', 'versionKey');\r", - " pm.expect(jsonResponse.result.node_id).to.be.a(\"String\");\r", - " pm.expect(jsonResponse.result.versionKey).to.be.a(\"string\");\r", - "});\r", - "\r", - "pm.globals.set(\"node_fw\",jsonResponse.result.node_id);\r", - "console.log(pm.globals.get(\"node_fw\"));\r", - "\r", - "// pm.test(\"Status has string \", function () {\r", - "// pm.expect(jsonResponse.result.node_id).to.be.equal(code);\r", - "// });\r", - "\r", - "//how to check the node_id is same as the input" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "apikey", - "apikey": [ - { - "key": "value", - "value": "{{auth_token}}", - "type": "string" - }, - { - "key": "key", - "value": "Authorization", - "type": "string" - }, - { - "key": "in", - "value": "header", - "type": "string" - } - ] - }, - "method": "POST", - "header": [ - { - "key": "X-Channel-Id", - "value": "{{X-Channel-Id}}", - "type": "text" - }, - { - "key": "Content-Type", - "value": "application/json", - "type": "text" - }, - { - "key": "Accept", - "value": "application/json", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\r\n \"request\": {\r\n \"framework\": {\r\n \"name\": \"{{name1}}\",\r\n \"code\": \"{{code1}}\",\r\n \"Description\": \"This is a Sample Framework\",\r\n \"channels\": [\r\n {\r\n \"identifier\": \"sunbird\"\r\n }\r\n ]\r\n }\r\n }\r\n}" - }, - "url": { - "raw": "{{host}}/framework/v3/create", - "host": [ - "{{host}}" - ], - "path": [ - "framework", - "v3", - "create" - ] - } - }, - "response": [] } ] }, { - "name": "Negative", + "name": "Positive", "item": [ { - "name": "Create a framework with invalid fields", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "let jsonResponse = pm.response.json()\r", - "\r", - "pm.test(\"Status code is 400\", function () {\r", - " pm.response.to.have.status(400);\r", - "});\r", - "\r", - "pm.test(\"Status code name has string\", function () {\r", - " pm.response.to.have.status(\"Bad Request\");\r", - "});\r", - "\r", - "\r", - "pm.test(\"Verify keys and data type of the response result\", () => {\r", - " pm.expect(jsonResponse.params).to.have.all.keys('resmsgid','msgid','status', 'err','errmsg');\r", - " pm.expect(jsonResponse.params.status).to.be.a(\"String\");\r", - " pm.expect(jsonResponse.params.err).to.be.a(\"String\");\r", - " pm.expect(jsonResponse.params.errmsg).to.be.a(\"String\");\r", - "});\r", - "\r", - "pm.test(\"Status has string \", function () {\r", - " pm.expect(jsonResponse.params.status).to.be.equal(\"failed\");\r", - "});\r", - "\r", - "pm.test(\"Status code name has string\", function () {\r", - " pm.expect(jsonResponse.params.err).to.be.equal(\"ERR_INVALID_REQUEST\");\r", - "});\r", - "\r", - "pm.test(\"Status code name has string\", function () {\r", - " pm.expect(jsonResponse.params.errmsg).to.be.equal(\"Invalid Request. Please Provide Required Properties!\");\r", - "});\r", - "\r", - "pm.test(\"Status code name has string\", function () {\r", - " pm.expect(jsonResponse.responseCode).to.be.equal(\"CLIENT_ERROR\");\r", - "});\r", - "\r", - "\r", - "\r", - "\r", - "\r", - "" - ], - "type": "text/javascript" - } - } - ], - "protocolProfileBehavior": { - "disabledSystemHeaders": {} - }, + "name": "Update a channel id with Valid fields", "request": { "auth": { "type": "apikey", "apikey": [ { - "key": "value", - "value": "{{auth_token}}", + "key": "key", + "value": "Authorization", "type": "string" }, { - "key": "key", - "value": "Authorization", + "key": "value", + "value": "{{apiKey}}", "type": "string" }, { @@ -1467,46 +1515,14633 @@ } ] }, - "method": "POST", + "method": "PATCH", "header": [ { - "key": "X-Channel-Id", - "value": "{{X-Channel-Id}}", - "type": "text" + "key": "Content-Type", + "value": "application/json" }, { "key": "Accept", - "value": "application/json", - "type": "text" + "value": "application/json" } ], "body": { "mode": "raw", - "raw": "{\r\n \"request\": {\r\n \"framework\": {\r\n \"name\": [],\r\n \"code\": \"Sample Framework\",\r\n \"channels\": [\r\n {\r\n \"identifier\": \"in.ekstep\"\r\n }\r\n ]\r\n }\r\n }\r\n}" + "raw": "{\n \"request\": {\n \"channel\": {\n \"description\": \"Updated channel description\"\n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } }, "url": { - "raw": "{{host}}/framework/v3/create", + "raw": "{{baseUrl}}/channel/v3/update/{{channel}}", "host": [ - "{{host}}" + "{{baseUrl}}" ], "path": [ - "framework", + "channel", "v3", - "create" + "update", + "{{channel}}" ] + }, + "description": "This API is associated with updating a specific channel\n - The endpoint for **Update Channel** is `/channel/v1/update/{ID}`\n - It points to knowledge-mw-service - `/v1/channel/update/{ID}`\n - The fields marked with an asterisk (*) are mandatory. They cannot be null or empty." + }, + "response": [ + { + "name": "OK ! Successful operation.\"Update channel by ID\" operation was successfully executed.", + "originalRequest": { + "method": "PATCH", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource.\n Possible media types can be:- \n - application/json\n - multipart/form-data\n - application/x-www-form-urlencoded", + "key": "Content-Type", + "value": "Ut enim offici" + }, + { + "description": "(Required) To make use of the API, you require authorization. Raise a request to the administrator for the use of the API. You will receive the authorization key. Specify the key received, here.", + "key": "Authorization", + "value": "Ut enim offici" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"channel\": {\n \"description\": \"Updated channel description\"\n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/channel/v1/update/:ID", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "channel", + "v1", + "update", + ":ID" + ], + "variable": [ + { + "key": "ID", + "value": "Ut enim offici", + "description": "(Required) Unique identifier of the channel to be updated" + } + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"api.channel.update\",\n \"ver\": \"1.0\",\n \"ts\": \"2020-12-14T08:29:24.724Z\",\n \"params\": {\n \"resmsgid\": \"79078340-3de6-11eb-9ff3-67c41480f6aa\",\n \"msgid\": \"78fef7c0-3de6-11eb-9ff3-67c41480f6aa\",\n \"status\": \"successful\",\n \"err\": null,\n \"errmsg\": null\n },\n \"responseCode\": \"OK\",\n \"result\": {\n \"identifier\": \"channel-405\",\n \"node_id\": \"channel-405\"\n }\n}" + }, + { + "name": "BAD REQUEST. The **Update Channel\" operation failed ! The possible reason for failure is that you may have missed providing input for a mandatory parameter.", + "originalRequest": { + "method": "PATCH", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource.\n Possible media types can be:- \n - application/json\n - multipart/form-data\n - application/x-www-form-urlencoded", + "key": "Content-Type", + "value": "Ut enim offici" + }, + { + "description": "(Required) To make use of the API, you require authorization. Raise a request to the administrator for the use of the API. You will receive the authorization key. Specify the key received, here.", + "key": "Authorization", + "value": "Ut enim offici" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"channel\": {\n \"description\": \"Updated channel description\"\n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/channel/v1/update/:ID", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "channel", + "v1", + "update", + ":ID" + ], + "variable": [ + { + "key": "ID", + "value": "Ut enim offici", + "description": "(Required) Unique identifier of the channel to be updated" + } + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"ts\": 79777367,\n \"id\": \"Lorem in dolore ex ullamco\",\n \"params\": {\n \"msgid\": \"in mollit commodo\",\n \"resmsgid\": \"fugiat deserunt Lorem\",\n \"status\": \"failed\",\n \"err\": \"ut dolor et repreh\",\n \"errmsg\": \"ut enim \"\n },\n \"ver\": \"reprehenderit laboris\",\n \"responseCode\": \"proident qui minim\",\n \"result\": {}\n}" + }, + { + "name": "RESOURCE NOT FOUND. The \"update channel by ID\" operation failed ! The possible reason for failure is that you may have passed invalid channel id.", + "originalRequest": { + "method": "PATCH", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource.\n Possible media types can be:- \n - application/json\n - multipart/form-data\n - application/x-www-form-urlencoded", + "key": "Content-Type", + "value": "Ut enim offici" + }, + { + "description": "(Required) To make use of the API, you require authorization. Raise a request to the administrator for the use of the API. You will receive the authorization key. Specify the key received, here.", + "key": "Authorization", + "value": "Ut enim offici" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"channel\": {\n \"description\": \"Updated channel description\"\n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/channel/v1/update/:ID", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "channel", + "v1", + "update", + ":ID" + ], + "variable": [ + { + "key": "ID", + "value": "Ut enim offici", + "description": "(Required) Unique identifier of the channel to be updated" + } + ] + } + }, + "status": "Not Found", + "code": 404, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"api.channel.update\",\n \"ver\": \"1.0\",\n \"ts\": \"2020-12-14T08:30:44.219Z\",\n \"params\": {\n \"resmsgid\": \"a8697cb0-3de6-11eb-9ff3-67c41480f6aa\",\n \"msgid\": null,\n \"status\": \"failed\",\n \"err\": \"NOT_FOUND\",\n \"errmsg\": \"Error! Node(s) doesn't Exists. | [Invalid Node Id.]: channel-406\"\n },\n \"responseCode\": \"RESOURCE_NOT_FOUND\",\n \"result\": {\n \"messages\": null\n }\n}" + }, + { + "name": "INTERNAL SERVER ERROR ! Looks like something went wrong! These errors are tracked automatically, but if the problem persists feel free to contact us. In the meantime, try refreshing.", + "originalRequest": { + "method": "PATCH", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource.\n Possible media types can be:- \n - application/json\n - multipart/form-data\n - application/x-www-form-urlencoded", + "key": "Content-Type", + "value": "Ut enim offici" + }, + { + "description": "(Required) To make use of the API, you require authorization. Raise a request to the administrator for the use of the API. You will receive the authorization key. Specify the key received, here.", + "key": "Authorization", + "value": "Ut enim offici" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"channel\": {\n \"description\": \"Updated channel description\"\n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/channel/v1/update/:ID", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "channel", + "v1", + "update", + ":ID" + ], + "variable": [ + { + "key": "ID", + "value": "Ut enim offici", + "description": "(Required) Unique identifier of the channel to be updated" + } + ] + } + }, + "status": "Internal Server Error", + "code": 500, + "_postman_previewlanguage": "text", + "header": [ + { + "key": "Content-Type", + "value": "text/plain" + } + ], + "cookie": [], + "body": "" + } + ] + } + ] + }, + { + "name": "Negative", + "item": [ + { + "name": "Update a channel id with Invalid fields", + "request": { + "method": "PATCH", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "{{apiKey}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"channel\": {\n \"123\":\"abc\"\n }\n }\n}" + }, + "url": { + "raw": "{{host}}/channel/v3/update/{{channel}}", + "host": [ + "{{host}}" + ], + "path": [ + "channel", + "v3", + "update", + "{{channel}}" + ] + } + }, + "response": [] + }, + { + "name": "Update a channel which does not exist", + "request": { + "auth": { + "type": "apikey", + "apikey": [ + { + "key": "value", + "value": "{{auth_token}}", + "type": "string" + }, + { + "key": "key", + "value": "Authorization", + "type": "string" + }, + { + "key": "in", + "value": "header", + "type": "string" + } + ] + }, + "method": "PATCH", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "{{apiKey}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"channel\": {\n \"description\": \"Updated channel description\"\n }\n }\n}" + }, + "url": { + "raw": "{{host}}/channel/v3/update/dummy", + "host": [ + "{{host}}" + ], + "path": [ + "channel", + "v3", + "update", + "dummy" + ] + } + }, + "response": [] + } + ] + } + ] + } + ] + }, + { + "name": "Channel Category", + "item": [ + { + "name": "Create Channel Category", + "item": [ + { + "name": "Positive", + "item": [ + { + "name": "Create Channel category for valid channel id with valid Mandatory fields", + "request": { + "method": "POST", + "header": [ + { + "key": "user-id", + "value": "{{user-id}}" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "{{APIKey}}" + }, + { + "key": "X-Channel-Id", + "value": "{{channel}}" + }, + { + "key": "Accept", + "value": "application/json", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"categoryInstance\": {\n \"name\": \"category\",\n \"code\": \"org.ekstep.test.categoryInstance.medium\"\n }\n }\n}" + }, + "url": { + "raw": "{{host}}/channel/v3/category/create", + "host": [ + "{{host}}" + ], + "path": [ + "channel", + "v3", + "category", + "create" + ] + } + }, + "response": [] + }, + { + "name": "Create channel category for valid channel id with all valid fieldsNew Request", + "request": { + "method": "POST", + "header": [ + { + "key": "user-id", + "value": "{{user-id}}" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "{{APIKey}}" + }, + { + "key": "X-Channel-Id", + "value": "{{channel}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"categoryInstance\": {\n \"name\": \"category\",\n \"Description\": \"Channel description\",\n \"code\": \"org.ekstep.test.categoryInstance.medium\"\n }\n }\n}" + }, + "url": { + "raw": "{{host}}/channel/v3/category/create", + "host": [ + "{{host}}" + ], + "path": [ + "channel", + "v3", + "category", + "create" + ] + } + }, + "response": [] + } + ] + }, + { + "name": "Negative", + "item": [ + { + "name": "Create channel category for invalid channel id with all valid fields", + "request": { + "method": "POST", + "header": [ + { + "key": "user-id", + "value": "{{user-id}}" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "{{APIKey}}" + }, + { + "key": "X-Channel-Id", + "value": "dummy" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"categoryInstance\": {\n \"name\": \"category\",\n \"Description\": \"Channel description\",\n \"code\": \"org.ekstep.test.categoryInstance.medium\"\n }\n }\n}" + }, + "url": { + "raw": "{{host}}/channel/v3/category/create", + "host": [ + "{{host}}" + ], + "path": [ + "channel", + "v3", + "category", + "create" + ] + } + }, + "response": [] + }, + { + "name": "Create channel category for valid channel id with missing mandatory field", + "request": { + "method": "POST", + "header": [ + { + "key": "user-id", + "value": "rayuluv" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "{{APIKey}}" + }, + { + "key": "X-Channel-Id", + "value": "channel_ch1" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"categoryInstance\": {\n \"name\": \"category\",\n \"Description\": \"Channel description\"\n \n }\n }\n}" + }, + "url": { + "raw": "{{host}}/channel/v3/category/create", + "host": [ + "{{host}}" + ], + "path": [ + "channel", + "v3", + "category", + "create" + ] + } + }, + "response": [] + } + ] + } + ] + }, + { + "name": "Read Channel category", + "item": [ + { + "name": "Positive", + "item": [ + { + "name": "Read a valid channel category", + "request": { + "method": "GET", + "header": [ + { + "key": "user-id", + "value": "{{user-id}}" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer {{api_key}}" + }, + { + "key": "X-Channel-Id", + "value": "{{channel}}" + } + ], + "url": { + "raw": "{{host}}/channel/v3/category/read/class", + "host": [ + "{{host}}" + ], + "path": [ + "channel", + "v3", + "category", + "read", + "class" + ] + } + }, + "response": [] + } + ] + }, + { + "name": "Negative", + "item": [ + { + "name": "Read an invalid channel category from valid channel", + "request": { + "method": "GET", + "header": [ + { + "key": "user-id", + "value": "{{user-id}}" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer {{api_key}}" + }, + { + "key": "X-Channel-Id", + "value": "{{channel}}" + } + ], + "url": { + "raw": "{{host}}/channel/v3/category/read/dummy", + "host": [ + "{{host}}" + ], + "path": [ + "channel", + "v3", + "category", + "read", + "dummy" + ] + } + }, + "response": [] + }, + { + "name": "Read a valid channel category with invalid channel id", + "request": { + "method": "GET", + "header": [ + { + "key": "user-id", + "value": "{{user-id}}" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer {{api_key}}" + }, + { + "key": "X-Channel-Id", + "value": "dummy" + } + ], + "url": { + "raw": "{{host}}/channel/v3/category/read/class", + "host": [ + "{{host}}" + ], + "path": [ + "channel", + "v3", + "category", + "read", + "class" + ] + } + }, + "response": [] + } + ] + } + ] + }, + { + "name": "Search Channel category", + "item": [ + { + "name": "Positive", + "item": [] + }, + { + "name": "Negative", + "item": [] + } + ] + }, + { + "name": "Update Channel category", + "item": [ + { + "name": "Positive", + "item": [ + { + "name": "Update a channel category with valid fields", + "request": { + "method": "PATCH", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "user-id", + "value": "ilimi" + }, + { + "key": "Accept-Charset", + "value": "UTF-8" + }, + { + "key": "Accept-Encoding", + "value": "UTF-8" + }, + { + "key": "Authorization", + "value": "{{APIKey}}" + }, + { + "key": "X-Channel-Id", + "value": "{{channel}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"category\":{\n \"description\":\"LP category API\",\n \"name\":\"test\",\n \"code\":\"testUpdate\"\n }\n }\n}" + }, + "url": { + "raw": "{{host}}/channel/v3/category/update/{{do_id}}", + "host": [ + "{{host}}" + ], + "path": [ + "channel", + "v3", + "category", + "update", + "{{do_id}}" + ] + } + }, + "response": [] + } + ] + }, + { + "name": "Negative", + "item": [ + { + "name": "Update a channel category with valid fields with invalid channel id", + "request": { + "method": "PATCH", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "user-id", + "value": "{{user-id}}" + }, + { + "key": "Accept-Charset", + "value": "UTF-8" + }, + { + "key": "Accept-Encoding", + "value": "UTF-8" + }, + { + "key": "Authorization", + "value": "{{APIKey}}" + }, + { + "key": "X-Channel-Id", + "value": "dummy" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"category\":{\n \"description\":\"LP category API\",\n \"name\":\"test\",\n \"code\":\"testUpdate\"\n }\n }\n}" + }, + "url": { + "raw": "{{host}}/channel/v3/category/update/{{do_id}}", + "host": [ + "{{host}}" + ], + "path": [ + "channel", + "v3", + "category", + "update", + "{{do_id}}" + ] + } + }, + "response": [] + }, + { + "name": "Update a channel category with invalid fields", + "request": { + "method": "PATCH", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "user-id", + "value": "rayuluv" + }, + { + "key": "Accept-Charset", + "value": "UTF-8" + }, + { + "key": "Accept-Encoding", + "value": "UTF-8" + }, + { + "key": "Authorization", + "value": "{{APIKey}}" + }, + { + "key": "X-Channel-Id", + "value": "channel_ch1" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"category\":{\n \"description\":\"LP category API\",\n \"name\":\"test\",\n \"code\":\"testUpdate\"\n }\n }\n}" + }, + "url": { + "raw": "{{host}}/channel/v3/category/update/{{do_id}}", + "host": [ + "{{host}}" + ], + "path": [ + "channel", + "v3", + "category", + "update", + "{{do_id}}" + ] + } + }, + "response": [] + } + ] + } + ] + }, + { + "name": "Delete Channel Category", + "item": [ + { + "name": "Positive", + "item": [ + { + "name": "Retire a valid channel category", + "request": { + "method": "DELETE", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "user-id", + "value": "{{user-id}}" + }, + { + "key": "Authorization", + "value": "{{APIKey}}" + }, + { + "key": "X-Channel-Id", + "value": "{{channel}}" + } + ], + "url": { + "raw": "{{host}}/channel/v3/category/retire/", + "host": [ + "{{host}}" + ], + "path": [ + "channel", + "v3", + "category", + "retire", + "" + ] + } + }, + "response": [] + } + ] + }, + { + "name": "Negative", + "item": [ + { + "name": "Retire a valid channel category with invalid channel id", + "request": { + "method": "DELETE", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "user-id", + "value": "{{user-id}}" + }, + { + "key": "Authorization", + "value": "{{APIKey}}" + }, + { + "key": "X-Channel-Id", + "value": "dummy" + } + ], + "url": { + "raw": "{{host}}/channel/v3/category/retire/class", + "host": [ + "{{host}}" + ], + "path": [ + "channel", + "v3", + "category", + "retire", + "class" + ] + } + }, + "response": [] + }, + { + "name": "Retire a non existing channel category from valid channel id", + "request": { + "method": "DELETE", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "user-id", + "value": "{{user-id}}" + }, + { + "key": "Authorization", + "value": "{{APIKey}}" + }, + { + "key": "X-Channel-Id", + "value": "{{channel}}" + } + ], + "url": { + "raw": "{{host}}/channel/v3/category/retire/abc", + "host": [ + "{{host}}" + ], + "path": [ + "channel", + "v3", + "category", + "retire", + "abc" + ] + } + }, + "response": [] + }, + { + "name": "Retire a already retired channel category", + "request": { + "method": "DELETE", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "user-id", + "value": "{{user-id}}" + }, + { + "key": "Authorization", + "value": "{{APIKey}}" + }, + { + "key": "X-Channel-Id", + "value": "{{channel}}" + } + ], + "url": { + "raw": "{{host}}/channel/v3/category/retire/class", + "host": [ + "{{host}}" + ], + "path": [ + "channel", + "v3", + "category", + "retire", + "class" + ] + } + }, + "response": [] + } + ] + } + ] + } + ] + }, + { + "name": "Channel Term", + "item": [ + { + "name": "Create Channel term", + "item": [ + { + "name": "Positive", + "item": [] + }, + { + "name": "Negative", + "item": [] + } + ] + }, + { + "name": "Read Channel term", + "item": [ + { + "name": "Positive", + "item": [] + }, + { + "name": "Negative", + "item": [] + } + ] + }, + { + "name": "Search Channel term", + "item": [ + { + "name": "Positive", + "item": [] + }, + { + "name": "Negative", + "item": [] + } + ] + }, + { + "name": "Update Channel term", + "item": [ + { + "name": "Positive", + "item": [] + }, + { + "name": "Negative", + "item": [] + } + ] + }, + { + "name": "Delete Channel term", + "item": [ + { + "name": "Positive", + "item": [] + }, + { + "name": "Negative", + "item": [] + } + ] + } + ] + } + ], + "description": "Pre-requisite\n\n- Channel name should be updated before running the collection (in the pre requisite folder as well)\n \n- Channel category should be updated before running the collection (in the pre requisite folder as well)\n \n- Channel term should be updated before running the collection (in the requisite folders as well)" + }, + { + "name": "Master Data", + "item": [ + { + "name": "Master Category", + "item": [ + { + "name": "Create master categroy", + "item": [ + { + "name": "Positive", + "item": [ + { + "name": "Create a master category with valid mandatory fields", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json()\r", + "\r", + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "\r", + "pm.test(\"id has string - api.taxonomy.category.create \", function () {\r", + " pm.expect(jsonResponse.id).to.be.equal(\"api.taxonomy.category.create\");\r", + "});\r", + "\r", + "pm.test(\"Version is 3.0 \", function () {\r", + " pm.expect(jsonResponse.ver).to.be.equal(\"3.0\");\r", + "});\r", + "\r", + "pm.test(\"Verify keys and data type of the response result\", () => {\r", + " pm.expect(jsonResponse.params).to.have.all.keys('resmsgid','msgid','status', 'err','errmsg');\r", + " pm.expect(jsonResponse.params.resmsgid).to.be.a(\"string\");\r", + " pm.expect(jsonResponse.params.msgid).to.be.a(\"null\"); \r", + " pm.expect(jsonResponse.params.status).to.be.a(\"string\");\r", + " pm.expect(jsonResponse.params.err).to.be.a(\"null\");\r", + " pm.expect(jsonResponse.params.errmsg).to.be.a(\"null\");\r", + "});\r", + "\r", + "pm.test(\"Status is successful \", function () {\r", + " pm.expect(jsonResponse.params.status).to.be.equal(\"successful\");\r", + "});\r", + "\r", + "pm.test(\"ResponseCode is OK \", function () {\r", + " pm.expect(jsonResponse.responseCode).to.be.equal(\"OK\");\r", + "});\r", + "\r", + "pm.test(\"Verify keys and data type of the response result\", () => {\r", + " pm.expect(jsonResponse.result).to.have.all.keys('identifier','node_id');\r", + " pm.expect(jsonResponse.result.node_id).to.be.a('String');\r", + " pm.expect(jsonResponse.result.identifier).to.be.a('String');\r", + "});\r", + "pm.collectionVariables.set(\"master_id\",jsonResponse.result.identifier);\r", + "console.log(pm.collectionVariables.get(\"master_id\"));\r", + "pm.collectionVariables.set(\"master_node\",jsonResponse.result.node_id);\r", + "console.log(pm.collectionVariables.get(\"master_node\"));\r", + "\r", + "pm.test(`identifier should be equal to ${pm.collectionVariables.get(\"master_id\")}`, () => {\r", + " pm.expect(jsonResponse.result.identifier).to.eql(`${pm.collectionVariables.get(\"master_code\")}`);\r", + "});\r", + "\r", + "pm.test(`node_id should be equal to ${pm.collectionVariables.get(\"master_node\")}`, () => {\r", + " pm.expect(jsonResponse.result.node_id).to.eql(`${pm.collectionVariables.get(\"master_code\")}`);\r", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "apikey", + "apikey": [ + { + "key": "value", + "value": "{{auth_token}}", + "type": "string" + }, + { + "key": "key", + "value": "Authorization", + "type": "string" + }, + { + "key": "in", + "value": "header", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "X-Channel-Id", + "value": "{{X-Channel-Id}}" + }, + { + "key": "", + "value": "", + "disabled": true + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"category\": {\n \"name\": \"master\",\n \"code\": \"{{master_code}}\",\n \"targetIdFieldName\": \"targetmasterIds\",\n \"searchLabelFieldName\": \"se_master\",\n \"searchIdFieldName\": \"se_master\",\n \"orgIdFieldName\": \"masterIds\"\n }\n }\n}" + }, + "url": { + "raw": "{{host}}/framework/v3/category/master/create", + "host": [ + "{{host}}" + ], + "path": [ + "framework", + "v3", + "category", + "master", + "create" + ] + } + }, + "response": [] + }, + { + "name": "Create a master category with all valid fields", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json()\r", + "\r", + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "\r", + "pm.test(\"id has string - api.taxonomy.category.create \", function () {\r", + " pm.expect(jsonResponse.id).to.be.equal(\"api.taxonomy.category.create\");\r", + "});\r", + "\r", + "pm.test(\"Version is 3.0 \", function () {\r", + " pm.expect(jsonResponse.ver).to.be.equal(\"3.0\");\r", + "});\r", + "\r", + "pm.test(\"Verify keys and data type of the response result\", () => {\r", + " pm.expect(jsonResponse.params).to.have.all.keys('resmsgid','msgid','status', 'err','errmsg');\r", + " pm.expect(jsonResponse.params.resmsgid).to.be.a(\"string\");\r", + " pm.expect(jsonResponse.params.msgid).to.be.a(\"null\"); \r", + " pm.expect(jsonResponse.params.status).to.be.a(\"string\");\r", + " pm.expect(jsonResponse.params.err).to.be.a(\"null\");\r", + " pm.expect(jsonResponse.params.errmsg).to.be.a(\"null\");\r", + "});\r", + "\r", + "pm.test(\"Status is successful \", function () {\r", + " pm.expect(jsonResponse.params.status).to.be.equal(\"successful\");\r", + "});\r", + "\r", + "pm.test(\"ResponseCode is OK \", function () {\r", + " pm.expect(jsonResponse.responseCode).to.be.equal(\"OK\");\r", + "});\r", + "\r", + "pm.test(\"Verify keys and data type of the response result\", () => {\r", + " pm.expect(jsonResponse.result).to.have.all.keys('identifier','node_id');\r", + " pm.expect(jsonResponse.result.node_id).to.be.a('String');\r", + " pm.expect(jsonResponse.result.identifier).to.be.a('String');\r", + "});\r", + "\r", + "pm.collectionVariables.set(\"master2_id\",jsonResponse.result.identifier);\r", + "console.log(pm.collectionVariables.get(\"master2_id\"));\r", + "pm.collectionVariables.set(\"master2_node\",jsonResponse.result.node_id);\r", + "console.log(pm.collectionVariables.get(\"master2_node\"));\r", + "\r", + "pm.test(`identifier should be equal to ${pm.collectionVariables.get(\"master2_id\")}`, () => {\r", + " pm.expect(jsonResponse.result.identifier).to.eql(`${pm.collectionVariables.get(\"master2_code\")}`);\r", + "});\r", + "\r", + "pm.test(`node_id should be equal to ${pm.collectionVariables.get(\"master2_node\")}`, () => {\r", + " pm.expect(jsonResponse.result.node_id).to.eql(`${pm.collectionVariables.get(\"master2_code\")}`);\r", + "});\r", + "\r", + "" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "apikey", + "apikey": [ + { + "key": "value", + "value": "{{auth_token}}", + "type": "string" + }, + { + "key": "key", + "value": "Authorization", + "type": "string" + }, + { + "key": "in", + "value": "header", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "X-Channel-Id", + "value": "{{X-Channel-Id}}" + }, + { + "key": "", + "value": "" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"category\": {\n \"name\": \"master\",\n \"code\": \"{{master2_code}}\",\n \"description\" : \"Master category description\",\n \"targetIdFieldName\": \"targetmasterIds\",\n \"searchLabelFieldName\": \"se_master\",\n \"searchIdFieldName\": \"se_master\",\n \"orgIdFieldName\": \"masterIds\"\n }\n }\n}" + }, + "url": { + "raw": "{{host}}/framework/v3/category/master/create", + "host": [ + "{{host}}" + ], + "path": [ + "framework", + "v3", + "category", + "master", + "create" + ] + } + }, + "response": [] + } + ], + "description": "1. Request body should be updated with unique value each time before creating master category" + }, + { + "name": "Negative", + "item": [ + { + "name": "Create a master category with invalid fields", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json()\r", + "\r", + "pm.test(\"Status code is 400\", function () {\r", + " pm.response.to.have.status(400);\r", + "});\r", + "\r", + "pm.test(\"id has string - api.taxonomy.category.create \", function () {\r", + " pm.expect(jsonResponse.id).to.be.equal(\"api.taxonomy.category.create\");\r", + "});\r", + "\r", + "pm.test(\"Version is 3.0 \", function () {\r", + " pm.expect(jsonResponse.ver).to.be.equal(\"3.0\");\r", + "});\r", + "\r", + "pm.test(\"Verify keys and data type of the response result\", () => {\r", + " pm.expect(jsonResponse.result).to.be.an(\"object\").that.has.all.keys(\r", + " 'messages'\r", + " );\r", + " pm.expect(jsonResponse.params).to.have.all.keys('resmsgid','msgid','status', 'err','errmsg');\r", + "pm.expect(jsonResponse.params.resmsgid).to.be.a(\"String\");\r", + "pm.expect(jsonResponse.params.msgid).to.be.a(\"null\");\r", + " pm.expect(jsonResponse.params.status).to.be.a(\"String\");\r", + " pm.expect(jsonResponse.params.err).to.be.a(\"String\");\r", + " pm.expect(jsonResponse.params.errmsg).to.be.a(\"String\");\r", + "});\r", + "\r", + "pm.test(\"err has string: CLIENT_ERROR\", function () {\r", + " pm.expect(jsonResponse.params.err).to.be.equal(\"CLIENT_ERROR\");\r", + "});\r", + "\r", + "pm.test(\"Status has string: failed\", function () {\r", + " pm.expect(jsonResponse.params.status).to.be.equal(\"failed\");\r", + "});\r", + "\r", + "pm.test(\"errmsg has string: Validation Errors\", function () {\r", + " pm.expect(jsonResponse.params.errmsg).to.be.equal(\"Validation Errors\");\r", + "});\r", + "\r", + "pm.test(\"Status code name has string: Bad Request\", function () {\r", + " pm.response.to.have.status(\"Bad Request\");\r", + "});\r", + "\r", + "pm.test(\"ResponseCode has string: CLIENT_ERROR\", function () {\r", + " pm.expect(jsonResponse.responseCode).to.be.equal(\"CLIENT_ERROR\");\r", + "});\r", + "\r", + "pm.test(\"Verify keys and data type of the response result\", () => {\r", + " pm.expect(jsonResponse.result).to.be.an(\"object\").that.has.all.keys(\r", + " 'messages'\r", + " );\r", + " pm.expect(jsonResponse.result.messages).to.be.an(\"array\").that.includes.members([\r", + " \"Required Metadata orgIdFieldName not set\",\r", + " \"Required Metadata code not set\"\r", + " ]);\r", + "});\r", + "\r", + "\r", + "\r", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "apikey", + "apikey": [ + { + "key": "value", + "value": "{{auth_token}}", + "type": "string" + }, + { + "key": "key", + "value": "Authorization", + "type": "string" + }, + { + "key": "in", + "value": "header", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "X-Channel-Id", + "value": "{{X-Channel-Id}}" + }, + { + "key": "", + "value": "", + "disabled": true + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"category\": {\n \"name\": \"class\",\n \"code\": \"\",\n \"description\": \"\",\n \"targetIdFieldName\": \"targetclassIds\",\n \"searchLabelFieldName\": \"se_class\",\n \"searchIdFieldName\": \"se_class\",\n \"orgIdFieldName\": \"\"\n }\n }\n}" + }, + "url": { + "raw": "{{host}}/framework/v3/category/master/create", + "host": [ + "{{host}}" + ], + "path": [ + "framework", + "v3", + "category", + "master", + "create" + ] + } + }, + "response": [] + }, + { + "name": "Create master category with missing mandatory fields", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json()\r", + "\r", + "pm.test(\"Status code is 400\", function () {\r", + " pm.response.to.have.status(400);\r", + "});\r", + "pm.test(\"id has string - api.taxonomy.category.create \", function () {\r", + " pm.expect(jsonResponse.id).to.be.equal(\"api.taxonomy.category.create\");\r", + "});\r", + "\r", + "pm.test(\"Version is 3.0 \", function () {\r", + " pm.expect(jsonResponse.ver).to.be.equal(\"3.0\");\r", + "});\r", + "pm.test(\"Verify keys and data type of the response result\", () => {\r", + " pm.expect(jsonResponse.result).to.be.an(\"object\").that.has.all.keys(\r", + " 'messages'\r", + " );\r", + " pm.expect(jsonResponse.params).to.have.all.keys('resmsgid','msgid','status', 'err','errmsg');\r", + "pm.expect(jsonResponse.params.resmsgid).to.be.a(\"String\");\r", + "pm.expect(jsonResponse.params.msgid).to.be.a(\"null\");\r", + " pm.expect(jsonResponse.params.status).to.be.a(\"String\");\r", + " pm.expect(jsonResponse.params.err).to.be.a(\"String\");\r", + " pm.expect(jsonResponse.params.errmsg).to.be.a(\"String\");\r", + "});\r", + "\r", + "pm.test(\"err has string\", function () {\r", + " pm.expect(jsonResponse.params.err).to.be.equal(\"CLIENT_ERROR\");\r", + "});\r", + "\r", + "pm.test(\"Status has string\", function () {\r", + " pm.expect(jsonResponse.params.status).to.be.equal(\"failed\");\r", + "});\r", + "\r", + "pm.test(\"errmsg has string\", function () {\r", + " pm.expect(jsonResponse.params.errmsg).to.be.equal(\"Validation Errors\");\r", + "});\r", + "\r", + "pm.test(\"Status code name has string: Bad Request\", function () {\r", + " pm.response.to.have.status(\"Bad Request\");\r", + "});\r", + "\r", + "pm.test(\"ResponseCode has string: CLIENT_ERROR\", function () {\r", + " pm.expect(jsonResponse.responseCode).to.be.equal(\"CLIENT_ERROR\");\r", + "});\r", + "\r", + "pm.test(\"Verify keys and data type of the response result\", () => {\r", + " pm.expect(jsonResponse.result).to.be.an(\"object\").that.has.all.keys(\r", + " 'messages'\r", + " );\r", + " pm.expect(jsonResponse.result.messages).to.be.an(\"array\").that.includes.members([\r", + " \"Required Metadata searchLabelFieldName not set\",\r", + " \"Required Metadata searchIdFieldName not set\",\r", + " \"Required Metadata targetIdFieldName not set\",\r", + " \"Required Metadata orgIdFieldName not set\"\r", + " ]);\r", + "});\r", + "\r", + "\r", + "\r", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "user-id", + "value": "rayuluv" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "X-Channel-Id", + "value": "in.ekstep" + }, + { + "key": "Authorization", + "value": "Bearer {{api_key}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"category\": {\n \"name\": \"Class\",\n \"code\": \"Class\"\n }\n }\n}" + }, + "url": { + "raw": "{{host}}/framework/v3/category/master/create", + "host": [ + "{{host}}" + ], + "path": [ + "framework", + "v3", + "category", + "master", + "create" + ] + } + }, + "response": [] + }, + { + "name": "Create existing category", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json()\r", + "\r", + "pm.test(\"Status code is 400\", function () {\r", + " pm.response.to.have.status(400);\r", + "});\r", + "pm.test(\"Verify keys and data type of the response result\", () => {\r", + " pm.expect(jsonResponse.result).to.be.an(\"object\").that.has.all.keys(\r", + " 'messages'\r", + " );\r", + " pm.expect(jsonResponse.params).to.have.all.keys('resmsgid','msgid','status', 'err','errmsg');\r", + "pm.expect(jsonResponse.params.resmsgid).to.be.a(\"String\");\r", + "pm.expect(jsonResponse.params.msgid).to.be.a(\"null\");\r", + " pm.expect(jsonResponse.params.status).to.be.a(\"String\");\r", + " pm.expect(jsonResponse.params.err).to.be.a(\"String\");\r", + " pm.expect(jsonResponse.params.errmsg).to.be.a(\"String\");\r", + "});\r", + "\r", + "pm.test(\"err has string\", function () {\r", + " pm.expect(jsonResponse.params.err).to.be.equal(\"CONSTRAINT_VALIDATION_FAILED\");\r", + "});\r", + "\r", + "pm.test(\"Status has string\", function () {\r", + " pm.expect(jsonResponse.params.status).to.be.equal(\"failed\");\r", + "});\r", + "\r", + "pm.test(\"errmsg has string\", function () {\r", + " pm.expect(jsonResponse.params.errmsg).to.eql(\"Object already exists with identifier: class\");\r", + "});\r", + "\r", + "pm.test(\"Status code name has string: Bad Request\", function () {\r", + " pm.response.to.have.status(\"Bad Request\");\r", + "});\r", + "\r", + "pm.test(\"ResponseCode has string: CLIENT_ERROR\", function () {\r", + " pm.expect(jsonResponse.responseCode).to.be.equal(\"CLIENT_ERROR\");\r", + "});\r", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "user-id", + "value": "rayuluv" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "X-Channel-Id", + "value": "in.ekstep" + }, + { + "key": "Authorization", + "value": "Bearer {{api_key}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"category\": {\n \"name\": \"class\",\n \"code\": \"class\",\n \"description\": \"class description\",\n \"targetIdFieldName\": \"targetclassIds\",\n \"searchLabelFieldName\": \"se_class\",\n \"searchIdFieldName\": \"se_class\",\n \"orgIdFieldName\": \"se_class\"\n }\n }\n}" + }, + "url": { + "raw": "{{host}}/framework/v3/category/master/create", + "host": [ + "{{host}}" + ], + "path": [ + "framework", + "v3", + "category", + "master", + "create" + ] + } + }, + "response": [] + } + ], + "description": "1. Third scenario, existing details should be updated in request body" + } + ], + "description": "1. Master category code should be updated everytime befor running the collection (Positive)" + }, + { + "name": "Update Master category", + "item": [ + { + "name": "Pre requisite", + "item": [ + { + "name": "Create Master category", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json()\r", + "\r", + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "\r", + "pm.collectionVariables.set(\"master3_id\",jsonResponse.result.identifier);\r", + "console.log(pm.collectionVariables.get(\"master3_id\"));\r", + "pm.collectionVariables.set(\"master3_node\",jsonResponse.result.node_id);\r", + "console.log(pm.collectionVariables.get(\"master3_node\"));\r", + "\r", + "pm.test(`identifier should be equal to ${pm.collectionVariables.get(\"master3_id\")}`, () => {\r", + " pm.expect(jsonResponse.result.identifier).to.eql(`${pm.collectionVariables.get(\"master3_code\")}`);\r", + "});\r", + "\r", + "pm.test(`node_id should be equal to ${pm.collectionVariables.get(\"master3_node\")}`, () => {\r", + " pm.expect(jsonResponse.result.node_id).to.eql(`${pm.collectionVariables.get(\"master3_code\")}`);\r", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "apikey", + "apikey": [ + { + "key": "value", + "value": "{{auth_token}}", + "type": "string" + }, + { + "key": "key", + "value": "Authorization", + "type": "string" + }, + { + "key": "in", + "value": "header", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "X-Channel-Id", + "value": "{{X-Channel-Id}}" + }, + { + "key": "", + "value": "", + "disabled": true + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"category\": {\n \"name\": \"master\",\n \"code\": \"{{master3_code}}\",\n \"targetIdFieldName\": \"targetmasterIds\",\n \"searchLabelFieldName\": \"se_master\",\n \"searchIdFieldName\": \"se_master\",\n \"orgIdFieldName\": \"masterIds\"\n }\n }\n}" + }, + "url": { + "raw": "{{host}}/framework/v3/category/master/create", + "host": [ + "{{host}}" + ], + "path": [ + "framework", + "v3", + "category", + "master", + "create" + ] + } + }, + "response": [] + } + ] + }, + { + "name": "Positive", + "item": [ + { + "name": "Update details for existing master category with valid fields", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json()\r", + "\r", + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "pm.test(\"id has string - api.taxonomy.category.update\", function () {\r", + " pm.expect(jsonResponse.id).to.be.equal(\"api.taxonomy.category.update\");\r", + "});\r", + "pm.test(\"Version is 3.0 \", function () {\r", + " pm.expect(jsonResponse.ver).to.be.equal(\"3.0\");\r", + "});\r", + "pm.test(\"Verify keys and data type of the response result\", () => {\r", + " pm.expect(jsonResponse.params).to.have.all.keys('resmsgid','msgid','status', 'err','errmsg');\r", + " pm.expect(jsonResponse.params.msgid).to.be.a(\"null\"); \r", + " pm.expect(jsonResponse.params.status).to.be.a(\"String\");\r", + " pm.expect(jsonResponse.params.err).to.be.a(\"null\");\r", + " pm.expect(jsonResponse.params.errmsg).to.be.a(\"null\");\r", + "});\r", + "\r", + "pm.test(\"Status has string \", function () {\r", + " pm.expect(jsonResponse.params.status).to.be.equal(\"successful\");\r", + "});\r", + "pm.test(\"ResponseCode is OK \", function () {\r", + " pm.expect(jsonResponse.responseCode).to.be.equal(\"OK\");\r", + "});\r", + "pm.test(\"Verify keys and data type of the response result\", () => {\r", + " pm.expect(jsonResponse.result).to.have.all.keys('identifier','node_id');\r", + " pm.expect(jsonResponse.result.node_id).to.be.a('String');\r", + " pm.expect(jsonResponse.result.identifier).to.be.a('String');\r", + "});\r", + "\r", + "pm.collectionVariables.set(\"master3_id\",jsonResponse.result.identifier);\r", + "console.log(pm.collectionVariables.get(\"master3_id\"));\r", + "pm.collectionVariables.set(\"master3_node\",jsonResponse.result.node_id);\r", + "console.log(pm.collectionVariables.get(\"master3_node\"));\r", + "\r", + "pm.test(`identifier should be equal to ${pm.collectionVariables.get(\"master3_id\")}`, () => {\r", + " pm.expect(jsonResponse.result.identifier).to.eql(`${pm.collectionVariables.get(\"master3_code\")}`);\r", + "});\r", + "\r", + "pm.test(`node_id should be equal to ${pm.collectionVariables.get(\"master3_node\")}`, () => {\r", + " pm.expect(jsonResponse.result.node_id).to.eql(`${pm.collectionVariables.get(\"master3_code\")}`);\r", + "});\r", + "\r", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "apikey", + "apikey": [ + { + "key": "value", + "value": "{{auth_token}}", + "type": "string" + }, + { + "key": "key", + "value": "Authorization", + "type": "string" + }, + { + "key": "in", + "value": "header", + "type": "string" + } + ] + }, + "method": "PATCH", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "X-Channel-Id", + "value": "{{X-Channel-Id}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"category\":{\n \"Description\":\"Description of class category\"\n }\n }\n}" + }, + "url": { + "raw": "{{host}}/framework/v3/category/master/update/{{master3_code}}", + "host": [ + "{{host}}" + ], + "path": [ + "framework", + "v3", + "category", + "master", + "update", + "{{master3_code}}" + ] + } + }, + "response": [] + } + ] + }, + { + "name": "Negative", + "item": [ + { + "name": "Update details for invalid master category", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json()\r", + "\r", + "pm.test(\"Status code is 404\", function () {\r", + " pm.response.to.have.status(404);\r", + "});\r", + "\r", + "pm.test(\"Status code name has string\", function () {\r", + " pm.response.to.have.status(\"Not Found\");\r", + "});\r", + "pm.test(\"id has string - api.taxonomy.category.update\", function () {\r", + " pm.expect(jsonResponse.id).to.be.equal(\"api.taxonomy.category.update\");\r", + "});\r", + "pm.test(\"Version is 3.0 \", function () {\r", + " pm.expect(jsonResponse.ver).to.be.equal(\"3.0\");\r", + "});\r", + "\r", + "pm.test(\"Verify keys and data type of the response result\", () => {\r", + " pm.expect(jsonResponse.params).to.have.all.keys('resmsgid','msgid','err','status','errmsg');\r", + " pm.expect(jsonResponse.params.resmsgid).to.be.a(\"String\");\r", + " pm.expect(jsonResponse.params.msgid).to.be.a(\"null\");\r", + " pm.expect(jsonResponse.params.err).to.be.a(\"String\");\r", + " pm.expect(jsonResponse.params.status).to.be.a(\"String\");\r", + " pm.expect(jsonResponse.params.errmsg).to.be.a(\"String\");\r", + " });\r", + "\r", + "pm.test(\"Err has string - Not Found\", function () {\r", + " pm.expect(jsonResponse.params.err).to.be.equal(\"NOT_FOUND\");\r", + "});\r", + "pm.test(\"Status has string - Failed\", function () {\r", + " pm.expect(jsonResponse.params.status).to.be.equal(\"failed\");\r", + "});\r", + "pm.test(\"errmsg has string\", function () {\r", + " pm.expect(jsonResponse.params.errmsg).to.be.include(\"Error! Node(s) doesn't Exists. | [Invalid Node Id.]: \");\r", + "});\r", + "pm.test(\"responseCode has RESOURCE_NOT_FOUND\", function () {\r", + " pm.expect(jsonResponse.responseCode).to.be.equal(\"RESOURCE_NOT_FOUND\");\r", + "});\r", + "\r", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "PATCH", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "X-Channel-Id", + "value": "sunbird" + }, + { + "key": "Authorization", + "value": "{{auth_token}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"category\":{\n \"Description\":\"Description of class category\"\n }\n }\n}" + }, + "url": { + "raw": "{{host}}/framework/v3/category/master/update/abc", + "host": [ + "{{host}}" + ], + "path": [ + "framework", + "v3", + "category", + "master", + "update", + "abc" + ] + } + }, + "response": [] + } + ] + } + ], + "description": "- Master category code should be updated everytime befor running the collection (Positive)" + }, + { + "name": "Delete Master category", + "item": [ + { + "name": "Pre requisite", + "item": [ + { + "name": "Create Master category", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json()\r", + "\r", + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "\r", + "pm.collectionVariables.set(\"master4_id\",jsonResponse.result.identifier);\r", + "console.log(pm.collectionVariables.get(\"master4_id\"));\r", + "pm.collectionVariables.set(\"master4_node\",jsonResponse.result.node_id);\r", + "console.log(pm.collectionVariables.get(\"master4_node\"));\r", + "\r", + "pm.test(`identifier should be equal to ${pm.collectionVariables.get(\"master4_id\")}`, () => {\r", + " pm.expect(jsonResponse.result.identifier).to.eql(`${pm.collectionVariables.get(\"master4_code\")}`);\r", + "});\r", + "\r", + "pm.test(`node_id should be equal to ${pm.collectionVariables.get(\"master4_node\")}`, () => {\r", + " pm.expect(jsonResponse.result.node_id).to.eql(`${pm.collectionVariables.get(\"master4_code\")}`);\r", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "apikey", + "apikey": [ + { + "key": "value", + "value": "{{auth_token}}", + "type": "string" + }, + { + "key": "key", + "value": "Authorization", + "type": "string" + }, + { + "key": "in", + "value": "header", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "X-Channel-Id", + "value": "{{X-Channel-Id}}" + }, + { + "key": "", + "value": "", + "disabled": true + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"category\": {\n \"name\": \"master\",\n \"code\": \"{{master4_code}}\",\n \"targetIdFieldName\": \"targetmasterIds\",\n \"searchLabelFieldName\": \"se_master\",\n \"searchIdFieldName\": \"se_master\",\n \"orgIdFieldName\": \"masterIds\"\n }\n }\n}" + }, + "url": { + "raw": "{{host}}/framework/v3/category/master/create", + "host": [ + "{{host}}" + ], + "path": [ + "framework", + "v3", + "category", + "master", + "create" + ] + } + }, + "response": [] + } + ] + }, + { + "name": "Positive", + "item": [ + { + "name": "Delete a valid master category", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json()\r", + "\r", + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "\r", + "pm.test(\"id has string - api.taxonomy.category.retire \", function () {\r", + " pm.expect(jsonResponse.id).to.be.equal(\"api.taxonomy.category.retire\");\r", + "});\r", + "\r", + "pm.test(\"Version is 3.0 \", function () {\r", + " pm.expect(jsonResponse.ver).to.be.equal(\"3.0\");\r", + "});\r", + "\r", + "pm.test(\"Verify keys and data type of the response result\", () => {\r", + " pm.expect(jsonResponse.params).to.have.all.keys('resmsgid','msgid','status', 'err','errmsg');\r", + " pm.expect(jsonResponse.params.resmsgid).to.be.a(\"string\");\r", + " pm.expect(jsonResponse.params.msgid).to.be.a(\"null\"); \r", + " pm.expect(jsonResponse.params.status).to.be.a(\"string\");\r", + " pm.expect(jsonResponse.params.err).to.be.a(\"null\");\r", + " pm.expect(jsonResponse.params.errmsg).to.be.a(\"null\");\r", + "});\r", + "\r", + "pm.test(\"Status is successful \", function () {\r", + " pm.expect(jsonResponse.params.status).to.be.equal(\"successful\");\r", + "});\r", + "\r", + "pm.test(\"ResponseCode is OK \", function () {\r", + " pm.expect(jsonResponse.responseCode).to.be.equal(\"OK\");\r", + "});\r", + "\r", + "pm.test(\"Verify keys and data type of the response result\", () => {\r", + " pm.expect(jsonResponse.result).to.have.all.keys('identifier','node_id');\r", + " pm.expect(jsonResponse.result.node_id).to.be.a('String');\r", + " pm.expect(jsonResponse.result.identifier).to.be.a('String');\r", + "});\r", + "\r", + "pm.collectionVariables.set(\"master4_id\",jsonResponse.result.identifier);\r", + "console.log(pm.collectionVariables.get(\"master4_id\"));\r", + "pm.collectionVariables.set(\"master4_node\",jsonResponse.result.node_id);\r", + "console.log(pm.collectionVariables.get(\"master4_node\"));\r", + "\r", + "pm.test(`identifier should be equal to ${pm.collectionVariables.get(\"master4_id\")}`, () => {\r", + " pm.expect(jsonResponse.result.identifier).to.eql(`${pm.collectionVariables.get(\"master4_code\")}`);\r", + "});\r", + "\r", + "pm.test(`node_id should be equal to ${pm.collectionVariables.get(\"master4_node\")}`, () => {\r", + " pm.expect(jsonResponse.result.node_id).to.eql(`${pm.collectionVariables.get(\"master4_code\")}`);\r", + "});\r", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "apikey", + "apikey": [ + { + "key": "value", + "value": "{{auth_token}}", + "type": "string" + }, + { + "key": "key", + "value": "Authorization", + "type": "string" + }, + { + "key": "in", + "value": "header", + "type": "string" + } + ] + }, + "method": "DELETE", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "X-Channel-Id", + "value": "{{X-Channel-Id}}" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "url": { + "raw": "{{host}}/framework/v3/category/master/retire/{{master4_code}}", + "host": [ + "{{host}}" + ], + "path": [ + "framework", + "v3", + "category", + "master", + "retire", + "{{master4_code}}" + ] + } + }, + "response": [] + } + ] + }, + { + "name": "Negative", + "item": [ + { + "name": "Delete an invalid master category", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json()\r", + "\r", + "pm.test(\"Status code is 404\", function () {\r", + " pm.response.to.have.status(404);\r", + "});\r", + "\r", + "pm.test(\"Status code name has string\", function () {\r", + " pm.response.to.have.status(\"Not Found\");\r", + "});\r", + "pm.test(\"id has string - api.taxonomy.category.retire \", function () {\r", + " pm.expect(jsonResponse.id).to.be.equal(\"api.taxonomy.category.retire\");\r", + "});\r", + "\r", + "pm.test(\"Version is 3.0 \", function () {\r", + " pm.expect(jsonResponse.ver).to.be.equal(\"3.0\");\r", + "});\r", + "pm.test(\"Verify keys and data type of the response result\", () => {\r", + " pm.expect(jsonResponse.params).to.have.all.keys('resmsgid','msgid','err','status','errmsg');\r", + " pm.expect(jsonResponse.params.resmsgid).to.be.a(\"String\");\r", + " pm.expect(jsonResponse.params.msgid).to.be.a(\"null\");\r", + " pm.expect(jsonResponse.params.err).to.be.a(\"String\");\r", + " pm.expect(jsonResponse.params.status).to.be.a(\"String\");\r", + " pm.expect(jsonResponse.params.errmsg).to.be.a(\"String\");\r", + " });\r", + "\r", + "pm.test(\"Err has string\", function () {\r", + " pm.expect(jsonResponse.params.err).to.be.equal(\"NOT_FOUND\");\r", + "});\r", + "pm.test(\"Status has string\", function () {\r", + " pm.expect(jsonResponse.params.status).to.be.equal(\"failed\");\r", + "});\r", + "pm.test(\"errmsg has string\", function () {\r", + " pm.expect(jsonResponse.params.errmsg).to.be.include(\"Error! Node(s) doesn't Exists. | [Invalid Node Id.]: \");\r", + "});\r", + "pm.test(\"responseCode has string\", function () {\r", + " pm.expect(jsonResponse.responseCode).to.be.equal(\"RESOURCE_NOT_FOUND\");\r", + "});\r", + "\r", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "apikey", + "apikey": [ + { + "key": "value", + "value": "{{auth_token}}", + "type": "string" + }, + { + "key": "key", + "value": "Authorization", + "type": "string" + }, + { + "key": "in", + "value": "header", + "type": "string" + } + ] + }, + "method": "DELETE", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "X-Channel-Id", + "value": "{{X-Channel-Id}}" + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "", + "value": "", + "disabled": true + } + ], + "url": { + "raw": "{{host}}/framework/v3/category/master/retire/abc", + "host": [ + "{{host}}" + ], + "path": [ + "framework", + "v3", + "category", + "master", + "retire", + "abc" + ] + } + }, + "response": [] + } + ] + } + ], + "description": "- Master category code should be updated everytime befor running the collection (Positive)" + }, + { + "name": "Get Master Category", + "item": [ + { + "name": "Pre requisite", + "item": [ + { + "name": "Create a master category", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json()\r", + "\r", + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "\r", + "pm.collectionVariables.set(\"master5_id\",jsonResponse.result.identifier);\r", + "console.log(pm.collectionVariables.get(\"master5_id\"));\r", + "pm.collectionVariables.set(\"master5_node\",jsonResponse.result.node_id);\r", + "console.log(pm.collectionVariables.get(\"master5_node\"));\r", + "\r", + "pm.test(`identifier should be equal to ${pm.collectionVariables.get(\"master5_id\")}`, () => {\r", + " pm.expect(jsonResponse.result.identifier).to.eql(`${pm.collectionVariables.get(\"master5_code\")}`);\r", + "});\r", + "\r", + "pm.test(`node_id should be equal to ${pm.collectionVariables.get(\"master5_node\")}`, () => {\r", + " pm.expect(jsonResponse.result.node_id).to.eql(`${pm.collectionVariables.get(\"master5_code\")}`);\r", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "apikey", + "apikey": [ + { + "key": "value", + "value": "{{auth_token}}", + "type": "string" + }, + { + "key": "key", + "value": "Authorization", + "type": "string" + }, + { + "key": "in", + "value": "header", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "X-Channel-Id", + "value": "{{X-Channel-Id}}" + }, + { + "key": "", + "value": "", + "disabled": true + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"category\": {\n \"name\": \"master\",\n \"code\": \"{{master5_code}}\",\n \"targetIdFieldName\": \"targetmasterIds\",\n \"searchLabelFieldName\": \"se_master\",\n \"searchIdFieldName\": \"se_master\",\n \"orgIdFieldName\": \"masterIds\"\n }\n }\n}" + }, + "url": { + "raw": "{{host}}/framework/v3/category/master/create", + "host": [ + "{{host}}" + ], + "path": [ + "framework", + "v3", + "category", + "master", + "create" + ] + } + }, + "response": [] + } + ] + }, + { + "name": "Positive", + "item": [ + { + "name": "Read a live master category", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json()\r", + "\r", + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "pm.test(\"id has string - api.taxonomy.category.read \", function () {\r", + " pm.expect(jsonResponse.id).to.be.equal(\"api.taxonomy.category.read\");\r", + "});\r", + "\r", + "pm.test(\"Version is 3.0 \", function () {\r", + " pm.expect(jsonResponse.ver).to.be.equal(\"3.0\");\r", + "});\r", + "pm.test(\"Verify keys and data type of the response result\", () => {\r", + " pm.expect(jsonResponse.params).to.have.all.keys('resmsgid','msgid','status', 'err','errmsg');\r", + "pm.expect(jsonResponse.params.resmsgid).to.be.a(\"String\");\r", + "pm.expect(jsonResponse.params.msgid).to.be.a(\"null\");\r", + " pm.expect(jsonResponse.params.status).to.be.a(\"String\");\r", + " pm.expect(jsonResponse.params.err).to.be.a(\"null\");\r", + " pm.expect(jsonResponse.params.errmsg).to.be.a(\"null\");\r", + "});\r", + "pm.test(\"Verify keys and data type of the response result\", () => {\r", + " pm.expect(jsonResponse.result).to.be.an(\"object\").that.has.all.keys(\r", + " 'category'\r", + " );\r", + " pm.expect(jsonResponse.result.category).to.have.all.keys('trackable','identifier','lastStatusChangedOn', 'code','targetIdFieldName','channel','searchLabelFieldName','languageCode','createdOn','objectType','versionKey','name','lastUpdatedOn','searchIdFieldName','orgIdFieldName','status');\r", + "});\r", + "\r", + "pm.test(\"Status has String: Live \", function () {\r", + " pm.expect(jsonResponse.result.category.status).to.be.equal(\"Live\");\r", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "apikey", + "apikey": [ + { + "key": "value", + "value": "{{auth_token}}", + "type": "string" + }, + { + "key": "key", + "value": "Authorization", + "type": "string" + }, + { + "key": "in", + "value": "header", + "type": "string" + } + ] + }, + "method": "GET", + "header": [ + { + "key": "X-Channel-Id", + "value": "{{X-Channel-Id}}" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "", + "value": "", + "disabled": true + } + ], + "url": { + "raw": "{{host}}/framework/v3/category/master/read/{{master5_node}}", + "host": [ + "{{host}}" + ], + "path": [ + "framework", + "v3", + "category", + "master", + "read", + "{{master5_node}}" + ] + } + }, + "response": [] + }, + { + "name": "Read a retired master category", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json()\r", + "\r", + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "pm.test(\"id has string - api.taxonomy.category.read \", function () {\r", + " pm.expect(jsonResponse.id).to.be.equal(\"api.taxonomy.category.read\");\r", + "});\r", + "\r", + "pm.test(\"Version is 3.0 \", function () {\r", + " pm.expect(jsonResponse.ver).to.be.equal(\"3.0\");\r", + "});\r", + "pm.test(\"Verify keys and data type of the response result\", () => {\r", + " pm.expect(jsonResponse.params).to.have.all.keys('resmsgid','msgid','status', 'err','errmsg');\r", + "pm.expect(jsonResponse.params.resmsgid).to.be.a(\"String\");\r", + "pm.expect(jsonResponse.params.msgid).to.be.a(\"null\");\r", + " pm.expect(jsonResponse.params.status).to.be.a(\"String\");\r", + " pm.expect(jsonResponse.params.err).to.be.a(\"null\");\r", + " pm.expect(jsonResponse.params.errmsg).to.be.a(\"null\");\r", + "});\r", + "pm.test(\"Verify keys and data type of the response result\", () => {\r", + " pm.expect(jsonResponse.result).to.be.an(\"object\").that.has.all.keys(\r", + " 'category'\r", + " );\r", + " pm.expect(jsonResponse.result.category).to.have.all.keys('trackable','identifier','lastStatusChangedOn', 'code','targetIdFieldName','channel','searchLabelFieldName','languageCode','createdOn','objectType','versionKey','name','lastUpdatedOn','searchIdFieldName','orgIdFieldName','status');\r", + "});\r", + "\r", + "pm.test(\"Status has String: retired \", function () {\r", + " pm.expect(jsonResponse.result.category.status).to.be.equal(\"Retired\");\r", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "apikey", + "apikey": [ + { + "key": "value", + "value": "{{auth_token}}", + "type": "string" + }, + { + "key": "key", + "value": "Authorization", + "type": "string" + }, + { + "key": "in", + "value": "header", + "type": "string" + } + ] + }, + "method": "GET", + "header": [ + { + "key": "X-Channel-Id", + "value": "{{X-Channel-Id}}" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "{{auth_token}}" + } + ], + "url": { + "raw": "{{host}}/framework/v3/category/master/read/{{master4_code}}", + "host": [ + "{{host}}" + ], + "path": [ + "framework", + "v3", + "category", + "master", + "read", + "{{master4_code}}" + ] + } + }, + "response": [] + } + ] + }, + { + "name": "Negative", + "item": [ + { + "name": "Read an invalid master category", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json()\r", + "\r", + "pm.test(\"Status code is 404\", function () {\r", + " pm.response.to.have.status(404);\r", + "});\r", + "\r", + "pm.test(\"Status code name has string\", function () {\r", + " pm.response.to.have.status(\"Not Found\");\r", + "});\r", + "pm.test(\"id has string - api.taxonomy.category.read \", function () {\r", + " pm.expect(jsonResponse.id).to.be.equal(\"api.taxonomy.category.read\");\r", + "});\r", + "\r", + "pm.test(\"Version is 3.0 \", function () {\r", + " pm.expect(jsonResponse.ver).to.be.equal(\"3.0\");\r", + "});\r", + "pm.test(\"Verify keys and data type of the response result\", () => {\r", + " pm.expect(jsonResponse.params).to.have.all.keys('resmsgid','msgid','err','status','errmsg');\r", + " pm.expect(jsonResponse.params.resmsgid).to.be.a(\"String\");\r", + " pm.expect(jsonResponse.params.msgid).to.be.a(\"null\");\r", + " pm.expect(jsonResponse.params.err).to.be.a(\"String\");\r", + " pm.expect(jsonResponse.params.status).to.be.a(\"String\");\r", + " pm.expect(jsonResponse.params.errmsg).to.be.a(\"String\");\r", + " });\r", + "\r", + "pm.test(\"Err has string\", function () {\r", + " pm.expect(jsonResponse.params.err).to.be.equal(\"NOT_FOUND\");\r", + "});\r", + "pm.test(\"Status has string\", function () {\r", + " pm.expect(jsonResponse.params.status).to.be.equal(\"failed\");\r", + "});\r", + "pm.test(\"errmsg has string\", function () {\r", + " pm.expect(jsonResponse.params.errmsg).to.be.include(\"Error! Node(s) doesn't Exists. | [Invalid Node Id.]: \");\r", + "});\r", + "pm.test(\"responseCode has string\", function () {\r", + " pm.expect(jsonResponse.responseCode).to.be.equal(\"RESOURCE_NOT_FOUND\");\r", + "});\r", + "\r", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "apikey", + "apikey": [ + { + "key": "value", + "value": "{{auth_token}}", + "type": "string" + }, + { + "key": "key", + "value": "Authorization", + "type": "string" + }, + { + "key": "in", + "value": "header", + "type": "string" + } + ] + }, + "method": "GET", + "header": [ + { + "key": "X-Channel-Id", + "value": "sunbird" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "X-Channel-Id", + "value": "{{X-Channel-Id}}" + } + ], + "url": { + "raw": "{{host}}/framework/v3/category/master/read/abc", + "host": [ + "{{host}}" + ], + "path": [ + "framework", + "v3", + "category", + "master", + "read", + "abc" + ] + } + }, + "response": [] + } + ] + } + ], + "description": "- Master category code should be updated everytime befor running the collection (Positive)" + }, + { + "name": "Delete data", + "item": [ + { + "name": "Delete master category", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json()\r", + "\r", + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "\r", + "pm.test(`identifier should be equal to ${pm.collectionVariables.get(\"master_id\")}`, () => {\r", + " pm.expect(jsonResponse.result.identifier).to.eql(`${pm.collectionVariables.get(\"master_code\")}`);\r", + "});\r", + "\r", + "pm.test(`node_id should be equal to ${pm.collectionVariables.get(\"master_node\")}`, () => {\r", + " pm.expect(jsonResponse.result.node_id).to.eql(`${pm.collectionVariables.get(\"master_code\")}`);\r", + "});\r", + "\r", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "apikey", + "apikey": [ + { + "key": "value", + "value": "{{auth_token}}", + "type": "string" + }, + { + "key": "key", + "value": "Authorization", + "type": "string" + }, + { + "key": "in", + "value": "header", + "type": "string" + } + ] + }, + "method": "DELETE", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "X-Channel-Id", + "value": "{{X-Channel-Id}}" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "url": { + "raw": "{{host}}/framework/v3/category/master/retire/{{master_id}}", + "host": [ + "{{host}}" + ], + "path": [ + "framework", + "v3", + "category", + "master", + "retire", + "{{master_id}}" + ] + } + }, + "response": [] + }, + { + "name": "Delete master category", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json()\r", + "\r", + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "\r", + "pm.test(`identifier should be equal to ${pm.collectionVariables.get(\"master2_id\")}`, () => {\r", + " pm.expect(jsonResponse.result.identifier).to.eql(`${pm.collectionVariables.get(\"master2_code\")}`);\r", + "});\r", + "\r", + "pm.test(`node_id should be equal to ${pm.collectionVariables.get(\"master2_node\")}`, () => {\r", + " pm.expect(jsonResponse.result.node_id).to.eql(`${pm.collectionVariables.get(\"master2_code\")}`);\r", + "});\r", + "\r", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "apikey", + "apikey": [ + { + "key": "value", + "value": "{{auth_token}}", + "type": "string" + }, + { + "key": "key", + "value": "Authorization", + "type": "string" + }, + { + "key": "in", + "value": "header", + "type": "string" + } + ] + }, + "method": "DELETE", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "X-Channel-Id", + "value": "{{X-Channel-Id}}" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "url": { + "raw": "{{host}}/framework/v3/category/master/retire/{{master2_code}}", + "host": [ + "{{host}}" + ], + "path": [ + "framework", + "v3", + "category", + "master", + "retire", + "{{master2_code}}" + ] + } + }, + "response": [] + }, + { + "name": "Delete master category", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json()\r", + "\r", + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "\r", + "pm.test(`identifier should be equal to ${pm.collectionVariables.get(\"master3_id\")}`, () => {\r", + " pm.expect(jsonResponse.result.identifier).to.eql(`${pm.collectionVariables.get(\"master3_code\")}`);\r", + "});\r", + "\r", + "pm.test(`node_id should be equal to ${pm.collectionVariables.get(\"master3_node\")}`, () => {\r", + " pm.expect(jsonResponse.result.node_id).to.eql(`${pm.collectionVariables.get(\"master3_code\")}`);\r", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "apikey", + "apikey": [ + { + "key": "value", + "value": "{{auth_token}}", + "type": "string" + }, + { + "key": "key", + "value": "Authorization", + "type": "string" + }, + { + "key": "in", + "value": "header", + "type": "string" + } + ] + }, + "method": "DELETE", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "X-Channel-Id", + "value": "{{X-Channel-Id}}" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "url": { + "raw": "{{host}}/framework/v3/category/master/retire/{{master3_code}}", + "host": [ + "{{host}}" + ], + "path": [ + "framework", + "v3", + "category", + "master", + "retire", + "{{master3_code}}" + ] + } + }, + "response": [] + }, + { + "name": "Delete master category", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json()\r", + "\r", + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "\r", + "pm.test(`identifier should be equal to ${pm.collectionVariables.get(\"master4_id\")}`, () => {\r", + " pm.expect(jsonResponse.result.identifier).to.eql(`${pm.collectionVariables.get(\"master4_code\")}`);\r", + "});\r", + "\r", + "pm.test(`node_id should be equal to ${pm.collectionVariables.get(\"master4_node\")}`, () => {\r", + " pm.expect(jsonResponse.result.node_id).to.eql(`${pm.collectionVariables.get(\"master4_code\")}`);\r", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "apikey", + "apikey": [ + { + "key": "value", + "value": "{{auth_token}}", + "type": "string" + }, + { + "key": "key", + "value": "Authorization", + "type": "string" + }, + { + "key": "in", + "value": "header", + "type": "string" + } + ] + }, + "method": "DELETE", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "X-Channel-Id", + "value": "{{X-Channel-Id}}" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "url": { + "raw": "{{host}}/framework/v3/category/master/retire/{{master4_code}}", + "host": [ + "{{host}}" + ], + "path": [ + "framework", + "v3", + "category", + "master", + "retire", + "{{master4_code}}" + ] + } + }, + "response": [] + }, + { + "name": "Delete master category", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json()\r", + "\r", + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "\r", + "pm.test(`identifier should be equal to ${pm.collectionVariables.get(\"master5_id\")}`, () => {\r", + " pm.expect(jsonResponse.result.identifier).to.eql(`${pm.collectionVariables.get(\"master5_code\")}`);\r", + "});\r", + "\r", + "pm.test(`node_id should be equal to ${pm.collectionVariables.get(\"master5_node\")}`, () => {\r", + " pm.expect(jsonResponse.result.node_id).to.eql(`${pm.collectionVariables.get(\"master5_code\")}`);\r", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "apikey", + "apikey": [ + { + "key": "value", + "value": "{{auth_token}}", + "type": "string" + }, + { + "key": "key", + "value": "Authorization", + "type": "string" + }, + { + "key": "in", + "value": "header", + "type": "string" + } + ] + }, + "method": "DELETE", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "X-Channel-Id", + "value": "{{X-Channel-Id}}" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "url": { + "raw": "{{host}}/framework/v3/category/master/retire/{{master5_code}}", + "host": [ + "{{host}}" + ], + "path": [ + "framework", + "v3", + "category", + "master", + "retire", + "{{master5_code}}" + ] + } + }, + "response": [] + } + ] + } + ], + "event": [ + { + "listen": "prerequest", + "script": { + "type": "text/javascript", + "exec": [ + "//Scenarion-1", + "pm.collectionVariables.set(\"master_code\", \"master_cat_9\");", + "pm.collectionVariables.set(\"master2_code\", \"master2_cat_7\");", + "//Scenario-2", + "pm.collectionVariables.set(\"master3_code\", \"master3_cat_8\");", + "//Scenario-3", + "pm.collectionVariables.set(\"master4_code\", \"master4_cat_7\");", + "//Scenario-4", + "pm.collectionVariables.set(\"master5_code\", \"master5_cat_8\");" + ] + } + }, + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "" + ] + } + } + ] + } + ], + "description": "Pre requisite:\n\n- Master category name should be updated before running the collection (in the pre requisite folder as well)" + }, + { + "name": "framework/v1", + "item": [ + { + "name": "framework", + "item": [ + { + "name": "Create a Framework", + "item": [ + { + "name": "Positive", + "item": [ + { + "name": "Create a framework with valid mandatory fields", + "event": [ + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + }, + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json()\r", + "\r", + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "pm.test(\"id has string - api.taxonomy.framework.create \", function () {\r", + " pm.expect(jsonResponse.id).to.be.equal(\"api.taxonomy.framework.create\");\r", + "});\r", + "\r", + "pm.test(\"Version is 3.0 \", function () {\r", + " pm.expect(jsonResponse.ver).to.be.equal(\"3.0\");\r", + "});\r", + "pm.test(\"Verify keys and data type of the response result\", () => {\r", + " pm.expect(jsonResponse.params).to.have.all.keys('resmsgid','msgid','status', 'err','errmsg');\r", + " pm.expect(jsonResponse.params.status).to.be.a(\"String\");\r", + " pm.expect(jsonResponse.params.err).to.be.a(\"null\");\r", + " pm.expect(jsonResponse.params.errmsg).to.be.a(\"null\");\r", + "});\r", + "\r", + "pm.test(\"Status has string \", function () {\r", + " pm.expect(jsonResponse.params.status).to.be.equal(\"successful\");\r", + "});\r", + "\r", + "pm.test(\"Verify keys and data type of the response result\", () => {\r", + " pm.expect(jsonResponse.result).to.have.all.keys('node_id', 'versionKey');\r", + " pm.expect(jsonResponse.result.node_id).to.be.a(\"String\");\r", + " pm.expect(jsonResponse.result.versionKey).to.be.a(\"string\");\r", + "});\r", + "\r", + "pm.collectionVariables.set(\"fw1_node\",jsonResponse.result.node_id);\r", + "console.log(pm.collectionVariables.get(\"fw1_node\"));\r", + "\r", + "pm.test(`node id should be equal to ${pm.collectionVariables.get(\"fw1_node\")}`, () => {\r", + " pm.expect(jsonResponse.result.node_id).to.eql(pm.collectionVariables.get(\"fw1_code\"));\r", + "});\r", + "\r", + "\r", + "\r", + "" + ], + "type": "text/javascript" + } + } + ], + "protocolProfileBehavior": { + "disabledSystemHeaders": {} + }, + "request": { + "auth": { + "type": "apikey", + "apikey": [ + { + "key": "value", + "value": "{{auth_token}}", + "type": "string" + }, + { + "key": "key", + "value": "Authorization", + "type": "string" + }, + { + "key": "in", + "value": "header", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "description": "(Required) It is the Unique Id to identify the root organisation to which the user belongs", + "key": "X-Channel-Id", + "value": "{{X-Channel-Id}}" + }, + { + "key": "", + "value": "", + "disabled": true + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "", + "type": "text", + "disabled": true + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"framework\": {\n \"name\": \"{{fw1_name}}\",\n \"code\": \"{{fw1_code}}\"\n \n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{host}}/framework/v3/create", + "host": [ + "{{host}}" + ], + "path": [ + "framework", + "v3", + "create" + ] + }, + "description": "This API is associated with creating a new framework on the Sunbird Platform.\n - The endpoint for **Create a Framework** is `/framework/v1/create`\n - It points to knowledge-mw-service - `/v1/framework/create`\n - The fields marked with an asterisk (*) are mandatory. They cannot be null or empty." + }, + "response": [ + { + "name": "OK ! Successful operation.\"create framework\" operation was successfully executed.", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource\n Possible media types can be:- \n - application/json", + "key": "Content-Type", + "value": "Ut enim offici" + }, + { + "description": "(Required) To make use of the API, you require authorization. Raise a request to the administrator for the use of the API. You will receive the authorization key. Specify the key received, here.", + "key": "Authorization", + "value": "Ut enim offici" + }, + { + "description": "(Required) It is the Unique Id to identify the root organisation to which the user belongs", + "key": "X-Channel-Id", + "value": "Ut enim offici" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"framework\": {\n \"name\": \"Framework Name\",\n \"code\": \"dummy_framework\",\n \"channels\": [\n {\n \"identifier\": \"in.ekstep\"\n }\n ]\n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/framework/v1/create", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "framework", + "v1", + "create" + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"api.framework.create\",\n \"ver\": \"1.0\",\n \"ts\": \"2020-12-14T09:49:06.794Z\",\n \"params\": {\n \"resmsgid\": \"9b5d7ca0-3df1-11eb-9ff3-67c41480f6aa\",\n \"msgid\": \"9b4a90e0-3df1-11eb-9ff3-67c41480f6aa\",\n \"status\": \"successful\",\n \"err\": null,\n \"errmsg\": null\n },\n \"responseCode\": \"OK\",\n \"result\": {\n \"node_id\": \"dummy_framework\",\n \"versionKey\": \"1607939346678\"\n }\n}" + }, + { + "name": "BAD REQUEST. The \"create framework\" operation failed ! The possible reason for failure is that you may have missed providing input for a mandatory parameter.", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource\n Possible media types can be:- \n - application/json", + "key": "Content-Type", + "value": "Ut enim offici" + }, + { + "description": "(Required) To make use of the API, you require authorization. Raise a request to the administrator for the use of the API. You will receive the authorization key. Specify the key received, here.", + "key": "Authorization", + "value": "Ut enim offici" + }, + { + "description": "(Required) It is the Unique Id to identify the root organisation to which the user belongs", + "key": "X-Channel-Id", + "value": "Ut enim offici" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"framework\": {\n \"name\": \"Framework Name\",\n \"code\": \"dummy_framework\",\n \"channels\": [\n {\n \"identifier\": \"in.ekstep\"\n }\n ]\n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/framework/v1/create", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "framework", + "v1", + "create" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"api.framework.create\",\n \"ver\": \"1.0\",\n \"ts\": \"2020-12-14T09:50:45.249Z\",\n \"params\": {\n \"resmsgid\": \"d60c8710-3df1-11eb-9ff3-67c41480f6aa\",\n \"msgid\": null,\n \"status\": \"failed\",\n \"err\": \"CONSTRAINT_VALIDATION_FAILED\",\n \"errmsg\": \"Object already exists with identifier: dummy_framework\"\n },\n \"responseCode\": \"CLIENT_ERROR\",\n \"result\": {}\n}" + }, + { + "name": "INTERNAL SERVER ERROR ! Looks like something went wrong! These errors are tracked automatically, but if the problem persists feel free to contact us. In the meantime, try refreshing.", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource\n Possible media types can be:- \n - application/json", + "key": "Content-Type", + "value": "Ut enim offici" + }, + { + "description": "(Required) To make use of the API, you require authorization. Raise a request to the administrator for the use of the API. You will receive the authorization key. Specify the key received, here.", + "key": "Authorization", + "value": "Ut enim offici" + }, + { + "description": "(Required) It is the Unique Id to identify the root organisation to which the user belongs", + "key": "X-Channel-Id", + "value": "Ut enim offici" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"framework\": {\n \"name\": \"Framework Name\",\n \"code\": \"dummy_framework\",\n \"channels\": [\n {\n \"identifier\": \"in.ekstep\"\n }\n ]\n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/framework/v1/create", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "framework", + "v1", + "create" + ] + } + }, + "status": "Internal Server Error", + "code": 500, + "_postman_previewlanguage": "text", + "header": [ + { + "key": "Content-Type", + "value": "text/plain" + } + ], + "cookie": [], + "body": "" + } + ] + }, + { + "name": "Create a framework with all valid fields", + "event": [ + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + }, + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json()\r", + "\r", + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "pm.test(\"id has string - api.taxonomy.framework.create \", function () {\r", + " pm.expect(jsonResponse.id).to.be.equal(\"api.taxonomy.framework.create\");\r", + "});\r", + "\r", + "pm.test(\"Version is 3.0 \", function () {\r", + " pm.expect(jsonResponse.ver).to.be.equal(\"3.0\");\r", + "});\r", + "pm.test(\"Verify keys and data type of the response result\", () => {\r", + " pm.expect(jsonResponse.params).to.have.all.keys('resmsgid','msgid','status', 'err','errmsg');\r", + " pm.expect(jsonResponse.params.status).to.be.a(\"String\");\r", + " pm.expect(jsonResponse.params.err).to.be.a(\"null\");\r", + " pm.expect(jsonResponse.params.errmsg).to.be.a(\"null\");\r", + "});\r", + "\r", + "pm.test(\"Status has string \", function () {\r", + " pm.expect(jsonResponse.params.status).to.be.equal(\"successful\");\r", + "});\r", + "\r", + "pm.test(\"Verify keys and data type of the response result\", () => {\r", + " pm.expect(jsonResponse.result).to.have.all.keys('node_id', 'versionKey');\r", + " pm.expect(jsonResponse.result.node_id).to.be.a(\"String\");\r", + " pm.expect(jsonResponse.result.versionKey).to.be.a(\"string\");\r", + "});\r", + "\r", + "pm.collectionVariables.set(\"fw2_node\",jsonResponse.result.node_id);\r", + "console.log(pm.collectionVariables.get(\"fw2_node\"));\r", + "\r", + "pm.test(`node id should be equal to ${pm.collectionVariables.get(\"fw2_node\")}`, () => {\r", + " pm.expect(jsonResponse.result.node_id).to.eql(pm.collectionVariables.get(\"fw2_code\"));\r", + "});\r", + "\r", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "apikey", + "apikey": [ + { + "key": "value", + "value": "{{auth_token}}", + "type": "string" + }, + { + "key": "key", + "value": "Authorization", + "type": "string" + }, + { + "key": "in", + "value": "header", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "X-Channel-Id", + "value": "{{X-Channel-Id}}", + "type": "text" + }, + { + "key": "Content-Type", + "value": "application/json", + "type": "text" + }, + { + "key": "Accept", + "value": "application/json", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\r\n \"request\": {\r\n \"framework\": {\r\n \"name\": \"{{fw2_name}}\",\r\n \"code\": \"{{fw2_code}}\",\r\n \"Description\": \"This is a Sample Framework\",\r\n \"channels\": [\r\n {\r\n \"identifier\": \"{{channel_id}}\"\r\n }\r\n ]\r\n }\r\n }\r\n}" + }, + "url": { + "raw": "{{host}}/framework/v3/create", + "host": [ + "{{host}}" + ], + "path": [ + "framework", + "v3", + "create" + ] + } + }, + "response": [] + } + ] + }, + { + "name": "Negative", + "item": [ + { + "name": "Create a framework with invalid fields", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json()\r", + "\r", + "pm.test(\"Status code is 400\", function () {\r", + " pm.response.to.have.status(400);\r", + "});\r", + "\r", + "pm.test(\"Status code name has string\", function () {\r", + " pm.response.to.have.status(\"Bad Request\");\r", + "});\r", + "pm.test(\"id has string - api.taxonomy.framework.create \", function () {\r", + " pm.expect(jsonResponse.id).to.be.equal(\"api.taxonomy.framework.create\");\r", + "});\r", + "\r", + "pm.test(\"Version is 3.0 \", function () {\r", + " pm.expect(jsonResponse.ver).to.be.equal(\"3.0\");\r", + "});\r", + "\r", + "pm.test(\"Verify keys and data type of the response result\", () => {\r", + " pm.expect(jsonResponse.params).to.have.all.keys('resmsgid','msgid','status', 'err','errmsg');\r", + " pm.expect(jsonResponse.params.status).to.be.a(\"String\");\r", + " pm.expect(jsonResponse.params.err).to.be.a(\"String\");\r", + " pm.expect(jsonResponse.params.errmsg).to.be.a(\"String\");\r", + "});\r", + "\r", + "pm.test(\"Status has string \", function () {\r", + " pm.expect(jsonResponse.params.status).to.be.equal(\"failed\");\r", + "});\r", + "\r", + "pm.test(\"Status code name has string\", function () {\r", + " pm.expect(jsonResponse.params.err).to.be.equal(\"ERR_INVALID_REQUEST\");\r", + "});\r", + "\r", + "pm.test(\"Status code name has string\", function () {\r", + " pm.expect(jsonResponse.params.errmsg).to.be.equal(\"Invalid Request. Please Provide Required Properties!\");\r", + "});\r", + "\r", + "pm.test(\"Status code name has string\", function () {\r", + " pm.expect(jsonResponse.responseCode).to.be.equal(\"CLIENT_ERROR\");\r", + "});\r", + "\r", + "\r", + "\r", + "\r", + "\r", + "" + ], + "type": "text/javascript" + } + } + ], + "protocolProfileBehavior": { + "disabledSystemHeaders": {} + }, + "request": { + "auth": { + "type": "apikey", + "apikey": [ + { + "key": "value", + "value": "{{auth_token}}", + "type": "string" + }, + { + "key": "key", + "value": "Authorization", + "type": "string" + }, + { + "key": "in", + "value": "header", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "X-Channel-Id", + "value": "{{X-Channel-Id}}", + "type": "text" + }, + { + "key": "Accept", + "value": "application/json", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\r\n \"request\": {\r\n \"framework\": {\r\n \"name\": [],\r\n \"code\": \"Sample Framework\",\r\n \"channels\": [\r\n {\r\n \"identifier\": \"in.ekstep\"\r\n }\r\n ]\r\n }\r\n }\r\n}" + }, + "url": { + "raw": "{{host}}/framework/v3/create", + "host": [ + "{{host}}" + ], + "path": [ + "framework", + "v3", + "create" + ] + } + }, + "response": [] + }, + { + "name": "Create a framework for invalid channel id", + "event": [ + { + "listen": "prerequest", + "script": { + "exec": [ + "pm.globals.set(\"name\", \"Framework19\");\r", + "pm.globals.set(\"code\", \"Framework19\");" + ], + "type": "text/javascript" + } + }, + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json()\r", + "\r", + "pm.test(\"Status code is 404\", function () {\r", + " pm.response.to.have.status(404);\r", + "});\r", + "\r", + "pm.test(\"Status code name has string\", function () {\r", + " pm.response.to.have.status(\"Not Found\");\r", + "});\r", + "pm.test(\"id has string - api.taxonomy.framework.create \", function () {\r", + " pm.expect(jsonResponse.id).to.be.equal(\"api.taxonomy.framework.create\");\r", + "});\r", + "\r", + "pm.test(\"Version is 3.0 \", function () {\r", + " pm.expect(jsonResponse.ver).to.be.equal(\"3.0\");\r", + "});\r", + "pm.test(\"Verify keys and data type of the response result\", () => {\r", + " pm.expect(jsonResponse.params).to.have.all.keys('resmsgid','msgid','status', 'err','errmsg');\r", + " pm.expect(jsonResponse.params.status).to.be.a(\"String\");\r", + " pm.expect(jsonResponse.params.err).to.be.a(\"String\");\r", + " pm.expect(jsonResponse.params.errmsg).to.be.a(\"String\");\r", + "});\r", + "\r", + "pm.test(\"Status has string \", function () {\r", + " pm.expect(jsonResponse.params.status).to.be.equal(\"failed\");\r", + "});\r", + "\r", + "pm.test(\"Status code name has string\", function () {\r", + " pm.expect(jsonResponse.params.err).to.be.equal(\"NOT_FOUND\");\r", + "});\r", + "\r", + "pm.test(\"Status code name has string: Error! Node(s) doesn't Exists. | [Invalid Node Id.]: dummy\", function () {\r", + " pm.expect(jsonResponse.params.errmsg).to.be.equal(\"Error! Node(s) doesn't Exists. | [Invalid Node Id.]: dummy\");\r", + "});\r", + "\r", + "pm.test(\"Status code name has string\", function () {\r", + " pm.expect(jsonResponse.responseCode).to.be.equal(\"RESOURCE_NOT_FOUND\");\r", + "});\r", + "\r", + "\r", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "apikey", + "apikey": [ + { + "key": "value", + "value": "{{auth_token}}", + "type": "string" + }, + { + "key": "key", + "value": "Authorization", + "type": "string" + }, + { + "key": "in", + "value": "header", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "Accept", + "value": "application/json", + "type": "text" + }, + { + "key": "X-Channel-Id", + "value": "dummy", + "type": "text" + }, + { + "key": "Content-Type", + "value": "application/json", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\r\n \"request\": {\r\n \"framework\": {\r\n \"name\": \"{{name}}\",\r\n \"code\": \"{{code}}\"\r\n }\r\n }\r\n}" + }, + "url": { + "raw": "{{host}}/framework/v3/create", + "host": [ + "{{host}}" + ], + "path": [ + "framework", + "v3", + "create" + ] + } + }, + "response": [] + }, + { + "name": "Create a framework that already exists", + "event": [ + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + }, + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json();\r", + "\r", + "pm.test(\"Status code is 400\", function () {\r", + " pm.response.to.have.status(400);\r", + "});\r", + "\r", + "pm.test(\"Status code name has string\", function () {\r", + " pm.response.to.have.status(\"Bad Request\");\r", + "});\r", + "pm.test(\"id has string - api.taxonomy.framework.create \", function () {\r", + " pm.expect(jsonResponse.id).to.be.equal(\"api.taxonomy.framework.create\");\r", + "});\r", + "\r", + "pm.test(\"Version is 3.0 \", function () {\r", + " pm.expect(jsonResponse.ver).to.be.equal(\"3.0\");\r", + "});\r", + "pm.test(\"Verify keys and data type of the response result\", () => {\r", + " pm.expect(jsonResponse.params).to.have.all.keys('resmsgid','msgid','status', 'err','errmsg');\r", + " pm.expect(jsonResponse.params.status).to.be.a(\"String\");\r", + " pm.expect(jsonResponse.params.err).to.be.a(\"String\");\r", + " pm.expect(jsonResponse.params.errmsg).to.be.a(\"String\");\r", + "});\r", + "\r", + "pm.test(\"Status has string \", function () {\r", + " pm.expect(jsonResponse.params.status).to.be.equal(\"failed\");\r", + "});\r", + "\r", + "pm.test(\"Status code name has string\", function () {\r", + " pm.expect(jsonResponse.params.err).to.be.equal(\"CONSTRAINT_VALIDATION_FAILED\");\r", + "});\r", + "\r", + "pm.test(`errmsg has string Object already exists with identifier: ${pm.globals.get(\"node\")}`, () => {\r", + " pm.expect(jsonResponse.params.errmsg).to.eql(`Object already exists with identifier: ${pm.globals.get(\"node\")}` );\r", + "}); \r", + "console.log(`Object already exists with identifier: ${pm.globals.get(\"node\")}`);\r", + "pm.test(\"Status code name has string\", function () {\r", + " pm.expect(jsonResponse.responseCode).to.be.equal(\"CLIENT_ERROR\");\r", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "apikey", + "apikey": [ + { + "key": "value", + "value": "{{auth_token}}", + "type": "string" + }, + { + "key": "key", + "value": "Authorization", + "type": "string" + }, + { + "key": "in", + "value": "header", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "Accept", + "value": "application/json", + "type": "text" + }, + { + "key": "X-Channel-Id", + "value": "{{X-Channel-Id}}", + "type": "text" + }, + { + "key": "Content-Type", + "value": "application/json", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\r\n \"request\": {\r\n \"framework\": {\r\n \"name\": \"Sample Framework\",\r\n \"code\": \"{{node}}\"\r\n }\r\n }\r\n}" + }, + "url": { + "raw": "{{host}}/framework/v3/create", + "host": [ + "{{host}}" + ], + "path": [ + "framework", + "v3", + "create" + ] + } + }, + "response": [] + } + ] + } + ], + "description": "1. Framework name should be updated before every run" + }, + { + "name": "Update framework", + "item": [ + { + "name": "Pre requisite", + "item": [ + { + "name": "Create a framework with valid mandatory fields Copy", + "event": [ + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + }, + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json()\r", + "\r", + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "\r", + "\r", + "pm.collectionVariables.set(\"fw3_node\",jsonResponse.result.node_id);\r", + "console.log(pm.collectionVariables.get(\"fw3_node\"));\r", + "\r", + "pm.test(`node id should be equal to ${pm.collectionVariables.get(\"fw3_node\")}`, () => {\r", + " pm.expect(jsonResponse.result.node_id).to.eql(pm.collectionVariables.get(\"fw3_code\"));\r", + "});\r", + "\r", + "\r", + "\r", + "" + ], + "type": "text/javascript" + } + } + ], + "protocolProfileBehavior": { + "disabledSystemHeaders": {} + }, + "request": { + "auth": { + "type": "apikey", + "apikey": [ + { + "key": "value", + "value": "{{auth_token}}", + "type": "string" + }, + { + "key": "key", + "value": "Authorization", + "type": "string" + }, + { + "key": "in", + "value": "header", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "description": "(Required) It is the Unique Id to identify the root organisation to which the user belongs", + "key": "X-Channel-Id", + "value": "{{X-Channel-Id}}" + }, + { + "key": "", + "value": "", + "disabled": true + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "", + "type": "text", + "disabled": true + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"framework\": {\n \"name\": \"{{fw3_name}}\",\n \"code\": \"{{fw3_code}}\"\n \n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{host}}/framework/v3/create", + "host": [ + "{{host}}" + ], + "path": [ + "framework", + "v3", + "create" + ] + }, + "description": "This API is associated with creating a new framework on the Sunbird Platform.\n - The endpoint for **Create a Framework** is `/framework/v1/create`\n - It points to knowledge-mw-service - `/v1/framework/create`\n - The fields marked with an asterisk (*) are mandatory. They cannot be null or empty." + }, + "response": [ + { + "name": "OK ! Successful operation.\"create framework\" operation was successfully executed.", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource\n Possible media types can be:- \n - application/json", + "key": "Content-Type", + "value": "Ut enim offici" + }, + { + "description": "(Required) To make use of the API, you require authorization. Raise a request to the administrator for the use of the API. You will receive the authorization key. Specify the key received, here.", + "key": "Authorization", + "value": "Ut enim offici" + }, + { + "description": "(Required) It is the Unique Id to identify the root organisation to which the user belongs", + "key": "X-Channel-Id", + "value": "Ut enim offici" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"framework\": {\n \"name\": \"Framework Name\",\n \"code\": \"dummy_framework\",\n \"channels\": [\n {\n \"identifier\": \"in.ekstep\"\n }\n ]\n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/framework/v1/create", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "framework", + "v1", + "create" + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"api.framework.create\",\n \"ver\": \"1.0\",\n \"ts\": \"2020-12-14T09:49:06.794Z\",\n \"params\": {\n \"resmsgid\": \"9b5d7ca0-3df1-11eb-9ff3-67c41480f6aa\",\n \"msgid\": \"9b4a90e0-3df1-11eb-9ff3-67c41480f6aa\",\n \"status\": \"successful\",\n \"err\": null,\n \"errmsg\": null\n },\n \"responseCode\": \"OK\",\n \"result\": {\n \"node_id\": \"dummy_framework\",\n \"versionKey\": \"1607939346678\"\n }\n}" + }, + { + "name": "BAD REQUEST. The \"create framework\" operation failed ! The possible reason for failure is that you may have missed providing input for a mandatory parameter.", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource\n Possible media types can be:- \n - application/json", + "key": "Content-Type", + "value": "Ut enim offici" + }, + { + "description": "(Required) To make use of the API, you require authorization. Raise a request to the administrator for the use of the API. You will receive the authorization key. Specify the key received, here.", + "key": "Authorization", + "value": "Ut enim offici" + }, + { + "description": "(Required) It is the Unique Id to identify the root organisation to which the user belongs", + "key": "X-Channel-Id", + "value": "Ut enim offici" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"framework\": {\n \"name\": \"Framework Name\",\n \"code\": \"dummy_framework\",\n \"channels\": [\n {\n \"identifier\": \"in.ekstep\"\n }\n ]\n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/framework/v1/create", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "framework", + "v1", + "create" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"api.framework.create\",\n \"ver\": \"1.0\",\n \"ts\": \"2020-12-14T09:50:45.249Z\",\n \"params\": {\n \"resmsgid\": \"d60c8710-3df1-11eb-9ff3-67c41480f6aa\",\n \"msgid\": null,\n \"status\": \"failed\",\n \"err\": \"CONSTRAINT_VALIDATION_FAILED\",\n \"errmsg\": \"Object already exists with identifier: dummy_framework\"\n },\n \"responseCode\": \"CLIENT_ERROR\",\n \"result\": {}\n}" + }, + { + "name": "INTERNAL SERVER ERROR ! Looks like something went wrong! These errors are tracked automatically, but if the problem persists feel free to contact us. In the meantime, try refreshing.", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource\n Possible media types can be:- \n - application/json", + "key": "Content-Type", + "value": "Ut enim offici" + }, + { + "description": "(Required) To make use of the API, you require authorization. Raise a request to the administrator for the use of the API. You will receive the authorization key. Specify the key received, here.", + "key": "Authorization", + "value": "Ut enim offici" + }, + { + "description": "(Required) It is the Unique Id to identify the root organisation to which the user belongs", + "key": "X-Channel-Id", + "value": "Ut enim offici" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"framework\": {\n \"name\": \"Framework Name\",\n \"code\": \"dummy_framework\",\n \"channels\": [\n {\n \"identifier\": \"in.ekstep\"\n }\n ]\n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/framework/v1/create", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "framework", + "v1", + "create" + ] + } + }, + "status": "Internal Server Error", + "code": 500, + "_postman_previewlanguage": "text", + "header": [ + { + "key": "Content-Type", + "value": "text/plain" + } + ], + "cookie": [], + "body": "" + } + ] + } + ], + "description": "1. Each time before running the folder, unique name should be given for the framework for create framework API" + }, + { + "name": "Positive", + "item": [ + { + "name": "Update an existing framework with valid fields", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json()\r", + "\r", + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "pm.test(\"id has string - api.taxonomy.framework.update \", function () {\r", + " pm.expect(jsonResponse.id).to.be.equal(\"api.taxonomy.framework.update\");\r", + "});\r", + "pm.test(\"Version is 3.0 \", function () {\r", + " pm.expect(jsonResponse.ver).to.be.equal(\"3.0\");\r", + "});\r", + "pm.test(\"Verify keys and data type of the response result\", () => {\r", + " pm.expect(jsonResponse.params).to.have.all.keys('resmsgid','msgid','status', 'err','errmsg');\r", + " pm.expect(jsonResponse.params.status).to.be.a(\"String\");\r", + " pm.expect(jsonResponse.params.err).to.be.a(\"null\");\r", + " pm.expect(jsonResponse.params.errmsg).to.be.a(\"null\");\r", + "});\r", + "\r", + "pm.test(\"Status has string \", function () {\r", + " pm.expect(jsonResponse.params.status).to.be.equal(\"successful\");\r", + "});\r", + "\r", + "pm.test(\"Verify keys and data type of the response result\", () => {\r", + " pm.expect(jsonResponse.result).to.have.all.keys('node_id', 'versionKey');\r", + " pm.expect(jsonResponse.result.node_id).to.be.a(\"String\");\r", + " pm.expect(jsonResponse.result.versionKey).to.be.a(\"string\");\r", + "});\r", + "\r", + "pm.collectionVariables.set(\"fw3_node\",jsonResponse.result.node_id);\r", + "console.log(pm.collectionVariables.get(\"fw3_node\"));\r", + "\r", + "pm.test(`node id should be equal to ${pm.collectionVariables.get(\"fw3_node\")}`, () => {\r", + " pm.expect(jsonResponse.result.node_id).to.eql(pm.collectionVariables.get(\"fw3_code\"));\r", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "apikey", + "apikey": [ + { + "key": "key", + "value": "Authorization", + "type": "string" + }, + { + "key": "value", + "value": "{{apiKey}}", + "type": "string" + }, + { + "key": "in", + "value": "header", + "type": "string" + } + ] + }, + "method": "PATCH", + "header": [ + { + "description": "(Required) It is the Unique Id to identify the root organisation to which the user belongs", + "key": "X-Channel-Id", + "value": "{{X-Channel-Id}}", + "disabled": true + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"framework\": {\n \"description\": \"Description for framework\"\n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{host}}/framework/v3/update/{{fw3_code}}", + "host": [ + "{{host}}" + ], + "path": [ + "framework", + "v3", + "update", + "{{fw3_code}}" + ] + }, + "description": "This API is associated with updating a framework\n - The endpoint for **Update Framework** is `/framework/v1/update/{ID}`\n - It points to knowledge-mw-service - `/v1/framework/update/{ID}`\n - The fieldsmarked with an asterisk (*) are mandatory. They cannot be null or empty." + }, + "response": [ + { + "name": "OK ! Successful operation.\"update framework\" operation was successfully executed.", + "originalRequest": { + "method": "PATCH", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource\n Possible media types can be:- \n - application/json\n - multipart/form-data\n - application/x-www-form-urlencoded", + "key": "Content-Type", + "value": "Ut enim offici" + }, + { + "description": "(Required) To make use of the API, you require authorization. Raise a request to the administrator for the use of the API. You will receive the authorization key. Specify the key received, here.", + "key": "Authorization", + "value": "Ut enim offici" + }, + { + "description": "(Required) It is the Unique Id to identify the root organisation to which the user belongs", + "key": "X-Channel-Id", + "value": "Ut enim offici" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"framework\": {\n \"description\": \"Dumy framework updated\"\n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/framework/v1/update/:ID", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "framework", + "v1", + "update", + ":ID" + ], + "variable": [ + { + "key": "ID", + "value": "Ut enim offici", + "description": "(Required) The identifier of the framework to be updated" + } + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"api.framework.update\",\n \"ver\": \"1.0\",\n \"ts\": \"2020-12-14T09:57:20.317Z\",\n \"params\": {\n \"resmsgid\": \"c1871ed0-3df2-11eb-9ff3-67c41480f6aa\",\n \"msgid\": \"c17ff2e0-3df2-11eb-9ff3-67c41480f6aa\",\n \"status\": \"successful\",\n \"err\": null,\n \"errmsg\": null\n },\n \"responseCode\": \"OK\",\n \"result\": {\n \"node_id\": \"dummy_framework\",\n \"versionKey\": \"1607939840281\"\n }\n}" + }, + { + "name": "BAD REQUEST. The \"update framework\" operation failed ! The possible reason for failure is that you may have missed providing input for a mandatory parameter.", + "originalRequest": { + "method": "PATCH", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource\n Possible media types can be:- \n - application/json\n - multipart/form-data\n - application/x-www-form-urlencoded", + "key": "Content-Type", + "value": "Ut enim offici" + }, + { + "description": "(Required) To make use of the API, you require authorization. Raise a request to the administrator for the use of the API. You will receive the authorization key. Specify the key received, here.", + "key": "Authorization", + "value": "Ut enim offici" + }, + { + "description": "(Required) It is the Unique Id to identify the root organisation to which the user belongs", + "key": "X-Channel-Id", + "value": "Ut enim offici" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"framework\": {\n \"description\": \"Dumy framework updated\"\n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/framework/v1/update/:ID", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "framework", + "v1", + "update", + ":ID" + ], + "variable": [ + { + "key": "ID", + "value": "Ut enim offici", + "description": "(Required) The identifier of the framework to be updated" + } + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"ts\": 24700756,\n \"id\": \"ut culpa\",\n \"params\": {\n \"msgid\": \"esse consequat\",\n \"resmsgid\": \"commodo aliqua magna Excepteur\",\n \"status\": \"failed\",\n \"err\": \"dolor laborum in ullamco\",\n \"errmsg\": \"laborum laboris sunt\"\n },\n \"ver\": \"laboris ut qu\",\n \"responseCode\": \"exercitation adipisicing in aliqua\",\n \"result\": {}\n}" + }, + { + "name": "RESOURCE NOT FOUND. The \"update framework\" operation failed ! The possible reason for failure is that you may have passed invalid framework id.", + "originalRequest": { + "method": "PATCH", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource\n Possible media types can be:- \n - application/json\n - multipart/form-data\n - application/x-www-form-urlencoded", + "key": "Content-Type", + "value": "Ut enim offici" + }, + { + "description": "(Required) To make use of the API, you require authorization. Raise a request to the administrator for the use of the API. You will receive the authorization key. Specify the key received, here.", + "key": "Authorization", + "value": "Ut enim offici" + }, + { + "description": "(Required) It is the Unique Id to identify the root organisation to which the user belongs", + "key": "X-Channel-Id", + "value": "Ut enim offici" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"framework\": {\n \"description\": \"Dumy framework updated\"\n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/framework/v1/update/:ID", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "framework", + "v1", + "update", + ":ID" + ], + "variable": [ + { + "key": "ID", + "value": "Ut enim offici", + "description": "(Required) The identifier of the framework to be updated" + } + ] + } + }, + "status": "Not Found", + "code": 404, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"api.framework.update\",\n \"ver\": \"1.0\",\n \"ts\": \"2020-12-14T09:57:50.352Z\",\n \"params\": {\n \"resmsgid\": \"d36e1900-3df2-11eb-9ff3-67c41480f6aa\",\n \"msgid\": null,\n \"status\": \"failed\",\n \"err\": \"ERR_FRAMEWORK_NOT_FOUND\",\n \"errmsg\": \"Framework Not Found With Id : dummy_framework1\"\n },\n \"responseCode\": \"RESOURCE_NOT_FOUND\",\n \"result\": {}\n}" + }, + { + "name": "INTERNAL SERVER ERROR ! Looks like something went wrong! These errors are tracked automatically, but if the problem persists feel free to contact us. In the meantime, try refreshing.", + "originalRequest": { + "method": "PATCH", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource\n Possible media types can be:- \n - application/json\n - multipart/form-data\n - application/x-www-form-urlencoded", + "key": "Content-Type", + "value": "Ut enim offici" + }, + { + "description": "(Required) To make use of the API, you require authorization. Raise a request to the administrator for the use of the API. You will receive the authorization key. Specify the key received, here.", + "key": "Authorization", + "value": "Ut enim offici" + }, + { + "description": "(Required) It is the Unique Id to identify the root organisation to which the user belongs", + "key": "X-Channel-Id", + "value": "Ut enim offici" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"framework\": {\n \"description\": \"Dumy framework updated\"\n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/framework/v1/update/:ID", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "framework", + "v1", + "update", + ":ID" + ], + "variable": [ + { + "key": "ID", + "value": "Ut enim offici", + "description": "(Required) The identifier of the framework to be updated" + } + ] + } + }, + "status": "Internal Server Error", + "code": 500, + "_postman_previewlanguage": "text", + "header": [ + { + "key": "Content-Type", + "value": "text/plain" + } + ], + "cookie": [], + "body": "" + } + ] + } + ] + }, + { + "name": "Negative", + "item": [ + { + "name": "Update a non existing framework", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json()\r", + "\r", + "pm.test(\"Status code is 404\", function () {\r", + " pm.response.to.have.status(404);\r", + "});\r", + "\r", + "pm.test(\"Status code name has string\", function () {\r", + " pm.response.to.have.status(\"Not Found\");\r", + "});\r", + "pm.test(\"id has string - api.taxonomy.framework.update \", function () {\r", + " pm.expect(jsonResponse.id).to.be.equal(\"api.taxonomy.framework.update\");\r", + "});\r", + "pm.test(\"Version is 3.0 \", function () {\r", + " pm.expect(jsonResponse.ver).to.be.equal(\"3.0\");\r", + "});\r", + "pm.test(\"Verify keys and data type of the response result\", () => {\r", + " pm.expect(jsonResponse.params).to.have.all.keys('resmsgid','msgid','err','status','errmsg');\r", + " pm.expect(jsonResponse.params.resmsgid).to.be.a(\"String\");\r", + " pm.expect(jsonResponse.params.msgid).to.be.a(\"null\");\r", + " pm.expect(jsonResponse.params.err).to.be.a(\"String\");\r", + " pm.expect(jsonResponse.params.status).to.be.a(\"String\");\r", + " pm.expect(jsonResponse.params.errmsg).to.be.a(\"String\");\r", + " });\r", + "\r", + "pm.test(\"Err has string\", function () {\r", + " pm.expect(jsonResponse.params.err).to.be.equal(\"NOT_FOUND\");\r", + "});\r", + "pm.test(\"Status has string\", function () {\r", + " pm.expect(jsonResponse.params.status).to.be.equal(\"failed\");\r", + "});\r", + "pm.test(\"errmsg has string\", function () {\r", + " pm.expect(jsonResponse.params.errmsg).to.be.equal(\"Error! Node(s) doesn't Exists. | [Invalid Node Id.]: abc\");\r", + "});\r", + "pm.test(\"responseCode has string: RESOURCE_NOT_FOUND\", function () {\r", + " pm.expect(jsonResponse.responseCode).to.be.equal(\"RESOURCE_NOT_FOUND\");\r", + "});\r", + "\r", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "apikey", + "apikey": [ + { + "key": "in", + "value": "header", + "type": "string" + }, + { + "key": "value", + "value": "{{auth_token}}", + "type": "string" + }, + { + "key": "key", + "value": "Authorization", + "type": "string" + } + ] + }, + "method": "PATCH", + "header": [ + { + "key": "Accept", + "value": "application/json", + "type": "text" + }, + { + "key": "X-Channel-Id", + "value": "{{X-Channel-Id}}", + "type": "text" + }, + { + "key": "Content-Type", + "value": "", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\r\n \"request\": {\r\n \"framework\": {\r\n \"description\": \"Description for framework\"\r\n }\r\n }\r\n}" + }, + "url": { + "raw": "{{host}}/framework/v3/update/abc", + "host": [ + "{{host}}" + ], + "path": [ + "framework", + "v3", + "update", + "abc" + ] + } + }, + "response": [] + } + ] + } + ] + }, + { + "name": "Delete a Framework", + "item": [ + { + "name": "Pre requisite", + "item": [ + { + "name": "Create a framework", + "event": [ + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + }, + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json()\r", + "\r", + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "\r", + "pm.collectionVariables.set(\"fw4_node\",jsonResponse.result.node_id);\r", + "console.log(pm.collectionVariables.get(\"fw4_node\"));\r", + "\r", + "pm.test(`node id should be equal to ${pm.collectionVariables.get(\"fw4_node\")}`, () => {\r", + " pm.expect(jsonResponse.result.node_id).to.eql(pm.collectionVariables.get(\"fw4_code\"));\r", + "});\r", + "\r", + "\r", + "\r", + "" + ], + "type": "text/javascript" + } + } + ], + "protocolProfileBehavior": { + "disabledSystemHeaders": {} + }, + "request": { + "auth": { + "type": "apikey", + "apikey": [ + { + "key": "value", + "value": "{{auth_token}}", + "type": "string" + }, + { + "key": "key", + "value": "Authorization", + "type": "string" + }, + { + "key": "in", + "value": "header", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "description": "(Required) It is the Unique Id to identify the root organisation to which the user belongs", + "key": "X-Channel-Id", + "value": "{{X-Channel-Id}}" + }, + { + "key": "", + "value": "", + "disabled": true + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "", + "type": "text", + "disabled": true + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"framework\": {\n \"name\": \"{{fw4_name}}\",\n \"code\": \"{{fw4_code}}\"\n \n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{host}}/framework/v3/create", + "host": [ + "{{host}}" + ], + "path": [ + "framework", + "v3", + "create" + ] + }, + "description": "This API is associated with creating a new framework on the Sunbird Platform.\n - The endpoint for **Create a Framework** is `/framework/v1/create`\n - It points to knowledge-mw-service - `/v1/framework/create`\n - The fields marked with an asterisk (*) are mandatory. They cannot be null or empty." + }, + "response": [ + { + "name": "OK ! Successful operation.\"create framework\" operation was successfully executed.", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource\n Possible media types can be:- \n - application/json", + "key": "Content-Type", + "value": "Ut enim offici" + }, + { + "description": "(Required) To make use of the API, you require authorization. Raise a request to the administrator for the use of the API. You will receive the authorization key. Specify the key received, here.", + "key": "Authorization", + "value": "Ut enim offici" + }, + { + "description": "(Required) It is the Unique Id to identify the root organisation to which the user belongs", + "key": "X-Channel-Id", + "value": "Ut enim offici" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"framework\": {\n \"name\": \"Framework Name\",\n \"code\": \"dummy_framework\",\n \"channels\": [\n {\n \"identifier\": \"in.ekstep\"\n }\n ]\n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/framework/v1/create", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "framework", + "v1", + "create" + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"api.framework.create\",\n \"ver\": \"1.0\",\n \"ts\": \"2020-12-14T09:49:06.794Z\",\n \"params\": {\n \"resmsgid\": \"9b5d7ca0-3df1-11eb-9ff3-67c41480f6aa\",\n \"msgid\": \"9b4a90e0-3df1-11eb-9ff3-67c41480f6aa\",\n \"status\": \"successful\",\n \"err\": null,\n \"errmsg\": null\n },\n \"responseCode\": \"OK\",\n \"result\": {\n \"node_id\": \"dummy_framework\",\n \"versionKey\": \"1607939346678\"\n }\n}" + }, + { + "name": "BAD REQUEST. The \"create framework\" operation failed ! The possible reason for failure is that you may have missed providing input for a mandatory parameter.", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource\n Possible media types can be:- \n - application/json", + "key": "Content-Type", + "value": "Ut enim offici" + }, + { + "description": "(Required) To make use of the API, you require authorization. Raise a request to the administrator for the use of the API. You will receive the authorization key. Specify the key received, here.", + "key": "Authorization", + "value": "Ut enim offici" + }, + { + "description": "(Required) It is the Unique Id to identify the root organisation to which the user belongs", + "key": "X-Channel-Id", + "value": "Ut enim offici" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"framework\": {\n \"name\": \"Framework Name\",\n \"code\": \"dummy_framework\",\n \"channels\": [\n {\n \"identifier\": \"in.ekstep\"\n }\n ]\n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/framework/v1/create", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "framework", + "v1", + "create" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"api.framework.create\",\n \"ver\": \"1.0\",\n \"ts\": \"2020-12-14T09:50:45.249Z\",\n \"params\": {\n \"resmsgid\": \"d60c8710-3df1-11eb-9ff3-67c41480f6aa\",\n \"msgid\": null,\n \"status\": \"failed\",\n \"err\": \"CONSTRAINT_VALIDATION_FAILED\",\n \"errmsg\": \"Object already exists with identifier: dummy_framework\"\n },\n \"responseCode\": \"CLIENT_ERROR\",\n \"result\": {}\n}" + }, + { + "name": "INTERNAL SERVER ERROR ! Looks like something went wrong! These errors are tracked automatically, but if the problem persists feel free to contact us. In the meantime, try refreshing.", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource\n Possible media types can be:- \n - application/json", + "key": "Content-Type", + "value": "Ut enim offici" + }, + { + "description": "(Required) To make use of the API, you require authorization. Raise a request to the administrator for the use of the API. You will receive the authorization key. Specify the key received, here.", + "key": "Authorization", + "value": "Ut enim offici" + }, + { + "description": "(Required) It is the Unique Id to identify the root organisation to which the user belongs", + "key": "X-Channel-Id", + "value": "Ut enim offici" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"framework\": {\n \"name\": \"Framework Name\",\n \"code\": \"dummy_framework\",\n \"channels\": [\n {\n \"identifier\": \"in.ekstep\"\n }\n ]\n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/framework/v1/create", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "framework", + "v1", + "create" + ] + } + }, + "status": "Internal Server Error", + "code": 500, + "_postman_previewlanguage": "text", + "header": [ + { + "key": "Content-Type", + "value": "text/plain" + } + ], + "cookie": [], + "body": "" + } + ] + } + ], + "description": "1. Each time before running the folder, unique name should be given for the framework for create framework API" + }, + { + "name": "Positive", + "item": [ + { + "name": "Delete a valid framework", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json()\r", + "\r", + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "pm.test(\"id has string - api.taxonomy.framework.retire \", function () {\r", + " pm.expect(jsonResponse.id).to.be.equal(\"api.taxonomy.framework.retire\");\r", + "});\r", + "pm.test(\"Version is 3.0 \", function () {\r", + " pm.expect(jsonResponse.ver).to.be.equal(\"3.0\");\r", + "});\r", + "pm.test(\"Verify keys and data type of the response result\", () => {\r", + " pm.expect(jsonResponse.params).to.have.all.keys('resmsgid','msgid','err','status','errmsg');\r", + " pm.expect(jsonResponse.params.resmsgid).to.be.a(\"String\");\r", + " pm.expect(jsonResponse.params.msgid).to.be.a('null');\r", + " pm.expect(jsonResponse.params.err).to.be.a('null');\r", + " pm.expect(jsonResponse.params.status).to.be.a(\"String\");\r", + " pm.expect(jsonResponse.params.errmsg).to.be.a('null');\r", + " });\r", + "\r", + "\r", + "pm.test(\"Status has string\", function () {\r", + " pm.expect(jsonResponse.params.status).to.be.equal(\"successful\");\r", + "});\r", + "\r", + "pm.test(\"responseCode has string\", function () {\r", + " pm.expect(jsonResponse.responseCode).to.be.equal(\"OK\");\r", + "});\r", + "\r", + "pm.test(\"Verify keys and data type of the response result\", () => {\r", + " pm.expect(jsonResponse.result).to.have.all.keys('identifier','node_id');\r", + " pm.expect(jsonResponse.result.identifier).to.be.a(\"String\");\r", + " pm.expect(jsonResponse.result.node_id).to.be.a(\"string\");\r", + "});\r", + "\r", + "pm.collectionVariables.set(\"fw4_node\",jsonResponse.result.node_id);\r", + "console.log(pm.collectionVariables.get(\"fw4_node\"));\r", + "\r", + "pm.collectionVariables.set(\"fw4_id\",jsonResponse.result.identifier);\r", + "console.log(pm.collectionVariables.get(\"fw4_id\"));\r", + "\r", + "pm.test(`identifier should be equal to ${pm.collectionVariables.get(\"fw4_id\")}`, () => {\r", + " pm.expect(jsonResponse.result.identifier).to.eql(pm.collectionVariables.get(\"fw4_code\"));\r", + "});\r", + "\r", + "pm.test(`node id should be equal to ${pm.collectionVariables.get(\"fw4_node\")}`, () => {\r", + " pm.expect(jsonResponse.result.node_id).to.eql(pm.collectionVariables.get(\"fw4_code\"));\r", + "});\r", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "apikey", + "apikey": [ + { + "key": "in", + "value": "header", + "type": "string" + }, + { + "key": "value", + "value": "{{auth_token}}", + "type": "string" + }, + { + "key": "key", + "value": "Authorization", + "type": "string" + } + ] + }, + "method": "DELETE", + "header": [ + { + "key": "X-Channel-Id", + "value": "{{X-Channel-Id}}", + "type": "text" + }, + { + "key": "Accept", + "value": "application/json", + "type": "text" + }, + { + "key": "Content-Type", + "value": "application/json", + "type": "text" + } + ], + "url": { + "raw": "{{host}}/framework/v3/retire/{{fw4_code}}", + "host": [ + "{{host}}" + ], + "path": [ + "framework", + "v3", + "retire", + "{{fw4_code}}" + ] + } + }, + "response": [] + } + ] + }, + { + "name": "Negative", + "item": [ + { + "name": "Delete an invalid framework", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json()\r", + "\r", + "pm.test(\"Status code is 404\", function () {\r", + " pm.response.to.have.status(404);\r", + "});\r", + "\r", + "pm.test(\"Status code name has string:Not Found\", function () {\r", + " pm.response.to.have.status(\"Not Found\");\r", + "});\r", + "pm.test(\"id has string - api.taxonomy.framework.retire \", function () {\r", + " pm.expect(jsonResponse.id).to.be.equal(\"api.taxonomy.framework.retire\");\r", + "});\r", + "pm.test(\"Version is 3.0 \", function () {\r", + " pm.expect(jsonResponse.ver).to.be.equal(\"3.0\");\r", + "});\r", + "pm.test(\"Verify keys and data type of the response result\", () => {\r", + " pm.expect(jsonResponse.params).to.have.all.keys('resmsgid','msgid','err','status','errmsg');\r", + " pm.expect(jsonResponse.params.resmsgid).to.be.a(\"String\");\r", + " pm.expect(jsonResponse.params.msgid).to.be.a(\"null\");\r", + " pm.expect(jsonResponse.params.err).to.be.a(\"String\");\r", + " pm.expect(jsonResponse.params.status).to.be.a(\"String\");\r", + " pm.expect(jsonResponse.params.errmsg).to.be.a(\"String\");\r", + " });\r", + "\r", + "pm.test(\"Err has string: NOT_FOUND\", function () {\r", + " pm.expect(jsonResponse.params.err).to.be.equal(\"NOT_FOUND\");\r", + "});\r", + "pm.test(\"Status has string: failed\", function () {\r", + " pm.expect(jsonResponse.params.status).to.be.equal(\"failed\");\r", + "});\r", + "pm.test(\"errmsg has string: Error! Node(s) doesn't Exists. | [Invalid Node Id.]: abc\", function () {\r", + " pm.expect(jsonResponse.params.errmsg).to.be.equal(\"Error! Node(s) doesn't Exists. | [Invalid Node Id.]: abc\");\r", + "});\r", + "pm.test(\"responseCode has string: RESOURCE_NOT_FOUND\", function () {\r", + " pm.expect(jsonResponse.responseCode).to.be.equal(\"RESOURCE_NOT_FOUND\");\r", + "});\r", + "\r", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "apikey", + "apikey": [ + { + "key": "in", + "value": "header", + "type": "string" + }, + { + "key": "value", + "value": "{{auth_token}}", + "type": "string" + }, + { + "key": "key", + "value": "Authorization", + "type": "string" + } + ] + }, + "method": "DELETE", + "header": [ + { + "key": "Accept", + "value": "application/json", + "type": "text" + }, + { + "key": "Content-Type", + "value": "application/json", + "type": "text" + }, + { + "key": "X-Channel-Id", + "value": "{{X-Channel-Id}}", + "type": "text" + } + ], + "url": { + "raw": "{{host}}/framework/v3/retire/abc", + "host": [ + "{{host}}" + ], + "path": [ + "framework", + "v3", + "retire", + "abc" + ] + } + }, + "response": [] + } + ] + } + ] + }, + { + "name": "Publish Framework", + "item": [ + { + "name": "Pre requisite", + "item": [ + { + "name": "Create Master category", + "event": [ + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + }, + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json()\r", + "\r", + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "\r", + "pm.collectionVariables.set(\"master6_id\",jsonResponse.result.identifier);\r", + "console.log(pm.collectionVariables.get(\"master6_id\"));\r", + "pm.collectionVariables.set(\"master6_node\",jsonResponse.result.node_id);\r", + "console.log(pm.collectionVariables.get(\"master6_node\"));\r", + "\r", + "pm.test(`identifier should be equal to ${pm.collectionVariables.get(\"master6_id\")}`, () => {\r", + " pm.expect(jsonResponse.result.identifier).to.eql(`${pm.collectionVariables.get(\"master6_code\")}`);\r", + "});\r", + "\r", + "pm.test(`node_id should be equal to ${pm.collectionVariables.get(\"master6_node\")}`, () => {\r", + " pm.expect(jsonResponse.result.node_id).to.eql(`${pm.collectionVariables.get(\"master6_code\")}`);\r", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "apikey", + "apikey": [ + { + "key": "value", + "value": "{{auth_token}}", + "type": "string" + }, + { + "key": "key", + "value": "Authorization", + "type": "string" + }, + { + "key": "in", + "value": "header", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "X-Channel-Id", + "value": "{{X-Channel-Id}}" + }, + { + "key": "", + "value": "", + "disabled": true + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"category\": {\n \"name\": \"master\",\n \"code\": \"{{master6_code}}\",\n \"targetIdFieldName\": \"targetmasterIds\",\n \"searchLabelFieldName\": \"se_master\",\n \"searchIdFieldName\": \"se_master\",\n \"orgIdFieldName\": \"masterIds\"\n }\n }\n}" + }, + "url": { + "raw": "{{host}}/framework/v3/category/master/create", + "host": [ + "{{host}}" + ], + "path": [ + "framework", + "v3", + "category", + "master", + "create" + ] + } + }, + "response": [] + }, + { + "name": "Create a framework", + "event": [ + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + }, + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json()\r", + "\r", + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "\r", + "pm.collectionVariables.set(\"fw5_node\",jsonResponse.result.node_id);\r", + "console.log(pm.collectionVariables.get(\"fw5_node\"));\r", + "\r", + "pm.test(`node id should be equal to ${pm.collectionVariables.get(\"fw5_node\")}`, () => {\r", + " pm.expect(jsonResponse.result.node_id).to.eql(pm.collectionVariables.get(\"fw5_code\"));\r", + "});\r", + "\r", + "\r", + "\r", + "" + ], + "type": "text/javascript" + } + } + ], + "protocolProfileBehavior": { + "disabledSystemHeaders": {} + }, + "request": { + "auth": { + "type": "apikey", + "apikey": [ + { + "key": "value", + "value": "{{auth_token}}", + "type": "string" + }, + { + "key": "key", + "value": "Authorization", + "type": "string" + }, + { + "key": "in", + "value": "header", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "description": "(Required) It is the Unique Id to identify the root organisation to which the user belongs", + "key": "X-Channel-Id", + "value": "{{X-Channel-Id}}" + }, + { + "key": "", + "value": "", + "disabled": true + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "", + "type": "text", + "disabled": true + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"framework\": {\n \"name\": \"{{fw5_name}}\",\n \"code\": \"{{fw5_code}}\"\n \n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{host}}/framework/v3/create", + "host": [ + "{{host}}" + ], + "path": [ + "framework", + "v3", + "create" + ] + }, + "description": "This API is associated with creating a new framework on the Sunbird Platform.\n - The endpoint for **Create a Framework** is `/framework/v1/create`\n - It points to knowledge-mw-service - `/v1/framework/create`\n - The fields marked with an asterisk (*) are mandatory. They cannot be null or empty." + }, + "response": [ + { + "name": "OK ! Successful operation.\"create framework\" operation was successfully executed.", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource\n Possible media types can be:- \n - application/json", + "key": "Content-Type", + "value": "Ut enim offici" + }, + { + "description": "(Required) To make use of the API, you require authorization. Raise a request to the administrator for the use of the API. You will receive the authorization key. Specify the key received, here.", + "key": "Authorization", + "value": "Ut enim offici" + }, + { + "description": "(Required) It is the Unique Id to identify the root organisation to which the user belongs", + "key": "X-Channel-Id", + "value": "Ut enim offici" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"framework\": {\n \"name\": \"Framework Name\",\n \"code\": \"dummy_framework\",\n \"channels\": [\n {\n \"identifier\": \"in.ekstep\"\n }\n ]\n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/framework/v1/create", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "framework", + "v1", + "create" + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"api.framework.create\",\n \"ver\": \"1.0\",\n \"ts\": \"2020-12-14T09:49:06.794Z\",\n \"params\": {\n \"resmsgid\": \"9b5d7ca0-3df1-11eb-9ff3-67c41480f6aa\",\n \"msgid\": \"9b4a90e0-3df1-11eb-9ff3-67c41480f6aa\",\n \"status\": \"successful\",\n \"err\": null,\n \"errmsg\": null\n },\n \"responseCode\": \"OK\",\n \"result\": {\n \"node_id\": \"dummy_framework\",\n \"versionKey\": \"1607939346678\"\n }\n}" + }, + { + "name": "BAD REQUEST. The \"create framework\" operation failed ! The possible reason for failure is that you may have missed providing input for a mandatory parameter.", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource\n Possible media types can be:- \n - application/json", + "key": "Content-Type", + "value": "Ut enim offici" + }, + { + "description": "(Required) To make use of the API, you require authorization. Raise a request to the administrator for the use of the API. You will receive the authorization key. Specify the key received, here.", + "key": "Authorization", + "value": "Ut enim offici" + }, + { + "description": "(Required) It is the Unique Id to identify the root organisation to which the user belongs", + "key": "X-Channel-Id", + "value": "Ut enim offici" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"framework\": {\n \"name\": \"Framework Name\",\n \"code\": \"dummy_framework\",\n \"channels\": [\n {\n \"identifier\": \"in.ekstep\"\n }\n ]\n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/framework/v1/create", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "framework", + "v1", + "create" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"api.framework.create\",\n \"ver\": \"1.0\",\n \"ts\": \"2020-12-14T09:50:45.249Z\",\n \"params\": {\n \"resmsgid\": \"d60c8710-3df1-11eb-9ff3-67c41480f6aa\",\n \"msgid\": null,\n \"status\": \"failed\",\n \"err\": \"CONSTRAINT_VALIDATION_FAILED\",\n \"errmsg\": \"Object already exists with identifier: dummy_framework\"\n },\n \"responseCode\": \"CLIENT_ERROR\",\n \"result\": {}\n}" + }, + { + "name": "INTERNAL SERVER ERROR ! Looks like something went wrong! These errors are tracked automatically, but if the problem persists feel free to contact us. In the meantime, try refreshing.", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource\n Possible media types can be:- \n - application/json", + "key": "Content-Type", + "value": "Ut enim offici" + }, + { + "description": "(Required) To make use of the API, you require authorization. Raise a request to the administrator for the use of the API. You will receive the authorization key. Specify the key received, here.", + "key": "Authorization", + "value": "Ut enim offici" + }, + { + "description": "(Required) It is the Unique Id to identify the root organisation to which the user belongs", + "key": "X-Channel-Id", + "value": "Ut enim offici" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"framework\": {\n \"name\": \"Framework Name\",\n \"code\": \"dummy_framework\",\n \"channels\": [\n {\n \"identifier\": \"in.ekstep\"\n }\n ]\n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/framework/v1/create", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "framework", + "v1", + "create" + ] + } + }, + "status": "Internal Server Error", + "code": 500, + "_postman_previewlanguage": "text", + "header": [ + { + "key": "Content-Type", + "value": "text/plain" + } + ], + "cookie": [], + "body": "" + } + ] + }, + { + "name": "Create Framework category", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json()\r", + "\r", + "pm.collectionVariables.set(\"fwcat_cat1\",jsonResponse.result.identifier);\r", + "console.log(pm.collectionVariables.get(\"fwcat_cat1\"));\r", + "\r", + "pm.test(`identifier should be equal to ${pm.collectionVariables.get(\"fwcat_cat1\")}`, () => {\r", + " pm.expect(jsonResponse.result.identifier).to.eql(`${pm.collectionVariables.get(\"fw5_code\")}_${pm.collectionVariables.get(\"master6_code\")}`);\r", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "X-Channel-Id", + "value": "{{X-Channel-Id}}" + }, + { + "key": "Authorization", + "value": "" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"category\": {\n \"name\": \"Board\",\n \"code\": \"{{master6_code}}\",\n \"description\":\"Board category\"\n }\n }\n}" + }, + "url": { + "raw": "{{host}}/framework/v3/category/create?framework={{fw5_code}}", + "host": [ + "{{host}}" + ], + "path": [ + "framework", + "v3", + "category", + "create" + ], + "query": [ + { + "key": "framework", + "value": "{{fw5_code}}" + } + ] + } + }, + "response": [] + } + ] + }, + { + "name": "Positive", + "item": [ + { + "name": "Publish a valid Framework", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json()\r", + "\r", + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "pm.test(\"id has string - api.taxonomy.framework.publish \", function () {\r", + " pm.expect(jsonResponse.id).to.be.equal(\"api.taxonomy.framework.publish\");\r", + "});\r", + "pm.test(\"Version is 3.0 \", function () {\r", + " pm.expect(jsonResponse.ver).to.be.equal(\"3.0\");\r", + "});\r", + "pm.test(\"Verify keys and data type of the response result\", () => {\r", + " pm.expect(jsonResponse.params).to.have.all.keys('resmsgid','msgid','err','status','errmsg');\r", + " pm.expect(jsonResponse.params.resmsgid).to.be.a(\"String\");\r", + " pm.expect(jsonResponse.params.msgid).to.be.a(\"null\");\r", + " pm.expect(jsonResponse.params.err).to.be.a(\"null\");\r", + " pm.expect(jsonResponse.params.status).to.be.a(\"String\");\r", + " pm.expect(jsonResponse.params.errmsg).to.be.a(\"null\");\r", + " });\r", + "\r", + "pm.test(\"responseCode has string\", function () {\r", + " pm.expect(jsonResponse.responseCode).to.be.equal(\"OK\");\r", + "});\r", + "\r", + "\r", + "pm.test(`publishStatus has string: Publish Event for Framework Id ${pm.collectionVariables.get(\"fw5_code\")} is pushed Successfully!`, function () {\r", + " pm.expect(jsonResponse.result.publishStatus).to.eql(`Publish Event for Framework Id '${pm.collectionVariables.get(\"fw5_code\")}' is pushed Successfully!`);\r", + "});\r", + "\r", + "\r", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "apikey", + "apikey": [ + { + "key": "value", + "value": "{{auth_token}}", + "type": "string" + }, + { + "key": "key", + "value": "Authorization", + "type": "string" + }, + { + "key": "in", + "value": "header", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "description": "(Required) It is the Unique Id to identify the root organisation to which the user belongs", + "key": "X-Channel-Id", + "value": "{{X-Channel-Id}}" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{host}}/framework/v3/publish/{{fw5_code}}", + "host": [ + "{{host}}" + ], + "path": [ + "framework", + "v3", + "publish", + "{{fw5_code}}" + ] + }, + "description": "This API is associated with publishing a framework\n - The endpoint for **Publish Framework** is `/framework/v1/publish/{ID}`\n - It points to knowledge-mw-service - `/v1/framework/publish/{ID}`\n - The fields marked with an asterisk (*) are mandatory. They cannot be null or empty." + }, + "response": [ + { + "name": "OK ! Successful operation.\"Publish framework\" operation was successfully executed.", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "The Content Type entity is the media type of the resource.\n Possible media types can be:- \n - application/json", + "key": "Content-Type", + "value": "Ut enim offici" + }, + { + "description": "(Required) To make use of the API, you require authorization. Raise a request to the administrator for the use of the API. You will receive the authorization key. Specify the key received, here.", + "key": "Authorization", + "value": "Ut enim offici" + }, + { + "description": "(Required) It is the Unique Id to identify the root organisation to which the user belongs", + "key": "X-Channel-Id", + "value": "Ut enim offici" + } + ], + "body": { + "mode": "raw", + "raw": "{}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/framework/v1/publish/:ID", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "framework", + "v1", + "publish", + ":ID" + ], + "variable": [ + { + "key": "ID", + "value": "Ut enim offici", + "description": "(Required) The identifier of the framework to be published" + } + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"api.framework.publish\",\n \"ver\": \"1.0\",\n \"ts\": \"2020-12-14T10:07:54.648Z\",\n \"params\": {\n \"resmsgid\": \"3b9e5980-3df4-11eb-9ff3-67c41480f6aa\",\n \"msgid\": \"3b9cabd0-3df4-11eb-9ff3-67c41480f6aa\",\n \"status\": \"successful\",\n \"err\": null,\n \"errmsg\": null\n },\n \"responseCode\": \"OK\",\n \"result\": {\n \"publishStatus\": \"Publish Operation for Framework Id 'dummy_framework' Started Successfully!\"\n }\n}" + }, + { + "name": "BAD REQUEST. The \"Publish Framework\" operation failed ! The possible reason for failure is that you may have missed providing input for a mandatory parameter.", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "The Content Type entity is the media type of the resource.\n Possible media types can be:- \n - application/json", + "key": "Content-Type", + "value": "Ut enim offici" + }, + { + "description": "(Required) To make use of the API, you require authorization. Raise a request to the administrator for the use of the API. You will receive the authorization key. Specify the key received, here.", + "key": "Authorization", + "value": "Ut enim offici" + }, + { + "description": "(Required) It is the Unique Id to identify the root organisation to which the user belongs", + "key": "X-Channel-Id", + "value": "Ut enim offici" + } + ], + "body": { + "mode": "raw", + "raw": "{}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/framework/v1/publish/:ID", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "framework", + "v1", + "publish", + ":ID" + ], + "variable": [ + { + "key": "ID", + "value": "Ut enim offici", + "description": "(Required) The identifier of the framework to be published" + } + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"api.framework.publish\",\n \"ver\": \"1.0\",\n \"ts\": \"2020-12-14T10:08:19.872Z\",\n \"params\": {\n \"resmsgid\": \"4aa73a00-3df4-11eb-9ff3-67c41480f6aa\",\n \"msgid\": null,\n \"status\": \"failed\",\n \"err\": \"ERR_INVALID_FRAMEOWRK_ID\",\n \"errmsg\": \"Invalid Framework Id. Framework doesn't exist.\"\n },\n \"responseCode\": \"CLIENT_ERROR\",\n \"result\": {}\n}" + }, + { + "name": "INTERNAL SERVER ERROR ! Looks like something went wrong! These errors are tracked automatically, but if the problem persists feel free to contact us. In the meantime, try refreshing.", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "The Content Type entity is the media type of the resource.\n Possible media types can be:- \n - application/json", + "key": "Content-Type", + "value": "Ut enim offici" + }, + { + "description": "(Required) To make use of the API, you require authorization. Raise a request to the administrator for the use of the API. You will receive the authorization key. Specify the key received, here.", + "key": "Authorization", + "value": "Ut enim offici" + }, + { + "description": "(Required) It is the Unique Id to identify the root organisation to which the user belongs", + "key": "X-Channel-Id", + "value": "Ut enim offici" + } + ], + "body": { + "mode": "raw", + "raw": "{}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/framework/v1/publish/:ID", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "framework", + "v1", + "publish", + ":ID" + ], + "variable": [ + { + "key": "ID", + "value": "Ut enim offici", + "description": "(Required) The identifier of the framework to be published" + } + ] + } + }, + "status": "Internal Server Error", + "code": 500, + "_postman_previewlanguage": "text", + "header": [ + { + "key": "Content-Type", + "value": "text/plain" + } + ], + "cookie": [], + "body": "" + } + ] + } + ] + }, + { + "name": "Negative", + "item": [ + { + "name": "Publish an invalid framework", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json()\r", + "\r", + "pm.test(\"Status code is 500\", function () {\r", + " pm.response.to.have.status(500);\r", + "});\r", + "pm.test(\"id has string - api.taxonomy.framework.publish \", function () {\r", + " pm.expect(jsonResponse.id).to.be.equal(\"api.taxonomy.framework.publish\");\r", + "});\r", + "pm.test(\"Version is 3.0 \", function () {\r", + " pm.expect(jsonResponse.ver).to.be.equal(\"3.0\");\r", + "});\r", + "pm.test(\"errmsg has string\", function () {\r", + " pm.expect(jsonResponse.params.errmsg).to.be.equal(\"Something went wrong in server while processing the request\");\r", + "});\r", + "\r", + "pm.test(\"responseCode has string\", function () {\r", + " pm.expect(jsonResponse.responseCode).to.be.equal(\"SERVER_ERROR\");\r", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "X-Channel-Id", + "value": "sunbird" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "{{auth_token}}" + } + ], + "body": { + "mode": "raw", + "raw": "{}" + }, + "url": { + "raw": "{{host}}/framework/v3/publish/dummy", + "host": [ + "{{host}}" + ], + "path": [ + "framework", + "v3", + "publish", + "dummy" + ] + } + }, + "response": [] + } + ] + } + ] + }, + { + "name": "Copy Framework", + "item": [ + { + "name": "Positive", + "item": [ + { + "name": "Copy a valid framework", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json()\r", + "\r", + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "pm.test(\"id has string - api.taxonomy.framework.copy \", function () {\r", + " pm.expect(jsonResponse.id).to.be.equal(\"api.taxonomy.framework.copy\");\r", + "});\r", + "pm.test(\"Version is 3.0 \", function () {\r", + " pm.expect(jsonResponse.ver).to.be.equal(\"3.0\");\r", + "});\r", + "pm.test(\"Verify keys and data type of the response result\", () => {\r", + " pm.expect(jsonResponse.params).to.have.all.keys('resmsgid','msgid','status', 'err','errmsg');\r", + " pm.expect(jsonResponse.params.status).to.be.a(\"String\");\r", + " pm.expect(jsonResponse.params.err).to.be.a(\"null\");\r", + " pm.expect(jsonResponse.params.errmsg).to.be.a(\"null\");\r", + "});\r", + "\r", + "pm.test(\"Status has string Successful\", function () {\r", + " pm.expect(jsonResponse.params.status).to.be.equal(\"successful\");\r", + "});\r", + "\r", + "pm.test(\"Verify keys and data type of the response result\", () => {\r", + " pm.expect(jsonResponse.result).to.have.all.keys('node_id');\r", + " pm.expect(jsonResponse.result.node_id).to.be.a(\"String\");\r", + "});\r", + "\r", + "pm.collectionVariables.set(\"copy_node\",jsonResponse.result.node_id);\r", + "console.log(pm.collectionVariables.get(\"copy_node\"));\r", + "\r", + "pm.test(`node id should be equal to ${pm.collectionVariables.get(\"copy_fw\")}`, () => {\r", + " pm.expect(jsonResponse.result.node_id).to.eql(pm.collectionVariables.get(\"copy_fw\"));\r", + "});\r", + "" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "apikey", + "apikey": [ + { + "key": "key", + "value": "Authorization", + "type": "string" + }, + { + "key": "value", + "value": "{{apiKey}}", + "type": "string" + }, + { + "key": "in", + "value": "header", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "description": "(Required) It is the Unique Id to identify the root organisation to which the user belongs", + "key": "X-Channel-Id", + "value": "{{X-Channel-Id}}" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"framework\": {\n \"code\": \"{{copy_fw}}\"\n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{host}}/framework/v3/copy/{{fw5_code}}", + "host": [ + "{{host}}" + ], + "path": [ + "framework", + "v3", + "copy", + "{{fw5_code}}" + ] + }, + "description": "This API is associated with copying a framework\n - The endpoint for **Copy Framework** is `/framework/v1/copy/{ID}`\n - It points to knowledge-mw-service - `v1/framework/copy/{ID}`\n - The fields marked with an asterisk (*) are mandatory. They cannot be null or empty." + }, + "response": [ + { + "name": "OK ! Successful operation.\"Copy framework\" operation was successfully executed.", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource.\n Possible media types can be:- \n - application/json", + "key": "Content-Type", + "value": "Ut enim offici" + }, + { + "description": "(Required) To make use of the API, you require authorization. Raise a request to the administrator for the use of the API. You will receive the authorization key. Specify the key received, here.", + "key": "Authorization", + "value": "Ut enim offici" + }, + { + "description": "(Required) It is the Unique Id to identify the root organisation to which the user belongs", + "key": "X-Channel-Id", + "value": "Ut enim offici" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"framework\": {\n \"code\": \"NCERTCOPY11\"\n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/framework/v1/copy/:ID", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "framework", + "v1", + "copy", + ":ID" + ], + "variable": [ + { + "key": "ID", + "value": "Ut enim offici", + "description": "(Required) The identifier of the framework to be copied" + } + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"api.framework.copy\",\n \"ver\": \"1.0\",\n \"ts\": \"2020-12-14T10:46:44.287Z\",\n \"params\": {\n \"resmsgid\": \"a8310cf0-3df9-11eb-9ff3-67c41480f6aa\",\n \"msgid\": \"a6b2aa50-3df9-11eb-9ff3-67c41480f6aa\",\n \"status\": \"successful\",\n \"err\": null,\n \"errmsg\": null\n },\n \"responseCode\": \"OK\",\n \"result\": {\n \"node_id\": \"NCERTCOPY11\"\n }\n}" + }, + { + "name": "BAD REQUEST. The \"Copy fFramework\" operation failed ! The possible reason for failure is that you may have missed providing input for a mandatory parameter.", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource.\n Possible media types can be:- \n - application/json", + "key": "Content-Type", + "value": "Ut enim offici" + }, + { + "description": "(Required) To make use of the API, you require authorization. Raise a request to the administrator for the use of the API. You will receive the authorization key. Specify the key received, here.", + "key": "Authorization", + "value": "Ut enim offici" + }, + { + "description": "(Required) It is the Unique Id to identify the root organisation to which the user belongs", + "key": "X-Channel-Id", + "value": "Ut enim offici" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"framework\": {\n \"code\": \"NCERTCOPY11\"\n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/framework/v1/copy/:ID", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "framework", + "v1", + "copy", + ":ID" + ], + "variable": [ + { + "key": "ID", + "value": "Ut enim offici", + "description": "(Required) The identifier of the framework to be copied" + } + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"api.framework.copy\",\n \"ver\": \"1.0\",\n \"ts\": \"2020-12-14T10:47:22.578Z\",\n \"params\": {\n \"resmsgid\": \"bf03cb20-3df9-11eb-9ff3-67c41480f6aa\",\n \"msgid\": null,\n \"status\": \"failed\",\n \"err\": \"ERR_FRAMEWORK_EXISTS\",\n \"errmsg\": \"Framework with code: NCERTCOPY11, already exists.\"\n },\n \"responseCode\": \"CLIENT_ERROR\",\n \"result\": {}\n}" + }, + { + "name": "RESOURCE NOT FOUND. The \"Copy fFramework\" operation failed ! The possible reason for failure is that you may have missed invlalid framework id.", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource.\n Possible media types can be:- \n - application/json", + "key": "Content-Type", + "value": "Ut enim offici" + }, + { + "description": "(Required) To make use of the API, you require authorization. Raise a request to the administrator for the use of the API. You will receive the authorization key. Specify the key received, here.", + "key": "Authorization", + "value": "Ut enim offici" + }, + { + "description": "(Required) It is the Unique Id to identify the root organisation to which the user belongs", + "key": "X-Channel-Id", + "value": "Ut enim offici" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"framework\": {\n \"code\": \"NCERTCOPY11\"\n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/framework/v1/copy/:ID", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "framework", + "v1", + "copy", + ":ID" + ], + "variable": [ + { + "key": "ID", + "value": "Ut enim offici", + "description": "(Required) The identifier of the framework to be copied" + } + ] + } + }, + "status": "Not Found", + "code": 404, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"api.framework.copy\",\n \"ver\": \"1.0\",\n \"ts\": \"2020-12-14T10:47:47.865Z\",\n \"params\": {\n \"resmsgid\": \"ce164890-3df9-11eb-9ff3-67c41480f6aa\",\n \"msgid\": null,\n \"status\": \"failed\",\n \"err\": \"ERR_DATA_NOT_FOUND\",\n \"errmsg\": \"Data not found with id : NCERT101100\"\n },\n \"responseCode\": \"RESOURCE_NOT_FOUND\",\n \"result\": {}\n}" + }, + { + "name": "INTERNAL SERVER ERROR ! Looks like something went wrong! These errors are tracked automatically, but if the problem persists feel free to contact us. In the meantime, try refreshing.", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource.\n Possible media types can be:- \n - application/json", + "key": "Content-Type", + "value": "Ut enim offici" + }, + { + "description": "(Required) To make use of the API, you require authorization. Raise a request to the administrator for the use of the API. You will receive the authorization key. Specify the key received, here.", + "key": "Authorization", + "value": "Ut enim offici" + }, + { + "description": "(Required) It is the Unique Id to identify the root organisation to which the user belongs", + "key": "X-Channel-Id", + "value": "Ut enim offici" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"framework\": {\n \"code\": \"NCERTCOPY11\"\n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/framework/v1/copy/:ID", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "framework", + "v1", + "copy", + ":ID" + ], + "variable": [ + { + "key": "ID", + "value": "Ut enim offici", + "description": "(Required) The identifier of the framework to be copied" + } + ] + } + }, + "status": "Internal Server Error", + "code": 500, + "_postman_previewlanguage": "text", + "header": [ + { + "key": "Content-Type", + "value": "text/plain" + } + ], + "cookie": [], + "body": "" + } + ] + } + ], + "description": "name of the framework should be updated before every run" + }, + { + "name": "Negative", + "item": [ + { + "name": "Copy an invalid framework", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json()\r", + "\r", + "pm.test(\"Status code is 404\", function () {\r", + " pm.response.to.have.status(404);\r", + "});\r", + "\r", + "pm.test(\"Status code name has string\", function () {\r", + " pm.response.to.have.status(\"Not Found\");\r", + "});\r", + "pm.test(\"id has string - api.taxonomy.framework.copy \", function () {\r", + " pm.expect(jsonResponse.id).to.be.equal(\"api.taxonomy.framework.copy\");\r", + "});\r", + "pm.test(\"Version is 3.0 \", function () {\r", + " pm.expect(jsonResponse.ver).to.be.equal(\"3.0\");\r", + "});\r", + "pm.test(\"Verify keys and data type of the response result\", () => {\r", + " pm.expect(jsonResponse.params).to.have.all.keys('resmsgid','msgid','err','status','errmsg');\r", + " pm.expect(jsonResponse.params.resmsgid).to.be.a(\"String\");\r", + " pm.expect(jsonResponse.params.msgid).to.be.a(\"null\");\r", + " pm.expect(jsonResponse.params.err).to.be.a(\"String\");\r", + " pm.expect(jsonResponse.params.status).to.be.a(\"String\");\r", + " pm.expect(jsonResponse.params.errmsg).to.be.a(\"String\");\r", + " });\r", + "\r", + "pm.test(\"Err has string\", function () {\r", + " pm.expect(jsonResponse.params.err).to.be.equal(\"NOT_FOUND\");\r", + "});\r", + "pm.test(\"Status has string\", function () {\r", + " pm.expect(jsonResponse.params.status).to.be.equal(\"failed\");\r", + "});\r", + "pm.test(\"errmsg has string\", function () {\r", + " pm.expect(jsonResponse.params.errmsg).to.be.equal(\"Error! Node(s) doesn't Exists. | [Invalid Node Id.]: dummy\");\r", + "});\r", + "pm.test(\"responseCode has string\", function () {\r", + " pm.expect(jsonResponse.responseCode).to.be.equal(\"RESOURCE_NOT_FOUND\");\r", + "});\r", + "\r", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "apikey", + "apikey": [ + { + "key": "in", + "value": "header", + "type": "string" + }, + { + "key": "value", + "value": "{{auth_token}}", + "type": "string" + }, + { + "key": "key", + "value": "Authorization", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "Accept", + "value": "application/json", + "type": "text" + }, + { + "key": "X-Channel-Id", + "value": "{{X-Channel-Id}}", + "type": "text" + }, + { + "key": "Content-Type", + "value": "application/json", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\r\n \"request\": {\r\n \"framework\": {\r\n \"code\": \"Framework_copy_5\"\r\n }\r\n }\r\n}" + }, + "url": { + "raw": "{{host}}/framework/v3/copy/dummy", + "host": [ + "{{host}}" + ], + "path": [ + "framework", + "v3", + "copy", + "dummy" + ] + } + }, + "response": [] + }, + { + "name": "Copy a framework with existing name", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json()\r", + "\r", + "pm.test(\"Status code is 400\", function () {\r", + " pm.response.to.have.status(400);\r", + "});\r", + "\r", + "pm.test(\"Status code name has string\", function () {\r", + " pm.response.to.have.status(\"Bad Request\");\r", + "});\r", + "pm.test(\"id has string - api.taxonomy.framework.copy \", function () {\r", + " pm.expect(jsonResponse.id).to.be.equal(\"api.taxonomy.framework.copy\");\r", + "});\r", + "pm.test(\"Version is 3.0 \", function () {\r", + " pm.expect(jsonResponse.ver).to.be.equal(\"3.0\");\r", + "});\r", + "pm.test(\"Verify keys and data type of the response result\", () => {\r", + " pm.expect(jsonResponse.params).to.have.all.keys('resmsgid','msgid','err','status','errmsg');\r", + " pm.expect(jsonResponse.params.resmsgid).to.be.a(\"String\");\r", + " pm.expect(jsonResponse.params.msgid).to.be.a(\"null\");\r", + " pm.expect(jsonResponse.params.err).to.be.a(\"String\");\r", + " pm.expect(jsonResponse.params.status).to.be.a(\"String\");\r", + " pm.expect(jsonResponse.params.errmsg).to.be.a(\"String\");\r", + " });\r", + "\r", + "pm.test(\"Err has string\", function () {\r", + " pm.expect(jsonResponse.params.err).to.be.equal(\"CONSTRAINT_VALIDATION_FAILED\");\r", + "});\r", + "pm.test(\"Status has string\", function () {\r", + " pm.expect(jsonResponse.params.status).to.be.equal(\"failed\");\r", + "});\r", + "pm.test(`errmsg has string- Object already exists with identifier: ${(pm.collectionVariables.get(\"copy_fw\"))}`, function () {\r", + " pm.expect(jsonResponse.params.errmsg).to.be.equal(`Object already exists with identifier: ${(pm.collectionVariables.get(\"copy_fw\"))}`);\r", + "});\r", + "pm.test(\"responseCode has string\", function () {\r", + " pm.expect(jsonResponse.responseCode).to.be.equal(\"CLIENT_ERROR\");\r", + "});\r", + "\r", + "" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "apikey", + "apikey": [ + { + "key": "in", + "value": "header", + "type": "string" + }, + { + "key": "value", + "value": "{{auth_token}}", + "type": "string" + }, + { + "key": "key", + "value": "Authorization", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "Accept", + "value": "application/json", + "type": "text" + }, + { + "key": "X-Channel-Id", + "value": "{{X-Channel-Id}}", + "type": "text" + }, + { + "key": "Content-Type", + "value": "application/json", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\r\n \"request\": {\r\n \"framework\": {\r\n \"code\": \"{{copy_fw}}\"\r\n }\r\n }\r\n}" + }, + "url": { + "raw": "{{host}}/framework/v3/copy/{{fw5_code}}", + "host": [ + "{{host}}" + ], + "path": [ + "framework", + "v3", + "copy", + "{{fw5_code}}" + ] + } + }, + "response": [] + } + ] + } + ] + }, + { + "name": "Read a Framework", + "item": [ + { + "name": "Pre requisite", + "item": [ + { + "name": "Create Master category", + "event": [ + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + }, + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json()\r", + "\r", + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "\r", + "pm.collectionVariables.set(\"master7_id\",jsonResponse.result.identifier);\r", + "console.log(pm.collectionVariables.get(\"master7_id\"));\r", + "pm.collectionVariables.set(\"master7_node\",jsonResponse.result.node_id);\r", + "console.log(pm.collectionVariables.get(\"master7_node\"));\r", + "\r", + "pm.test(`identifier should be equal to ${pm.collectionVariables.get(\"master7_id\")}`, () => {\r", + " pm.expect(jsonResponse.result.identifier).to.eql(`${pm.collectionVariables.get(\"master7_code\")}`);\r", + "});\r", + "\r", + "pm.test(`node_id should be equal to ${pm.collectionVariables.get(\"master7_node\")}`, () => {\r", + " pm.expect(jsonResponse.result.node_id).to.eql(`${pm.collectionVariables.get(\"master7_code\")}`);\r", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "apikey", + "apikey": [ + { + "key": "value", + "value": "{{auth_token}}", + "type": "string" + }, + { + "key": "key", + "value": "Authorization", + "type": "string" + }, + { + "key": "in", + "value": "header", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "X-Channel-Id", + "value": "{{X-Channel-Id}}" + }, + { + "key": "", + "value": "", + "disabled": true + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"category\": {\n \"name\": \"master\",\n \"code\": \"{{master7_code}}\",\n \"targetIdFieldName\": \"targetmasterIds\",\n \"searchLabelFieldName\": \"se_master\",\n \"searchIdFieldName\": \"se_master\",\n \"orgIdFieldName\": \"masterIds\"\n }\n }\n}" + }, + "url": { + "raw": "{{host}}/framework/v3/category/master/create", + "host": [ + "{{host}}" + ], + "path": [ + "framework", + "v3", + "category", + "master", + "create" + ] + } + }, + "response": [] + }, + { + "name": "Create a framework", + "event": [ + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + }, + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json()\r", + "\r", + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "\r", + "pm.collectionVariables.set(\"fw6_node\",jsonResponse.result.node_id);\r", + "console.log(pm.collectionVariables.get(\"fw6_node\"));\r", + "\r", + "pm.test(`node id should be equal to ${pm.collectionVariables.get(\"fw6_node\")}`, () => {\r", + " pm.expect(jsonResponse.result.node_id).to.eql(pm.collectionVariables.get(\"fw6_code\"));\r", + "});\r", + "\r", + "\r", + "\r", + "" + ], + "type": "text/javascript" + } + } + ], + "protocolProfileBehavior": { + "disabledSystemHeaders": {} + }, + "request": { + "auth": { + "type": "apikey", + "apikey": [ + { + "key": "value", + "value": "{{auth_token}}", + "type": "string" + }, + { + "key": "key", + "value": "Authorization", + "type": "string" + }, + { + "key": "in", + "value": "header", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "description": "(Required) It is the Unique Id to identify the root organisation to which the user belongs", + "key": "X-Channel-Id", + "value": "{{X-Channel-Id}}" + }, + { + "key": "", + "value": "", + "disabled": true + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "", + "type": "text", + "disabled": true + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"framework\": {\n \"name\": \"{{fw6_name}}\",\n \"code\": \"{{fw6_code}}\"\n \n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{host}}/framework/v3/create", + "host": [ + "{{host}}" + ], + "path": [ + "framework", + "v3", + "create" + ] + }, + "description": "This API is associated with creating a new framework on the Sunbird Platform.\n - The endpoint for **Create a Framework** is `/framework/v1/create`\n - It points to knowledge-mw-service - `/v1/framework/create`\n - The fields marked with an asterisk (*) are mandatory. They cannot be null or empty." + }, + "response": [ + { + "name": "OK ! Successful operation.\"create framework\" operation was successfully executed.", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource\n Possible media types can be:- \n - application/json", + "key": "Content-Type", + "value": "Ut enim offici" + }, + { + "description": "(Required) To make use of the API, you require authorization. Raise a request to the administrator for the use of the API. You will receive the authorization key. Specify the key received, here.", + "key": "Authorization", + "value": "Ut enim offici" + }, + { + "description": "(Required) It is the Unique Id to identify the root organisation to which the user belongs", + "key": "X-Channel-Id", + "value": "Ut enim offici" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"framework\": {\n \"name\": \"Framework Name\",\n \"code\": \"dummy_framework\",\n \"channels\": [\n {\n \"identifier\": \"in.ekstep\"\n }\n ]\n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/framework/v1/create", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "framework", + "v1", + "create" + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"api.framework.create\",\n \"ver\": \"1.0\",\n \"ts\": \"2020-12-14T09:49:06.794Z\",\n \"params\": {\n \"resmsgid\": \"9b5d7ca0-3df1-11eb-9ff3-67c41480f6aa\",\n \"msgid\": \"9b4a90e0-3df1-11eb-9ff3-67c41480f6aa\",\n \"status\": \"successful\",\n \"err\": null,\n \"errmsg\": null\n },\n \"responseCode\": \"OK\",\n \"result\": {\n \"node_id\": \"dummy_framework\",\n \"versionKey\": \"1607939346678\"\n }\n}" + }, + { + "name": "BAD REQUEST. The \"create framework\" operation failed ! The possible reason for failure is that you may have missed providing input for a mandatory parameter.", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource\n Possible media types can be:- \n - application/json", + "key": "Content-Type", + "value": "Ut enim offici" + }, + { + "description": "(Required) To make use of the API, you require authorization. Raise a request to the administrator for the use of the API. You will receive the authorization key. Specify the key received, here.", + "key": "Authorization", + "value": "Ut enim offici" + }, + { + "description": "(Required) It is the Unique Id to identify the root organisation to which the user belongs", + "key": "X-Channel-Id", + "value": "Ut enim offici" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"framework\": {\n \"name\": \"Framework Name\",\n \"code\": \"dummy_framework\",\n \"channels\": [\n {\n \"identifier\": \"in.ekstep\"\n }\n ]\n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/framework/v1/create", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "framework", + "v1", + "create" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"api.framework.create\",\n \"ver\": \"1.0\",\n \"ts\": \"2020-12-14T09:50:45.249Z\",\n \"params\": {\n \"resmsgid\": \"d60c8710-3df1-11eb-9ff3-67c41480f6aa\",\n \"msgid\": null,\n \"status\": \"failed\",\n \"err\": \"CONSTRAINT_VALIDATION_FAILED\",\n \"errmsg\": \"Object already exists with identifier: dummy_framework\"\n },\n \"responseCode\": \"CLIENT_ERROR\",\n \"result\": {}\n}" + }, + { + "name": "INTERNAL SERVER ERROR ! Looks like something went wrong! These errors are tracked automatically, but if the problem persists feel free to contact us. In the meantime, try refreshing.", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource\n Possible media types can be:- \n - application/json", + "key": "Content-Type", + "value": "Ut enim offici" + }, + { + "description": "(Required) To make use of the API, you require authorization. Raise a request to the administrator for the use of the API. You will receive the authorization key. Specify the key received, here.", + "key": "Authorization", + "value": "Ut enim offici" + }, + { + "description": "(Required) It is the Unique Id to identify the root organisation to which the user belongs", + "key": "X-Channel-Id", + "value": "Ut enim offici" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"framework\": {\n \"name\": \"Framework Name\",\n \"code\": \"dummy_framework\",\n \"channels\": [\n {\n \"identifier\": \"in.ekstep\"\n }\n ]\n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/framework/v1/create", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "framework", + "v1", + "create" + ] + } + }, + "status": "Internal Server Error", + "code": 500, + "_postman_previewlanguage": "text", + "header": [ + { + "key": "Content-Type", + "value": "text/plain" + } + ], + "cookie": [], + "body": "" + } + ] + }, + { + "name": "Link the framework to the category", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json()\r", + "\r", + "pm.collectionVariables.set(\"fwcat_cat2\",jsonResponse.result.identifier);\r", + "console.log(pm.collectionVariables.get(\"fwcat_cat2\"));\r", + "\r", + "pm.test(`identifier should be equal to ${pm.collectionVariables.get(\"fwcat_cat2\")}`, () => {\r", + " pm.expect(jsonResponse.result.identifier).to.eql(`${pm.collectionVariables.get(\"fw6_code\")}_${pm.collectionVariables.get(\"master7_code\")}`);\r", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "X-Channel-Id", + "value": "{{X-Channel-Id}}" + }, + { + "key": "Authorization", + "value": "" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"category\": {\n \"name\": \"Board\",\n \"code\": \"{{master7_code}}\",\n \"description\":\"Board category\"\n }\n }\n}" + }, + "url": { + "raw": "{{host}}/framework/v3/category/create?framework={{fw6_code}}", + "host": [ + "{{host}}" + ], + "path": [ + "framework", + "v3", + "category", + "create" + ], + "query": [ + { + "key": "framework", + "value": "{{fw6_code}}" + } + ] + } + }, + "response": [] + }, + { + "name": "Publish a valid Framework Copy", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json()\r", + "\r", + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "pm.test(\"id has string - api.taxonomy.framework.publish \", function () {\r", + " pm.expect(jsonResponse.id).to.be.equal(\"api.taxonomy.framework.publish\");\r", + "});\r", + "pm.test(\"Version is 3.0 \", function () {\r", + " pm.expect(jsonResponse.ver).to.be.equal(\"3.0\");\r", + "});\r", + "pm.test(\"Verify keys and data type of the response result\", () => {\r", + " pm.expect(jsonResponse.params).to.have.all.keys('resmsgid','msgid','err','status','errmsg');\r", + " pm.expect(jsonResponse.params.resmsgid).to.be.a(\"String\");\r", + " pm.expect(jsonResponse.params.msgid).to.be.a(\"null\");\r", + " pm.expect(jsonResponse.params.err).to.be.a(\"null\");\r", + " pm.expect(jsonResponse.params.status).to.be.a(\"String\");\r", + " pm.expect(jsonResponse.params.errmsg).to.be.a(\"null\");\r", + " });\r", + "\r", + "pm.test(\"responseCode has string\", function () {\r", + " pm.expect(jsonResponse.responseCode).to.be.equal(\"OK\");\r", + "});\r", + "\r", + "\r", + "pm.test(`publishStatus has string: Publish Event for Framework Id ${pm.collectionVariables.get(\"fw6_code\")} is pushed Successfully!`, function () {\r", + " pm.expect(jsonResponse.result.publishStatus).to.eql(`Publish Event for Framework Id '${pm.collectionVariables.get(\"fw6_code\")}' is pushed Successfully!`);\r", + "});\r", + "\r", + "\r", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "apikey", + "apikey": [ + { + "key": "value", + "value": "{{auth_token}}", + "type": "string" + }, + { + "key": "key", + "value": "Authorization", + "type": "string" + }, + { + "key": "in", + "value": "header", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "description": "(Required) It is the Unique Id to identify the root organisation to which the user belongs", + "key": "X-Channel-Id", + "value": "{{X-Channel-Id}}" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{host}}/framework/v3/publish/{{fw6_code}}", + "host": [ + "{{host}}" + ], + "path": [ + "framework", + "v3", + "publish", + "{{fw6_code}}" + ] + }, + "description": "This API is associated with publishing a framework\n - The endpoint for **Publish Framework** is `/framework/v1/publish/{ID}`\n - It points to knowledge-mw-service - `/v1/framework/publish/{ID}`\n - The fields marked with an asterisk (*) are mandatory. They cannot be null or empty." + }, + "response": [ + { + "name": "OK ! Successful operation.\"Publish framework\" operation was successfully executed.", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "The Content Type entity is the media type of the resource.\n Possible media types can be:- \n - application/json", + "key": "Content-Type", + "value": "Ut enim offici" + }, + { + "description": "(Required) To make use of the API, you require authorization. Raise a request to the administrator for the use of the API. You will receive the authorization key. Specify the key received, here.", + "key": "Authorization", + "value": "Ut enim offici" + }, + { + "description": "(Required) It is the Unique Id to identify the root organisation to which the user belongs", + "key": "X-Channel-Id", + "value": "Ut enim offici" + } + ], + "body": { + "mode": "raw", + "raw": "{}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/framework/v1/publish/:ID", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "framework", + "v1", + "publish", + ":ID" + ], + "variable": [ + { + "key": "ID", + "value": "Ut enim offici", + "description": "(Required) The identifier of the framework to be published" + } + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"api.framework.publish\",\n \"ver\": \"1.0\",\n \"ts\": \"2020-12-14T10:07:54.648Z\",\n \"params\": {\n \"resmsgid\": \"3b9e5980-3df4-11eb-9ff3-67c41480f6aa\",\n \"msgid\": \"3b9cabd0-3df4-11eb-9ff3-67c41480f6aa\",\n \"status\": \"successful\",\n \"err\": null,\n \"errmsg\": null\n },\n \"responseCode\": \"OK\",\n \"result\": {\n \"publishStatus\": \"Publish Operation for Framework Id 'dummy_framework' Started Successfully!\"\n }\n}" + }, + { + "name": "BAD REQUEST. The \"Publish Framework\" operation failed ! The possible reason for failure is that you may have missed providing input for a mandatory parameter.", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "The Content Type entity is the media type of the resource.\n Possible media types can be:- \n - application/json", + "key": "Content-Type", + "value": "Ut enim offici" + }, + { + "description": "(Required) To make use of the API, you require authorization. Raise a request to the administrator for the use of the API. You will receive the authorization key. Specify the key received, here.", + "key": "Authorization", + "value": "Ut enim offici" + }, + { + "description": "(Required) It is the Unique Id to identify the root organisation to which the user belongs", + "key": "X-Channel-Id", + "value": "Ut enim offici" + } + ], + "body": { + "mode": "raw", + "raw": "{}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/framework/v1/publish/:ID", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "framework", + "v1", + "publish", + ":ID" + ], + "variable": [ + { + "key": "ID", + "value": "Ut enim offici", + "description": "(Required) The identifier of the framework to be published" + } + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"api.framework.publish\",\n \"ver\": \"1.0\",\n \"ts\": \"2020-12-14T10:08:19.872Z\",\n \"params\": {\n \"resmsgid\": \"4aa73a00-3df4-11eb-9ff3-67c41480f6aa\",\n \"msgid\": null,\n \"status\": \"failed\",\n \"err\": \"ERR_INVALID_FRAMEOWRK_ID\",\n \"errmsg\": \"Invalid Framework Id. Framework doesn't exist.\"\n },\n \"responseCode\": \"CLIENT_ERROR\",\n \"result\": {}\n}" + }, + { + "name": "INTERNAL SERVER ERROR ! Looks like something went wrong! These errors are tracked automatically, but if the problem persists feel free to contact us. In the meantime, try refreshing.", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "The Content Type entity is the media type of the resource.\n Possible media types can be:- \n - application/json", + "key": "Content-Type", + "value": "Ut enim offici" + }, + { + "description": "(Required) To make use of the API, you require authorization. Raise a request to the administrator for the use of the API. You will receive the authorization key. Specify the key received, here.", + "key": "Authorization", + "value": "Ut enim offici" + }, + { + "description": "(Required) It is the Unique Id to identify the root organisation to which the user belongs", + "key": "X-Channel-Id", + "value": "Ut enim offici" + } + ], + "body": { + "mode": "raw", + "raw": "{}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/framework/v1/publish/:ID", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "framework", + "v1", + "publish", + ":ID" + ], + "variable": [ + { + "key": "ID", + "value": "Ut enim offici", + "description": "(Required) The identifier of the framework to be published" + } + ] + } + }, + "status": "Internal Server Error", + "code": 500, + "_postman_previewlanguage": "text", + "header": [ + { + "key": "Content-Type", + "value": "text/plain" + } + ], + "cookie": [], + "body": "" + } + ] + } + ] + }, + { + "name": "Positive", + "item": [ + { + "name": "Read a valid Live framework", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json();\r", + "\r", + "pm.test('Status code is 200', function () {\r", + " pm.response.to.have.status(200);\r", + "})\r", + "\r", + "pm.test('id has string - api.taxonomy.framework.read', function () {\r", + " pm.expect(jsonResponse.id).to.be.equal('api.taxonomy.framework.read');\r", + "})\r", + "\r", + "pm.test('Version is 3.0 ', function () {\r", + " pm.expect(jsonResponse.ver).to.be.equal('3.0');\r", + "})\r", + "\r", + "pm.test(\"Verify keys and data type of the response result\", () => {\r", + " pm.expect(jsonResponse.result.framework).to.have.all.keys('identifier','lastStatusChangedOn','code','channel','languageCode','type','createdOn','objectType','versionKey','systemDefault','name','lastUpdatedOn','status','categories');\r", + " pm.expect(jsonResponse.result.framework.identifier).to.be.a(\"String\");\r", + " pm.expect(jsonResponse.result.framework.lastStatusChangedOn).to.be.a(\"String\");\r", + " pm.expect(jsonResponse.result.framework.code).to.be.a(\"String\");\r", + " pm.expect(jsonResponse.result.framework.channel).to.be.a(\"String\");\r", + " pm.expect(jsonResponse.result.framework.languageCode).to.be.a('array');\r", + " pm.expect(jsonResponse.result.framework.type).to.be.a(\"String\");\r", + " pm.expect(jsonResponse.result.framework.createdOn).to.be.a(\"String\");\r", + " pm.expect(jsonResponse.result.framework.objectType).to.be.a(\"String\");\r", + " pm.expect(jsonResponse.result.framework.versionKey).to.be.a(\"String\");\r", + " pm.expect(jsonResponse.result.framework.systemDefault).to.be.a(\"String\");\r", + " pm.expect(jsonResponse.result.framework.name).to.be.a(\"String\");\r", + " pm.expect(jsonResponse.result.framework.lastUpdatedOn).to.be.a(\"String\");\r", + " pm.expect(jsonResponse.result.framework.status).to.be.a(\"String\");\r", + "\r", + " const requiredKeys = ['identifier', 'lastStatusChangedOn', 'code', 'channel', 'description', 'index', 'languageCode', 'createdOn', 'versionKey', 'objectType', 'framework', 'name', 'lastUpdatedOn', 'status'];\r", + " // Loop through each category and verify the keys\r", + " jsonResponse.result.framework.categories.forEach(category => {\r", + " requiredKeys.forEach(key => {\r", + " pm.expect(category).to.have.property(key);\r", + " });\r", + " });\r", + "});\r", + "\r", + "pm.test('Status has string Live ', function () {\r", + " pm.expect(jsonResponse.result.framework.status).to.be.equal('Live');\r", + "})\r", + "\r", + "" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "pm.globals.get(\"name_fw\");" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "apikey", + "apikey": [ + { + "key": "value", + "value": "{{auth_token}}", + "type": "string" + }, + { + "key": "key", + "value": "Authorization", + "type": "string" + }, + { + "key": "in", + "value": "header", + "type": "string" + } + ] + }, + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "X-Channel-Id", + "value": "{{X-Channel-Id}}", + "type": "text" + }, + { + "key": "Content-Type", + "value": "application/json", + "type": "text" + } + ], + "url": { + "raw": "{{host}}/framework/v3/read/{{fw6_code}}", + "host": [ + "{{host}}" + ], + "path": [ + "framework", + "v3", + "read", + "{{fw6_code}}" + ] + }, + "description": "This API is associated with fetching a specific framework\n - The endpoint for **Get a Framework** is `/framework/v1/read/{ID}`\n - It points to knowledge-mw-service - `/v1/framework/read/{ID}`\n - The fields marked with an asterisk (*) are mandatory. They cannot be null or empty." + }, + "response": [ + { + "name": "OK ! Successful operation.\"read framework\" operation was successfully executed.", + "originalRequest": { + "method": "GET", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + } + ], + "url": { + "raw": "{{baseUrl}}/framework/v1/read/:ID", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "framework", + "v1", + "read", + ":ID" + ], + "variable": [ + { + "key": "ID", + "value": "Ut enim offici", + "description": "(Required) The identifier of the framework to be fetched" + } + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"api.framework.read\",\n \"ver\": \"1.0\",\n \"ts\": \"2020-12-14T19:51:24ZZ\",\n \"params\": {\n \"resmsgid\": \"28f10a2a-ce6c-4dbe-a733-4c193013e84b\",\n \"msgid\": null,\n \"err\": null,\n \"status\": \"successful\",\n \"errmsg\": null\n },\n \"responseCode\": \"OK\",\n \"result\": {\n \"framework\": {\n \"identifier\": \"dummy_framework\",\n \"code\": \"Dumy framework updated\",\n \"name\": \"Framework Name\",\n \"description\": \"Dumy framework updated\",\n \"categories\": [\n {\n \"identifier\": \"dummy_framework_subject\",\n \"code\": \"subject\",\n \"terms\": [\n {\n \"identifier\": \"dummy_framework_subject_english\",\n \"code\": \"english\",\n \"translations\": null,\n \"name\": \"English\",\n \"description\": \"English\",\n \"index\": 1,\n \"category\": \"subject\",\n \"status\": \"Live\"\n }\n ],\n \"translations\": null,\n \"name\": \"Subject\",\n \"description\": \"Updated description\",\n \"index\": 1,\n \"status\": \"Live\"\n },\n {\n \"identifier\": \"dummy_framework_medium\",\n \"code\": \"medium\",\n \"translations\": null,\n \"name\": \"Medium\",\n \"description\": \"Medium\",\n \"index\": 2,\n \"status\": \"Live\"\n }\n ],\n \"type\": \"K-12\",\n \"objectType\": \"Framework\"\n }\n }\n}" + }, + { + "name": "BAD REQUEST. The \"read framework\" operation failed ! The possible reason for failure is that you may have missed providing input for a mandatory parameter.", + "originalRequest": { + "method": "GET", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + } + ], + "url": { + "raw": "{{baseUrl}}/framework/v1/read/:ID", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "framework", + "v1", + "read", + ":ID" + ], + "variable": [ + { + "key": "ID", + "value": "Ut enim offici", + "description": "(Required) The identifier of the framework to be fetched" + } + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"ts\": 87966182,\n \"id\": \"laboris q\",\n \"params\": {\n \"msgid\": \"do est non incididunt\",\n \"resmsgid\": \"sint Excepteur sunt\",\n \"status\": \"successful\",\n \"err\": \"nisi magna eu\",\n \"errmsg\": \"velit\"\n },\n \"ver\": \"cupidatat exercitation elit\",\n \"responseCode\": \"do et cillum\",\n \"result\": {}\n}" + }, + { + "name": "RESOURCE NOT FOUND. The \"read framework\" operation failed ! The possible reason for failure is that you may have passed invalid framework id.", + "originalRequest": { + "method": "GET", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + } + ], + "url": { + "raw": "{{baseUrl}}/framework/v1/read/:ID", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "framework", + "v1", + "read", + ":ID" + ], + "variable": [ + { + "key": "ID", + "value": "Ut enim offici", + "description": "(Required) The identifier of the framework to be fetched" + } + ] + } + }, + "status": "Not Found", + "code": 404, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"api.framework.read\",\n \"ver\": \"1.0\",\n \"ts\": \"2020-12-14T10:00:12.540Z\",\n \"params\": {\n \"resmsgid\": \"282e43c0-3df3-11eb-9ff3-67c41480f6aa\",\n \"msgid\": null,\n \"status\": \"failed\",\n \"err\": \"ERR_DATA_NOT_FOUND\",\n \"errmsg\": \"Data not found with id : dummy_framework1\"\n },\n \"responseCode\": \"RESOURCE_NOT_FOUND\",\n \"result\": {}\n}" + }, + { + "name": "INTERNAL SERVER ERROR ! Looks like something went wrong! These errors are tracked automatically, but if the problem persists feel free to contact us. In the meantime, try refreshing.", + "originalRequest": { + "method": "GET", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + } + ], + "url": { + "raw": "{{baseUrl}}/framework/v1/read/:ID", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "framework", + "v1", + "read", + ":ID" + ], + "variable": [ + { + "key": "ID", + "value": "Ut enim offici", + "description": "(Required) The identifier of the framework to be fetched" + } + ] + } + }, + "status": "Internal Server Error", + "code": 500, + "_postman_previewlanguage": "text", + "header": [ + { + "key": "Content-Type", + "value": "text/plain" + } + ], + "cookie": [], + "body": "" + } + ] + }, + { + "name": "Read a retired framewrok", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json()\r", + "\r", + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "pm.test(\"id has string - api.taxonomy.framework.read\", function () {\r", + " pm.expect(jsonResponse.id).to.be.equal(\"api.taxonomy.framework.read\");\r", + "});\r", + "pm.test(\"Version is 3.0 \", function () {\r", + " pm.expect(jsonResponse.ver).to.be.equal(\"3.0\");\r", + "});\r", + "// pm.test(\"Verify keys and data type of the response result\", () => {\r", + "// pm.expect(jsonResponse.result.framework).to.have.all.keys('identifier','lastStatusChangedOn','code','channel','languageCode','type','createdOn','objectType','versionKey','systemDefault','name','lastUpdatedOn','status','description');\r", + "// pm.expect(jsonResponse.result.framework.identifier).to.be.a(\"String\");\r", + "// pm.expect(jsonResponse.result.framework.lastStatusChangedOn).to.be.a(\"String\");\r", + "// pm.expect(jsonResponse.result.framework.code).to.be.a(\"String\");\r", + "// //pm.expect(jsonResponse.result.framework.consumerId).to.be.a(\"String\");\r", + "// pm.expect(jsonResponse.result.framework.channel).to.be.a(\"String\");\r", + "// pm.expect(jsonResponse.result.framework.languageCode).to.be.a('array');\r", + "// pm.expect(jsonResponse.result.framework.type).to.be.a(\"String\");\r", + "// pm.expect(jsonResponse.result.framework.createdOn).to.be.a(\"String\");\r", + "// pm.expect(jsonResponse.result.framework.objectType).to.be.a(\"String\");\r", + "// pm.expect(jsonResponse.result.framework.versionKey).to.be.a(\"String\");\r", + "// pm.expect(jsonResponse.result.framework.systemDefault).to.be.a(\"String\");\r", + "// pm.expect(jsonResponse.result.framework.name).to.be.a(\"String\");\r", + "// pm.expect(jsonResponse.result.framework.lastUpdatedOn).to.be.a(\"String\");\r", + "// pm.expect(jsonResponse.result.framework.status).to.be.a(\"String\");\r", + "// });\r", + "\r", + "pm.test(\"Verify keys and data type of the response result\", () => {\r", + " pm.expect(jsonResponse.result.framework).to.have.all.keys('identifier', 'lastStatusChangedOn', 'code','channel', 'type','languageCode','createdOn', 'objectType', 'versionKey', 'systemDefault', 'name', 'lastUpdatedOn', 'status');\r", + "pm.expect(jsonResponse.result.framework.code).to.be.equal(pm.collectionVariables.get(\"fw4_code\"));\r", + "});\r", + "\r", + "pm.test(\"Status has string Retired\", function () {\r", + " pm.expect(jsonResponse.result.framework.status).to.be.equal(\"Retired\");\r", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json", + "type": "text" + }, + { + "key": "Content-Type", + "value": "application/json", + "type": "text" + }, + { + "key": "X-Channel-Id", + "value": "{{X-Channel-Id}}", + "type": "text" + } + ], + "url": { + "raw": "{{host}}/framework/v3/read/{{fw4_code}}", + "host": [ + "{{host}}" + ], + "path": [ + "framework", + "v3", + "read", + "{{fw4_code}}" + ] + } + }, + "response": [] + } + ] + }, + { + "name": "Negative", + "item": [ + { + "name": "Read an invalid framework", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json()\r", + "\r", + "pm.test(\"Status code is 404\", function () {\r", + " pm.response.to.have.status(404);\r", + "});\r", + "\r", + "pm.test(\"Status code name has string\", function () {\r", + " pm.response.to.have.status(\"Not Found\");\r", + "});\r", + "\r", + "pm.test(\"Verify keys and data type of the response result\", () => {\r", + " pm.expect(jsonResponse.params).to.have.all.keys('resmsgid','msgid','err','status','errmsg');\r", + " pm.expect(jsonResponse.params.resmsgid).to.be.a(\"String\");\r", + " pm.expect(jsonResponse.params.msgid).to.be.a(\"null\");\r", + " pm.expect(jsonResponse.params.err).to.be.a(\"String\");\r", + " pm.expect(jsonResponse.params.status).to.be.a(\"String\");\r", + " pm.expect(jsonResponse.params.errmsg).to.be.a(\"String\");\r", + " });\r", + "\r", + "pm.test(\"Err has string\", function () {\r", + " pm.expect(jsonResponse.params.err).to.be.equal(\"NOT_FOUND\");\r", + "});\r", + "pm.test(\"Status has string\", function () {\r", + " pm.expect(jsonResponse.params.status).to.be.equal(\"failed\");\r", + "});\r", + "pm.test(\"errmsg has string\", function () {\r", + " pm.expect(jsonResponse.params.errmsg).to.be.equal(\"Error! Node(s) doesn't Exists. | [Invalid Node Id.]: invalid_fw\");\r", + "});\r", + "pm.test(\"responseCode has string\", function () {\r", + " pm.expect(jsonResponse.responseCode).to.be.equal(\"RESOURCE_NOT_FOUND\");\r", + "});\r", + "\r", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "apikey", + "apikey": [ + { + "key": "value", + "value": "{{auth_token}}", + "type": "string" + }, + { + "key": "key", + "value": "Authorization", + "type": "string" + }, + { + "key": "in", + "value": "header", + "type": "string" + } + ] + }, + "method": "GET", + "header": [ + { + "key": "X-Channel-Id", + "value": "{{X-Channel-Id}}", + "type": "text" + } + ], + "url": { + "raw": "{{host}}/framework/v3/read/invalid_fw", + "host": [ + "{{host}}" + ], + "path": [ + "framework", + "v3", + "read", + "invalid_fw" + ] + } + }, + "response": [] + } + ] + } + ] + }, + { + "name": "Delete data", + "item": [ + { + "name": "Delete framework", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json()\r", + "\r", + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "\r", + "pm.collectionVariables.set(\"fw1_node\",jsonResponse.result.node_id);\r", + "console.log(pm.collectionVariables.get(\"fw1_node\"));\r", + "\r", + "pm.test(`node id should be equal to ${pm.collectionVariables.get(\"fw1_node\")}`, () => {\r", + " pm.expect(jsonResponse.result.node_id).to.eql(pm.collectionVariables.get(\"fw1_code\"));\r", + "});\r", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "apikey", + "apikey": [ + { + "key": "in", + "value": "header", + "type": "string" + }, + { + "key": "value", + "value": "{{auth_token}}", + "type": "string" + }, + { + "key": "key", + "value": "Authorization", + "type": "string" + } + ] + }, + "method": "DELETE", + "header": [ + { + "key": "X-Channel-Id", + "value": "{{X-Channel-Id}}", + "type": "text" + }, + { + "key": "Accept", + "value": "application/json", + "type": "text" + }, + { + "key": "Content-Type", + "value": "application/json", + "type": "text" + } + ], + "url": { + "raw": "{{host}}/framework/v3/retire/{{fw1_code}}", + "host": [ + "{{host}}" + ], + "path": [ + "framework", + "v3", + "retire", + "{{fw1_code}}" + ] + } + }, + "response": [] + }, + { + "name": "Delete framework", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json()\r", + "\r", + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "pm.collectionVariables.set(\"fw2_node\",jsonResponse.result.node_id);\r", + "console.log(pm.collectionVariables.get(\"fw2_node\"));\r", + "\r", + "pm.test(`node id should be equal to ${pm.collectionVariables.get(\"fw2_node\")}`, () => {\r", + " pm.expect(jsonResponse.result.node_id).to.eql(pm.collectionVariables.get(\"fw2_code\"));\r", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "apikey", + "apikey": [ + { + "key": "in", + "value": "header", + "type": "string" + }, + { + "key": "value", + "value": "{{auth_token}}", + "type": "string" + }, + { + "key": "key", + "value": "Authorization", + "type": "string" + } + ] + }, + "method": "DELETE", + "header": [ + { + "key": "X-Channel-Id", + "value": "{{X-Channel-Id}}", + "type": "text" + }, + { + "key": "Accept", + "value": "application/json", + "type": "text" + }, + { + "key": "Content-Type", + "value": "application/json", + "type": "text" + } + ], + "url": { + "raw": "{{host}}/framework/v3/retire/{{fw2_code}}", + "host": [ + "{{host}}" + ], + "path": [ + "framework", + "v3", + "retire", + "{{fw2_code}}" + ] + } + }, + "response": [] + }, + { + "name": "Delete framework", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json()\r", + "\r", + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "pm.collectionVariables.set(\"fw3_node\",jsonResponse.result.node_id);\r", + "console.log(pm.collectionVariables.get(\"fw3_node\"));\r", + "\r", + "pm.test(`node id should be equal to ${pm.collectionVariables.get(\"fw3_node\")}`, () => {\r", + " pm.expect(jsonResponse.result.node_id).to.eql(pm.collectionVariables.get(\"fw3_code\"));\r", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "apikey", + "apikey": [ + { + "key": "in", + "value": "header", + "type": "string" + }, + { + "key": "value", + "value": "{{auth_token}}", + "type": "string" + }, + { + "key": "key", + "value": "Authorization", + "type": "string" + } + ] + }, + "method": "DELETE", + "header": [ + { + "key": "X-Channel-Id", + "value": "{{X-Channel-Id}}", + "type": "text" + }, + { + "key": "Accept", + "value": "application/json", + "type": "text" + }, + { + "key": "Content-Type", + "value": "application/json", + "type": "text" + } + ], + "url": { + "raw": "{{host}}/framework/v3/retire/{{fw3_code}}", + "host": [ + "{{host}}" + ], + "path": [ + "framework", + "v3", + "retire", + "{{fw3_code}}" + ] + } + }, + "response": [] + }, + { + "name": "Delete master category", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json()\r", + "\r", + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "pm.collectionVariables.set(\"master6_node\",jsonResponse.result.node_id);\r", + "console.log(pm.collectionVariables.get(\"master6_node\"));\r", + "\r", + "pm.collectionVariables.set(\"master6_id\",jsonResponse.result.node_id);\r", + "console.log(pm.collectionVariables.get(\"master6_id\"));\r", + "\r", + "pm.test(`identifier should be equal to ${pm.collectionVariables.get(\"master6_id\")}`, () => {\r", + " pm.expect(jsonResponse.result.identifier).to.eql(`${pm.collectionVariables.get(\"master6_code\")}`);\r", + "});\r", + "\r", + "pm.test(`node_id should be equal to ${pm.collectionVariables.get(\"master6_node\")}`, () => {\r", + " pm.expect(jsonResponse.result.node_id).to.eql(`${pm.collectionVariables.get(\"master6_code\")}`);\r", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "apikey", + "apikey": [ + { + "key": "value", + "value": "{{auth_token}}", + "type": "string" + }, + { + "key": "key", + "value": "Authorization", + "type": "string" + }, + { + "key": "in", + "value": "header", + "type": "string" + } + ] + }, + "method": "DELETE", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "X-Channel-Id", + "value": "{{X-Channel-Id}}" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "url": { + "raw": "{{host}}/framework/v3/category/master/retire/{{master6_code}}", + "host": [ + "{{host}}" + ], + "path": [ + "framework", + "v3", + "category", + "master", + "retire", + "{{master6_code}}" + ] + } + }, + "response": [] + }, + { + "name": "Delete framework", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json()\r", + "\r", + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "pm.collectionVariables.set(\"fw5_node\",jsonResponse.result.node_id);\r", + "console.log(pm.collectionVariables.get(\"fw5_node\"));\r", + "\r", + "pm.test(`node id should be equal to ${pm.collectionVariables.get(\"fw5_node\")}`, () => {\r", + " pm.expect(jsonResponse.result.node_id).to.eql(pm.collectionVariables.get(\"fw5_code\"));\r", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "apikey", + "apikey": [ + { + "key": "in", + "value": "header", + "type": "string" + }, + { + "key": "value", + "value": "{{auth_token}}", + "type": "string" + }, + { + "key": "key", + "value": "Authorization", + "type": "string" + } + ] + }, + "method": "DELETE", + "header": [ + { + "key": "X-Channel-Id", + "value": "{{X-Channel-Id}}", + "type": "text" + }, + { + "key": "Accept", + "value": "application/json", + "type": "text" + }, + { + "key": "Content-Type", + "value": "application/json", + "type": "text" + } + ], + "url": { + "raw": "{{host}}/framework/v3/retire/{{fw5_code}}", + "host": [ + "{{host}}" + ], + "path": [ + "framework", + "v3", + "retire", + "{{fw5_code}}" + ] + } + }, + "response": [] + }, + { + "name": "Delete framework category", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json()\r", + "\r", + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "\r", + "pm.collectionVariables.set(\"fw_catgry\",jsonResponse.result.identifier);\r", + "console.log(pm.collectionVariables.get(\"fw_catgry\"));\r", + "\r", + "pm.test(`identifier should be equal to ${pm.collectionVariables.get(\"fw_catgry\")}`, () => {\r", + " pm.expect(jsonResponse.result.identifier).to.eql(`${pm.collectionVariables.get(\"fw5_code\")}_${pm.collectionVariables.get(\"master6_code\")}`);\r", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "DELETE", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "X-Channel-Id", + "value": "sunbird" + } + ], + "url": { + "raw": "{{host}}/framework/v3/category/retire/{{master6_code}}?framework={{fw5_code}}", + "host": [ + "{{host}}" + ], + "path": [ + "framework", + "v3", + "category", + "retire", + "{{master6_code}}" + ], + "query": [ + { + "key": "framework", + "value": "{{fw5_code}}" + } + ] + } + }, + "response": [] + }, + { + "name": "Delete framework", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json()\r", + "\r", + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "pm.collectionVariables.set(\"copy_node\",jsonResponse.result.node_id);\r", + "console.log(pm.collectionVariables.get(\"copy_node\"));\r", + "\r", + "pm.test(`node id should be equal to ${pm.collectionVariables.get(\"copy_node\")}`, () => {\r", + " pm.expect(jsonResponse.result.node_id).to.eql(pm.collectionVariables.get(\"copy_fw\"));\r", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "apikey", + "apikey": [ + { + "key": "in", + "value": "header", + "type": "string" + }, + { + "key": "value", + "value": "{{auth_token}}", + "type": "string" + }, + { + "key": "key", + "value": "Authorization", + "type": "string" + } + ] + }, + "method": "DELETE", + "header": [ + { + "key": "X-Channel-Id", + "value": "{{X-Channel-Id}}", + "type": "text" + }, + { + "key": "Accept", + "value": "application/json", + "type": "text" + }, + { + "key": "Content-Type", + "value": "application/json", + "type": "text" + } + ], + "url": { + "raw": "{{host}}/framework/v3/retire/{{copy_fw}}", + "host": [ + "{{host}}" + ], + "path": [ + "framework", + "v3", + "retire", + "{{copy_fw}}" + ] + } + }, + "response": [] + }, + { + "name": "Delete master category", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json()\r", + "\r", + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "pm.collectionVariables.set(\"master7_node\",jsonResponse.result.node_id);\r", + "console.log(pm.collectionVariables.get(\"master7_node\"));\r", + "\r", + "pm.collectionVariables.set(\"master7_id\",jsonResponse.result.node_id);\r", + "console.log(pm.collectionVariables.get(\"master7_id\"));\r", + "\r", + "pm.test(`identifier should be equal to ${pm.collectionVariables.get(\"master7_id\")}`, () => {\r", + " pm.expect(jsonResponse.result.identifier).to.eql(`${pm.collectionVariables.get(\"master7_code\")}`);\r", + "});\r", + "\r", + "pm.test(`node_id should be equal to ${pm.collectionVariables.get(\"master7_node\")}`, () => {\r", + " pm.expect(jsonResponse.result.node_id).to.eql(`${pm.collectionVariables.get(\"master7_code\")}`);\r", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "apikey", + "apikey": [ + { + "key": "value", + "value": "{{auth_token}}", + "type": "string" + }, + { + "key": "key", + "value": "Authorization", + "type": "string" + }, + { + "key": "in", + "value": "header", + "type": "string" + } + ] + }, + "method": "DELETE", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "X-Channel-Id", + "value": "{{X-Channel-Id}}" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "url": { + "raw": "{{host}}/framework/v3/category/master/retire/{{master7_code}}", + "host": [ + "{{host}}" + ], + "path": [ + "framework", + "v3", + "category", + "master", + "retire", + "{{master7_code}}" + ] + } + }, + "response": [] + }, + { + "name": "Delete framework", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json()\r", + "\r", + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "pm.collectionVariables.set(\"fw6_node\",jsonResponse.result.node_id);\r", + "console.log(pm.collectionVariables.get(\"fw6_node\"));\r", + "\r", + "pm.test(`node id should be equal to ${pm.collectionVariables.get(\"fw6_node\")}`, () => {\r", + " pm.expect(jsonResponse.result.node_id).to.eql(pm.collectionVariables.get(\"fw6_code\"));\r", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "apikey", + "apikey": [ + { + "key": "in", + "value": "header", + "type": "string" + }, + { + "key": "value", + "value": "{{auth_token}}", + "type": "string" + }, + { + "key": "key", + "value": "Authorization", + "type": "string" + } + ] + }, + "method": "DELETE", + "header": [ + { + "key": "X-Channel-Id", + "value": "{{X-Channel-Id}}", + "type": "text" + }, + { + "key": "Accept", + "value": "application/json", + "type": "text" + }, + { + "key": "Content-Type", + "value": "application/json", + "type": "text" + } + ], + "url": { + "raw": "{{host}}/framework/v3/retire/{{fw6_code}}", + "host": [ + "{{host}}" + ], + "path": [ + "framework", + "v3", + "retire", + "{{fw6_code}}" + ] + } + }, + "response": [] + }, + { + "name": "Delete framework category", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json()\r", + "\r", + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "\r", + "pm.collectionVariables.set(\"fw_catgry\",jsonResponse.result.identifier);\r", + "console.log(pm.collectionVariables.get(\"fw_catgry\"));\r", + "\r", + "pm.test(`identifier should be equal to ${pm.collectionVariables.get(\"fw_catgry\")}`, () => {\r", + " pm.expect(jsonResponse.result.identifier).to.eql(`${pm.collectionVariables.get(\"fw6_code\")}_${pm.collectionVariables.get(\"master7_code\")}`);\r", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "DELETE", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "X-Channel-Id", + "value": "sunbird" + } + ], + "url": { + "raw": "{{host}}/framework/v3/category/retire/{{master7_code}}?framework={{fw6_code}}", + "host": [ + "{{host}}" + ], + "path": [ + "framework", + "v3", + "category", + "retire", + "{{master7_code}}" + ], + "query": [ + { + "key": "framework", + "value": "{{fw6_code}}" + } + ] + } + }, + "response": [] + } + ] + } + ], + "description": "1. Each time before running the folder, unique name should be given for the framework for create framework API (in the pre requisite folder as well)\n \n2. Framework should be associated with a framework category before publishing the framework (which is dependent on master category)\n \n3. In the pre requisite, maste caretgory and framework category should be updated before running the collection", + "event": [ + { + "listen": "prerequest", + "script": { + "type": "text/javascript", + "exec": [ + "//Scenario-1", + "pm.collectionVariables.set(\"fw1_name\", \"fw1_name\");", + "pm.collectionVariables.set(\"fw1_code\", \"fw1_code8\");", + "//Scenario-1", + "pm.collectionVariables.set(\"fw2_name\", \"fw2_name\");", + "pm.collectionVariables.set(\"fw2_code\", \"fw2_code6\");", + "//Scenario-2", + "pm.collectionVariables.set(\"fw3_name\", \"fw3_name\");", + "pm.collectionVariables.set(\"fw3_code\", \"fw3_code7\");", + "//Scenario-3", + "pm.collectionVariables.set(\"fw4_name\", \"fw4_name\");", + "pm.collectionVariables.set(\"fw4_code\", \"fw4_code9\");", + "//Scenarion-4", + "pm.collectionVariables.set(\"master6_code\", \"master6_cat_7\");", + "pm.collectionVariables.set(\"fw5_name\", \"fw5_name\");", + "pm.collectionVariables.set(\"fw5_code\", \"fw5_code9\");", + "//Scenario-4", + "pm.collectionVariables.set(\"copy_fw\", \"copy_fw5\");", + "//Scenario-6", + "pm.collectionVariables.set(\"master7_code\", \"master7_cat_5\");", + "pm.collectionVariables.set(\"fw6_name\", \"fw6_name\");", + "pm.collectionVariables.set(\"fw6_code\", \"fw6_code6\");", + "" + ] + } + }, + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "" + ] + } + } + ] + }, + { + "name": "Framework Category", + "item": [ + { + "name": "Create framework category", + "item": [ + { + "name": "Pre requisite", + "item": [ + { + "name": "Create a master category", + "event": [ + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + }, + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json()\r", + "\r", + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "\r", + "pm.collectionVariables.set(\"master8_id\",jsonResponse.result.identifier);\r", + "console.log(pm.collectionVariables.get(\"master8_id\"));\r", + "pm.collectionVariables.set(\"master8_node\",jsonResponse.result.node_id);\r", + "console.log(pm.collectionVariables.get(\"master8_node\"));\r", + "\r", + "pm.test(`identifier should be equal to ${pm.collectionVariables.get(\"master8_id\")}`, () => {\r", + " pm.expect(jsonResponse.result.identifier).to.eql(`${pm.collectionVariables.get(\"master8_code\")}`);\r", + "});\r", + "\r", + "pm.test(`node_id should be equal to ${pm.collectionVariables.get(\"master8_node\")}`, () => {\r", + " pm.expect(jsonResponse.result.node_id).to.eql(`${pm.collectionVariables.get(\"master8_code\")}`);\r", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "X-Channel-Id", + "value": "sunbird" + }, + { + "key": "Authorization", + "value": "{{auth_token}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"category\": {\n \"name\": \"master\",\n \"code\": \"{{master8_code}}\",\n \"targetIdFieldName\": \"targetmasterIds\",\n \"searchLabelFieldName\": \"se_master\",\n \"searchIdFieldName\": \"se_master\",\n \"orgIdFieldName\": \"masterIds\"\n }\n }\n}" + }, + "url": { + "raw": "{{host}}/framework/v3/category/master/create", + "host": [ + "{{host}}" + ], + "path": [ + "framework", + "v3", + "category", + "master", + "create" + ] + } + }, + "response": [] + }, + { + "name": "Create a framework", + "event": [ + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + }, + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json()\r", + "\r", + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "\r", + "pm.test(\"Verify keys and data type of the response result\", () => {\r", + " pm.expect(jsonResponse.params).to.have.all.keys('resmsgid','msgid','status', 'err','errmsg');\r", + " pm.expect(jsonResponse.params.status).to.be.a(\"String\");\r", + " pm.expect(jsonResponse.params.err).to.be.a(\"null\");\r", + " pm.expect(jsonResponse.params.errmsg).to.be.a(\"null\");\r", + "});\r", + "\r", + "pm.test(\"Status has string \", function () {\r", + " pm.expect(jsonResponse.params.status).to.be.equal(\"successful\");\r", + "});\r", + "\r", + "pm.test(\"Verify keys and data type of the response result\", () => {\r", + " pm.expect(jsonResponse.result).to.have.all.keys('node_id', 'versionKey');\r", + " pm.expect(jsonResponse.result.node_id).to.be.a(\"String\");\r", + " pm.expect(jsonResponse.result.versionKey).to.be.a(\"string\");\r", + "});\r", + "\r", + "pm.collectionVariables.set(\"fw7_node\",jsonResponse.result.node_id);\r", + "console.log(pm.collectionVariables.get(\"fw7_node\"));\r", + "\r", + "pm.test(`node id should be equal to ${pm.collectionVariables.get(\"fw7_node\")}`, () => {\r", + " pm.expect(jsonResponse.result.node_id).to.eql(pm.collectionVariables.get(\"fw7_code\"));\r", + "});\r", + "" + ], + "type": "text/javascript" + } + } + ], + "protocolProfileBehavior": { + "disabledSystemHeaders": {} + }, + "request": { + "auth": { + "type": "apikey", + "apikey": [ + { + "key": "value", + "value": "{{auth_token}}", + "type": "string" + }, + { + "key": "key", + "value": "Authorization", + "type": "string" + }, + { + "key": "in", + "value": "header", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "description": "(Required) It is the Unique Id to identify the root organisation to which the user belongs", + "key": "X-Channel-Id", + "value": "{{X-Channel-Id}}" + }, + { + "key": "", + "value": "", + "disabled": true + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "", + "type": "text", + "disabled": true + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"framework\": {\n \"name\": \"{{fw7_name}}\",\n \"code\": \"{{fw7_code}}\"\n \n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{host}}/framework/v3/create", + "host": [ + "{{host}}" + ], + "path": [ + "framework", + "v3", + "create" + ] + }, + "description": "This API is associated with creating a new framework on the Sunbird Platform.\n - The endpoint for **Create a Framework** is `/framework/v1/create`\n - It points to knowledge-mw-service - `/v1/framework/create`\n - The fields marked with an asterisk (*) are mandatory. They cannot be null or empty." + }, + "response": [ + { + "name": "OK ! Successful operation.\"create framework\" operation was successfully executed.", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource\n Possible media types can be:- \n - application/json", + "key": "Content-Type", + "value": "Ut enim offici" + }, + { + "description": "(Required) To make use of the API, you require authorization. Raise a request to the administrator for the use of the API. You will receive the authorization key. Specify the key received, here.", + "key": "Authorization", + "value": "Ut enim offici" + }, + { + "description": "(Required) It is the Unique Id to identify the root organisation to which the user belongs", + "key": "X-Channel-Id", + "value": "Ut enim offici" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"framework\": {\n \"name\": \"Framework Name\",\n \"code\": \"dummy_framework\",\n \"channels\": [\n {\n \"identifier\": \"in.ekstep\"\n }\n ]\n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/framework/v1/create", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "framework", + "v1", + "create" + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"api.framework.create\",\n \"ver\": \"1.0\",\n \"ts\": \"2020-12-14T09:49:06.794Z\",\n \"params\": {\n \"resmsgid\": \"9b5d7ca0-3df1-11eb-9ff3-67c41480f6aa\",\n \"msgid\": \"9b4a90e0-3df1-11eb-9ff3-67c41480f6aa\",\n \"status\": \"successful\",\n \"err\": null,\n \"errmsg\": null\n },\n \"responseCode\": \"OK\",\n \"result\": {\n \"node_id\": \"dummy_framework\",\n \"versionKey\": \"1607939346678\"\n }\n}" + }, + { + "name": "BAD REQUEST. The \"create framework\" operation failed ! The possible reason for failure is that you may have missed providing input for a mandatory parameter.", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource\n Possible media types can be:- \n - application/json", + "key": "Content-Type", + "value": "Ut enim offici" + }, + { + "description": "(Required) To make use of the API, you require authorization. Raise a request to the administrator for the use of the API. You will receive the authorization key. Specify the key received, here.", + "key": "Authorization", + "value": "Ut enim offici" + }, + { + "description": "(Required) It is the Unique Id to identify the root organisation to which the user belongs", + "key": "X-Channel-Id", + "value": "Ut enim offici" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"framework\": {\n \"name\": \"Framework Name\",\n \"code\": \"dummy_framework\",\n \"channels\": [\n {\n \"identifier\": \"in.ekstep\"\n }\n ]\n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/framework/v1/create", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "framework", + "v1", + "create" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"api.framework.create\",\n \"ver\": \"1.0\",\n \"ts\": \"2020-12-14T09:50:45.249Z\",\n \"params\": {\n \"resmsgid\": \"d60c8710-3df1-11eb-9ff3-67c41480f6aa\",\n \"msgid\": null,\n \"status\": \"failed\",\n \"err\": \"CONSTRAINT_VALIDATION_FAILED\",\n \"errmsg\": \"Object already exists with identifier: dummy_framework\"\n },\n \"responseCode\": \"CLIENT_ERROR\",\n \"result\": {}\n}" + }, + { + "name": "INTERNAL SERVER ERROR ! Looks like something went wrong! These errors are tracked automatically, but if the problem persists feel free to contact us. In the meantime, try refreshing.", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource\n Possible media types can be:- \n - application/json", + "key": "Content-Type", + "value": "Ut enim offici" + }, + { + "description": "(Required) To make use of the API, you require authorization. Raise a request to the administrator for the use of the API. You will receive the authorization key. Specify the key received, here.", + "key": "Authorization", + "value": "Ut enim offici" + }, + { + "description": "(Required) It is the Unique Id to identify the root organisation to which the user belongs", + "key": "X-Channel-Id", + "value": "Ut enim offici" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"framework\": {\n \"name\": \"Framework Name\",\n \"code\": \"dummy_framework\",\n \"channels\": [\n {\n \"identifier\": \"in.ekstep\"\n }\n ]\n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/framework/v1/create", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "framework", + "v1", + "create" + ] + } + }, + "status": "Internal Server Error", + "code": 500, + "_postman_previewlanguage": "text", + "header": [ + { + "key": "Content-Type", + "value": "text/plain" + } + ], + "cookie": [], + "body": "" + } + ] + }, + { + "name": "Create a master category for neg test case", + "event": [ + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + }, + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json()\r", + "\r", + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "\r", + "pm.collectionVariables.set(\"master9_id\",jsonResponse.result.identifier);\r", + "console.log(pm.collectionVariables.get(\"master9_id\"));\r", + "pm.collectionVariables.set(\"master9_node\",jsonResponse.result.node_id);\r", + "console.log(pm.collectionVariables.get(\"master9_node\"));\r", + "\r", + "pm.test(`identifier should be equal to ${pm.collectionVariables.get(\"master9_id\")}`, () => {\r", + " pm.expect(jsonResponse.result.identifier).to.eql(`${pm.collectionVariables.get(\"master9_code\")}`);\r", + "});\r", + "\r", + "pm.test(`node_id should be equal to ${pm.collectionVariables.get(\"master9_node\")}`, () => {\r", + " pm.expect(jsonResponse.result.node_id).to.eql(`${pm.collectionVariables.get(\"master9_code\")}`);\r", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "X-Channel-Id", + "value": "sunbird" + }, + { + "key": "Authorization", + "value": "{{auth_token}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"category\": {\n \"name\": \"master\",\n \"code\": \"{{master9_code}}\",\n \"targetIdFieldName\": \"targetmasterIds\",\n \"searchLabelFieldName\": \"se_master\",\n \"searchIdFieldName\": \"se_master\",\n \"orgIdFieldName\": \"masterIds\"\n }\n }\n}" + }, + "url": { + "raw": "{{host}}/framework/v3/category/master/create", + "host": [ + "{{host}}" + ], + "path": [ + "framework", + "v3", + "category", + "master", + "create" + ] + } + }, + "response": [] + } + ], + "description": "1. Framework name and code should be updated before each run\n2. Framework categroy should be a subset of master category, i.e., framework category can be created only when it is available in master category\n \n3. Create a master category with same indentifier before creating the framework category" + }, + { + "name": "Positive", + "item": [ + { + "name": "Create Category with valid fields", + "event": [ + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + }, + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json()\r", + "\r", + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "pm.test(\"id has string - api.taxonomy.category.instance.create \", function () {\r", + " pm.expect(jsonResponse.id).to.be.equal(\"api.taxonomy.category.instance.create\");\r", + "});\r", + "pm.test(\"Version is 3.0 \", function () {\r", + " pm.expect(jsonResponse.ver).to.be.equal(\"3.0\");\r", + "});\r", + "pm.test(\"Verify keys and data type of the response result\", () => {\r", + " pm.expect(jsonResponse.params).to.have.all.keys('resmsgid','msgid','status', 'err','errmsg');\r", + "pm.expect(jsonResponse.params.resmsgid).to.be.a(\"String\");\r", + "pm.expect(jsonResponse.params.msgid).to.be.a(\"null\");\r", + " pm.expect(jsonResponse.params.status).to.be.a(\"String\");\r", + " pm.expect(jsonResponse.params.err).to.be.a(\"null\");\r", + " pm.expect(jsonResponse.params.errmsg).to.be.a(\"null\");\r", + "});\r", + "\r", + "pm.test(\"Status has string \", function () {\r", + " pm.expect(jsonResponse.params.status).to.be.equal(\"successful\");\r", + "});\r", + "\r", + "pm.test(\"Verify keys and data type of the response result\", () => {\r", + " pm.expect(jsonResponse.result).to.have.all.keys('identifier', 'versionKey');\r", + " pm.expect(jsonResponse.result.identifier).to.be.a(\"String\");\r", + " pm.expect(jsonResponse.result.versionKey).to.be.a(\"string\");\r", + "});\r", + "\r", + "pm.collectionVariables.set(\"fwcat_cat2\",jsonResponse.result.identifier);\r", + "console.log(pm.collectionVariables.get(\"fwcat_cat2\"));\r", + "\r", + "pm.test(`identifier should be equal to ${pm.collectionVariables.get(\"fwcat_cat2\")}`, () => {\r", + " pm.expect(jsonResponse.result.identifier).to.eql(`${pm.collectionVariables.get(\"fw7_code\")}_${pm.collectionVariables.get(\"master8_code\")}`);\r", + "});\r", + "\r", + "\r", + "\r", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "apikey", + "apikey": [ + { + "key": "value", + "value": "", + "type": "string" + }, + { + "key": "key", + "value": "Authorization", + "type": "string" + }, + { + "key": "in", + "value": "header", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "X-Channel-Id", + "value": "{{X-Channel-Id}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"category\": {\n \"name\": \"Board\",\n \"code\": \"{{master8_code}}\",\n \"description\":\"Board category\"\n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{host}}/framework/v3/category/create?framework={{fw7_node}}", + "host": [ + "{{host}}" + ], + "path": [ + "framework", + "v3", + "category", + "create" + ], + "query": [ + { + "key": "framework", + "value": "{{fw7_node}}", + "description": "(Required) The code of the framework under which category has to be created" + } + ] + }, + "description": "This API is associated with creating a category under a framework\n - The endpoint for **Create Category** is `/framework/v1/category/create`\n - It points to knowledge-mw-service - `/v1/framework/category/create`\n - The fields marked with an asterisk (*) are mandatory. They cannot be null or empty." + }, + "response": [ + { + "name": "OK ! Successful operation.\"create category\" operation was successfully executed.", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource\n Possible media types can be:- \n - application/json", + "key": "Content-Type", + "value": "Ut enim offici" + }, + { + "description": "(Required) To make use of the API, you require authorization. Raise a request to the administrator for the use of the API. You will receive the authorization key. Specify the key received, here.", + "key": "Authorization", + "value": "Ut enim offici" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"category\": {\n \"name\": \"Subject\",\n \"code\": \"subject\"\n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/framework/v1/category/create?framework=Ut enim offici", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "framework", + "v1", + "category", + "create" + ], + "query": [ + { + "key": "framework", + "value": "Ut enim offici" + } + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"api.category.create\",\n \"ver\": \"1.0\",\n \"ts\": \"2020-12-14T19:32:01.754Z\",\n \"params\": {\n \"resmsgid\": \"0a10dba0-3e43-11eb-9ff3-67c41480f6aa\",\n \"msgid\": \"0a05df20-3e43-11eb-9ff3-67c41480f6aa\",\n \"status\": \"successful\",\n \"err\": null,\n \"errmsg\": null\n },\n \"responseCode\": \"OK\",\n \"result\": {\n \"node_id\": \"dummy_framework_medium\",\n \"versionKey\": \"1607974321700\"\n }\n}" + }, + { + "name": "BAD REQUEST. The \"create category\" operation failed ! The possible reason for failure is that you may have missed providing input for a mandatory parameter.", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource\n Possible media types can be:- \n - application/json", + "key": "Content-Type", + "value": "Ut enim offici" + }, + { + "description": "(Required) To make use of the API, you require authorization. Raise a request to the administrator for the use of the API. You will receive the authorization key. Specify the key received, here.", + "key": "Authorization", + "value": "Ut enim offici" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"category\": {\n \"name\": \"Subject\",\n \"code\": \"subject\"\n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/framework/v1/category/create?framework=Ut enim offici", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "framework", + "v1", + "category", + "create" + ], + "query": [ + { + "key": "framework", + "value": "Ut enim offici" + } + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"api.category.create\",\n \"ver\": \"1.0\",\n \"ts\": \"2020-12-14T19:30:50.114Z\",\n \"params\": {\n \"resmsgid\": \"df5d7620-3e42-11eb-9ff3-67c41480f6aa\",\n \"msgid\": null,\n \"status\": \"failed\",\n \"err\": \"CONSTRAINT_VALIDATION_FAILED\",\n \"errmsg\": \"Object already exists with identifier: dummy_framework_subject\"\n },\n \"responseCode\": \"CLIENT_ERROR\",\n \"result\": {}\n}" + }, + { + "name": "INTERNAL SERVER ERROR ! Looks like something went wrong! These errors are tracked automatically, but if the problem persists feel free to contact us. In the meantime, try refreshing.", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource\n Possible media types can be:- \n - application/json", + "key": "Content-Type", + "value": "Ut enim offici" + }, + { + "description": "(Required) To make use of the API, you require authorization. Raise a request to the administrator for the use of the API. You will receive the authorization key. Specify the key received, here.", + "key": "Authorization", + "value": "Ut enim offici" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"category\": {\n \"name\": \"Subject\",\n \"code\": \"subject\"\n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/framework/v1/category/create?framework=Ut enim offici", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "framework", + "v1", + "category", + "create" + ], + "query": [ + { + "key": "framework", + "value": "Ut enim offici" + } + ] + } + }, + "status": "Internal Server Error", + "code": 500, + "_postman_previewlanguage": "text", + "header": [ + { + "key": "Content-Type", + "value": "text/plain" + } + ], + "cookie": [], + "body": "" + } + ] + } + ] + }, + { + "name": "Negative", + "item": [ + { + "name": "Create a duplicate framework category", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json()\r", + "\r", + "pm.test(\"Status code is 400\", function () {\r", + " pm.response.to.have.status(400);\r", + "});\r", + "pm.test(\"id has string - api.taxonomy.category.instance.create \", function () {\r", + " pm.expect(jsonResponse.id).to.be.equal(\"api.taxonomy.category.instance.create\");\r", + "});\r", + "pm.test(\"Version is 3.0 \", function () {\r", + " pm.expect(jsonResponse.ver).to.be.equal(\"3.0\");\r", + "});\r", + "pm.test(\"Verify keys and data type of the response result\", () => {\r", + " pm.expect(jsonResponse.params).to.have.all.keys('resmsgid','msgid','status', 'err','errmsg');\r", + "pm.expect(jsonResponse.params.resmsgid).to.be.a(\"String\");\r", + "pm.expect(jsonResponse.params.msgid).to.be.a(\"null\");\r", + " pm.expect(jsonResponse.params.status).to.be.a(\"String\");\r", + " pm.expect(jsonResponse.params.err).to.be.a(\"String\");\r", + " pm.expect(jsonResponse.params.errmsg).to.be.a(\"String\");\r", + "});\r", + "\r", + "pm.test(\"Status has string \", function () {\r", + " pm.expect(jsonResponse.params.status).to.be.equal(\"failed\");\r", + "});\r", + "\r", + "pm.test(\"err has string \", function () {\r", + " pm.expect(jsonResponse.params.err).to.be.equal(\"CONSTRAINT_VALIDATION_FAILED\");\r", + "});\r", + "\r", + "pm.test(\"errmsg has string \", function () {\r", + " pm.expect(jsonResponse.params.errmsg).to.be.include(`Object already exists with identifier: ${pm.collectionVariables.get(\"fw7_code\")}_${pm.collectionVariables.get(\"master7_code\")}`);\r", + "});\r", + "\r", + "\r", + "\r", + "" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "setTimeout(function(){}, 3000);" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "X-Channel-Id", + "value": "{{X-Channel-Id}}" + }, + { + "key": "Authorization", + "value": "" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"category\": {\n \"name\": \"Board\",\n \"code\": \"{{master8_code}}\",\n \"description\":\"Board category\"\n }\n }\n}" + }, + "url": { + "raw": "{{host}}/framework/v3/category/create?framework={{fw7_node}}", + "host": [ + "{{host}}" + ], + "path": [ + "framework", + "v3", + "category", + "create" + ], + "query": [ + { + "key": "framework", + "value": "{{fw7_node}}" + } + ] + } + }, + "response": [] + }, + { + "name": "Create valid framework category to invalid framework", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json()\r", + "\r", + "pm.test(\"Status code is 404\", function () {\r", + " pm.response.to.have.status(404);\r", + "});\r", + "pm.test(\"id has string - api.taxonomy.category.instance.create \", function () {\r", + " pm.expect(jsonResponse.id).to.be.equal(\"api.taxonomy.category.instance.create\");\r", + "});\r", + "pm.test(\"Version is 3.0 \", function () {\r", + " pm.expect(jsonResponse.ver).to.be.equal(\"3.0\");\r", + "});\r", + "pm.test(\"Verify keys and data type of the response result\", () => {\r", + " pm.expect(jsonResponse.params).to.have.all.keys('resmsgid','msgid','status', 'err','errmsg');\r", + "pm.expect(jsonResponse.params.resmsgid).to.be.a(\"String\");\r", + "pm.expect(jsonResponse.params.msgid).to.be.a(\"null\");\r", + " pm.expect(jsonResponse.params.status).to.be.a(\"String\");\r", + " pm.expect(jsonResponse.params.err).to.be.a(\"String\");\r", + " pm.expect(jsonResponse.params.errmsg).to.be.a(\"String\");\r", + "});\r", + "\r", + "pm.test(\"Status has string \", function () {\r", + " pm.expect(jsonResponse.params.status).to.be.equal(\"failed\");\r", + "});\r", + "\r", + "pm.test(\"err has string \", function () {\r", + " pm.expect(jsonResponse.params.err).to.be.equal(\"NOT_FOUND\");\r", + "});\r", + "\r", + "pm.test(\"errmsg has string \", function () {\r", + " pm.expect(jsonResponse.params.errmsg).to.be.include(\"Error! Node(s) doesn't Exists. | [Invalid Node Id.]: dummy\");\r", + "});\r", + "\r", + "pm.test(\"responseCode has string \", function () {\r", + " pm.expect(jsonResponse.responseCode).to.be.include(\"RESOURCE_NOT_FOUND\");\r", + "});\r", + "// pm.globals.set(\"identifier\",jsonResponse.result.node_id);\r", + "// console.log(pm.globals.get(\"identifier\"));\r", + "\r", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "X-Channel-Id", + "value": "sunbird" + }, + { + "key": "Authorization", + "value": "" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"category\": {\n \"name\": \"Board\",\n \"code\": \"{{master8_code}}\",\n \"description\":\"Board category\"\n }\n }\n}" + }, + "url": { + "raw": "{{host}}/framework/v3/category/create?framework=dummy", + "host": [ + "{{host}}" + ], + "path": [ + "framework", + "v3", + "category", + "create" + ], + "query": [ + { + "key": "framework", + "value": "dummy" + } + ] + } + }, + "response": [] + } + ] + } + ] + }, + { + "name": "Update Framework category", + "item": [ + { + "name": "Pre requisite", + "item": [ + { + "name": "Create a master category", + "event": [ + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + }, + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json()\r", + "\r", + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "\r", + "pm.collectionVariables.set(\"master10_id\",jsonResponse.result.identifier);\r", + "console.log(pm.collectionVariables.get(\"master10_id\"));\r", + "pm.collectionVariables.set(\"master10_node\",jsonResponse.result.node_id);\r", + "console.log(pm.collectionVariables.get(\"master10_node\"));\r", + "\r", + "pm.test(`identifier should be equal to ${pm.collectionVariables.get(\"master10_id\")}`, () => {\r", + " pm.expect(jsonResponse.result.identifier).to.eql(`${pm.collectionVariables.get(\"master10_code\")}`);\r", + "});\r", + "\r", + "pm.test(`node_id should be equal to ${pm.collectionVariables.get(\"master10_node\")}`, () => {\r", + " pm.expect(jsonResponse.result.node_id).to.eql(`${pm.collectionVariables.get(\"master10_code\")}`);\r", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "X-Channel-Id", + "value": "sunbird" + }, + { + "key": "Authorization", + "value": "{{auth_token}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"category\": {\n \"name\": \"master\",\n \"code\": \"{{master10_code}}\",\n \"targetIdFieldName\": \"targetmasterIds\",\n \"searchLabelFieldName\": \"se_master\",\n \"searchIdFieldName\": \"se_master\",\n \"orgIdFieldName\": \"masterIds\"\n }\n }\n}" + }, + "url": { + "raw": "{{host}}/framework/v3/category/master/create", + "host": [ + "{{host}}" + ], + "path": [ + "framework", + "v3", + "category", + "master", + "create" + ] + } + }, + "response": [] + }, + { + "name": "Create a framework", + "event": [ + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + }, + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json()\r", + "\r", + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "\r", + "pm.test(\"Verify keys and data type of the response result\", () => {\r", + " pm.expect(jsonResponse.params).to.have.all.keys('resmsgid','msgid','status', 'err','errmsg');\r", + " pm.expect(jsonResponse.params.status).to.be.a(\"String\");\r", + " pm.expect(jsonResponse.params.err).to.be.a(\"null\");\r", + " pm.expect(jsonResponse.params.errmsg).to.be.a(\"null\");\r", + "});\r", + "\r", + "pm.test(\"Status has string \", function () {\r", + " pm.expect(jsonResponse.params.status).to.be.equal(\"successful\");\r", + "});\r", + "\r", + "pm.test(\"Verify keys and data type of the response result\", () => {\r", + " pm.expect(jsonResponse.result).to.have.all.keys('node_id', 'versionKey');\r", + " pm.expect(jsonResponse.result.node_id).to.be.a(\"String\");\r", + " pm.expect(jsonResponse.result.versionKey).to.be.a(\"string\");\r", + "});\r", + "\r", + "pm.collectionVariables.set(\"fw8_node\",jsonResponse.result.node_id);\r", + "console.log(pm.collectionVariables.get(\"fw8_node\"));\r", + "\r", + "pm.test(`node id should be equal to ${pm.collectionVariables.get(\"fw8_node\")}`, () => {\r", + " pm.expect(jsonResponse.result.node_id).to.eql(pm.collectionVariables.get(\"fw8_code\"));\r", + "});\r", + "\r", + "" + ], + "type": "text/javascript" + } + } + ], + "protocolProfileBehavior": { + "disabledSystemHeaders": {} + }, + "request": { + "auth": { + "type": "apikey", + "apikey": [ + { + "key": "value", + "value": "{{auth_token}}", + "type": "string" + }, + { + "key": "key", + "value": "Authorization", + "type": "string" + }, + { + "key": "in", + "value": "header", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "description": "(Required) It is the Unique Id to identify the root organisation to which the user belongs", + "key": "X-Channel-Id", + "value": "{{X-Channel-Id}}" + }, + { + "key": "", + "value": "", + "disabled": true + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "", + "type": "text", + "disabled": true + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"framework\": {\n \"name\": \"{{fw8_name}}\",\n \"code\": \"{{fw8_code}}\"\n \n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{host}}/framework/v3/create", + "host": [ + "{{host}}" + ], + "path": [ + "framework", + "v3", + "create" + ] + }, + "description": "This API is associated with creating a new framework on the Sunbird Platform.\n - The endpoint for **Create a Framework** is `/framework/v1/create`\n - It points to knowledge-mw-service - `/v1/framework/create`\n - The fields marked with an asterisk (*) are mandatory. They cannot be null or empty." + }, + "response": [ + { + "name": "OK ! Successful operation.\"create framework\" operation was successfully executed.", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource\n Possible media types can be:- \n - application/json", + "key": "Content-Type", + "value": "Ut enim offici" + }, + { + "description": "(Required) To make use of the API, you require authorization. Raise a request to the administrator for the use of the API. You will receive the authorization key. Specify the key received, here.", + "key": "Authorization", + "value": "Ut enim offici" + }, + { + "description": "(Required) It is the Unique Id to identify the root organisation to which the user belongs", + "key": "X-Channel-Id", + "value": "Ut enim offici" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"framework\": {\n \"name\": \"Framework Name\",\n \"code\": \"dummy_framework\",\n \"channels\": [\n {\n \"identifier\": \"in.ekstep\"\n }\n ]\n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/framework/v1/create", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "framework", + "v1", + "create" + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"api.framework.create\",\n \"ver\": \"1.0\",\n \"ts\": \"2020-12-14T09:49:06.794Z\",\n \"params\": {\n \"resmsgid\": \"9b5d7ca0-3df1-11eb-9ff3-67c41480f6aa\",\n \"msgid\": \"9b4a90e0-3df1-11eb-9ff3-67c41480f6aa\",\n \"status\": \"successful\",\n \"err\": null,\n \"errmsg\": null\n },\n \"responseCode\": \"OK\",\n \"result\": {\n \"node_id\": \"dummy_framework\",\n \"versionKey\": \"1607939346678\"\n }\n}" + }, + { + "name": "BAD REQUEST. The \"create framework\" operation failed ! The possible reason for failure is that you may have missed providing input for a mandatory parameter.", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource\n Possible media types can be:- \n - application/json", + "key": "Content-Type", + "value": "Ut enim offici" + }, + { + "description": "(Required) To make use of the API, you require authorization. Raise a request to the administrator for the use of the API. You will receive the authorization key. Specify the key received, here.", + "key": "Authorization", + "value": "Ut enim offici" + }, + { + "description": "(Required) It is the Unique Id to identify the root organisation to which the user belongs", + "key": "X-Channel-Id", + "value": "Ut enim offici" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"framework\": {\n \"name\": \"Framework Name\",\n \"code\": \"dummy_framework\",\n \"channels\": [\n {\n \"identifier\": \"in.ekstep\"\n }\n ]\n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/framework/v1/create", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "framework", + "v1", + "create" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"api.framework.create\",\n \"ver\": \"1.0\",\n \"ts\": \"2020-12-14T09:50:45.249Z\",\n \"params\": {\n \"resmsgid\": \"d60c8710-3df1-11eb-9ff3-67c41480f6aa\",\n \"msgid\": null,\n \"status\": \"failed\",\n \"err\": \"CONSTRAINT_VALIDATION_FAILED\",\n \"errmsg\": \"Object already exists with identifier: dummy_framework\"\n },\n \"responseCode\": \"CLIENT_ERROR\",\n \"result\": {}\n}" + }, + { + "name": "INTERNAL SERVER ERROR ! Looks like something went wrong! These errors are tracked automatically, but if the problem persists feel free to contact us. In the meantime, try refreshing.", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource\n Possible media types can be:- \n - application/json", + "key": "Content-Type", + "value": "Ut enim offici" + }, + { + "description": "(Required) To make use of the API, you require authorization. Raise a request to the administrator for the use of the API. You will receive the authorization key. Specify the key received, here.", + "key": "Authorization", + "value": "Ut enim offici" + }, + { + "description": "(Required) It is the Unique Id to identify the root organisation to which the user belongs", + "key": "X-Channel-Id", + "value": "Ut enim offici" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"framework\": {\n \"name\": \"Framework Name\",\n \"code\": \"dummy_framework\",\n \"channels\": [\n {\n \"identifier\": \"in.ekstep\"\n }\n ]\n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/framework/v1/create", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "framework", + "v1", + "create" + ] + } + }, + "status": "Internal Server Error", + "code": 500, + "_postman_previewlanguage": "text", + "header": [ + { + "key": "Content-Type", + "value": "text/plain" + } + ], + "cookie": [], + "body": "" + } + ] + }, + { + "name": "Create Framewok Category", + "event": [ + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + }, + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json()\r", + "\r", + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "pm.test(\"id has string - api.taxonomy.category.instance.create \", function () {\r", + " pm.expect(jsonResponse.id).to.be.equal(\"api.taxonomy.category.instance.create\");\r", + "});\r", + "pm.test(\"Version is 3.0 \", function () {\r", + " pm.expect(jsonResponse.ver).to.be.equal(\"3.0\");\r", + "});\r", + "pm.test(\"Verify keys and data type of the response result\", () => {\r", + " pm.expect(jsonResponse.params).to.have.all.keys('resmsgid','msgid','status', 'err','errmsg');\r", + "pm.expect(jsonResponse.params.resmsgid).to.be.a(\"String\");\r", + "pm.expect(jsonResponse.params.msgid).to.be.a(\"null\");\r", + " pm.expect(jsonResponse.params.status).to.be.a(\"String\");\r", + " pm.expect(jsonResponse.params.err).to.be.a(\"null\");\r", + " pm.expect(jsonResponse.params.errmsg).to.be.a(\"null\");\r", + "});\r", + "\r", + "pm.test(\"Status has string \", function () {\r", + " pm.expect(jsonResponse.params.status).to.be.equal(\"successful\");\r", + "});\r", + "\r", + "pm.test(\"Verify keys and data type of the response result\", () => {\r", + " pm.expect(jsonResponse.result).to.have.all.keys('identifier', 'versionKey');\r", + " pm.expect(jsonResponse.result.identifier).to.be.a(\"String\");\r", + " pm.expect(jsonResponse.result.versionKey).to.be.a(\"string\");\r", + "});\r", + "\r", + "pm.collectionVariables.set(\"fwcat_cat3\",jsonResponse.result.identifier);\r", + "console.log(pm.collectionVariables.get(\"fwcat_cat3\"));\r", + "\r", + "pm.test(`identifier should be equal to ${pm.collectionVariables.get(\"fwcat_cat3\")}`, () => {\r", + " pm.expect(jsonResponse.result.identifier).to.eql(`${pm.collectionVariables.get(\"fw8_code\")}_${pm.collectionVariables.get(\"master10_code\")}`);\r", + "});\r", + "\r", + "\r", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "apikey", + "apikey": [ + { + "key": "value", + "value": "", + "type": "string" + }, + { + "key": "key", + "value": "Authorization", + "type": "string" + }, + { + "key": "in", + "value": "header", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "X-Channel-Id", + "value": "{{X-Channel-Id}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"category\": {\n \"name\": \"Board\",\n \"code\": \"{{master10_code}}\",\n \"description\":\"Board category\"\n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{host}}/framework/v3/category/create?framework={{fw8_node}}", + "host": [ + "{{host}}" + ], + "path": [ + "framework", + "v3", + "category", + "create" + ], + "query": [ + { + "key": "framework", + "value": "{{fw8_node}}", + "description": "(Required) The code of the framework under which category has to be created" + } + ] + }, + "description": "This API is associated with creating a category under a framework\n - The endpoint for **Create Category** is `/framework/v1/category/create`\n - It points to knowledge-mw-service - `/v1/framework/category/create`\n - The fields marked with an asterisk (*) are mandatory. They cannot be null or empty." + }, + "response": [ + { + "name": "OK ! Successful operation.\"create category\" operation was successfully executed.", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource\n Possible media types can be:- \n - application/json", + "key": "Content-Type", + "value": "Ut enim offici" + }, + { + "description": "(Required) To make use of the API, you require authorization. Raise a request to the administrator for the use of the API. You will receive the authorization key. Specify the key received, here.", + "key": "Authorization", + "value": "Ut enim offici" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"category\": {\n \"name\": \"Subject\",\n \"code\": \"subject\"\n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/framework/v1/category/create?framework=Ut enim offici", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "framework", + "v1", + "category", + "create" + ], + "query": [ + { + "key": "framework", + "value": "Ut enim offici" + } + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"api.category.create\",\n \"ver\": \"1.0\",\n \"ts\": \"2020-12-14T19:32:01.754Z\",\n \"params\": {\n \"resmsgid\": \"0a10dba0-3e43-11eb-9ff3-67c41480f6aa\",\n \"msgid\": \"0a05df20-3e43-11eb-9ff3-67c41480f6aa\",\n \"status\": \"successful\",\n \"err\": null,\n \"errmsg\": null\n },\n \"responseCode\": \"OK\",\n \"result\": {\n \"node_id\": \"dummy_framework_medium\",\n \"versionKey\": \"1607974321700\"\n }\n}" + }, + { + "name": "BAD REQUEST. The \"create category\" operation failed ! The possible reason for failure is that you may have missed providing input for a mandatory parameter.", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource\n Possible media types can be:- \n - application/json", + "key": "Content-Type", + "value": "Ut enim offici" + }, + { + "description": "(Required) To make use of the API, you require authorization. Raise a request to the administrator for the use of the API. You will receive the authorization key. Specify the key received, here.", + "key": "Authorization", + "value": "Ut enim offici" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"category\": {\n \"name\": \"Subject\",\n \"code\": \"subject\"\n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/framework/v1/category/create?framework=Ut enim offici", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "framework", + "v1", + "category", + "create" + ], + "query": [ + { + "key": "framework", + "value": "Ut enim offici" + } + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"api.category.create\",\n \"ver\": \"1.0\",\n \"ts\": \"2020-12-14T19:30:50.114Z\",\n \"params\": {\n \"resmsgid\": \"df5d7620-3e42-11eb-9ff3-67c41480f6aa\",\n \"msgid\": null,\n \"status\": \"failed\",\n \"err\": \"CONSTRAINT_VALIDATION_FAILED\",\n \"errmsg\": \"Object already exists with identifier: dummy_framework_subject\"\n },\n \"responseCode\": \"CLIENT_ERROR\",\n \"result\": {}\n}" + }, + { + "name": "INTERNAL SERVER ERROR ! Looks like something went wrong! These errors are tracked automatically, but if the problem persists feel free to contact us. In the meantime, try refreshing.", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource\n Possible media types can be:- \n - application/json", + "key": "Content-Type", + "value": "Ut enim offici" + }, + { + "description": "(Required) To make use of the API, you require authorization. Raise a request to the administrator for the use of the API. You will receive the authorization key. Specify the key received, here.", + "key": "Authorization", + "value": "Ut enim offici" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"category\": {\n \"name\": \"Subject\",\n \"code\": \"subject\"\n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/framework/v1/category/create?framework=Ut enim offici", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "framework", + "v1", + "category", + "create" + ], + "query": [ + { + "key": "framework", + "value": "Ut enim offici" + } + ] + } + }, + "status": "Internal Server Error", + "code": 500, + "_postman_previewlanguage": "text", + "header": [ + { + "key": "Content-Type", + "value": "text/plain" + } + ], + "cookie": [], + "body": "" + } + ] + } + ], + "description": "1. Framework name and code should be updated before each run\n2. Framework categroy should be a subset of master category, i.e., framework category can be created only when it is available in master category\n \n3. Create a master category with same indentifier before creating the framework category" + }, + { + "name": "Positive", + "item": [ + { + "name": "Update a valid framework category for a valid framework", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json()\r", + "\r", + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "pm.test(\"id has string - api.taxonomy.category.instance.update \", function () {\r", + " pm.expect(jsonResponse.id).to.be.equal(\"api.taxonomy.category.instance.update\");\r", + "});\r", + "pm.test(\"Version is 3.0 \", function () {\r", + " pm.expect(jsonResponse.ver).to.be.equal(\"3.0\");\r", + "});\r", + "pm.test(\"Verify keys and data type of the response result\", () => {\r", + " pm.expect(jsonResponse.params).to.have.all.keys('resmsgid','msgid','status', 'err','errmsg');\r", + "pm.expect(jsonResponse.params.resmsgid).to.be.a(\"String\");\r", + "pm.expect(jsonResponse.params.msgid).to.be.a(\"null\");\r", + " pm.expect(jsonResponse.params.status).to.be.a(\"String\");\r", + " pm.expect(jsonResponse.params.err).to.be.a(\"null\");\r", + " pm.expect(jsonResponse.params.errmsg).to.be.a(\"null\");\r", + "});\r", + "\r", + "pm.test(\"Status has string \", function () {\r", + " pm.expect(jsonResponse.params.status).to.be.equal(\"successful\");\r", + "});\r", + "\r", + "pm.test(\"Verify keys and data type of the response result\", () => {\r", + " pm.expect(jsonResponse.result).to.have.all.keys('identifier', 'versionKey');\r", + " pm.expect(jsonResponse.result.identifier).to.be.a(\"String\");\r", + " pm.expect(jsonResponse.result.versionKey).to.be.a(\"string\");\r", + "});\r", + "\r", + "pm.collectionVariables.set(\"fwcat_cat3\",jsonResponse.result.identifier);\r", + "console.log(pm.collectionVariables.get(\"fwcat_cat3\"));\r", + "\r", + "pm.test(`identifier should be equal to ${pm.collectionVariables.get(\"fwcat_cat3\")}`, () => {\r", + " pm.expect(jsonResponse.result.identifier).to.eql(`${pm.collectionVariables.get(\"fw8_code\")}_${pm.collectionVariables.get(\"master10_code\")}`);\r", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "apikey", + "apikey": [ + { + "key": "key", + "value": "Authorization", + "type": "string" + }, + { + "key": "value", + "value": "{{apiKey}}", + "type": "string" + }, + { + "key": "in", + "value": "header", + "type": "string" + } + ] + }, + "method": "PATCH", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"category\": {\n \"description\": \"Updated description\"\n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{host}}/framework/v3/category/update/:{{master10_code}}?framework={{fw8_code}}", + "host": [ + "{{host}}" + ], + "path": [ + "framework", + "v3", + "category", + "update", + ":{{master10_code}}" + ], + "query": [ + { + "key": "framework", + "value": "{{fw8_code}}", + "description": "(Required) Represents the framework to which the category belongs" + } + ], + "variable": [ + { + "key": "{{master10_code}}", + "value": "" + } + ] + }, + "description": "This API is associated with updating a category in an existing framework\n - The endpoint for **Update Category** is `/framework/v1/category/update/{code}`\n - It points to knowledge-mw-service - `/v1/framework/category/update/{code}`\n - The fields marked with an asterisk (*) are mandatory. They cannot be null or empty." + }, + "response": [ + { + "name": "OK ! Successful operation.\"update category\" operation was successfully executed.", + "originalRequest": { + "method": "PATCH", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource.\n Possible media types can be:- \n - application/json", + "key": "Content-Type", + "value": "Ut enim offici" + }, + { + "description": "(Required) To make use of the API, you require authorization. Raise a request to the administrator for the use of the API. You will receive the authorization key. Specify the key received, here.", + "key": "Authorization", + "value": "Ut enim offici" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"category\": {\n \"description\": \"Updated description\"\n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/framework/v1/category/update/:code?framework=Ut enim offici", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "framework", + "v1", + "category", + "update", + ":code" + ], + "query": [ + { + "key": "framework", + "value": "Ut enim offici" + } + ], + "variable": [ + { + "key": "code", + "value": "Ut enim offici", + "description": "(Required) The name/code of the category to be updated" + } + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"api.category.update\",\n \"ver\": \"1.0\",\n \"ts\": \"2020-12-14T19:37:49.082Z\",\n \"params\": {\n \"resmsgid\": \"d916e7a0-3e43-11eb-9ff3-67c41480f6aa\",\n \"msgid\": \"d90f4680-3e43-11eb-9ff3-67c41480f6aa\",\n \"status\": \"successful\",\n \"err\": null,\n \"errmsg\": null\n },\n \"responseCode\": \"OK\",\n \"result\": {\n \"node_id\": \"dummy_framework_subject\",\n \"versionKey\": \"1607974669043\"\n }\n}" + }, + { + "name": "BAD REQUEST. The \"update category\" operation failed ! The possible reason for failure is that you may have missed providing input for a mandatory parameter.", + "originalRequest": { + "method": "PATCH", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource.\n Possible media types can be:- \n - application/json", + "key": "Content-Type", + "value": "Ut enim offici" + }, + { + "description": "(Required) To make use of the API, you require authorization. Raise a request to the administrator for the use of the API. You will receive the authorization key. Specify the key received, here.", + "key": "Authorization", + "value": "Ut enim offici" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"category\": {\n \"description\": \"Updated description\"\n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/framework/v1/category/update/:code?framework=Ut enim offici", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "framework", + "v1", + "category", + "update", + ":code" + ], + "query": [ + { + "key": "framework", + "value": "Ut enim offici" + } + ], + "variable": [ + { + "key": "code", + "value": "Ut enim offici", + "description": "(Required) The name/code of the category to be updated" + } + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"api.category.update\",\n \"ver\": \"1.0\",\n \"ts\": \"2020-12-14T19:38:29.662Z\",\n \"params\": {\n \"resmsgid\": \"f146ebe0-3e43-11eb-9ff3-67c41480f6aa\",\n \"msgid\": null,\n \"status\": \"failed\",\n \"err\": \"ERR_INVALID_FRAMEWORK_ID\",\n \"errmsg\": \"Invalid FrameworkId: dummy_framework1 for Categoryinstance \"\n },\n \"responseCode\": \"CLIENT_ERROR\",\n \"result\": {}\n}" + }, + { + "name": "INTERNAL SERVER ERROR ! Looks like something went wrong! These errors are tracked automatically, but if the problem persists feel free to contact us. In the meantime, try refreshing.", + "originalRequest": { + "method": "PATCH", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource.\n Possible media types can be:- \n - application/json", + "key": "Content-Type", + "value": "Ut enim offici" + }, + { + "description": "(Required) To make use of the API, you require authorization. Raise a request to the administrator for the use of the API. You will receive the authorization key. Specify the key received, here.", + "key": "Authorization", + "value": "Ut enim offici" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"category\": {\n \"description\": \"Updated description\"\n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/framework/v1/category/update/:code?framework=Ut enim offici", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "framework", + "v1", + "category", + "update", + ":code" + ], + "query": [ + { + "key": "framework", + "value": "Ut enim offici" + } + ], + "variable": [ + { + "key": "code", + "value": "Ut enim offici", + "description": "(Required) The name/code of the category to be updated" + } + ] + } + }, + "status": "Internal Server Error", + "code": 500, + "_postman_previewlanguage": "text", + "header": [ + { + "key": "Content-Type", + "value": "text/plain" + } + ], + "cookie": [], + "body": "" + } + ] + } + ] + }, + { + "name": "Negative", + "item": [ + { + "name": "Update an invalid framework to a valid framework", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json()\r", + "\r", + "pm.test(\"Status code is 404\", function () {\r", + " pm.response.to.have.status(404);\r", + "});\r", + "\r", + "pm.test(\"Status code name has string\", function () {\r", + " pm.response.to.have.status(\"Not Found\");\r", + "});\r", + "pm.test(\"id has string - api.taxonomy.category.instance.update \", function () {\r", + " pm.expect(jsonResponse.id).to.be.equal(\"api.taxonomy.category.instance.update\");\r", + "});\r", + "pm.test(\"Version is 3.0 \", function () {\r", + " pm.expect(jsonResponse.ver).to.be.equal(\"3.0\");\r", + "});\r", + "pm.test(\"Verify keys and data type of the response result\", () => {\r", + " pm.expect(jsonResponse.params).to.have.all.keys('resmsgid','msgid','err','status','errmsg');\r", + " pm.expect(jsonResponse.params.resmsgid).to.be.a(\"String\");\r", + " pm.expect(jsonResponse.params.msgid).to.be.a(\"null\");\r", + " pm.expect(jsonResponse.params.err).to.be.a(\"String\");\r", + " pm.expect(jsonResponse.params.status).to.be.a(\"String\");\r", + " pm.expect(jsonResponse.params.errmsg).to.be.a(\"String\");\r", + " });\r", + "\r", + "pm.test(\"Err has string\", function () {\r", + " pm.expect(jsonResponse.params.err).to.be.equal(\"NOT_FOUND\");\r", + "});\r", + "pm.test(\"Status has string\", function () {\r", + " pm.expect(jsonResponse.params.status).to.be.equal(\"failed\");\r", + "});\r", + "pm.test(`errmsg has string: Error! Node(s) doesn't Exists. | [Invalid Node Id.]: ${pm.globals.get(\"node_id\")}_abc` , function () {\r", + " pm.expect(jsonResponse.params.errmsg).to.be.include(`Error! Node(s) doesn't Exists. | [Invalid Node Id.]: ${pm.globals.get(\"node_id\")}_abc`);\r", + "});\r", + "pm.test(\"responseCode has string\", function () {\r", + " pm.expect(jsonResponse.responseCode).to.be.equal(\"RESOURCE_NOT_FOUND\");\r", + "});\r", + "\r", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "PATCH", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "{{apiKey}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"category\": {\n \"description\": \"Updated description\"\n }\n }\n}" + }, + "url": { + "raw": "{{host}}/framework/v3/category/update/:abc?framework={{node_id}}", + "host": [ + "{{host}}" + ], + "path": [ + "framework", + "v3", + "category", + "update", + ":abc" + ], + "query": [ + { + "key": "framework", + "value": "{{node_id}}" + } + ], + "variable": [ + { + "key": "abc", + "value": "" + } + ] + } + }, + "response": [] + }, + { + "name": "Update a valid framework to an invalid framework", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json()\r", + "\r", + "pm.test(\"Status code is 404\", function () {\r", + " pm.response.to.have.status(404);\r", + "});\r", + "\r", + "pm.test(\"Status code name has string\", function () {\r", + " pm.response.to.have.status(\"Not Found\");\r", + "});\r", + "pm.test(\"id has string - api.taxonomy.category.instance.update \", function () {\r", + " pm.expect(jsonResponse.id).to.be.equal(\"api.taxonomy.category.instance.update\");\r", + "});\r", + "pm.test(\"Version is 3.0 \", function () {\r", + " pm.expect(jsonResponse.ver).to.be.equal(\"3.0\");\r", + "});\r", + "pm.test(\"Verify keys and data type of the response result\", () => {\r", + " pm.expect(jsonResponse.params).to.have.all.keys('resmsgid','msgid','err','status','errmsg');\r", + " pm.expect(jsonResponse.params.resmsgid).to.be.a(\"String\");\r", + " pm.expect(jsonResponse.params.msgid).to.be.a(\"null\");\r", + " pm.expect(jsonResponse.params.err).to.be.a(\"String\");\r", + " pm.expect(jsonResponse.params.status).to.be.a(\"String\");\r", + " pm.expect(jsonResponse.params.errmsg).to.be.a(\"String\");\r", + " });\r", + "\r", + "pm.test(\"Err has string\", function () {\r", + " pm.expect(jsonResponse.params.err).to.be.equal(\"NOT_FOUND\");\r", + "});\r", + "pm.test(\"Status has string\", function () {\r", + " pm.expect(jsonResponse.params.status).to.be.equal(\"failed\");\r", + "});\r", + "pm.test(`errmsg has string: Error! Node(s) doesn't Exists. | [Invalid Node Id.]: dummy_${pm.globals.get(\"category\")}`, function () {\r", + " pm.expect(jsonResponse.params.errmsg).to.be.include(`Error! Node(s) doesn't Exists. | [Invalid Node Id.]: dummy_${pm.globals.get(\"category\")}`);\r", + "});\r", + "pm.test(\"responseCode has string\", function () {\r", + " pm.expect(jsonResponse.responseCode).to.be.equal(\"RESOURCE_NOT_FOUND\");\r", + "});\r", + "\r", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "PATCH", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "{{apiKey}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"category\": {\n \"description\": \"Updated description\"\n }\n }\n}" + }, + "url": { + "raw": "{{host}}/framework/v3/category/update/:{{category}}?framework=dummy", + "host": [ + "{{host}}" + ], + "path": [ + "framework", + "v3", + "category", + "update", + ":{{category}}" + ], + "query": [ + { + "key": "framework", + "value": "dummy" + } + ], + "variable": [ + { + "key": "{{category}}", + "value": "" + } + ] + } + }, + "response": [] + }, + { + "name": "Update a invalid framework to an invalid framework", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json()\r", + "\r", + "pm.test(\"Status code is 404\", function () {\r", + " pm.response.to.have.status(404);\r", + "});\r", + "\r", + "pm.test(\"Status code name has string\", function () {\r", + " pm.response.to.have.status(\"Not Found\");\r", + "});\r", + "pm.test(\"id has string - api.taxonomy.category.instance.update \", function () {\r", + " pm.expect(jsonResponse.id).to.be.equal(\"api.taxonomy.category.instance.update\");\r", + "});\r", + "pm.test(\"Version is 3.0 \", function () {\r", + " pm.expect(jsonResponse.ver).to.be.equal(\"3.0\");\r", + "});\r", + "pm.test(\"Verify keys and data type of the response result\", () => {\r", + " pm.expect(jsonResponse.params).to.have.all.keys('resmsgid','msgid','err','status','errmsg');\r", + " pm.expect(jsonResponse.params.resmsgid).to.be.a(\"String\");\r", + " pm.expect(jsonResponse.params.msgid).to.be.a(\"null\");\r", + " pm.expect(jsonResponse.params.err).to.be.a(\"String\");\r", + " pm.expect(jsonResponse.params.status).to.be.a(\"String\");\r", + " pm.expect(jsonResponse.params.errmsg).to.be.a(\"String\");\r", + " });\r", + "\r", + "pm.test(\"Err has string\", function () {\r", + " pm.expect(jsonResponse.params.err).to.be.equal(\"NOT_FOUND\");\r", + "});\r", + "pm.test(\"Status has string\", function () {\r", + " pm.expect(jsonResponse.params.status).to.be.equal(\"failed\");\r", + "});\r", + "pm.test(`errmsg has string: Error! Node(s) doesn't Exists. | [Invalid Node Id.]: dummy_abc`, function () {\r", + " pm.expect(jsonResponse.params.errmsg).to.be.include(`Error! Node(s) doesn't Exists. | [Invalid Node Id.]: dummy_abc`);\r", + "});\r", + "pm.test(\"responseCode has string\", function () {\r", + " pm.expect(jsonResponse.responseCode).to.be.equal(\"RESOURCE_NOT_FOUND\");\r", + "});\r", + "\r", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "PATCH", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "{{apiKey}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"category\": {\n \"description\": \"Updated description\"\n }\n }\n}" + }, + "url": { + "raw": "{{host}}/framework/v3/category/update/:abc?framework=dummy", + "host": [ + "{{host}}" + ], + "path": [ + "framework", + "v3", + "category", + "update", + ":abc" + ], + "query": [ + { + "key": "framework", + "value": "dummy" + } + ], + "variable": [ + { + "key": "abc", + "value": "" + } + ] + } + }, + "response": [] + } + ] + } + ] + }, + { + "name": "Delete Framework Category", + "item": [ + { + "name": "Pre requisite", + "item": [ + { + "name": "Create a master category", + "event": [ + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + }, + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json()\r", + "\r", + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "\r", + "pm.collectionVariables.set(\"master11_id\",jsonResponse.result.identifier);\r", + "console.log(pm.collectionVariables.get(\"master11_id\"));\r", + "pm.collectionVariables.set(\"master11_node\",jsonResponse.result.node_id);\r", + "console.log(pm.collectionVariables.get(\"master11_node\"));\r", + "\r", + "pm.test(`identifier should be equal to ${pm.collectionVariables.get(\"master11_id\")}`, () => {\r", + " pm.expect(jsonResponse.result.identifier).to.eql(`${pm.collectionVariables.get(\"master11_code\")}`);\r", + "});\r", + "\r", + "pm.test(`node_id should be equal to ${pm.collectionVariables.get(\"master11_node\")}`, () => {\r", + " pm.expect(jsonResponse.result.node_id).to.eql(`${pm.collectionVariables.get(\"master11_code\")}`);\r", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "X-Channel-Id", + "value": "sunbird" + }, + { + "key": "Authorization", + "value": "{{auth_token}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"category\": {\n \"name\": \"master\",\n \"code\": \"{{master11_code}}\",\n \"targetIdFieldName\": \"targetmasterIds\",\n \"searchLabelFieldName\": \"se_master\",\n \"searchIdFieldName\": \"se_master\",\n \"orgIdFieldName\": \"masterIds\"\n }\n }\n}" + }, + "url": { + "raw": "{{host}}/framework/v3/category/master/create", + "host": [ + "{{host}}" + ], + "path": [ + "framework", + "v3", + "category", + "master", + "create" + ] + } + }, + "response": [] + }, + { + "name": "Create a framework", + "event": [ + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + }, + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json()\r", + "\r", + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "\r", + "pm.test(\"Verify keys and data type of the response result\", () => {\r", + " pm.expect(jsonResponse.params).to.have.all.keys('resmsgid','msgid','status', 'err','errmsg');\r", + " pm.expect(jsonResponse.params.status).to.be.a(\"String\");\r", + " pm.expect(jsonResponse.params.err).to.be.a(\"null\");\r", + " pm.expect(jsonResponse.params.errmsg).to.be.a(\"null\");\r", + "});\r", + "\r", + "pm.test(\"Status has string \", function () {\r", + " pm.expect(jsonResponse.params.status).to.be.equal(\"successful\");\r", + "});\r", + "\r", + "pm.test(\"Verify keys and data type of the response result\", () => {\r", + " pm.expect(jsonResponse.result).to.have.all.keys('node_id', 'versionKey');\r", + " pm.expect(jsonResponse.result.node_id).to.be.a(\"String\");\r", + " pm.expect(jsonResponse.result.versionKey).to.be.a(\"string\");\r", + "});\r", + "\r", + "pm.collectionVariables.set(\"fw9_node\",jsonResponse.result.node_id);\r", + "console.log(pm.collectionVariables.get(\"fw9_node\"));\r", + "\r", + "pm.test(`node id should be equal to ${pm.collectionVariables.get(\"fw9_node\")}`, () => {\r", + " pm.expect(jsonResponse.result.node_id).to.eql(pm.collectionVariables.get(\"fw9_code\"));\r", + "});\r", + "" + ], + "type": "text/javascript" + } + } + ], + "protocolProfileBehavior": { + "disabledSystemHeaders": {} + }, + "request": { + "auth": { + "type": "apikey", + "apikey": [ + { + "key": "value", + "value": "{{auth_token}}", + "type": "string" + }, + { + "key": "key", + "value": "Authorization", + "type": "string" + }, + { + "key": "in", + "value": "header", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "description": "(Required) It is the Unique Id to identify the root organisation to which the user belongs", + "key": "X-Channel-Id", + "value": "{{X-Channel-Id}}" + }, + { + "key": "", + "value": "", + "disabled": true + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "", + "type": "text", + "disabled": true + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"framework\": {\n \"name\": \"{{fw9_name}}\",\n \"code\": \"{{fw9_code}}\"\n \n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{host}}/framework/v3/create", + "host": [ + "{{host}}" + ], + "path": [ + "framework", + "v3", + "create" + ] + }, + "description": "This API is associated with creating a new framework on the Sunbird Platform.\n - The endpoint for **Create a Framework** is `/framework/v1/create`\n - It points to knowledge-mw-service - `/v1/framework/create`\n - The fields marked with an asterisk (*) are mandatory. They cannot be null or empty." + }, + "response": [ + { + "name": "OK ! Successful operation.\"create framework\" operation was successfully executed.", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource\n Possible media types can be:- \n - application/json", + "key": "Content-Type", + "value": "Ut enim offici" + }, + { + "description": "(Required) To make use of the API, you require authorization. Raise a request to the administrator for the use of the API. You will receive the authorization key. Specify the key received, here.", + "key": "Authorization", + "value": "Ut enim offici" + }, + { + "description": "(Required) It is the Unique Id to identify the root organisation to which the user belongs", + "key": "X-Channel-Id", + "value": "Ut enim offici" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"framework\": {\n \"name\": \"Framework Name\",\n \"code\": \"dummy_framework\",\n \"channels\": [\n {\n \"identifier\": \"in.ekstep\"\n }\n ]\n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/framework/v1/create", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "framework", + "v1", + "create" + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"api.framework.create\",\n \"ver\": \"1.0\",\n \"ts\": \"2020-12-14T09:49:06.794Z\",\n \"params\": {\n \"resmsgid\": \"9b5d7ca0-3df1-11eb-9ff3-67c41480f6aa\",\n \"msgid\": \"9b4a90e0-3df1-11eb-9ff3-67c41480f6aa\",\n \"status\": \"successful\",\n \"err\": null,\n \"errmsg\": null\n },\n \"responseCode\": \"OK\",\n \"result\": {\n \"node_id\": \"dummy_framework\",\n \"versionKey\": \"1607939346678\"\n }\n}" + }, + { + "name": "BAD REQUEST. The \"create framework\" operation failed ! The possible reason for failure is that you may have missed providing input for a mandatory parameter.", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource\n Possible media types can be:- \n - application/json", + "key": "Content-Type", + "value": "Ut enim offici" + }, + { + "description": "(Required) To make use of the API, you require authorization. Raise a request to the administrator for the use of the API. You will receive the authorization key. Specify the key received, here.", + "key": "Authorization", + "value": "Ut enim offici" + }, + { + "description": "(Required) It is the Unique Id to identify the root organisation to which the user belongs", + "key": "X-Channel-Id", + "value": "Ut enim offici" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"framework\": {\n \"name\": \"Framework Name\",\n \"code\": \"dummy_framework\",\n \"channels\": [\n {\n \"identifier\": \"in.ekstep\"\n }\n ]\n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/framework/v1/create", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "framework", + "v1", + "create" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"api.framework.create\",\n \"ver\": \"1.0\",\n \"ts\": \"2020-12-14T09:50:45.249Z\",\n \"params\": {\n \"resmsgid\": \"d60c8710-3df1-11eb-9ff3-67c41480f6aa\",\n \"msgid\": null,\n \"status\": \"failed\",\n \"err\": \"CONSTRAINT_VALIDATION_FAILED\",\n \"errmsg\": \"Object already exists with identifier: dummy_framework\"\n },\n \"responseCode\": \"CLIENT_ERROR\",\n \"result\": {}\n}" + }, + { + "name": "INTERNAL SERVER ERROR ! Looks like something went wrong! These errors are tracked automatically, but if the problem persists feel free to contact us. In the meantime, try refreshing.", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource\n Possible media types can be:- \n - application/json", + "key": "Content-Type", + "value": "Ut enim offici" + }, + { + "description": "(Required) To make use of the API, you require authorization. Raise a request to the administrator for the use of the API. You will receive the authorization key. Specify the key received, here.", + "key": "Authorization", + "value": "Ut enim offici" + }, + { + "description": "(Required) It is the Unique Id to identify the root organisation to which the user belongs", + "key": "X-Channel-Id", + "value": "Ut enim offici" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"framework\": {\n \"name\": \"Framework Name\",\n \"code\": \"dummy_framework\",\n \"channels\": [\n {\n \"identifier\": \"in.ekstep\"\n }\n ]\n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/framework/v1/create", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "framework", + "v1", + "create" + ] + } + }, + "status": "Internal Server Error", + "code": 500, + "_postman_previewlanguage": "text", + "header": [ + { + "key": "Content-Type", + "value": "text/plain" + } + ], + "cookie": [], + "body": "" + } + ] + }, + { + "name": "Create Framework Category", + "event": [ + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + }, + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json()\r", + "\r", + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "pm.test(\"id has string - api.taxonomy.category.instance.create \", function () {\r", + " pm.expect(jsonResponse.id).to.be.equal(\"api.taxonomy.category.instance.create\");\r", + "});\r", + "pm.test(\"Version is 3.0 \", function () {\r", + " pm.expect(jsonResponse.ver).to.be.equal(\"3.0\");\r", + "});\r", + "pm.test(\"Verify keys and data type of the response result\", () => {\r", + " pm.expect(jsonResponse.params).to.have.all.keys('resmsgid','msgid','status', 'err','errmsg');\r", + "pm.expect(jsonResponse.params.resmsgid).to.be.a(\"String\");\r", + "pm.expect(jsonResponse.params.msgid).to.be.a(\"null\");\r", + " pm.expect(jsonResponse.params.status).to.be.a(\"String\");\r", + " pm.expect(jsonResponse.params.err).to.be.a(\"null\");\r", + " pm.expect(jsonResponse.params.errmsg).to.be.a(\"null\");\r", + "});\r", + "\r", + "pm.test(\"Status has string \", function () {\r", + " pm.expect(jsonResponse.params.status).to.be.equal(\"successful\");\r", + "});\r", + "\r", + "pm.test(\"Verify keys and data type of the response result\", () => {\r", + " pm.expect(jsonResponse.result).to.have.all.keys('identifier', 'versionKey');\r", + " pm.expect(jsonResponse.result.identifier).to.be.a(\"String\");\r", + " pm.expect(jsonResponse.result.versionKey).to.be.a(\"string\");\r", + "});\r", + "\r", + "pm.collectionVariables.set(\"fwcat_cat4\",jsonResponse.result.identifier);\r", + "console.log(pm.collectionVariables.get(\"fwcat_cat4\"));\r", + "\r", + "pm.test(`identifier should be equal to ${pm.collectionVariables.get(\"fwcat_cat4\")}`, () => {\r", + " pm.expect(jsonResponse.result.identifier).to.eql(`${pm.collectionVariables.get(\"fw9_code\")}_${pm.collectionVariables.get(\"master11_code\")}`);\r", + "\r", + "});\r", + "\r", + "\r", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "apikey", + "apikey": [ + { + "key": "value", + "value": "", + "type": "string" + }, + { + "key": "key", + "value": "Authorization", + "type": "string" + }, + { + "key": "in", + "value": "header", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "X-Channel-Id", + "value": "{{X-Channel-Id}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"category\": {\n \"name\": \"Board\",\n \"code\": \"{{master11_code}}\",\n \"description\":\"Board category\"\n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{host}}/framework/v3/category/create?framework={{fw9_node}}", + "host": [ + "{{host}}" + ], + "path": [ + "framework", + "v3", + "category", + "create" + ], + "query": [ + { + "key": "framework", + "value": "{{fw9_node}}", + "description": "(Required) The code of the framework under which category has to be created" + } + ] + }, + "description": "This API is associated with creating a category under a framework\n - The endpoint for **Create Category** is `/framework/v1/category/create`\n - It points to knowledge-mw-service - `/v1/framework/category/create`\n - The fields marked with an asterisk (*) are mandatory. They cannot be null or empty." + }, + "response": [ + { + "name": "OK ! Successful operation.\"create category\" operation was successfully executed.", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource\n Possible media types can be:- \n - application/json", + "key": "Content-Type", + "value": "Ut enim offici" + }, + { + "description": "(Required) To make use of the API, you require authorization. Raise a request to the administrator for the use of the API. You will receive the authorization key. Specify the key received, here.", + "key": "Authorization", + "value": "Ut enim offici" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"category\": {\n \"name\": \"Subject\",\n \"code\": \"subject\"\n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/framework/v1/category/create?framework=Ut enim offici", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "framework", + "v1", + "category", + "create" + ], + "query": [ + { + "key": "framework", + "value": "Ut enim offici" + } + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"api.category.create\",\n \"ver\": \"1.0\",\n \"ts\": \"2020-12-14T19:32:01.754Z\",\n \"params\": {\n \"resmsgid\": \"0a10dba0-3e43-11eb-9ff3-67c41480f6aa\",\n \"msgid\": \"0a05df20-3e43-11eb-9ff3-67c41480f6aa\",\n \"status\": \"successful\",\n \"err\": null,\n \"errmsg\": null\n },\n \"responseCode\": \"OK\",\n \"result\": {\n \"node_id\": \"dummy_framework_medium\",\n \"versionKey\": \"1607974321700\"\n }\n}" + }, + { + "name": "BAD REQUEST. The \"create category\" operation failed ! The possible reason for failure is that you may have missed providing input for a mandatory parameter.", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource\n Possible media types can be:- \n - application/json", + "key": "Content-Type", + "value": "Ut enim offici" + }, + { + "description": "(Required) To make use of the API, you require authorization. Raise a request to the administrator for the use of the API. You will receive the authorization key. Specify the key received, here.", + "key": "Authorization", + "value": "Ut enim offici" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"category\": {\n \"name\": \"Subject\",\n \"code\": \"subject\"\n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/framework/v1/category/create?framework=Ut enim offici", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "framework", + "v1", + "category", + "create" + ], + "query": [ + { + "key": "framework", + "value": "Ut enim offici" + } + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"api.category.create\",\n \"ver\": \"1.0\",\n \"ts\": \"2020-12-14T19:30:50.114Z\",\n \"params\": {\n \"resmsgid\": \"df5d7620-3e42-11eb-9ff3-67c41480f6aa\",\n \"msgid\": null,\n \"status\": \"failed\",\n \"err\": \"CONSTRAINT_VALIDATION_FAILED\",\n \"errmsg\": \"Object already exists with identifier: dummy_framework_subject\"\n },\n \"responseCode\": \"CLIENT_ERROR\",\n \"result\": {}\n}" + }, + { + "name": "INTERNAL SERVER ERROR ! Looks like something went wrong! These errors are tracked automatically, but if the problem persists feel free to contact us. In the meantime, try refreshing.", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource\n Possible media types can be:- \n - application/json", + "key": "Content-Type", + "value": "Ut enim offici" + }, + { + "description": "(Required) To make use of the API, you require authorization. Raise a request to the administrator for the use of the API. You will receive the authorization key. Specify the key received, here.", + "key": "Authorization", + "value": "Ut enim offici" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"category\": {\n \"name\": \"Subject\",\n \"code\": \"subject\"\n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/framework/v1/category/create?framework=Ut enim offici", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "framework", + "v1", + "category", + "create" + ], + "query": [ + { + "key": "framework", + "value": "Ut enim offici" + } + ] + } + }, + "status": "Internal Server Error", + "code": 500, + "_postman_previewlanguage": "text", + "header": [ + { + "key": "Content-Type", + "value": "text/plain" + } + ], + "cookie": [], + "body": "" + } + ] + } + ], + "description": "1. Framework name and code should be updated before each run\n2. Framework categroy should be a subset of master category, i.e., framework category can be created only when it is available in master category\n \n3. Create a master category with same indentifier before creating the framework category" + }, + { + "name": "Positive", + "item": [ + { + "name": "Delete a valid framework category", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json()\r", + "\r", + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "pm.test(\"id has string - api.taxonomy.category.instance.retire \", function () {\r", + " pm.expect(jsonResponse.id).to.be.equal(\"api.taxonomy.category.instance.retire\");\r", + "});\r", + "pm.test(\"Version is 3.0 \", function () {\r", + " pm.expect(jsonResponse.ver).to.be.equal(\"3.0\");\r", + "});\r", + "pm.test(\"Verify keys and data type of the response result\", () => {\r", + " pm.expect(jsonResponse.params).to.have.all.keys('resmsgid','msgid','status', 'err','errmsg');\r", + "pm.expect(jsonResponse.params.resmsgid).to.be.a(\"String\");\r", + "pm.expect(jsonResponse.params.msgid).to.be.a(\"null\");\r", + " pm.expect(jsonResponse.params.status).to.be.a(\"String\");\r", + " pm.expect(jsonResponse.params.err).to.be.a(\"null\");\r", + " pm.expect(jsonResponse.params.errmsg).to.be.a(\"null\");\r", + "});\r", + "\r", + "pm.test(\"Status has string \", function () {\r", + " pm.expect(jsonResponse.params.status).to.be.equal(\"successful\");\r", + "});\r", + "\r", + "pm.test(\"Verify keys and data type of the response result\", () => {\r", + " pm.expect(jsonResponse.result).to.have.all.keys('identifier', 'versionKey');\r", + " pm.expect(jsonResponse.result.identifier).to.be.a(\"String\");\r", + " pm.expect(jsonResponse.result.versionKey).to.be.a(\"string\");\r", + "});\r", + "\r", + "pm.collectionVariables.set(\"identifier\",jsonResponse.result.identifier);\r", + "console.log(pm.collectionVariables.get(\"identifier\"));\r", + "\r", + "pm.test(`identifier should be equal to ${pm.collectionVariables.get(\"identifier\")}`, () => {\r", + " pm.expect(jsonResponse.result.identifier).to.eql(`${pm.collectionVariables.get(\"fw9_code\")}_${pm.collectionVariables.get(\"master11_code\")}`);\r", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "DELETE", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "X-Channel-Id", + "value": "sunbird" + } + ], + "url": { + "raw": "{{host}}/framework/v3/category/retire/{{master11_code}}?framework={{fw9_code}}", + "host": [ + "{{host}}" + ], + "path": [ + "framework", + "v3", + "category", + "retire", + "{{master11_code}}" + ], + "query": [ + { + "key": "framework", + "value": "{{fw9_code}}" + } + ] + } + }, + "response": [] + } + ] + }, + { + "name": "Negative", + "item": [ + { + "name": "Delete an invalid framework category to a valid framework", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json()\r", + "\r", + "pm.test(\"Status code is 404\", function () {\r", + " pm.response.to.have.status(404);\r", + "});\r", + "\r", + "pm.test(\"Status code name has string\", function () {\r", + " pm.response.to.have.status(\"Not Found\");\r", + "});\r", + "pm.test(\"id has string - api.taxonomy.category.instance.retire \", function () {\r", + " pm.expect(jsonResponse.id).to.be.equal(\"api.taxonomy.category.instance.retire\");\r", + "});\r", + "pm.test(\"Version is 3.0 \", function () {\r", + " pm.expect(jsonResponse.ver).to.be.equal(\"3.0\");\r", + "});\r", + "pm.test(\"Verify keys and data type of the response result\", () => {\r", + " pm.expect(jsonResponse.params).to.have.all.keys('resmsgid','msgid','err','status','errmsg');\r", + " pm.expect(jsonResponse.params.resmsgid).to.be.a(\"String\");\r", + " pm.expect(jsonResponse.params.msgid).to.be.a(\"null\");\r", + " pm.expect(jsonResponse.params.err).to.be.a(\"String\");\r", + " pm.expect(jsonResponse.params.status).to.be.a(\"String\");\r", + " pm.expect(jsonResponse.params.errmsg).to.be.a(\"String\");\r", + " });\r", + "\r", + "pm.test(\"Err has string\", function () {\r", + " pm.expect(jsonResponse.params.err).to.be.equal(\"NOT_FOUND\");\r", + "});\r", + "pm.test(\"Status has string\", function () {\r", + " pm.expect(jsonResponse.params.status).to.be.equal(\"failed\");\r", + "});\r", + "\r", + "pm.test(`errmsg has string: Error! Node(s) doesn't Exists. | [Invalid Node Id.]: ${pm.globals.get(\"node_id\")}_abc` , function () {\r", + " pm.expect(jsonResponse.params.errmsg).to.be.include(`Error! Node(s) doesn't Exists. | [Invalid Node Id.]: ${pm.globals.get(\"node_id\")}_abc`);\r", + "});\r", + "\r", + "pm.test(\"responseCode has string\", function () {\r", + " pm.expect(jsonResponse.responseCode).to.be.equal(\"RESOURCE_NOT_FOUND\");\r", + "});\r", + "\r", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "DELETE", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "X-Channel-Id", + "value": "sunbird" + } + ], + "url": { + "raw": "{{host}}/framework/v3/category/retire/abc?framework={{node_id}}", + "host": [ + "{{host}}" + ], + "path": [ + "framework", + "v3", + "category", + "retire", + "abc" + ], + "query": [ + { + "key": "framework", + "value": "{{node_id}}" + } + ] + } + }, + "response": [] + }, + { + "name": "Delete a valid framework category from invalid framework", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json()\r", + "\r", + "pm.test(\"Status code is 404\", function () {\r", + " pm.response.to.have.status(404);\r", + "});\r", + "\r", + "pm.test(\"Status code name has string\", function () {\r", + " pm.response.to.have.status(\"Not Found\");\r", + "});\r", + "pm.test(\"id has string - api.taxonomy.category.instance.retire \", function () {\r", + " pm.expect(jsonResponse.id).to.be.equal(\"api.taxonomy.category.instance.retire\");\r", + "});\r", + "pm.test(\"Version is 3.0 \", function () {\r", + " pm.expect(jsonResponse.ver).to.be.equal(\"3.0\");\r", + "});\r", + "pm.test(\"Verify keys and data type of the response result\", () => {\r", + " pm.expect(jsonResponse.params).to.have.all.keys('resmsgid','msgid','err','status','errmsg');\r", + " pm.expect(jsonResponse.params.resmsgid).to.be.a(\"String\");\r", + " pm.expect(jsonResponse.params.msgid).to.be.a(\"null\");\r", + " pm.expect(jsonResponse.params.err).to.be.a(\"String\");\r", + " pm.expect(jsonResponse.params.status).to.be.a(\"String\");\r", + " pm.expect(jsonResponse.params.errmsg).to.be.a(\"String\");\r", + " });\r", + "\r", + "pm.test(\"Err has string\", function () {\r", + " pm.expect(jsonResponse.params.err).to.be.equal(\"NOT_FOUND\");\r", + "});\r", + "pm.test(\"Status has string\", function () {\r", + " pm.expect(jsonResponse.params.status).to.be.equal(\"failed\");\r", + "});\r", + "\r", + "pm.test(`errmsg has string: Error! Node(s) doesn't Exists. | [Invalid Node Id.]: dummy_${pm.globals.get(\"category\")}`, function () {\r", + " pm.expect(jsonResponse.params.errmsg).to.be.include(`Error! Node(s) doesn't Exists. | [Invalid Node Id.]: dummy_${pm.globals.get(\"category\")}`);\r", + "});\r", + "\r", + "pm.test(\"responseCode has string\", function () {\r", + " pm.expect(jsonResponse.responseCode).to.be.equal(\"RESOURCE_NOT_FOUND\");\r", + "});\r", + "\r", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "DELETE", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "X-Channel-Id", + "value": "sunbird" + } + ], + "url": { + "raw": "{{host}}/framework/v3/category/retire/{{category}}?framework=dummy", + "host": [ + "{{host}}" + ], + "path": [ + "framework", + "v3", + "category", + "retire", + "{{category}}" + ], + "query": [ + { + "key": "framework", + "value": "dummy" + } + ] + } + }, + "response": [] + }, + { + "name": "Delete an invalid framework category from invalid framework", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json()\r", + "\r", + "pm.test(\"Status code is 404\", function () {\r", + " pm.response.to.have.status(404);\r", + "});\r", + "\r", + "pm.test(\"Status code name has string\", function () {\r", + " pm.response.to.have.status(\"Not Found\");\r", + "});\r", + "pm.test(\"id has string - api.taxonomy.category.instance.retire \", function () {\r", + " pm.expect(jsonResponse.id).to.be.equal(\"api.taxonomy.category.instance.retire\");\r", + "});\r", + "pm.test(\"Version is 3.0 \", function () {\r", + " pm.expect(jsonResponse.ver).to.be.equal(\"3.0\");\r", + "});\r", + "pm.test(\"Verify keys and data type of the response result\", () => {\r", + " pm.expect(jsonResponse.params).to.have.all.keys('resmsgid','msgid','err','status','errmsg');\r", + " pm.expect(jsonResponse.params.resmsgid).to.be.a(\"String\");\r", + " pm.expect(jsonResponse.params.msgid).to.be.a(\"null\");\r", + " pm.expect(jsonResponse.params.err).to.be.a(\"String\");\r", + " pm.expect(jsonResponse.params.status).to.be.a(\"String\");\r", + " pm.expect(jsonResponse.params.errmsg).to.be.a(\"String\");\r", + " });\r", + "\r", + "pm.test(\"Err has string\", function () {\r", + " pm.expect(jsonResponse.params.err).to.be.equal(\"NOT_FOUND\");\r", + "});\r", + "pm.test(\"Status has string\", function () {\r", + " pm.expect(jsonResponse.params.status).to.be.equal(\"failed\");\r", + "});\r", + "pm.test(`errmsg has string: Error! Node(s) doesn't Exists. | [Invalid Node Id.]: dummy_abc`, function () {\r", + " pm.expect(jsonResponse.params.errmsg).to.be.include(`Error! Node(s) doesn't Exists. | [Invalid Node Id.]: dummy_abc`);\r", + "});\r", + "pm.test(\"responseCode has string\", function () {\r", + " pm.expect(jsonResponse.responseCode).to.be.equal(\"RESOURCE_NOT_FOUND\");\r", + "});\r", + "\r", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "DELETE", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "X-Channel-Id", + "value": "sunbird" + } + ], + "url": { + "raw": "{{host}}/framework/v3/category/retire/abc?framework=dummy", + "host": [ + "{{host}}" + ], + "path": [ + "framework", + "v3", + "category", + "retire", + "abc" + ], + "query": [ + { + "key": "framework", + "value": "dummy" + } + ] + } + }, + "response": [] + } + ] + } + ] + }, + { + "name": "Get a Framework Category", + "item": [ + { + "name": "Pre requisite", + "item": [ + { + "name": "Create a master category", + "event": [ + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + }, + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json()\r", + "\r", + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "\r", + "pm.collectionVariables.set(\"master12_id\",jsonResponse.result.identifier);\r", + "console.log(pm.collectionVariables.get(\"master12_id\"));\r", + "pm.collectionVariables.set(\"master12_node\",jsonResponse.result.node_id);\r", + "console.log(pm.collectionVariables.get(\"master12_node\"));\r", + "\r", + "pm.test(`identifier should be equal to ${pm.collectionVariables.get(\"master12_id\")}`, () => {\r", + " pm.expect(jsonResponse.result.identifier).to.eql(`${pm.collectionVariables.get(\"master12_code\")}`);\r", + "});\r", + "\r", + "pm.test(`node_id should be equal to ${pm.collectionVariables.get(\"master12_node\")}`, () => {\r", + " pm.expect(jsonResponse.result.node_id).to.eql(`${pm.collectionVariables.get(\"master12_code\")}`);\r", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "X-Channel-Id", + "value": "sunbird" + }, + { + "key": "Authorization", + "value": "{{auth_token}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"category\": {\n \"name\": \"master\",\n \"code\": \"{{master12_code}}\",\n \"targetIdFieldName\": \"targetmasterIds\",\n \"searchLabelFieldName\": \"se_master\",\n \"searchIdFieldName\": \"se_master\",\n \"orgIdFieldName\": \"masterIds\"\n }\n }\n}" + }, + "url": { + "raw": "{{host}}/framework/v3/category/master/create", + "host": [ + "{{host}}" + ], + "path": [ + "framework", + "v3", + "category", + "master", + "create" + ] + } + }, + "response": [] + }, + { + "name": "Create a framework", + "event": [ + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + }, + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json()\r", + "\r", + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "\r", + "pm.test(\"Verify keys and data type of the response result\", () => {\r", + " pm.expect(jsonResponse.params).to.have.all.keys('resmsgid','msgid','status', 'err','errmsg');\r", + " pm.expect(jsonResponse.params.status).to.be.a(\"String\");\r", + " pm.expect(jsonResponse.params.err).to.be.a(\"null\");\r", + " pm.expect(jsonResponse.params.errmsg).to.be.a(\"null\");\r", + "});\r", + "\r", + "pm.test(\"Status has string \", function () {\r", + " pm.expect(jsonResponse.params.status).to.be.equal(\"successful\");\r", + "});\r", + "\r", + "pm.test(\"Verify keys and data type of the response result\", () => {\r", + " pm.expect(jsonResponse.result).to.have.all.keys('node_id', 'versionKey');\r", + " pm.expect(jsonResponse.result.node_id).to.be.a(\"String\");\r", + " pm.expect(jsonResponse.result.versionKey).to.be.a(\"string\");\r", + "});\r", + "\r", + "pm.collectionVariables.set(\"fw10_node\",jsonResponse.result.node_id);\r", + "console.log(pm.collectionVariables.get(\"fw10_node\"));\r", + "\r", + "pm.test(`node id should be equal to ${pm.collectionVariables.get(\"fw10_node\")}`, () => {\r", + " pm.expect(jsonResponse.result.node_id).to.eql(pm.collectionVariables.get(\"fw10_code\"));\r", + "});\r", + "" + ], + "type": "text/javascript" + } + } + ], + "protocolProfileBehavior": { + "disabledSystemHeaders": {} + }, + "request": { + "method": "POST", + "header": [ + { + "key": "X-Channel-Id", + "value": "sunbird" + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "{{auth_token}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"framework\": {\n \"name\": \"{{fw10_name}}\",\n \"code\": \"{{fw10_code}}\"\n \n }\n }\n}" + }, + "url": { + "raw": "{{host}}/framework/v3/create", + "host": [ + "{{host}}" + ], + "path": [ + "framework", + "v3", + "create" + ] + }, + "description": "This API is associated with creating a new framework on the Sunbird Platform.\n - The endpoint for **Create a Framework** is `/framework/v1/create`\n - It points to knowledge-mw-service - `/v1/framework/create`\n - The fields marked with an asterisk (*) are mandatory. They cannot be null or empty." + }, + "response": [ + { + "name": "OK ! Successful operation.\"create framework\" operation was successfully executed.", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource\n Possible media types can be:- \n - application/json", + "key": "Content-Type", + "value": "Ut enim offici" + }, + { + "description": "(Required) To make use of the API, you require authorization. Raise a request to the administrator for the use of the API. You will receive the authorization key. Specify the key received, here.", + "key": "Authorization", + "value": "Ut enim offici" + }, + { + "description": "(Required) It is the Unique Id to identify the root organisation to which the user belongs", + "key": "X-Channel-Id", + "value": "Ut enim offici" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"framework\": {\n \"name\": \"Framework Name\",\n \"code\": \"dummy_framework\",\n \"channels\": [\n {\n \"identifier\": \"in.ekstep\"\n }\n ]\n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/framework/v1/create", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "framework", + "v1", + "create" + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"api.framework.create\",\n \"ver\": \"1.0\",\n \"ts\": \"2020-12-14T09:49:06.794Z\",\n \"params\": {\n \"resmsgid\": \"9b5d7ca0-3df1-11eb-9ff3-67c41480f6aa\",\n \"msgid\": \"9b4a90e0-3df1-11eb-9ff3-67c41480f6aa\",\n \"status\": \"successful\",\n \"err\": null,\n \"errmsg\": null\n },\n \"responseCode\": \"OK\",\n \"result\": {\n \"node_id\": \"dummy_framework\",\n \"versionKey\": \"1607939346678\"\n }\n}" + }, + { + "name": "BAD REQUEST. The \"create framework\" operation failed ! The possible reason for failure is that you may have missed providing input for a mandatory parameter.", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource\n Possible media types can be:- \n - application/json", + "key": "Content-Type", + "value": "Ut enim offici" + }, + { + "description": "(Required) To make use of the API, you require authorization. Raise a request to the administrator for the use of the API. You will receive the authorization key. Specify the key received, here.", + "key": "Authorization", + "value": "Ut enim offici" + }, + { + "description": "(Required) It is the Unique Id to identify the root organisation to which the user belongs", + "key": "X-Channel-Id", + "value": "Ut enim offici" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"framework\": {\n \"name\": \"Framework Name\",\n \"code\": \"dummy_framework\",\n \"channels\": [\n {\n \"identifier\": \"in.ekstep\"\n }\n ]\n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/framework/v1/create", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "framework", + "v1", + "create" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"api.framework.create\",\n \"ver\": \"1.0\",\n \"ts\": \"2020-12-14T09:50:45.249Z\",\n \"params\": {\n \"resmsgid\": \"d60c8710-3df1-11eb-9ff3-67c41480f6aa\",\n \"msgid\": null,\n \"status\": \"failed\",\n \"err\": \"CONSTRAINT_VALIDATION_FAILED\",\n \"errmsg\": \"Object already exists with identifier: dummy_framework\"\n },\n \"responseCode\": \"CLIENT_ERROR\",\n \"result\": {}\n}" + }, + { + "name": "INTERNAL SERVER ERROR ! Looks like something went wrong! These errors are tracked automatically, but if the problem persists feel free to contact us. In the meantime, try refreshing.", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource\n Possible media types can be:- \n - application/json", + "key": "Content-Type", + "value": "Ut enim offici" + }, + { + "description": "(Required) To make use of the API, you require authorization. Raise a request to the administrator for the use of the API. You will receive the authorization key. Specify the key received, here.", + "key": "Authorization", + "value": "Ut enim offici" + }, + { + "description": "(Required) It is the Unique Id to identify the root organisation to which the user belongs", + "key": "X-Channel-Id", + "value": "Ut enim offici" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"framework\": {\n \"name\": \"Framework Name\",\n \"code\": \"dummy_framework\",\n \"channels\": [\n {\n \"identifier\": \"in.ekstep\"\n }\n ]\n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/framework/v1/create", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "framework", + "v1", + "create" + ] + } + }, + "status": "Internal Server Error", + "code": 500, + "_postman_previewlanguage": "text", + "header": [ + { + "key": "Content-Type", + "value": "text/plain" + } + ], + "cookie": [], + "body": "" + } + ] + }, + { + "name": "Create framework Category", + "event": [ + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + }, + { + "listen": "test", + "script": { + "exec": [ + "// Removed duplicate declaration of jsonResponse\r", + "let jsonResponse = pm.response.json()\r", + "\r", + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "pm.test(\"id has string - api.taxonomy.category.instance.create \", function () {\r", + " pm.expect(jsonResponse.id).to.be.equal(\"api.taxonomy.category.instance.create\");\r", + "});\r", + "pm.test(\"Version is 3.0 \", function () {\r", + " pm.expect(jsonResponse.ver).to.be.equal(\"3.0\");\r", + "});\r", + "pm.test(\"Verify keys and data type of the response result\", () => {\r", + " pm.expect(jsonResponse.params).to.have.all.keys('resmsgid','msgid','status', 'err','errmsg');\r", + " pm.expect(jsonResponse.params.resmsgid).to.be.a(\"String\");\r", + " pm.expect(jsonResponse.params.msgid).to.be.a(\"null\");\r", + " pm.expect(jsonResponse.params.status).to.be.a(\"String\");\r", + " pm.expect(jsonResponse.params.err).to.be.a(\"null\");\r", + " pm.expect(jsonResponse.params.errmsg).to.be.a(\"null\");\r", + "});\r", + "\r", + "pm.test(\"Status has string \", function () {\r", + " pm.expect(jsonResponse.params.status).to.be.equal(\"successful\");\r", + "});\r", + "\r", + "pm.test(\"Verify keys and data type of the response result\", () => {\r", + " pm.expect(jsonResponse.result).to.have.all.keys('identifier', 'versionKey');\r", + " pm.expect(jsonResponse.result.identifier).to.be.a(\"String\");\r", + " pm.expect(jsonResponse.result.versionKey).to.be.a(\"string\");\r", + "});\r", + "\r", + "pm.collectionVariables.set(\"fwcat_cat5\",jsonResponse.result.identifier);\r", + "console.log(pm.collectionVariables.get(\"fwcat_cat5\"));\r", + "\r", + "pm.test(`identifier should be equal to ${pm.collectionVariables.get(\"fwcat_cat5\")}`, () => {\r", + " pm.expect(jsonResponse.result.identifier).to.eql(`${pm.collectionVariables.get(\"fw10_code\")}_${pm.collectionVariables.get(\"master12_code\")}`);\r", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "X-Channel-Id", + "value": "sunbird" + }, + { + "key": "Authorization", + "value": "" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"category\": {\n \"name\": \"Board\",\n \"code\": \"{{master12_code}}\",\n \"description\":\"Board category\"\n }\n }\n}" + }, + "url": { + "raw": "{{host}}/framework/v3/category/create?framework={{fw10_code}}", + "host": [ + "{{host}}" + ], + "path": [ + "framework", + "v3", + "category", + "create" + ], + "query": [ + { + "key": "framework", + "value": "{{fw10_code}}", + "description": "(Required) The code of the framework under which category has to be created" + } + ] + }, + "description": "This API is associated with creating a category under a framework\n - The endpoint for **Create Category** is `/framework/v1/category/create`\n - It points to knowledge-mw-service - `/v1/framework/category/create`\n - The fields marked with an asterisk (*) are mandatory. They cannot be null or empty." + }, + "response": [ + { + "name": "OK ! Successful operation.\"create category\" operation was successfully executed.", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource\n Possible media types can be:- \n - application/json", + "key": "Content-Type", + "value": "Ut enim offici" + }, + { + "description": "(Required) To make use of the API, you require authorization. Raise a request to the administrator for the use of the API. You will receive the authorization key. Specify the key received, here.", + "key": "Authorization", + "value": "Ut enim offici" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"category\": {\n \"name\": \"Subject\",\n \"code\": \"subject\"\n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/framework/v1/category/create?framework=Ut enim offici", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "framework", + "v1", + "category", + "create" + ], + "query": [ + { + "key": "framework", + "value": "Ut enim offici" + } + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"api.category.create\",\n \"ver\": \"1.0\",\n \"ts\": \"2020-12-14T19:32:01.754Z\",\n \"params\": {\n \"resmsgid\": \"0a10dba0-3e43-11eb-9ff3-67c41480f6aa\",\n \"msgid\": \"0a05df20-3e43-11eb-9ff3-67c41480f6aa\",\n \"status\": \"successful\",\n \"err\": null,\n \"errmsg\": null\n },\n \"responseCode\": \"OK\",\n \"result\": {\n \"node_id\": \"dummy_framework_medium\",\n \"versionKey\": \"1607974321700\"\n }\n}" + }, + { + "name": "BAD REQUEST. The \"create category\" operation failed ! The possible reason for failure is that you may have missed providing input for a mandatory parameter.", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource\n Possible media types can be:- \n - application/json", + "key": "Content-Type", + "value": "Ut enim offici" + }, + { + "description": "(Required) To make use of the API, you require authorization. Raise a request to the administrator for the use of the API. You will receive the authorization key. Specify the key received, here.", + "key": "Authorization", + "value": "Ut enim offici" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"category\": {\n \"name\": \"Subject\",\n \"code\": \"subject\"\n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/framework/v1/category/create?framework=Ut enim offici", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "framework", + "v1", + "category", + "create" + ], + "query": [ + { + "key": "framework", + "value": "Ut enim offici" + } + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"api.category.create\",\n \"ver\": \"1.0\",\n \"ts\": \"2020-12-14T19:30:50.114Z\",\n \"params\": {\n \"resmsgid\": \"df5d7620-3e42-11eb-9ff3-67c41480f6aa\",\n \"msgid\": null,\n \"status\": \"failed\",\n \"err\": \"CONSTRAINT_VALIDATION_FAILED\",\n \"errmsg\": \"Object already exists with identifier: dummy_framework_subject\"\n },\n \"responseCode\": \"CLIENT_ERROR\",\n \"result\": {}\n}" + }, + { + "name": "INTERNAL SERVER ERROR ! Looks like something went wrong! These errors are tracked automatically, but if the problem persists feel free to contact us. In the meantime, try refreshing.", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource\n Possible media types can be:- \n - application/json", + "key": "Content-Type", + "value": "Ut enim offici" + }, + { + "description": "(Required) To make use of the API, you require authorization. Raise a request to the administrator for the use of the API. You will receive the authorization key. Specify the key received, here.", + "key": "Authorization", + "value": "Ut enim offici" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"category\": {\n \"name\": \"Subject\",\n \"code\": \"subject\"\n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/framework/v1/category/create?framework=Ut enim offici", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "framework", + "v1", + "category", + "create" + ], + "query": [ + { + "key": "framework", + "value": "Ut enim offici" + } + ] + } + }, + "status": "Internal Server Error", + "code": 500, + "_postman_previewlanguage": "text", + "header": [ + { + "key": "Content-Type", + "value": "text/plain" + } + ], + "cookie": [], + "body": "" + } + ] + } + ] + }, + { + "name": "Positive", + "item": [ + { + "name": "Read framework category for a valid framework", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json()\r", + "\r", + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "pm.test(\"id has string - api.taxonomy.category.instance.read \", function () {\r", + " pm.expect(jsonResponse.id).to.be.equal(\"api.taxonomy.category.instance.read\");\r", + "});\r", + "pm.test(\"Version is 3.0 \", function () {\r", + " pm.expect(jsonResponse.ver).to.be.equal(\"3.0\");\r", + "});\r", + "pm.test(\"Verify keys and data type of the response result\", () => {\r", + " pm.expect(jsonResponse.params).to.have.all.keys('resmsgid','msgid','status', 'err','errmsg');\r", + "pm.expect(jsonResponse.params.resmsgid).to.be.a(\"String\");\r", + "pm.expect(jsonResponse.params.msgid).to.be.a(\"null\");\r", + " pm.expect(jsonResponse.params.status).to.be.a(\"String\");\r", + " pm.expect(jsonResponse.params.err).to.be.a(\"null\");\r", + " pm.expect(jsonResponse.params.errmsg).to.be.a(\"null\");\r", + "});\r", + "\r", + "pm.test(\"Verify keys and data type of the response result\", () => {\r", + " pm.expect(jsonResponse.result.categoryInstance).to.have.all.keys('identifier','lastStatusChangedOn','code','frameworks','channel','languageCode','createdOn','objectType','versionKey','framework','name','lastUpdatedOn','status','description');\r", + "});\r", + "\r", + "pm.test(\"Status has string: successful \", function () {\r", + " pm.expect(jsonResponse.params.status).to.be.equal(\"successful\");\r", + "});\r", + "\r", + "\r", + "\r", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "apikey", + "apikey": [ + { + "key": "key", + "value": "Authorization", + "type": "string" + }, + { + "key": "value", + "value": "{{apiKey}}", + "type": "string" + }, + { + "key": "in", + "value": "header", + "type": "string" + } + ] + }, + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "X-Channel-Id", + "value": "{{X-Channel-Id}}", + "type": "text" + }, + { + "key": "Content-Type", + "value": "application/json", + "type": "text" + } + ], + "url": { + "raw": "{{host}}/framework/v3/category/read/:{{master12_code}}?framework={{fw10_code}}", + "host": [ + "{{host}}" + ], + "path": [ + "framework", + "v3", + "category", + "read", + ":{{master12_code}}" + ], + "query": [ + { + "key": "framework", + "value": "{{fw10_code}}", + "description": "(Required) Name of the framework under which category exists. Its an abstract data structure which serves as a template for categories and terms" + } + ], + "variable": [ + { + "key": "{{master12_code}}", + "value": "" + } + ] + }, + "description": "This API is associated with fetching a category on Sunbird Platform\n - The endpoint for **Fetch Category** is `/framework/v1/category/read/{code}`\n - It points to knowledge-mw-service - `/v1/framework/category/read/{code}`\n - The fields marked with an asterisk (*) are mandatory. They cannot be null or empty." + }, + "response": [ + { + "name": "OK ! Successful operation.\"fetch category\" operation was successfully executed.", + "originalRequest": { + "method": "GET", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "The Content Type entity is the media type of the resource\n Possible media types can be:- \n - application/json", + "key": "Content-Type", + "value": "Ut enim offici" + }, + { + "description": "(Required) To make use of the API, you require authorization. Raise a request to the administrator for the use of the API. You will receive the authorization key. Specify the key received, here.", + "key": "Authorization", + "value": "Ut enim offici" + } + ], + "url": { + "raw": "{{baseUrl}}/framework/v1/category/read/:code?framework=Ut enim offici", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "framework", + "v1", + "category", + "read", + ":code" + ], + "query": [ + { + "key": "framework", + "value": "Ut enim offici" + } + ], + "variable": [ + { + "key": "code", + "value": "Ut enim offici", + "description": "(Required) The name/code of the category to be fetched" + } + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"api.category.read\",\n \"ver\": \"1.0\",\n \"ts\": \"2020-12-14T19:34:41.261Z\",\n \"params\": {\n \"resmsgid\": \"6923b1d0-3e43-11eb-9ff3-67c41480f6aa\",\n \"msgid\": \"691e3390-3e43-11eb-9ff3-67c41480f6aa\",\n \"status\": \"successful\",\n \"err\": null,\n \"errmsg\": null\n },\n \"responseCode\": \"OK\",\n \"result\": {\n \"category\": {\n \"identifier\": \"dummy_framework_subject\",\n \"lastStatusChangedOn\": \"2020-12-14T19:30:32.392+0000\",\n \"code\": \"subject\",\n \"frameworks\": [\n {\n \"identifier\": \"dummy_framework\",\n \"name\": \"Framework Name\",\n \"objectType\": \"Framework\",\n \"relation\": \"hasSequenceMember\",\n \"description\": \"Dumy framework updated\",\n \"status\": \"Live\"\n }\n ],\n \"consumerId\": \"7411b6bd-89f3-40ec-98d1-229dc64ce77d\",\n \"channel\": \"in.ekstep\",\n \"description\": \"Subject\",\n \"domains\": [],\n \"createdOn\": \"2020-12-14T19:30:32.392+0000\",\n \"versionKey\": \"1607974232392\",\n \"terms\": [],\n \"appId\": \"@ignore@\",\n \"name\": \"Subject\",\n \"lastUpdatedOn\": \"2020-12-14T19:30:32.392+0000\",\n \"status\": \"Live\"\n }\n }\n}" + }, + { + "name": "BAD REQUEST. The \"fetch category\" operation failed ! The possible reason for failure is that you may have missed providing input for a mandatory parameter.", + "originalRequest": { + "method": "GET", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "The Content Type entity is the media type of the resource\n Possible media types can be:- \n - application/json", + "key": "Content-Type", + "value": "Ut enim offici" + }, + { + "description": "(Required) To make use of the API, you require authorization. Raise a request to the administrator for the use of the API. You will receive the authorization key. Specify the key received, here.", + "key": "Authorization", + "value": "Ut enim offici" + } + ], + "url": { + "raw": "{{baseUrl}}/framework/v1/category/read/:code?framework=Ut enim offici", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "framework", + "v1", + "category", + "read", + ":code" + ], + "query": [ + { + "key": "framework", + "value": "Ut enim offici" + } + ], + "variable": [ + { + "key": "code", + "value": "Ut enim offici", + "description": "(Required) The name/code of the category to be fetched" + } + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"api.category.read\",\n \"ver\": \"1.0\",\n \"ts\": \"2020-12-14T19:35:21.540Z\",\n \"params\": {\n \"resmsgid\": \"8125c840-3e43-11eb-9ff3-67c41480f6aa\",\n \"msgid\": null,\n \"status\": \"failed\",\n \"err\": \"ERR_INVALID_FRAMEWORK_ID\",\n \"errmsg\": \"Invalid FrameworkId: dummy_framework1 for Categoryinstance \"\n },\n \"responseCode\": \"CLIENT_ERROR\",\n \"result\": {}\n}" + }, + { + "name": "INTERNAL SERVER ERROR ! Looks like something went wrong! These errors are tracked automatically, but if the problem persists feel free to contact us. In the meantime, try refreshing.", + "originalRequest": { + "method": "GET", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "The Content Type entity is the media type of the resource\n Possible media types can be:- \n - application/json", + "key": "Content-Type", + "value": "Ut enim offici" + }, + { + "description": "(Required) To make use of the API, you require authorization. Raise a request to the administrator for the use of the API. You will receive the authorization key. Specify the key received, here.", + "key": "Authorization", + "value": "Ut enim offici" + } + ], + "url": { + "raw": "{{baseUrl}}/framework/v1/category/read/:code?framework=Ut enim offici", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "framework", + "v1", + "category", + "read", + ":code" + ], + "query": [ + { + "key": "framework", + "value": "Ut enim offici" + } + ], + "variable": [ + { + "key": "code", + "value": "Ut enim offici", + "description": "(Required) The name/code of the category to be fetched" + } + ] + } + }, + "status": "Internal Server Error", + "code": 500, + "_postman_previewlanguage": "text", + "header": [ + { + "key": "Content-Type", + "value": "text/plain" + } + ], + "cookie": [], + "body": "" + }, + { + "name": "Read framework category for a valid framework", + "originalRequest": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "X-Channel-Id", + "value": "{{X-Channel-Id}}", + "type": "text" + }, + { + "key": "Content-Type", + "value": "application/json", + "type": "text" + } + ], + "url": { + "raw": "{{host}}/framework/v3/category/read/:{{master12_code}}?framework={{fw10_code}}", + "host": [ + "{{host}}" + ], + "path": [ + "framework", + "v3", + "category", + "read", + ":{{master12_code}}" + ], + "query": [ + { + "key": "framework", + "value": "{{fw10_code}}", + "description": "(Required) Name of the framework under which category exists. Its an abstract data structure which serves as a template for categories and terms" + } + ], + "variable": [ + { + "key": "{{master12_code}}", + "value": "" + } + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Server", + "value": "openresty/1.21.4.3" + }, + { + "key": "Date", + "value": "Tue, 02 Jan 2024 08:48:11 GMT" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Content-Length", + "value": "819" + }, + { + "key": "Request-Time", + "value": "7" + }, + { + "key": "X-Cache", + "value": "MISS from tg413d37" + }, + { + "key": "X-Cache-Lookup", + "value": "MISS from tg413d37:3120" + }, + { + "key": "Via", + "value": "1.1 tg413d37 (squid/5.7)" + }, + { + "key": "Connection", + "value": "keep-alive" + } + ], + "cookie": [], + "body": "{\n \"id\": \"api.taxonomy.category.instance.read\",\n \"ver\": \"3.0\",\n \"ts\": \"2024-01-02T08:48:11ZZ\",\n \"params\": {\n \"resmsgid\": \"ec5281f5-354b-4478-ab6d-9173933c5dcc\",\n \"msgid\": null,\n \"err\": null,\n \"status\": \"successful\",\n \"errmsg\": null\n },\n \"responseCode\": \"OK\",\n \"result\": {\n \"categoryInstance\": {\n \"identifier\": \"fw10_code2_master12_cat_2\",\n \"lastStatusChangedOn\": \"2024-01-02T08:28:08.608+0000\",\n \"code\": \"master12_cat_2\",\n \"frameworks\": [\n {\n \"name\": \"fw10_name\",\n \"relation\": \"hasSequenceMember\",\n \"identifier\": \"fw10_code2\",\n \"description\": null,\n \"objectType\": \"Framework\",\n \"status\": \"Live\",\n \"type\": \"K-12\"\n }\n ],\n \"channel\": \"sunbird\",\n \"description\": \"Board category\",\n \"languageCode\": [],\n \"createdOn\": \"2024-01-02T08:28:08.608+0000\",\n \"objectType\": \"CategoryInstance\",\n \"versionKey\": \"1704184088608\",\n \"framework\": \"fw10_code2\",\n \"name\": \"Board\",\n \"lastUpdatedOn\": \"2024-01-02T08:28:08.608+0000\",\n \"status\": \"Live\"\n }\n }\n}" + } + ] + } + ] + }, + { + "name": "Negative", + "item": [ + { + "name": "Read valid framework category for an invalid framework", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json()\r", + "\r", + "pm.test(\"Status code is 404\", function () {\r", + " pm.response.to.have.status(404);\r", + "});\r", + "\r", + "pm.test(\"Status code name has string\", function () {\r", + " pm.response.to.have.status(\"Not Found\");\r", + "});\r", + "pm.test(\"id has string - api.taxonomy.category.instance.read \", function () {\r", + " pm.expect(jsonResponse.id).to.be.equal(\"api.taxonomy.category.instance.read\");\r", + "});\r", + "pm.test(\"Version is 3.0 \", function () {\r", + " pm.expect(jsonResponse.ver).to.be.equal(\"3.0\");\r", + "});\r", + "pm.test(\"Verify keys and data type of the response result\", () => {\r", + " pm.expect(jsonResponse.params).to.have.all.keys('resmsgid','msgid','err','status','errmsg');\r", + " pm.expect(jsonResponse.params.resmsgid).to.be.a(\"String\");\r", + " pm.expect(jsonResponse.params.msgid).to.be.a(\"null\");\r", + " pm.expect(jsonResponse.params.err).to.be.a(\"String\");\r", + " pm.expect(jsonResponse.params.status).to.be.a(\"String\");\r", + " pm.expect(jsonResponse.params.errmsg).to.be.a(\"String\");\r", + " });\r", + "\r", + "pm.test(\"Err has string\", function () {\r", + " pm.expect(jsonResponse.params.err).to.be.equal(\"NOT_FOUND\");\r", + "});\r", + "pm.test(\"Status has string\", function () {\r", + " pm.expect(jsonResponse.params.status).to.be.equal(\"failed\");\r", + "});\r", + "pm.test(`errmsg has string: Error! Node(s) doesn't Exists. | [Invalid Node Id.]: dummy_${pm.globals.get(\"category\")}`, function () {\r", + " pm.expect(jsonResponse.params.errmsg).to.be.include(`Error! Node(s) doesn't Exists. | [Invalid Node Id.]: dummy_${pm.collectionVariables.get(\"master12_code\")}`);\r", + "});\r", + "pm.test(\"responseCode has string\", function () {\r", + " pm.expect(jsonResponse.responseCode).to.be.equal(\"RESOURCE_NOT_FOUND\");\r", + "});\r", + "\r", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "X-Channel-Id", + "value": "{{X-Channel-Id}}" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "{{apiKey}}" + } + ], + "url": { + "raw": "{{host}}/framework/v3/category/read/:{{master12_code}}?framework=dummy", + "host": [ + "{{host}}" + ], + "path": [ + "framework", + "v3", + "category", + "read", + ":{{master12_code}}" + ], + "query": [ + { + "key": "framework", + "value": "dummy" + } + ], + "variable": [ + { + "key": "{{master12_code}}", + "value": "" + } + ] + } + }, + "response": [] + }, + { + "name": "Read invalid framework category for valid framework", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json()\r", + "\r", + "pm.test(\"Status code is 404\", function () {\r", + " pm.response.to.have.status(404);\r", + "});\r", + "\r", + "pm.test(\"Status code name has string\", function () {\r", + " pm.response.to.have.status(\"Not Found\");\r", + "});\r", + "pm.test(\"id has string - api.taxonomy.category.instance.read \", function () {\r", + " pm.expect(jsonResponse.id).to.be.equal(\"api.taxonomy.category.instance.read\");\r", + "});\r", + "pm.test(\"Version is 3.0 \", function () {\r", + " pm.expect(jsonResponse.ver).to.be.equal(\"3.0\");\r", + "});\r", + "pm.test(\"Verify keys and data type of the response result\", () => {\r", + " pm.expect(jsonResponse.params).to.have.all.keys('resmsgid','msgid','err','status','errmsg');\r", + " pm.expect(jsonResponse.params.resmsgid).to.be.a(\"String\");\r", + " pm.expect(jsonResponse.params.msgid).to.be.a(\"null\");\r", + " pm.expect(jsonResponse.params.err).to.be.a(\"String\");\r", + " pm.expect(jsonResponse.params.status).to.be.a(\"String\");\r", + " pm.expect(jsonResponse.params.errmsg).to.be.a(\"String\");\r", + " });\r", + "\r", + "pm.test(\"Err has string\", function () {\r", + " pm.expect(jsonResponse.params.err).to.be.equal(\"NOT_FOUND\");\r", + "});\r", + "pm.test(\"Status has string\", function () {\r", + " pm.expect(jsonResponse.params.status).to.be.equal(\"failed\");\r", + "});\r", + "pm.test(`errmsg has string: Error! Node(s) doesn't Exists. | [Invalid Node Id.]: ${pm.globals.get(\"node_id\")}_abc` , function () {\r", + " pm.expect(jsonResponse.params.errmsg).to.be.include(`Error! Node(s) doesn't Exists. | [Invalid Node Id.]: ${pm.collectionVariables.get(\"master12_code\")}_abc`);\r", + "});\r", + "pm.test(\"responseCode has string\", function () {\r", + " pm.expect(jsonResponse.responseCode).to.be.equal(\"RESOURCE_NOT_FOUND\");\r", + "});\r", + "\r", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "X-Channel-Id", + "value": "sunbird" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "{{apiKey}}" + } + ], + "url": { + "raw": "{{host}}/framework/v3/category/read/:abc?framework={{master12_code}}", + "host": [ + "{{host}}" + ], + "path": [ + "framework", + "v3", + "category", + "read", + ":abc" + ], + "query": [ + { + "key": "framework", + "value": "{{master12_code}}" + } + ], + "variable": [ + { + "key": "abc", + "value": "" + } + ] + } + }, + "response": [] + }, + { + "name": "Read invalid framework category for an invalid framework", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json()\r", + "\r", + "pm.test(\"Status code is 404\", function () {\r", + " pm.response.to.have.status(404);\r", + "});\r", + "\r", + "pm.test(\"Status code name has string\", function () {\r", + " pm.response.to.have.status(\"Not Found\");\r", + "});\r", + "pm.test(\"id has string - api.taxonomy.category.instance.read \", function () {\r", + " pm.expect(jsonResponse.id).to.be.equal(\"api.taxonomy.category.instance.read\");\r", + "});\r", + "pm.test(\"Version is 3.0 \", function () {\r", + " pm.expect(jsonResponse.ver).to.be.equal(\"3.0\");\r", + "});\r", + "\r", + "pm.test(\"Verify keys and data type of the response result\", () => {\r", + " pm.expect(jsonResponse.params).to.have.all.keys('resmsgid','msgid','err','status','errmsg');\r", + " pm.expect(jsonResponse.params.resmsgid).to.be.a(\"String\");\r", + " pm.expect(jsonResponse.params.msgid).to.be.a(\"null\");\r", + " pm.expect(jsonResponse.params.err).to.be.a(\"String\");\r", + " pm.expect(jsonResponse.params.status).to.be.a(\"String\");\r", + " pm.expect(jsonResponse.params.errmsg).to.be.a(\"String\");\r", + " });\r", + "\r", + "pm.test(\"Err has string\", function () {\r", + " pm.expect(jsonResponse.params.err).to.be.equal(\"NOT_FOUND\");\r", + "});\r", + "pm.test(\"Status has string\", function () {\r", + " pm.expect(jsonResponse.params.status).to.be.equal(\"failed\");\r", + "});\r", + "pm.test(`errmsg has string: Error! Node(s) doesn't Exists. | [Invalid Node Id.]: dummy_abc`, function () {\r", + " pm.expect(jsonResponse.params.errmsg).to.be.include(`Error! Node(s) doesn't Exists. | [Invalid Node Id.]: dummy_abc`);\r", + "});\r", + "pm.test(\"responseCode has string\", function () {\r", + " pm.expect(jsonResponse.responseCode).to.be.equal(\"RESOURCE_NOT_FOUND\");\r", + "});\r", + "\r", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "X-Channel-Id", + "value": "sunbird" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "{{apiKey}}" + } + ], + "url": { + "raw": "{{host}}/framework/v3/category/read/:abc?framework=dummy", + "host": [ + "{{host}}" + ], + "path": [ + "framework", + "v3", + "category", + "read", + ":abc" + ], + "query": [ + { + "key": "framework", + "value": "dummy" + } + ], + "variable": [ + { + "key": "abc", + "value": "" + } + ] + } + }, + "response": [] + } + ] + } + ] + }, + { + "name": "Delete data", + "item": [ + { + "name": "Delete master category", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json()\r", + "\r", + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "pm.collectionVariables.set(\"master8_node\",jsonResponse.result.node_id);\r", + "console.log(pm.collectionVariables.get(\"master8_node\"));\r", + "\r", + "pm.collectionVariables.set(\"master8_id\",jsonResponse.result.node_id);\r", + "console.log(pm.collectionVariables.get(\"master8_id\"));\r", + "\r", + "pm.test(`identifier should be equal to ${pm.collectionVariables.get(\"master8_id\")}`, () => {\r", + " pm.expect(jsonResponse.result.identifier).to.eql(`${pm.collectionVariables.get(\"master8_code\")}`);\r", + "});\r", + "\r", + "pm.test(`node_id should be equal to ${pm.collectionVariables.get(\"master8_node\")}`, () => {\r", + " pm.expect(jsonResponse.result.node_id).to.eql(`${pm.collectionVariables.get(\"master8_code\")}`);\r", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "apikey", + "apikey": [ + { + "key": "value", + "value": "{{auth_token}}", + "type": "string" + }, + { + "key": "key", + "value": "Authorization", + "type": "string" + }, + { + "key": "in", + "value": "header", + "type": "string" + } + ] + }, + "method": "DELETE", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "X-Channel-Id", + "value": "{{X-Channel-Id}}" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "url": { + "raw": "{{host}}/framework/v3/category/master/retire/{{master8_code}}", + "host": [ + "{{host}}" + ], + "path": [ + "framework", + "v3", + "category", + "master", + "retire", + "{{master8_code}}" + ] + } + }, + "response": [] + }, + { + "name": "Delete framework", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json()\r", + "\r", + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "\r", + "pm.collectionVariables.set(\"fw7_node\",jsonResponse.result.node_id);\r", + "console.log(pm.collectionVariables.get(\"fw7_node\"));\r", + "\r", + "pm.test(`node id should be equal to ${pm.collectionVariables.get(\"fw7_node\")}`, () => {\r", + " pm.expect(jsonResponse.result.node_id).to.eql(pm.collectionVariables.get(\"fw7_code\"));\r", + "});\r", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "apikey", + "apikey": [ + { + "key": "in", + "value": "header", + "type": "string" + }, + { + "key": "value", + "value": "{{auth_token}}", + "type": "string" + }, + { + "key": "key", + "value": "Authorization", + "type": "string" + } + ] + }, + "method": "DELETE", + "header": [ + { + "key": "X-Channel-Id", + "value": "{{X-Channel-Id}}", + "type": "text" + }, + { + "key": "Accept", + "value": "application/json", + "type": "text" + }, + { + "key": "Content-Type", + "value": "application/json", + "type": "text" + } + ], + "url": { + "raw": "{{host}}/framework/v3/retire/{{fw7_code}}", + "host": [ + "{{host}}" + ], + "path": [ + "framework", + "v3", + "retire", + "{{fw7_code}}" + ] + } + }, + "response": [] + }, + { + "name": "Delete master category", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json()\r", + "\r", + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "pm.collectionVariables.set(\"master9_node\",jsonResponse.result.node_id);\r", + "console.log(pm.collectionVariables.get(\"master9_node\"));\r", + "\r", + "pm.collectionVariables.set(\"master9_id\",jsonResponse.result.node_id);\r", + "console.log(pm.collectionVariables.get(\"master9_id\"));\r", + "\r", + "pm.test(`identifier should be equal to ${pm.collectionVariables.get(\"master9_id\")}`, () => {\r", + " pm.expect(jsonResponse.result.identifier).to.eql(`${pm.collectionVariables.get(\"master9_code\")}`);\r", + "});\r", + "\r", + "pm.test(`node_id should be equal to ${pm.collectionVariables.get(\"master9_node\")}`, () => {\r", + " pm.expect(jsonResponse.result.node_id).to.eql(`${pm.collectionVariables.get(\"master9_code\")}`);\r", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "apikey", + "apikey": [ + { + "key": "value", + "value": "{{auth_token}}", + "type": "string" + }, + { + "key": "key", + "value": "Authorization", + "type": "string" + }, + { + "key": "in", + "value": "header", + "type": "string" + } + ] + }, + "method": "DELETE", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "X-Channel-Id", + "value": "{{X-Channel-Id}}" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "url": { + "raw": "{{host}}/framework/v3/category/master/retire/{{master9_code}}", + "host": [ + "{{host}}" + ], + "path": [ + "framework", + "v3", + "category", + "master", + "retire", + "{{master9_code}}" + ] + } + }, + "response": [] + }, + { + "name": "Delete framework category", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json()\r", + "\r", + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "\r", + "\r", + "pm.test(`identifier should be equal to ${pm.collectionVariables.get(\"fwcat_cat2\")}`, () => {\r", + " pm.expect(jsonResponse.result.identifier).to.eql(`${pm.collectionVariables.get(\"fw7_code\")}_${pm.collectionVariables.get(\"master8_code\")}`);\r", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "DELETE", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "X-Channel-Id", + "value": "sunbird" + } + ], + "url": { + "raw": "{{host}}/framework/v3/category/retire/{{master8_code}}?framework={{fw7_code}}", + "host": [ + "{{host}}" + ], + "path": [ + "framework", + "v3", + "category", + "retire", + "{{master8_code}}" + ], + "query": [ + { + "key": "framework", + "value": "{{fw7_code}}" + } + ] + } + }, + "response": [] + }, + { + "name": "Delete master category Copy", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json()\r", + "\r", + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "pm.collectionVariables.set(\"master10_node\",jsonResponse.result.node_id);\r", + "console.log(pm.collectionVariables.get(\"master10_node\"));\r", + "\r", + "pm.collectionVariables.set(\"master10_id\",jsonResponse.result.node_id);\r", + "console.log(pm.collectionVariables.get(\"master10_id\"));\r", + "\r", + "pm.test(`identifier should be equal to ${pm.collectionVariables.get(\"master10_id\")}`, () => {\r", + " pm.expect(jsonResponse.result.identifier).to.eql(`${pm.collectionVariables.get(\"master10_code\")}`);\r", + "});\r", + "\r", + "pm.test(`node_id should be equal to ${pm.collectionVariables.get(\"master10_node\")}`, () => {\r", + " pm.expect(jsonResponse.result.node_id).to.eql(`${pm.collectionVariables.get(\"master10_code\")}`);\r", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "apikey", + "apikey": [ + { + "key": "value", + "value": "{{auth_token}}", + "type": "string" + }, + { + "key": "key", + "value": "Authorization", + "type": "string" + }, + { + "key": "in", + "value": "header", + "type": "string" + } + ] + }, + "method": "DELETE", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "X-Channel-Id", + "value": "{{X-Channel-Id}}" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "url": { + "raw": "{{host}}/framework/v3/category/master/retire/{{master10_code}}", + "host": [ + "{{host}}" + ], + "path": [ + "framework", + "v3", + "category", + "master", + "retire", + "{{master10_code}}" + ] + } + }, + "response": [] + }, + { + "name": "Delete framework", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json()\r", + "\r", + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "\r", + "pm.collectionVariables.set(\"fw8_node\",jsonResponse.result.node_id);\r", + "console.log(pm.collectionVariables.get(\"fw8_node\"));\r", + "\r", + "pm.test(`node id should be equal to ${pm.collectionVariables.get(\"fw8_node\")}`, () => {\r", + " pm.expect(jsonResponse.result.node_id).to.eql(pm.collectionVariables.get(\"fw8_code\"));\r", + "});\r", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "apikey", + "apikey": [ + { + "key": "in", + "value": "header", + "type": "string" + }, + { + "key": "value", + "value": "{{auth_token}}", + "type": "string" + }, + { + "key": "key", + "value": "Authorization", + "type": "string" } + ] + }, + "method": "DELETE", + "header": [ + { + "key": "X-Channel-Id", + "value": "{{X-Channel-Id}}", + "type": "text" }, - "response": [] + { + "key": "Accept", + "value": "application/json", + "type": "text" + }, + { + "key": "Content-Type", + "value": "application/json", + "type": "text" + } + ], + "url": { + "raw": "{{host}}/framework/v3/retire/{{fw8_code}}", + "host": [ + "{{host}}" + ], + "path": [ + "framework", + "v3", + "retire", + "{{fw8_code}}" + ] + } + }, + "response": [] + }, + { + "name": "Delete framework category", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json()\r", + "\r", + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "\r", + "pm.collectionVariables.set(\"fwcat_cat3\",jsonResponse.result.identifier);\r", + "console.log(pm.collectionVariables.get(\"fwcat_cat3\"));\r", + "\r", + "pm.test(`identifier should be equal to ${pm.collectionVariables.get(\"fwcat_cat3\")}`, () => {\r", + " pm.expect(jsonResponse.result.identifier).to.eql(`${pm.collectionVariables.get(\"fw8_code\")}_${pm.collectionVariables.get(\"master10_code\")}`);\r", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "DELETE", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "X-Channel-Id", + "value": "sunbird" + } + ], + "url": { + "raw": "{{host}}/framework/v3/category/retire/{{master10_code}}?framework={{fw8_code}}", + "host": [ + "{{host}}" + ], + "path": [ + "framework", + "v3", + "category", + "retire", + "{{master10_code}}" + ], + "query": [ + { + "key": "framework", + "value": "{{fw8_code}}" + } + ] + } + }, + "response": [] + }, + { + "name": "Delete master category", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json()\r", + "\r", + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "pm.collectionVariables.set(\"master11_node\",jsonResponse.result.node_id);\r", + "console.log(pm.collectionVariables.get(\"master11_node\"));\r", + "\r", + "pm.collectionVariables.set(\"master11_id\",jsonResponse.result.node_id);\r", + "console.log(pm.collectionVariables.get(\"master11_id\"));\r", + "\r", + "pm.test(`identifier should be equal to ${pm.collectionVariables.get(\"master11_id\")}`, () => {\r", + " pm.expect(jsonResponse.result.identifier).to.eql(`${pm.collectionVariables.get(\"master11_code\")}`);\r", + "});\r", + "\r", + "pm.test(`node_id should be equal to ${pm.collectionVariables.get(\"master11_node\")}`, () => {\r", + " pm.expect(jsonResponse.result.node_id).to.eql(`${pm.collectionVariables.get(\"master11_code\")}`);\r", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "apikey", + "apikey": [ + { + "key": "value", + "value": "{{auth_token}}", + "type": "string" + }, + { + "key": "key", + "value": "Authorization", + "type": "string" + }, + { + "key": "in", + "value": "header", + "type": "string" + } + ] }, + "method": "DELETE", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "X-Channel-Id", + "value": "{{X-Channel-Id}}" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "url": { + "raw": "{{host}}/framework/v3/category/master/retire/{{master11_code}}", + "host": [ + "{{host}}" + ], + "path": [ + "framework", + "v3", + "category", + "master", + "retire", + "{{master11_code}}" + ] + } + }, + "response": [] + }, + { + "name": "Delete framework", + "event": [ { - "name": "Create a framework for invalid channel id", + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json()\r", + "\r", + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "\r", + "pm.collectionVariables.set(\"fw9_node\",jsonResponse.result.node_id);\r", + "console.log(pm.collectionVariables.get(\"fw9_node\"));\r", + "\r", + "pm.test(`node id should be equal to ${pm.collectionVariables.get(\"fw9_node\")}`, () => {\r", + " pm.expect(jsonResponse.result.node_id).to.eql(pm.collectionVariables.get(\"fw9_code\"));\r", + "});\r", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "apikey", + "apikey": [ + { + "key": "in", + "value": "header", + "type": "string" + }, + { + "key": "value", + "value": "{{auth_token}}", + "type": "string" + }, + { + "key": "key", + "value": "Authorization", + "type": "string" + } + ] + }, + "method": "DELETE", + "header": [ + { + "key": "X-Channel-Id", + "value": "{{X-Channel-Id}}", + "type": "text" + }, + { + "key": "Accept", + "value": "application/json", + "type": "text" + }, + { + "key": "Content-Type", + "value": "application/json", + "type": "text" + } + ], + "url": { + "raw": "{{host}}/framework/v3/retire/{{fw9_code}}", + "host": [ + "{{host}}" + ], + "path": [ + "framework", + "v3", + "retire", + "{{fw9_code}}" + ] + } + }, + "response": [] + }, + { + "name": "Delete framework category", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json()\r", + "\r", + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "\r", + "pm.test(`identifier should be equal to ${pm.collectionVariables.get(\"fwcat_cat4\")}`, () => {\r", + " pm.expect(jsonResponse.result.identifier).to.eql(`${pm.collectionVariables.get(\"fw9_code\")}_${pm.collectionVariables.get(\"master11_code\")}`);\r", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "DELETE", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "X-Channel-Id", + "value": "sunbird" + } + ], + "url": { + "raw": "{{host}}/framework/v3/category/retire/{{master11_code}}?framework={{fw9_code}}", + "host": [ + "{{host}}" + ], + "path": [ + "framework", + "v3", + "category", + "retire", + "{{master11_code}}" + ], + "query": [ + { + "key": "framework", + "value": "{{fw9_code}}" + } + ] + } + }, + "response": [] + }, + { + "name": "Delete master category", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json()\r", + "\r", + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "pm.collectionVariables.set(\"master12_node\",jsonResponse.result.node_id);\r", + "console.log(pm.collectionVariables.get(\"master12_node\"));\r", + "\r", + "pm.collectionVariables.set(\"master12_id\",jsonResponse.result.node_id);\r", + "console.log(pm.collectionVariables.get(\"master12_id\"));\r", + "\r", + "pm.test(`identifier should be equal to ${pm.collectionVariables.get(\"master12_id\")}`, () => {\r", + " pm.expect(jsonResponse.result.identifier).to.eql(`${pm.collectionVariables.get(\"master12_code\")}`);\r", + "});\r", + "\r", + "pm.test(`node_id should be equal to ${pm.collectionVariables.get(\"master12_node\")}`, () => {\r", + " pm.expect(jsonResponse.result.node_id).to.eql(`${pm.collectionVariables.get(\"master12_code\")}`);\r", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "apikey", + "apikey": [ + { + "key": "value", + "value": "{{auth_token}}", + "type": "string" + }, + { + "key": "key", + "value": "Authorization", + "type": "string" + }, + { + "key": "in", + "value": "header", + "type": "string" + } + ] + }, + "method": "DELETE", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "X-Channel-Id", + "value": "{{X-Channel-Id}}" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "url": { + "raw": "{{host}}/framework/v3/category/master/retire/{{master12_code}}", + "host": [ + "{{host}}" + ], + "path": [ + "framework", + "v3", + "category", + "master", + "retire", + "{{master12_code}}" + ] + } + }, + "response": [] + }, + { + "name": "Delete framework", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json()\r", + "\r", + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "\r", + "pm.collectionVariables.set(\"fw10_node\",jsonResponse.result.node_id);\r", + "console.log(pm.collectionVariables.get(\"fw10_node\"));\r", + "\r", + "pm.test(`node id should be equal to ${pm.collectionVariables.get(\"fw10_node\")}`, () => {\r", + " pm.expect(jsonResponse.result.node_id).to.eql(pm.collectionVariables.get(\"fw10_code\"));\r", + "});\r", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "apikey", + "apikey": [ + { + "key": "in", + "value": "header", + "type": "string" + }, + { + "key": "value", + "value": "{{auth_token}}", + "type": "string" + }, + { + "key": "key", + "value": "Authorization", + "type": "string" + } + ] + }, + "method": "DELETE", + "header": [ + { + "key": "X-Channel-Id", + "value": "{{X-Channel-Id}}", + "type": "text" + }, + { + "key": "Accept", + "value": "application/json", + "type": "text" + }, + { + "key": "Content-Type", + "value": "application/json", + "type": "text" + } + ], + "url": { + "raw": "{{host}}/framework/v3/retire/{{fw10_code}}", + "host": [ + "{{host}}" + ], + "path": [ + "framework", + "v3", + "retire", + "{{fw10_code}}" + ] + } + }, + "response": [] + }, + { + "name": "Delete framework category", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json()\r", + "\r", + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "\r", + "pm.collectionVariables.set(\"fw_catgry\",jsonResponse.result.identifier);\r", + "console.log(pm.collectionVariables.get(\"fw_catgry\"));\r", + "\r", + "pm.test(`identifier should be equal to ${pm.collectionVariables.get(\"fw_catgry\")}`, () => {\r", + " pm.expect(jsonResponse.result.identifier).to.eql(`${pm.collectionVariables.get(\"fw10_code\")}_${pm.collectionVariables.get(\"master12_code\")}`);\r", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "DELETE", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "X-Channel-Id", + "value": "sunbird" + } + ], + "url": { + "raw": "{{host}}/framework/v3/category/retire/{{master12_code}}?framework={{fw10_code}}", + "host": [ + "{{host}}" + ], + "path": [ + "framework", + "v3", + "category", + "retire", + "{{master12_code}}" + ], + "query": [ + { + "key": "framework", + "value": "{{fw10_code}}" + } + ] + } + }, + "response": [] + } + ] + } + ], + "description": "Pre requisite:\n\n1. Master category should be available before creating framework category\n2. Master category and framework should be updated before running the collection (in the pre requisite folder as well)", + "event": [ + { + "listen": "prerequest", + "script": { + "type": "text/javascript", + "exec": [ + "//Scenario-1", + "pm.collectionVariables.set(\"master8_code\", \"master8_cat_6\");", + "pm.collectionVariables.set(\"fw7_name\", \"fw7_name\");", + "pm.collectionVariables.set(\"fw7_code\", \"fw7_code6\");", + "pm.collectionVariables.set(\"master9_code\", \"master9_cat_6\");", + "//Scenarion-2", + "pm.collectionVariables.set(\"master10_code\", \"master10_cat_5\");", + "pm.collectionVariables.set(\"fw8_name\", \"fw8_name\");", + "pm.collectionVariables.set(\"fw8_code\", \"fw8_code5\");", + "//Scenario-3", + "pm.collectionVariables.set(\"master11_code\", \"master11_cat_5\");", + "pm.collectionVariables.set(\"fw9_name\", \"fw9_name\");", + "pm.collectionVariables.set(\"fw9_code\", \"fw9_code6\");", + "//Scenario-4", + "pm.collectionVariables.set(\"master12_code\", \"master12_cat_6\");", + "pm.collectionVariables.set(\"fw10_name\", \"fw10_name\");", + "pm.collectionVariables.set(\"fw10_code\", \"fw10_code6\");", + "" + ] + } + }, + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "" + ] + } + } + ] + }, + { + "name": "term", + "item": [ + { + "name": "Create Term", + "item": [ + { + "name": "Pre requisite", + "item": [ + { + "name": "Create a master category", "event": [ { "listen": "prerequest", "script": { "exec": [ - "pm.globals.set(\"name\", \"Framework19\");\r", - "pm.globals.set(\"code\", \"Framework19\");" + "" ], "type": "text/javascript" } @@ -1517,95 +16152,61 @@ "exec": [ "let jsonResponse = pm.response.json()\r", "\r", - "pm.test(\"Status code is 404\", function () {\r", - " pm.response.to.have.status(404);\r", - "});\r", - "\r", - "pm.test(\"Status code name has string\", function () {\r", - " pm.response.to.have.status(\"Not Found\");\r", - "});\r", - "\r", - "pm.test(\"Verify keys and data type of the response result\", () => {\r", - " pm.expect(jsonResponse.params).to.have.all.keys('resmsgid','msgid','status', 'err','errmsg');\r", - " pm.expect(jsonResponse.params.status).to.be.a(\"String\");\r", - " pm.expect(jsonResponse.params.err).to.be.a(\"String\");\r", - " pm.expect(jsonResponse.params.errmsg).to.be.a(\"String\");\r", - "});\r", - "\r", - "pm.test(\"Status has string \", function () {\r", - " pm.expect(jsonResponse.params.status).to.be.equal(\"failed\");\r", - "});\r", - "\r", - "pm.test(\"Status code name has string\", function () {\r", - " pm.expect(jsonResponse.params.err).to.be.equal(\"NOT_FOUND\");\r", + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", "});\r", "\r", - "pm.test(\"Status code name has string\", function () {\r", - " pm.expect(jsonResponse.params.errmsg).to.be.equal(\"Error! Node(s) doesn't Exists. | [Invalid Node Id.]: dummy\");\r", - "});\r", + "pm.collectionVariables.set(\"master13_id\",jsonResponse.result.identifier);\r", + "console.log(pm.collectionVariables.get(\"master13_id\"));\r", + "pm.collectionVariables.set(\"master13_node\",jsonResponse.result.node_id);\r", + "console.log(pm.collectionVariables.get(\"master13_node\"));\r", "\r", - "pm.test(\"Status code name has string\", function () {\r", - " pm.expect(jsonResponse.responseCode).to.be.equal(\"RESOURCE_NOT_FOUND\");\r", + "pm.test(`identifier should be equal to ${pm.collectionVariables.get(\"master13_id\")}`, () => {\r", + " pm.expect(jsonResponse.result.identifier).to.eql(`${pm.collectionVariables.get(\"master13_code\")}`);\r", "});\r", "\r", - "\r", - "" + "pm.test(`node_id should be equal to ${pm.collectionVariables.get(\"master13_node\")}`, () => {\r", + " pm.expect(jsonResponse.result.node_id).to.eql(`${pm.collectionVariables.get(\"master13_code\")}`);\r", + "});" ], "type": "text/javascript" } } ], "request": { - "auth": { - "type": "apikey", - "apikey": [ - { - "key": "value", - "value": "{{auth_token}}", - "type": "string" - }, - { - "key": "key", - "value": "Authorization", - "type": "string" - }, - { - "key": "in", - "value": "header", - "type": "string" - } - ] - }, "method": "POST", "header": [ { "key": "Accept", - "value": "application/json", - "type": "text" + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" }, { "key": "X-Channel-Id", - "value": "dummy", - "type": "text" + "value": "sunbird" }, { - "key": "Content-Type", - "value": "application/json", - "type": "text" + "key": "Authorization", + "value": "{{auth_token}}" } ], "body": { "mode": "raw", - "raw": "{\r\n \"request\": {\r\n \"framework\": {\r\n \"name\": \"{{name}}\",\r\n \"code\": \"{{code}}\"\r\n }\r\n }\r\n}" + "raw": "{\n \"request\": {\n \"category\": {\n \"name\": \"master\",\n \"code\": \"{{master13_code}}\",\n \"targetIdFieldName\": \"targetmasterIds\",\n \"searchLabelFieldName\": \"se_master\",\n \"searchIdFieldName\": \"se_master\",\n \"orgIdFieldName\": \"masterIds\"\n }\n }\n}" }, "url": { - "raw": "{{host}}/framework/v3/create", + "raw": "{{host}}/framework/v3/category/master/create", "host": [ "{{host}}" ], "path": [ "framework", "v3", + "category", + "master", "create" ] } @@ -1613,7 +16214,7 @@ "response": [] }, { - "name": "Create a framework that already exists", + "name": "Create a framework", "event": [ { "listen": "prerequest", @@ -1630,44 +16231,42 @@ "exec": [ "let jsonResponse = pm.response.json()\r", "\r", - "pm.test(\"Status code is 400\", function () {\r", - " pm.response.to.have.status(400);\r", - "});\r", - "\r", - "pm.test(\"Status code name has string\", function () {\r", - " pm.response.to.have.status(\"Bad Request\");\r", + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", "});\r", "\r", "pm.test(\"Verify keys and data type of the response result\", () => {\r", " pm.expect(jsonResponse.params).to.have.all.keys('resmsgid','msgid','status', 'err','errmsg');\r", " pm.expect(jsonResponse.params.status).to.be.a(\"String\");\r", - " pm.expect(jsonResponse.params.err).to.be.a(\"String\");\r", - " pm.expect(jsonResponse.params.errmsg).to.be.a(\"String\");\r", + " pm.expect(jsonResponse.params.err).to.be.a(\"null\");\r", + " pm.expect(jsonResponse.params.errmsg).to.be.a(\"null\");\r", "});\r", "\r", "pm.test(\"Status has string \", function () {\r", - " pm.expect(jsonResponse.params.status).to.be.equal(\"failed\");\r", + " pm.expect(jsonResponse.params.status).to.be.equal(\"successful\");\r", "});\r", "\r", - "pm.test(\"Status code name has string\", function () {\r", - " pm.expect(jsonResponse.params.err).to.be.equal(\"CONSTRAINT_VALIDATION_FAILED\");\r", + "pm.test(\"Verify keys and data type of the response result\", () => {\r", + " pm.expect(jsonResponse.result).to.have.all.keys('node_id', 'versionKey');\r", + " pm.expect(jsonResponse.result.node_id).to.be.a(\"String\");\r", + " pm.expect(jsonResponse.result.versionKey).to.be.a(\"string\");\r", "});\r", "\r", - "pm.test(\"Status code name has string\", function () {\r", - " pm.expect(jsonResponse.params.errmsg).to.be.equal(\"Object already exists with identifier: Sample Framework\");\r", - "});\r", + "pm.collectionVariables.set(\"fw11_node\",jsonResponse.result.node_id);\r", + "console.log(pm.collectionVariables.get(\"fw11_node\"));\r", "\r", - "pm.test(\"Status code name has string\", function () {\r", - " pm.expect(jsonResponse.responseCode).to.be.equal(\"CLIENT_ERROR\");\r", + "pm.test(`node id should be equal to ${pm.collectionVariables.get(\"fw11_node\")}`, () => {\r", + " pm.expect(jsonResponse.result.node_id).to.eql(pm.collectionVariables.get(\"fw11_code\"));\r", "});\r", - "\r", - "\r", "" ], "type": "text/javascript" } } ], + "protocolProfileBehavior": { + "disabledSystemHeaders": {} + }, "request": { "auth": { "type": "apikey", @@ -1692,24 +16291,34 @@ "method": "POST", "header": [ { - "key": "Accept", - "value": "application/json", - "type": "text" + "description": "(Required) It is the Unique Id to identify the root organisation to which the user belongs", + "key": "X-Channel-Id", + "value": "{{X-Channel-Id}}" + }, + { + "key": "", + "value": "", + "disabled": true }, { - "key": "X-Channel-Id", - "value": "{{X-Channel-Id}}", - "type": "text" + "key": "Accept", + "value": "application/json" }, { - "key": "Content-Type", - "value": "application/json", - "type": "text" + "key": "Authorization", + "value": "", + "type": "text", + "disabled": true } ], "body": { "mode": "raw", - "raw": "{\r\n \"request\": {\r\n \"framework\": {\r\n \"name\": \"Sample Framework\",\r\n \"code\": \"Sample Framework\"\r\n }\r\n }\r\n}" + "raw": "{\n \"request\": {\n \"framework\": {\n \"name\": \"{{fw11_name}}\",\n \"code\": \"{{fw11_code}}\"\n \n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } }, "url": { "raw": "{{host}}/framework/v3/create", @@ -1721,24 +16330,201 @@ "v3", "create" ] - } + }, + "description": "This API is associated with creating a new framework on the Sunbird Platform.\n - The endpoint for **Create a Framework** is `/framework/v1/create`\n - It points to knowledge-mw-service - `/v1/framework/create`\n - The fields marked with an asterisk (*) are mandatory. They cannot be null or empty." }, - "response": [] - } - ] - } - ], - "description": "1. Framework name should be updated before every run\n \n2. Framework code should be updated before every run" - }, - { - "name": "Read a Framework", - "item": [ - { - "name": "Positive", - "item": [ + "response": [ + { + "name": "OK ! Successful operation.\"create framework\" operation was successfully executed.", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource\n Possible media types can be:- \n - application/json", + "key": "Content-Type", + "value": "Ut enim offici" + }, + { + "description": "(Required) To make use of the API, you require authorization. Raise a request to the administrator for the use of the API. You will receive the authorization key. Specify the key received, here.", + "key": "Authorization", + "value": "Ut enim offici" + }, + { + "description": "(Required) It is the Unique Id to identify the root organisation to which the user belongs", + "key": "X-Channel-Id", + "value": "Ut enim offici" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"framework\": {\n \"name\": \"Framework Name\",\n \"code\": \"dummy_framework\",\n \"channels\": [\n {\n \"identifier\": \"in.ekstep\"\n }\n ]\n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/framework/v1/create", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "framework", + "v1", + "create" + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"api.framework.create\",\n \"ver\": \"1.0\",\n \"ts\": \"2020-12-14T09:49:06.794Z\",\n \"params\": {\n \"resmsgid\": \"9b5d7ca0-3df1-11eb-9ff3-67c41480f6aa\",\n \"msgid\": \"9b4a90e0-3df1-11eb-9ff3-67c41480f6aa\",\n \"status\": \"successful\",\n \"err\": null,\n \"errmsg\": null\n },\n \"responseCode\": \"OK\",\n \"result\": {\n \"node_id\": \"dummy_framework\",\n \"versionKey\": \"1607939346678\"\n }\n}" + }, + { + "name": "BAD REQUEST. The \"create framework\" operation failed ! The possible reason for failure is that you may have missed providing input for a mandatory parameter.", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource\n Possible media types can be:- \n - application/json", + "key": "Content-Type", + "value": "Ut enim offici" + }, + { + "description": "(Required) To make use of the API, you require authorization. Raise a request to the administrator for the use of the API. You will receive the authorization key. Specify the key received, here.", + "key": "Authorization", + "value": "Ut enim offici" + }, + { + "description": "(Required) It is the Unique Id to identify the root organisation to which the user belongs", + "key": "X-Channel-Id", + "value": "Ut enim offici" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"framework\": {\n \"name\": \"Framework Name\",\n \"code\": \"dummy_framework\",\n \"channels\": [\n {\n \"identifier\": \"in.ekstep\"\n }\n ]\n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/framework/v1/create", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "framework", + "v1", + "create" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"api.framework.create\",\n \"ver\": \"1.0\",\n \"ts\": \"2020-12-14T09:50:45.249Z\",\n \"params\": {\n \"resmsgid\": \"d60c8710-3df1-11eb-9ff3-67c41480f6aa\",\n \"msgid\": null,\n \"status\": \"failed\",\n \"err\": \"CONSTRAINT_VALIDATION_FAILED\",\n \"errmsg\": \"Object already exists with identifier: dummy_framework\"\n },\n \"responseCode\": \"CLIENT_ERROR\",\n \"result\": {}\n}" + }, + { + "name": "INTERNAL SERVER ERROR ! Looks like something went wrong! These errors are tracked automatically, but if the problem persists feel free to contact us. In the meantime, try refreshing.", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource\n Possible media types can be:- \n - application/json", + "key": "Content-Type", + "value": "Ut enim offici" + }, + { + "description": "(Required) To make use of the API, you require authorization. Raise a request to the administrator for the use of the API. You will receive the authorization key. Specify the key received, here.", + "key": "Authorization", + "value": "Ut enim offici" + }, + { + "description": "(Required) It is the Unique Id to identify the root organisation to which the user belongs", + "key": "X-Channel-Id", + "value": "Ut enim offici" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"framework\": {\n \"name\": \"Framework Name\",\n \"code\": \"dummy_framework\",\n \"channels\": [\n {\n \"identifier\": \"in.ekstep\"\n }\n ]\n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/framework/v1/create", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "framework", + "v1", + "create" + ] + } + }, + "status": "Internal Server Error", + "code": 500, + "_postman_previewlanguage": "text", + "header": [ + { + "key": "Content-Type", + "value": "text/plain" + } + ], + "cookie": [], + "body": "" + } + ] + }, { - "name": "Read a valid framework", + "name": "Create Framework Category", "event": [ + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + }, { "listen": "test", "script": { @@ -1750,34 +16536,30 @@ "});\r", "\r", "pm.test(\"Verify keys and data type of the response result\", () => {\r", - " pm.expect(jsonResponse.result.framework).to.have.all.keys('identifier','lastStatusChangedOn','code','channel','languageCode','type','createdOn','objectType','versionKey','systemDefault','name','lastUpdatedOn','status','description');\r", - " pm.expect(jsonResponse.result.framework.identifier).to.be.a(\"String\");\r", - " pm.expect(jsonResponse.result.framework.lastStatusChangedOn).to.be.a(\"String\");\r", - " pm.expect(jsonResponse.result.framework.code).to.be.a(\"String\");\r", - " pm.expect(jsonResponse.result.framework.channel).to.be.a(\"String\");\r", - " pm.expect(jsonResponse.result.framework.languageCode).to.be.a('array');\r", - " pm.expect(jsonResponse.result.framework.type).to.be.a(\"String\");\r", - " pm.expect(jsonResponse.result.framework.createdOn).to.be.a(\"String\");\r", - " pm.expect(jsonResponse.result.framework.objectType).to.be.a(\"String\");\r", - " pm.expect(jsonResponse.result.framework.versionKey).to.be.a(\"String\");\r", - " pm.expect(jsonResponse.result.framework.systemDefault).to.be.a(\"String\");\r", - " pm.expect(jsonResponse.result.framework.name).to.be.a(\"String\");\r", - " pm.expect(jsonResponse.result.framework.lastUpdatedOn).to.be.a(\"String\");\r", - "pm.expect(jsonResponse.result.framework.status).to.be.a(\"String\");\r", + " pm.expect(jsonResponse.params).to.have.all.keys('resmsgid','msgid','status', 'err','errmsg');\r", + "pm.expect(jsonResponse.params.resmsgid).to.be.a(\"String\");\r", + "pm.expect(jsonResponse.params.msgid).to.be.a(\"null\");\r", + " pm.expect(jsonResponse.params.status).to.be.a(\"String\");\r", + " pm.expect(jsonResponse.params.err).to.be.a(\"null\");\r", + " pm.expect(jsonResponse.params.errmsg).to.be.a(\"null\");\r", "});\r", "\r", - "pm.test(\"Status has string Live \", function () {\r", - " pm.expect(jsonResponse.result.framework.status).to.be.equal(\"Live\");\r", - "});" - ], - "type": "text/javascript" - } - }, - { - "listen": "prerequest", - "script": { - "exec": [ - "pm.globals.get(\"name_fw\");" + "pm.test(\"Status has string \", function () {\r", + " pm.expect(jsonResponse.params.status).to.be.equal(\"successful\");\r", + "});\r", + "\r", + "pm.test(\"Verify keys and data type of the response result\", () => {\r", + " pm.expect(jsonResponse.result).to.have.all.keys('identifier', 'versionKey');\r", + " pm.expect(jsonResponse.result.identifier).to.be.a(\"String\");\r", + " pm.expect(jsonResponse.result.versionKey).to.be.a(\"string\");\r", + "});\r", + "\r", + "pm.collectionVariables.set(\"fwcat_cat6\",jsonResponse.result.identifier);\r", + "console.log(pm.collectionVariables.get(\"fwcat_cat6\"));\r", + "\r", + "pm.test(`identifier should be equal to ${pm.collectionVariables.get(\"fwcat_cat6\")}`, () => {\r", + " pm.expect(jsonResponse.result.identifier).to.eql(`${pm.collectionVariables.get(\"fw11_code\")}_${pm.collectionVariables.get(\"master13_code\")}`);\r", + "});" ], "type": "text/javascript" } @@ -1789,7 +16571,7 @@ "apikey": [ { "key": "value", - "value": "{{auth_token}}", + "value": "", "type": "string" }, { @@ -1804,8 +16586,12 @@ } ] }, - "method": "GET", + "method": "POST", "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, { "key": "Accept", "value": "application/json" @@ -1814,55 +16600,84 @@ "key": "X-Channel-Id", "value": "{{X-Channel-Id}}", "type": "text" - }, - { - "key": "Content-Type", - "value": "application/json", - "type": "text" } ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"category\": {\n \"name\": \"Board\",\n \"code\": \"{{master13_code}}\",\n \"description\":\"Board category\"\n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, "url": { - "raw": "{{host}}/framework/v3/read/{{node_id}}", + "raw": "{{host}}/framework/v3/category/create?framework={{fw11_code}}", "host": [ "{{host}}" ], "path": [ "framework", "v3", - "read", - "{{node_id}}" + "category", + "create" + ], + "query": [ + { + "key": "framework", + "value": "{{fw11_code}}", + "description": "(Required) The code of the framework under which category has to be created" + } ] }, - "description": "This API is associated with fetching a specific framework\n - The endpoint for **Get a Framework** is `/framework/v1/read/{ID}`\n - It points to knowledge-mw-service - `/v1/framework/read/{ID}`\n - The fields marked with an asterisk (*) are mandatory. They cannot be null or empty." + "description": "This API is associated with creating a category under a framework\n - The endpoint for **Create Category** is `/framework/v1/category/create`\n - It points to knowledge-mw-service - `/v1/framework/category/create`\n - The fields marked with an asterisk (*) are mandatory. They cannot be null or empty." }, "response": [ { - "name": "OK ! Successful operation.\"read framework\" operation was successfully executed.", + "name": "OK ! Successful operation.\"create category\" operation was successfully executed.", "originalRequest": { - "method": "GET", + "method": "POST", "header": [ { "description": "Added as a part of security scheme: apikey", "key": "Authorization", "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource\n Possible media types can be:- \n - application/json", + "key": "Content-Type", + "value": "Ut enim offici" + }, + { + "description": "(Required) To make use of the API, you require authorization. Raise a request to the administrator for the use of the API. You will receive the authorization key. Specify the key received, here.", + "key": "Authorization", + "value": "Ut enim offici" } ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"category\": {\n \"name\": \"Subject\",\n \"code\": \"subject\"\n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, "url": { - "raw": "{{baseUrl}}/framework/v1/read/:ID", + "raw": "{{baseUrl}}/framework/v1/category/create?framework=Ut enim offici", "host": [ "{{baseUrl}}" ], "path": [ "framework", "v1", - "read", - ":ID" + "category", + "create" ], - "variable": [ + "query": [ { - "key": "ID", - "value": "Ut enim offici", - "description": "(Required) The identifier of the framework to be fetched" + "key": "framework", + "value": "Ut enim offici" } ] } @@ -1877,35 +16692,53 @@ } ], "cookie": [], - "body": "{\n \"id\": \"api.framework.read\",\n \"ver\": \"1.0\",\n \"ts\": \"2020-12-14T19:51:24ZZ\",\n \"params\": {\n \"resmsgid\": \"28f10a2a-ce6c-4dbe-a733-4c193013e84b\",\n \"msgid\": null,\n \"err\": null,\n \"status\": \"successful\",\n \"errmsg\": null\n },\n \"responseCode\": \"OK\",\n \"result\": {\n \"framework\": {\n \"identifier\": \"dummy_framework\",\n \"code\": \"Dumy framework updated\",\n \"name\": \"Framework Name\",\n \"description\": \"Dumy framework updated\",\n \"categories\": [\n {\n \"identifier\": \"dummy_framework_subject\",\n \"code\": \"subject\",\n \"terms\": [\n {\n \"identifier\": \"dummy_framework_subject_english\",\n \"code\": \"english\",\n \"translations\": null,\n \"name\": \"English\",\n \"description\": \"English\",\n \"index\": 1,\n \"category\": \"subject\",\n \"status\": \"Live\"\n }\n ],\n \"translations\": null,\n \"name\": \"Subject\",\n \"description\": \"Updated description\",\n \"index\": 1,\n \"status\": \"Live\"\n },\n {\n \"identifier\": \"dummy_framework_medium\",\n \"code\": \"medium\",\n \"translations\": null,\n \"name\": \"Medium\",\n \"description\": \"Medium\",\n \"index\": 2,\n \"status\": \"Live\"\n }\n ],\n \"type\": \"K-12\",\n \"objectType\": \"Framework\"\n }\n }\n}" + "body": "{\n \"id\": \"api.category.create\",\n \"ver\": \"1.0\",\n \"ts\": \"2020-12-14T19:32:01.754Z\",\n \"params\": {\n \"resmsgid\": \"0a10dba0-3e43-11eb-9ff3-67c41480f6aa\",\n \"msgid\": \"0a05df20-3e43-11eb-9ff3-67c41480f6aa\",\n \"status\": \"successful\",\n \"err\": null,\n \"errmsg\": null\n },\n \"responseCode\": \"OK\",\n \"result\": {\n \"node_id\": \"dummy_framework_medium\",\n \"versionKey\": \"1607974321700\"\n }\n}" }, { - "name": "BAD REQUEST. The \"read framework\" operation failed ! The possible reason for failure is that you may have missed providing input for a mandatory parameter.", + "name": "BAD REQUEST. The \"create category\" operation failed ! The possible reason for failure is that you may have missed providing input for a mandatory parameter.", "originalRequest": { - "method": "GET", + "method": "POST", "header": [ { "description": "Added as a part of security scheme: apikey", "key": "Authorization", "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource\n Possible media types can be:- \n - application/json", + "key": "Content-Type", + "value": "Ut enim offici" + }, + { + "description": "(Required) To make use of the API, you require authorization. Raise a request to the administrator for the use of the API. You will receive the authorization key. Specify the key received, here.", + "key": "Authorization", + "value": "Ut enim offici" } ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"category\": {\n \"name\": \"Subject\",\n \"code\": \"subject\"\n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, "url": { - "raw": "{{baseUrl}}/framework/v1/read/:ID", + "raw": "{{baseUrl}}/framework/v1/category/create?framework=Ut enim offici", "host": [ "{{baseUrl}}" ], "path": [ "framework", "v1", - "read", - ":ID" + "category", + "create" ], - "variable": [ + "query": [ { - "key": "ID", - "value": "Ut enim offici", - "description": "(Required) The identifier of the framework to be fetched" + "key": "framework", + "value": "Ut enim offici" } ] } @@ -1920,276 +16753,89 @@ } ], "cookie": [], - "body": "{\n \"ts\": 87966182,\n \"id\": \"laboris q\",\n \"params\": {\n \"msgid\": \"do est non incididunt\",\n \"resmsgid\": \"sint Excepteur sunt\",\n \"status\": \"successful\",\n \"err\": \"nisi magna eu\",\n \"errmsg\": \"velit\"\n },\n \"ver\": \"cupidatat exercitation elit\",\n \"responseCode\": \"do et cillum\",\n \"result\": {}\n}" + "body": "{\n \"id\": \"api.category.create\",\n \"ver\": \"1.0\",\n \"ts\": \"2020-12-14T19:30:50.114Z\",\n \"params\": {\n \"resmsgid\": \"df5d7620-3e42-11eb-9ff3-67c41480f6aa\",\n \"msgid\": null,\n \"status\": \"failed\",\n \"err\": \"CONSTRAINT_VALIDATION_FAILED\",\n \"errmsg\": \"Object already exists with identifier: dummy_framework_subject\"\n },\n \"responseCode\": \"CLIENT_ERROR\",\n \"result\": {}\n}" }, { - "name": "RESOURCE NOT FOUND. The \"read framework\" operation failed ! The possible reason for failure is that you may have passed invalid framework id.", + "name": "INTERNAL SERVER ERROR ! Looks like something went wrong! These errors are tracked automatically, but if the problem persists feel free to contact us. In the meantime, try refreshing.", "originalRequest": { - "method": "GET", + "method": "POST", "header": [ { "description": "Added as a part of security scheme: apikey", "key": "Authorization", "value": "" - } - ], - "url": { - "raw": "{{baseUrl}}/framework/v1/read/:ID", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "framework", - "v1", - "read", - ":ID" - ], - "variable": [ - { - "key": "ID", - "value": "Ut enim offici", - "description": "(Required) The identifier of the framework to be fetched" - } - ] - } - }, - "status": "Not Found", - "code": 404, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "Content-Type", - "value": "application/json" - } - ], - "cookie": [], - "body": "{\n \"id\": \"api.framework.read\",\n \"ver\": \"1.0\",\n \"ts\": \"2020-12-14T10:00:12.540Z\",\n \"params\": {\n \"resmsgid\": \"282e43c0-3df3-11eb-9ff3-67c41480f6aa\",\n \"msgid\": null,\n \"status\": \"failed\",\n \"err\": \"ERR_DATA_NOT_FOUND\",\n \"errmsg\": \"Data not found with id : dummy_framework1\"\n },\n \"responseCode\": \"RESOURCE_NOT_FOUND\",\n \"result\": {}\n}" - }, - { - "name": "INTERNAL SERVER ERROR ! Looks like something went wrong! These errors are tracked automatically, but if the problem persists feel free to contact us. In the meantime, try refreshing.", - "originalRequest": { - "method": "GET", - "header": [ + }, { - "description": "Added as a part of security scheme: apikey", + "description": "(Required) The Content Type entity is the media type of the resource\n Possible media types can be:- \n - application/json", + "key": "Content-Type", + "value": "Ut enim offici" + }, + { + "description": "(Required) To make use of the API, you require authorization. Raise a request to the administrator for the use of the API. You will receive the authorization key. Specify the key received, here.", "key": "Authorization", - "value": "" + "value": "Ut enim offici" } ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"category\": {\n \"name\": \"Subject\",\n \"code\": \"subject\"\n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, "url": { - "raw": "{{baseUrl}}/framework/v1/read/:ID", + "raw": "{{baseUrl}}/framework/v1/category/create?framework=Ut enim offici", "host": [ "{{baseUrl}}" - ], - "path": [ - "framework", - "v1", - "read", - ":ID" - ], - "variable": [ - { - "key": "ID", - "value": "Ut enim offici", - "description": "(Required) The identifier of the framework to be fetched" - } - ] - } - }, - "status": "Internal Server Error", - "code": 500, - "_postman_previewlanguage": "text", - "header": [ - { - "key": "Content-Type", - "value": "text/plain" - } - ], - "cookie": [], - "body": "" - } - ] - }, - { - "name": "Read a retired framewrok", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "let jsonResponse = pm.response.json()\r", - "\r", - "pm.test(\"Status code is 200\", function () {\r", - " pm.response.to.have.status(200);\r", - "});\r", - "\r", - "pm.test(\"Verify keys and data type of the response result\", () => {\r", - " pm.expect(jsonResponse.result.framework).to.have.all.keys('identifier','lastStatusChangedOn','code','channel','languageCode','type','createdOn','objectType','versionKey','systemDefault','name','lastUpdatedOn','status','description');\r", - " pm.expect(jsonResponse.result.framework.identifier).to.be.a(\"String\");\r", - " pm.expect(jsonResponse.result.framework.lastStatusChangedOn).to.be.a(\"String\");\r", - " pm.expect(jsonResponse.result.framework.code).to.be.a(\"String\");\r", - " //pm.expect(jsonResponse.result.framework.consumerId).to.be.a(\"String\");\r", - " pm.expect(jsonResponse.result.framework.channel).to.be.a(\"String\");\r", - " pm.expect(jsonResponse.result.framework.languageCode).to.be.a('array');\r", - " pm.expect(jsonResponse.result.framework.type).to.be.a(\"String\");\r", - " pm.expect(jsonResponse.result.framework.createdOn).to.be.a(\"String\");\r", - " pm.expect(jsonResponse.result.framework.objectType).to.be.a(\"String\");\r", - " pm.expect(jsonResponse.result.framework.versionKey).to.be.a(\"String\");\r", - " pm.expect(jsonResponse.result.framework.systemDefault).to.be.a(\"String\");\r", - " pm.expect(jsonResponse.result.framework.name).to.be.a(\"String\");\r", - " pm.expect(jsonResponse.result.framework.lastUpdatedOn).to.be.a(\"String\");\r", - "pm.expect(jsonResponse.result.framework.status).to.be.a(\"String\");\r", - "});\r", - "\r", - "pm.test(\"Status has string Live \", function () {\r", - " pm.expect(jsonResponse.result.framework.status).to.be.equal(\"Retired\");\r", - "});" - ], - "type": "text/javascript" - } - } - ], - "request": { - "method": "GET", - "header": [ - { - "key": "Accept", - "value": "application/json", - "type": "text" - }, - { - "key": "Content-Type", - "value": "application/json", - "type": "text" + ], + "path": [ + "framework", + "v1", + "category", + "create" + ], + "query": [ + { + "key": "framework", + "value": "Ut enim offici" + } + ] + } }, - { - "key": "X-Channel-Id", - "value": "{{X-Channel-Id}}", - "type": "text" - } - ], - "url": { - "raw": "{{host}}/framework/v3/read/Framework5", - "host": [ - "{{host}}" + "status": "Internal Server Error", + "code": 500, + "_postman_previewlanguage": "text", + "header": [ + { + "key": "Content-Type", + "value": "text/plain" + } ], - "path": [ - "framework", - "v3", - "read", - "Framework5" - ] + "cookie": [], + "body": "" } - }, - "response": [] + ] } - ] + ], + "description": "1. Framework name and code should be updated before each run\n2. Framework categroy should be a subset of master category, i.e., framework category can be created only when it is available in master category\n \n3. Create a master category with same indentifier before creating the framework category" }, { - "name": "Negative", + "name": "Positive", "item": [ { - "name": "Read an invalid framework", + "name": "Create a valid term for valid framework and framework category", "event": [ { - "listen": "test", + "listen": "prerequest", "script": { "exec": [ - "let jsonResponse = pm.response.json()\r", - "\r", - "pm.test(\"Status code is 404\", function () {\r", - " pm.response.to.have.status(404);\r", - "});\r", - "\r", - "pm.test(\"Status code name has string\", function () {\r", - " pm.response.to.have.status(\"Not Found\");\r", - "});\r", - "\r", - "pm.test(\"Verify keys and data type of the response result\", () => {\r", - " pm.expect(jsonResponse.params).to.have.all.keys('resmsgid','msgid','err','status','errmsg');\r", - " pm.expect(jsonResponse.params.resmsgid).to.be.a(\"String\");\r", - " pm.expect(jsonResponse.params.msgid).to.be.a(\"null\");\r", - " pm.expect(jsonResponse.params.err).to.be.a(\"String\");\r", - " pm.expect(jsonResponse.params.status).to.be.a(\"String\");\r", - " pm.expect(jsonResponse.params.errmsg).to.be.a(\"String\");\r", - " });\r", - "\r", - "pm.test(\"Err has string\", function () {\r", - " pm.expect(jsonResponse.params.err).to.be.equal(\"NOT_FOUND\");\r", - "});\r", - "pm.test(\"Status has string\", function () {\r", - " pm.expect(jsonResponse.params.status).to.be.equal(\"failed\");\r", - "});\r", - "pm.test(\"errmsg has string\", function () {\r", - " pm.expect(jsonResponse.params.errmsg).to.be.equal(\"Error! Node(s) doesn't Exists. | [Invalid Node Id.]: invalid_fw\");\r", - "});\r", - "pm.test(\"responseCode has string\", function () {\r", - " pm.expect(jsonResponse.responseCode).to.be.equal(\"RESOURCE_NOT_FOUND\");\r", - "});\r", - "\r", "" ], "type": "text/javascript" } - } - ], - "request": { - "auth": { - "type": "apikey", - "apikey": [ - { - "key": "value", - "value": "{{auth_token}}", - "type": "string" - }, - { - "key": "key", - "value": "Authorization", - "type": "string" - }, - { - "key": "in", - "value": "header", - "type": "string" - } - ] }, - "method": "GET", - "header": [ - { - "key": "X-Channel-Id", - "value": "{{X-Channel-Id}}", - "type": "text" - } - ], - "url": { - "raw": "{{host}}/framework/v3/read/invalid_fw", - "host": [ - "{{host}}" - ], - "path": [ - "framework", - "v3", - "read", - "invalid_fw" - ] - } - }, - "response": [] - } - ] - } - ] - }, - { - "name": "Update framework", - "item": [ - { - "name": "Positive", - "item": [ - { - "name": "Update an existing framework with valid fields", - "event": [ { "listen": "test", "script": { @@ -2199,9 +16845,16 @@ "pm.test(\"Status code is 200\", function () {\r", " pm.response.to.have.status(200);\r", "});\r", - "\r", + "pm.test(\"id has string - api.taxonomy.term.create\", function () {\r", + " pm.expect(jsonResponse.id).to.be.equal(\"api.taxonomy.term.create\");\r", + "});\r", + "pm.test(\"Version is 3.0 \", function () {\r", + " pm.expect(jsonResponse.ver).to.be.equal(\"3.0\");\r", + "});\r", "pm.test(\"Verify keys and data type of the response result\", () => {\r", " pm.expect(jsonResponse.params).to.have.all.keys('resmsgid','msgid','status', 'err','errmsg');\r", + "pm.expect(jsonResponse.params.resmsgid).to.be.a(\"String\");\r", + "pm.expect(jsonResponse.params.msgid).to.be.a(\"null\");\r", " pm.expect(jsonResponse.params.status).to.be.a(\"String\");\r", " pm.expect(jsonResponse.params.err).to.be.a(\"null\");\r", " pm.expect(jsonResponse.params.errmsg).to.be.a(\"null\");\r", @@ -2212,11 +16865,23 @@ "});\r", "\r", "pm.test(\"Verify keys and data type of the response result\", () => {\r", - " pm.expect(jsonResponse.result).to.have.all.keys('node_id', 'versionKey');\r", - " pm.expect(jsonResponse.result.node_id).to.be.a(\"String\");\r", - " pm.expect(jsonResponse.result.versionKey).to.be.a(\"string\");\r", + " pm.expect(jsonResponse.result).to.have.all.keys('identifier', 'node_id');\r", + " pm.expect(jsonResponse.result.identifier).to.be.a(\"String\");\r", + " pm.expect(jsonResponse.result.node_id).to.be.a(\"string\");\r", + "});\r", + "\r", + "pm.collectionVariables.set(\"term_id\",jsonResponse.result.identifier);\r", + "console.log(pm.collectionVariables.get(\"term_id\"));\r", + "pm.collectionVariables.set(\"term_node\",jsonResponse.result.node_id);\r", + "console.log(pm.collectionVariables.get(\"term_node\"));\r", + "\r", + "pm.test(`identifier should be equal to ${pm.collectionVariables.get(\"term_id\")}`, () => {\r", + " pm.expect(jsonResponse.result.identifier).to.eql(`${pm.collectionVariables.get(\"fw11_code\")}_${pm.collectionVariables.get(\"master13_code\")}_${pm.collectionVariables.get(\"t1_term\")}`);\r", "});\r", "\r", + "pm.test(`node should be equal to ${pm.collectionVariables.get(\"term_node\")}`, () => {\r", + " pm.expect(jsonResponse.result.node_id).to.eql(`${pm.collectionVariables.get(\"fw11_code\")}_${pm.collectionVariables.get(\"master13_code\")}_${pm.collectionVariables.get(\"t1_term\")}`);\r", + "});\r", "" ], "type": "text/javascript" @@ -2244,14 +16909,8 @@ } ] }, - "method": "PATCH", + "method": "POST", "header": [ - { - "description": "(Required) It is the Unique Id to identify the root organisation to which the user belongs", - "key": "X-Channel-Id", - "value": "{{X-Channel-Id}}", - "disabled": true - }, { "key": "Content-Type", "value": "application/json" @@ -2263,7 +16922,7 @@ ], "body": { "mode": "raw", - "raw": "{\n \"request\": {\n \"framework\": {\n \"description\": \"Description for framework\"\n }\n }\n}", + "raw": "{\n \"request\": {\n \"term\": {\n \"code\": \"{{t1_term}}\",\n \"name\": \"English\"\n }\n }\n}", "options": { "raw": { "language": "json" @@ -2271,91 +16930,36 @@ } }, "url": { - "raw": "{{host}}/framework/v3/update/{{node_id}}", + "raw": "{{host}}/framework/v3/term/create?framework={{fw11_code}}&category={{master13_code}}", "host": [ "{{host}}" ], "path": [ "framework", "v3", - "update", - "{{node_id}}" - ] - }, - "description": "This API is associated with updating a framework\n - The endpoint for **Update Framework** is `/framework/v1/update/{ID}`\n - It points to knowledge-mw-service - `/v1/framework/update/{ID}`\n - The fieldsmarked with an asterisk (*) are mandatory. They cannot be null or empty." - }, - "response": [ - { - "name": "OK ! Successful operation.\"update framework\" operation was successfully executed.", - "originalRequest": { - "method": "PATCH", - "header": [ - { - "description": "Added as a part of security scheme: apikey", - "key": "Authorization", - "value": "" - }, - { - "description": "(Required) The Content Type entity is the media type of the resource\n Possible media types can be:- \n - application/json\n - multipart/form-data\n - application/x-www-form-urlencoded", - "key": "Content-Type", - "value": "Ut enim offici" - }, - { - "description": "(Required) To make use of the API, you require authorization. Raise a request to the administrator for the use of the API. You will receive the authorization key. Specify the key received, here.", - "key": "Authorization", - "value": "Ut enim offici" - }, - { - "description": "(Required) It is the Unique Id to identify the root organisation to which the user belongs", - "key": "X-Channel-Id", - "value": "Ut enim offici" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"request\": {\n \"framework\": {\n \"description\": \"Dumy framework updated\"\n }\n }\n}", - "options": { - "raw": { - "language": "json" - } - } + "term", + "create" + ], + "query": [ + { + "key": "framework", + "value": "{{fw11_code}}", + "description": "(Required) Represents the framework in which the term is to be created" }, - "url": { - "raw": "{{baseUrl}}/framework/v1/update/:ID", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "framework", - "v1", - "update", - ":ID" - ], - "variable": [ - { - "key": "ID", - "value": "Ut enim offici", - "description": "(Required) The identifier of the framework to be updated" - } - ] - } - }, - "status": "OK", - "code": 200, - "_postman_previewlanguage": "json", - "header": [ { - "key": "Content-Type", - "value": "application/json" + "key": "category", + "value": "{{master13_code}}", + "description": "(Required) Represents the category in which the term is to be created" } - ], - "cookie": [], - "body": "{\n \"id\": \"api.framework.update\",\n \"ver\": \"1.0\",\n \"ts\": \"2020-12-14T09:57:20.317Z\",\n \"params\": {\n \"resmsgid\": \"c1871ed0-3df2-11eb-9ff3-67c41480f6aa\",\n \"msgid\": \"c17ff2e0-3df2-11eb-9ff3-67c41480f6aa\",\n \"status\": \"successful\",\n \"err\": null,\n \"errmsg\": null\n },\n \"responseCode\": \"OK\",\n \"result\": {\n \"node_id\": \"dummy_framework\",\n \"versionKey\": \"1607939840281\"\n }\n}" + ] }, + "description": "This API is associated with creating a term under a framework category\n - The endpoint for **Create Term** is `/framework/v1/term/create`\n - It points to knowledge-mw-service - `/v1/framework/term/create`\n - The fields marked with an asterisk (*) are mandatory. They cannot be null or empty.\"" + }, + "response": [ { - "name": "BAD REQUEST. The \"update framework\" operation failed ! The possible reason for failure is that you may have missed providing input for a mandatory parameter.", + "name": "OK ! Successful operation.\"create term\" operation was successfully executed.", "originalRequest": { - "method": "PATCH", + "method": "POST", "header": [ { "description": "Added as a part of security scheme: apikey", @@ -2363,24 +16967,19 @@ "value": "" }, { - "description": "(Required) The Content Type entity is the media type of the resource\n Possible media types can be:- \n - application/json\n - multipart/form-data\n - application/x-www-form-urlencoded", + "description": "(Required) The Content Type entity is the media type of the resource.\n Possible media types can be:- \n - application/json", "key": "Content-Type", "value": "Ut enim offici" }, { "description": "(Required) To make use of the API, you require authorization. Raise a request to the administrator for the use of the API. You will receive the authorization key. Specify the key received, here.", - "key": "Authorization", - "value": "Ut enim offici" - }, - { - "description": "(Required) It is the Unique Id to identify the root organisation to which the user belongs", - "key": "X-Channel-Id", + "key": "Authorization", "value": "Ut enim offici" } ], "body": { "mode": "raw", - "raw": "{\n \"request\": {\n \"framework\": {\n \"description\": \"Dumy framework updated\"\n }\n }\n}", + "raw": "{\n \"request\": {\n \"term\": {\n \"code\": \"english\",\n \"name\": \"English\"\n }\n }\n}", "options": { "raw": { "language": "json" @@ -2388,27 +16987,30 @@ } }, "url": { - "raw": "{{baseUrl}}/framework/v1/update/:ID", + "raw": "{{baseUrl}}/framework/v1/term/create?framework=Ut enim offici&category=Ut enim offici", "host": [ "{{baseUrl}}" ], "path": [ "framework", "v1", - "update", - ":ID" + "term", + "create" ], - "variable": [ + "query": [ { - "key": "ID", - "value": "Ut enim offici", - "description": "(Required) The identifier of the framework to be updated" + "key": "framework", + "value": "Ut enim offici" + }, + { + "key": "category", + "value": "Ut enim offici" } ] } }, - "status": "Bad Request", - "code": 400, + "status": "OK", + "code": 200, "_postman_previewlanguage": "json", "header": [ { @@ -2417,12 +17019,12 @@ } ], "cookie": [], - "body": "{\n \"ts\": 24700756,\n \"id\": \"ut culpa\",\n \"params\": {\n \"msgid\": \"esse consequat\",\n \"resmsgid\": \"commodo aliqua magna Excepteur\",\n \"status\": \"failed\",\n \"err\": \"dolor laborum in ullamco\",\n \"errmsg\": \"laborum laboris sunt\"\n },\n \"ver\": \"laboris ut qu\",\n \"responseCode\": \"exercitation adipisicing in aliqua\",\n \"result\": {}\n}" + "body": "{\n \"id\": \"api.term.create\",\n \"ver\": \"1.0\",\n \"ts\": \"2020-12-14T19:44:02.348Z\",\n \"params\": {\n \"resmsgid\": \"b792c6c0-3e44-11eb-9ff3-67c41480f6aa\",\n \"msgid\": \"b783f9b0-3e44-11eb-9ff3-67c41480f6aa\",\n \"status\": \"successful\",\n \"err\": null,\n \"errmsg\": null\n },\n \"responseCode\": \"OK\",\n \"result\": {\n \"node_id\": [\n \"dummy_framework_subject_english\"\n ]\n }\n}" }, { - "name": "RESOURCE NOT FOUND. The \"update framework\" operation failed ! The possible reason for failure is that you may have passed invalid framework id.", + "name": "BAD REQUEST. The \"create term\" operation failed ! The possible reason for failure is that you may have missed providing input for a mandatory parameter.", "originalRequest": { - "method": "PATCH", + "method": "POST", "header": [ { "description": "Added as a part of security scheme: apikey", @@ -2430,7 +17032,7 @@ "value": "" }, { - "description": "(Required) The Content Type entity is the media type of the resource\n Possible media types can be:- \n - application/json\n - multipart/form-data\n - application/x-www-form-urlencoded", + "description": "(Required) The Content Type entity is the media type of the resource.\n Possible media types can be:- \n - application/json", "key": "Content-Type", "value": "Ut enim offici" }, @@ -2438,16 +17040,11 @@ "description": "(Required) To make use of the API, you require authorization. Raise a request to the administrator for the use of the API. You will receive the authorization key. Specify the key received, here.", "key": "Authorization", "value": "Ut enim offici" - }, - { - "description": "(Required) It is the Unique Id to identify the root organisation to which the user belongs", - "key": "X-Channel-Id", - "value": "Ut enim offici" } ], "body": { "mode": "raw", - "raw": "{\n \"request\": {\n \"framework\": {\n \"description\": \"Dumy framework updated\"\n }\n }\n}", + "raw": "{\n \"request\": {\n \"term\": {\n \"code\": \"english\",\n \"name\": \"English\"\n }\n }\n}", "options": { "raw": { "language": "json" @@ -2455,27 +17052,30 @@ } }, "url": { - "raw": "{{baseUrl}}/framework/v1/update/:ID", + "raw": "{{baseUrl}}/framework/v1/term/create?framework=Ut enim offici&category=Ut enim offici", "host": [ "{{baseUrl}}" ], "path": [ "framework", "v1", - "update", - ":ID" + "term", + "create" ], - "variable": [ + "query": [ { - "key": "ID", - "value": "Ut enim offici", - "description": "(Required) The identifier of the framework to be updated" + "key": "framework", + "value": "Ut enim offici" + }, + { + "key": "category", + "value": "Ut enim offici" } ] } }, - "status": "Not Found", - "code": 404, + "status": "Bad Request", + "code": 400, "_postman_previewlanguage": "json", "header": [ { @@ -2484,12 +17084,12 @@ } ], "cookie": [], - "body": "{\n \"id\": \"api.framework.update\",\n \"ver\": \"1.0\",\n \"ts\": \"2020-12-14T09:57:50.352Z\",\n \"params\": {\n \"resmsgid\": \"d36e1900-3df2-11eb-9ff3-67c41480f6aa\",\n \"msgid\": null,\n \"status\": \"failed\",\n \"err\": \"ERR_FRAMEWORK_NOT_FOUND\",\n \"errmsg\": \"Framework Not Found With Id : dummy_framework1\"\n },\n \"responseCode\": \"RESOURCE_NOT_FOUND\",\n \"result\": {}\n}" + "body": "{\n \"id\": \"api.term.create\",\n \"ver\": \"1.0\",\n \"ts\": \"2020-12-14T19:44:49.263Z\",\n \"params\": {\n \"resmsgid\": \"d3896ff0-3e44-11eb-9ff3-67c41480f6aa\",\n \"msgid\": null,\n \"status\": \"failed\",\n \"err\": \"ERR_INVALID_CATEGORY_ID\",\n \"errmsg\": \"Please provide valid category.\"\n },\n \"responseCode\": \"CLIENT_ERROR\",\n \"result\": {}\n}" }, { "name": "INTERNAL SERVER ERROR ! Looks like something went wrong! These errors are tracked automatically, but if the problem persists feel free to contact us. In the meantime, try refreshing.", "originalRequest": { - "method": "PATCH", + "method": "POST", "header": [ { "description": "Added as a part of security scheme: apikey", @@ -2497,7 +17097,7 @@ "value": "" }, { - "description": "(Required) The Content Type entity is the media type of the resource\n Possible media types can be:- \n - application/json\n - multipart/form-data\n - application/x-www-form-urlencoded", + "description": "(Required) The Content Type entity is the media type of the resource.\n Possible media types can be:- \n - application/json", "key": "Content-Type", "value": "Ut enim offici" }, @@ -2505,16 +17105,11 @@ "description": "(Required) To make use of the API, you require authorization. Raise a request to the administrator for the use of the API. You will receive the authorization key. Specify the key received, here.", "key": "Authorization", "value": "Ut enim offici" - }, - { - "description": "(Required) It is the Unique Id to identify the root organisation to which the user belongs", - "key": "X-Channel-Id", - "value": "Ut enim offici" } ], "body": { "mode": "raw", - "raw": "{\n \"request\": {\n \"framework\": {\n \"description\": \"Dumy framework updated\"\n }\n }\n}", + "raw": "{\n \"request\": {\n \"term\": {\n \"code\": \"english\",\n \"name\": \"English\"\n }\n }\n}", "options": { "raw": { "language": "json" @@ -2522,21 +17117,24 @@ } }, "url": { - "raw": "{{baseUrl}}/framework/v1/update/:ID", + "raw": "{{baseUrl}}/framework/v1/term/create?framework=Ut enim offici&category=Ut enim offici", "host": [ "{{baseUrl}}" ], "path": [ "framework", "v1", - "update", - ":ID" + "term", + "create" ], - "variable": [ + "query": [ { - "key": "ID", - "value": "Ut enim offici", - "description": "(Required) The identifier of the framework to be updated" + "key": "framework", + "value": "Ut enim offici" + }, + { + "key": "category", + "value": "Ut enim offici" } ] } @@ -2561,7 +17159,7 @@ "name": "Negative", "item": [ { - "name": "Update a non existing framework", + "name": "Create a valid term for invalid framework and valid framework category", "event": [ { "listen": "test", @@ -2572,31 +17170,35 @@ "pm.test(\"Status code is 404\", function () {\r", " pm.response.to.have.status(404);\r", "});\r", - "\r", - "pm.test(\"Status code name has string\", function () {\r", - " pm.response.to.have.status(\"Not Found\");\r", + "pm.test(\"id has string - api.taxonomy.term.create\", function () {\r", + " pm.expect(jsonResponse.id).to.be.equal(\"api.taxonomy.term.create\");\r", + "});\r", + "pm.test(\"Version is 3.0 \", function () {\r", + " pm.expect(jsonResponse.ver).to.be.equal(\"3.0\");\r", "});\r", - "\r", "pm.test(\"Verify keys and data type of the response result\", () => {\r", - " pm.expect(jsonResponse.params).to.have.all.keys('resmsgid','msgid','err','status','errmsg');\r", - " pm.expect(jsonResponse.params.resmsgid).to.be.a(\"String\");\r", - " pm.expect(jsonResponse.params.msgid).to.be.a(\"null\");\r", - " pm.expect(jsonResponse.params.err).to.be.a(\"String\");\r", + " pm.expect(jsonResponse.params).to.have.all.keys('resmsgid','msgid','status', 'err','errmsg');\r", + "pm.expect(jsonResponse.params.resmsgid).to.be.a(\"String\");\r", + "pm.expect(jsonResponse.params.msgid).to.be.a(\"null\");\r", " pm.expect(jsonResponse.params.status).to.be.a(\"String\");\r", + " pm.expect(jsonResponse.params.err).to.be.a(\"String\");\r", " pm.expect(jsonResponse.params.errmsg).to.be.a(\"String\");\r", - " });\r", - "\r", - "pm.test(\"Err has string\", function () {\r", - " pm.expect(jsonResponse.params.err).to.be.equal(\"NOT_FOUND\");\r", "});\r", - "pm.test(\"Status has string\", function () {\r", + "\r", + "pm.test(\"Status has string \", function () {\r", " pm.expect(jsonResponse.params.status).to.be.equal(\"failed\");\r", "});\r", - "pm.test(\"errmsg has string\", function () {\r", - " pm.expect(jsonResponse.params.errmsg).to.be.equal(\"Error! Node(s) doesn't Exists. | [Invalid Node Id.]: abc\");\r", + "\r", + "pm.test(\"err has string \", function () {\r", + " pm.expect(jsonResponse.params.err).to.be.equal(\"NOT_FOUND\");\r", "});\r", - "pm.test(\"responseCode has string\", function () {\r", - " pm.expect(jsonResponse.responseCode).to.be.equal(\"RESOURCE_NOT_FOUND\");\r", + "\r", + "pm.test(`errmsg has string: Error! Node(s) doesn't Exists. | [Invalid Node Id.]: invalid_${pm.collectionVariables.get(\"master13_code\")}` , function () {\r", + " pm.expect(jsonResponse.params.errmsg).to.be.include(`Error! Node(s) doesn't Exists. | [Invalid Node Id.]: invalid_${pm.collectionVariables.get(\"master13_code\")}`);\r", + "});\r", + "\r", + "pm.test(\"responseCode has string \", function () {\r", + " pm.expect(jsonResponse.responseCode).to.be.include(\"RESOURCE_NOT_FOUND\");\r", "});\r", "\r", "" @@ -2609,11 +17211,6 @@ "auth": { "type": "apikey", "apikey": [ - { - "key": "in", - "value": "header", - "type": "string" - }, { "key": "value", "value": "{{auth_token}}", @@ -2623,59 +17220,14 @@ "key": "key", "value": "Authorization", "type": "string" + }, + { + "key": "in", + "value": "header", + "type": "string" } ] }, - "method": "PATCH", - "header": [ - { - "key": "Accept", - "value": "application/json", - "type": "text" - }, - { - "key": "X-Channel-Id", - "value": "{{X-Channel-Id}}", - "type": "text" - }, - { - "key": "Content-Type", - "value": "", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\r\n \"request\": {\r\n \"framework\": {\r\n \"description\": \"Description for framework\"\r\n }\r\n }\r\n}" - }, - "url": { - "raw": "{{host}}/framework/v3/update/abc", - "host": [ - "{{host}}" - ], - "path": [ - "framework", - "v3", - "update", - "abc" - ] - } - }, - "response": [] - } - ] - } - ] - }, - { - "name": "Publish Framework", - "item": [ - { - "name": "Pre requisite", - "item": [ - { - "name": "Link the framework to the category", - "request": { "method": "POST", "header": [ { @@ -2686,47 +17238,42 @@ "key": "Accept", "value": "application/json" }, - { - "key": "X-Channel-Id", - "value": "{{X-Channel-Id}}" - }, { "key": "Authorization", - "value": "" + "value": "{{apiKey}}" } ], "body": { "mode": "raw", - "raw": "{\n \"request\": {\n \"category\": {\n \"name\": \"Board\",\n \"code\": \"board\",\n \"description\":\"Board category\"\n }\n }\n}" + "raw": "{\n \"request\": {\n \"term\": {\n \"code\": \"Science\",\n \"name\": \"English\"\n }\n }\n}" }, "url": { - "raw": "{{host}}/framework/v3/category/create?framework={{node_id}}", + "raw": "{{host}}/framework/v3/term/create?framework=invalid&category={{master13_code}}", "host": [ "{{host}}" ], "path": [ "framework", "v3", - "category", + "term", "create" ], "query": [ { "key": "framework", - "value": "{{node_id}}" + "value": "invalid" + }, + { + "key": "category", + "value": "{{master13_code}}" } ] } }, "response": [] - } - ] - }, - { - "name": "Positive", - "item": [ + }, { - "name": "Publish a valid Framework", + "name": "Create a valid term for valid framework and invalid framework category", "event": [ { "listen": "test", @@ -2734,27 +17281,41 @@ "exec": [ "let jsonResponse = pm.response.json()\r", "\r", - "pm.test(\"Status code is 200\", function () {\r", - " pm.response.to.have.status(200);\r", + "pm.test(\"Status code is 404\", function () {\r", + " pm.response.to.have.status(404);\r", + "});\r", + "pm.test(\"id has string - api.taxonomy.term.create\", function () {\r", + " pm.expect(jsonResponse.id).to.be.equal(\"api.taxonomy.term.create\");\r", + "});\r", + "pm.test(\"Version is 3.0 \", function () {\r", + " pm.expect(jsonResponse.ver).to.be.equal(\"3.0\");\r", "});\r", - "\r", "pm.test(\"Verify keys and data type of the response result\", () => {\r", - " pm.expect(jsonResponse.params).to.have.all.keys('resmsgid','msgid','err','status','errmsg');\r", - " pm.expect(jsonResponse.params.resmsgid).to.be.a(\"String\");\r", - " pm.expect(jsonResponse.params.msgid).to.be.a(\"null\");\r", - " pm.expect(jsonResponse.params.err).to.be.a(\"null\");\r", + " pm.expect(jsonResponse.params).to.have.all.keys('resmsgid','msgid','status', 'err','errmsg');\r", + "pm.expect(jsonResponse.params.resmsgid).to.be.a(\"String\");\r", + "pm.expect(jsonResponse.params.msgid).to.be.a(\"null\");\r", " pm.expect(jsonResponse.params.status).to.be.a(\"String\");\r", - " pm.expect(jsonResponse.params.errmsg).to.be.a(\"null\");\r", - " });\r", + " pm.expect(jsonResponse.params.err).to.be.a(\"String\");\r", + " pm.expect(jsonResponse.params.errmsg).to.be.a(\"String\");\r", + "});\r", "\r", - "pm.test(\"responseCode has string\", function () {\r", - " pm.expect(jsonResponse.responseCode).to.be.equal(\"OK\");\r", + "pm.test(\"Status has string \", function () {\r", + " pm.expect(jsonResponse.params.status).to.be.equal(\"failed\");\r", "});\r", "\r", + "pm.test(\"err has string \", function () {\r", + " pm.expect(jsonResponse.params.err).to.be.equal(\"NOT_FOUND\");\r", + "});\r", + "\r", + "pm.test(`errmsg has string: Error! Node(s) doesn't Exists. | [Invalid Node Id.]: ${pm.collectionVariables.get(\"fw11_code\")}_dummy` , function () {\r", + " pm.expect(jsonResponse.params.errmsg).to.be.include(`Error! Node(s) doesn't Exists. | [Invalid Node Id.]: ${pm.collectionVariables.get(\"fw11_code\")}_dummy`);\r", + "});\r", "\r", - "pm.test(\"publishStatus has string\", function () {\r", - " pm.expect(jsonResponse.result.publishStatus).to.include(\"Publish Event for Framework Id \");\r", + "pm.test(\"responseCode has string \", function () {\r", + " pm.expect(jsonResponse.responseCode).to.be.include(\"RESOURCE_NOT_FOUND\");\r", "});\r", + "\r", + "\r", "" ], "type": "text/javascript" @@ -2762,33 +17323,8 @@ } ], "request": { - "auth": { - "type": "apikey", - "apikey": [ - { - "key": "value", - "value": "{{auth_token}}", - "type": "string" - }, - { - "key": "key", - "value": "Authorization", - "type": "string" - }, - { - "key": "in", - "value": "header", - "type": "string" - } - ] - }, "method": "POST", - "header": [ - { - "description": "(Required) It is the Unique Id to identify the root organisation to which the user belongs", - "key": "X-Channel-Id", - "value": "{{X-Channel-Id}}" - }, + "header": [ { "key": "Content-Type", "value": "application/json" @@ -2796,259 +17332,182 @@ { "key": "Accept", "value": "application/json" + }, + { + "key": "Authorization", + "value": "{{auth_token}}" } ], "body": { "mode": "raw", - "raw": "{}", - "options": { - "raw": { - "language": "json" - } - } + "raw": "{\n \"request\": {\n \"term\": {\n \"code\": \"Science\",\n \"name\": \"English\"\n }\n }\n}" }, "url": { - "raw": "{{host}}/framework/v3/publish/{{node_id}}", + "raw": "{{host}}/framework/v3/term/create?framework={{fw11_code}}&category=dummy", "host": [ "{{host}}" ], "path": [ "framework", "v3", - "publish", - "{{node_id}}" - ] - }, - "description": "This API is associated with publishing a framework\n - The endpoint for **Publish Framework** is `/framework/v1/publish/{ID}`\n - It points to knowledge-mw-service - `/v1/framework/publish/{ID}`\n - The fields marked with an asterisk (*) are mandatory. They cannot be null or empty." - }, - "response": [ - { - "name": "OK ! Successful operation.\"Publish framework\" operation was successfully executed.", - "originalRequest": { - "method": "POST", - "header": [ - { - "description": "Added as a part of security scheme: apikey", - "key": "Authorization", - "value": "" - }, - { - "description": "The Content Type entity is the media type of the resource.\n Possible media types can be:- \n - application/json", - "key": "Content-Type", - "value": "Ut enim offici" - }, - { - "description": "(Required) To make use of the API, you require authorization. Raise a request to the administrator for the use of the API. You will receive the authorization key. Specify the key received, here.", - "key": "Authorization", - "value": "Ut enim offici" - }, - { - "description": "(Required) It is the Unique Id to identify the root organisation to which the user belongs", - "key": "X-Channel-Id", - "value": "Ut enim offici" - } - ], - "body": { - "mode": "raw", - "raw": "{}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{baseUrl}}/framework/v1/publish/:ID", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "framework", - "v1", - "publish", - ":ID" - ], - "variable": [ - { - "key": "ID", - "value": "Ut enim offici", - "description": "(Required) The identifier of the framework to be published" - } - ] - } - }, - "status": "OK", - "code": 200, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "Content-Type", - "value": "application/json" - } + "term", + "create" ], - "cookie": [], - "body": "{\n \"id\": \"api.framework.publish\",\n \"ver\": \"1.0\",\n \"ts\": \"2020-12-14T10:07:54.648Z\",\n \"params\": {\n \"resmsgid\": \"3b9e5980-3df4-11eb-9ff3-67c41480f6aa\",\n \"msgid\": \"3b9cabd0-3df4-11eb-9ff3-67c41480f6aa\",\n \"status\": \"successful\",\n \"err\": null,\n \"errmsg\": null\n },\n \"responseCode\": \"OK\",\n \"result\": {\n \"publishStatus\": \"Publish Operation for Framework Id 'dummy_framework' Started Successfully!\"\n }\n}" - }, - { - "name": "BAD REQUEST. The \"Publish Framework\" operation failed ! The possible reason for failure is that you may have missed providing input for a mandatory parameter.", - "originalRequest": { - "method": "POST", - "header": [ - { - "description": "Added as a part of security scheme: apikey", - "key": "Authorization", - "value": "" - }, - { - "description": "The Content Type entity is the media type of the resource.\n Possible media types can be:- \n - application/json", - "key": "Content-Type", - "value": "Ut enim offici" - }, - { - "description": "(Required) To make use of the API, you require authorization. Raise a request to the administrator for the use of the API. You will receive the authorization key. Specify the key received, here.", - "key": "Authorization", - "value": "Ut enim offici" - }, - { - "description": "(Required) It is the Unique Id to identify the root organisation to which the user belongs", - "key": "X-Channel-Id", - "value": "Ut enim offici" - } - ], - "body": { - "mode": "raw", - "raw": "{}", - "options": { - "raw": { - "language": "json" - } - } + "query": [ + { + "key": "framework", + "value": "{{fw11_code}}" }, - "url": { - "raw": "{{baseUrl}}/framework/v1/publish/:ID", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "framework", - "v1", - "publish", - ":ID" - ], - "variable": [ - { - "key": "ID", - "value": "Ut enim offici", - "description": "(Required) The identifier of the framework to be published" - } - ] - } - }, - "status": "Bad Request", - "code": 400, - "_postman_previewlanguage": "json", - "header": [ { - "key": "Content-Type", - "value": "application/json" + "key": "category", + "value": "dummy" } - ], - "cookie": [], - "body": "{\n \"id\": \"api.framework.publish\",\n \"ver\": \"1.0\",\n \"ts\": \"2020-12-14T10:08:19.872Z\",\n \"params\": {\n \"resmsgid\": \"4aa73a00-3df4-11eb-9ff3-67c41480f6aa\",\n \"msgid\": null,\n \"status\": \"failed\",\n \"err\": \"ERR_INVALID_FRAMEOWRK_ID\",\n \"errmsg\": \"Invalid Framework Id. Framework doesn't exist.\"\n },\n \"responseCode\": \"CLIENT_ERROR\",\n \"result\": {}\n}" - }, + ] + } + }, + "response": [] + }, + { + "name": "Create a valid term for invalid framework and invalid framework category", + "event": [ { - "name": "INTERNAL SERVER ERROR ! Looks like something went wrong! These errors are tracked automatically, but if the problem persists feel free to contact us. In the meantime, try refreshing.", - "originalRequest": { - "method": "POST", - "header": [ - { - "description": "Added as a part of security scheme: apikey", - "key": "Authorization", - "value": "" - }, - { - "description": "The Content Type entity is the media type of the resource.\n Possible media types can be:- \n - application/json", - "key": "Content-Type", - "value": "Ut enim offici" - }, - { - "description": "(Required) To make use of the API, you require authorization. Raise a request to the administrator for the use of the API. You will receive the authorization key. Specify the key received, here.", - "key": "Authorization", - "value": "Ut enim offici" - }, - { - "description": "(Required) It is the Unique Id to identify the root organisation to which the user belongs", - "key": "X-Channel-Id", - "value": "Ut enim offici" - } + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json()\r", + "\r", + "pm.test(\"Status code is 404\", function () {\r", + " pm.response.to.have.status(404);\r", + "});\r", + "pm.test(\"id has string - api.taxonomy.term.create\", function () {\r", + " pm.expect(jsonResponse.id).to.be.equal(\"api.taxonomy.term.create\");\r", + "});\r", + "pm.test(\"Version is 3.0 \", function () {\r", + " pm.expect(jsonResponse.ver).to.be.equal(\"3.0\");\r", + "});\r", + "pm.test(\"Verify keys and data type of the response result\", () => {\r", + " pm.expect(jsonResponse.params).to.have.all.keys('resmsgid','msgid','status', 'err','errmsg');\r", + "pm.expect(jsonResponse.params.resmsgid).to.be.a(\"String\");\r", + "pm.expect(jsonResponse.params.msgid).to.be.a(\"null\");\r", + " pm.expect(jsonResponse.params.status).to.be.a(\"String\");\r", + " pm.expect(jsonResponse.params.err).to.be.a(\"String\");\r", + " pm.expect(jsonResponse.params.errmsg).to.be.a(\"String\");\r", + "});\r", + "\r", + "pm.test(\"Status has string \", function () {\r", + " pm.expect(jsonResponse.params.status).to.be.equal(\"failed\");\r", + "});\r", + "\r", + "pm.test(\"err has string \", function () {\r", + " pm.expect(jsonResponse.params.err).to.be.equal(\"NOT_FOUND\");\r", + "});\r", + "\r", + "pm.test(\"errmsg has string \", function () {\r", + " pm.expect(jsonResponse.params.errmsg).to.be.include(\"Error! Node(s) doesn't Exists. | [Invalid Node Id.]: \");\r", + "});\r", + "\r", + "pm.test(\"responseCode has string \", function () {\r", + " pm.expect(jsonResponse.responseCode).to.be.include(\"RESOURCE_NOT_FOUND\");\r", + "});\r", + "\r", + "pm.test(`errmsg has string: Error! Node(s) doesn't Exists. | [Invalid Node Id.]: dummy_dummy` , function () {\r", + " pm.expect(jsonResponse.params.errmsg).to.be.include(`Error! Node(s) doesn't Exists. | [Invalid Node Id.]: dummy_dummy`);\r", + "});\r", + "\r", + "" ], - "body": { - "mode": "raw", - "raw": "{}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{baseUrl}}/framework/v1/publish/:ID", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "framework", - "v1", - "publish", - ":ID" - ], - "variable": [ - { - "key": "ID", - "value": "Ut enim offici", - "description": "(Required) The identifier of the framework to be published" - } - ] - } + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" }, - "status": "Internal Server Error", - "code": 500, - "_postman_previewlanguage": "text", - "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "{{auth_token}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"term\": {\n \"code\": \"Science\",\n \"name\": \"English\"\n }\n }\n}" + }, + "url": { + "raw": "{{host}}/framework/v3/term/create?framework=dummy&category=dummy", + "host": [ + "{{host}}" + ], + "path": [ + "framework", + "v3", + "term", + "create" + ], + "query": [ { - "key": "Content-Type", - "value": "text/plain" + "key": "framework", + "value": "dummy" + }, + { + "key": "category", + "value": "dummy" } - ], - "cookie": [], - "body": "" + ] } - ] + }, + "response": [] } ] - }, + } + ] + }, + { + "name": "Read Term", + "item": [ { - "name": "Negative", + "name": "Pre requisite", "item": [ { - "name": "Publish an invalid framework", + "name": "Create a master category", "event": [ + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + }, { "listen": "test", "script": { "exec": [ "let jsonResponse = pm.response.json()\r", "\r", - "pm.test(\"Status code is 500\", function () {\r", - " pm.response.to.have.status(500);\r", + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", "});\r", "\r", - "pm.test(\"errmsg has string\", function () {\r", - " pm.expect(jsonResponse.params.errmsg).to.be.equal(\"Something went wrong in server while processing the request\");\r", + "pm.collectionVariables.set(\"master14_id\",jsonResponse.result.identifier);\r", + "console.log(pm.collectionVariables.get(\"master14_id\"));\r", + "pm.collectionVariables.set(\"master14_node\",jsonResponse.result.node_id);\r", + "console.log(pm.collectionVariables.get(\"master14_node\"));\r", + "\r", + "pm.test(`identifier should be equal to ${pm.collectionVariables.get(\"master14_id\")}`, () => {\r", + " pm.expect(jsonResponse.result.identifier).to.eql(`${pm.collectionVariables.get(\"master14_code\")}`);\r", "});\r", "\r", - "pm.test(\"responseCode has string\", function () {\r", - " pm.expect(jsonResponse.responseCode).to.be.equal(\"SERVER_ERROR\");\r", + "pm.test(`node_id should be equal to ${pm.collectionVariables.get(\"master14_node\")}`, () => {\r", + " pm.expect(jsonResponse.result.node_id).to.eql(`${pm.collectionVariables.get(\"master14_code\")}`);\r", "});" ], "type": "text/javascript" @@ -3059,16 +17518,16 @@ "method": "POST", "header": [ { - "key": "X-Channel-Id", - "value": "sunbird" + "key": "Accept", + "value": "application/json" }, { "key": "Content-Type", "value": "application/json" }, { - "key": "Accept", - "value": "application/json" + "key": "X-Channel-Id", + "value": "sunbird" }, { "key": "Authorization", @@ -3077,36 +17536,36 @@ ], "body": { "mode": "raw", - "raw": "{}" + "raw": "{\n \"request\": {\n \"category\": {\n \"name\": \"master\",\n \"code\": \"{{master14_code}}\",\n \"targetIdFieldName\": \"targetmasterIds\",\n \"searchLabelFieldName\": \"se_master\",\n \"searchIdFieldName\": \"se_master\",\n \"orgIdFieldName\": \"masterIds\"\n }\n }\n}" }, "url": { - "raw": "{{host}}/framework/v3/publish/dummy", + "raw": "{{host}}/framework/v3/category/master/create", "host": [ "{{host}}" ], "path": [ "framework", "v3", - "publish", - "dummy" + "category", + "master", + "create" ] } }, "response": [] - } - ] - } - ] - }, - { - "name": "Copy Framework", - "item": [ - { - "name": "Positive", - "item": [ + }, { - "name": "Copy a valid framework", + "name": "Create a framework", "event": [ + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + }, { "listen": "test", "script": { @@ -3124,50 +17583,43 @@ " pm.expect(jsonResponse.params.errmsg).to.be.a(\"null\");\r", "});\r", "\r", - "pm.test(\"Status has string Successful\", function () {\r", + "pm.test(\"Status has string \", function () {\r", " pm.expect(jsonResponse.params.status).to.be.equal(\"successful\");\r", "});\r", "\r", "pm.test(\"Verify keys and data type of the response result\", () => {\r", - " pm.expect(jsonResponse.result).to.have.all.keys('node_id');\r", + " pm.expect(jsonResponse.result).to.have.all.keys('node_id', 'versionKey');\r", " pm.expect(jsonResponse.result.node_id).to.be.a(\"String\");\r", + " pm.expect(jsonResponse.result.versionKey).to.be.a(\"string\");\r", "});\r", "\r", - "// var node = JSON.parse(jsonResponse);\r", - "// pm.globals.set(\"node_id\", node.node_id);\r", - "// console.log(node_id);\r", + "pm.collectionVariables.set(\"fw12_node\",jsonResponse.result.node_id);\r", + "console.log(pm.collectionVariables.get(\"fw12_node\"));\r", "\r", - "// pm.test(\"Status has string \", function () {\r", - "// pm.expect(jsonResponse.result.node_id).to.be.equal(code);\r", - "// });\r", - "\r", - "//how to check the node_id is same as the input" - ], - "type": "text/javascript" - } - }, - { - "listen": "prerequest", - "script": { - "exec": [ - "pm.environment.set(\"code\", \"Framework_copy_8\");" + "pm.test(`node id should be equal to ${pm.collectionVariables.get(\"fw12_node\")}`, () => {\r", + " pm.expect(jsonResponse.result.node_id).to.eql(pm.collectionVariables.get(\"fw12_code\"));\r", + "});\r", + "" ], "type": "text/javascript" } } ], + "protocolProfileBehavior": { + "disabledSystemHeaders": {} + }, "request": { "auth": { "type": "apikey", "apikey": [ { - "key": "key", - "value": "Authorization", + "key": "value", + "value": "{{auth_token}}", "type": "string" }, { - "key": "value", - "value": "{{apiKey}}", + "key": "key", + "value": "Authorization", "type": "string" }, { @@ -3185,17 +17637,24 @@ "value": "{{X-Channel-Id}}" }, { - "key": "Content-Type", - "value": "application/json" + "key": "", + "value": "", + "disabled": true }, { "key": "Accept", "value": "application/json" + }, + { + "key": "Authorization", + "value": "", + "type": "text", + "disabled": true } ], "body": { "mode": "raw", - "raw": "{\n \"request\": {\n \"framework\": {\n \"code\": \"{{code}}\"\n }\n }\n}", + "raw": "{\n \"request\": {\n \"framework\": {\n \"name\": \"{{fw12_name}}\",\n \"code\": \"{{fw12_code}}\"\n \n }\n }\n}", "options": { "raw": { "language": "json" @@ -3203,22 +17662,21 @@ } }, "url": { - "raw": "{{host}}/framework/v3/copy/{{node_id}}", + "raw": "{{host}}/framework/v3/create", "host": [ "{{host}}" ], "path": [ "framework", "v3", - "copy", - "{{node_id}}" + "create" ] }, - "description": "This API is associated with copying a framework\n - The endpoint for **Copy Framework** is `/framework/v1/copy/{ID}`\n - It points to knowledge-mw-service - `v1/framework/copy/{ID}`\n - The fields marked with an asterisk (*) are mandatory. They cannot be null or empty." + "description": "This API is associated with creating a new framework on the Sunbird Platform.\n - The endpoint for **Create a Framework** is `/framework/v1/create`\n - It points to knowledge-mw-service - `/v1/framework/create`\n - The fields marked with an asterisk (*) are mandatory. They cannot be null or empty." }, "response": [ { - "name": "OK ! Successful operation.\"Copy framework\" operation was successfully executed.", + "name": "OK ! Successful operation.\"create framework\" operation was successfully executed.", "originalRequest": { "method": "POST", "header": [ @@ -3228,7 +17686,7 @@ "value": "" }, { - "description": "(Required) The Content Type entity is the media type of the resource.\n Possible media types can be:- \n - application/json", + "description": "(Required) The Content Type entity is the media type of the resource\n Possible media types can be:- \n - application/json", "key": "Content-Type", "value": "Ut enim offici" }, @@ -3245,7 +17703,7 @@ ], "body": { "mode": "raw", - "raw": "{\n \"request\": {\n \"framework\": {\n \"code\": \"NCERTCOPY11\"\n }\n }\n}", + "raw": "{\n \"request\": {\n \"framework\": {\n \"name\": \"Framework Name\",\n \"code\": \"dummy_framework\",\n \"channels\": [\n {\n \"identifier\": \"in.ekstep\"\n }\n ]\n }\n }\n}", "options": { "raw": { "language": "json" @@ -3253,22 +17711,14 @@ } }, "url": { - "raw": "{{baseUrl}}/framework/v1/copy/:ID", + "raw": "{{baseUrl}}/framework/v1/create", "host": [ "{{baseUrl}}" ], "path": [ "framework", "v1", - "copy", - ":ID" - ], - "variable": [ - { - "key": "ID", - "value": "Ut enim offici", - "description": "(Required) The identifier of the framework to be copied" - } + "create" ] } }, @@ -3282,77 +17732,10 @@ } ], "cookie": [], - "body": "{\n \"id\": \"api.framework.copy\",\n \"ver\": \"1.0\",\n \"ts\": \"2020-12-14T10:46:44.287Z\",\n \"params\": {\n \"resmsgid\": \"a8310cf0-3df9-11eb-9ff3-67c41480f6aa\",\n \"msgid\": \"a6b2aa50-3df9-11eb-9ff3-67c41480f6aa\",\n \"status\": \"successful\",\n \"err\": null,\n \"errmsg\": null\n },\n \"responseCode\": \"OK\",\n \"result\": {\n \"node_id\": \"NCERTCOPY11\"\n }\n}" - }, - { - "name": "BAD REQUEST. The \"Copy fFramework\" operation failed ! The possible reason for failure is that you may have missed providing input for a mandatory parameter.", - "originalRequest": { - "method": "POST", - "header": [ - { - "description": "Added as a part of security scheme: apikey", - "key": "Authorization", - "value": "" - }, - { - "description": "(Required) The Content Type entity is the media type of the resource.\n Possible media types can be:- \n - application/json", - "key": "Content-Type", - "value": "Ut enim offici" - }, - { - "description": "(Required) To make use of the API, you require authorization. Raise a request to the administrator for the use of the API. You will receive the authorization key. Specify the key received, here.", - "key": "Authorization", - "value": "Ut enim offici" - }, - { - "description": "(Required) It is the Unique Id to identify the root organisation to which the user belongs", - "key": "X-Channel-Id", - "value": "Ut enim offici" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"request\": {\n \"framework\": {\n \"code\": \"NCERTCOPY11\"\n }\n }\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{baseUrl}}/framework/v1/copy/:ID", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "framework", - "v1", - "copy", - ":ID" - ], - "variable": [ - { - "key": "ID", - "value": "Ut enim offici", - "description": "(Required) The identifier of the framework to be copied" - } - ] - } - }, - "status": "Bad Request", - "code": 400, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "Content-Type", - "value": "application/json" - } - ], - "cookie": [], - "body": "{\n \"id\": \"api.framework.copy\",\n \"ver\": \"1.0\",\n \"ts\": \"2020-12-14T10:47:22.578Z\",\n \"params\": {\n \"resmsgid\": \"bf03cb20-3df9-11eb-9ff3-67c41480f6aa\",\n \"msgid\": null,\n \"status\": \"failed\",\n \"err\": \"ERR_FRAMEWORK_EXISTS\",\n \"errmsg\": \"Framework with code: NCERTCOPY11, already exists.\"\n },\n \"responseCode\": \"CLIENT_ERROR\",\n \"result\": {}\n}" + "body": "{\n \"id\": \"api.framework.create\",\n \"ver\": \"1.0\",\n \"ts\": \"2020-12-14T09:49:06.794Z\",\n \"params\": {\n \"resmsgid\": \"9b5d7ca0-3df1-11eb-9ff3-67c41480f6aa\",\n \"msgid\": \"9b4a90e0-3df1-11eb-9ff3-67c41480f6aa\",\n \"status\": \"successful\",\n \"err\": null,\n \"errmsg\": null\n },\n \"responseCode\": \"OK\",\n \"result\": {\n \"node_id\": \"dummy_framework\",\n \"versionKey\": \"1607939346678\"\n }\n}" }, { - "name": "RESOURCE NOT FOUND. The \"Copy fFramework\" operation failed ! The possible reason for failure is that you may have missed invlalid framework id.", + "name": "BAD REQUEST. The \"create framework\" operation failed ! The possible reason for failure is that you may have missed providing input for a mandatory parameter.", "originalRequest": { "method": "POST", "header": [ @@ -3362,7 +17745,7 @@ "value": "" }, { - "description": "(Required) The Content Type entity is the media type of the resource.\n Possible media types can be:- \n - application/json", + "description": "(Required) The Content Type entity is the media type of the resource\n Possible media types can be:- \n - application/json", "key": "Content-Type", "value": "Ut enim offici" }, @@ -3379,7 +17762,7 @@ ], "body": { "mode": "raw", - "raw": "{\n \"request\": {\n \"framework\": {\n \"code\": \"NCERTCOPY11\"\n }\n }\n}", + "raw": "{\n \"request\": {\n \"framework\": {\n \"name\": \"Framework Name\",\n \"code\": \"dummy_framework\",\n \"channels\": [\n {\n \"identifier\": \"in.ekstep\"\n }\n ]\n }\n }\n}", "options": { "raw": { "language": "json" @@ -3387,27 +17770,19 @@ } }, "url": { - "raw": "{{baseUrl}}/framework/v1/copy/:ID", + "raw": "{{baseUrl}}/framework/v1/create", "host": [ "{{baseUrl}}" ], "path": [ "framework", - "v1", - "copy", - ":ID" - ], - "variable": [ - { - "key": "ID", - "value": "Ut enim offici", - "description": "(Required) The identifier of the framework to be copied" - } + "v1", + "create" ] } }, - "status": "Not Found", - "code": 404, + "status": "Bad Request", + "code": 400, "_postman_previewlanguage": "json", "header": [ { @@ -3416,7 +17791,7 @@ } ], "cookie": [], - "body": "{\n \"id\": \"api.framework.copy\",\n \"ver\": \"1.0\",\n \"ts\": \"2020-12-14T10:47:47.865Z\",\n \"params\": {\n \"resmsgid\": \"ce164890-3df9-11eb-9ff3-67c41480f6aa\",\n \"msgid\": null,\n \"status\": \"failed\",\n \"err\": \"ERR_DATA_NOT_FOUND\",\n \"errmsg\": \"Data not found with id : NCERT101100\"\n },\n \"responseCode\": \"RESOURCE_NOT_FOUND\",\n \"result\": {}\n}" + "body": "{\n \"id\": \"api.framework.create\",\n \"ver\": \"1.0\",\n \"ts\": \"2020-12-14T09:50:45.249Z\",\n \"params\": {\n \"resmsgid\": \"d60c8710-3df1-11eb-9ff3-67c41480f6aa\",\n \"msgid\": null,\n \"status\": \"failed\",\n \"err\": \"CONSTRAINT_VALIDATION_FAILED\",\n \"errmsg\": \"Object already exists with identifier: dummy_framework\"\n },\n \"responseCode\": \"CLIENT_ERROR\",\n \"result\": {}\n}" }, { "name": "INTERNAL SERVER ERROR ! Looks like something went wrong! These errors are tracked automatically, but if the problem persists feel free to contact us. In the meantime, try refreshing.", @@ -3429,7 +17804,7 @@ "value": "" }, { - "description": "(Required) The Content Type entity is the media type of the resource.\n Possible media types can be:- \n - application/json", + "description": "(Required) The Content Type entity is the media type of the resource\n Possible media types can be:- \n - application/json", "key": "Content-Type", "value": "Ut enim offici" }, @@ -3446,7 +17821,7 @@ ], "body": { "mode": "raw", - "raw": "{\n \"request\": {\n \"framework\": {\n \"code\": \"NCERTCOPY11\"\n }\n }\n}", + "raw": "{\n \"request\": {\n \"framework\": {\n \"name\": \"Framework Name\",\n \"code\": \"dummy_framework\",\n \"channels\": [\n {\n \"identifier\": \"in.ekstep\"\n }\n ]\n }\n }\n}", "options": { "raw": { "language": "json" @@ -3454,22 +17829,14 @@ } }, "url": { - "raw": "{{baseUrl}}/framework/v1/copy/:ID", + "raw": "{{baseUrl}}/framework/v1/create", "host": [ "{{baseUrl}}" ], "path": [ "framework", "v1", - "copy", - ":ID" - ], - "variable": [ - { - "key": "ID", - "value": "Ut enim offici", - "description": "(Required) The identifier of the framework to be copied" - } + "create" ] } }, @@ -3482,460 +17849,65 @@ "value": "text/plain" } ], - "cookie": [], - "body": "" - } - ] - } - ], - "description": "name of the framework should be updated before every run" - }, - { - "name": "Negative", - "item": [ - { - "name": "Copy an invalid framework", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "let jsonResponse = pm.response.json()\r", - "\r", - "pm.test(\"Status code is 404\", function () {\r", - " pm.response.to.have.status(404);\r", - "});\r", - "\r", - "pm.test(\"Status code name has string\", function () {\r", - " pm.response.to.have.status(\"Not Found\");\r", - "});\r", - "\r", - "pm.test(\"Verify keys and data type of the response result\", () => {\r", - " pm.expect(jsonResponse.params).to.have.all.keys('resmsgid','msgid','err','status','errmsg');\r", - " pm.expect(jsonResponse.params.resmsgid).to.be.a(\"String\");\r", - " pm.expect(jsonResponse.params.msgid).to.be.a(\"null\");\r", - " pm.expect(jsonResponse.params.err).to.be.a(\"String\");\r", - " pm.expect(jsonResponse.params.status).to.be.a(\"String\");\r", - " pm.expect(jsonResponse.params.errmsg).to.be.a(\"String\");\r", - " });\r", - "\r", - "pm.test(\"Err has string\", function () {\r", - " pm.expect(jsonResponse.params.err).to.be.equal(\"NOT_FOUND\");\r", - "});\r", - "pm.test(\"Status has string\", function () {\r", - " pm.expect(jsonResponse.params.status).to.be.equal(\"failed\");\r", - "});\r", - "pm.test(\"errmsg has string\", function () {\r", - " pm.expect(jsonResponse.params.errmsg).to.be.equal(\"Error! Node(s) doesn't Exists. | [Invalid Node Id.]: dummy\");\r", - "});\r", - "pm.test(\"responseCode has string\", function () {\r", - " pm.expect(jsonResponse.responseCode).to.be.equal(\"RESOURCE_NOT_FOUND\");\r", - "});\r", - "\r", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "apikey", - "apikey": [ - { - "key": "in", - "value": "header", - "type": "string" - }, - { - "key": "value", - "value": "{{auth_token}}", - "type": "string" - }, - { - "key": "key", - "value": "Authorization", - "type": "string" - } - ] - }, - "method": "POST", - "header": [ - { - "key": "Accept", - "value": "application/json", - "type": "text" - }, - { - "key": "X-Channel-Id", - "value": "{{X-Channel-Id}}", - "type": "text" - }, - { - "key": "Content-Type", - "value": "application/json", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\r\n \"request\": {\r\n \"framework\": {\r\n \"code\": \"Framework_copy_5\"\r\n }\r\n }\r\n}" - }, - "url": { - "raw": "{{host}}/framework/v3/copy/dummy", - "host": [ - "{{host}}" - ], - "path": [ - "framework", - "v3", - "copy", - "dummy" - ] - } - }, - "response": [] - }, - { - "name": "Copy a framework with existing name", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "let jsonResponse = pm.response.json()\r", - "\r", - "pm.test(\"Status code is 400\", function () {\r", - " pm.response.to.have.status(400);\r", - "});\r", - "\r", - "pm.test(\"Status code name has string\", function () {\r", - " pm.response.to.have.status(\"Bad Request\");\r", - "});\r", - "\r", - "pm.test(\"Verify keys and data type of the response result\", () => {\r", - " pm.expect(jsonResponse.params).to.have.all.keys('resmsgid','msgid','err','status','errmsg');\r", - " pm.expect(jsonResponse.params.resmsgid).to.be.a(\"String\");\r", - " pm.expect(jsonResponse.params.msgid).to.be.a(\"null\");\r", - " pm.expect(jsonResponse.params.err).to.be.a(\"String\");\r", - " pm.expect(jsonResponse.params.status).to.be.a(\"String\");\r", - " pm.expect(jsonResponse.params.errmsg).to.be.a(\"String\");\r", - " });\r", - "\r", - "pm.test(\"Err has string\", function () {\r", - " pm.expect(jsonResponse.params.err).to.be.equal(\"CONSTRAINT_VALIDATION_FAILED\");\r", - "});\r", - "pm.test(\"Status has string\", function () {\r", - " pm.expect(jsonResponse.params.status).to.be.equal(\"failed\");\r", - "});\r", - "pm.test(\"errmsg has string\", function () {\r", - " pm.expect(jsonResponse.params.errmsg).to.be.equal(\"Object already exists with identifier: Framework_copy_4\");\r", - "});\r", - "pm.test(\"responseCode has string\", function () {\r", - " pm.expect(jsonResponse.responseCode).to.be.equal(\"CLIENT_ERROR\");\r", - "});\r", - "\r", - "" - ], - "type": "text/javascript" - } - }, - { - "listen": "prerequest", - "script": { - "exec": [ - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "apikey", - "apikey": [ - { - "key": "in", - "value": "header", - "type": "string" - }, - { - "key": "value", - "value": "{{auth_token}}", - "type": "string" - }, - { - "key": "key", - "value": "Authorization", - "type": "string" - } - ] - }, - "method": "POST", - "header": [ - { - "key": "Accept", - "value": "application/json", - "type": "text" - }, - { - "key": "X-Channel-Id", - "value": "{{X-Channel-Id}}", - "type": "text" - }, - { - "key": "Content-Type", - "value": "application/json", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\r\n \"request\": {\r\n \"framework\": {\r\n \"code\": \"Framework_copy_4\"\r\n }\r\n }\r\n}" - }, - "url": { - "raw": "{{host}}/framework/v3/copy/Framework5", - "host": [ - "{{host}}" - ], - "path": [ - "framework", - "v3", - "copy", - "Framework5" - ] - } - }, - "response": [] - } - ] - } - ] - }, - { - "name": "Delete a Framework", - "item": [ - { - "name": "Positive", - "item": [ + "cookie": [], + "body": "" + } + ] + }, { - "name": "Delete a valid framework", + "name": "Create Framework Category", "event": [ { - "listen": "test", + "listen": "prerequest", "script": { "exec": [ - "let jsonResponse = pm.response.json()\r", - "\r", - "pm.test(\"Status code is 200\", function () {\r", - " pm.response.to.have.status(200);\r", - "});\r", - "\r", - "\r", - "pm.test(\"Verify keys and data type of the response result\", () => {\r", - " pm.expect(jsonResponse.params).to.have.all.keys('resmsgid','msgid','err','status','errmsg');\r", - " pm.expect(jsonResponse.params.resmsgid).to.be.a(\"String\");\r", - " pm.expect(jsonResponse.params.msgid).to.be.a('null');\r", - " pm.expect(jsonResponse.params.err).to.be.a('null');\r", - " pm.expect(jsonResponse.params.status).to.be.a(\"String\");\r", - " pm.expect(jsonResponse.params.errmsg).to.be.a('null');\r", - " });\r", - "\r", - "\r", - "pm.test(\"Status has string\", function () {\r", - " pm.expect(jsonResponse.params.status).to.be.equal(\"successful\");\r", - "});\r", - "\r", - "pm.test(\"responseCode has string\", function () {\r", - " pm.expect(jsonResponse.responseCode).to.be.equal(\"OK\");\r", - "});\r", + "pm.globals.get(\"category\");\r", "\r", - "pm.test(\"Verify keys and data type of the response result\", () => {\r", - " pm.expect(jsonResponse.result).to.have.all.keys('identifier','node_id');\r", - " pm.expect(jsonResponse.result.identifier).to.be.a(\"String\");\r", - " pm.expect(jsonResponse.result.node_id).to.be.a(\"string\");\r", - "});" + "" ], "type": "text/javascript" } - } - ], - "request": { - "auth": { - "type": "apikey", - "apikey": [ - { - "key": "in", - "value": "header", - "type": "string" - }, - { - "key": "value", - "value": "{{auth_token}}", - "type": "string" - }, - { - "key": "key", - "value": "Authorization", - "type": "string" - } - ] }, - "method": "DELETE", - "header": [ - { - "key": "X-Channel-Id", - "value": "{{X-Channel-Id}}", - "type": "text" - }, - { - "key": "Accept", - "value": "application/json", - "type": "text" - }, - { - "key": "Content-Type", - "value": "application/json", - "type": "text" - } - ], - "url": { - "raw": "{{host}}/framework/v3/retire/{{node_fw}}", - "host": [ - "{{host}}" - ], - "path": [ - "framework", - "v3", - "retire", - "{{node_fw}}" - ] - } - }, - "response": [] - } - ] - }, - { - "name": "Negative", - "item": [ - { - "name": "Delete an invalid framework", - "event": [ { "listen": "test", "script": { "exec": [ "let jsonResponse = pm.response.json()\r", "\r", - "pm.test(\"Status code is 404\", function () {\r", - " pm.response.to.have.status(404);\r", - "});\r", - "\r", - "pm.test(\"Status code name has string\", function () {\r", - " pm.response.to.have.status(\"Not Found\");\r", + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", "});\r", "\r", "pm.test(\"Verify keys and data type of the response result\", () => {\r", - " pm.expect(jsonResponse.params).to.have.all.keys('resmsgid','msgid','err','status','errmsg');\r", - " pm.expect(jsonResponse.params.resmsgid).to.be.a(\"String\");\r", - " pm.expect(jsonResponse.params.msgid).to.be.a(\"null\");\r", - " pm.expect(jsonResponse.params.err).to.be.a(\"String\");\r", + " pm.expect(jsonResponse.params).to.have.all.keys('resmsgid','msgid','status', 'err','errmsg');\r", + "pm.expect(jsonResponse.params.resmsgid).to.be.a(\"String\");\r", + "pm.expect(jsonResponse.params.msgid).to.be.a(\"null\");\r", " pm.expect(jsonResponse.params.status).to.be.a(\"String\");\r", - " pm.expect(jsonResponse.params.errmsg).to.be.a(\"String\");\r", - " });\r", - "\r", - "pm.test(\"Err has string\", function () {\r", - " pm.expect(jsonResponse.params.err).to.be.equal(\"NOT_FOUND\");\r", - "});\r", - "pm.test(\"Status has string\", function () {\r", - " pm.expect(jsonResponse.params.status).to.be.equal(\"failed\");\r", + " pm.expect(jsonResponse.params.err).to.be.a(\"null\");\r", + " pm.expect(jsonResponse.params.errmsg).to.be.a(\"null\");\r", "});\r", - "pm.test(\"errmsg has string\", function () {\r", - " pm.expect(jsonResponse.params.errmsg).to.be.equal(\"Error! Node(s) doesn't Exists. | [Invalid Node Id.]: abc\");\r", + "\r", + "pm.test(\"Status has string \", function () {\r", + " pm.expect(jsonResponse.params.status).to.be.equal(\"successful\");\r", "});\r", - "pm.test(\"responseCode has string\", function () {\r", - " pm.expect(jsonResponse.responseCode).to.be.equal(\"RESOURCE_NOT_FOUND\");\r", + "\r", + "pm.test(\"Verify keys and data type of the response result\", () => {\r", + " pm.expect(jsonResponse.result).to.have.all.keys('identifier', 'versionKey');\r", + " pm.expect(jsonResponse.result.identifier).to.be.a(\"String\");\r", + " pm.expect(jsonResponse.result.versionKey).to.be.a(\"string\");\r", "});\r", "\r", - "" + "pm.collectionVariables.set(\"fwcat_cat7\",jsonResponse.result.identifier);\r", + "console.log(pm.collectionVariables.get(\"fwcat_cat7\"));\r", + "\r", + "pm.test(`identifier should be equal to ${pm.collectionVariables.get(\"fwcat_cat7\")}`, () => {\r", + " pm.expect(jsonResponse.result.identifier).to.eql(`${pm.collectionVariables.get(\"fw12_code\")}_${pm.collectionVariables.get(\"master14_code\")}`);\r", + "});" ], "type": "text/javascript" } } ], - "request": { - "auth": { - "type": "apikey", - "apikey": [ - { - "key": "in", - "value": "header", - "type": "string" - }, - { - "key": "value", - "value": "{{auth_token}}", - "type": "string" - }, - { - "key": "key", - "value": "Authorization", - "type": "string" - } - ] - }, - "method": "DELETE", - "header": [ - { - "key": "Accept", - "value": "application/json", - "type": "text" - }, - { - "key": "Content-Type", - "value": "application/json", - "type": "text" - }, - { - "key": "X-Channel-Id", - "value": "{{X-Channel-Id}}", - "type": "text" - } - ], - "url": { - "raw": "{{host}}/framework/v3/retire/abc", - "host": [ - "{{host}}" - ], - "path": [ - "framework", - "v3", - "retire", - "abc" - ] - } - }, - "response": [] - } - ] - } - ] - } - ], - "description": "1. Each time before running the folder, unique name should be given for the framework for create framework API\n \n\n2\\. Framework can be created only for existing frameworkmaster category, if we wish to create Framework master category, it is available in the pre-requisite of publish framework\n\n3\\. Need to create framework master category if it is already existing" - }, - { - "name": "Framework Category", - "item": [ - { - "name": "Create framework category", - "item": [ - { - "name": "Positive", - "item": [ - { - "name": "Create Category", "request": { "auth": { "type": "apikey", @@ -3975,7 +17947,7 @@ ], "body": { "mode": "raw", - "raw": "{\n \"request\": {\n \"category\": {\n \"name\": \"Board\",\n \"code\": \"board\",\n \"description\":\"Board category\"\n }\n }\n}", + "raw": "{\n \"request\": {\n \"category\": {\n \"name\": \"Board\",\n \"code\": \"{{master14_code}}\",\n \"description\":\"Board category\"\n }\n }\n}", "options": { "raw": { "language": "json" @@ -3983,7 +17955,7 @@ } }, "url": { - "raw": "{{host}}/framework/v3/category/create?framework=Framework03", + "raw": "{{host}}/framework/v3/category/create?framework={{fw12_code}}", "host": [ "{{host}}" ], @@ -3996,7 +17968,7 @@ "query": [ { "key": "framework", - "value": "Framework03", + "value": "{{fw12_code}}", "description": "(Required) The code of the framework under which category has to be created" } ] @@ -4188,32 +18160,42 @@ "body": "" } ] - } - ] - }, - { - "name": "Negative", - "item": [ - { - "name": "Create a duplicate framework category", - "request": { - "method": "GET", - "header": [] - }, - "response": [] - } - ] - } - ] - }, - { - "name": "Get a Framework Category", - "item": [ - { - "name": "Positive", - "item": [ + }, { - "name": "Read framework category for a valid framework", + "name": "Create a framework term", + "event": [ + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + }, + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json()\r", + "pm.collectionVariables.set(\"term_id\",jsonResponse.result.identifier);\r", + "console.log(pm.collectionVariables.get(\"term_id\"));\r", + "pm.collectionVariables.set(\"term_node\",jsonResponse.result.node_id);\r", + "console.log(pm.collectionVariables.get(\"term_node\"));\r", + "\r", + "pm.test(`identifier should be equal to ${pm.collectionVariables.get(\"term_id\")}`, () => {\r", + " pm.expect(jsonResponse.result.identifier).to.eql(`${pm.collectionVariables.get(\"fw12_code\")}_${pm.collectionVariables.get(\"master14_code\")}_${pm.collectionVariables.get(\"t2_term\")}`);\r", + "});\r", + "\r", + "pm.test(`node should be equal to ${pm.collectionVariables.get(\"term_node\")}`, () => {\r", + " pm.expect(jsonResponse.result.node_id).to.eql(`${pm.collectionVariables.get(\"fw12_code\")}_${pm.collectionVariables.get(\"master14_code\")}_${pm.collectionVariables.get(\"t2_term\")}`);\r", + "});\r", + "" + ], + "type": "text/javascript" + } + } + ], "request": { "auth": { "type": "apikey", @@ -4235,47 +18217,57 @@ } ] }, - "method": "GET", + "method": "POST", "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, { "key": "Accept", "value": "application/json" } ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"term\": {\n \"code\": \"{{t2_term}}\",\n \"name\": \"English\"\n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, "url": { - "raw": "{{baseUrl}}/framework/v1/category/read/:code?framework=Ut enim offici", + "raw": "{{baseUrl}}/framework/v3/term/create?framework={{fw12_code}}&category={{master14_code}}", "host": [ "{{baseUrl}}" ], "path": [ "framework", - "v1", - "category", - "read", - ":code" + "v3", + "term", + "create" ], "query": [ { "key": "framework", - "value": "Ut enim offici", - "description": "(Required) Name of the framework under which category exists. Its an abstract data structure which serves as a template for categories and terms" - } - ], - "variable": [ + "value": "{{fw12_code}}", + "description": "(Required) Represents the framework in which the term is to be created" + }, { - "key": "code", - "value": "Ut enim offici", - "description": "(Required) The name/code of the category to be fetched" + "key": "category", + "value": "{{master14_code}}", + "description": "(Required) Represents the category in which the term is to be created" } ] }, - "description": "This API is associated with fetching a category on Sunbird Platform\n - The endpoint for **Fetch Category** is `/framework/v1/category/read/{code}`\n - It points to knowledge-mw-service - `/v1/framework/category/read/{code}`\n - The fields marked with an asterisk (*) are mandatory. They cannot be null or empty." + "description": "This API is associated with creating a term under a framework category\n - The endpoint for **Create Term** is `/framework/v1/term/create`\n - It points to knowledge-mw-service - `/v1/framework/term/create`\n - The fields marked with an asterisk (*) are mandatory. They cannot be null or empty.\"" }, "response": [ { - "name": "OK ! Successful operation.\"fetch category\" operation was successfully executed.", + "name": "OK ! Successful operation.\"create term\" operation was successfully executed.", "originalRequest": { - "method": "GET", + "method": "POST", "header": [ { "description": "Added as a part of security scheme: apikey", @@ -4283,7 +18275,7 @@ "value": "" }, { - "description": "The Content Type entity is the media type of the resource\n Possible media types can be:- \n - application/json", + "description": "(Required) The Content Type entity is the media type of the resource.\n Possible media types can be:- \n - application/json", "key": "Content-Type", "value": "Ut enim offici" }, @@ -4293,29 +18285,34 @@ "value": "Ut enim offici" } ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"term\": {\n \"code\": \"english\",\n \"name\": \"English\"\n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, "url": { - "raw": "{{baseUrl}}/framework/v1/category/read/:code?framework=Ut enim offici", + "raw": "{{baseUrl}}/framework/v1/term/create?framework=Ut enim offici&category=Ut enim offici", "host": [ "{{baseUrl}}" ], "path": [ "framework", "v1", - "category", - "read", - ":code" + "term", + "create" ], "query": [ { "key": "framework", "value": "Ut enim offici" - } - ], - "variable": [ + }, { - "key": "code", - "value": "Ut enim offici", - "description": "(Required) The name/code of the category to be fetched" + "key": "category", + "value": "Ut enim offici" } ] } @@ -4330,12 +18327,12 @@ } ], "cookie": [], - "body": "{\n \"id\": \"api.category.read\",\n \"ver\": \"1.0\",\n \"ts\": \"2020-12-14T19:34:41.261Z\",\n \"params\": {\n \"resmsgid\": \"6923b1d0-3e43-11eb-9ff3-67c41480f6aa\",\n \"msgid\": \"691e3390-3e43-11eb-9ff3-67c41480f6aa\",\n \"status\": \"successful\",\n \"err\": null,\n \"errmsg\": null\n },\n \"responseCode\": \"OK\",\n \"result\": {\n \"category\": {\n \"identifier\": \"dummy_framework_subject\",\n \"lastStatusChangedOn\": \"2020-12-14T19:30:32.392+0000\",\n \"code\": \"subject\",\n \"frameworks\": [\n {\n \"identifier\": \"dummy_framework\",\n \"name\": \"Framework Name\",\n \"objectType\": \"Framework\",\n \"relation\": \"hasSequenceMember\",\n \"description\": \"Dumy framework updated\",\n \"status\": \"Live\"\n }\n ],\n \"consumerId\": \"7411b6bd-89f3-40ec-98d1-229dc64ce77d\",\n \"channel\": \"in.ekstep\",\n \"description\": \"Subject\",\n \"domains\": [],\n \"createdOn\": \"2020-12-14T19:30:32.392+0000\",\n \"versionKey\": \"1607974232392\",\n \"terms\": [],\n \"appId\": \"@ignore@\",\n \"name\": \"Subject\",\n \"lastUpdatedOn\": \"2020-12-14T19:30:32.392+0000\",\n \"status\": \"Live\"\n }\n }\n}" + "body": "{\n \"id\": \"api.term.create\",\n \"ver\": \"1.0\",\n \"ts\": \"2020-12-14T19:44:02.348Z\",\n \"params\": {\n \"resmsgid\": \"b792c6c0-3e44-11eb-9ff3-67c41480f6aa\",\n \"msgid\": \"b783f9b0-3e44-11eb-9ff3-67c41480f6aa\",\n \"status\": \"successful\",\n \"err\": null,\n \"errmsg\": null\n },\n \"responseCode\": \"OK\",\n \"result\": {\n \"node_id\": [\n \"dummy_framework_subject_english\"\n ]\n }\n}" }, { - "name": "BAD REQUEST. The \"fetch category\" operation failed ! The possible reason for failure is that you may have missed providing input for a mandatory parameter.", + "name": "BAD REQUEST. The \"create term\" operation failed ! The possible reason for failure is that you may have missed providing input for a mandatory parameter.", "originalRequest": { - "method": "GET", + "method": "POST", "header": [ { "description": "Added as a part of security scheme: apikey", @@ -4343,7 +18340,7 @@ "value": "" }, { - "description": "The Content Type entity is the media type of the resource\n Possible media types can be:- \n - application/json", + "description": "(Required) The Content Type entity is the media type of the resource.\n Possible media types can be:- \n - application/json", "key": "Content-Type", "value": "Ut enim offici" }, @@ -4353,29 +18350,34 @@ "value": "Ut enim offici" } ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"term\": {\n \"code\": \"english\",\n \"name\": \"English\"\n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, "url": { - "raw": "{{baseUrl}}/framework/v1/category/read/:code?framework=Ut enim offici", + "raw": "{{baseUrl}}/framework/v1/term/create?framework=Ut enim offici&category=Ut enim offici", "host": [ "{{baseUrl}}" ], "path": [ "framework", "v1", - "category", - "read", - ":code" + "term", + "create" ], "query": [ { "key": "framework", "value": "Ut enim offici" - } - ], - "variable": [ + }, { - "key": "code", - "value": "Ut enim offici", - "description": "(Required) The name/code of the category to be fetched" + "key": "category", + "value": "Ut enim offici" } ] } @@ -4390,12 +18392,12 @@ } ], "cookie": [], - "body": "{\n \"id\": \"api.category.read\",\n \"ver\": \"1.0\",\n \"ts\": \"2020-12-14T19:35:21.540Z\",\n \"params\": {\n \"resmsgid\": \"8125c840-3e43-11eb-9ff3-67c41480f6aa\",\n \"msgid\": null,\n \"status\": \"failed\",\n \"err\": \"ERR_INVALID_FRAMEWORK_ID\",\n \"errmsg\": \"Invalid FrameworkId: dummy_framework1 for Categoryinstance \"\n },\n \"responseCode\": \"CLIENT_ERROR\",\n \"result\": {}\n}" + "body": "{\n \"id\": \"api.term.create\",\n \"ver\": \"1.0\",\n \"ts\": \"2020-12-14T19:44:49.263Z\",\n \"params\": {\n \"resmsgid\": \"d3896ff0-3e44-11eb-9ff3-67c41480f6aa\",\n \"msgid\": null,\n \"status\": \"failed\",\n \"err\": \"ERR_INVALID_CATEGORY_ID\",\n \"errmsg\": \"Please provide valid category.\"\n },\n \"responseCode\": \"CLIENT_ERROR\",\n \"result\": {}\n}" }, { "name": "INTERNAL SERVER ERROR ! Looks like something went wrong! These errors are tracked automatically, but if the problem persists feel free to contact us. In the meantime, try refreshing.", "originalRequest": { - "method": "GET", + "method": "POST", "header": [ { "description": "Added as a part of security scheme: apikey", @@ -4403,7 +18405,7 @@ "value": "" }, { - "description": "The Content Type entity is the media type of the resource\n Possible media types can be:- \n - application/json", + "description": "(Required) The Content Type entity is the media type of the resource.\n Possible media types can be:- \n - application/json", "key": "Content-Type", "value": "Ut enim offici" }, @@ -4413,29 +18415,34 @@ "value": "Ut enim offici" } ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"term\": {\n \"code\": \"english\",\n \"name\": \"English\"\n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, "url": { - "raw": "{{baseUrl}}/framework/v1/category/read/:code?framework=Ut enim offici", + "raw": "{{baseUrl}}/framework/v1/term/create?framework=Ut enim offici&category=Ut enim offici", "host": [ "{{baseUrl}}" ], "path": [ "framework", "v1", - "category", - "read", - ":code" + "term", + "create" ], "query": [ { "key": "framework", "value": "Ut enim offici" - } - ], - "variable": [ + }, { - "key": "code", - "value": "Ut enim offici", - "description": "(Required) The name/code of the category to be fetched" + "key": "category", + "value": "Ut enim offici" } ] } @@ -4454,31 +18461,62 @@ } ] } - ] + ], + "description": "1. Framework name and code should be updated before each run\n2. Framework categroy should be a subset of master category, i.e., framework category can be created only when it is available in master category\n \n3. Create a master category with same indentifier before creating the framework category" }, - { - "name": "Negative", - "item": [ - { - "name": "Read framework category for an invalid framework", - "request": { - "method": "GET", - "header": [] - }, - "response": [] - } - ] - } - ] - }, - { - "name": "Update Framework category", - "item": [ { "name": "Positive", "item": [ { - "name": "Update a valid framework category for a valid framework", + "name": "Read term for valid framework and valid framework category", + "event": [ + { + "listen": "prerequest", + "script": { + "exec": [ + "pm.environment.get(\"term\");" + ], + "type": "text/javascript" + } + }, + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json()\r", + "\r", + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "\r", + "pm.test(\"Status code has OK\", function () {\r", + " pm.response.to.have.status(\"OK\");\r", + "});\r", + "pm.test(\"id has string - api.taxonomy.term.read\", function () {\r", + " pm.expect(jsonResponse.id).to.be.equal(\"api.taxonomy.term.read\");\r", + "});\r", + "pm.test(\"Version is 3.0 \", function () {\r", + " pm.expect(jsonResponse.ver).to.be.equal(\"3.0\");\r", + "});\r", + "pm.test(\"Verify keys and data type of the response result\", () => {\r", + " const jsonResponse = pm.response.json();\r", + "\r", + " pm.expect(jsonResponse.result.term).to.have.all.keys('identifier', 'lastStatusChangedOn', 'code', 'languageCode', 'createdOn', 'objectType', 'versionKey', 'framework', 'name', 'lastUpdatedOn', 'categories', 'category', 'status');\r", + "\r", + " pm.expect(jsonResponse.result.term.categories).to.be.an(\"array\");\r", + " pm.expect(jsonResponse.result.term.categories[0]).to.have.all.keys(\r", + " 'name', 'relation', 'identifier', 'description', 'objectType', 'status'\r", + " );\r", + "});\r", + "\r", + "pm.test(\"Status is Live\", function () {\r", + " pm.expect(jsonResponse.result.term.status).to.be.equal(\"Live\");\r", + "});" + ], + "type": "text/javascript" + } + } + ], "request": { "auth": { "type": "apikey", @@ -4500,60 +18538,51 @@ } ] }, - "method": "PATCH", + "method": "GET", "header": [ - { - "key": "Content-Type", - "value": "application/json" - }, { "key": "Accept", "value": "application/json" } ], - "body": { - "mode": "raw", - "raw": "{\n \"request\": {\n \"category\": {\n \"description\": \"Updated description\"\n }\n }\n}", - "options": { - "raw": { - "language": "json" - } - } - }, "url": { - "raw": "{{baseUrl}}/framework/v1/category/update/:code?framework=Ut enim offici", + "raw": "{{baseUrl}}/framework/v3/term/read/:{{t2_term}}?framework={{fw12_code}}&category={{master14_code}}", "host": [ "{{baseUrl}}" ], "path": [ "framework", - "v1", - "category", - "update", - ":code" + "v3", + "term", + "read", + ":{{t2_term}}" ], "query": [ { "key": "framework", - "value": "Ut enim offici", - "description": "(Required) Represents the framework to which the category belongs" + "value": "{{fw12_code}}", + "description": "(Required) Represents the framework id in which the term can be fetched" + }, + { + "key": "category", + "value": "{{master14_code}}", + "description": "(Required) Represents the category in which the term can be fetched" } ], "variable": [ { - "key": "code", - "value": "Ut enim offici", - "description": "(Required) The name/code of the category to be updated" + "key": "{{t2_term}}", + "value": "" } ] }, - "description": "This API is associated with updating a category in an existing framework\n - The endpoint for **Update Category** is `/framework/v1/category/update/{code}`\n - It points to knowledge-mw-service - `/v1/framework/category/update/{code}`\n - The fields marked with an asterisk (*) are mandatory. They cannot be null or empty." + "description": "This API is associated with fetching the available terms under a specific category and a framework on Sunbird Platform.\n - The endpoint for **Fetch Term** is `/framework/v1/term/read/{code}`\n - It points to knowledge-mw-service - `/v1/framework/term/read/{code}`\n - The fields marked with an asterisk (*) are mandatory. They cannot be null or empty." }, "response": [ { - "name": "OK ! Successful operation.\"update category\" operation was successfully executed.", + "name": "OK ! Successful operation.\"Fetch term\" operation was successfully executed.", "originalRequest": { - "method": "PATCH", + "method": "GET", "header": [ { "description": "Added as a part of security scheme: apikey", @@ -4561,7 +18590,7 @@ "value": "" }, { - "description": "(Required) The Content Type entity is the media type of the resource.\n Possible media types can be:- \n - application/json", + "description": "The Content Type entity is the media type of the resource.\n Possible media types can be:- \n - application/json", "key": "Content-Type", "value": "Ut enim offici" }, @@ -4571,38 +18600,33 @@ "value": "Ut enim offici" } ], - "body": { - "mode": "raw", - "raw": "{\n \"request\": {\n \"category\": {\n \"description\": \"Updated description\"\n }\n }\n}", - "options": { - "raw": { - "language": "json" - } - } - }, "url": { - "raw": "{{baseUrl}}/framework/v1/category/update/:code?framework=Ut enim offici", + "raw": "{{baseUrl}}/framework/v1/term/read/:code?framework=Ut enim offici&category=Ut enim offici", "host": [ "{{baseUrl}}" ], "path": [ "framework", "v1", - "category", - "update", + "term", + "read", ":code" ], "query": [ { "key": "framework", "value": "Ut enim offici" + }, + { + "key": "category", + "value": "Ut enim offici" } ], "variable": [ { "key": "code", "value": "Ut enim offici", - "description": "(Required) The name/code of the category to be updated" + "description": "(Required) The name/code of the term to be fetched" } ] } @@ -4617,12 +18641,12 @@ } ], "cookie": [], - "body": "{\n \"id\": \"api.category.update\",\n \"ver\": \"1.0\",\n \"ts\": \"2020-12-14T19:37:49.082Z\",\n \"params\": {\n \"resmsgid\": \"d916e7a0-3e43-11eb-9ff3-67c41480f6aa\",\n \"msgid\": \"d90f4680-3e43-11eb-9ff3-67c41480f6aa\",\n \"status\": \"successful\",\n \"err\": null,\n \"errmsg\": null\n },\n \"responseCode\": \"OK\",\n \"result\": {\n \"node_id\": \"dummy_framework_subject\",\n \"versionKey\": \"1607974669043\"\n }\n}" + "body": "{\n \"id\": \"api.term.read\",\n \"ver\": \"1.0\",\n \"ts\": \"2020-12-17T07:24:51.258Z\",\n \"params\": {\n \"resmsgid\": \"f380c1a0-4038-11eb-9b0c-abcfbdf41bc3\",\n \"msgid\": \"f358c740-4038-11eb-9b0c-abcfbdf41bc3\",\n \"status\": \"successful\",\n \"err\": null,\n \"errmsg\": null\n },\n \"responseCode\": \"OK\",\n \"result\": {\n \"term\": {\n \"associations\": [],\n \"identifier\": \"dummy_framework_subject_english\",\n \"lastStatusChangedOn\": \"2020-12-14T19:44:02.260+0000\",\n \"code\": \"english\",\n \"consumerId\": \"7411b6bd-89f3-40ec-98d1-229dc64ce77d\",\n \"channel\": \"in.ekstep\",\n \"description\": \"English\",\n \"createdOn\": \"2020-12-14T19:44:02.260+0000\",\n \"versionKey\": \"1607975299669\",\n \"children\": [],\n \"appId\": \"dev.sunbird.portal\",\n \"name\": \"English\",\n \"lastUpdatedOn\": \"2020-12-14T19:48:19.669+0000\",\n \"categories\": [\n {\n \"identifier\": \"dummy_framework_subject\",\n \"name\": \"Subject\",\n \"objectType\": \"CategoryInstance\",\n \"relation\": \"hasSequenceMember\",\n \"description\": \"Updated description\",\n \"status\": \"Live\"\n }\n ],\n \"category\": \"subject\",\n \"status\": \"Live\"\n }\n }\n}" }, { - "name": "BAD REQUEST. The \"update category\" operation failed ! The possible reason for failure is that you may have missed providing input for a mandatory parameter.", + "name": "BAD REQUEST. The \"Fetch term\" operation failed ! The possible reason for failure is that you may have missed providing input for a mandatory parameter.", "originalRequest": { - "method": "PATCH", + "method": "GET", "header": [ { "description": "Added as a part of security scheme: apikey", @@ -4630,7 +18654,7 @@ "value": "" }, { - "description": "(Required) The Content Type entity is the media type of the resource.\n Possible media types can be:- \n - application/json", + "description": "The Content Type entity is the media type of the resource.\n Possible media types can be:- \n - application/json", "key": "Content-Type", "value": "Ut enim offici" }, @@ -4640,38 +18664,33 @@ "value": "Ut enim offici" } ], - "body": { - "mode": "raw", - "raw": "{\n \"request\": {\n \"category\": {\n \"description\": \"Updated description\"\n }\n }\n}", - "options": { - "raw": { - "language": "json" - } - } - }, "url": { - "raw": "{{baseUrl}}/framework/v1/category/update/:code?framework=Ut enim offici", + "raw": "{{baseUrl}}/framework/v1/term/read/:code?framework=Ut enim offici&category=Ut enim offici", "host": [ "{{baseUrl}}" ], "path": [ "framework", - "v1", - "category", - "update", + "v1", + "term", + "read", ":code" ], "query": [ { "key": "framework", "value": "Ut enim offici" + }, + { + "key": "category", + "value": "Ut enim offici" } ], "variable": [ { "key": "code", "value": "Ut enim offici", - "description": "(Required) The name/code of the category to be updated" + "description": "(Required) The name/code of the term to be fetched" } ] } @@ -4686,12 +18705,12 @@ } ], "cookie": [], - "body": "{\n \"id\": \"api.category.update\",\n \"ver\": \"1.0\",\n \"ts\": \"2020-12-14T19:38:29.662Z\",\n \"params\": {\n \"resmsgid\": \"f146ebe0-3e43-11eb-9ff3-67c41480f6aa\",\n \"msgid\": null,\n \"status\": \"failed\",\n \"err\": \"ERR_INVALID_FRAMEWORK_ID\",\n \"errmsg\": \"Invalid FrameworkId: dummy_framework1 for Categoryinstance \"\n },\n \"responseCode\": \"CLIENT_ERROR\",\n \"result\": {}\n}" + "body": "{\n \"id\": \"api.term.read\",\n \"ver\": \"1.0\",\n \"ts\": \"2020-12-17T07:54:24.246Z\",\n \"params\": {\n \"resmsgid\": \"14494160-403d-11eb-9b0c-abcfbdf41bc3\",\n \"msgid\": null,\n \"status\": \"failed\",\n \"err\": \"ERR_INVALID_CATEGORY_ID\",\n \"errmsg\": \"Please provide valid category.\"\n },\n \"responseCode\": \"CLIENT_ERROR\",\n \"result\": {}\n}" }, { "name": "INTERNAL SERVER ERROR ! Looks like something went wrong! These errors are tracked automatically, but if the problem persists feel free to contact us. In the meantime, try refreshing.", "originalRequest": { - "method": "PATCH", + "method": "GET", "header": [ { "description": "Added as a part of security scheme: apikey", @@ -4699,7 +18718,7 @@ "value": "" }, { - "description": "(Required) The Content Type entity is the media type of the resource.\n Possible media types can be:- \n - application/json", + "description": "The Content Type entity is the media type of the resource.\n Possible media types can be:- \n - application/json", "key": "Content-Type", "value": "Ut enim offici" }, @@ -4709,38 +18728,33 @@ "value": "Ut enim offici" } ], - "body": { - "mode": "raw", - "raw": "{\n \"request\": {\n \"category\": {\n \"description\": \"Updated description\"\n }\n }\n}", - "options": { - "raw": { - "language": "json" - } - } - }, "url": { - "raw": "{{baseUrl}}/framework/v1/category/update/:code?framework=Ut enim offici", + "raw": "{{baseUrl}}/framework/v1/term/read/:code?framework=Ut enim offici&category=Ut enim offici", "host": [ "{{baseUrl}}" ], "path": [ "framework", "v1", - "category", - "update", + "term", + "read", ":code" ], "query": [ { "key": "framework", "value": "Ut enim offici" + }, + { + "key": "category", + "value": "Ut enim offici" } ], "variable": [ { "key": "code", "value": "Ut enim offici", - "description": "(Required) The name/code of the category to be updated" + "description": "(Required) The name/code of the term to be fetched" } ] } @@ -4765,291 +18779,376 @@ "name": "Negative", "item": [ { - "name": "Update an invalid framework to a valid framework", + "name": "Read term for invalid framework and valid framework category", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json();\r", + "\r", + "pm.test(\"Status code is 404\", function () {\r", + " pm.response.to.have.status(404);\r", + "});\r", + "\r", + "pm.test(\"Status code name has string\", function () {\r", + " pm.response.to.have.status(\"Not Found\");\r", + "});\r", + "pm.test(\"id has string - api.taxonomy.term.read\", function () {\r", + " pm.expect(jsonResponse.id).to.be.equal(\"api.taxonomy.term.read\");\r", + "});\r", + "pm.test(\"Version is 3.0 \", function () {\r", + " pm.expect(jsonResponse.ver).to.be.equal(\"3.0\");\r", + "});\r", + "pm.test(\"Verify keys and data type of the response result\", () => {\r", + " pm.expect(jsonResponse.params).to.have.all.keys('resmsgid','msgid','err','status','errmsg');\r", + " pm.expect(jsonResponse.params.resmsgid).to.be.a(\"String\");\r", + " pm.expect(jsonResponse.params.msgid).to.be.a(\"null\");\r", + " pm.expect(jsonResponse.params.err).to.be.a(\"String\");\r", + " pm.expect(jsonResponse.params.status).to.be.a(\"String\");\r", + " pm.expect(jsonResponse.params.errmsg).to.be.a(\"String\");\r", + " });\r", + "\r", + "pm.test(\"Err has string\", function () {\r", + " pm.expect(jsonResponse.params.err).to.be.equal(\"NOT_FOUND\");\r", + "});\r", + "pm.test(\"Status has string\", function () {\r", + " pm.expect(jsonResponse.params.status).to.be.equal(\"failed\");\r", + "});\r", + "pm.test(`errmsg has string: Error! Node(s) doesn't Exists. | [Invalid Node Id.]: dummy_${pm.collectionVariables.get(\"master14_code\")}_${pm.collectionVariables.get(\"t2_term\")}`, function () {\r", + " pm.expect(jsonResponse.params.errmsg).to.eql(`Error! Node(s) doesn't Exists. | [Invalid Node Id.]: dummy_${pm.collectionVariables.get(\"master14_code\")}_${pm.collectionVariables.get(\"t2_term\")}`);\r", + "});\r", + "pm.test(\"responseCode has string\", function () {\r", + " pm.expect(jsonResponse.responseCode).to.be.equal(\"RESOURCE_NOT_FOUND\");\r", + "});" + ], + "type": "text/javascript" + } + } + ], "request": { "method": "GET", - "header": [] + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "{{apiKey}}" + } + ], + "url": { + "raw": "{{host}}/framework/v3/term/read/:{{t2_term}}?framework=dummy&category={{master14_code}}", + "host": [ + "{{host}}" + ], + "path": [ + "framework", + "v3", + "term", + "read", + ":{{t2_term}}" + ], + "query": [ + { + "key": "framework", + "value": "dummy" + }, + { + "key": "category", + "value": "{{master14_code}}" + } + ], + "variable": [ + { + "key": "{{t2_term}}", + "value": "" + } + ] + } }, "response": [] }, { - "name": "Update a valid framework to an invalid framework", + "name": "Read term for valid framework and invalid framework category", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json()\r", + "\r", + "pm.test(\"Status code is 404\", function () {\r", + " pm.response.to.have.status(404);\r", + "});\r", + "\r", + "pm.test(\"Status code name has string\", function () {\r", + " pm.response.to.have.status(\"Not Found\");\r", + "});\r", + "pm.test(\"id has string - api.taxonomy.term.read\", function () {\r", + " pm.expect(jsonResponse.id).to.be.equal(\"api.taxonomy.term.read\");\r", + "});\r", + "pm.test(\"Version is 3.0 \", function () {\r", + " pm.expect(jsonResponse.ver).to.be.equal(\"3.0\");\r", + "});\r", + "pm.test(\"Verify keys and data type of the response result\", () => {\r", + " pm.expect(jsonResponse.params).to.have.all.keys('resmsgid','msgid','err','status','errmsg');\r", + " pm.expect(jsonResponse.params.resmsgid).to.be.a(\"String\");\r", + " pm.expect(jsonResponse.params.msgid).to.be.a(\"null\");\r", + " pm.expect(jsonResponse.params.err).to.be.a(\"String\");\r", + " pm.expect(jsonResponse.params.status).to.be.a(\"String\");\r", + " pm.expect(jsonResponse.params.errmsg).to.be.a(\"String\");\r", + " });\r", + "\r", + "pm.test(\"Err has string\", function () {\r", + " pm.expect(jsonResponse.params.err).to.be.equal(\"NOT_FOUND\");\r", + "});\r", + "pm.test(\"Status has string\", function () {\r", + " pm.expect(jsonResponse.params.status).to.be.equal(\"failed\");\r", + "});\r", + "pm.test(`errmsg has string: Error! Node(s) doesn't Exists. | [Invalid Node Id.]: ${pm.collectionVariables.get(\"fw12_code\")}_dummy_${pm.collectionVariables.get(\"t2_term\")}`, function () {\r", + " pm.expect(jsonResponse.params.errmsg).to.eql(`Error! Node(s) doesn't Exists. | [Invalid Node Id.]: ${pm.collectionVariables.get(\"fw12_code\")}_dummy_${pm.collectionVariables.get(\"t2_term\")}`);\r", + "});\r", + "pm.test(\"responseCode has string\", function () {\r", + " pm.expect(jsonResponse.responseCode).to.be.equal(\"RESOURCE_NOT_FOUND\");\r", + "});\r", + "\r", + "" + ], + "type": "text/javascript" + } + } + ], "request": { "method": "GET", - "header": [] - }, - "response": [] - } - ] - } - ] - }, - { - "name": "Search Framework category", - "item": [ - { - "name": "Positive", - "item": [ - { - "name": "Search framework category for a valid framework", - "request": { - "auth": { - "type": "apikey", - "apikey": [ + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "{{apiKey}}" + } + ], + "url": { + "raw": "{{host}}/framework/v3/term/read/:{{t2_term}}?framework={{fw12_code}}&category=dummy", + "host": [ + "{{host}}" + ], + "path": [ + "framework", + "v3", + "term", + "read", + ":{{t2_term}}" + ], + "query": [ { - "key": "key", - "value": "Authorization", - "type": "string" + "key": "framework", + "value": "{{fw12_code}}" }, { - "key": "value", - "value": "{{apiKey}}", - "type": "string" - }, + "key": "category", + "value": "dummy" + } + ], + "variable": [ { - "key": "in", - "value": "header", - "type": "string" + "key": "{{t2_term}}", + "value": "" } ] - }, - "method": "POST", + } + }, + "response": [] + }, + { + "name": "Read term for invalid framework and invalid framework category", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json()\r", + "\r", + "pm.test(\"Status code is 404\", function () {\r", + " pm.response.to.have.status(404);\r", + "});\r", + "\r", + "pm.test(\"Status code name has string\", function () {\r", + " pm.response.to.have.status(\"Not Found\");\r", + "});\r", + "pm.test(\"id has string - api.taxonomy.term.read\", function () {\r", + " pm.expect(jsonResponse.id).to.be.equal(\"api.taxonomy.term.read\");\r", + "});\r", + "pm.test(\"Version is 3.0 \", function () {\r", + " pm.expect(jsonResponse.ver).to.be.equal(\"3.0\");\r", + "});\r", + "pm.test(\"Verify keys and data type of the response result\", () => {\r", + " pm.expect(jsonResponse.params).to.have.all.keys('resmsgid','msgid','err','status','errmsg');\r", + " pm.expect(jsonResponse.params.resmsgid).to.be.a(\"String\");\r", + " pm.expect(jsonResponse.params.msgid).to.be.a(\"null\");\r", + " pm.expect(jsonResponse.params.err).to.be.a(\"String\");\r", + " pm.expect(jsonResponse.params.status).to.be.a(\"String\");\r", + " pm.expect(jsonResponse.params.errmsg).to.be.a(\"String\");\r", + " });\r", + "\r", + "pm.test(\"Err has string\", function () {\r", + " pm.expect(jsonResponse.params.err).to.be.equal(\"NOT_FOUND\");\r", + "});\r", + "pm.test(\"Status has string\", function () {\r", + " pm.expect(jsonResponse.params.status).to.be.equal(\"failed\");\r", + "});\r", + "pm.test(`errmsg has string: Error! Node(s) doesn't Exists. | [Invalid Node Id.]: dummy_dummy_${pm.collectionVariables.get(\"t2_term\")}`, function () {\r", + " pm.expect(jsonResponse.params.errmsg).to.eql(`Error! Node(s) doesn't Exists. | [Invalid Node Id.]: dummy_dummy_${pm.collectionVariables.get(\"t2_term\")}`);\r", + "});\r", + "pm.test(\"responseCode has string\", function () {\r", + " pm.expect(jsonResponse.responseCode).to.be.equal(\"RESOURCE_NOT_FOUND\");\r", + "});\r", + "\r", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", "header": [ { - "key": "Content-Type", + "key": "Accept", "value": "application/json" }, { - "key": "Accept", - "value": "application/json" + "key": "Authorization", + "value": "{{apiKey}}" } ], - "body": { - "mode": "raw", - "raw": "{\n \"request\": {\n \"search\": {}\n }\n}", - "options": { - "raw": { - "language": "json" - } - } - }, "url": { - "raw": "{{baseUrl}}/framework/v1/category/search?framework=Ut enim offici", + "raw": "{{host}}/framework/v3/term/read/:{{t2_term}}?framework=dummy&category=dummy", "host": [ - "{{baseUrl}}" + "{{host}}" ], "path": [ "framework", - "v1", - "category", - "search" + "v3", + "term", + "read", + ":{{t2_term}}" ], "query": [ { "key": "framework", - "value": "Ut enim offici", - "description": "(Required) Represents the framework in which category can be searched" - } - ] - }, - "description": "This API is associated with searching a category\n - The endpoint for **Search Categories** is `/framework/v1/category/search`\n - It points to knowledge-mw-service - `/v1/framework/category/search`\n - The fields marked with an asterisk (*) are mandatory. They cannot be null or empty." - }, - "response": [ - { - "name": "OK ! Successful operation.\"search category\" operation was successfully executed.", - "originalRequest": { - "method": "POST", - "header": [ - { - "description": "Added as a part of security scheme: apikey", - "key": "Authorization", - "value": "" - }, - { - "description": "(Required) The Content Type entity is the media type of the resource\n Possible media types can be:- \n - application/json", - "key": "Content-Type", - "value": "Ut enim offici" - }, - { - "description": "(Required) To make use of the API, you require authorization. Raise a request to the administrator for the use of the API. You will receive the authorization key. Specify the key received, here.", - "key": "Authorization", - "value": "Ut enim offici" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"request\": {\n \"search\": {}\n }\n}", - "options": { - "raw": { - "language": "json" - } - } + "value": "dummy" }, - "url": { - "raw": "{{baseUrl}}/framework/v1/category/search?framework=Ut enim offici", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "framework", - "v1", - "category", - "search" - ], - "query": [ - { - "key": "framework", - "value": "Ut enim offici" - } - ] - } - }, - "status": "OK", - "code": 200, - "_postman_previewlanguage": "json", - "header": [ { - "key": "Content-Type", - "value": "application/json" + "key": "category", + "value": "dummy" } ], - "cookie": [], - "body": "{\n \"id\": \"api.category.search\",\n \"ver\": \"1.0\",\n \"ts\": \"2020-12-14T19:40:23.864Z\",\n \"params\": {\n \"resmsgid\": \"3558c380-3e44-11eb-9ff3-67c41480f6aa\",\n \"msgid\": \"3555b640-3e44-11eb-9ff3-67c41480f6aa\",\n \"status\": \"successful\",\n \"err\": null,\n \"errmsg\": null\n },\n \"responseCode\": \"OK\",\n \"result\": {\n \"count\": 2,\n \"categories\": [\n {\n \"identifier\": \"dummy_framework_subject\",\n \"lastStatusChangedOn\": \"2020-12-14T19:30:32.392+0000\",\n \"code\": \"subject\",\n \"frameworks\": [\n {\n \"identifier\": \"dummy_framework\",\n \"name\": \"Framework Name\",\n \"objectType\": \"Framework\",\n \"relation\": \"hasSequenceMember\",\n \"description\": \"Dumy framework updated\",\n \"status\": \"Live\"\n }\n ],\n \"consumerId\": \"7411b6bd-89f3-40ec-98d1-229dc64ce77d\",\n \"channel\": \"in.ekstep\",\n \"description\": \"Updated description\",\n \"domains\": [],\n \"createdOn\": \"2020-12-14T19:30:32.392+0000\",\n \"versionKey\": \"1607974669043\",\n \"terms\": [],\n \"appId\": \"dev.sunbird.portal\",\n \"name\": \"Subject\",\n \"lastUpdatedOn\": \"2020-12-14T19:37:49.043+0000\",\n \"status\": \"Live\"\n },\n {\n \"identifier\": \"dummy_framework_medium\",\n \"lastStatusChangedOn\": \"2020-12-14T19:32:01.700+0000\",\n \"code\": \"medium\",\n \"frameworks\": [\n {\n \"identifier\": \"dummy_framework\",\n \"name\": \"Framework Name\",\n \"objectType\": \"Framework\",\n \"relation\": \"hasSequenceMember\",\n \"description\": \"Dumy framework updated\",\n \"status\": \"Live\"\n }\n ],\n \"consumerId\": \"7411b6bd-89f3-40ec-98d1-229dc64ce77d\",\n \"channel\": \"in.ekstep\",\n \"description\": \"Medium\",\n \"domains\": [],\n \"createdOn\": \"2020-12-14T19:32:01.700+0000\",\n \"versionKey\": \"1607974321700\",\n \"terms\": [],\n \"appId\": \"@ignore@\",\n \"name\": \"Medium\",\n \"lastUpdatedOn\": \"2020-12-14T19:32:01.700+0000\",\n \"status\": \"Live\"\n }\n ]\n }\n}" - }, - { - "name": "BAD REQUEST. The \"search category\" operation failed ! The possible reason for failure is that you may have missed providing input for a mandatory parameter.", - "originalRequest": { - "method": "POST", - "header": [ - { - "description": "Added as a part of security scheme: apikey", - "key": "Authorization", - "value": "" - }, - { - "description": "(Required) The Content Type entity is the media type of the resource\n Possible media types can be:- \n - application/json", - "key": "Content-Type", - "value": "Ut enim offici" - }, - { - "description": "(Required) To make use of the API, you require authorization. Raise a request to the administrator for the use of the API. You will receive the authorization key. Specify the key received, here.", - "key": "Authorization", - "value": "Ut enim offici" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"request\": {\n \"search\": {}\n }\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{baseUrl}}/framework/v1/category/search?framework=Ut enim offici", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "framework", - "v1", - "category", - "search" - ], - "query": [ - { - "key": "framework", - "value": "Ut enim offici" - } - ] - } - }, - "status": "Bad Request", - "code": 400, - "_postman_previewlanguage": "json", - "header": [ + "variable": [ { - "key": "Content-Type", - "value": "application/json" + "key": "{{t2_term}}", + "value": "" } - ], - "cookie": [], - "body": "{\n \"id\": \"api.category.search\",\n \"ver\": \"1.0\",\n \"ts\": \"2020-12-14T19:41:28.846Z\",\n \"params\": {\n \"resmsgid\": \"5c143ae0-3e44-11eb-9ff3-67c41480f6aa\",\n \"msgid\": null,\n \"status\": \"failed\",\n \"err\": \"ERR_INVALID_FRAMEWORK_ID\",\n \"errmsg\": \"Invalid FrameworkId: dummy_framework1 for Categoryinstance \"\n },\n \"responseCode\": \"CLIENT_ERROR\",\n \"result\": {}\n}" - }, + ] + } + }, + "response": [] + }, + { + "name": "Read invalid term for valid framework and valid framework category", + "event": [ { - "name": "INTERNAL SERVER ERROR ! Looks like something went wrong! These errors are tracked automatically, but if the problem persists feel free to contact us. In the meantime, try refreshing.", - "originalRequest": { - "method": "POST", - "header": [ - { - "description": "Added as a part of security scheme: apikey", - "key": "Authorization", - "value": "" - }, - { - "description": "(Required) The Content Type entity is the media type of the resource\n Possible media types can be:- \n - application/json", - "key": "Content-Type", - "value": "Ut enim offici" - }, - { - "description": "(Required) To make use of the API, you require authorization. Raise a request to the administrator for the use of the API. You will receive the authorization key. Specify the key received, here.", - "key": "Authorization", - "value": "Ut enim offici" - } + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json()\r", + "\r", + "pm.test(\"Status code is 404\", function () {\r", + " pm.response.to.have.status(404);\r", + "});\r", + "\r", + "pm.test(\"Status code name has string\", function () {\r", + " pm.response.to.have.status(\"Not Found\");\r", + "});\r", + "pm.test(\"id has string - api.taxonomy.term.read\", function () {\r", + " pm.expect(jsonResponse.id).to.be.equal(\"api.taxonomy.term.read\");\r", + "});\r", + "pm.test(\"Version is 3.0 \", function () {\r", + " pm.expect(jsonResponse.ver).to.be.equal(\"3.0\");\r", + "});\r", + "pm.test(\"Verify keys and data type of the response result\", () => {\r", + " pm.expect(jsonResponse.params).to.have.all.keys('resmsgid','msgid','err','status','errmsg');\r", + " pm.expect(jsonResponse.params.resmsgid).to.be.a(\"String\");\r", + " pm.expect(jsonResponse.params.msgid).to.be.a(\"null\");\r", + " pm.expect(jsonResponse.params.err).to.be.a(\"String\");\r", + " pm.expect(jsonResponse.params.status).to.be.a(\"String\");\r", + " pm.expect(jsonResponse.params.errmsg).to.be.a(\"String\");\r", + " });\r", + "\r", + "pm.test(\"Err has string\", function () {\r", + " pm.expect(jsonResponse.params.err).to.be.equal(\"NOT_FOUND\");\r", + "});\r", + "pm.test(\"Status has string\", function () {\r", + " pm.expect(jsonResponse.params.status).to.be.equal(\"failed\");\r", + "});\r", + "pm.test(`errmsg has string: Error! Node(s) doesn't Exists. | [Invalid Node Id.]: ${pm.collectionVariables.get(\"fw12_code\")}_${pm.collectionVariables.get(\"master14_code\")}_dummy`, function () {\r", + " pm.expect(jsonResponse.params.errmsg).to.eql(`Error! Node(s) doesn't Exists. | [Invalid Node Id.]: ${pm.collectionVariables.get(\"fw12_code\")}_${pm.collectionVariables.get(\"master14_code\")}_dummy`);\r", + "});\r", + "pm.test(\"responseCode has string\", function () {\r", + " pm.expect(jsonResponse.responseCode).to.be.equal(\"RESOURCE_NOT_FOUND\");\r", + "});\r", + "\r", + "" ], - "body": { - "mode": "raw", - "raw": "{\n \"request\": {\n \"search\": {}\n }\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{baseUrl}}/framework/v1/category/search?framework=Ut enim offici", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "framework", - "v1", - "category", - "search" - ], - "query": [ - { - "key": "framework", - "value": "Ut enim offici" - } - ] - } + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" }, - "status": "Internal Server Error", - "code": 500, - "_postman_previewlanguage": "text", - "header": [ + { + "key": "Authorization", + "value": "{{apiKey}}" + } + ], + "url": { + "raw": "{{host}}/framework/v3/term/read/:dummy?framework={{fw12_code}}&category={{master14_code}}", + "host": [ + "{{host}}" + ], + "path": [ + "framework", + "v3", + "term", + "read", + ":dummy" + ], + "query": [ { - "key": "Content-Type", - "value": "text/plain" + "key": "framework", + "value": "{{fw12_code}}" + }, + { + "key": "category", + "value": "{{master14_code}}" } ], - "cookie": [], - "body": "" + "variable": [ + { + "key": "dummy", + "value": "" + } + ] } - ] - } - ] - }, - { - "name": "Negative", - "item": [ - { - "name": "Search framework category for an invalid framework", - "request": { - "method": "GET", - "header": [] }, "response": [] } @@ -5058,61 +19157,156 @@ ] }, { - "name": "Deleted Framework Category", + "name": "Update Term", "item": [ { - "name": "Positive", + "name": "Pre requisite", "item": [ { - "name": "Delete a valid framework category", + "name": "Create a master category", + "event": [ + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + }, + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json()\r", + "\r", + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "\r", + "pm.collectionVariables.set(\"master15_id\",jsonResponse.result.identifier);\r", + "console.log(pm.collectionVariables.get(\"master15_id\"));\r", + "pm.collectionVariables.set(\"master15_node\",jsonResponse.result.node_id);\r", + "console.log(pm.collectionVariables.get(\"master15_node\"));\r", + "\r", + "pm.test(`identifier should be equal to ${pm.collectionVariables.get(\"master15_id\")}`, () => {\r", + " pm.expect(jsonResponse.result.identifier).to.eql(`${pm.collectionVariables.get(\"master15_code\")}`);\r", + "});\r", + "\r", + "pm.test(`node_id should be equal to ${pm.collectionVariables.get(\"master15_node\")}`, () => {\r", + " pm.expect(jsonResponse.result.node_id).to.eql(`${pm.collectionVariables.get(\"master15_code\")}`);\r", + "});" + ], + "type": "text/javascript" + } + } + ], "request": { - "method": "GET", - "header": [] + "method": "POST", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "X-Channel-Id", + "value": "sunbird" + }, + { + "key": "Authorization", + "value": "{{auth_token}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"category\": {\n \"name\": \"master\",\n \"code\": \"{{master15_code}}\",\n \"targetIdFieldName\": \"targetmasterIds\",\n \"searchLabelFieldName\": \"se_master\",\n \"searchIdFieldName\": \"se_master\",\n \"orgIdFieldName\": \"masterIds\"\n }\n }\n}" + }, + "url": { + "raw": "{{host}}/framework/v3/category/master/create", + "host": [ + "{{host}}" + ], + "path": [ + "framework", + "v3", + "category", + "master", + "create" + ] + } }, "response": [] - } - ] - }, - { - "name": "Negative", - "item": [ + }, { - "name": "Delete an invalid framework category", - "request": { - "method": "GET", - "header": [] + "name": "Create a framework", + "event": [ + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + }, + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json()\r", + "\r", + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "\r", + "pm.test(\"Verify keys and data type of the response result\", () => {\r", + " pm.expect(jsonResponse.params).to.have.all.keys('resmsgid','msgid','status', 'err','errmsg');\r", + " pm.expect(jsonResponse.params.status).to.be.a(\"String\");\r", + " pm.expect(jsonResponse.params.err).to.be.a(\"null\");\r", + " pm.expect(jsonResponse.params.errmsg).to.be.a(\"null\");\r", + "});\r", + "\r", + "pm.test(\"Status has string \", function () {\r", + " pm.expect(jsonResponse.params.status).to.be.equal(\"successful\");\r", + "});\r", + "\r", + "pm.test(\"Verify keys and data type of the response result\", () => {\r", + " pm.expect(jsonResponse.result).to.have.all.keys('node_id', 'versionKey');\r", + " pm.expect(jsonResponse.result.node_id).to.be.a(\"String\");\r", + " pm.expect(jsonResponse.result.versionKey).to.be.a(\"string\");\r", + "});\r", + "\r", + "pm.collectionVariables.set(\"fw13_node\",jsonResponse.result.node_id);\r", + "console.log(pm.collectionVariables.get(\"fw13_node\"));\r", + "\r", + "pm.test(`node id should be equal to ${pm.collectionVariables.get(\"fw13_node\")}`, () => {\r", + " pm.expect(jsonResponse.result.node_id).to.eql(pm.collectionVariables.get(\"fw13_code\"));\r", + "});\r", + "" + ], + "type": "text/javascript" + } + } + ], + "protocolProfileBehavior": { + "disabledSystemHeaders": {} }, - "response": [] - } - ] - } - ] - } - ] - }, - { - "name": "term", - "item": [ - { - "name": "Create Term", - "item": [ - { - "name": "Positive", - "item": [ - { - "name": "Create a valid term for valid framework and framework category", "request": { "auth": { "type": "apikey", "apikey": [ { - "key": "key", - "value": "Authorization", + "key": "value", + "value": "{{auth_token}}", "type": "string" }, { - "key": "value", - "value": "{{apiKey}}", + "key": "key", + "value": "Authorization", "type": "string" }, { @@ -5125,17 +19319,29 @@ "method": "POST", "header": [ { - "key": "Content-Type", - "value": "application/json" + "description": "(Required) It is the Unique Id to identify the root organisation to which the user belongs", + "key": "X-Channel-Id", + "value": "{{X-Channel-Id}}" + }, + { + "key": "", + "value": "", + "disabled": true }, { "key": "Accept", "value": "application/json" + }, + { + "key": "Authorization", + "value": "", + "type": "text", + "disabled": true } ], "body": { "mode": "raw", - "raw": "{\n \"request\": {\n \"term\": {\n \"code\": \"english\",\n \"name\": \"English\"\n }\n }\n}", + "raw": "{\n \"request\": {\n \"framework\": {\n \"name\": \"{{fw13_name}}\",\n \"code\": \"{{fw13_code}}\"\n \n }\n }\n}", "options": { "raw": { "language": "json" @@ -5143,34 +19349,21 @@ } }, "url": { - "raw": "{{baseUrl}}/framework/v1/term/create?framework=Ut enim offici&category=Ut enim offici", + "raw": "{{host}}/framework/v3/create", "host": [ - "{{baseUrl}}" + "{{host}}" ], "path": [ "framework", - "v1", - "term", + "v3", "create" - ], - "query": [ - { - "key": "framework", - "value": "Ut enim offici", - "description": "(Required) Represents the framework in which the term is to be created" - }, - { - "key": "category", - "value": "Ut enim offici", - "description": "(Required) Represents the category in which the term is to be created" - } ] }, - "description": "This API is associated with creating a term under a framework category\n - The endpoint for **Create Term** is `/framework/v1/term/create`\n - It points to knowledge-mw-service - `/v1/framework/term/create`\n - The fields marked with an asterisk (*) are mandatory. They cannot be null or empty.\"" + "description": "This API is associated with creating a new framework on the Sunbird Platform.\n - The endpoint for **Create a Framework** is `/framework/v1/create`\n - It points to knowledge-mw-service - `/v1/framework/create`\n - The fields marked with an asterisk (*) are mandatory. They cannot be null or empty." }, "response": [ { - "name": "OK ! Successful operation.\"create term\" operation was successfully executed.", + "name": "OK ! Successful operation.\"create framework\" operation was successfully executed.", "originalRequest": { "method": "POST", "header": [ @@ -5180,7 +19373,7 @@ "value": "" }, { - "description": "(Required) The Content Type entity is the media type of the resource.\n Possible media types can be:- \n - application/json", + "description": "(Required) The Content Type entity is the media type of the resource\n Possible media types can be:- \n - application/json", "key": "Content-Type", "value": "Ut enim offici" }, @@ -5188,11 +19381,16 @@ "description": "(Required) To make use of the API, you require authorization. Raise a request to the administrator for the use of the API. You will receive the authorization key. Specify the key received, here.", "key": "Authorization", "value": "Ut enim offici" + }, + { + "description": "(Required) It is the Unique Id to identify the root organisation to which the user belongs", + "key": "X-Channel-Id", + "value": "Ut enim offici" } ], "body": { "mode": "raw", - "raw": "{\n \"request\": {\n \"term\": {\n \"code\": \"english\",\n \"name\": \"English\"\n }\n }\n}", + "raw": "{\n \"request\": {\n \"framework\": {\n \"name\": \"Framework Name\",\n \"code\": \"dummy_framework\",\n \"channels\": [\n {\n \"identifier\": \"in.ekstep\"\n }\n ]\n }\n }\n}", "options": { "raw": { "language": "json" @@ -5200,25 +19398,14 @@ } }, "url": { - "raw": "{{baseUrl}}/framework/v1/term/create?framework=Ut enim offici&category=Ut enim offici", + "raw": "{{baseUrl}}/framework/v1/create", "host": [ "{{baseUrl}}" ], "path": [ "framework", "v1", - "term", "create" - ], - "query": [ - { - "key": "framework", - "value": "Ut enim offici" - }, - { - "key": "category", - "value": "Ut enim offici" - } ] } }, @@ -5232,10 +19419,10 @@ } ], "cookie": [], - "body": "{\n \"id\": \"api.term.create\",\n \"ver\": \"1.0\",\n \"ts\": \"2020-12-14T19:44:02.348Z\",\n \"params\": {\n \"resmsgid\": \"b792c6c0-3e44-11eb-9ff3-67c41480f6aa\",\n \"msgid\": \"b783f9b0-3e44-11eb-9ff3-67c41480f6aa\",\n \"status\": \"successful\",\n \"err\": null,\n \"errmsg\": null\n },\n \"responseCode\": \"OK\",\n \"result\": {\n \"node_id\": [\n \"dummy_framework_subject_english\"\n ]\n }\n}" + "body": "{\n \"id\": \"api.framework.create\",\n \"ver\": \"1.0\",\n \"ts\": \"2020-12-14T09:49:06.794Z\",\n \"params\": {\n \"resmsgid\": \"9b5d7ca0-3df1-11eb-9ff3-67c41480f6aa\",\n \"msgid\": \"9b4a90e0-3df1-11eb-9ff3-67c41480f6aa\",\n \"status\": \"successful\",\n \"err\": null,\n \"errmsg\": null\n },\n \"responseCode\": \"OK\",\n \"result\": {\n \"node_id\": \"dummy_framework\",\n \"versionKey\": \"1607939346678\"\n }\n}" }, { - "name": "BAD REQUEST. The \"create term\" operation failed ! The possible reason for failure is that you may have missed providing input for a mandatory parameter.", + "name": "BAD REQUEST. The \"create framework\" operation failed ! The possible reason for failure is that you may have missed providing input for a mandatory parameter.", "originalRequest": { "method": "POST", "header": [ @@ -5245,7 +19432,7 @@ "value": "" }, { - "description": "(Required) The Content Type entity is the media type of the resource.\n Possible media types can be:- \n - application/json", + "description": "(Required) The Content Type entity is the media type of the resource\n Possible media types can be:- \n - application/json", "key": "Content-Type", "value": "Ut enim offici" }, @@ -5253,11 +19440,16 @@ "description": "(Required) To make use of the API, you require authorization. Raise a request to the administrator for the use of the API. You will receive the authorization key. Specify the key received, here.", "key": "Authorization", "value": "Ut enim offici" + }, + { + "description": "(Required) It is the Unique Id to identify the root organisation to which the user belongs", + "key": "X-Channel-Id", + "value": "Ut enim offici" } ], "body": { "mode": "raw", - "raw": "{\n \"request\": {\n \"term\": {\n \"code\": \"english\",\n \"name\": \"English\"\n }\n }\n}", + "raw": "{\n \"request\": {\n \"framework\": {\n \"name\": \"Framework Name\",\n \"code\": \"dummy_framework\",\n \"channels\": [\n {\n \"identifier\": \"in.ekstep\"\n }\n ]\n }\n }\n}", "options": { "raw": { "language": "json" @@ -5265,25 +19457,14 @@ } }, "url": { - "raw": "{{baseUrl}}/framework/v1/term/create?framework=Ut enim offici&category=Ut enim offici", + "raw": "{{baseUrl}}/framework/v1/create", "host": [ "{{baseUrl}}" - ], - "path": [ - "framework", - "v1", - "term", - "create" - ], - "query": [ - { - "key": "framework", - "value": "Ut enim offici" - }, - { - "key": "category", - "value": "Ut enim offici" - } + ], + "path": [ + "framework", + "v1", + "create" ] } }, @@ -5297,7 +19478,7 @@ } ], "cookie": [], - "body": "{\n \"id\": \"api.term.create\",\n \"ver\": \"1.0\",\n \"ts\": \"2020-12-14T19:44:49.263Z\",\n \"params\": {\n \"resmsgid\": \"d3896ff0-3e44-11eb-9ff3-67c41480f6aa\",\n \"msgid\": null,\n \"status\": \"failed\",\n \"err\": \"ERR_INVALID_CATEGORY_ID\",\n \"errmsg\": \"Please provide valid category.\"\n },\n \"responseCode\": \"CLIENT_ERROR\",\n \"result\": {}\n}" + "body": "{\n \"id\": \"api.framework.create\",\n \"ver\": \"1.0\",\n \"ts\": \"2020-12-14T09:50:45.249Z\",\n \"params\": {\n \"resmsgid\": \"d60c8710-3df1-11eb-9ff3-67c41480f6aa\",\n \"msgid\": null,\n \"status\": \"failed\",\n \"err\": \"CONSTRAINT_VALIDATION_FAILED\",\n \"errmsg\": \"Object already exists with identifier: dummy_framework\"\n },\n \"responseCode\": \"CLIENT_ERROR\",\n \"result\": {}\n}" }, { "name": "INTERNAL SERVER ERROR ! Looks like something went wrong! These errors are tracked automatically, but if the problem persists feel free to contact us. In the meantime, try refreshing.", @@ -5310,7 +19491,7 @@ "value": "" }, { - "description": "(Required) The Content Type entity is the media type of the resource.\n Possible media types can be:- \n - application/json", + "description": "(Required) The Content Type entity is the media type of the resource\n Possible media types can be:- \n - application/json", "key": "Content-Type", "value": "Ut enim offici" }, @@ -5318,11 +19499,16 @@ "description": "(Required) To make use of the API, you require authorization. Raise a request to the administrator for the use of the API. You will receive the authorization key. Specify the key received, here.", "key": "Authorization", "value": "Ut enim offici" + }, + { + "description": "(Required) It is the Unique Id to identify the root organisation to which the user belongs", + "key": "X-Channel-Id", + "value": "Ut enim offici" } ], "body": { "mode": "raw", - "raw": "{\n \"request\": {\n \"term\": {\n \"code\": \"english\",\n \"name\": \"English\"\n }\n }\n}", + "raw": "{\n \"request\": {\n \"framework\": {\n \"name\": \"Framework Name\",\n \"code\": \"dummy_framework\",\n \"channels\": [\n {\n \"identifier\": \"in.ekstep\"\n }\n ]\n }\n }\n}", "options": { "raw": { "language": "json" @@ -5330,25 +19516,14 @@ } }, "url": { - "raw": "{{baseUrl}}/framework/v1/term/create?framework=Ut enim offici&category=Ut enim offici", + "raw": "{{baseUrl}}/framework/v1/create", "host": [ "{{baseUrl}}" ], "path": [ "framework", "v1", - "term", "create" - ], - "query": [ - { - "key": "framework", - "value": "Ut enim offici" - }, - { - "key": "category", - "value": "Ut enim offici" - } ] } }, @@ -5365,60 +19540,71 @@ "body": "" } ] - } - ] - }, - { - "name": "Negative", - "item": [ - { - "name": "Create a valid term for invalid framework and valid framework category", - "request": { - "method": "GET", - "header": [] - }, - "response": [] - }, - { - "name": "Create a valid term for valid framework and invalid framework category", - "request": { - "method": "GET", - "header": [] - }, - "response": [] }, { - "name": "Create a valid term for invalid framework and invalid framework category", - "request": { - "method": "GET", - "header": [] - }, - "response": [] - } - ] - } - ] - }, - { - "name": "Read Term", - "item": [ - { - "name": "Positive", - "item": [ - { - "name": "Read term for valid framework and valid framework category", + "name": "Create Framework Category", + "event": [ + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + }, + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json()\r", + "\r", + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "\r", + "pm.test(\"Verify keys and data type of the response result\", () => {\r", + " pm.expect(jsonResponse.params).to.have.all.keys('resmsgid','msgid','status', 'err','errmsg');\r", + "pm.expect(jsonResponse.params.resmsgid).to.be.a(\"String\");\r", + "pm.expect(jsonResponse.params.msgid).to.be.a(\"null\");\r", + " pm.expect(jsonResponse.params.status).to.be.a(\"String\");\r", + " pm.expect(jsonResponse.params.err).to.be.a(\"null\");\r", + " pm.expect(jsonResponse.params.errmsg).to.be.a(\"null\");\r", + "});\r", + "\r", + "pm.test(\"Status has string \", function () {\r", + " pm.expect(jsonResponse.params.status).to.be.equal(\"successful\");\r", + "});\r", + "\r", + "pm.test(\"Verify keys and data type of the response result\", () => {\r", + " pm.expect(jsonResponse.result).to.have.all.keys('identifier', 'versionKey');\r", + " pm.expect(jsonResponse.result.identifier).to.be.a(\"String\");\r", + " pm.expect(jsonResponse.result.versionKey).to.be.a(\"string\");\r", + "});\r", + "\r", + "pm.collectionVariables.set(\"fwcat_cat8\",jsonResponse.result.identifier);\r", + "console.log(pm.collectionVariables.get(\"fwcat_cat8\"));\r", + "\r", + "pm.test(`identifier should be equal to ${pm.collectionVariables.get(\"fwcat_cat8\")}`, () => {\r", + " pm.expect(jsonResponse.result.identifier).to.eql(`${pm.collectionVariables.get(\"fw13_code\")}_${pm.collectionVariables.get(\"master15_code\")}`);\r", + "});" + ], + "type": "text/javascript" + } + } + ], "request": { "auth": { "type": "apikey", "apikey": [ { - "key": "key", - "value": "Authorization", + "key": "value", + "value": "", "type": "string" }, { - "key": "value", - "value": "{{apiKey}}", + "key": "key", + "value": "Authorization", "type": "string" }, { @@ -5428,52 +19614,57 @@ } ] }, - "method": "GET", + "method": "POST", "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, { "key": "Accept", "value": "application/json" + }, + { + "key": "X-Channel-Id", + "value": "{{X-Channel-Id}}", + "type": "text" } ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"category\": {\n \"name\": \"Board\",\n \"code\": \"{{master15_code}}\",\n \"description\":\"Board category\"\n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, "url": { - "raw": "{{baseUrl}}/framework/v1/term/read/:code?framework=Ut enim offici&category=Ut enim offici", + "raw": "{{host}}/framework/v3/category/create?framework={{fw13_code}}", "host": [ - "{{baseUrl}}" + "{{host}}" ], "path": [ "framework", - "v1", - "term", - "read", - ":code" + "v3", + "category", + "create" ], "query": [ { "key": "framework", - "value": "Ut enim offici", - "description": "(Required) Represents the framework id in which the term can be fetched" - }, - { - "key": "category", - "value": "Ut enim offici", - "description": "(Required) Represents the category in which the term can be fetched" - } - ], - "variable": [ - { - "key": "code", - "value": "Ut enim offici", - "description": "(Required) The name/code of the term to be fetched" + "value": "{{fw13_code}}", + "description": "(Required) The code of the framework under which category has to be created" } ] }, - "description": "This API is associated with fetching the available terms under a specific category and a framework on Sunbird Platform.\n - The endpoint for **Fetch Term** is `/framework/v1/term/read/{code}`\n - It points to knowledge-mw-service - `/v1/framework/term/read/{code}`\n - The fields marked with an asterisk (*) are mandatory. They cannot be null or empty." + "description": "This API is associated with creating a category under a framework\n - The endpoint for **Create Category** is `/framework/v1/category/create`\n - It points to knowledge-mw-service - `/v1/framework/category/create`\n - The fields marked with an asterisk (*) are mandatory. They cannot be null or empty." }, "response": [ { - "name": "OK ! Successful operation.\"Fetch term\" operation was successfully executed.", + "name": "OK ! Successful operation.\"create category\" operation was successfully executed.", "originalRequest": { - "method": "GET", + "method": "POST", "header": [ { "description": "Added as a part of security scheme: apikey", @@ -5481,7 +19672,7 @@ "value": "" }, { - "description": "The Content Type entity is the media type of the resource.\n Possible media types can be:- \n - application/json", + "description": "(Required) The Content Type entity is the media type of the resource\n Possible media types can be:- \n - application/json", "key": "Content-Type", "value": "Ut enim offici" }, @@ -5491,33 +19682,30 @@ "value": "Ut enim offici" } ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"category\": {\n \"name\": \"Subject\",\n \"code\": \"subject\"\n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, "url": { - "raw": "{{baseUrl}}/framework/v1/term/read/:code?framework=Ut enim offici&category=Ut enim offici", + "raw": "{{baseUrl}}/framework/v1/category/create?framework=Ut enim offici", "host": [ "{{baseUrl}}" ], "path": [ "framework", "v1", - "term", - "read", - ":code" + "category", + "create" ], "query": [ { "key": "framework", "value": "Ut enim offici" - }, - { - "key": "category", - "value": "Ut enim offici" - } - ], - "variable": [ - { - "key": "code", - "value": "Ut enim offici", - "description": "(Required) The name/code of the term to be fetched" } ] } @@ -5532,12 +19720,12 @@ } ], "cookie": [], - "body": "{\n \"id\": \"api.term.read\",\n \"ver\": \"1.0\",\n \"ts\": \"2020-12-17T07:24:51.258Z\",\n \"params\": {\n \"resmsgid\": \"f380c1a0-4038-11eb-9b0c-abcfbdf41bc3\",\n \"msgid\": \"f358c740-4038-11eb-9b0c-abcfbdf41bc3\",\n \"status\": \"successful\",\n \"err\": null,\n \"errmsg\": null\n },\n \"responseCode\": \"OK\",\n \"result\": {\n \"term\": {\n \"associations\": [],\n \"identifier\": \"dummy_framework_subject_english\",\n \"lastStatusChangedOn\": \"2020-12-14T19:44:02.260+0000\",\n \"code\": \"english\",\n \"consumerId\": \"7411b6bd-89f3-40ec-98d1-229dc64ce77d\",\n \"channel\": \"in.ekstep\",\n \"description\": \"English\",\n \"createdOn\": \"2020-12-14T19:44:02.260+0000\",\n \"versionKey\": \"1607975299669\",\n \"children\": [],\n \"appId\": \"dev.sunbird.portal\",\n \"name\": \"English\",\n \"lastUpdatedOn\": \"2020-12-14T19:48:19.669+0000\",\n \"categories\": [\n {\n \"identifier\": \"dummy_framework_subject\",\n \"name\": \"Subject\",\n \"objectType\": \"CategoryInstance\",\n \"relation\": \"hasSequenceMember\",\n \"description\": \"Updated description\",\n \"status\": \"Live\"\n }\n ],\n \"category\": \"subject\",\n \"status\": \"Live\"\n }\n }\n}" + "body": "{\n \"id\": \"api.category.create\",\n \"ver\": \"1.0\",\n \"ts\": \"2020-12-14T19:32:01.754Z\",\n \"params\": {\n \"resmsgid\": \"0a10dba0-3e43-11eb-9ff3-67c41480f6aa\",\n \"msgid\": \"0a05df20-3e43-11eb-9ff3-67c41480f6aa\",\n \"status\": \"successful\",\n \"err\": null,\n \"errmsg\": null\n },\n \"responseCode\": \"OK\",\n \"result\": {\n \"node_id\": \"dummy_framework_medium\",\n \"versionKey\": \"1607974321700\"\n }\n}" }, { - "name": "BAD REQUEST. The \"Fetch term\" operation failed ! The possible reason for failure is that you may have missed providing input for a mandatory parameter.", + "name": "BAD REQUEST. The \"create category\" operation failed ! The possible reason for failure is that you may have missed providing input for a mandatory parameter.", "originalRequest": { - "method": "GET", + "method": "POST", "header": [ { "description": "Added as a part of security scheme: apikey", @@ -5545,7 +19733,7 @@ "value": "" }, { - "description": "The Content Type entity is the media type of the resource.\n Possible media types can be:- \n - application/json", + "description": "(Required) The Content Type entity is the media type of the resource\n Possible media types can be:- \n - application/json", "key": "Content-Type", "value": "Ut enim offici" }, @@ -5555,33 +19743,30 @@ "value": "Ut enim offici" } ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"category\": {\n \"name\": \"Subject\",\n \"code\": \"subject\"\n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, "url": { - "raw": "{{baseUrl}}/framework/v1/term/read/:code?framework=Ut enim offici&category=Ut enim offici", + "raw": "{{baseUrl}}/framework/v1/category/create?framework=Ut enim offici", "host": [ "{{baseUrl}}" ], "path": [ "framework", "v1", - "term", - "read", - ":code" + "category", + "create" ], "query": [ { "key": "framework", "value": "Ut enim offici" - }, - { - "key": "category", - "value": "Ut enim offici" - } - ], - "variable": [ - { - "key": "code", - "value": "Ut enim offici", - "description": "(Required) The name/code of the term to be fetched" } ] } @@ -5596,12 +19781,12 @@ } ], "cookie": [], - "body": "{\n \"id\": \"api.term.read\",\n \"ver\": \"1.0\",\n \"ts\": \"2020-12-17T07:54:24.246Z\",\n \"params\": {\n \"resmsgid\": \"14494160-403d-11eb-9b0c-abcfbdf41bc3\",\n \"msgid\": null,\n \"status\": \"failed\",\n \"err\": \"ERR_INVALID_CATEGORY_ID\",\n \"errmsg\": \"Please provide valid category.\"\n },\n \"responseCode\": \"CLIENT_ERROR\",\n \"result\": {}\n}" + "body": "{\n \"id\": \"api.category.create\",\n \"ver\": \"1.0\",\n \"ts\": \"2020-12-14T19:30:50.114Z\",\n \"params\": {\n \"resmsgid\": \"df5d7620-3e42-11eb-9ff3-67c41480f6aa\",\n \"msgid\": null,\n \"status\": \"failed\",\n \"err\": \"CONSTRAINT_VALIDATION_FAILED\",\n \"errmsg\": \"Object already exists with identifier: dummy_framework_subject\"\n },\n \"responseCode\": \"CLIENT_ERROR\",\n \"result\": {}\n}" }, { "name": "INTERNAL SERVER ERROR ! Looks like something went wrong! These errors are tracked automatically, but if the problem persists feel free to contact us. In the meantime, try refreshing.", "originalRequest": { - "method": "GET", + "method": "POST", "header": [ { "description": "Added as a part of security scheme: apikey", @@ -5609,7 +19794,7 @@ "value": "" }, { - "description": "The Content Type entity is the media type of the resource.\n Possible media types can be:- \n - application/json", + "description": "(Required) The Content Type entity is the media type of the resource\n Possible media types can be:- \n - application/json", "key": "Content-Type", "value": "Ut enim offici" }, @@ -5619,33 +19804,30 @@ "value": "Ut enim offici" } ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"category\": {\n \"name\": \"Subject\",\n \"code\": \"subject\"\n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, "url": { - "raw": "{{baseUrl}}/framework/v1/term/read/:code?framework=Ut enim offici&category=Ut enim offici", + "raw": "{{baseUrl}}/framework/v1/category/create?framework=Ut enim offici", "host": [ "{{baseUrl}}" ], "path": [ "framework", "v1", - "term", - "read", - ":code" - ], - "query": [ - { - "key": "framework", - "value": "Ut enim offici" - }, - { - "key": "category", - "value": "Ut enim offici" - } + "category", + "create" ], - "variable": [ + "query": [ { - "key": "code", - "value": "Ut enim offici", - "description": "(Required) The name/code of the term to be fetched" + "key": "framework", + "value": "Ut enim offici" } ] } @@ -5663,48 +19845,42 @@ "body": "" } ] - } - ] - }, - { - "name": "Negative", - "item": [ - { - "name": "Read term for invalid framework and valid framework category", - "request": { - "method": "GET", - "header": [] - }, - "response": [] - }, - { - "name": "Read term for valid framework and invalid framework category", - "request": { - "method": "GET", - "header": [] - }, - "response": [] }, { - "name": "Read term for invalid framework and invalid framework category", - "request": { - "method": "GET", - "header": [] - }, - "response": [] - } - ] - } - ] - }, - { - "name": "Update Term", - "item": [ - { - "name": "Positive", - "item": [ - { - "name": "Update a valid term for a valid framework and framework category", + "name": "Create a framework term", + "event": [ + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + }, + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json()\r", + "pm.collectionVariables.set(\"term_id\",jsonResponse.result.identifier);\r", + "console.log(pm.collectionVariables.get(\"term_id\"));\r", + "pm.collectionVariables.set(\"term_node\",jsonResponse.result.node_id);\r", + "console.log(pm.collectionVariables.get(\"term_node\"));\r", + "\r", + "pm.test(`identifier should be equal to ${pm.collectionVariables.get(\"term_id\")}`, () => {\r", + " pm.expect(jsonResponse.result.identifier).to.eql(`${pm.collectionVariables.get(\"fw13_code\")}_${pm.collectionVariables.get(\"master15_code\")}_${pm.collectionVariables.get(\"t3_term\")}`);\r", + "});\r", + "\r", + "pm.test(`node should be equal to ${pm.collectionVariables.get(\"term_node\")}`, () => {\r", + " pm.expect(jsonResponse.result.node_id).to.eql(`${pm.collectionVariables.get(\"fw13_code\")}_${pm.collectionVariables.get(\"master15_code\")}_${pm.collectionVariables.get(\"t3_term\")}`);\r", + "});\r", + "" + ], + "type": "text/javascript" + } + } + ], "request": { "auth": { "type": "apikey", @@ -5726,7 +19902,7 @@ } ] }, - "method": "PATCH", + "method": "POST", "header": [ { "key": "Content-Type", @@ -5739,7 +19915,7 @@ ], "body": { "mode": "raw", - "raw": "{\n \"request\": {\n \"term\": {\n \"name\": \"English\",\n \"description\": \"English\"\n }\n }\n}", + "raw": "{\n \"request\": {\n \"term\": {\n \"code\": \"{{t3_term}}\",\n \"name\": \"English\"\n }\n }\n}", "options": { "raw": { "language": "json" @@ -5747,36 +19923,36 @@ } }, "url": { - "raw": "{{baseUrl}}/framework/v1/term/update{{code}}?framework=Ut enim offici&category=Ut enim offici", + "raw": "{{baseUrl}}/framework/v3/term/create?framework={{fw13_code}}&category={{master15_code}}", "host": [ "{{baseUrl}}" ], "path": [ "framework", - "v1", + "v3", "term", - "update{{code}}" + "create" ], "query": [ { "key": "framework", - "value": "Ut enim offici", - "description": "(Required) Represents the framework in which the terms is to be updated" + "value": "{{fw13_code}}", + "description": "(Required) Represents the framework in which the term is to be created" }, { "key": "category", - "value": "Ut enim offici", - "description": "(Required) Represents the category in which the term is to be updated" + "value": "{{master15_code}}", + "description": "(Required) Represents the category in which the term is to be created" } ] }, - "description": "This API is associated with updating a term under a category in a framework on Sunbird Platform\n - The endpoint for **Update Term** is `/framework/v1/term/update{code}`\n - It points to knowledge-mw-service - `/v1/framework/term/update/{code}`\n - The fields marked with an asterisk (*) are mandatory. They cannot be null or empty." + "description": "This API is associated with creating a term under a framework category\n - The endpoint for **Create Term** is `/framework/v1/term/create`\n - It points to knowledge-mw-service - `/v1/framework/term/create`\n - The fields marked with an asterisk (*) are mandatory. They cannot be null or empty.\"" }, "response": [ { - "name": "OK ! Successful operation.\"update term\" operation was successfully executed.", + "name": "OK ! Successful operation.\"create term\" operation was successfully executed.", "originalRequest": { - "method": "PATCH", + "method": "POST", "header": [ { "description": "Added as a part of security scheme: apikey", @@ -5784,19 +19960,19 @@ "value": "" }, { - "description": "(Required) The Content Type entity is the media type of the resource\n Possible media types can be:- \n - application/json", + "description": "(Required) The Content Type entity is the media type of the resource.\n Possible media types can be:- \n - application/json", "key": "Content-Type", "value": "Ut enim offici" }, { - "description": "(Required) To make use of the API, you require authorization. Raise a request to the administrator for the use of the API. You will receive the authorization key. Specify the key received, here.'", + "description": "(Required) To make use of the API, you require authorization. Raise a request to the administrator for the use of the API. You will receive the authorization key. Specify the key received, here.", "key": "Authorization", "value": "Ut enim offici" } ], "body": { "mode": "raw", - "raw": "{\n \"request\": {\n \"term\": {\n \"name\": \"English\",\n \"description\": \"English\"\n }\n }\n}", + "raw": "{\n \"request\": {\n \"term\": {\n \"code\": \"english\",\n \"name\": \"English\"\n }\n }\n}", "options": { "raw": { "language": "json" @@ -5804,7 +19980,7 @@ } }, "url": { - "raw": "{{baseUrl}}/framework/v1/term/update{{code}}?framework=Ut enim offici&category=Ut enim offici", + "raw": "{{baseUrl}}/framework/v1/term/create?framework=Ut enim offici&category=Ut enim offici", "host": [ "{{baseUrl}}" ], @@ -5812,7 +19988,7 @@ "framework", "v1", "term", - "update{{code}}" + "create" ], "query": [ { @@ -5836,12 +20012,12 @@ } ], "cookie": [], - "body": "{\n \"id\": \"api.term.update\",\n \"ver\": \"1.0\",\n \"ts\": \"2020-12-14T19:48:19.754Z\",\n \"params\": {\n \"resmsgid\": \"50ffd0a0-3e45-11eb-9ff3-67c41480f6aa\",\n \"msgid\": \"50f04040-3e45-11eb-9ff3-67c41480f6aa\",\n \"status\": \"successful\",\n \"err\": null,\n \"errmsg\": null\n },\n \"responseCode\": \"OK\",\n \"result\": {\n \"node_id\": \"dummy_framework_subject_english\",\n \"versionKey\": \"1607975299669\"\n }\n}" + "body": "{\n \"id\": \"api.term.create\",\n \"ver\": \"1.0\",\n \"ts\": \"2020-12-14T19:44:02.348Z\",\n \"params\": {\n \"resmsgid\": \"b792c6c0-3e44-11eb-9ff3-67c41480f6aa\",\n \"msgid\": \"b783f9b0-3e44-11eb-9ff3-67c41480f6aa\",\n \"status\": \"successful\",\n \"err\": null,\n \"errmsg\": null\n },\n \"responseCode\": \"OK\",\n \"result\": {\n \"node_id\": [\n \"dummy_framework_subject_english\"\n ]\n }\n}" }, { - "name": "BAD REQUEST. The \"update term\" operation failed ! The possible reason for failure is that you may have missed providing input for a mandatory parameter.", + "name": "BAD REQUEST. The \"create term\" operation failed ! The possible reason for failure is that you may have missed providing input for a mandatory parameter.", "originalRequest": { - "method": "PATCH", + "method": "POST", "header": [ { "description": "Added as a part of security scheme: apikey", @@ -5849,19 +20025,19 @@ "value": "" }, { - "description": "(Required) The Content Type entity is the media type of the resource\n Possible media types can be:- \n - application/json", + "description": "(Required) The Content Type entity is the media type of the resource.\n Possible media types can be:- \n - application/json", "key": "Content-Type", "value": "Ut enim offici" }, { - "description": "(Required) To make use of the API, you require authorization. Raise a request to the administrator for the use of the API. You will receive the authorization key. Specify the key received, here.'", + "description": "(Required) To make use of the API, you require authorization. Raise a request to the administrator for the use of the API. You will receive the authorization key. Specify the key received, here.", "key": "Authorization", "value": "Ut enim offici" } ], "body": { "mode": "raw", - "raw": "{\n \"request\": {\n \"term\": {\n \"name\": \"English\",\n \"description\": \"English\"\n }\n }\n}", + "raw": "{\n \"request\": {\n \"term\": {\n \"code\": \"english\",\n \"name\": \"English\"\n }\n }\n}", "options": { "raw": { "language": "json" @@ -5869,7 +20045,7 @@ } }, "url": { - "raw": "{{baseUrl}}/framework/v1/term/update{{code}}?framework=Ut enim offici&category=Ut enim offici", + "raw": "{{baseUrl}}/framework/v1/term/create?framework=Ut enim offici&category=Ut enim offici", "host": [ "{{baseUrl}}" ], @@ -5877,7 +20053,7 @@ "framework", "v1", "term", - "update{{code}}" + "create" ], "query": [ { @@ -5901,12 +20077,12 @@ } ], "cookie": [], - "body": "{\n \"id\": \"api.term.update\",\n \"ver\": \"1.0\",\n \"ts\": \"2020-12-14T19:49:03.927Z\",\n \"params\": {\n \"resmsgid\": \"6b541470-3e45-11eb-9ff3-67c41480f6aa\",\n \"msgid\": null,\n \"status\": \"failed\",\n \"err\": \"ERR_INVALID_CATEGORY_ID\",\n \"errmsg\": \"Please provide valid category.\"\n },\n \"responseCode\": \"CLIENT_ERROR\",\n \"result\": {}\n}" + "body": "{\n \"id\": \"api.term.create\",\n \"ver\": \"1.0\",\n \"ts\": \"2020-12-14T19:44:49.263Z\",\n \"params\": {\n \"resmsgid\": \"d3896ff0-3e44-11eb-9ff3-67c41480f6aa\",\n \"msgid\": null,\n \"status\": \"failed\",\n \"err\": \"ERR_INVALID_CATEGORY_ID\",\n \"errmsg\": \"Please provide valid category.\"\n },\n \"responseCode\": \"CLIENT_ERROR\",\n \"result\": {}\n}" }, { "name": "INTERNAL SERVER ERROR ! Looks like something went wrong! These errors are tracked automatically, but if the problem persists feel free to contact us. In the meantime, try refreshing.", "originalRequest": { - "method": "PATCH", + "method": "POST", "header": [ { "description": "Added as a part of security scheme: apikey", @@ -5914,19 +20090,19 @@ "value": "" }, { - "description": "(Required) The Content Type entity is the media type of the resource\n Possible media types can be:- \n - application/json", + "description": "(Required) The Content Type entity is the media type of the resource.\n Possible media types can be:- \n - application/json", "key": "Content-Type", "value": "Ut enim offici" }, { - "description": "(Required) To make use of the API, you require authorization. Raise a request to the administrator for the use of the API. You will receive the authorization key. Specify the key received, here.'", + "description": "(Required) To make use of the API, you require authorization. Raise a request to the administrator for the use of the API. You will receive the authorization key. Specify the key received, here.", "key": "Authorization", "value": "Ut enim offici" } ], "body": { "mode": "raw", - "raw": "{\n \"request\": {\n \"term\": {\n \"name\": \"English\",\n \"description\": \"English\"\n }\n }\n}", + "raw": "{\n \"request\": {\n \"term\": {\n \"code\": \"english\",\n \"name\": \"English\"\n }\n }\n}", "options": { "raw": { "language": "json" @@ -5934,7 +20110,7 @@ } }, "url": { - "raw": "{{baseUrl}}/framework/v1/term/update{{code}}?framework=Ut enim offici&category=Ut enim offici", + "raw": "{{baseUrl}}/framework/v1/term/create?framework=Ut enim offici&category=Ut enim offici", "host": [ "{{baseUrl}}" ], @@ -5942,7 +20118,7 @@ "framework", "v1", "term", - "update{{code}}" + "create" ], "query": [ { @@ -5956,62 +20132,599 @@ ] } }, - "status": "Internal Server Error", - "code": 500, - "_postman_previewlanguage": "text", - "header": [ + "status": "Internal Server Error", + "code": 500, + "_postman_previewlanguage": "text", + "header": [ + { + "key": "Content-Type", + "value": "text/plain" + } + ], + "cookie": [], + "body": "" + } + ] + } + ], + "description": "1. Framework name and code should be updated before each run\n2. Framework categroy should be a subset of master category, i.e., framework category can be created only when it is available in master category\n \n3. Create a master category with same indentifier before creating the framework category" + }, + { + "name": "Positive", + "item": [ + { + "name": "Update a valid term for a valid framework and framework category", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json()\r", + "\r", + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "pm.test(\"id has string - api.taxonomy.term.update\", function () {\r", + " pm.expect(jsonResponse.id).to.be.equal(\"api.taxonomy.term.update\");\r", + "});\r", + "pm.test(\"Version is 3.0 \", function () {\r", + " pm.expect(jsonResponse.ver).to.be.equal(\"3.0\");\r", + "});\r", + "pm.test(\"Verify keys and data type of the response result\", () => {\r", + " pm.expect(jsonResponse.params).to.have.all.keys('resmsgid','msgid','status', 'err','errmsg');\r", + "pm.expect(jsonResponse.params.resmsgid).to.be.a(\"String\");\r", + "pm.expect(jsonResponse.params.msgid).to.be.a(\"null\");\r", + " pm.expect(jsonResponse.params.status).to.be.a(\"String\");\r", + " pm.expect(jsonResponse.params.err).to.be.a(\"null\");\r", + " pm.expect(jsonResponse.params.errmsg).to.be.a(\"null\");\r", + "});\r", + "\r", + "pm.test(\"Status has string \", function () {\r", + " pm.expect(jsonResponse.params.status).to.be.equal(\"successful\");\r", + "});\r", + "\r", + "pm.test(\"Verify keys and data type of the response result\", () => {\r", + " pm.expect(jsonResponse.result).to.have.all.keys('identifier', 'versionKey');\r", + " pm.expect(jsonResponse.result.identifier).to.be.a(\"String\");\r", + " pm.expect(jsonResponse.result.versionKey).to.be.a(\"string\");\r", + "});\r", + "\r", + "pm.collectionVariables.set(\"term1_id\",jsonResponse.result.identifier);\r", + "console.log(pm.collectionVariables.get(\"term1_id\"));\r", + "pm.test(`identifier should be equal to ${pm.collectionVariables.get(\"term1_id\")}`, () => {\r", + " pm.expect(jsonResponse.result.identifier).to.eql(`${pm.collectionVariables.get(\"fw13_code\")}_${pm.collectionVariables.get(\"master15_code\")}_${pm.collectionVariables.get(\"t3_term\")}`);\r", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "PATCH", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "{{apiKey}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"term\": {\n \"name\": \"{{term}}\",\n \"description\": \"{{term}} description updated\"\n }\n }\n}" + }, + "url": { + "raw": "{{host}}/framework/v3/term/update/{{t3_term}}?framework={{fw13_code}}&category={{master15_code}}", + "host": [ + "{{host}}" + ], + "path": [ + "framework", + "v3", + "term", + "update", + "{{t3_term}}" + ], + "query": [ + { + "key": "framework", + "value": "{{fw13_code}}" + }, + { + "key": "category", + "value": "{{master15_code}}" + } + ] + } + }, + "response": [] + } + ] + }, + { + "name": "Negative", + "item": [ + { + "name": "Update an invalid term for a valid framework and framework category", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json()\r", + "\r", + "pm.test(\"Status code is 404\", function () {\r", + " pm.response.to.have.status(404);\r", + "});\r", + "pm.test(\"id has string - api.taxonomy.term.update\", function () {\r", + " pm.expect(jsonResponse.id).to.be.equal(\"api.taxonomy.term.update\");\r", + "});\r", + "pm.test(\"Version is 3.0 \", function () {\r", + " pm.expect(jsonResponse.ver).to.be.equal(\"3.0\");\r", + "});\r", + "pm.test(\"Verify keys and data type of the response result\", () => {\r", + " pm.expect(jsonResponse.params).to.have.all.keys('resmsgid','msgid','status', 'err','errmsg');\r", + "pm.expect(jsonResponse.params.resmsgid).to.be.a(\"String\");\r", + "pm.expect(jsonResponse.params.msgid).to.be.a(\"null\");\r", + " pm.expect(jsonResponse.params.status).to.be.a(\"String\");\r", + " pm.expect(jsonResponse.params.err).to.be.a(\"String\");\r", + " pm.expect(jsonResponse.params.errmsg).to.be.a(\"String\");\r", + "});\r", + "\r", + "pm.test(\"Status has string \", function () {\r", + " pm.expect(jsonResponse.params.status).to.be.equal(\"failed\");\r", + "});\r", + "\r", + "pm.test(\"err has string \", function () {\r", + " pm.expect(jsonResponse.params.err).to.be.equal(\"NOT_FOUND\");\r", + "});\r", + "\r", + "pm.test(`errmsg has string: Error! Node(s) doesn't Exists. | [Invalid Node Id.]: ${pm.collectionVariables.get(\"fw13_code\")}_${pm.collectionVariables.get(\"master15_code\")}_dummy`, function () {\r", + " pm.expect(jsonResponse.params.errmsg).to.eql(`Error! Node(s) doesn't Exists. | [Invalid Node Id.]: ${pm.collectionVariables.get(\"fw13_code\")}_${pm.collectionVariables.get(\"master15_code\")}_dummy`);\r", + "});\r", + "\r", + "pm.test(\"responseCode has string \", function () {\r", + " pm.expect(jsonResponse.responseCode).to.be.include(\"RESOURCE_NOT_FOUND\");\r", + "});\r", + "\r", + "\r", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "PATCH", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "{{apiKey}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"term\": {\n \"name\": \"sst\",\n \"description\": \"sst description updated\"\n }\n }\n}" + }, + "url": { + "raw": "{{host}}/framework/v3/term/update/dummy?framework={{fw13_code}}&category={{master15_code}}", + "host": [ + "{{host}}" + ], + "path": [ + "framework", + "v3", + "term", + "update", + "dummy" + ], + "query": [ { - "key": "Content-Type", - "value": "text/plain" + "key": "framework", + "value": "{{fw13_code}}" + }, + { + "key": "category", + "value": "{{master15_code}}" } - ], - "cookie": [], - "body": "" + ] } - ] - } - ] - }, - { - "name": "Negative", - "item": [ - { - "name": "Update an invalid term for a valid framework and framework category", - "request": { - "method": "GET", - "header": [] }, "response": [] }, { "name": "Update an valid term for a invalid framework and framework category", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json()\r", + "\r", + "pm.test(\"Status code is 404\", function () {\r", + " pm.response.to.have.status(404);\r", + "});\r", + "pm.test(\"id has string - api.taxonomy.term.update\", function () {\r", + " pm.expect(jsonResponse.id).to.be.equal(\"api.taxonomy.term.update\");\r", + "});\r", + "pm.test(\"Version is 3.0 \", function () {\r", + " pm.expect(jsonResponse.ver).to.be.equal(\"3.0\");\r", + "});\r", + "pm.test(\"Verify keys and data type of the response result\", () => {\r", + " pm.expect(jsonResponse.params).to.have.all.keys('resmsgid','msgid','status', 'err','errmsg');\r", + "pm.expect(jsonResponse.params.resmsgid).to.be.a(\"String\");\r", + "pm.expect(jsonResponse.params.msgid).to.be.a(\"null\");\r", + " pm.expect(jsonResponse.params.status).to.be.a(\"String\");\r", + " pm.expect(jsonResponse.params.err).to.be.a(\"String\");\r", + " pm.expect(jsonResponse.params.errmsg).to.be.a(\"String\");\r", + "});\r", + "\r", + "pm.test(\"Status has string \", function () {\r", + " pm.expect(jsonResponse.params.status).to.be.equal(\"failed\");\r", + "});\r", + "\r", + "pm.test(\"err has string \", function () {\r", + " pm.expect(jsonResponse.params.err).to.be.equal(\"NOT_FOUND\");\r", + "});\r", + "\r", + "pm.test(`errmsg has string: Error! Node(s) doesn't Exists. | [Invalid Node Id.]: dummy_${pm.collectionVariables.get(\"master15_code\")}_${pm.collectionVariables.get(\"t3_term\")}`, function () {\r", + " pm.expect(jsonResponse.params.errmsg).to.eql(`Error! Node(s) doesn't Exists. | [Invalid Node Id.]: dummy_${pm.collectionVariables.get(\"master15_code\")}_${pm.collectionVariables.get(\"t3_term\")}`);\r", + "});\r", + "\r", + "pm.test(\"responseCode has string \", function () {\r", + " pm.expect(jsonResponse.responseCode).to.be.include(\"RESOURCE_NOT_FOUND\");\r", + "});\r", + "\r", + "\r", + "" + ], + "type": "text/javascript" + } + } + ], "request": { - "method": "GET", - "header": [] + "method": "PATCH", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "{{apiKey}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"term\": {\n \"name\": \"sst\",\n \"description\": \"sst description updated\"\n }\n }\n}" + }, + "url": { + "raw": "{{host}}/framework/v3/term/update/{{t3_term}}?framework=dummy&category={{master15_code}}", + "host": [ + "{{host}}" + ], + "path": [ + "framework", + "v3", + "term", + "update", + "{{t3_term}}" + ], + "query": [ + { + "key": "framework", + "value": "dummy" + }, + { + "key": "category", + "value": "{{master15_code}}" + } + ] + } }, "response": [] }, { "name": "Update an valid term for a valid framework and invalid framework category", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json()\r", + "\r", + "pm.test(\"Status code is 404\", function () {\r", + " pm.response.to.have.status(404);\r", + "});\r", + "pm.test(\"id has string - api.taxonomy.term.update\", function () {\r", + " pm.expect(jsonResponse.id).to.be.equal(\"api.taxonomy.term.update\");\r", + "});\r", + "pm.test(\"Version is 3.0 \", function () {\r", + " pm.expect(jsonResponse.ver).to.be.equal(\"3.0\");\r", + "});\r", + "pm.test(\"Verify keys and data type of the response result\", () => {\r", + " pm.expect(jsonResponse.params).to.have.all.keys('resmsgid','msgid','status', 'err','errmsg');\r", + "pm.expect(jsonResponse.params.resmsgid).to.be.a(\"String\");\r", + "pm.expect(jsonResponse.params.msgid).to.be.a(\"null\");\r", + " pm.expect(jsonResponse.params.status).to.be.a(\"String\");\r", + " pm.expect(jsonResponse.params.err).to.be.a(\"String\");\r", + " pm.expect(jsonResponse.params.errmsg).to.be.a(\"String\");\r", + "});\r", + "\r", + "pm.test(\"Status has string \", function () {\r", + " pm.expect(jsonResponse.params.status).to.be.equal(\"failed\");\r", + "});\r", + "\r", + "pm.test(\"err has string \", function () {\r", + " pm.expect(jsonResponse.params.err).to.be.equal(\"NOT_FOUND\");\r", + "});\r", + "\r", + "pm.test(`errmsg has string: Error! Node(s) doesn't Exists. | [Invalid Node Id.]: ${pm.collectionVariables.get(\"fw13_code\")}_dummy_${pm.collectionVariables.get(\"t3_term\")}`, function () {\r", + " pm.expect(jsonResponse.params.errmsg).to.eql(`Error! Node(s) doesn't Exists. | [Invalid Node Id.]: ${pm.collectionVariables.get(\"fw13_code\")}_dummy_${pm.collectionVariables.get(\"t3_term\")}`);\r", + "});\r", + "\r", + "pm.test(\"responseCode has string \", function () {\r", + " pm.expect(jsonResponse.responseCode).to.be.include(\"RESOURCE_NOT_FOUND\");\r", + "});\r", + "\r", + "" + ], + "type": "text/javascript" + } + } + ], "request": { - "method": "GET", - "header": [] + "method": "PATCH", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "{{apiKey}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"term\": {\n \"name\": \"sst\",\n \"description\": \"sst description updated\"\n }\n }\n}" + }, + "url": { + "raw": "{{host}}/framework/v3/term/update/{{t3_term}}?framework={{fw13_code}}&category=dummy", + "host": [ + "{{host}}" + ], + "path": [ + "framework", + "v3", + "term", + "update", + "{{t3_term}}" + ], + "query": [ + { + "key": "framework", + "value": "{{fw13_code}}" + }, + { + "key": "category", + "value": "dummy" + } + ] + } }, "response": [] }, { "name": "Update a valid term for invalid framework and invalid framework category", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json()\r", + "\r", + "pm.test(\"Status code is 404\", function () {\r", + " pm.response.to.have.status(404);\r", + "});\r", + "pm.test(\"id has string - api.taxonomy.term.update\", function () {\r", + " pm.expect(jsonResponse.id).to.be.equal(\"api.taxonomy.term.update\");\r", + "});\r", + "pm.test(\"Version is 3.0 \", function () {\r", + " pm.expect(jsonResponse.ver).to.be.equal(\"3.0\");\r", + "});\r", + "pm.test(\"Verify keys and data type of the response result\", () => {\r", + " pm.expect(jsonResponse.params).to.have.all.keys('resmsgid','msgid','status', 'err','errmsg');\r", + "pm.expect(jsonResponse.params.resmsgid).to.be.a(\"String\");\r", + "pm.expect(jsonResponse.params.msgid).to.be.a(\"null\");\r", + " pm.expect(jsonResponse.params.status).to.be.a(\"String\");\r", + " pm.expect(jsonResponse.params.err).to.be.a(\"String\");\r", + " pm.expect(jsonResponse.params.errmsg).to.be.a(\"String\");\r", + "});\r", + "\r", + "pm.test(\"Status has string \", function () {\r", + " pm.expect(jsonResponse.params.status).to.be.equal(\"failed\");\r", + "});\r", + "\r", + "pm.test(\"err has string \", function () {\r", + " pm.expect(jsonResponse.params.err).to.be.equal(\"NOT_FOUND\");\r", + "});\r", + "\r", + "pm.test(`errmsg has string: Error! Node(s) doesn't Exists. | [Invalid Node Id.]: dummy_dummy_${pm.collectionVariables.get(\"t3_term\")}`, function () {\r", + " pm.expect(jsonResponse.params.errmsg).to.eql(`Error! Node(s) doesn't Exists. | [Invalid Node Id.]: dummy_dummy_${pm.collectionVariables.get(\"t3_term\")}`);\r", + "});\r", + "\r", + "pm.test(\"responseCode has string \", function () {\r", + " pm.expect(jsonResponse.responseCode).to.be.include(\"RESOURCE_NOT_FOUND\");\r", + "});\r", + "\r", + "" + ], + "type": "text/javascript" + } + } + ], "request": { - "method": "GET", - "header": [] + "method": "PATCH", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "{{apiKey}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"term\": {\n \"name\": \"sst\",\n \"description\": \"sst description updated\"\n }\n }\n}" + }, + "url": { + "raw": "{{host}}/framework/v3/term/update/{{t3_term}}?framework=dummy&category=dummy", + "host": [ + "{{host}}" + ], + "path": [ + "framework", + "v3", + "term", + "update", + "{{t3_term}}" + ], + "query": [ + { + "key": "framework", + "value": "dummy" + }, + { + "key": "category", + "value": "dummy" + } + ] + } }, "response": [] }, { "name": "Update a invalid term for invalid framework and invalid framework category", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json()\r", + "\r", + "pm.test(\"Status code is 404\", function () {\r", + " pm.response.to.have.status(404);\r", + "});\r", + "pm.test(\"id has string - api.taxonomy.term.update\", function () {\r", + " pm.expect(jsonResponse.id).to.be.equal(\"api.taxonomy.term.update\");\r", + "});\r", + "pm.test(\"Version is 3.0 \", function () {\r", + " pm.expect(jsonResponse.ver).to.be.equal(\"3.0\");\r", + "});\r", + "pm.test(\"Verify keys and data type of the response result\", () => {\r", + " pm.expect(jsonResponse.params).to.have.all.keys('resmsgid','msgid','status', 'err','errmsg');\r", + "pm.expect(jsonResponse.params.resmsgid).to.be.a(\"String\");\r", + "pm.expect(jsonResponse.params.msgid).to.be.a(\"null\");\r", + " pm.expect(jsonResponse.params.status).to.be.a(\"String\");\r", + " pm.expect(jsonResponse.params.err).to.be.a(\"String\");\r", + " pm.expect(jsonResponse.params.errmsg).to.be.a(\"String\");\r", + "});\r", + "\r", + "pm.test(\"Status has string \", function () {\r", + " pm.expect(jsonResponse.params.status).to.be.equal(\"failed\");\r", + "});\r", + "\r", + "pm.test(\"err has string \", function () {\r", + " pm.expect(jsonResponse.params.err).to.be.equal(\"NOT_FOUND\");\r", + "});\r", + "\r", + "pm.test(`errmsg has string: Error! Node(s) doesn't Exists. | [Invalid Node Id.]: dummy_dummy_dummy`, function () {\r", + " pm.expect(jsonResponse.params.errmsg).to.eql(`Error! Node(s) doesn't Exists. | [Invalid Node Id.]: dummy_dummy_dummy`);\r", + "});\r", + "\r", + "pm.test(\"responseCode has string \", function () {\r", + " pm.expect(jsonResponse.responseCode).to.be.include(\"RESOURCE_NOT_FOUND\");\r", + "});\r", + "\r", + "\r", + "" + ], + "type": "text/javascript" + } + } + ], "request": { - "method": "GET", - "header": [] + "method": "PATCH", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "{{apiKey}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"term\": {\n \"name\": \"sst\",\n \"description\": \"sst description updated\"\n }\n }\n}" + }, + "url": { + "raw": "{{host}}/framework/v3/term/update/dummy?framework=dummy&category=dummy", + "host": [ + "{{host}}" + ], + "path": [ + "framework", + "v3", + "term", + "update", + "dummy" + ], + "query": [ + { + "key": "framework", + "value": "dummy" + }, + { + "key": "category", + "value": "dummy" + } + ] + } }, "response": [] } @@ -6020,25 +20733,157 @@ ] }, { - "name": "Search Term", + "name": "Retire Term", "item": [ { - "name": "Positive", + "name": "Pre requisite", "item": [ { - "name": "Search term for valid framework and framework category", + "name": "Create a master category", + "event": [ + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + }, + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json()\r", + "\r", + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "\r", + "pm.collectionVariables.set(\"master16_id\",jsonResponse.result.identifier);\r", + "console.log(pm.collectionVariables.get(\"master16_id\"));\r", + "pm.collectionVariables.set(\"master16_node\",jsonResponse.result.node_id);\r", + "console.log(pm.collectionVariables.get(\"master16_node\"));\r", + "\r", + "pm.test(`identifier should be equal to ${pm.collectionVariables.get(\"master16_id\")}`, () => {\r", + " pm.expect(jsonResponse.result.identifier).to.eql(`${pm.collectionVariables.get(\"master16_code\")}`);\r", + "});\r", + "\r", + "pm.test(`node_id should be equal to ${pm.collectionVariables.get(\"master16_node\")}`, () => {\r", + " pm.expect(jsonResponse.result.node_id).to.eql(`${pm.collectionVariables.get(\"master16_code\")}`);\r", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "X-Channel-Id", + "value": "sunbird" + }, + { + "key": "Authorization", + "value": "{{auth_token}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"category\": {\n \"name\": \"master\",\n \"code\": \"{{master16_code}}\",\n \"targetIdFieldName\": \"targetmasterIds\",\n \"searchLabelFieldName\": \"se_master\",\n \"searchIdFieldName\": \"se_master\",\n \"orgIdFieldName\": \"masterIds\"\n }\n }\n}" + }, + "url": { + "raw": "{{host}}/framework/v3/category/master/create", + "host": [ + "{{host}}" + ], + "path": [ + "framework", + "v3", + "category", + "master", + "create" + ] + } + }, + "response": [] + }, + { + "name": "Create a framework", + "event": [ + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + }, + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json()\r", + "\r", + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "\r", + "pm.test(\"Verify keys and data type of the response result\", () => {\r", + " pm.expect(jsonResponse.params).to.have.all.keys('resmsgid','msgid','status', 'err','errmsg');\r", + " pm.expect(jsonResponse.params.status).to.be.a(\"String\");\r", + " pm.expect(jsonResponse.params.err).to.be.a(\"null\");\r", + " pm.expect(jsonResponse.params.errmsg).to.be.a(\"null\");\r", + "});\r", + "\r", + "pm.test(\"Status has string \", function () {\r", + " pm.expect(jsonResponse.params.status).to.be.equal(\"successful\");\r", + "});\r", + "\r", + "pm.test(\"Verify keys and data type of the response result\", () => {\r", + " pm.expect(jsonResponse.result).to.have.all.keys('node_id', 'versionKey');\r", + " pm.expect(jsonResponse.result.node_id).to.be.a(\"String\");\r", + " pm.expect(jsonResponse.result.versionKey).to.be.a(\"string\");\r", + "});\r", + "\r", + "pm.collectionVariables.set(\"fw14_node\",jsonResponse.result.node_id);\r", + "console.log(pm.collectionVariables.get(\"fw14_node\"));\r", + "\r", + "pm.test(`node id should be equal to ${pm.collectionVariables.get(\"fw14_node\")}`, () => {\r", + " pm.expect(jsonResponse.result.node_id).to.eql(pm.collectionVariables.get(\"fw14_code\"));\r", + "});\r", + "\r", + "" + ], + "type": "text/javascript" + } + } + ], + "protocolProfileBehavior": { + "disabledSystemHeaders": {} + }, "request": { "auth": { "type": "apikey", "apikey": [ { - "key": "key", - "value": "Authorization", + "key": "value", + "value": "{{auth_token}}", "type": "string" }, { - "key": "value", - "value": "{{apiKey}}", + "key": "key", + "value": "Authorization", "type": "string" }, { @@ -6051,17 +20896,29 @@ "method": "POST", "header": [ { - "key": "Content-Type", - "value": "application/json" + "description": "(Required) It is the Unique Id to identify the root organisation to which the user belongs", + "key": "X-Channel-Id", + "value": "{{X-Channel-Id}}" + }, + { + "key": "", + "value": "", + "disabled": true }, { "key": "Accept", "value": "application/json" + }, + { + "key": "Authorization", + "value": "", + "type": "text", + "disabled": true } ], "body": { "mode": "raw", - "raw": "{\n \"request\": {}\n}", + "raw": "{\n \"request\": {\n \"framework\": {\n \"name\": \"{{fw14_name}}\",\n \"code\": \"{{fw14_code}}\"\n \n }\n }\n}", "options": { "raw": { "language": "json" @@ -6069,34 +20926,21 @@ } }, "url": { - "raw": "{{baseUrl}}/framework/v1/term/search?framework=Ut enim offici&category=Ut enim offici", + "raw": "{{host}}/framework/v3/create", "host": [ - "{{baseUrl}}" + "{{host}}" ], "path": [ "framework", - "v1", - "term", - "search" - ], - "query": [ - { - "key": "framework", - "value": "Ut enim offici", - "description": "(Required) Represents the framework in which the term is to be searched" - }, - { - "key": "category", - "value": "Ut enim offici", - "description": "(Required) Represents the category in which the term is to be searched" - } + "v3", + "create" ] }, - "description": "This API is associated with searching the existing terms under a category in a framework on Sunbird Platform\n - The endpoint for **Search Term** is `/framework/v1/term/search`\n - It points to knowledge-mw-service - `/v1/framework/term/search`\n - The fields marked with an asterisk (*) are mandatory. They cannot be null or empty." + "description": "This API is associated with creating a new framework on the Sunbird Platform.\n - The endpoint for **Create a Framework** is `/framework/v1/create`\n - It points to knowledge-mw-service - `/v1/framework/create`\n - The fields marked with an asterisk (*) are mandatory. They cannot be null or empty." }, "response": [ { - "name": "OK ! Successful operation.\"Search term operation was successfully executed.", + "name": "OK ! Successful operation.\"create framework\" operation was successfully executed.", "originalRequest": { "method": "POST", "header": [ @@ -6105,15 +20949,25 @@ "key": "Authorization", "value": "" }, + { + "description": "(Required) The Content Type entity is the media type of the resource\n Possible media types can be:- \n - application/json", + "key": "Content-Type", + "value": "Ut enim offici" + }, { "description": "(Required) To make use of the API, you require authorization. Raise a request to the administrator for the use of the API. You will receive the authorization key. Specify the key received, here.", "key": "Authorization", "value": "Ut enim offici" + }, + { + "description": "(Required) It is the Unique Id to identify the root organisation to which the user belongs", + "key": "X-Channel-Id", + "value": "Ut enim offici" } ], "body": { "mode": "raw", - "raw": "{\n \"request\": {}\n}", + "raw": "{\n \"request\": {\n \"framework\": {\n \"name\": \"Framework Name\",\n \"code\": \"dummy_framework\",\n \"channels\": [\n {\n \"identifier\": \"in.ekstep\"\n }\n ]\n }\n }\n}", "options": { "raw": { "language": "json" @@ -6121,25 +20975,14 @@ } }, "url": { - "raw": "{{baseUrl}}/framework/v1/term/search?framework=Ut enim offici&category=Ut enim offici", + "raw": "{{baseUrl}}/framework/v1/create", "host": [ "{{baseUrl}}" ], "path": [ "framework", "v1", - "term", - "search" - ], - "query": [ - { - "key": "framework", - "value": "Ut enim offici" - }, - { - "key": "category", - "value": "Ut enim offici" - } + "create" ] } }, @@ -6153,10 +20996,10 @@ } ], "cookie": [], - "body": "{\n \"id\": \"api.term.search\",\n \"ver\": \"1.0\",\n \"ts\": \"2020-12-17T08:12:44.816Z\",\n \"params\": {\n \"resmsgid\": \"a446e900-403f-11eb-9b0c-abcfbdf41bc3\",\n \"msgid\": \"a4447800-403f-11eb-9b0c-abcfbdf41bc3\",\n \"status\": \"successful\",\n \"err\": null,\n \"errmsg\": null\n },\n \"responseCode\": \"OK\",\n \"result\": {\n \"terms\": [\n {\n \"associations\": [],\n \"identifier\": \"dummy_framework_subject_english\",\n \"lastStatusChangedOn\": \"2020-12-14T19:44:02.260+0000\",\n \"code\": \"english\",\n \"consumerId\": \"7411b6bd-89f3-40ec-98d1-229dc64ce77d\",\n \"channel\": \"in.ekstep\",\n \"description\": \"English\",\n \"createdOn\": \"2020-12-14T19:44:02.260+0000\",\n \"versionKey\": \"1607975299669\",\n \"children\": [],\n \"appId\": \"dev.sunbird.portal\",\n \"name\": \"English\",\n \"lastUpdatedOn\": \"2020-12-14T19:48:19.669+0000\",\n \"categories\": [\n {\n \"identifier\": \"dummy_framework_subject\",\n \"name\": \"Subject\",\n \"objectType\": \"CategoryInstance\",\n \"relation\": \"hasSequenceMember\",\n \"description\": \"Updated description\",\n \"status\": \"Live\"\n }\n ],\n \"category\": \"subject\",\n \"status\": \"Live\"\n }\n ],\n \"count\": 1\n }\n}" + "body": "{\n \"id\": \"api.framework.create\",\n \"ver\": \"1.0\",\n \"ts\": \"2020-12-14T09:49:06.794Z\",\n \"params\": {\n \"resmsgid\": \"9b5d7ca0-3df1-11eb-9ff3-67c41480f6aa\",\n \"msgid\": \"9b4a90e0-3df1-11eb-9ff3-67c41480f6aa\",\n \"status\": \"successful\",\n \"err\": null,\n \"errmsg\": null\n },\n \"responseCode\": \"OK\",\n \"result\": {\n \"node_id\": \"dummy_framework\",\n \"versionKey\": \"1607939346678\"\n }\n}" }, { - "name": "BAD REQUEST. The \"search term\" operation failed ! The possible reason for failure is that you may have missed providing input for a mandatory parameter.", + "name": "BAD REQUEST. The \"create framework\" operation failed ! The possible reason for failure is that you may have missed providing input for a mandatory parameter.", "originalRequest": { "method": "POST", "header": [ @@ -6165,15 +21008,25 @@ "key": "Authorization", "value": "" }, + { + "description": "(Required) The Content Type entity is the media type of the resource\n Possible media types can be:- \n - application/json", + "key": "Content-Type", + "value": "Ut enim offici" + }, { "description": "(Required) To make use of the API, you require authorization. Raise a request to the administrator for the use of the API. You will receive the authorization key. Specify the key received, here.", "key": "Authorization", "value": "Ut enim offici" + }, + { + "description": "(Required) It is the Unique Id to identify the root organisation to which the user belongs", + "key": "X-Channel-Id", + "value": "Ut enim offici" } ], "body": { "mode": "raw", - "raw": "{\n \"request\": {}\n}", + "raw": "{\n \"request\": {\n \"framework\": {\n \"name\": \"Framework Name\",\n \"code\": \"dummy_framework\",\n \"channels\": [\n {\n \"identifier\": \"in.ekstep\"\n }\n ]\n }\n }\n}", "options": { "raw": { "language": "json" @@ -6181,25 +21034,14 @@ } }, "url": { - "raw": "{{baseUrl}}/framework/v1/term/search?framework=Ut enim offici&category=Ut enim offici", + "raw": "{{baseUrl}}/framework/v1/create", "host": [ "{{baseUrl}}" ], "path": [ "framework", "v1", - "term", - "search" - ], - "query": [ - { - "key": "framework", - "value": "Ut enim offici" - }, - { - "key": "category", - "value": "Ut enim offici" - } + "create" ] } }, @@ -6213,7 +21055,7 @@ } ], "cookie": [], - "body": "{\n \"id\": \"api.term.search\",\n \"ver\": \"1.0\",\n \"ts\": \"2020-12-17T08:13:50.811Z\",\n \"params\": {\n \"resmsgid\": \"cb9cf2b0-403f-11eb-9b0c-abcfbdf41bc3\",\n \"msgid\": null,\n \"status\": \"failed\",\n \"err\": \"ERR_INVALID_CATEGORY_ID\",\n \"errmsg\": \"Please provide valid category.\"\n },\n \"responseCode\": \"CLIENT_ERROR\",\n \"result\": {}\n}" + "body": "{\n \"id\": \"api.framework.create\",\n \"ver\": \"1.0\",\n \"ts\": \"2020-12-14T09:50:45.249Z\",\n \"params\": {\n \"resmsgid\": \"d60c8710-3df1-11eb-9ff3-67c41480f6aa\",\n \"msgid\": null,\n \"status\": \"failed\",\n \"err\": \"CONSTRAINT_VALIDATION_FAILED\",\n \"errmsg\": \"Object already exists with identifier: dummy_framework\"\n },\n \"responseCode\": \"CLIENT_ERROR\",\n \"result\": {}\n}" }, { "name": "INTERNAL SERVER ERROR ! Looks like something went wrong! These errors are tracked automatically, but if the problem persists feel free to contact us. In the meantime, try refreshing.", @@ -6225,15 +21067,25 @@ "key": "Authorization", "value": "" }, + { + "description": "(Required) The Content Type entity is the media type of the resource\n Possible media types can be:- \n - application/json", + "key": "Content-Type", + "value": "Ut enim offici" + }, { "description": "(Required) To make use of the API, you require authorization. Raise a request to the administrator for the use of the API. You will receive the authorization key. Specify the key received, here.", "key": "Authorization", "value": "Ut enim offici" + }, + { + "description": "(Required) It is the Unique Id to identify the root organisation to which the user belongs", + "key": "X-Channel-Id", + "value": "Ut enim offici" } ], "body": { "mode": "raw", - "raw": "{\n \"request\": {}\n}", + "raw": "{\n \"request\": {\n \"framework\": {\n \"name\": \"Framework Name\",\n \"code\": \"dummy_framework\",\n \"channels\": [\n {\n \"identifier\": \"in.ekstep\"\n }\n ]\n }\n }\n}", "options": { "raw": { "language": "json" @@ -6241,25 +21093,14 @@ } }, "url": { - "raw": "{{baseUrl}}/framework/v1/term/search?framework=Ut enim offici&category=Ut enim offici", + "raw": "{{baseUrl}}/framework/v1/create", "host": [ "{{baseUrl}}" ], "path": [ "framework", "v1", - "term", - "search" - ], - "query": [ - { - "key": "framework", - "value": "Ut enim offici" - }, - { - "key": "category", - "value": "Ut enim offici" - } + "create" ] } }, @@ -6276,183 +21117,19 @@ "body": "" } ] - } - ] - }, - { - "name": "Negative", - "item": [ - { - "name": "Search term for invalid framework and framework category", - "request": { - "method": "GET", - "header": [] - }, - "response": [] - } - ] - } - ] - }, - { - "name": "List Term", - "item": [ - { - "name": "Positive", - "item": [ - { - "name": "List term for valid framework and valid framework category", - "request": { - "method": "GET", - "header": [] - }, - "response": [] - } - ] - }, - { - "name": "Negative", - "item": [ - { - "name": "List invalid term for valid framework and valid framework category", - "request": { - "method": "GET", - "header": [] - }, - "response": [] }, { - "name": "List valid term for invalid framework and inavlid framework category", - "request": { - "method": "GET", - "header": [] - }, - "response": [] - } - ] - } - ] - } - ] - } - ] - }, - { - "name": "Master Data", - "item": [ - { - "name": "Master Category", - "item": [ - { - "name": "Create master categroy", - "item": [ - { - "name": "Positive", - "item": [ - { - "name": "Create a master category with valid mandatory fields", + "name": "Create Framework Category", "event": [ { - "listen": "test", + "listen": "prerequest", "script": { "exec": [ - "let jsonResponse = pm.response.json()\r", - "\r", - "pm.test(\"Status code is 200\", function () {\r", - " pm.response.to.have.status(200);\r", - "});\r", - "\r", - "pm.test(\"Verify keys and data type of the response result\", () => {\r", - " pm.expect(jsonResponse.params).to.have.all.keys('resmsgid','msgid','status', 'err','errmsg');\r", - " pm.expect(jsonResponse.params.msgid).to.be.a(\"null\"); \r", - " pm.expect(jsonResponse.params.status).to.be.a(\"String\");\r", - " pm.expect(jsonResponse.params.err).to.be.a(\"null\");\r", - " pm.expect(jsonResponse.params.errmsg).to.be.a(\"null\");\r", - "});\r", - "\r", - "pm.test(\"Status has string \", function () {\r", - " pm.expect(jsonResponse.params.status).to.be.equal(\"successful\");\r", - "});\r", - "\r", - "pm.test(\"Verify keys and data type of the response result\", () => {\r", - " pm.expect(jsonResponse.result).to.have.all.keys('identifier','node_id');\r", - " pm.expect(jsonResponse.result.node_id).to.be.a('String');\r", - " pm.expect(jsonResponse.result.identifier).to.be.a('String');\r", - "});\r", - "\r", - "pm.globals.set(\"node_id1\",jsonResponse.result.node_id);\r", - "console.log(pm.globals.get(\"node_id1\"));\r", - "\r", "" ], "type": "text/javascript" } - } - ], - "request": { - "auth": { - "type": "apikey", - "apikey": [ - { - "key": "value", - "value": "{{auth_token}}", - "type": "string" - }, - { - "key": "key", - "value": "Authorization", - "type": "string" - }, - { - "key": "in", - "value": "header", - "type": "string" - } - ] - }, - "method": "POST", - "header": [ - { - "key": "Accept", - "value": "application/json" - }, - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "X-Channel-Id", - "value": "{{X-Channel-Id}}" - }, - { - "key": "", - "value": "", - "disabled": true - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"request\": {\n \"category\": {\n \"name\": \"state\",\n \"code\": \"state\",\n \"targetIdFieldName\": \"targetstateIds\",\n \"searchLabelFieldName\": \"se_state\",\n \"searchIdFieldName\": \"se_state\",\n \"orgIdFieldName\": \"stateIds\"\n }\n }\n}" }, - "url": { - "raw": "{{host}}/framework/v3/category/master/create", - "host": [ - "{{host}}" - ], - "path": [ - "framework", - "v3", - "category", - "master", - "create" - ] - } - }, - "response": [] - }, - { - "name": "Create a master category with all valid fields", - "event": [ { "listen": "test", "script": { @@ -6465,7 +21142,8 @@ "\r", "pm.test(\"Verify keys and data type of the response result\", () => {\r", " pm.expect(jsonResponse.params).to.have.all.keys('resmsgid','msgid','status', 'err','errmsg');\r", - " pm.expect(jsonResponse.params.msgid).to.be.a(\"null\"); \r", + "pm.expect(jsonResponse.params.resmsgid).to.be.a(\"String\");\r", + "pm.expect(jsonResponse.params.msgid).to.be.a(\"null\");\r", " pm.expect(jsonResponse.params.status).to.be.a(\"String\");\r", " pm.expect(jsonResponse.params.err).to.be.a(\"null\");\r", " pm.expect(jsonResponse.params.errmsg).to.be.a(\"null\");\r", @@ -6476,15 +21154,17 @@ "});\r", "\r", "pm.test(\"Verify keys and data type of the response result\", () => {\r", - " pm.expect(jsonResponse.result).to.have.all.keys('identifier','node_id');\r", - " pm.expect(jsonResponse.result.node_id).to.be.a(\"String\");\r", - " pm.expect(jsonResponse.result.identifier).to.be.a(\"string\");\r", + " pm.expect(jsonResponse.result).to.have.all.keys('identifier', 'versionKey');\r", + " pm.expect(jsonResponse.result.identifier).to.be.a(\"String\");\r", + " pm.expect(jsonResponse.result.versionKey).to.be.a(\"string\");\r", "});\r", "\r", - "pm.globals.set(\"node_id\",jsonResponse.result.node_id);\r", - "console.log(pm.globals.get(\"node_id\"));\r", + "pm.collectionVariables.set(\"fwcat_cat9\",jsonResponse.result.identifier);\r", + "console.log(pm.collectionVariables.get(\"fwcat_cat9\"));\r", "\r", - "" + "pm.test(`identifier should be equal to ${pm.collectionVariables.get(\"fwcat_cat9\")}`, () => {\r", + " pm.expect(jsonResponse.result.identifier).to.eql(`${pm.collectionVariables.get(\"fw14_code\")}_${pm.collectionVariables.get(\"master16_code\")}`);\r", + "});" ], "type": "text/javascript" } @@ -6496,7 +21176,7 @@ "apikey": [ { "key": "value", - "value": "{{auth_token}}", + "value": "", "type": "string" }, { @@ -6514,28 +21194,30 @@ "method": "POST", "header": [ { - "key": "Accept", + "key": "Content-Type", "value": "application/json" }, { - "key": "Content-Type", + "key": "Accept", "value": "application/json" }, { "key": "X-Channel-Id", - "value": "{{X-Channel-Id}}" - }, - { - "key": "", - "value": "" + "value": "{{X-Channel-Id}}", + "type": "text" } ], "body": { "mode": "raw", - "raw": "{\n \"request\": {\n \"category\": {\n \"name\": \"med\",\n \"code\": \"med\",\n \"description\": \"med category\",\n \"targetIdFieldName\": \"targetmedIds\",\n \"searchLabelFieldName\": \"se_med\",\n \"searchIdFieldName\": \"se_med\",\n \"orgIdFieldName\": \"medIds\"\n }\n }\n}" + "raw": "{\n \"request\": {\n \"category\": {\n \"name\": \"Board\",\n \"code\": \"{{master16_code}}\",\n \"description\":\"Board category\"\n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } }, "url": { - "raw": "{{host}}/framework/v3/category/master/create", + "raw": "{{host}}/framework/v3/category/create?framework={{fw14_code}}", "host": [ "{{host}}" ], @@ -6543,75 +21225,231 @@ "framework", "v3", "category", - "master", "create" + ], + "query": [ + { + "key": "framework", + "value": "{{fw14_code}}", + "description": "(Required) The code of the framework under which category has to be created" + } ] - } + }, + "description": "This API is associated with creating a category under a framework\n - The endpoint for **Create Category** is `/framework/v1/category/create`\n - It points to knowledge-mw-service - `/v1/framework/category/create`\n - The fields marked with an asterisk (*) are mandatory. They cannot be null or empty." }, - "response": [] - } - ], - "description": "1. Request body should be updated with unique value each time before creating master category" - }, - { - "name": "Negative", - "item": [ + "response": [ + { + "name": "OK ! Successful operation.\"create category\" operation was successfully executed.", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource\n Possible media types can be:- \n - application/json", + "key": "Content-Type", + "value": "Ut enim offici" + }, + { + "description": "(Required) To make use of the API, you require authorization. Raise a request to the administrator for the use of the API. You will receive the authorization key. Specify the key received, here.", + "key": "Authorization", + "value": "Ut enim offici" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"category\": {\n \"name\": \"Subject\",\n \"code\": \"subject\"\n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/framework/v1/category/create?framework=Ut enim offici", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "framework", + "v1", + "category", + "create" + ], + "query": [ + { + "key": "framework", + "value": "Ut enim offici" + } + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"api.category.create\",\n \"ver\": \"1.0\",\n \"ts\": \"2020-12-14T19:32:01.754Z\",\n \"params\": {\n \"resmsgid\": \"0a10dba0-3e43-11eb-9ff3-67c41480f6aa\",\n \"msgid\": \"0a05df20-3e43-11eb-9ff3-67c41480f6aa\",\n \"status\": \"successful\",\n \"err\": null,\n \"errmsg\": null\n },\n \"responseCode\": \"OK\",\n \"result\": {\n \"node_id\": \"dummy_framework_medium\",\n \"versionKey\": \"1607974321700\"\n }\n}" + }, + { + "name": "BAD REQUEST. The \"create category\" operation failed ! The possible reason for failure is that you may have missed providing input for a mandatory parameter.", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource\n Possible media types can be:- \n - application/json", + "key": "Content-Type", + "value": "Ut enim offici" + }, + { + "description": "(Required) To make use of the API, you require authorization. Raise a request to the administrator for the use of the API. You will receive the authorization key. Specify the key received, here.", + "key": "Authorization", + "value": "Ut enim offici" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"category\": {\n \"name\": \"Subject\",\n \"code\": \"subject\"\n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/framework/v1/category/create?framework=Ut enim offici", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "framework", + "v1", + "category", + "create" + ], + "query": [ + { + "key": "framework", + "value": "Ut enim offici" + } + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"api.category.create\",\n \"ver\": \"1.0\",\n \"ts\": \"2020-12-14T19:30:50.114Z\",\n \"params\": {\n \"resmsgid\": \"df5d7620-3e42-11eb-9ff3-67c41480f6aa\",\n \"msgid\": null,\n \"status\": \"failed\",\n \"err\": \"CONSTRAINT_VALIDATION_FAILED\",\n \"errmsg\": \"Object already exists with identifier: dummy_framework_subject\"\n },\n \"responseCode\": \"CLIENT_ERROR\",\n \"result\": {}\n}" + }, + { + "name": "INTERNAL SERVER ERROR ! Looks like something went wrong! These errors are tracked automatically, but if the problem persists feel free to contact us. In the meantime, try refreshing.", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource\n Possible media types can be:- \n - application/json", + "key": "Content-Type", + "value": "Ut enim offici" + }, + { + "description": "(Required) To make use of the API, you require authorization. Raise a request to the administrator for the use of the API. You will receive the authorization key. Specify the key received, here.", + "key": "Authorization", + "value": "Ut enim offici" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"category\": {\n \"name\": \"Subject\",\n \"code\": \"subject\"\n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/framework/v1/category/create?framework=Ut enim offici", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "framework", + "v1", + "category", + "create" + ], + "query": [ + { + "key": "framework", + "value": "Ut enim offici" + } + ] + } + }, + "status": "Internal Server Error", + "code": 500, + "_postman_previewlanguage": "text", + "header": [ + { + "key": "Content-Type", + "value": "text/plain" + } + ], + "cookie": [], + "body": "" + } + ] + }, { - "name": "Create a master category with invalid fields", + "name": "Create a framework term", "event": [ { - "listen": "test", + "listen": "prerequest", "script": { "exec": [ - "let jsonResponse = pm.response.json()\r", - "\r", - "pm.test(\"Status code is 400\", function () {\r", - " pm.response.to.have.status(400);\r", - "});\r", - "pm.test(\"Verify keys and data type of the response result\", () => {\r", - " pm.expect(jsonResponse.result).to.be.an(\"object\").that.has.all.keys(\r", - " 'messages'\r", - " );\r", - " pm.expect(jsonResponse.params).to.have.all.keys('resmsgid','msgid','status', 'err','errmsg');\r", - "pm.expect(jsonResponse.params.resmsgid).to.be.a(\"String\");\r", - "pm.expect(jsonResponse.params.msgid).to.be.a(\"null\");\r", - " pm.expect(jsonResponse.params.status).to.be.a(\"String\");\r", - " pm.expect(jsonResponse.params.err).to.be.a(\"String\");\r", - " pm.expect(jsonResponse.params.errmsg).to.be.a(\"String\");\r", - "});\r", - "\r", - "pm.test(\"err has string: CLIENT_ERROR\", function () {\r", - " pm.expect(jsonResponse.params.err).to.be.equal(\"CLIENT_ERROR\");\r", - "});\r", - "\r", - "pm.test(\"Status has string: failed\", function () {\r", - " pm.expect(jsonResponse.params.status).to.be.equal(\"failed\");\r", - "});\r", - "\r", - "pm.test(\"errmsg has string: Validation Errors\", function () {\r", - " pm.expect(jsonResponse.params.errmsg).to.be.equal(\"Validation Errors\");\r", - "});\r", - "\r", - "pm.test(\"Status code name has string: Bad Request\", function () {\r", - " pm.response.to.have.status(\"Bad Request\");\r", - "});\r", + "" + ], + "type": "text/javascript" + } + }, + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json()\r", + "pm.collectionVariables.set(\"term2_node\",jsonResponse.result.node_id);\r", + "console.log(pm.collectionVariables.get(\"term2_node\"));\r", "\r", - "pm.test(\"ResponseCode has string: CLIENT_ERROR\", function () {\r", - " pm.expect(jsonResponse.responseCode).to.be.equal(\"CLIENT_ERROR\");\r", + "pm.test(`identifier should be equal to ${pm.collectionVariables.get(\"term2_id\")}`, () => {\r", + " pm.expect(jsonResponse.result.identifier).to.eql(`${pm.collectionVariables.get(\"fw14_code\")}_${pm.collectionVariables.get(\"master16_code\")}_${pm.collectionVariables.get(\"t4_term\")}`);\r", "});\r", "\r", - "pm.test(\"Verify keys and data type of the response result\", () => {\r", - " pm.expect(jsonResponse.result).to.be.an(\"object\").that.has.all.keys(\r", - " 'messages'\r", - " );\r", - " pm.expect(jsonResponse.result.messages).to.be.an(\"array\").that.includes.members([\r", - " \"Required Metadata orgIdFieldName not set\",\r", - " \"Required Metadata code not set\"\r", - " ]);\r", + "pm.test(`node should be equal to ${pm.collectionVariables.get(\"term2_node\")}`, () => {\r", + " pm.expect(jsonResponse.result.node_id).to.eql(`${pm.collectionVariables.get(\"fw14_code\")}_${pm.collectionVariables.get(\"master16_code\")}_${pm.collectionVariables.get(\"t4_term\")}`);\r", "});\r", - "\r", - "\r", - "\r", "" ], "type": "text/javascript" @@ -6623,13 +21461,13 @@ "type": "apikey", "apikey": [ { - "key": "value", - "value": "{{auth_token}}", + "key": "key", + "value": "Authorization", "type": "string" }, { - "key": "key", - "value": "Authorization", + "key": "value", + "value": "{{apiKey}}", "type": "string" }, { @@ -6641,150 +21479,256 @@ }, "method": "POST", "header": [ - { - "key": "Accept", - "value": "application/json" - }, { "key": "Content-Type", "value": "application/json" }, { - "key": "X-Channel-Id", - "value": "{{X-Channel-Id}}" - }, - { - "key": "", - "value": "", - "disabled": true + "key": "Accept", + "value": "application/json" } ], "body": { "mode": "raw", - "raw": "{\n \"request\": {\n \"category\": {\n \"name\": \"class\",\n \"code\": \"\",\n \"description\": \"\",\n \"targetIdFieldName\": \"targetclassIds\",\n \"searchLabelFieldName\": \"se_class\",\n \"searchIdFieldName\": \"se_class\",\n \"orgIdFieldName\": \"\"\n }\n }\n}" + "raw": "{\n \"request\": {\n \"term\": {\n \"code\": \"{{t4_term}}\",\n \"name\": \"English\"\n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } }, "url": { - "raw": "{{host}}/framework/v3/category/master/create", + "raw": "{{baseUrl}}/framework/v3/term/create?framework={{fw14_code}}&category={{master16_code}}", "host": [ - "{{host}}" + "{{baseUrl}}" ], "path": [ "framework", "v3", - "category", - "master", + "term", "create" + ], + "query": [ + { + "key": "framework", + "value": "{{fw14_code}}", + "description": "(Required) Represents the framework in which the term is to be created" + }, + { + "key": "category", + "value": "{{master16_code}}", + "description": "(Required) Represents the category in which the term is to be created" + } ] - } + }, + "description": "This API is associated with creating a term under a framework category\n - The endpoint for **Create Term** is `/framework/v1/term/create`\n - It points to knowledge-mw-service - `/v1/framework/term/create`\n - The fields marked with an asterisk (*) are mandatory. They cannot be null or empty.\"" }, - "response": [] - }, - { - "name": "Create master category with missing mandatory fields", - "event": [ + "response": [ { - "listen": "test", - "script": { - "exec": [ - "let jsonResponse = pm.response.json()\r", - "\r", - "pm.test(\"Status code is 400\", function () {\r", - " pm.response.to.have.status(400);\r", - "});\r", - "pm.test(\"Verify keys and data type of the response result\", () => {\r", - " pm.expect(jsonResponse.result).to.be.an(\"object\").that.has.all.keys(\r", - " 'messages'\r", - " );\r", - " pm.expect(jsonResponse.params).to.have.all.keys('resmsgid','msgid','status', 'err','errmsg');\r", - "pm.expect(jsonResponse.params.resmsgid).to.be.a(\"String\");\r", - "pm.expect(jsonResponse.params.msgid).to.be.a(\"null\");\r", - " pm.expect(jsonResponse.params.status).to.be.a(\"String\");\r", - " pm.expect(jsonResponse.params.err).to.be.a(\"String\");\r", - " pm.expect(jsonResponse.params.errmsg).to.be.a(\"String\");\r", - "});\r", - "\r", - "pm.test(\"err has string\", function () {\r", - " pm.expect(jsonResponse.params.err).to.be.equal(\"CLIENT_ERROR\");\r", - "});\r", - "\r", - "pm.test(\"Status has string\", function () {\r", - " pm.expect(jsonResponse.params.status).to.be.equal(\"failed\");\r", - "});\r", - "\r", - "pm.test(\"errmsg has string\", function () {\r", - " pm.expect(jsonResponse.params.errmsg).to.be.equal(\"Validation Errors\");\r", - "});\r", - "\r", - "pm.test(\"Status code name has string: Bad Request\", function () {\r", - " pm.response.to.have.status(\"Bad Request\");\r", - "});\r", - "\r", - "pm.test(\"ResponseCode has string: CLIENT_ERROR\", function () {\r", - " pm.expect(jsonResponse.responseCode).to.be.equal(\"CLIENT_ERROR\");\r", - "});\r", - "\r", - "pm.test(\"Verify keys and data type of the response result\", () => {\r", - " pm.expect(jsonResponse.result).to.be.an(\"object\").that.has.all.keys(\r", - " 'messages'\r", - " );\r", - " pm.expect(jsonResponse.result.messages).to.be.an(\"array\").that.includes.members([\r", - " \"Required Metadata searchLabelFieldName not set\",\r", - " \"Required Metadata searchIdFieldName not set\",\r", - " \"Required Metadata targetIdFieldName not set\",\r", - " \"Required Metadata orgIdFieldName not set\"\r", - " ]);\r", - "});\r", - "\r", - "\r", - "\r", - "" + "name": "OK ! Successful operation.\"create term\" operation was successfully executed.", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource.\n Possible media types can be:- \n - application/json", + "key": "Content-Type", + "value": "Ut enim offici" + }, + { + "description": "(Required) To make use of the API, you require authorization. Raise a request to the administrator for the use of the API. You will receive the authorization key. Specify the key received, here.", + "key": "Authorization", + "value": "Ut enim offici" + } ], - "type": "text/javascript" - } - } - ], - "request": { - "method": "POST", - "header": [ - { - "key": "user-id", - "value": "rayuluv" - }, - { - "key": "Content-Type", - "value": "application/json" + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"term\": {\n \"code\": \"english\",\n \"name\": \"English\"\n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/framework/v1/term/create?framework=Ut enim offici&category=Ut enim offici", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "framework", + "v1", + "term", + "create" + ], + "query": [ + { + "key": "framework", + "value": "Ut enim offici" + }, + { + "key": "category", + "value": "Ut enim offici" + } + ] + } }, - { - "key": "X-Channel-Id", - "value": "in.ekstep" + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"api.term.create\",\n \"ver\": \"1.0\",\n \"ts\": \"2020-12-14T19:44:02.348Z\",\n \"params\": {\n \"resmsgid\": \"b792c6c0-3e44-11eb-9ff3-67c41480f6aa\",\n \"msgid\": \"b783f9b0-3e44-11eb-9ff3-67c41480f6aa\",\n \"status\": \"successful\",\n \"err\": null,\n \"errmsg\": null\n },\n \"responseCode\": \"OK\",\n \"result\": {\n \"node_id\": [\n \"dummy_framework_subject_english\"\n ]\n }\n}" + }, + { + "name": "BAD REQUEST. The \"create term\" operation failed ! The possible reason for failure is that you may have missed providing input for a mandatory parameter.", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource.\n Possible media types can be:- \n - application/json", + "key": "Content-Type", + "value": "Ut enim offici" + }, + { + "description": "(Required) To make use of the API, you require authorization. Raise a request to the administrator for the use of the API. You will receive the authorization key. Specify the key received, here.", + "key": "Authorization", + "value": "Ut enim offici" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"term\": {\n \"code\": \"english\",\n \"name\": \"English\"\n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/framework/v1/term/create?framework=Ut enim offici&category=Ut enim offici", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "framework", + "v1", + "term", + "create" + ], + "query": [ + { + "key": "framework", + "value": "Ut enim offici" + }, + { + "key": "category", + "value": "Ut enim offici" + } + ] + } }, - { - "key": "Authorization", - "value": "Bearer {{api_key}}" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"request\": {\n \"category\": {\n \"name\": \"Class\",\n \"code\": \"Class\"\n }\n }\n}" + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"api.term.create\",\n \"ver\": \"1.0\",\n \"ts\": \"2020-12-14T19:44:49.263Z\",\n \"params\": {\n \"resmsgid\": \"d3896ff0-3e44-11eb-9ff3-67c41480f6aa\",\n \"msgid\": null,\n \"status\": \"failed\",\n \"err\": \"ERR_INVALID_CATEGORY_ID\",\n \"errmsg\": \"Please provide valid category.\"\n },\n \"responseCode\": \"CLIENT_ERROR\",\n \"result\": {}\n}" }, - "url": { - "raw": "{{host}}/framework/v3/category/master/create", - "host": [ - "{{host}}" + { + "name": "INTERNAL SERVER ERROR ! Looks like something went wrong! These errors are tracked automatically, but if the problem persists feel free to contact us. In the meantime, try refreshing.", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) The Content Type entity is the media type of the resource.\n Possible media types can be:- \n - application/json", + "key": "Content-Type", + "value": "Ut enim offici" + }, + { + "description": "(Required) To make use of the API, you require authorization. Raise a request to the administrator for the use of the API. You will receive the authorization key. Specify the key received, here.", + "key": "Authorization", + "value": "Ut enim offici" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {\n \"term\": {\n \"code\": \"english\",\n \"name\": \"English\"\n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/framework/v1/term/create?framework=Ut enim offici&category=Ut enim offici", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "framework", + "v1", + "term", + "create" + ], + "query": [ + { + "key": "framework", + "value": "Ut enim offici" + }, + { + "key": "category", + "value": "Ut enim offici" + } + ] + } + }, + "status": "Internal Server Error", + "code": 500, + "_postman_previewlanguage": "text", + "header": [ + { + "key": "Content-Type", + "value": "text/plain" + } ], - "path": [ - "framework", - "v3", - "category", - "master", - "create" - ] + "cookie": [], + "body": "" } - }, - "response": [] - }, + ] + } + ], + "description": "1. Framework name and code should be updated before each run\n2. Framework categroy should be a subset of master category, i.e., framework category can be created only when it is available in master category\n \n3. Create a master category with same indentifier before creating the framework category" + }, + { + "name": "Positive", + "item": [ { - "name": "Create existing category", + "name": "Delete term for valid framework and valid framework category", "event": [ { "listen": "test", @@ -6792,192 +21736,264 @@ "exec": [ "let jsonResponse = pm.response.json()\r", "\r", - "pm.test(\"Status code is 400\", function () {\r", - " pm.response.to.have.status(400);\r", + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "pm.test(\"id has string - api.taxonomy.term.retire\", function () {\r", + " pm.expect(jsonResponse.id).to.be.equal(\"api.taxonomy.term.retire\");\r", + "});\r", + "pm.test(\"Version is 3.0 \", function () {\r", + " pm.expect(jsonResponse.ver).to.be.equal(\"3.0\");\r", "});\r", "pm.test(\"Verify keys and data type of the response result\", () => {\r", - " pm.expect(jsonResponse.result).to.be.an(\"object\").that.has.all.keys(\r", - " 'messages'\r", - " );\r", " pm.expect(jsonResponse.params).to.have.all.keys('resmsgid','msgid','status', 'err','errmsg');\r", "pm.expect(jsonResponse.params.resmsgid).to.be.a(\"String\");\r", "pm.expect(jsonResponse.params.msgid).to.be.a(\"null\");\r", " pm.expect(jsonResponse.params.status).to.be.a(\"String\");\r", - " pm.expect(jsonResponse.params.err).to.be.a(\"String\");\r", - " pm.expect(jsonResponse.params.errmsg).to.be.a(\"String\");\r", - "});\r", - "\r", - "pm.test(\"err has string\", function () {\r", - " pm.expect(jsonResponse.params.err).to.be.equal(\"CONSTRAINT_VALIDATION_FAILED\");\r", + " pm.expect(jsonResponse.params.err).to.be.a(\"null\");\r", + " pm.expect(jsonResponse.params.errmsg).to.be.a(\"null\");\r", "});\r", "\r", - "pm.test(\"Status has string\", function () {\r", - " pm.expect(jsonResponse.params.status).to.be.equal(\"failed\");\r", + "pm.test(\"Status has string \", function () {\r", + " pm.expect(jsonResponse.params.status).to.be.equal(\"successful\");\r", "});\r", "\r", - "pm.test(\"errmsg has string\", function () {\r", - " pm.expect(jsonResponse.params.errmsg).to.be.include(\"Object already exists with identifier:\");\r", + "pm.test(\"Verify keys and data type of the response result\", () => {\r", + " pm.expect(jsonResponse.result).to.have.all.keys('identifier', 'versionKey');\r", + " pm.expect(jsonResponse.result.identifier).to.be.a(\"String\");\r", + " pm.expect(jsonResponse.result.versionKey).to.be.a(\"string\");\r", "});\r", "\r", - "pm.test(\"Status code name has string: Bad Request\", function () {\r", - " pm.response.to.have.status(\"Bad Request\");\r", - "});\r", + "pm.collectionVariables.set(\"del_term_id\",jsonResponse.result.identifier);\r", + "console.log(pm.collectionVariables.get(\"del_term_id\"));\r", "\r", - "pm.test(\"ResponseCode has string: CLIENT_ERROR\", function () {\r", - " pm.expect(jsonResponse.responseCode).to.be.equal(\"CLIENT_ERROR\");\r", - "});\r", - "" + "pm.test(`identifier should be equal to ${pm.collectionVariables.get(\"del_term_id\")}`, () => {\r", + " pm.expect(jsonResponse.result.identifier).to.eql(`${pm.collectionVariables.get(\"fw14_code\")}_${pm.collectionVariables.get(\"master16_code\")}_${pm.collectionVariables.get(\"t4_term\")}`);\r", + "});" ], "type": "text/javascript" } } ], "request": { - "method": "POST", + "method": "DELETE", "header": [ - { - "key": "user-id", - "value": "rayuluv" - }, { "key": "Content-Type", "value": "application/json" }, { "key": "X-Channel-Id", - "value": "in.ekstep" - }, - { - "key": "Authorization", - "value": "Bearer {{api_key}}" + "value": "{{X-Channel-Id}}" } ], - "body": { - "mode": "raw", - "raw": "{\n \"request\": {\n \"category\": {\n \"name\": \"class\",\n \"code\": \"class\",\n \"description\": \"class description\",\n \"targetIdFieldName\": \"targetclassIds\",\n \"searchLabelFieldName\": \"se_class\",\n \"searchIdFieldName\": \"se_class\",\n \"orgIdFieldName\": \"se_class\"\n }\n }\n}" - }, "url": { - "raw": "{{host}}/framework/v3/category/master/create", + "raw": "{{host}}/framework/v3/term/retire/{{t4_term}}?framework={{fw14_code}}&category={{master16_code}}", "host": [ "{{host}}" ], "path": [ "framework", "v3", - "category", - "master", - "create" + "term", + "retire", + "{{t4_term}}" + ], + "query": [ + { + "key": "framework", + "value": "{{fw14_code}}" + }, + { + "key": "category", + "value": "{{master16_code}}" + } ] - } + }, + "description": "This API is associated with searching the existing terms under a category in a framework on Sunbird Platform\n - The endpoint for **Search Term** is `/framework/v1/term/search`\n - It points to knowledge-mw-service - `/v1/framework/term/search`\n - The fields marked with an asterisk (*) are mandatory. They cannot be null or empty." }, - "response": [] - } - ], - "description": "1. Third scenario, existing details should be updated in request body" - } - ] - }, - { - "name": "Update Master category", - "item": [ - { - "name": "Positive", - "item": [ - { - "name": "Update details for existing master category with valid fields", - "event": [ + "response": [ { - "listen": "test", - "script": { - "exec": [ - "let jsonResponse = pm.response.json()\r", - "\r", - "pm.test(\"Status code is 200\", function () {\r", - " pm.response.to.have.status(200);\r", - "});\r", - "\r", - "pm.test(\"Verify keys and data type of the response result\", () => {\r", - " pm.expect(jsonResponse.params).to.have.all.keys('resmsgid','msgid','status', 'err','errmsg');\r", - " pm.expect(jsonResponse.params.msgid).to.be.a(\"null\"); \r", - " pm.expect(jsonResponse.params.status).to.be.a(\"String\");\r", - " pm.expect(jsonResponse.params.err).to.be.a(\"null\");\r", - " pm.expect(jsonResponse.params.errmsg).to.be.a(\"null\");\r", - "});\r", - "\r", - "pm.test(\"Status has string \", function () {\r", - " pm.expect(jsonResponse.params.status).to.be.equal(\"successful\");\r", - "});\r", - "\r", - "pm.test(\"Verify keys and data type of the response result\", () => {\r", - " pm.expect(jsonResponse.result).to.have.all.keys('identifier','node_id');\r", - " pm.expect(jsonResponse.result.node_id).to.be.a('String');\r", - " pm.expect(jsonResponse.result.identifier).to.be.a('String');\r", - "});\r", - "\r", - "\r", - "\r", - "" + "name": "OK ! Successful operation.\"Search term operation was successfully executed.", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) To make use of the API, you require authorization. Raise a request to the administrator for the use of the API. You will receive the authorization key. Specify the key received, here.", + "key": "Authorization", + "value": "Ut enim offici" + } ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "apikey", - "apikey": [ - { - "key": "value", - "value": "{{auth_token}}", - "type": "string" - }, - { - "key": "key", - "value": "Authorization", - "type": "string" + "body": { + "mode": "raw", + "raw": "{\n \"request\": {}\n}", + "options": { + "raw": { + "language": "json" + } + } }, + "url": { + "raw": "{{baseUrl}}/framework/v1/term/search?framework=Ut enim offici&category=Ut enim offici", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "framework", + "v1", + "term", + "search" + ], + "query": [ + { + "key": "framework", + "value": "Ut enim offici" + }, + { + "key": "category", + "value": "Ut enim offici" + } + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ { - "key": "in", - "value": "header", - "type": "string" + "key": "Content-Type", + "value": "application/json" } - ] + ], + "cookie": [], + "body": "{\n \"id\": \"api.term.search\",\n \"ver\": \"1.0\",\n \"ts\": \"2020-12-17T08:12:44.816Z\",\n \"params\": {\n \"resmsgid\": \"a446e900-403f-11eb-9b0c-abcfbdf41bc3\",\n \"msgid\": \"a4447800-403f-11eb-9b0c-abcfbdf41bc3\",\n \"status\": \"successful\",\n \"err\": null,\n \"errmsg\": null\n },\n \"responseCode\": \"OK\",\n \"result\": {\n \"terms\": [\n {\n \"associations\": [],\n \"identifier\": \"dummy_framework_subject_english\",\n \"lastStatusChangedOn\": \"2020-12-14T19:44:02.260+0000\",\n \"code\": \"english\",\n \"consumerId\": \"7411b6bd-89f3-40ec-98d1-229dc64ce77d\",\n \"channel\": \"in.ekstep\",\n \"description\": \"English\",\n \"createdOn\": \"2020-12-14T19:44:02.260+0000\",\n \"versionKey\": \"1607975299669\",\n \"children\": [],\n \"appId\": \"dev.sunbird.portal\",\n \"name\": \"English\",\n \"lastUpdatedOn\": \"2020-12-14T19:48:19.669+0000\",\n \"categories\": [\n {\n \"identifier\": \"dummy_framework_subject\",\n \"name\": \"Subject\",\n \"objectType\": \"CategoryInstance\",\n \"relation\": \"hasSequenceMember\",\n \"description\": \"Updated description\",\n \"status\": \"Live\"\n }\n ],\n \"category\": \"subject\",\n \"status\": \"Live\"\n }\n ],\n \"count\": 1\n }\n}" }, - "method": "PATCH", - "header": [ - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "Accept", - "value": "application/json" + { + "name": "BAD REQUEST. The \"search term\" operation failed ! The possible reason for failure is that you may have missed providing input for a mandatory parameter.", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) To make use of the API, you require authorization. Raise a request to the administrator for the use of the API. You will receive the authorization key. Specify the key received, here.", + "key": "Authorization", + "value": "Ut enim offici" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {}\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/framework/v1/term/search?framework=Ut enim offici&category=Ut enim offici", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "framework", + "v1", + "term", + "search" + ], + "query": [ + { + "key": "framework", + "value": "Ut enim offici" + }, + { + "key": "category", + "value": "Ut enim offici" + } + ] + } }, - { - "key": "X-Channel-Id", - "value": "{{X-Channel-Id}}" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"request\": {\n \"category\":{\n \"Description\":\"Description of class category\"\n }\n }\n}" + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"id\": \"api.term.search\",\n \"ver\": \"1.0\",\n \"ts\": \"2020-12-17T08:13:50.811Z\",\n \"params\": {\n \"resmsgid\": \"cb9cf2b0-403f-11eb-9b0c-abcfbdf41bc3\",\n \"msgid\": null,\n \"status\": \"failed\",\n \"err\": \"ERR_INVALID_CATEGORY_ID\",\n \"errmsg\": \"Please provide valid category.\"\n },\n \"responseCode\": \"CLIENT_ERROR\",\n \"result\": {}\n}" }, - "url": { - "raw": "{{host}}/framework/v3/category/master/update/{{node_id1}}", - "host": [ - "{{host}}" + { + "name": "INTERNAL SERVER ERROR ! Looks like something went wrong! These errors are tracked automatically, but if the problem persists feel free to contact us. In the meantime, try refreshing.", + "originalRequest": { + "method": "POST", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Authorization", + "value": "" + }, + { + "description": "(Required) To make use of the API, you require authorization. Raise a request to the administrator for the use of the API. You will receive the authorization key. Specify the key received, here.", + "key": "Authorization", + "value": "Ut enim offici" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"request\": {}\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/framework/v1/term/search?framework=Ut enim offici&category=Ut enim offici", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "framework", + "v1", + "term", + "search" + ], + "query": [ + { + "key": "framework", + "value": "Ut enim offici" + }, + { + "key": "category", + "value": "Ut enim offici" + } + ] + } + }, + "status": "Internal Server Error", + "code": 500, + "_postman_previewlanguage": "text", + "header": [ + { + "key": "Content-Type", + "value": "text/plain" + } ], - "path": [ - "framework", - "v3", - "category", - "master", - "update", - "{{node_id1}}" - ] + "cookie": [], + "body": "" } - }, - "response": [] + ] } ] }, @@ -6985,7 +22001,7 @@ "name": "Negative", "item": [ { - "name": "Update details for invalid master category", + "name": "Delete invalid term for valid framework and valid framework category", "event": [ { "listen": "test", @@ -6996,113 +22012,43 @@ "pm.test(\"Status code is 404\", function () {\r", " pm.response.to.have.status(404);\r", "});\r", - "\r", - "pm.test(\"Status code name has string\", function () {\r", - " pm.response.to.have.status(\"Not Found\");\r", + "pm.test(\"id has string - api.taxonomy.term.retire\", function () {\r", + " pm.expect(jsonResponse.id).to.be.equal(\"api.taxonomy.term.retire\");\r", + "});\r", + "pm.test(\"Version is 3.0 \", function () {\r", + " pm.expect(jsonResponse.ver).to.be.equal(\"3.0\");\r", "});\r", - "\r", "pm.test(\"Verify keys and data type of the response result\", () => {\r", - " pm.expect(jsonResponse.params).to.have.all.keys('resmsgid','msgid','err','status','errmsg');\r", - " pm.expect(jsonResponse.params.resmsgid).to.be.a(\"String\");\r", - " pm.expect(jsonResponse.params.msgid).to.be.a(\"null\");\r", - " pm.expect(jsonResponse.params.err).to.be.a(\"String\");\r", + " pm.expect(jsonResponse.params).to.have.all.keys('resmsgid','msgid','status', 'err','errmsg');\r", + "pm.expect(jsonResponse.params.resmsgid).to.be.a(\"String\");\r", + "pm.expect(jsonResponse.params.msgid).to.be.a(\"null\");\r", " pm.expect(jsonResponse.params.status).to.be.a(\"String\");\r", - " pm.expect(jsonResponse.params.errmsg).to.be.a(\"String\");\r", - " });\r", - "\r", - "pm.test(\"Err has string\", function () {\r", - " pm.expect(jsonResponse.params.err).to.be.equal(\"NOT_FOUND\");\r", - "});\r", - "pm.test(\"Status has string\", function () {\r", - " pm.expect(jsonResponse.params.status).to.be.equal(\"failed\");\r", - "});\r", - "pm.test(\"errmsg has string\", function () {\r", - " pm.expect(jsonResponse.params.errmsg).to.be.include(\"Error! Node(s) doesn't Exists. | [Invalid Node Id.]: \");\r", - "});\r", - "pm.test(\"responseCode has string\", function () {\r", - " pm.expect(jsonResponse.responseCode).to.be.equal(\"RESOURCE_NOT_FOUND\");\r", - "});\r", - "\r", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "method": "PATCH", - "header": [ - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "Accept", - "value": "application/json" - }, - { - "key": "X-Channel-Id", - "value": "sunbird" - }, - { - "key": "Authorization", - "value": "{{auth_token}}" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"request\": {\n \"category\":{\n \"Description\":\"Description of class category\"\n }\n }\n}" - }, - "url": { - "raw": "{{host}}/framework/v3/category/master/update/abc", - "host": [ - "{{host}}" - ], - "path": [ - "framework", - "v3", - "category", - "master", - "update", - "abc" - ] + " pm.expect(jsonResponse.params.err).to.be.a(\"String\");\r", + " pm.expect(jsonResponse.params.errmsg).to.be.a(\"String\");\r", + "});\r", + "\r", + "pm.test(\"Status has string \", function () {\r", + " pm.expect(jsonResponse.params.status).to.be.equal(\"failed\");\r", + "});\r", + "\r", + "pm.test(\"err has string \", function () {\r", + " pm.expect(jsonResponse.params.err).to.be.equal(\"NOT_FOUND\");\r", + "});\r", + "\r", + "pm.test(`errmsg has string: Error! Node(s) doesn't Exists. | [Invalid Node Id.]: ${pm.collectionVariables.get(\"fw14_code\")}_${pm.collectionVariables.get(\"master16_code\")}_dummy`, function () {\r", + " pm.expect(jsonResponse.params.errmsg).to.eql(`Error! Node(s) doesn't Exists. | [Invalid Node Id.]: ${pm.collectionVariables.get(\"fw14_code\")}_${pm.collectionVariables.get(\"master16_code\")}_dummy`);\r", + "});\r", + "\r", + "pm.test(\"responseCode has string \", function () {\r", + " pm.expect(jsonResponse.responseCode).to.be.include(\"RESOURCE_NOT_FOUND\");\r", + "});\r", + "" + ], + "type": "text/javascript" + } } - }, - "response": [] - } - ] - } - ] - }, - { - "name": "Delete Master category", - "item": [ - { - "name": "Positive", - "item": [ - { - "name": "Delete a valid master category", + ], "request": { - "auth": { - "type": "apikey", - "apikey": [ - { - "key": "value", - "value": "{{auth_token}}", - "type": "string" - }, - { - "key": "key", - "value": "Authorization", - "type": "string" - }, - { - "key": "in", - "value": "header", - "type": "string" - } - ] - }, "method": "DELETE", "header": [ { @@ -7111,37 +22057,37 @@ }, { "key": "X-Channel-Id", - "value": "{{X-Channel-Id}}" - }, - { - "key": "Accept", - "value": "application/json" + "value": "sunbird" } ], "url": { - "raw": "{{host}}/framework/v3/category/master/retire/{{node_id}}", + "raw": "{{host}}/framework/v3/term/retire/dummy?framework={{fw14_code}}&category={{master16_code}}", "host": [ "{{host}}" ], "path": [ "framework", "v3", - "category", - "master", + "term", "retire", - "{{node_id}}" + "dummy" + ], + "query": [ + { + "key": "framework", + "value": "{{fw14_code}}" + }, + { + "key": "category", + "value": "{{master16_code}}" + } ] } }, "response": [] - } - ] - }, - { - "name": "Negative", - "item": [ + }, { - "name": "Delete an invalid master category", + "name": "Delete valid term for invalid framework and invalid framework category", "event": [ { "listen": "test", @@ -7152,33 +22098,36 @@ "pm.test(\"Status code is 404\", function () {\r", " pm.response.to.have.status(404);\r", "});\r", - "\r", - "pm.test(\"Status code name has string\", function () {\r", - " pm.response.to.have.status(\"Not Found\");\r", + "pm.test(\"id has string - api.taxonomy.term.retire\", function () {\r", + " pm.expect(jsonResponse.id).to.be.equal(\"api.taxonomy.term.retire\");\r", + "});\r", + "pm.test(\"Version is 3.0 \", function () {\r", + " pm.expect(jsonResponse.ver).to.be.equal(\"3.0\");\r", "});\r", - "\r", "pm.test(\"Verify keys and data type of the response result\", () => {\r", - " pm.expect(jsonResponse.params).to.have.all.keys('resmsgid','msgid','err','status','errmsg');\r", - " pm.expect(jsonResponse.params.resmsgid).to.be.a(\"String\");\r", - " pm.expect(jsonResponse.params.msgid).to.be.a(\"null\");\r", - " pm.expect(jsonResponse.params.err).to.be.a(\"String\");\r", + " pm.expect(jsonResponse.params).to.have.all.keys('resmsgid','msgid','status', 'err','errmsg');\r", + "pm.expect(jsonResponse.params.resmsgid).to.be.a(\"String\");\r", + "pm.expect(jsonResponse.params.msgid).to.be.a(\"null\");\r", " pm.expect(jsonResponse.params.status).to.be.a(\"String\");\r", + " pm.expect(jsonResponse.params.err).to.be.a(\"String\");\r", " pm.expect(jsonResponse.params.errmsg).to.be.a(\"String\");\r", - " });\r", - "\r", - "pm.test(\"Err has string\", function () {\r", - " pm.expect(jsonResponse.params.err).to.be.equal(\"NOT_FOUND\");\r", "});\r", - "pm.test(\"Status has string\", function () {\r", + "\r", + "pm.test(\"Status has string \", function () {\r", " pm.expect(jsonResponse.params.status).to.be.equal(\"failed\");\r", "});\r", - "pm.test(\"errmsg has string\", function () {\r", - " pm.expect(jsonResponse.params.errmsg).to.be.include(\"Error! Node(s) doesn't Exists. | [Invalid Node Id.]: \");\r", + "\r", + "pm.test(\"err has string \", function () {\r", + " pm.expect(jsonResponse.params.err).to.be.equal(\"NOT_FOUND\");\r", "});\r", - "pm.test(\"responseCode has string\", function () {\r", - " pm.expect(jsonResponse.responseCode).to.be.equal(\"RESOURCE_NOT_FOUND\");\r", + "\r", + "pm.test(`errmsg has string: Error! Node(s) doesn't Exists. | [Invalid Node Id.]: dummy_dummy_${pm.collectionVariables.get(\"t4_term\")}`, function () {\r", + " pm.expect(jsonResponse.params.errmsg).to.eql(`Error! Node(s) doesn't Exists. | [Invalid Node Id.]: dummy_dummy_${pm.collectionVariables.get(\"t4_term\")}`);\r", "});\r", "\r", + "pm.test(\"responseCode has string \", function () {\r", + " pm.expect(jsonResponse.responseCode).to.be.include(\"RESOURCE_NOT_FOUND\");\r", + "});\r", "" ], "type": "text/javascript" @@ -7186,26 +22135,6 @@ } ], "request": { - "auth": { - "type": "apikey", - "apikey": [ - { - "key": "value", - "value": "{{auth_token}}", - "type": "string" - }, - { - "key": "key", - "value": "Authorization", - "type": "string" - }, - { - "key": "in", - "value": "header", - "type": "string" - } - ] - }, "method": "DELETE", "header": [ { @@ -7215,362 +22144,1743 @@ { "key": "X-Channel-Id", "value": "{{X-Channel-Id}}" - }, - { - "key": "Accept", - "value": "application/json" - }, - { - "key": "", - "value": "", - "disabled": true } ], "url": { - "raw": "{{host}}/framework/v3/category/master/retire/abc", + "raw": "{{host}}/framework/v3/term/retire/{{t4_term}}?framework=dummy&category=dummy", "host": [ "{{host}}" ], "path": [ "framework", "v3", - "category", - "master", + "term", "retire", - "abc" + "{{t4_term}}" + ], + "query": [ + { + "key": "framework", + "value": "dummy" + }, + { + "key": "category", + "value": "dummy" + } ] } }, - "response": [] + "response": [] + } + ] + } + ] + }, + { + "name": "Delete data", + "item": [ + { + "name": "Delete master category", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json()\r", + "\r", + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "pm.collectionVariables.set(\"master13_node\",jsonResponse.result.node_id);\r", + "console.log(pm.collectionVariables.get(\"master13_node\"));\r", + "\r", + "pm.collectionVariables.set(\"master13_id\",jsonResponse.result.node_id);\r", + "console.log(pm.collectionVariables.get(\"master13_id\"));\r", + "\r", + "pm.test(`identifier should be equal to ${pm.collectionVariables.get(\"master13_id\")}`, () => {\r", + " pm.expect(jsonResponse.result.identifier).to.eql(`${pm.collectionVariables.get(\"master13_code\")}`);\r", + "});\r", + "\r", + "pm.test(`node_id should be equal to ${pm.collectionVariables.get(\"master13_node\")}`, () => {\r", + " pm.expect(jsonResponse.result.node_id).to.eql(`${pm.collectionVariables.get(\"master13_code\")}`);\r", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "apikey", + "apikey": [ + { + "key": "value", + "value": "{{auth_token}}", + "type": "string" + }, + { + "key": "key", + "value": "Authorization", + "type": "string" + }, + { + "key": "in", + "value": "header", + "type": "string" + } + ] + }, + "method": "DELETE", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "X-Channel-Id", + "value": "{{X-Channel-Id}}" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "url": { + "raw": "{{host}}/framework/v3/category/master/retire/{{master13_code}}", + "host": [ + "{{host}}" + ], + "path": [ + "framework", + "v3", + "category", + "master", + "retire", + "{{master13_code}}" + ] + } + }, + "response": [] + }, + { + "name": "Delete framework", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json()\r", + "\r", + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "\r", + "pm.collectionVariables.set(\"fw11_node\",jsonResponse.result.node_id);\r", + "console.log(pm.collectionVariables.get(\"fw11_node\"));\r", + "\r", + "pm.test(`node id should be equal to ${pm.collectionVariables.get(\"fw11_node\")}`, () => {\r", + " pm.expect(jsonResponse.result.node_id).to.eql(pm.collectionVariables.get(\"fw11_code\"));\r", + "});\r", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "apikey", + "apikey": [ + { + "key": "in", + "value": "header", + "type": "string" + }, + { + "key": "value", + "value": "{{auth_token}}", + "type": "string" + }, + { + "key": "key", + "value": "Authorization", + "type": "string" + } + ] + }, + "method": "DELETE", + "header": [ + { + "key": "X-Channel-Id", + "value": "{{X-Channel-Id}}", + "type": "text" + }, + { + "key": "Accept", + "value": "application/json", + "type": "text" + }, + { + "key": "Content-Type", + "value": "application/json", + "type": "text" + } + ], + "url": { + "raw": "{{host}}/framework/v3/retire/{{fw11_code}}", + "host": [ + "{{host}}" + ], + "path": [ + "framework", + "v3", + "retire", + "{{fw11_code}}" + ] + } + }, + "response": [] + }, + { + "name": "Delete framework category", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json()\r", + "\r", + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "\r", + "pm.collectionVariables.set(\"del_fw_catgry1\",jsonResponse.result.identifier);\r", + "console.log(pm.collectionVariables.get(\"del_fw_catgry1\"));\r", + "\r", + "pm.test(`identifier should be equal to ${pm.collectionVariables.get(\"del_fw_catgry1\")}`, () => {\r", + " pm.expect(jsonResponse.result.identifier).to.eql(`${pm.collectionVariables.get(\"fw11_code\")}_${pm.collectionVariables.get(\"master13_code\")}`);\r", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "DELETE", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "X-Channel-Id", + "value": "sunbird" + } + ], + "url": { + "raw": "{{host}}/framework/v3/category/retire/{{master13_code}}?framework={{fw11_code}}", + "host": [ + "{{host}}" + ], + "path": [ + "framework", + "v3", + "category", + "retire", + "{{master13_code}}" + ], + "query": [ + { + "key": "framework", + "value": "{{fw11_code}}" + } + ] + } + }, + "response": [] + }, + { + "name": "Delete term", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json()\r", + "\r", + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "pm.test(\"id has string - api.taxonomy.term.retire\", function () {\r", + " pm.expect(jsonResponse.id).to.be.equal(\"api.taxonomy.term.retire\");\r", + "});\r", + "pm.test(\"Version is 3.0 \", function () {\r", + " pm.expect(jsonResponse.ver).to.be.equal(\"3.0\");\r", + "});\r", + "pm.test(\"Verify keys and data type of the response result\", () => {\r", + " pm.expect(jsonResponse.params).to.have.all.keys('resmsgid','msgid','status', 'err','errmsg');\r", + "pm.expect(jsonResponse.params.resmsgid).to.be.a(\"String\");\r", + "pm.expect(jsonResponse.params.msgid).to.be.a(\"null\");\r", + " pm.expect(jsonResponse.params.status).to.be.a(\"String\");\r", + " pm.expect(jsonResponse.params.err).to.be.a(\"null\");\r", + " pm.expect(jsonResponse.params.errmsg).to.be.a(\"null\");\r", + "});\r", + "\r", + "pm.test(\"Status has string \", function () {\r", + " pm.expect(jsonResponse.params.status).to.be.equal(\"successful\");\r", + "});\r", + "\r", + "pm.test(\"Verify keys and data type of the response result\", () => {\r", + " pm.expect(jsonResponse.result).to.have.all.keys('identifier', 'versionKey');\r", + " pm.expect(jsonResponse.result.identifier).to.be.a(\"String\");\r", + " pm.expect(jsonResponse.result.versionKey).to.be.a(\"string\");\r", + "});\r", + "\r", + "pm.collectionVariables.set(\"del_term_id1\",jsonResponse.result.identifier);\r", + "console.log(pm.collectionVariables.get(\"del_term_id1\"));\r", + "\r", + "pm.test(`identifier should be equal to ${pm.collectionVariables.get(\"del_term_id1\")}`, () => {\r", + " pm.expect(jsonResponse.result.identifier).to.eql(`${pm.collectionVariables.get(\"fw11_code\")}_${pm.collectionVariables.get(\"master13_code\")}_${pm.collectionVariables.get(\"t1_term\")}`);\r", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "DELETE", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "X-Channel-Id", + "value": "{{X-Channel-Id}}" + } + ], + "url": { + "raw": "{{host}}/framework/v3/term/retire/{{t1_term}}?framework={{fw11_code}}&category={{master13_code}}", + "host": [ + "{{host}}" + ], + "path": [ + "framework", + "v3", + "term", + "retire", + "{{t1_term}}" + ], + "query": [ + { + "key": "framework", + "value": "{{fw11_code}}" + }, + { + "key": "category", + "value": "{{master13_code}}" + } + ] + }, + "description": "This API is associated with searching the existing terms under a category in a framework on Sunbird Platform\n - The endpoint for **Search Term** is `/framework/v1/term/search`\n - It points to knowledge-mw-service - `/v1/framework/term/search`\n - The fields marked with an asterisk (*) are mandatory. They cannot be null or empty." + }, + "response": [] + }, + { + "name": "Delete master category", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json()\r", + "\r", + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "pm.collectionVariables.set(\"master14_node\",jsonResponse.result.node_id);\r", + "console.log(pm.collectionVariables.get(\"master14_node\"));\r", + "\r", + "pm.collectionVariables.set(\"master14_id\",jsonResponse.result.node_id);\r", + "console.log(pm.collectionVariables.get(\"master14_id\"));\r", + "\r", + "pm.test(`identifier should be equal to ${pm.collectionVariables.get(\"master14_id\")}`, () => {\r", + " pm.expect(jsonResponse.result.identifier).to.eql(`${pm.collectionVariables.get(\"master14_code\")}`);\r", + "});\r", + "\r", + "pm.test(`node_id should be equal to ${pm.collectionVariables.get(\"master14_node\")}`, () => {\r", + " pm.expect(jsonResponse.result.node_id).to.eql(`${pm.collectionVariables.get(\"master14_code\")}`);\r", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "apikey", + "apikey": [ + { + "key": "value", + "value": "{{auth_token}}", + "type": "string" + }, + { + "key": "key", + "value": "Authorization", + "type": "string" + }, + { + "key": "in", + "value": "header", + "type": "string" + } + ] + }, + "method": "DELETE", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "X-Channel-Id", + "value": "{{X-Channel-Id}}" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "url": { + "raw": "{{host}}/framework/v3/category/master/retire/{{master14_code}}", + "host": [ + "{{host}}" + ], + "path": [ + "framework", + "v3", + "category", + "master", + "retire", + "{{master14_code}}" + ] + } + }, + "response": [] + }, + { + "name": "Delete framework", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json()\r", + "\r", + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "\r", + "pm.collectionVariables.set(\"fw12_node\",jsonResponse.result.node_id);\r", + "console.log(pm.collectionVariables.get(\"fw12_node\"));\r", + "\r", + "pm.test(`node id should be equal to ${pm.collectionVariables.get(\"fw12_node\")}`, () => {\r", + " pm.expect(jsonResponse.result.node_id).to.eql(pm.collectionVariables.get(\"fw12_code\"));\r", + "});\r", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "apikey", + "apikey": [ + { + "key": "in", + "value": "header", + "type": "string" + }, + { + "key": "value", + "value": "{{auth_token}}", + "type": "string" + }, + { + "key": "key", + "value": "Authorization", + "type": "string" + } + ] + }, + "method": "DELETE", + "header": [ + { + "key": "X-Channel-Id", + "value": "{{X-Channel-Id}}", + "type": "text" + }, + { + "key": "Accept", + "value": "application/json", + "type": "text" + }, + { + "key": "Content-Type", + "value": "application/json", + "type": "text" + } + ], + "url": { + "raw": "{{host}}/framework/v3/retire/{{fw12_code}}", + "host": [ + "{{host}}" + ], + "path": [ + "framework", + "v3", + "retire", + "{{fw12_code}}" + ] } - ] - } - ] - }, - { - "name": "Get Master Category", - "item": [ + }, + "response": [] + }, { - "name": "Positive", - "item": [ + "name": "Delete framework category", + "event": [ { - "name": "Read a live master category", - "event": [ + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json()\r", + "\r", + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "\r", + "pm.collectionVariables.set(\"fw_catgry\",jsonResponse.result.identifier);\r", + "console.log(pm.collectionVariables.get(\"fw_catgry\"));\r", + "\r", + "pm.test(`identifier should be equal to ${pm.collectionVariables.get(\"fw_catgry\")}`, () => {\r", + " pm.expect(jsonResponse.result.identifier).to.eql(`${pm.collectionVariables.get(\"fw12_code\")}_${pm.collectionVariables.get(\"master14_code\")}`);\r", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "DELETE", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "X-Channel-Id", + "value": "sunbird" + } + ], + "url": { + "raw": "{{host}}/framework/v3/category/retire/{{master14_code}}?framework={{fw12_code}}", + "host": [ + "{{host}}" + ], + "path": [ + "framework", + "v3", + "category", + "retire", + "{{master14_code}}" + ], + "query": [ { - "listen": "test", - "script": { - "exec": [ - "let jsonResponse = pm.response.json()\r", - "\r", - "pm.test(\"Status code is 200\", function () {\r", - " pm.response.to.have.status(200);\r", - "});\r", - "pm.test(\"Verify keys and data type of the response result\", () => {\r", - " pm.expect(jsonResponse.params).to.have.all.keys('resmsgid','msgid','status', 'err','errmsg');\r", - "pm.expect(jsonResponse.params.resmsgid).to.be.a(\"String\");\r", - "pm.expect(jsonResponse.params.msgid).to.be.a(\"null\");\r", - " pm.expect(jsonResponse.params.status).to.be.a(\"String\");\r", - " pm.expect(jsonResponse.params.err).to.be.a(\"null\");\r", - " pm.expect(jsonResponse.params.errmsg).to.be.a(\"null\");\r", - "});\r", - "pm.test(\"Verify keys and data type of the response result\", () => {\r", - " pm.expect(jsonResponse.result).to.be.an(\"object\").that.has.all.keys(\r", - " 'category'\r", - " );\r", - " pm.expect(jsonResponse.result.category).to.have.all.keys('trackable','identifier','lastStatusChangedOn', 'code','targetIdFieldName','channel','searchLabelFieldName','languageCode','createdOn','objectType','versionKey','name','lastUpdatedOn','searchIdFieldName','orgIdFieldName','status','description');\r", - "});\r", - "\r", - "pm.test(\"Status has String: retired \", function () {\r", - " pm.expect(jsonResponse.result.category.status).to.be.equal(\"Live\");\r", - "});" - ], - "type": "text/javascript" - } + "key": "framework", + "value": "{{fw12_code}}" } + ] + } + }, + "response": [] + }, + { + "name": "Delete term", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json()\r", + "\r", + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "pm.test(\"id has string - api.taxonomy.term.retire\", function () {\r", + " pm.expect(jsonResponse.id).to.be.equal(\"api.taxonomy.term.retire\");\r", + "});\r", + "pm.test(\"Version is 3.0 \", function () {\r", + " pm.expect(jsonResponse.ver).to.be.equal(\"3.0\");\r", + "});\r", + "pm.test(\"Verify keys and data type of the response result\", () => {\r", + " pm.expect(jsonResponse.params).to.have.all.keys('resmsgid','msgid','status', 'err','errmsg');\r", + "pm.expect(jsonResponse.params.resmsgid).to.be.a(\"String\");\r", + "pm.expect(jsonResponse.params.msgid).to.be.a(\"null\");\r", + " pm.expect(jsonResponse.params.status).to.be.a(\"String\");\r", + " pm.expect(jsonResponse.params.err).to.be.a(\"null\");\r", + " pm.expect(jsonResponse.params.errmsg).to.be.a(\"null\");\r", + "});\r", + "\r", + "pm.test(\"Status has string \", function () {\r", + " pm.expect(jsonResponse.params.status).to.be.equal(\"successful\");\r", + "});\r", + "\r", + "pm.test(\"Verify keys and data type of the response result\", () => {\r", + " pm.expect(jsonResponse.result).to.have.all.keys('identifier', 'versionKey');\r", + " pm.expect(jsonResponse.result.identifier).to.be.a(\"String\");\r", + " pm.expect(jsonResponse.result.versionKey).to.be.a(\"string\");\r", + "});\r", + "\r", + "pm.collectionVariables.set(\"del_term_id2\",jsonResponse.result.identifier);\r", + "console.log(pm.collectionVariables.get(\"del_term_id2\"));\r", + "\r", + "pm.test(`identifier should be equal to ${pm.collectionVariables.get(\"del_term_id2\")}`, () => {\r", + " pm.expect(jsonResponse.result.identifier).to.eql(`${pm.collectionVariables.get(\"fw12_code\")}_${pm.collectionVariables.get(\"master14_code\")}_${pm.collectionVariables.get(\"t2_term\")}`);\r", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "DELETE", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "X-Channel-Id", + "value": "{{X-Channel-Id}}" + } + ], + "url": { + "raw": "{{host}}/framework/v3/term/retire/{{t2_term}}?framework={{fw12_code}}&category={{master14_code}}", + "host": [ + "{{host}}" ], - "request": { - "auth": { - "type": "apikey", - "apikey": [ - { - "key": "value", - "value": "{{auth_token}}", - "type": "string" - }, - { - "key": "key", - "value": "Authorization", - "type": "string" - }, - { - "key": "in", - "value": "header", - "type": "string" - } - ] + "path": [ + "framework", + "v3", + "term", + "retire", + "{{t2_term}}" + ], + "query": [ + { + "key": "framework", + "value": "{{fw12_code}}" }, - "method": "GET", - "header": [ - { - "key": "X-Channel-Id", - "value": "{{X-Channel-Id}}" - }, - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "", - "value": "", - "disabled": true - } + { + "key": "category", + "value": "{{master14_code}}" + } + ] + }, + "description": "This API is associated with searching the existing terms under a category in a framework on Sunbird Platform\n - The endpoint for **Search Term** is `/framework/v1/term/search`\n - It points to knowledge-mw-service - `/v1/framework/term/search`\n - The fields marked with an asterisk (*) are mandatory. They cannot be null or empty." + }, + "response": [] + }, + { + "name": "Delete master category", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json()\r", + "\r", + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "pm.collectionVariables.set(\"master15_node\",jsonResponse.result.node_id);\r", + "console.log(pm.collectionVariables.get(\"master15_node\"));\r", + "\r", + "pm.collectionVariables.set(\"master15_id\",jsonResponse.result.node_id);\r", + "console.log(pm.collectionVariables.get(\"master15_id\"));\r", + "\r", + "pm.test(`identifier should be equal to ${pm.collectionVariables.get(\"master15_id\")}`, () => {\r", + " pm.expect(jsonResponse.result.identifier).to.eql(`${pm.collectionVariables.get(\"master15_code\")}`);\r", + "});\r", + "\r", + "pm.test(`node_id should be equal to ${pm.collectionVariables.get(\"master15_node\")}`, () => {\r", + " pm.expect(jsonResponse.result.node_id).to.eql(`${pm.collectionVariables.get(\"master15_code\")}`);\r", + "});" ], - "url": { - "raw": "{{host}}/framework/v3/category/master/read/{{node_id}}", - "host": [ - "{{host}}" - ], - "path": [ - "framework", - "v3", - "category", - "master", - "read", - "{{node_id}}" - ] + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "apikey", + "apikey": [ + { + "key": "value", + "value": "{{auth_token}}", + "type": "string" + }, + { + "key": "key", + "value": "Authorization", + "type": "string" + }, + { + "key": "in", + "value": "header", + "type": "string" } + ] + }, + "method": "DELETE", + "header": [ + { + "key": "Content-Type", + "value": "application/json" }, - "response": [] + { + "key": "X-Channel-Id", + "value": "{{X-Channel-Id}}" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "url": { + "raw": "{{host}}/framework/v3/category/master/retire/{{master15_code}}", + "host": [ + "{{host}}" + ], + "path": [ + "framework", + "v3", + "category", + "master", + "retire", + "{{master15_code}}" + ] + } + }, + "response": [] + }, + { + "name": "Delete framework", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json()\r", + "\r", + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "\r", + "pm.collectionVariables.set(\"fw13_node\",jsonResponse.result.node_id);\r", + "console.log(pm.collectionVariables.get(\"fw13_node\"));\r", + "\r", + "pm.test(`node id should be equal to ${pm.collectionVariables.get(\"fw13_node\")}`, () => {\r", + " pm.expect(jsonResponse.result.node_id).to.eql(pm.collectionVariables.get(\"fw13_code\"));\r", + "});\r", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "apikey", + "apikey": [ + { + "key": "in", + "value": "header", + "type": "string" + }, + { + "key": "value", + "value": "{{auth_token}}", + "type": "string" + }, + { + "key": "key", + "value": "Authorization", + "type": "string" + } + ] }, + "method": "DELETE", + "header": [ + { + "key": "X-Channel-Id", + "value": "{{X-Channel-Id}}", + "type": "text" + }, + { + "key": "Accept", + "value": "application/json", + "type": "text" + }, + { + "key": "Content-Type", + "value": "application/json", + "type": "text" + } + ], + "url": { + "raw": "{{host}}/framework/v3/retire/{{fw13_code}}", + "host": [ + "{{host}}" + ], + "path": [ + "framework", + "v3", + "retire", + "{{fw13_code}}" + ] + } + }, + "response": [] + }, + { + "name": "Delete framework category", + "event": [ { - "name": "Read a retired master category", - "event": [ + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json()\r", + "\r", + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "\r", + "pm.collectionVariables.set(\"fw_catgry1\",jsonResponse.result.identifier);\r", + "console.log(pm.collectionVariables.get(\"fw_catgry1\"));\r", + "\r", + "pm.test(`identifier should be equal to ${pm.collectionVariables.get(\"fw_catgry1\")}`, () => {\r", + " pm.expect(jsonResponse.result.identifier).to.eql(`${pm.collectionVariables.get(\"fw13_code\")}_${pm.collectionVariables.get(\"master15_code\")}`);\r", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "DELETE", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "X-Channel-Id", + "value": "sunbird" + } + ], + "url": { + "raw": "{{host}}/framework/v3/category/retire/{{master15_code}}?framework={{fw13_code}}", + "host": [ + "{{host}}" + ], + "path": [ + "framework", + "v3", + "category", + "retire", + "{{master15_code}}" + ], + "query": [ { - "listen": "test", - "script": { - "exec": [ - "let jsonResponse = pm.response.json()\r", - "\r", - "pm.test(\"Status code is 200\", function () {\r", - " pm.response.to.have.status(200);\r", - "});\r", - "pm.test(\"Verify keys and data type of the response result\", () => {\r", - " pm.expect(jsonResponse.params).to.have.all.keys('resmsgid','msgid','status', 'err','errmsg');\r", - "pm.expect(jsonResponse.params.resmsgid).to.be.a(\"String\");\r", - "pm.expect(jsonResponse.params.msgid).to.be.a(\"null\");\r", - " pm.expect(jsonResponse.params.status).to.be.a(\"String\");\r", - " pm.expect(jsonResponse.params.err).to.be.a(\"null\");\r", - " pm.expect(jsonResponse.params.errmsg).to.be.a(\"null\");\r", - "});\r", - "pm.test(\"Verify keys and data type of the response result\", () => {\r", - " pm.expect(jsonResponse.result).to.be.an(\"object\").that.has.all.keys(\r", - " 'category'\r", - " );\r", - " pm.expect(jsonResponse.result.category).to.have.all.keys('trackable','identifier','lastStatusChangedOn', 'code','targetIdFieldName','channel','searchLabelFieldName','languageCode','createdOn','objectType','versionKey','name','lastUpdatedOn','searchIdFieldName','orgIdFieldName','status','description');\r", - "});\r", - "\r", - "pm.test(\"Status has String: retired \", function () {\r", - " pm.expect(jsonResponse.result.category.status).to.be.equal(\"Retired\");\r", - "});" - ], - "type": "text/javascript" - } + "key": "framework", + "value": "{{fw13_code}}" } + ] + } + }, + "response": [] + }, + { + "name": "Delete term", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json()\r", + "\r", + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "pm.test(\"id has string - api.taxonomy.term.retire\", function () {\r", + " pm.expect(jsonResponse.id).to.be.equal(\"api.taxonomy.term.retire\");\r", + "});\r", + "pm.test(\"Version is 3.0 \", function () {\r", + " pm.expect(jsonResponse.ver).to.be.equal(\"3.0\");\r", + "});\r", + "pm.test(\"Verify keys and data type of the response result\", () => {\r", + " pm.expect(jsonResponse.params).to.have.all.keys('resmsgid','msgid','status', 'err','errmsg');\r", + "pm.expect(jsonResponse.params.resmsgid).to.be.a(\"String\");\r", + "pm.expect(jsonResponse.params.msgid).to.be.a(\"null\");\r", + " pm.expect(jsonResponse.params.status).to.be.a(\"String\");\r", + " pm.expect(jsonResponse.params.err).to.be.a(\"null\");\r", + " pm.expect(jsonResponse.params.errmsg).to.be.a(\"null\");\r", + "});\r", + "\r", + "pm.test(\"Status has string \", function () {\r", + " pm.expect(jsonResponse.params.status).to.be.equal(\"successful\");\r", + "});\r", + "\r", + "pm.test(\"Verify keys and data type of the response result\", () => {\r", + " pm.expect(jsonResponse.result).to.have.all.keys('identifier', 'versionKey');\r", + " pm.expect(jsonResponse.result.identifier).to.be.a(\"String\");\r", + " pm.expect(jsonResponse.result.versionKey).to.be.a(\"string\");\r", + "});\r", + "\r", + "pm.collectionVariables.set(\"del_term_id3\",jsonResponse.result.identifier);\r", + "console.log(pm.collectionVariables.get(\"del_term_id3\"));\r", + "\r", + "pm.test(`identifier should be equal to ${pm.collectionVariables.get(\"del_term_id3\")}`, () => {\r", + " pm.expect(jsonResponse.result.identifier).to.eql(`${pm.collectionVariables.get(\"fw13_code\")}_${pm.collectionVariables.get(\"master15_code\")}_${pm.collectionVariables.get(\"t3_term\")}`);\r", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "DELETE", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "X-Channel-Id", + "value": "{{X-Channel-Id}}" + } + ], + "url": { + "raw": "{{host}}/framework/v3/term/retire/{{t3_term}}?framework={{fw13_code}}&category={{master15_code}}", + "host": [ + "{{host}}" ], - "request": { - "auth": { - "type": "apikey", - "apikey": [ - { - "key": "value", - "value": "{{auth_token}}", - "type": "string" - }, - { - "key": "key", - "value": "Authorization", - "type": "string" - }, - { - "key": "in", - "value": "header", - "type": "string" - } - ] + "path": [ + "framework", + "v3", + "term", + "retire", + "{{t3_term}}" + ], + "query": [ + { + "key": "framework", + "value": "{{fw13_code}}" }, - "method": "GET", - "header": [ - { - "key": "X-Channel-Id", - "value": "{{X-Channel-Id}}" - }, - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "Authorization", - "value": "{{auth_token}}" - } + { + "key": "category", + "value": "{{master15_code}}" + } + ] + }, + "description": "This API is associated with searching the existing terms under a category in a framework on Sunbird Platform\n - The endpoint for **Search Term** is `/framework/v1/term/search`\n - It points to knowledge-mw-service - `/v1/framework/term/search`\n - The fields marked with an asterisk (*) are mandatory. They cannot be null or empty." + }, + "response": [] + }, + { + "name": "Delete master category", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json()\r", + "\r", + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "pm.collectionVariables.set(\"master15_node\",jsonResponse.result.node_id);\r", + "console.log(pm.collectionVariables.get(\"master15_node\"));\r", + "\r", + "pm.collectionVariables.set(\"master16_id\",jsonResponse.result.node_id);\r", + "console.log(pm.collectionVariables.get(\"master16_id\"));\r", + "\r", + "pm.test(`identifier should be equal to ${pm.collectionVariables.get(\"master16_id\")}`, () => {\r", + " pm.expect(jsonResponse.result.identifier).to.eql(`${pm.collectionVariables.get(\"master16_code\")}`);\r", + "});\r", + "\r", + "pm.test(`node_id should be equal to ${pm.collectionVariables.get(\"master16_node\")}`, () => {\r", + " pm.expect(jsonResponse.result.node_id).to.eql(`${pm.collectionVariables.get(\"master16_code\")}`);\r", + "});" ], - "url": { - "raw": "{{host}}/framework/v3/category/master/read/{{node_id}}", - "host": [ - "{{host}}" - ], - "path": [ - "framework", - "v3", - "category", - "master", - "read", - "{{node_id}}" - ] + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "apikey", + "apikey": [ + { + "key": "value", + "value": "{{auth_token}}", + "type": "string" + }, + { + "key": "key", + "value": "Authorization", + "type": "string" + }, + { + "key": "in", + "value": "header", + "type": "string" } + ] + }, + "method": "DELETE", + "header": [ + { + "key": "Content-Type", + "value": "application/json" }, - "response": [] + { + "key": "X-Channel-Id", + "value": "{{X-Channel-Id}}" + }, + { + "key": "Accept", + "value": "application/json" + } + ], + "url": { + "raw": "{{host}}/framework/v3/category/master/retire/{{master16_code}}", + "host": [ + "{{host}}" + ], + "path": [ + "framework", + "v3", + "category", + "master", + "retire", + "{{master16_code}}" + ] } - ] + }, + "response": [] }, { - "name": "Negative", - "item": [ + "name": "Delete framework", + "event": [ { - "name": "Read an invalid master category", - "event": [ + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json()\r", + "\r", + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "\r", + "pm.collectionVariables.set(\"fw14_node\",jsonResponse.result.node_id);\r", + "console.log(pm.collectionVariables.get(\"fw14_node\"));\r", + "\r", + "pm.test(`node id should be equal to ${pm.collectionVariables.get(\"fw14_node\")}`, () => {\r", + " pm.expect(jsonResponse.result.node_id).to.eql(pm.collectionVariables.get(\"fw14_code\"));\r", + "});\r", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "apikey", + "apikey": [ { - "listen": "test", - "script": { - "exec": [ - "let jsonResponse = pm.response.json()\r", - "\r", - "pm.test(\"Status code is 404\", function () {\r", - " pm.response.to.have.status(404);\r", - "});\r", - "\r", - "pm.test(\"Status code name has string\", function () {\r", - " pm.response.to.have.status(\"Not Found\");\r", - "});\r", - "\r", - "pm.test(\"Verify keys and data type of the response result\", () => {\r", - " pm.expect(jsonResponse.params).to.have.all.keys('resmsgid','msgid','err','status','errmsg');\r", - " pm.expect(jsonResponse.params.resmsgid).to.be.a(\"String\");\r", - " pm.expect(jsonResponse.params.msgid).to.be.a(\"null\");\r", - " pm.expect(jsonResponse.params.err).to.be.a(\"String\");\r", - " pm.expect(jsonResponse.params.status).to.be.a(\"String\");\r", - " pm.expect(jsonResponse.params.errmsg).to.be.a(\"String\");\r", - " });\r", - "\r", - "pm.test(\"Err has string\", function () {\r", - " pm.expect(jsonResponse.params.err).to.be.equal(\"NOT_FOUND\");\r", - "});\r", - "pm.test(\"Status has string\", function () {\r", - " pm.expect(jsonResponse.params.status).to.be.equal(\"failed\");\r", - "});\r", - "pm.test(\"errmsg has string\", function () {\r", - " pm.expect(jsonResponse.params.errmsg).to.be.include(\"Error! Node(s) doesn't Exists. | [Invalid Node Id.]: \");\r", - "});\r", - "pm.test(\"responseCode has string\", function () {\r", - " pm.expect(jsonResponse.responseCode).to.be.equal(\"RESOURCE_NOT_FOUND\");\r", - "});\r", - "\r", - "" - ], - "type": "text/javascript" - } + "key": "in", + "value": "header", + "type": "string" + }, + { + "key": "value", + "value": "{{auth_token}}", + "type": "string" + }, + { + "key": "key", + "value": "Authorization", + "type": "string" } + ] + }, + "method": "DELETE", + "header": [ + { + "key": "X-Channel-Id", + "value": "{{X-Channel-Id}}", + "type": "text" + }, + { + "key": "Accept", + "value": "application/json", + "type": "text" + }, + { + "key": "Content-Type", + "value": "application/json", + "type": "text" + } + ], + "url": { + "raw": "{{host}}/framework/v3/retire/{{fw14_code}}", + "host": [ + "{{host}}" ], - "request": { - "auth": { - "type": "apikey", - "apikey": [ - { - "key": "value", - "value": "{{auth_token}}", - "type": "string" - }, - { - "key": "key", - "value": "Authorization", - "type": "string" - }, - { - "key": "in", - "value": "header", - "type": "string" - } - ] - }, - "method": "GET", - "header": [ - { - "key": "X-Channel-Id", - "value": "sunbird" - }, - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "X-Channel-Id", - "value": "{{X-Channel-Id}}" - } + "path": [ + "framework", + "v3", + "retire", + "{{fw14_code}}" + ] + } + }, + "response": [] + }, + { + "name": "Delete framework category", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "let jsonResponse = pm.response.json()\r", + "\r", + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "\r", + "pm.collectionVariables.set(\"fw_catgry3\",jsonResponse.result.identifier);\r", + "console.log(pm.collectionVariables.get(\"fw_catgry3\"));\r", + "\r", + "pm.test(`identifier should be equal to ${pm.collectionVariables.get(\"fw_catgry3\")}`, () => {\r", + " pm.expect(jsonResponse.result.identifier).to.eql(`${pm.collectionVariables.get(\"fw14_code\")}_${pm.collectionVariables.get(\"master16_code\")}`);\r", + "});" ], - "url": { - "raw": "{{host}}/framework/v3/category/master/read/abc", - "host": [ - "{{host}}" - ], - "path": [ - "framework", - "v3", - "category", - "master", - "read", - "abc" - ] - } + "type": "text/javascript" + } + } + ], + "request": { + "method": "DELETE", + "header": [ + { + "key": "Content-Type", + "value": "application/json" }, - "response": [] + { + "key": "X-Channel-Id", + "value": "sunbird" + } + ], + "url": { + "raw": "{{host}}/framework/v3/category/retire/{{master16_code}}?framework={{fw14_code}}", + "host": [ + "{{host}}" + ], + "path": [ + "framework", + "v3", + "category", + "retire", + "{{master16_code}}" + ], + "query": [ + { + "key": "framework", + "value": "{{fw14_code}}" + } + ] } - ] + }, + "response": [] } ] } + ], + "description": "Pre requisite:\n\n1. Master category should be available before creating framework category\n2. Framework category, framework should be available before creating framework term\n \n3. Master category, framework and framework category should be updated before running the collection (in the pre requisite folder as well)", + "event": [ + { + "listen": "prerequest", + "script": { + "type": "text/javascript", + "exec": [ + "//Scenario-1", + "pm.collectionVariables.set(\"master13_code\", \"master13_cat_4\");", + "pm.collectionVariables.set(\"fw11_name\", \"fw11_name\");", + "pm.collectionVariables.set(\"fw11_code\", \"fw11_code4\");", + "pm.collectionVariables.set(\"t1_term\", \"tm1_term04\");", + "//Scenario-2", + "pm.collectionVariables.set(\"master14_code\", \"master14_cat_3\");", + "pm.collectionVariables.set(\"fw12_name\", \"fw12_name\");", + "pm.collectionVariables.set(\"fw12_code\", \"fw12_code3\");", + "pm.collectionVariables.set(\"t2_term\", \"tm2_term04\");", + "//Scenario-3", + "pm.collectionVariables.set(\"master15_code\", \"master15_cat_4\");", + "pm.collectionVariables.set(\"fw13_name\", \"fw13_name\");", + "pm.collectionVariables.set(\"fw13_code\", \"fw13_code4\");", + "pm.collectionVariables.set(\"t3_term\", \"tm3_term05\");", + "//Scenario-4", + "pm.collectionVariables.set(\"master16_code\", \"master16_cat_3\");", + "pm.collectionVariables.set(\"fw14_name\", \"fw14_name\");", + "pm.collectionVariables.set(\"fw14_code\", \"fw14_code3\");", + "pm.collectionVariables.set(\"t4_term\", \"tm4_term03\");" + ] + } + }, + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "" + ] + } + } ] } - ] + ], + "description": "Pre requisite:\n\n- Framework name should be updated before runnng the collection (in the prequisite folder as well)\n- Framework category should be updated before running the collection (in the pre requisite folder as well)\n- Master category should be updated before running the collection (in the pre requisite folder as well)\n- Framework term should be updated before running the collection (in the pre requisite folder as well)" } ], "variable": [ { - "key": "baseUrl", - "value": "https://staging.open-sunbird.org/api", - "type": "string" + "key": "baseUrl", + "value": "https://staging.open-sunbird.org/api", + "type": "string" + }, + { + "key": "code", + "value": "Ut enim offici", + "type": "any" + }, + { + "key": "name", + "value": "" + }, + { + "key": "name_fw", + "value": "" + }, + { + "key": "code_fw", + "value": "" + }, + { + "key": "name1", + "value": "" + }, + { + "key": "code1", + "value": "" + }, + { + "key": "framework", + "value": "" + }, + { + "key": "channel_id", + "value": "" + }, + { + "key": "fwcat_cat1", + "value": "" + }, + { + "key": "fw5_name", + "value": "" + }, + { + "key": "fw5_code", + "value": "" + }, + { + "key": "fw5_node", + "value": "" + }, + { + "key": "master6_code", + "value": "" + }, + { + "key": "master6_id", + "value": "" + }, + { + "key": "master6_node", + "value": "" + }, + { + "key": "copy_fw", + "value": "" + }, + { + "key": "copy_node", + "value": "" + }, + { + "key": "master7_code", + "value": "" + }, + { + "key": "master7_id", + "value": "" + }, + { + "key": "master7_node", + "value": "" + }, + { + "key": "fw6_name", + "value": "" + }, + { + "key": "fw6_code", + "value": "" + }, + { + "key": "fw6_node", + "value": "" + }, + { + "key": "fwcat_cat2", + "value": "" + }, + { + "key": "fw4_node", + "value": "" + }, + { + "key": "fw4_id", + "value": "" + }, + { + "key": "fw4_name", + "value": "" + }, + { + "key": "fw4_code", + "value": "" + }, + { + "key": "fw_catgry", + "value": "" + }, + { + "key": "fw1_node", + "value": "" + }, + { + "key": "fw2_node", + "value": "" + }, + { + "key": "fw3_node", + "value": "" + }, + { + "key": "fw1_name", + "value": "" + }, + { + "key": "fw1_code", + "value": "" + }, + { + "key": "fw2_name", + "value": "" + }, + { + "key": "fw2_code", + "value": "" + }, + { + "key": "fw3_name", + "value": "" + }, + { + "key": "fw3_code", + "value": "" + }, + { + "key": "master_code", + "value": "" + }, + { + "key": "master2_code", + "value": "" }, { - "key": "code", - "value": "Ut enim offici", - "type": "any" + "key": "master3_code", + "value": "" }, { - "key": "name", + "key": "master4_code", "value": "" }, { - "key": "name_fw", + "key": "master5_code", "value": "" }, { - "key": "code_fw", + "key": "master_id", "value": "" }, { - "key": "name1", + "key": "master_node", "value": "" }, { - "key": "code1", + "key": "master3_id", + "value": "" + }, + { + "key": "master3_node", + "value": "" + }, + { + "key": "master4_id", + "value": "" + }, + { + "key": "master4_node", + "value": "" + }, + { + "key": "master5_id", + "value": "" + }, + { + "key": "master5_node", + "value": "" + }, + { + "key": "master2_id", + "value": "" + }, + { + "key": "master2_node", + "value": "" + }, + { + "key": "master8_code", + "value": "" + }, + { + "key": "fw7_name", + "value": "" + }, + { + "key": "fw7_code", + "value": "" + }, + { + "key": "master9_code", + "value": "" + }, + { + "key": "master10_code", + "value": "" + }, + { + "key": "fw8_name", + "value": "" + }, + { + "key": "fw8_code", + "value": "" + }, + { + "key": "master11_code", + "value": "" + }, + { + "key": "fw9_name", + "value": "" + }, + { + "key": "fw9_code", + "value": "" + }, + { + "key": "master12_code", + "value": "" + }, + { + "key": "fw10_name", + "value": "" + }, + { + "key": "fw10_code", + "value": "" + }, + { + "key": "master8_id", + "value": "" + }, + { + "key": "master8_node", + "value": "" + }, + { + "key": "fw7_node", + "value": "" + }, + { + "key": "master9_id", + "value": "" + }, + { + "key": "master9_node", + "value": "" + }, + { + "key": "master10_id", + "value": "" + }, + { + "key": "master10_node", + "value": "" + }, + { + "key": "fw8_node", + "value": "" + }, + { + "key": "fwcat_cat3", + "value": "" + }, + { + "key": "master11_id", + "value": "" + }, + { + "key": "master11_node", + "value": "" + }, + { + "key": "fw9_node", + "value": "" + }, + { + "key": "fwcat_cat4", + "value": "" + }, + { + "key": "master12_id", + "value": "" + }, + { + "key": "master12_node", + "value": "" + }, + { + "key": "identifier", + "value": "" + }, + { + "key": "fw10_node", + "value": "" + }, + { + "key": "fwcat_cat5", + "value": "" + }, + { + "key": "master13_code", + "value": "" + }, + { + "key": "fw11_name", + "value": "" + }, + { + "key": "fw11_code", + "value": "" + }, + { + "key": "t1_term", + "value": "" + }, + { + "key": "master14_code", + "value": "" + }, + { + "key": "fw12_name", + "value": "" + }, + { + "key": "fw12_code", + "value": "" + }, + { + "key": "t2_term", + "value": "" + }, + { + "key": "master15_code", + "value": "" + }, + { + "key": "fw13_name", + "value": "" + }, + { + "key": "fw13_code", + "value": "" + }, + { + "key": "t3_term", + "value": "" + }, + { + "key": "master16_code", + "value": "" + }, + { + "key": "fw14_name", + "value": "" + }, + { + "key": "fw14_code", + "value": "" + }, + { + "key": "t4_term", + "value": "" + }, + { + "key": "master13_id", + "value": "" + }, + { + "key": "master13_node", + "value": "" + }, + { + "key": "fw11_node", + "value": "" + }, + { + "key": "fwcat_cat6", + "value": "" + }, + { + "key": "term_id", + "value": "" + }, + { + "key": "term_node", + "value": "" + }, + { + "key": "master14_id", + "value": "" + }, + { + "key": "master14_node", + "value": "" + }, + { + "key": "fw12_node", + "value": "" + }, + { + "key": "fwcat_cat7", + "value": "" + }, + { + "key": "master15_id", + "value": "" + }, + { + "key": "master15_node", + "value": "" + }, + { + "key": "fw13_node", + "value": "" + }, + { + "key": "fwcat_cat8", + "value": "" + }, + { + "key": "term1_id", + "value": "" + }, + { + "key": "master16_id", + "value": "" + }, + { + "key": "master16_node", + "value": "" + }, + { + "key": "fw14_node", + "value": "" + }, + { + "key": "fwcat_cat9", + "value": "" + }, + { + "key": "term2_node", + "value": "" + }, + { + "key": "del_term_id", + "value": "" + }, + { + "key": "del_fw_catgry1", + "value": "" + }, + { + "key": "del_term_id1", + "value": "" + }, + { + "key": "del_term_id2", + "value": "" + }, + { + "key": "fw_catgry1", + "value": "" + }, + { + "key": "del_term_id3", + "value": "" + }, + { + "key": "fw_catgry3", "value": "" } ]