{ "info": { "_postman_id": "4168a5e6-e0e3-448e-bdfa-1fccd8808d91", "name": "API embedded editor", "description": "API Embedded Editor\r\n\r\nThis Postman Collection does the following:\r\n\r\n#1 Authorise the API Token\r\nThis is a check to ensure the URL and API Token you are using is valid.\r\n\r\n#2 Get a specific User GUID\r\nFetch the Customer ID from admin of the customer you want to place an order on behalf of\r\nWhen you submit this request, in the response there is a field called \"Guid\", store this value as you need to use it in step #3\r\n\r\n#3 Get Editor URL for a particular product and User\r\nTake the Guid from Step #2 and update the API request to pass that as the id.\r\nUpdate the ProductId to the Id of the product you want to load up in an iframe\r\nThe response will provide you with a URL - click on the URL and load it in the browser, this will auto log you in as the customer you selected in step 2, and load up the product you selected in step 3.\r\nModify the URL so that the query string changes from this:\r\n?orderProductId=39&inIFrame=True&embeddedMode=False&embbedOperationMode=False\r\nTo this:\r\n?orderProductId=39&inIFrame=True&embbedOperationMode=True\r\n*WHERE embeddedOperationMode is True*\r\nThen reload the editor with the correct, amended link.\r\n\r\nOnce you have finished, click on the save button.\r\n\r\nin the URL extract the Job ID (orderProductId=)\r\n\r\n#4 Place order using Record Order\r\nUpdate the RecordOrder request to use the Job Id you capture in the previous step and the correct customer ID.\r\nThe response should provide you with a relevant error message if it is incorrect\r\nIf submission is successful it will return a Catfish Order ID - store this.\r\n\r\n#5 Update the status\r\nUpdate the request with the Order ID you stored from the previous step", "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json" }, "item": [ { "name": "00 - Auth check", "request": { "auth": { "type": "basic", "basic": [ { "key": "username", "value": "{{APIToken}}", "type": "string" }, { "key": "password", "value": "", "type": "string" } ] }, "method": "GET", "header": [ { "key": "Authorization", "value": "Basic TlRCbE1EaG1ObVV0TXpnNVppMDBaVEJpTFRsbVpqY3ROVGxqT0dWbE1qQTJaRGhsOg==" } ], "url": { "raw": "{{HostURL}}/services/api/Auth?id={{APIToken}}", "host": [ "{{HostURL}}" ], "path": [ "services", "api", "Auth" ], "query": [ { "key": "id", "value": "{{APIToken}}" } ] }, "description": "This API request is really purely to ensure the API Token and connection is working as expected. Not required in the full implementation when ready to go live." }, "response": [] }, { "name": "01 - Get Customer GUID", "event": [ { "listen": "test", "script": { "id": "e7058d53-63e6-437d-8669-b55c8d6493a8", "exec": [ "var responseJSON;", "try {", " responseJSON = JSON.parse(responseBody);", " postman.setEnvironmentVariable(\"CustomerGUID\", responseJSON.Guid);", "}", "catch (e) {}" ], "type": "text/javascript" } } ], "request": { "auth": { "type": "basic", "basic": [ { "key": "username", "value": "{{APIToken}}", "type": "string" }, { "key": "password", "value": "", "type": "string" } ] }, "method": "GET", "header": [], "url": { "raw": "{{HostURL}}/services/api/Customer/Get/{{CustomerId}}", "host": [ "{{HostURL}}" ], "path": [ "services", "api", "Customer", "Get", "{{CustomerId}}" ] }, "description": "This API request is used to obtain specific Customer information based on a Customer ID" }, "response": [] }, { "name": "02 - Get Editor URL", "event": [ { "listen": "test", "script": { "id": "65ee4f7e-64b5-428c-a44a-d33415d8e6be", "exec": [ "var responseJSON;", "try {", " responseJSON = JSON.parse(responseBody);", " postman.setEnvironmentVariable(\"EditorURL\", responseJSON);", "}", "catch (e) {}" ], "type": "text/javascript" } } ], "request": { "auth": { "type": "basic", "basic": [ { "key": "username", "value": "{{APIToken}}", "type": "string" }, { "key": "password", "value": "", "type": "string" } ] }, "method": "GET", "header": [ { "key": "Authorization", "value": "Basic TlRCbE1EaG1ObVV0TXpnNVppMDBaVEJpTFRsbVpqY3ROVGxqT0dWbE1qQTJaRGhsOg==" } ], "url": { "raw": "{{HostURL}}/services/api/Editor/LinkFor?id={{CustomerGUID}}&productId={{ProductId}}&embeddedMode=false&embeddedOperationMode=true", "host": [ "{{HostURL}}" ], "path": [ "services", "api", "Editor", "LinkFor" ], "query": [ { "key": "id", "value": "{{CustomerGUID}}" }, { "key": "productId", "value": "{{ProductId}}" }, { "key": "embeddedMode", "value": "false" }, { "key": "embeddedOperationMode", "value": "true" } ] }, "description": "This API request is used to fetch the Editor URL. By passing the Customer GUID it will also use a single sign on approach to ensure that job is assigned only to that customer and passing the product ID will ensure the correct editor and product is then loaded." }, "response": [] }, { "name": "02a - Simulate Editor URL", "request": { "auth": { "type": "basic", "basic": [ { "key": "username", "value": "{{APIToken}}", "type": "string" }, { "key": "password", "value": "", "type": "string" } ] }, "method": "GET", "header": [ { "key": "Authorization", "value": "Basic TlRCbE1EaG1ObVV0TXpnNVppMDBaVEJpTFRsbVpqY3ROVGxqT0dWbE1qQTJaRGhsOg==" } ], "url": { "raw": "{{HostURL}}{{EditorURL}}", "host": [ "{{HostURL}}{{EditorURL}}" ] }, "description": "This is not an API request - its purely there to build the resulting Editor URL that you can then take and put into your iframe.html page." }, "response": [] }, { "name": "03 - Record Order", "event": [ { "listen": "test", "script": { "id": "9a1b4487-987b-4d9b-a152-3ac3fae1d752", "exec": [ "// TODO: Capture the Order ID returned in the response and store it" ], "type": "text/javascript" } } ], "request": { "method": "POST", "header": [ { "key": "Authorization", "value": "Basic TlRCbE1EaG1ObVV0TXpnNVppMDBaVEJpTFRsbVpqY3ROVGxqT0dWbE1qQTJaRGhsOg==" }, { "key": "Content-Type", "value": "application/json" } ], "body": { "mode": "raw", "raw": "{\r\n\t\"CallbackUrl\": \"\",\r\n\t\"BillingAddress\": {\r\n\t\t\"AddressLine2\": \"\",\r\n\t\t\"AddressLine1\": \"Belgrave House\",\r\n\t\t\"Email\": \"api@infigosoftware.com\",\r\n\t\t\"Town\": \"Crawley\",\r\n\t\t\"ZipPostalCode\": \"RH10 1HU\",\r\n\t\t\"FirstName\": \"Test\",\r\n \"LastName\": \"API\",\r\n\t\t\"StateProvince\": \"West Sussex\",\r\n\t\t\"Country\": \"GB\"\r\n\t},\r\n\t\"PurchaseOrderNumber\": \"\",\r\n\t\"OrderLineItems\": [{\r\n\t\t\"NopProductId\": \"{{ProductId}}\",\r\n\t\t\"ExternalProductId\": \"12345\",\r\n\t\t\"Quantity\": 1,\r\n\t\t\"JobId\": \"{{JobId}}\"\r\n\t}],\r\n\t\"ExternalOrderId\": \"12345\",\r\n\t\"CatfishDeliveryMethod\": \"DEFAULT\",\r\n\t\"DeliveryAddress\": {\r\n\t\t\"AddressLine2\": \"\",\r\n\t\t\"AddressLine1\": \"Belgrave House\",\r\n\t\t\"Email\": \"api@infigosoftware.com\",\r\n\t\t\"Town\": \"Crawley\",\r\n\t\t\"ZipPostalCode\": \"RH10 1HU\",\r\n\t\t\"FirstName\": \"Test\",\r\n \"LastName\": \"API\",\r\n\t\t\"StateProvince\": \"West Sussex\",\r\n\t\t\"Country\": \"GB\"\r\n\t},\r\n\t\"IsPaymentPaid\": \"TRUE\",\r\n\t\"CatfishCustomerId\": \"{{CustomerId}}\"\r\n}\r\n" }, "url": { "raw": "{{HostURL}}/services/api/Order/RecordOrder", "host": [ "{{HostURL}}" ], "path": [ "services", "api", "Order", "RecordOrder" ] }, "description": "This Record Order API places a full order in Catfish as if it was placed manually on the site. All the information required to fullfill the order on the storefront is required here for it to be successful." }, "response": [] }, { "name": "03 - Request Output", "event": [ { "listen": "test", "script": { "id": "163b1158-3110-4241-aa26-711e0dff93f7", "exec": [ "" ], "type": "text/javascript" } } ], "request": { "auth": { "type": "basic", "basic": [ { "key": "username", "value": "{{APIToken}}", "type": "string" } ] }, "method": "POST", "header": [ { "key": "Content-Type", "value": "application/json" } ], "body": { "mode": "raw", "raw": "" }, "url": { "raw": "{{HostURL}}/services/api/OrderlineItem/CreateOutputFor/{id}?id={{JobId}}", "host": [ "{{HostURL}}" ], "path": [ "services", "api", "OrderlineItem", "CreateOutputFor", "{id}" ], "query": [ { "key": "id", "value": "{{JobId}}" } ] }, "description": "This output request API request does not create an order in Catfish but instead just creates an output file and returns it. There will be no trace of an order in Catfish for this at all." }, "response": [] } ], "protocolProfileBehavior": {} }