{"info":{"_postman_id":"4c0de704-ea37-4ef5-8eb7-f2e999bd41e3","name":"Exstream 16.6 API","description":"<html><head></head><body><h2 id=\"api-scenario-walkthroughs\">API Scenario Walkthroughs</h2>\n<p>This collection provides a few common scenarios for Exstream API usage:</p>\n<ul>\n<li>Creating a batch document</li>\n<li>Creating and releasing an on-demand document</li>\n<li>Various helper functions</li>\n</ul>\n<h2 id=\"usage\">Usage</h2>\n<p>The project you build needs a service request application created in <code>Control Center</code> whose port you need to call in the requests (defined in the environment variable <code>SdpPort</code>). The project itself needs to have an input channel of type <code>Service Request</code> of request type <code>Generic</code> with a service name set. The service name should also be set in the environment variable <code>ServiceRequestInputName</code>.</p>\n<p>To start, all API calls need to be preceeded by requesting an authentication ticket. To authenticate, create a <code>POST</code> request as shown in the <code>Authenticate</code> folder. After having yourself authenticated successfully, you can proceed with any of the scenarios listed in the folders below.</p>\n</body></html>","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","toc":[],"owner":"7187971","collectionId":"4c0de704-ea37-4ef5-8eb7-f2e999bd41e3","publishedId":"SzYUZ1G3","public":true,"customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"EF5B25"},"publishDate":"2020-03-26T08:29:14.000Z"},"item":[{"name":"Authenticate","item":[{"name":"Authenticate Tenant","event":[{"listen":"test","script":{"id":"3c39f40b-e853-4f15-8b70-88aa4d30da6c","exec":["var jsonData = JSON.parse(responseBody);\r","postman.setEnvironmentVariable(\"OTDSTicket\", jsonData.ticket);"],"type":"text/javascript"}},{"listen":"prerequest","script":{"id":"9a961347-ed9e-43ad-aa46-7101a3b0291b","exec":[""],"type":"text/javascript"}}],"id":"c57c3d93-3f80-4575-a765-8a791eeb1ae6","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"userName\": \"{{TenantUserName}}\",\n    \"password\": \"{{TenantUserPassword}}\"\n}","options":{"raw":{"language":"json"}}},"url":"{{ProtocolOtds}}://{{OtdsHost}}:{{OtdsPort}}/otdstenant/{{Tenant}}/otdsws/rest/authentication/credentials","auth":{"type":"noauth","isInherited":true,"source":{"_postman_id":"20eb0c42-af7b-4155-a4c2-ff9dc6d42adf","id":"20eb0c42-af7b-4155-a4c2-ff9dc6d42adf","name":"Authenticate","type":"folder"}},"urlObject":{"protocol":"{{ProtocolOtds}}","port":"{{OtdsPort}}","path":["otdstenant","{{Tenant}}","otdsws","rest","authentication","credentials"],"host":["{{OtdsHost}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"c57c3d93-3f80-4575-a765-8a791eeb1ae6"},{"name":"Authenticate Multitenant","event":[{"listen":"test","script":{"id":"3c39f40b-e853-4f15-8b70-88aa4d30da6c","exec":["var jsonData = JSON.parse(responseBody);\r","postman.setEnvironmentVariable(\"OTDSTicket\", jsonData.ticket);"],"type":"text/javascript"}},{"listen":"prerequest","script":{"id":"9a961347-ed9e-43ad-aa46-7101a3b0291b","exec":[""],"type":"text/javascript"}}],"id":"be266211-64ae-452f-8e88-d3eb08607824","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"userName\": \"{{TenantUserName}}\",\n    \"password\": \"{{TenantUserPassword}}\"\n}","options":{"raw":{"language":"json"}}},"url":"{{ProtocolOtds}}://{{OtdsHost}}:{{OtdsPort}}/otdsws/rest/authentication/credentials","auth":{"type":"noauth","isInherited":true,"source":{"_postman_id":"20eb0c42-af7b-4155-a4c2-ff9dc6d42adf","id":"20eb0c42-af7b-4155-a4c2-ff9dc6d42adf","name":"Authenticate","type":"folder"}},"urlObject":{"protocol":"{{ProtocolOtds}}","port":"{{OtdsPort}}","path":["otdsws","rest","authentication","credentials"],"host":["{{OtdsHost}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"be266211-64ae-452f-8e88-d3eb08607824"}],"id":"20eb0c42-af7b-4155-a4c2-ff9dc6d42adf","description":"<p>Authentication is required to call most other APIs and should be your first step.</p>\n<p>Depending on how you have installed your tenants, you either have to use the <code>Authenticate Tenant</code> (when using a separate tenant OTDS) or <code>Authenticate Multitentant</code> (for example when using the default bootstrap installation) request.</p>\n<h2 id=\"required-variables\">Required variables</h2>\n<h3 id=\"environment-variables-to-populate-before-calling\">Environment variables to populate before calling</h3>\n<ul>\n<li><code>ProtocolOtds</code>: protocol used for authentication (http or https)</li>\n<li><code>OtdsHost</code>: fully qualified hostname of the OTDS server</li>\n<li><code>OtdsPort</code>: port for connecting to the OTDS server</li>\n<li><code>TenantUserName</code>: username for logging in (typically with the role of <code>tenant administrator</code>)</li>\n<li><code>TenantUserPassword</code>: matching password</li>\n</ul>\n<h3 id=\"environment-variables-populated-from-the-response\">Environment variables populated from the response</h3>\n<ul>\n<li><code>OTDSTicket</code>: the authorization ticket to use in the header for subsequent API calls</li>\n</ul>\n","auth":{"type":"noauth","isInherited":false},"event":[{"listen":"prerequest","script":{"id":"b2e0a472-943e-40e8-bc8c-22ff6c4b192d","type":"text/javascript","exec":[""]}},{"listen":"test","script":{"id":"575cb53a-b2d1-434c-b361-993c2a52c76b","type":"text/javascript","exec":[""]}}],"_postman_id":"20eb0c42-af7b-4155-a4c2-ff9dc6d42adf"},{"name":"Create batch document","item":[{"name":"Direct processing","event":[{"listen":"prerequest","script":{"id":"55e2ea73-9a87-4ed6-a593-83141215f950","exec":["var plainData = pm.environment.get('SourceDataPlain');","var encodedData = CryptoJS.enc.Base64.stringify(CryptoJS.enc.Utf8.parse(plainData));","","console.log(`Encoded source data: ${encodedData}`);","pm.environment.set(\"SourceDataBase64\", encodedData);"],"type":"text/javascript"}},{"listen":"test","script":{"id":"a2128b79-31d8-4771-93ca-7e7e907f996f","exec":["var jsonData = JSON.parse(responseBody);","","try {","    documentEncoded = jsonData.data.result[0].content.data;","    documentDecoded = atob(documentEncoded);","    ","    console.log('returned document encoded:\\n');","    console.log(documentEncoded);","    ","    console.log('returned document decoded:\\n');","    console.log(documentDecoded);","    ","    console.log('In macOS, to save the decoded file, run the following in your terminal: ');","    console.log('base64 -d -o ~/Desktop/decoded.pdf <<< ' + documentEncoded);","}","catch (error) {","    console.log('no document retrieved');","}"],"type":"text/javascript"}}],"id":"53e47f7e-d78d-4e35-b110-76947419713c","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"OTDSTicket","value":"{{OTDSTicket}}","type":"text"}],"body":{"mode":"raw","raw":"{\r\n\t\"theme\" : {\r\n        \"id\" : \"{{ThemeId}}\"\r\n    },\r\n    \"content\": {\r\n        \"contentType\": \"text/xml\",\r\n        \"data\": \"{{SourceDataBase64}}\"\r\n\t}\r\n}","options":{"raw":{"language":"json"}}},"url":"{{ProtocolExstream}}://{{ExstreamHost}}:{{ExstreamPort}}/v1/communications?name={{ServiceRequestInputName}}&version={{ExstreamProjectVersion}}","auth":{"type":"apikey","apikey":{"basicConfig":[{"key":"key","value":"OTDSTicket"},{"key":"value","value":"{{OTDSTicket}}"}]},"isInherited":true,"source":{"_postman_id":"4c0de704-ea37-4ef5-8eb7-f2e999bd41e3","id":"4c0de704-ea37-4ef5-8eb7-f2e999bd41e3","name":"Exstream 16.6 API","type":"collection"}},"urlObject":{"protocol":"{{ProtocolExstream}}","port":"{{ExstreamPort}}","path":["v1","communications"],"host":["{{ExstreamHost}}"],"query":[{"key":"name","value":"{{ServiceRequestInputName}}"},{"key":"version","value":"{{ExstreamProjectVersion}}"}],"variable":[]}},"response":[],"_postman_id":"53e47f7e-d78d-4e35-b110-76947419713c"},{"name":"HTTP Call","event":[{"listen":"prerequest","script":{"id":"35fb1ec9-4617-4b0e-80d0-c263aeebd6d3","exec":[""],"type":"text/javascript"}},{"listen":"test","script":{"id":"f44b95dc-3bcd-4a56-bd38-06bd13f1dedf","exec":[""],"type":"text/javascript"}}],"id":"ead92f74-ce70-4814-af91-4495478cba3f","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"OTDSTicket","type":"text","value":"{{OTDSTicket}}"}],"body":{"mode":"raw","raw":"{{SourceDataPlain}}","options":{"raw":{"language":"xml"}}},"url":"{{ProtocolExstream}}://{{ExstreamHost}}:30004/","auth":{"type":"apikey","apikey":{"basicConfig":[{"key":"key","value":"OTDSTicket"},{"key":"value","value":"{{OTDSTicket}}"}]},"isInherited":true,"source":{"_postman_id":"4c0de704-ea37-4ef5-8eb7-f2e999bd41e3","id":"4c0de704-ea37-4ef5-8eb7-f2e999bd41e3","name":"Exstream 16.6 API","type":"collection"}},"urlObject":{"protocol":"{{ProtocolExstream}}","port":"30004","path":[""],"host":["{{ExstreamHost}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"ead92f74-ce70-4814-af91-4495478cba3f"},{"name":"HTTP Call GRE","event":[{"listen":"prerequest","script":{"id":"c827e25a-9209-493d-843e-cde0b2b4ce52","exec":[""],"type":"text/javascript"}},{"listen":"test","script":{"id":"ceede9c6-ee23-4f07-ac1f-2494067529c2","exec":[""],"type":"text/javascript"}}],"id":"95a57f86-e5b7-4722-9822-b223ccd014e7","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"OTDSTicket","type":"text","value":"{{OTDSTicket}}"}],"body":{"mode":"raw","raw":"{{SourceDataPlain}}","options":{"raw":{"language":"xml"}}},"url":"{{ProtocolExstream}}://{{ExstreamHost}}:30004/gre","auth":{"type":"apikey","apikey":{"basicConfig":[{"key":"key","value":"OTDSTicket"},{"key":"value","value":"{{OTDSTicket}}"}]},"isInherited":true,"source":{"_postman_id":"4c0de704-ea37-4ef5-8eb7-f2e999bd41e3","id":"4c0de704-ea37-4ef5-8eb7-f2e999bd41e3","name":"Exstream 16.6 API","type":"collection"}},"urlObject":{"protocol":"{{ProtocolExstream}}","port":"30004","path":["gre"],"host":["{{ExstreamHost}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"95a57f86-e5b7-4722-9822-b223ccd014e7"}],"id":"0f9339e8-a5fa-47b4-b488-3983d1fa2a52","description":"<p>A batch document gets created bypassing the message store. Therefore, no release or approval step is required. This also means that a user cannot modify the document in <code>Retouch</code> before printing.</p>\n<p>Only one request is necessary to trigger this type of processing.</p>\n<p>Note: you can control if you want to return the document produced in the payload. Check <code>Include result in service response</code> in the (PDF) output connector under the <code>General</code> section of the logical layer for sending the result back in the response.</p>\n<p>The response carries the payload <code>base64</code> formated. In order to decode and save the content to a file, run the following in your terminal:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>base64 -d -o ~/Desktop/decoded.pdf &lt;&lt;&lt; EncodedString\n</code></pre><p>You will find the complete command in the <a href=\"https://blog.postman.com/2020/02/06/powerful-debugging-with-the-postman-console/\">debug console</a>: go to the <code>Application Menu &gt; View &gt; Show Postman Console</code>. In the console, you will also see the encoded and the decoded file. </p>\n<blockquote>\n<p>Please note, that you cannot copy the decoded file out of there, because Postman adds non-printable return characters to the output which breaks the binary files.</p>\n</blockquote>\n<h2 id=\"required-variables\">Required variables</h2>\n<h3 id=\"environment-variables-to-populate-before-calling\">Environment variables to populate before calling</h3>\n<ul>\n<li><code>ProtocolExstream</code>: protocol used for authentication (http or https)</li>\n<li><code>ExstreamHost</code>: fully qualified hostname for the Exstream server</li>\n<li><code>ExstreamPort</code>: REST port for the Exstream service gateway</li>\n<li><code>ServiceRequestInputName</code>: name of the service request as defined in the input connector.</li>\n<li><code>ExstreamProjectVersion</code>: Exstream project version (e.g. visible when checking out a project from the CAS next to the commit message)</li>\n<li><code>ThemeId</code>: optional. A valid id can be found by calling the request <code>List Themes</code> from the <code>Utilities</code> folder. If left out, you will get one output per theme.</li>\n<li><code>SourceDataPlain</code>: The XML source data to process.</li>\n</ul>\n<h3 id=\"environment-variables-populated-from-the-response\">Environment variables populated from the response</h3>\n<p>none</p>\n","event":[{"listen":"prerequest","script":{"id":"cd378f45-960a-4f48-8dee-e9015b074be3","type":"text/javascript","exec":["pm.test('OTDSTicket should be available', function () {","    pm.expect(pm.environment.has('OTDSTicket')).to.equal(true);","});","","pm.test('OTDSTicket should be set', function () {","    pm.expect(pm.environment.get(\"OTDSTicket\")).to.not.be.empty;","});"]}},{"listen":"test","script":{"id":"4d60f234-d7d9-4103-9670-b8e1dfe21d3c","type":"text/javascript","exec":[""]}}],"_postman_id":"0f9339e8-a5fa-47b4-b488-3983d1fa2a52","auth":{"type":"apikey","apikey":{"basicConfig":[{"key":"key","value":"OTDSTicket"},{"key":"value","value":"{{OTDSTicket}}"}]},"isInherited":true,"source":{"_postman_id":"4c0de704-ea37-4ef5-8eb7-f2e999bd41e3","id":"4c0de704-ea37-4ef5-8eb7-f2e999bd41e3","name":"Exstream 16.6 API","type":"collection"}}},{"name":"Create on-demand document","item":[{"name":"Create Document","event":[{"listen":"test","script":{"id":"79dac493-87a5-4601-afa8-cebbfa6748f3","exec":["var jsonData = JSON.parse(responseBody);\r","postman.setEnvironmentVariable(\"DocId\", jsonData.data.messageId);"],"type":"text/javascript"}},{"listen":"prerequest","script":{"id":"b3654335-ba06-4e1b-91f6-6035a8c77b98","exec":["var plainData = pm.environment.get('SourceDataPlain');","var encodedData = CryptoJS.enc.Base64.stringify(CryptoJS.enc.Utf8.parse(plainData));","","console.log(`Encoded source data: ${encodedData}`);","pm.environment.set(\"SourceDataBase64\", encodedData);"],"type":"text/javascript"}}],"id":"e23b0162-118a-4584-8a65-ee7a9a0623a1","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"equals":true,"key":"OTDSTicket","value":"{{OTDSTicket}}"}],"body":{"mode":"raw","raw":"{\n    \"theme\": {\n        \"id\": \"{{ThemeId}}\"\n    },\n    \"content\": {\n        \"data\": \"{{SourceDataBase64}}\",\n        \"contentType\": \"text/xml\"\n    }\n}","options":{"raw":{"language":"json"}}},"url":"{{ProtocolExstream}}://{{ExstreamHost}}:{{ExstreamPort}}/v3/documents","auth":{"type":"apikey","apikey":{"basicConfig":[{"key":"key","value":"OTDSTicket"},{"key":"value","value":"{{OTDSTicket}}"}]},"isInherited":true,"source":{"_postman_id":"4c0de704-ea37-4ef5-8eb7-f2e999bd41e3","id":"4c0de704-ea37-4ef5-8eb7-f2e999bd41e3","name":"Exstream 16.6 API","type":"collection"}},"urlObject":{"protocol":"{{ProtocolExstream}}","port":"{{ExstreamPort}}","path":["v3","documents"],"host":["{{ExstreamHost}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"e23b0162-118a-4584-8a65-ee7a9a0623a1"},{"name":"Approve document","event":[{"listen":"test","script":{"id":"01024a2f-6cc4-4234-b050-e50d5a314db5","exec":["var jsonData = JSON.parse(responseBody);\r","postman.setEnvironmentVariable(\"ApprovedRevision\", jsonData.data.revision);"],"type":"text/javascript"}}],"id":"968c25c5-93f9-4fc7-b9d7-22538440a9d5","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"PUT","header":[{"key":"OTDSTicket","value":"{{OTDSTicket}}","type":"text"}],"body":{"mode":"raw","raw":"{\n    \"state\": \"Approved\"\n}","options":{"raw":{"language":"json"}}},"url":"{{ProtocolExstream}}://{{ExstreamHost}}:{{ExstreamPort}}/v1/documents/{{DocId}}?where_revision=-1","auth":{"type":"apikey","apikey":{"basicConfig":[{"key":"key","value":"OTDSTicket"},{"key":"value","value":"{{OTDSTicket}}"}]},"isInherited":true,"source":{"_postman_id":"4c0de704-ea37-4ef5-8eb7-f2e999bd41e3","id":"4c0de704-ea37-4ef5-8eb7-f2e999bd41e3","name":"Exstream 16.6 API","type":"collection"}},"urlObject":{"protocol":"{{ProtocolExstream}}","port":"{{ExstreamPort}}","path":["v1","documents","{{DocId}}"],"host":["{{ExstreamHost}}"],"query":[{"key":"where_revision","value":"-1"}],"variable":[]}},"response":[],"_postman_id":"968c25c5-93f9-4fc7-b9d7-22538440a9d5"},{"name":"Release document","id":"b8a3c2cf-97b9-4f03-bf12-e2ffa34d8cd5","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"PUT","header":[{"key":"OTDSTicket","value":"{{OTDSTicket}}","type":"text"}],"body":{"mode":"raw","raw":"{\n    \"state\": \"Released\"\n}","options":{"raw":{"language":"json"}}},"url":"{{ProtocolExstream}}://{{ExstreamHost}}:{{ExstreamPort}}/v1/documents/{{DocId}}?where_revision={{ApprovedRevision}}","auth":{"type":"apikey","apikey":{"basicConfig":[{"key":"key","value":"OTDSTicket"},{"key":"value","value":"{{OTDSTicket}}"}]},"isInherited":true,"source":{"_postman_id":"4c0de704-ea37-4ef5-8eb7-f2e999bd41e3","id":"4c0de704-ea37-4ef5-8eb7-f2e999bd41e3","name":"Exstream 16.6 API","type":"collection"}},"urlObject":{"protocol":"{{ProtocolExstream}}","port":"{{ExstreamPort}}","path":["v1","documents","{{DocId}}"],"host":["{{ExstreamHost}}"],"query":[{"key":"where_revision","value":"{{ApprovedRevision}}"}],"variable":[]}},"response":[],"_postman_id":"b8a3c2cf-97b9-4f03-bf12-e2ffa34d8cd5"}],"id":"64f4b220-a0ca-45fc-bcb0-7c228ff42600","description":"<p>Producing an on-demand document involves a few steps:</p>\n<ul>\n<li>Creating a document which gets stored in the message queue</li>\n<li>The end user now has the option to modify the document using <code>Retouch</code>. This step is optional and currently not documented here.</li>\n<li>Approving the document created earlier</li>\n<li>Releasing the approved document</li>\n</ul>\n<p>Note: you can search for your document placed in the document store by calling <code>Get documents from message store</code> from the <code>Utilities</code> folder.</p>\n<h2 id=\"required-variables\">Required variables</h2>\n<h3 id=\"environment-variables-to-populate-before-calling\">Environment variables to populate before calling</h3>\n<ul>\n<li><code>ProtocolExstream</code>: protocol used for authentication (http or https)</li>\n<li><code>ExstreamHost</code>: fully qualified hostname for the Exstream server</li>\n<li><code>ExstreamPort</code>: REST port for the Exstream service gateway</li>\n<li><code>ThemeId</code>: a valid id can be found by calling the request <code>List Themes</code> from the <code>Utilities</code> folder. If left out, you will get one output per theme.</li>\n<li><code>SourceDataPlain</code>: The XML source data to process.</li>\n</ul>\n<h3 id=\"environment-variables-populated-from-the-response\">Environment variables populated from the response</h3>\n<ul>\n<li><code>DocId</code>: the message ID of the document generated.</li>\n</ul>\n","event":[{"listen":"prerequest","script":{"id":"1888e346-221d-4442-80b9-76fe999090ad","type":"text/javascript","exec":["pm.test('OTDSTicket should be available', function () {","    pm.expect(pm.environment.has('OTDSTicket')).to.equal(true);","});","","pm.test('OTDSTicket should be set', function () {","    pm.expect(pm.environment.get(\"OTDSTicket\")).to.not.be.empty;","});"]}},{"listen":"test","script":{"id":"06567580-5c27-47fa-9161-4cf3e642d5a4","type":"text/javascript","exec":[""]}}],"_postman_id":"64f4b220-a0ca-45fc-bcb0-7c228ff42600","auth":{"type":"apikey","apikey":{"basicConfig":[{"key":"key","value":"OTDSTicket"},{"key":"value","value":"{{OTDSTicket}}"}]},"isInherited":true,"source":{"_postman_id":"4c0de704-ea37-4ef5-8eb7-f2e999bd41e3","id":"4c0de704-ea37-4ef5-8eb7-f2e999bd41e3","name":"Exstream 16.6 API","type":"collection"}}},{"name":"Utilities","item":[{"name":"List Themes","event":[{"listen":"test","script":{"id":"0d6f7966-f419-48d6-90e4-4de9aa5aa064","exec":["var jsonData = JSON.parse(responseBody);\r","postman.setEnvironmentVariable(\"ThemeId\", jsonData.data[0].latestVersionId);"],"type":"text/javascript"}}],"id":"facb09ec-a84d-4e65-ab1e-85914bb25888","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"OTDSTicket","value":"{{OTDSTicket}}","equals":true}],"url":"{{ProtocolExstream}}://{{ExstreamHost}}:{{ExstreamPort}}/v1/themes","description":"<p>Get a list of all themes currently available in the system.</p>\n","auth":{"type":"apikey","apikey":{"basicConfig":[{"key":"key","value":"OTDSTicket"},{"key":"value","value":"{{OTDSTicket}}"}]},"isInherited":true,"source":{"_postman_id":"4c0de704-ea37-4ef5-8eb7-f2e999bd41e3","id":"4c0de704-ea37-4ef5-8eb7-f2e999bd41e3","name":"Exstream 16.6 API","type":"collection"}},"urlObject":{"protocol":"{{ProtocolExstream}}","port":"{{ExstreamPort}}","path":["v1","themes"],"host":["{{ExstreamHost}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"facb09ec-a84d-4e65-ab1e-85914bb25888"},{"name":"Get documents from message store","id":"051b1a6a-4953-4fd3-81bd-2de8a0b20bcf","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"{{ProtocolExstream}}://{{ExstreamHost}}:{{ExstreamPort}}/v1/documents?where_typeid=messageobject&fields=messageId,6B84E18B-F03D-350C-E040-007F0200026D","description":"<p>Get a list of all documents stored in the message store. The request is currently only outputting two fields: <code>message id</code> and <code>external message id</code>, but this can be changed by removing or adding additional fields from the <code>fields</code> parameter.</p>\n<p>Note: In order to populate the external ID, set a script on <code>Event retrieved</code>:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>// GUID for \"External Job ID\" is 6B84E18B-F03D-350C-E040-007F0200026D\n$msgId = \"AppOne-\" + getdatetime(\"YYYYMMDD\") + \"-\" + getdatetime(\"HHMMSS\");\nSetMetaDataMessage(\"6B84E18B-F03D-350C-E040-007F0200026D\", $msgId);\n</code></pre><p>Note: using the <code>Event retrieved</code> event is critical. Otherwise the ID will get set too late and is not written to the message store.</p>\n","auth":{"type":"apikey","apikey":{"basicConfig":[{"key":"key","value":"OTDSTicket"},{"key":"value","value":"{{OTDSTicket}}"}]},"isInherited":true,"source":{"_postman_id":"4c0de704-ea37-4ef5-8eb7-f2e999bd41e3","id":"4c0de704-ea37-4ef5-8eb7-f2e999bd41e3","name":"Exstream 16.6 API","type":"collection"}},"urlObject":{"protocol":"{{ProtocolExstream}}","port":"{{ExstreamPort}}","path":["v1","documents"],"host":["{{ExstreamHost}}"],"query":[{"key":"where_typeid","value":"messageobject"},{"description":{"content":"<p>Message ID and External Message ID</p>\n","type":"text/plain"},"key":"fields","value":"messageId,6B84E18B-F03D-350C-E040-007F0200026D"}],"variable":[]}},"response":[],"_postman_id":"051b1a6a-4953-4fd3-81bd-2de8a0b20bcf"},{"name":"List Services","event":[{"listen":"prerequest","script":{"id":"39957ba8-ef08-4f6f-a6e8-0e7228529de6","exec":["var plainData = pm.environment.get('SourceDataPlain');","var encodedData = CryptoJS.enc.Base64.stringify(CryptoJS.enc.Utf8.parse(plainData));","","console.log(`Encoded source data: ${encodedData}`);","pm.environment.set(\"SourceDataBase64\", encodedData);"],"type":"text/javascript"}},{"listen":"test","script":{"id":"38fa531d-670e-4c28-8904-1b86fa24762b","exec":["var jsonData = JSON.parse(responseBody);","","try {","    documentEncoded = jsonData.data.result[0].content.data;","    documentDecoded = atob(documentEncoded);","    ","    console.log('returned document encoded:\\n');","    console.log(documentEncoded);","    ","    console.log('returned document decoded:\\n');","    console.log(documentDecoded);","    ","    console.log('In macOS, to save the decoded file, run the following in your terminal: ');","    console.log('base64 -d -o ~/Desktop/decoded.pdf <<< ' + documentEncoded);","}","catch (error) {","    console.log('no document retrieved');","}"],"type":"text/javascript"}}],"id":"1871b533-d871-45c3-aeb6-0be4feefddd0","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"OTDSTicket","type":"text","value":"{{OTDSTicket}}"}],"body":{"mode":"raw","raw":"{\r\n\t\"theme\" : {\r\n            \"id\" : \"{{ThemeId}}\"\r\n      },\r\n      \"content\": {\r\n\t\t\"contentType\": \"text/xml\",\r\n\t\t\"data\": \"{{SourceDataBase64}}\"\r\n\t}\r\n}","options":{"raw":{"language":"json"}}},"url":"{{ProtocolExstream}}://{{ExstreamHost}}:{{ExstreamPort}}/v1/services?ignore_templates=true","auth":{"type":"apikey","apikey":{"basicConfig":[{"key":"key","value":"OTDSTicket"},{"key":"value","value":"{{OTDSTicket}}"}]},"isInherited":true,"source":{"_postman_id":"4c0de704-ea37-4ef5-8eb7-f2e999bd41e3","id":"4c0de704-ea37-4ef5-8eb7-f2e999bd41e3","name":"Exstream 16.6 API","type":"collection"}},"urlObject":{"protocol":"{{ProtocolExstream}}","port":"{{ExstreamPort}}","path":["v1","services"],"host":["{{ExstreamHost}}"],"query":[{"key":"ignore_templates","value":"true"}],"variable":[]}},"response":[],"_postman_id":"1871b533-d871-45c3-aeb6-0be4feefddd0"}],"id":"4875ae9a-099a-4a70-a66f-1327ba968c07","event":[{"listen":"prerequest","script":{"id":"b13ddf77-daab-47a3-b664-c8d84d870b32","type":"text/javascript","exec":["pm.test('OTDSTicket should be available', function () {","    pm.expect(pm.environment.has('OTDSTicket')).to.equal(true);","});","","pm.test('OTDSTicket should be set', function () {","    pm.expect(pm.environment.get(\"OTDSTicket\")).to.not.be.empty;","});"]}},{"listen":"test","script":{"id":"9d46af62-f554-4ddc-b56e-b15b686913e9","type":"text/javascript","exec":[""]}}],"_postman_id":"4875ae9a-099a-4a70-a66f-1327ba968c07","description":"","auth":{"type":"apikey","apikey":{"basicConfig":[{"key":"key","value":"OTDSTicket"},{"key":"value","value":"{{OTDSTicket}}"}]},"isInherited":true,"source":{"_postman_id":"4c0de704-ea37-4ef5-8eb7-f2e999bd41e3","id":"4c0de704-ea37-4ef5-8eb7-f2e999bd41e3","name":"Exstream 16.6 API","type":"collection"}}},{"name":"Beta","item":[{"name":"Trigger Exstream from Web Form","id":"3ab34218-dd8a-4893-92a0-11597899708d","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"body":{"mode":"formdata","formdata":[{"key":"Begin","value":"authenticate","type":"text"},{"key":"user","value":"exuser","type":"text"},{"key":"password","value":"opentext","type":"text"}]},"url":"localhost:8001?","description":"<h2 id=\"work-in-progress\">Work in progress</h2>\n<p>Submit a HTML form to a StreamIn event listening at an http port.</p>\n","auth":{"type":"apikey","apikey":{"basicConfig":[{"key":"key","value":"OTDSTicket"},{"key":"value","value":"{{OTDSTicket}}"}]},"isInherited":true,"source":{"_postman_id":"4c0de704-ea37-4ef5-8eb7-f2e999bd41e3","id":"4c0de704-ea37-4ef5-8eb7-f2e999bd41e3","name":"Exstream 16.6 API","type":"collection"}},"urlObject":{"port":"8001","host":["localhost"],"query":[{"key":"","value":null},{"disabled":true,"key":"Content-type","value":"application/json"}],"variable":[]}},"response":[],"_postman_id":"3ab34218-dd8a-4893-92a0-11597899708d"}],"id":"17d81ceb-0945-46a2-8957-f44c84eccaf3","description":"<p>These requests are currently being worked on and might not be functional.</p>\n","_postman_id":"17d81ceb-0945-46a2-8957-f44c84eccaf3","auth":{"type":"apikey","apikey":{"basicConfig":[{"key":"key","value":"OTDSTicket"},{"key":"value","value":"{{OTDSTicket}}"}]},"isInherited":true,"source":{"_postman_id":"4c0de704-ea37-4ef5-8eb7-f2e999bd41e3","id":"4c0de704-ea37-4ef5-8eb7-f2e999bd41e3","name":"Exstream 16.6 API","type":"collection"}}}],"auth":{"type":"apikey","apikey":{"basicConfig":[{"key":"key","value":"OTDSTicket"},{"key":"value","value":"{{OTDSTicket}}"}]}},"event":[{"listen":"prerequest","script":{"id":"e9e01190-8742-4aa6-b0a2-b81a4bbb2f0c","type":"text/javascript","exec":[""]}},{"listen":"test","script":{"id":"81ac3bb5-f92b-4999-aba1-87c60348596e","type":"text/javascript","exec":[""]}}]}