{ "info": { "_postman_id": "a1f416b9-ce40-48a3-bd2a-0e6ecaf398cd", "name": "OEM Tenant, Manufacturer, Product and Document creation W/O Credentials", "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json" }, "item": [ { "name": "1. Create a tenant for your manufacturer data", "event": [ { "listen": "test", "script": { "exec": [ "var jsonData = JSON.parse(responseBody);\r", "pm.environment.set(\"TenantID\", jsonData.id);" ], "type": "text/javascript" } } ], "request": { "method": "POST", "header": [ { "key": "API-key", "value": "Your API Key here", "type": "text" } ], "body": { "mode": "raw", "raw": "{\r\n \"name\": \"Tank Company\"\r\n}", "options": { "raw": { "language": "json" } } }, "url": { "raw": "https://api.staging-env.netilion.endress.com/v1/tenants", "protocol": "https", "host": [ "api", "staging-env", "netilion", "endress", "com" ], "path": [ "v1", "tenants" ] } }, "response": [] }, { "name": "2. Create a manufacturer (Brand name under which your products will appear)", "event": [ { "listen": "test", "script": { "exec": [ "var jsonData = JSON.parse(responseBody);\r", "pm.environment.set(\"CompanyID\", jsonData.id);" ], "type": "text/javascript" } } ], "request": { "method": "POST", "header": [ { "key": "API-key", "value": "", "type": "text" } ], "body": { "mode": "raw", "raw": "{\r\n \"name\": \"Some Tank Company L\",\r\n \"tenant\": {\r\n \"id\": {{TenantID}}\r\n }\r\n}", "options": { "raw": { "language": "json" } } }, "url": { "raw": "https://api.staging-env.netilion.endress.com/v1/companies", "protocol": "https", "host": [ "api", "staging-env", "netilion", "endress", "com" ], "path": [ "v1", "companies" ] } }, "response": [] }, { "name": "3. Create a product under this manufacturer", "event": [ { "listen": "test", "script": { "exec": [ "var jsonData = JSON.parse(responseBody);\r", "pm.environment.set(\"ProductID\", jsonData.id);" ], "type": "text/javascript" } } ], "request": { "method": "POST", "header": [ { "key": "API-key", "value": "", "type": "text" } ], "body": { "mode": "raw", "raw": "{\r\n \"product_code\": \"CT_001\",\r\n \"name\": \"Circular Tank Type 2\",\r\n \"description\": \"This description field can be optionally filled in\",\r\n \"manufacturer\": {\r\n \"id\": {{CompanyID}}\r\n },\r\n \"status\": {\r\n \"id\": 2\r\n },\r\n \"tenant\": {\r\n \"id\": {{TenantID}}\r\n }\r\n}", "options": { "raw": { "language": "json" } } }, "url": { "raw": "https://api.staging-env.netilion.endress.com/v1/products", "protocol": "https", "host": [ "api", "staging-env", "netilion", "endress", "com" ], "path": [ "v1", "products" ] } }, "response": [] }, { "name": "4. Create a document for a product", "event": [ { "listen": "test", "script": { "exec": [ "var jsonData = JSON.parse(responseBody);\r", "pm.environment.set(\"DocumentID\", jsonData.id);" ], "type": "text/javascript" } } ], "request": { "method": "POST", "header": [ { "key": "API-key", "value": "", "type": "text" } ], "body": { "mode": "raw", "raw": "{\r\n \"name\": \"User Manual T1\",\r\n \"classification\": {\r\n \"id\": 2\r\n },\r\n \"status\": {\r\n \"id\": 1\r\n }\r\n}", "options": { "raw": { "language": "json" } } }, "url": { "raw": "https://api.staging-env.netilion.endress.com/v1/documents", "protocol": "https", "host": [ "api", "staging-env", "netilion", "endress", "com" ], "path": [ "v1", "documents" ] } }, "response": [] }, { "name": "5. Categorize created document", "event": [ { "listen": "test", "script": { "exec": [ "" ], "type": "text/javascript" } } ], "request": { "method": "POST", "header": [ { "key": "API-key", "value": "", "type": "text" } ], "body": { "mode": "raw", "raw": "{\r\n \"categories\": [\r\n {\r\n \"id\": 487\r\n }\r\n ]\r\n}", "options": { "raw": { "language": "json" } } }, "url": { "raw": "https://api.staging-env.netilion.endress.com/v1/documents/{{DocumentID}}/categories", "protocol": "https", "host": [ "api", "staging-env", "netilion", "endress", "com" ], "path": [ "v1", "documents", "{{DocumentID}}", "categories" ] } }, "response": [] }, { "name": "6. Assign created document to a product", "event": [ { "listen": "test", "script": { "exec": [ "" ], "type": "text/javascript" } } ], "request": { "method": "POST", "header": [ { "key": "API-key", "value": "", "type": "text" } ], "body": { "mode": "raw", "raw": "{\r\n \"documents\": [\r\n {\r\n \"id\": {{DocumentID}}\r\n }\r\n ]\r\n}", "options": { "raw": { "language": "json" } } }, "url": { "raw": "https://api.staging-env.netilion.endress.com/v1/products/{{ProductID}}/documents", "protocol": "https", "host": [ "api", "staging-env", "netilion", "endress", "com" ], "path": [ "v1", "products", "{{ProductID}}", "documents" ] } }, "response": [] }, { "name": "7. Create a file attachment for the previously created document", "event": [ { "listen": "test", "script": { "exec": [ "var jsonData = JSON.parse(responseBody);\r", "pm.environment.set(\"AttachmentID\", jsonData.id);" ], "type": "text/javascript" } } ], "request": { "method": "POST", "header": [ { "key": "API-key", "value": "", "type": "text" } ], "body": { "mode": "formdata", "formdata": [ { "key": "document_id", "value": "{{DocumentID}}", "type": "text" }, { "key": "file", "type": "file", "src": "/C:/Users/i02401295/Desktop/Tank_type_!_Intructions.pdf" }, { "key": "languages", "value": "en", "type": "text" } ], "options": { "raw": { "language": "json" } } }, "url": { "raw": "https://api.staging-env.netilion.endress.com/v1/attachments", "protocol": "https", "host": [ "api", "staging-env", "netilion", "endress", "com" ], "path": [ "v1", "attachments" ] } }, "response": [] }, { "name": "8. Create an Asset based on the prev. created Product", "event": [ { "listen": "test", "script": { "exec": [ "var jsonData = JSON.parse(responseBody);\r", "pm.environment.set(\"AssetID\", jsonData.id);" ], "type": "text/javascript" } } ], "request": { "method": "POST", "header": [ { "key": "API-key", "value": "", "type": "text" } ], "body": { "mode": "raw", "raw": "{\r\n \"serial_number\": \"some_dummy_S/N_here3\",\r\n \"description\": \"describe it as wished\",\r\n \"production_date\": \"2021-06-29\",\r\n \"status\": {\r\n \"id\": 1\r\n },\r\n \"product\": {\r\n \"id\": {{ProductID}}\r\n }, \r\n \"tenant\": {\r\n \"id\": {{TenantID}}\r\n }\r\n}", "options": { "raw": { "language": "json" } } }, "url": { "raw": "https://api.staging-env.netilion.endress.com/v1/assets", "protocol": "https", "host": [ "api", "staging-env", "netilion", "endress", "com" ], "path": [ "v1", "assets" ] } }, "response": [] }, { "name": "9. Create a document for the created Asset", "event": [ { "listen": "test", "script": { "exec": [ "var jsonData = JSON.parse(responseBody);\r", "pm.environment.set(\"DocumentID\", jsonData.id);" ], "type": "text/javascript" } } ], "request": { "method": "POST", "header": [ { "key": "API-key", "value": "", "type": "text" } ], "body": { "mode": "raw", "raw": "{\r\n \"name\": \"Some Asset specific Material Certificate\",\r\n \"classification\": {\r\n \"id\": 2\r\n },\r\n \"status\": {\r\n \"id\": 1\r\n }\r\n}", "options": { "raw": { "language": "json" } } }, "url": { "raw": "https://api.staging-env.netilion.endress.com/v1/documents", "protocol": "https", "host": [ "api", "staging-env", "netilion", "endress", "com" ], "path": [ "v1", "documents" ] } }, "response": [] }, { "name": "10. Categorize created document", "event": [ { "listen": "test", "script": { "exec": [ "" ], "type": "text/javascript" } } ], "request": { "method": "POST", "header": [ { "key": "API-key", "value": "", "type": "text" } ], "body": { "mode": "raw", "raw": "{\r\n \"categories\": [\r\n {\r\n \"id\": 494\r\n }\r\n ]\r\n}", "options": { "raw": { "language": "json" } } }, "url": { "raw": "https://api.staging-env.netilion.endress.com/v1/documents/{{DocumentID}}/categories", "protocol": "https", "host": [ "api", "staging-env", "netilion", "endress", "com" ], "path": [ "v1", "documents", "{{DocumentID}}", "categories" ] } }, "response": [] }, { "name": "11. Assign created document to the previous created Asset", "event": [ { "listen": "test", "script": { "exec": [ "" ], "type": "text/javascript" } } ], "request": { "method": "POST", "header": [ { "key": "API-key", "value": "", "type": "text" } ], "body": { "mode": "raw", "raw": "{\r\n \"documents\": [\r\n {\r\n \"id\": {{DocumentID}}\r\n }\r\n ]\r\n}", "options": { "raw": { "language": "json" } } }, "url": { "raw": "https://api.staging-env.netilion.endress.com/v1/assets/{{AssetID}}/documents", "protocol": "https", "host": [ "api", "staging-env", "netilion", "endress", "com" ], "path": [ "v1", "assets", "{{AssetID}}", "documents" ] } }, "response": [] }, { "name": "12. Create a file attachment for the previously created document", "event": [ { "listen": "test", "script": { "exec": [ "var jsonData = JSON.parse(responseBody);\r", "pm.environment.set(\"AttachmentID\", jsonData.id);" ], "type": "text/javascript" } } ], "request": { "method": "POST", "header": [ { "key": "API-key", "value": "", "type": "text" } ], "body": { "mode": "formdata", "formdata": [ { "key": "document_id", "value": "{{DocumentID}}", "type": "text" }, { "key": "file", "type": "file", "src": "/C:/Users/i02401295/Desktop/Tank_type_!_Intructions.pdf" }, { "key": "languages", "value": "en", "type": "text" } ], "options": { "raw": { "language": "json" } } }, "url": { "raw": "https://api.staging-env.netilion.endress.com/v1/attachments", "protocol": "https", "host": [ "api", "staging-env", "netilion", "endress", "com" ], "path": [ "v1", "attachments" ] } }, "response": [] } ], "auth": { "type": "basic", "basic": [ { "key": "password", "value": "", "type": "string" }, { "key": "username", "value": "", "type": "string" } ] }, "event": [ { "listen": "prerequest", "script": { "type": "text/javascript", "exec": [ "" ] } }, { "listen": "test", "script": { "type": "text/javascript", "exec": [ "" ] } } ] }