diff --git a/README.md b/README.md index fd084a0..9c66250 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Nitro Platform Integrations +# Nitro Platform Sample Code This repository provides production-ready examples and tools for integrating with the Nitro Platform API and Nitro Sign API, enabling document conversion, extraction, transformation, workflow automation, and eSignature capabilities. diff --git a/postman/Nitro Automation Platform APIs.postman_collection.json b/postman/Nitro Automation Platform APIs.postman_collection.json new file mode 100644 index 0000000..5558cd0 --- /dev/null +++ b/postman/Nitro Automation Platform APIs.postman_collection.json @@ -0,0 +1,2193 @@ +{ + "info": { + "_postman_id": "9155a7ef-8df4-4ca4-8663-cae66cf9f225", + "name": "Nitro Automation Platform APIs", + "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json", + "_exporter_id": "49176897", + "_collection_link": "https://go.postman.co/collection/49176897-9155a7ef-8df4-4ca4-8663-cae66cf9f225?source=collection_link" + }, + "item": [ + { + "name": "Authorization", + "item": [ + { + "name": "Get Bearer Token", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "// Parse the response", + "let responseData = pm.response.json();", + "", + "// Store token in an environment variable", + "pm.environment.set(\"token\", responseData.accessToken);", + "", + "// Optional: Log it to the Postman console", + "console.log(\"Token saved:\", responseData.token);" + ], + "type": "text/javascript", + "packages": {}, + "requests": {} + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"clientID\": \"{{clientID}}\",\n \"clientSecret\": \"{{clientSecret}}\"\n}" + }, + "url": { + "raw": "{{baseUrl}}/oauth/token", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "oauth", + "token" + ] + }, + "description": "Generated from cURL: curl --request POST \\\n --url https://api.gonitro.dev/oauth/token \\\n --header 'Content-Type: application/json' \\\n --data '{\n \"clientID\": \"\",\n \"clientSecret\": \"\"\n}'" + }, + "response": [] + } + ], + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "// Authorization folder: Validate status codes and response structure", + "pm.test(\"Status code is 200 or 201\", function () {", + " pm.expect(pm.response.code).to.be.oneOf([200, 201]);", + "});", + "pm.test(\"Response has expected properties\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData).to.be.an('object');", + " pm.expect(jsonData).to.have.any.keys('access_token', 'token_type', 'expires_in');", + "});" + ] + } + } + ] + }, + { + "name": "Conversions", + "item": [ + { + "name": "Word → PDF", + "protocolProfileBehavior": { + "followRedirects": true, + "disableUrlEncoding": false, + "disableCookies": false + }, + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{token}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "Authorization", + "value": "Bearer {{token}}" + }, + { + "key": "Content-Type", + "value": "multipart/form-data" + } + ], + "body": { + "mode": "formdata", + "formdata": [ + { + "key": "method", + "value": "convert" + }, + { + "key": "params", + "value": "{\"to\": \"pdf\"}" + }, + { + "key": "file", + "type": "file", + "src": "Analysis.docx" + } + ] + }, + "url": { + "raw": "{{baseUrl}}/conversions", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "conversions" + ] + }, + "description": "Upload a Word document (.doc, .docx, .dot, .xml, .docm, .dotx, .dotm, .rtf) and convert to PDF." + }, + "response": [] + }, + { + "name": "Excel → PDF", + "protocolProfileBehavior": { + "followRedirects": true, + "disableUrlEncoding": false, + "disableCookies": false + }, + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{token}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "Authorization", + "value": "Bearer {{token}}" + }, + { + "key": "Content-Type", + "value": "multipart/form-data" + } + ], + "body": { + "mode": "formdata", + "formdata": [ + { + "key": "method", + "value": "convert" + }, + { + "key": "params", + "value": "{\"to\": \"pdf\"}" + }, + { + "key": "file", + "type": "file", + "src": "Feedback.xlsx" + } + ] + }, + "url": { + "raw": "{{baseUrl}}/conversions", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "conversions" + ] + }, + "description": "Upload an Excel workbook (.xlsx, .xls, .xlt, .xlsm, .xltx, .xltm) and convert to PDF." + }, + "response": [] + }, + { + "name": "PowerPoint → PDF", + "protocolProfileBehavior": { + "followRedirects": true, + "disableUrlEncoding": false, + "disableCookies": false + }, + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{token}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "Authorization", + "value": "Bearer {{token}}" + }, + { + "key": "Content-Type", + "value": "multipart/form-data" + } + ], + "body": { + "mode": "formdata", + "formdata": [ + { + "key": "method", + "value": "convert" + }, + { + "key": "params", + "value": "{\"to\": \"pdf\"}" + }, + { + "key": "file", + "value": "", + "type": "file" + } + ] + }, + "url": { + "raw": "{{baseUrl}}/conversions", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "conversions" + ] + }, + "description": "Upload a PowerPoint file (.pptx, .ppt) and convert to PDF." + }, + "response": [] + }, + { + "name": "Image → PDF", + "protocolProfileBehavior": { + "followRedirects": true, + "disableUrlEncoding": false, + "disableCookies": false + }, + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{token}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "Authorization", + "value": "Bearer {{token}}" + }, + { + "key": "Content-Type", + "value": "multipart/form-data" + } + ], + "body": { + "mode": "formdata", + "formdata": [ + { + "key": "method", + "value": "convert" + }, + { + "key": "params", + "value": "{\"to\": \"pdf\"}" + }, + { + "key": "file", + "type": "file", + "src": "GoNitro.png" + } + ] + }, + "url": { + "raw": "{{baseUrl}}/conversions", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "conversions" + ] + }, + "description": "Upload an image (.png, .jpg, .jpeg, .tiff) and convert to PDF." + }, + "response": [] + }, + { + "name": "PDF → Word", + "protocolProfileBehavior": { + "followRedirects": true, + "disableUrlEncoding": false, + "disableCookies": false + }, + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{token}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "Authorization", + "value": "Bearer {{token}}" + }, + { + "key": "Content-Type", + "value": "multipart/form-data" + } + ], + "body": { + "mode": "formdata", + "formdata": [ + { + "key": "method", + "value": "convert" + }, + { + "key": "params", + "value": "{\"to\": \"docx\"}" + }, + { + "key": "file", + "type": "file", + "src": "SampleResume.pdf" + } + ] + }, + "url": { + "raw": "{{baseUrl}}/conversions", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "conversions" + ] + }, + "description": "Upload a PDF and convert to Word (docx)." + }, + "response": [] + }, + { + "name": "PDF → Excel", + "protocolProfileBehavior": { + "followRedirects": true, + "disableUrlEncoding": false, + "disableCookies": false + }, + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{token}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "Authorization", + "value": "Bearer {{token}}" + }, + { + "key": "Content-Type", + "value": "multipart/form-data" + } + ], + "body": { + "mode": "formdata", + "formdata": [ + { + "key": "method", + "value": "convert" + }, + { + "key": "params", + "value": "{\"to\": \"xlsx\"}" + }, + { + "key": "file", + "type": "file", + "src": "Sample Tables.pdf" + } + ] + }, + "url": { + "raw": "{{baseUrl}}/conversions", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "conversions" + ] + }, + "description": "Upload a PDF and convert to Excel (xlsx)." + }, + "response": [] + }, + { + "name": "PDF → Image", + "protocolProfileBehavior": { + "followRedirects": true, + "disableUrlEncoding": false, + "disableCookies": false + }, + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{token}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "Authorization", + "value": "Bearer {{token}}" + }, + { + "key": "Content-Type", + "value": "multipart/form-data" + } + ], + "body": { + "mode": "formdata", + "formdata": [ + { + "key": "method", + "value": "convert" + }, + { + "key": "params", + "value": "{\"to\": \"png\"}" + }, + { + "key": "file", + "type": "file", + "src": "SampleResume.pdf" + } + ] + }, + "url": { + "raw": "{{baseUrl}}/conversions", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "conversions" + ] + }, + "description": "Upload a PDF and convert to image (png/jpg). Modify the `to` field for the desired format." + }, + "response": [] + } + ], + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "// Conversions folder: Validate status codes and response structure", + "pm.test(\"Status code is 200 or 201\", function () {", + " pm.expect(pm.response.code).to.be.oneOf([200, 201]);", + "});", + "pm.test(\"Response has expected properties\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData).to.be.an('object');", + " pm.expect(jsonData).to.have.any.keys('jobId', 'status', 'outputUrl');", + "});" + ] + } + } + ] + }, + { + "name": "Extractions", + "item": [ + { + "name": "Extract PDF Text", + "protocolProfileBehavior": { + "followRedirects": true, + "disableUrlEncoding": false, + "disableCookies": false + }, + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{token}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "Authorization", + "value": "Bearer {{token}}" + }, + { + "key": "Content-Type", + "value": "multipart/form-data" + } + ], + "body": { + "mode": "formdata", + "formdata": [ + { + "key": "method", + "value": "extract-text" + }, + { + "key": "params", + "value": "{}" + }, + { + "key": "file", + "type": "file", + "src": "SampleResume.pdf" + } + ] + }, + "url": { + "raw": "{{baseUrl}}/extractions", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "extractions" + ] + }, + "description": "Extract plain text from the file." + }, + "response": [] + }, + { + "name": "Extract PDF Form Data", + "protocolProfileBehavior": { + "followRedirects": true, + "disableUrlEncoding": false, + "disableCookies": false + }, + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{token}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "Authorization", + "value": "Bearer {{token}}" + }, + { + "key": "Content-Type", + "value": "multipart/form-data" + } + ], + "body": { + "mode": "formdata", + "formdata": [ + { + "key": "method", + "value": "extract-forms" + }, + { + "key": "params", + "value": "{}" + }, + { + "key": "file", + "type": "file", + "src": "BOB - Student-Loan-Application-Form.pdf" + } + ] + }, + "url": { + "raw": "{{baseUrl}}/extractions", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "extractions" + ] + }, + "description": "Extract form field data." + }, + "response": [] + }, + { + "name": "Extract PDF Table Data", + "protocolProfileBehavior": { + "followRedirects": true, + "disableUrlEncoding": false, + "disableCookies": false + }, + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{token}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "Authorization", + "value": "Bearer {{token}}" + }, + { + "key": "Content-Type", + "value": "multipart/form-data" + } + ], + "body": { + "mode": "formdata", + "formdata": [ + { + "key": "method", + "value": "extract-tables" + }, + { + "key": "params", + "value": "{}" + }, + { + "key": "file", + "type": "file", + "src": "Sample Tables.pdf" + } + ] + }, + "url": { + "raw": "{{baseUrl}}/extractions", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "extractions" + ] + }, + "description": "Extract tabular data." + }, + "response": [] + }, + { + "name": "Extract and Autodetect Bounding Boxes for PII", + "protocolProfileBehavior": { + "followRedirects": true, + "disableUrlEncoding": false, + "disableCookies": false + }, + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{token}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "Authorization", + "value": "Bearer {{token}}" + }, + { + "key": "Content-Type", + "value": "multipart/form-data" + } + ], + "body": { + "mode": "formdata", + "formdata": [ + { + "key": "method", + "value": "pii-bbox-extraction" + }, + { + "key": "params", + "value": "{\"language\":\"en\"}" + }, + { + "key": "file", + "type": "file", + "src": "SampleResume.pdf" + } + ] + }, + "url": { + "raw": "{{baseUrl}}/extractions", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "extractions" + ] + }, + "description": "Detect PII and return bounding boxes." + }, + "response": [] + }, + { + "name": "Extract Bounding Boxes for Strings", + "protocolProfileBehavior": { + "followRedirects": true, + "disableUrlEncoding": false, + "disableCookies": false + }, + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{token}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "Authorization", + "value": "Bearer {{token}}" + }, + { + "key": "Content-Type", + "value": "multipart/form-data" + } + ], + "body": { + "mode": "formdata", + "formdata": [ + { + "key": "method", + "value": "text-bbox-extraction" + }, + { + "key": "params", + "value": "{ \"texts\": [ \"Professional\", \"Location\" ]}" + }, + { + "key": "file", + "type": "file", + "src": "SampleResume.pdf" + } + ] + }, + "url": { + "raw": "{{baseUrl}}/extractions", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "extractions" + ] + }, + "description": "Return coordinates for given strings." + }, + "response": [] + }, + { + "name": "Get PDF Properties", + "protocolProfileBehavior": { + "followRedirects": true, + "disableUrlEncoding": false, + "disableCookies": false + }, + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{token}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "Authorization", + "value": "Bearer {{token}}" + }, + { + "key": "Content-Type", + "value": "multipart/form-data" + } + ], + "body": { + "mode": "formdata", + "formdata": [ + { + "key": "method", + "value": "get-properties" + }, + { + "key": "params", + "value": "{}" + }, + { + "key": "file", + "type": "file", + "src": "SampleResume.pdf" + } + ] + }, + "url": { + "raw": "{{baseUrl}}/extractions", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "extractions" + ] + }, + "description": "Return document properties/metadata." + }, + "response": [] + }, + { + "name": "Set PDF Properties", + "protocolProfileBehavior": { + "followRedirects": true, + "disableUrlEncoding": false, + "disableCookies": false + }, + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{token}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "Authorization", + "value": "Bearer {{token}}" + }, + { + "key": "Content-Type", + "value": "multipart/form-data" + } + ], + "body": { + "mode": "formdata", + "formdata": [ + { + "key": "method", + "value": "set-properties" + }, + { + "key": "params", + "value": "{\"title\": \"the-title\"}" + }, + { + "key": "file", + "type": "file", + "src": "SampleResume.pdf" + } + ] + }, + "url": { + "raw": "{{baseUrl}}/transformations", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "transformations" + ] + }, + "description": "Set document properties/metadata." + }, + "response": [] + } + ], + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "// Extractions folder: Validate status codes and response structure", + "pm.test(\"Status code is 200 or 201\", function () {", + " pm.expect(pm.response.code).to.be.oneOf([200, 201]);", + "});", + "pm.test(\"Response has expected properties\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData).to.be.an('object');", + " pm.expect(jsonData).to.have.any.keys('extractedData', 'status');", + "});" + ] + } + } + ] + }, + { + "name": "Transformations", + "item": [ + { + "name": "Redact Bounding boxes (scrub PII)", + "protocolProfileBehavior": { + "followRedirects": true, + "disableUrlEncoding": false, + "disableCookies": false + }, + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{token}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "Authorization", + "value": "Bearer {{token}}" + }, + { + "key": "Content-Type", + "value": "multipart/form-data" + } + ], + "body": { + "mode": "formdata", + "formdata": [ + { + "key": "method", + "value": "redact" + }, + { + "key": "params", + "value": "{\n \"redactions\": [\n {\n \"pageIndex\": 0,\n \"boundingBox\": [\n 0.181746726,\n 0.170494927,\n 0.308388903,\n 0.188994937\n ],\n \"PIIType\": \"PHONE\",\n \"confidence\": 0.99\n },\n {\n \"pageIndex\": 0,\n \"boundingBox\": [\n 0.117687911,\n 0.106075797,\n 0.234256545,\n 0.124575798\n ],\n \"PIIType\": \"NAME\",\n \"confidence\": 0.99\n }\n ]\n}\n" + }, + { + "key": "file", + "type": "file", + "src": "SampleResume.pdf" + } + ] + }, + "url": { + "raw": "{{baseUrl}}/transformations", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "transformations" + ] + }, + "description": "Redact sensitive data from documents." + }, + "response": [] + }, + { + "name": "Compress", + "protocolProfileBehavior": { + "followRedirects": true, + "disableUrlEncoding": false, + "disableCookies": false + }, + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{token}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "Authorization", + "value": "Bearer {{token}}" + }, + { + "key": "Content-Type", + "value": "multipart/form-data" + } + ], + "body": { + "mode": "formdata", + "formdata": [ + { + "key": "method", + "value": "compress" + }, + { + "key": "params", + "value": "{\"level\": 2}" + }, + { + "key": "file", + "type": "file", + "src": "BOB - Student-Loan-Application-Form.pdf" + } + ] + }, + "url": { + "raw": "{{baseUrl}}/transformations", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "transformations" + ] + }, + "description": "Compress the PDF size." + }, + "response": [] + }, + { + "name": "Optomize", + "protocolProfileBehavior": { + "followRedirects": true, + "disableUrlEncoding": false, + "disableCookies": false + }, + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{token}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "Authorization", + "value": "Bearer {{token}}" + }, + { + "key": "Content-Type", + "value": "multipart/form-data" + } + ], + "body": { + "mode": "formdata", + "formdata": [ + { + "key": "method", + "value": "compress" + }, + { + "key": "params", + "value": "{\"level\": 2}" + }, + { + "key": "file", + "type": "file", + "src": "BOB - Student-Loan-Application-Form.pdf" + } + ] + }, + "url": { + "raw": "{{baseUrl}}/transformations", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "transformations" + ] + }, + "description": "Compress the PDF size." + }, + "response": [] + }, + { + "name": "Flatten", + "protocolProfileBehavior": { + "followRedirects": true, + "disableUrlEncoding": false, + "disableCookies": false + }, + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{token}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "Authorization", + "value": "Bearer {{token}}" + }, + { + "key": "Content-Type", + "value": "multipart/form-data" + } + ], + "body": { + "mode": "formdata", + "formdata": [ + { + "key": "method", + "value": "flatten" + }, + { + "key": "params", + "value": "{}" + }, + { + "key": "file", + "type": "file", + "src": "Sample Tables.pdf" + } + ] + }, + "url": { + "raw": "{{baseUrl}}/transformations", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "transformations" + ] + }, + "description": "Flatten annotations/form fields." + }, + "response": [] + }, + { + "name": "Rotate Pages", + "protocolProfileBehavior": { + "followRedirects": true, + "disableUrlEncoding": false, + "disableCookies": false + }, + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{token}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "Authorization", + "value": "Bearer {{token}}" + }, + { + "key": "Content-Type", + "value": "multipart/form-data" + } + ], + "body": { + "mode": "formdata", + "formdata": [ + { + "key": "method", + "value": "rotate" + }, + { + "key": "params", + "value": "{ \"rotations\": [ { \"page_index\": 0, \"amount\": 90 }, { \"page_index\": 1, \"amount\": -90 } ]}" + }, + { + "key": "file", + "type": "file", + "src": "SampleResume.pdf" + } + ] + }, + "url": { + "raw": "{{baseUrl}}/transformations", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "transformations" + ] + }, + "description": "Rotate pages by angle." + }, + "response": [] + }, + { + "name": "Delete Pages", + "protocolProfileBehavior": { + "followRedirects": true, + "disableUrlEncoding": false, + "disableCookies": false + }, + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{token}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "Authorization", + "value": "Bearer {{token}}" + }, + { + "key": "Content-Type", + "value": "multipart/form-data" + } + ], + "body": { + "mode": "formdata", + "formdata": [ + { + "key": "method", + "value": "delete-pages" + }, + { + "key": "params", + "value": "{\n\t\"pageIndices\": [\n\t\t0,\n\t\t2\n\t]\n}" + }, + { + "key": "file", + "type": "file", + "src": "SampleResume.pdf" + } + ] + }, + "url": { + "raw": "{{baseUrl}}/transformations", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "transformations" + ] + }, + "description": "Delete specific pages." + }, + "response": [] + }, + { + "name": "Split", + "protocolProfileBehavior": { + "followRedirects": true, + "disableUrlEncoding": false, + "disableCookies": false + }, + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{token}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "Authorization", + "value": "Bearer {{token}}" + }, + { + "key": "Content-Type", + "value": "multipart/form-data" + } + ], + "body": { + "mode": "formdata", + "formdata": [ + { + "key": "method", + "value": "split" + }, + { + "key": "params", + "value": "{ \"pageIndices\": [ [0, 2], [1, 3, 4] ]}" + }, + { + "key": "file", + "type": "file", + "src": "SampleResume.pdf" + } + ] + }, + "url": { + "raw": "{{baseUrl}}/transformations", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "transformations" + ] + }, + "description": "Split a document into parts." + }, + "response": [] + }, + { + "name": "Merge", + "protocolProfileBehavior": { + "followRedirects": true, + "disableUrlEncoding": false, + "disableCookies": false + }, + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{token}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "Authorization", + "value": "Bearer {{token}}" + }, + { + "key": "Content-Type", + "value": "multipart/form-data" + } + ], + "body": { + "mode": "formdata", + "formdata": [ + { + "key": "method", + "value": "merge" + }, + { + "key": "params", + "value": "{}" + }, + { + "key": "file", + "type": "file", + "src": [ + "Sample Tables.pdf", + "SampleResume.pdf" + ] + }, + { + "key": "file2", + "type": "file", + "value": null + } + ] + }, + "url": { + "raw": "{{baseUrl}}/transformations", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "transformations" + ] + }, + "description": "Merge multiple documents together." + }, + "response": [] + }, + { + "name": "Password Protect", + "protocolProfileBehavior": { + "followRedirects": true, + "disableUrlEncoding": false, + "disableCookies": false + }, + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{token}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "Authorization", + "value": "Bearer {{token}}" + }, + { + "key": "Content-Type", + "value": "multipart/form-data" + } + ], + "body": { + "mode": "formdata", + "formdata": [ + { + "key": "method", + "value": "protect" + }, + { + "key": "params", + "value": "{\"ownerPassword\": \"secret\", \"userPassword\": \"open\"}" + }, + { + "key": "file", + "type": "file", + "src": "SampleResume.pdf" + } + ] + }, + "url": { + "raw": "{{baseUrl}}/transformations", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "transformations" + ] + }, + "description": "Add password protection." + }, + "response": [] + }, + { + "name": "Password Remove", + "protocolProfileBehavior": { + "followRedirects": true, + "disableUrlEncoding": false, + "disableCookies": false + }, + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{token}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "Authorization", + "value": "Bearer {{token}}" + }, + { + "key": "Content-Type", + "value": "multipart/form-data" + } + ], + "body": { + "mode": "formdata", + "formdata": [ + { + "key": "method", + "value": "unprotect" + }, + { + "key": "params", + "value": "{\"ownerPassword\": \"secret\"}" + }, + { + "key": "file", + "type": "file", + "src": "PDF-withpassword.pdf" + } + ] + }, + "url": { + "raw": "{{baseUrl}}/transformations", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "transformations" + ] + }, + "description": "Remove password protection." + }, + "response": [] + } + ], + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "// Transformations folder: Validate status codes and response structure", + "pm.test(\"Status code is 200 or 201\", function () {", + " pm.expect(pm.response.code).to.be.oneOf([200, 201]);", + "});", + "pm.test(\"Response has expected properties\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData).to.be.an('object');", + " pm.expect(jsonData).to.have.any.keys('jobId', 'status', 'transformedData');", + "});" + ] + } + } + ] + }, + { + "name": "Jobs", + "item": [ + { + "name": "Get Async Job Status", + "protocolProfileBehavior": { + "followRedirects": true, + "disableUrlEncoding": false, + "disableCookies": false + }, + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{token}}", + "type": "string" + } + ] + }, + "method": "GET", + "header": [ + { + "key": "Authorization", + "value": "Bearer {{token}}" + } + ], + "url": { + "raw": "{{baseUrl}}/jobs/{{jobId}}/status", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "jobs", + "{{jobId}}", + "status" + ] + }, + "description": "Fetch status for an asynchronous job by ID." + }, + "response": [] + }, + { + "name": "Get Async Job Result", + "protocolProfileBehavior": { + "followRedirects": true, + "disableUrlEncoding": false, + "disableCookies": false + }, + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{token}}", + "type": "string" + } + ] + }, + "method": "GET", + "header": [ + { + "key": "Authorization", + "value": "Bearer {{token}}" + } + ], + "url": { + "raw": "{{baseUrl}}/jobs/{{jobId}}/result", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "jobs", + "{{jobId}}", + "result" + ] + }, + "description": "Retrieve the result for an asynchronous job by ID." + }, + "response": [] + } + ], + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "// Jobs folder: Validate status codes and response structure", + "pm.test(\"Status code is 200 or 201\", function () {", + " pm.expect(pm.response.code).to.be.oneOf([200, 201]);", + "});", + "pm.test(\"Response has expected properties\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData).to.be.an('object');", + " pm.expect(jsonData).to.have.any.keys('jobId', 'status', 'createdAt');", + "});" + ] + } + } + ] + }, + { + "name": "Work in Progress", + "item": [ + { + "name": "ToDo - Add Accessibility (Alt Text)", + "protocolProfileBehavior": { + "followRedirects": true, + "disableUrlEncoding": false, + "disableCookies": false + }, + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{token}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "Authorization", + "value": "Bearer {{token}}" + }, + { + "key": "Content-Type", + "value": "multipart/form-data" + } + ], + "body": { + "mode": "formdata", + "formdata": [ + { + "key": "method", + "value": "add-accessibility" + }, + { + "key": "params", + "value": "{\"altText\": [{\"page\": 1, \"objectId\": \"img1\", \"text\": \"Chart of sales\"}]}" + }, + { + "key": "delivery", + "value": "" + }, + { + "key": "file", + "value": "", + "type": "file" + } + ] + }, + "url": { + "raw": "{{baseUrl}}/transformations", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "transformations" + ] + }, + "description": "Add accessibility metadata such as alt text for images." + }, + "response": [] + }, + { + "name": "ToDo - Quick Sign", + "protocolProfileBehavior": { + "followRedirects": true, + "disableUrlEncoding": false, + "disableCookies": false + }, + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{token}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "Authorization", + "value": "Bearer {{token}}" + }, + { + "key": "Content-Type", + "value": "multipart/form-data" + } + ], + "body": { + "mode": "formdata", + "formdata": [ + { + "key": "method", + "value": "sign" + }, + { + "key": "params", + "value": "{\"signature\": \"\"}" + }, + { + "key": "delivery", + "value": "" + }, + { + "key": "file", + "value": "", + "type": "file" + } + ] + }, + "url": { + "raw": "{{baseUrl}}/transformations", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "transformations" + ] + }, + "description": "Apply a simple e-signature." + }, + "response": [] + }, + { + "name": "ToDo - Fill Form", + "protocolProfileBehavior": { + "followRedirects": true, + "disableUrlEncoding": false, + "disableCookies": false + }, + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{token}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "Authorization", + "value": "Bearer {{token}}" + }, + { + "key": "Content-Type", + "value": "multipart/form-data" + } + ], + "body": { + "mode": "formdata", + "formdata": [ + { + "key": "method", + "value": "fill" + }, + { + "key": "params", + "value": "{\"fields\": {\"Name\": \"Ada Lovelace\"}}" + }, + { + "key": "delivery", + "value": "" + }, + { + "key": "file", + "value": "", + "type": "file" + } + ] + }, + "url": { + "raw": "{{baseUrl}}/transformations", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "transformations" + ] + }, + "description": "Programmatically fill PDF forms." + }, + "response": [] + }, + { + "name": "ToDo - Find & Replace Text", + "protocolProfileBehavior": { + "followRedirects": true, + "disableUrlEncoding": false, + "disableCookies": false + }, + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{token}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "Authorization", + "value": "Bearer {{token}}" + }, + { + "key": "Content-Type", + "value": "multipart/form-data" + } + ], + "body": { + "mode": "formdata", + "formdata": [ + { + "key": "method", + "value": "find-and-replace" + }, + { + "key": "params", + "value": "{\"find\": \"foo\", \"replace\": \"bar\"}" + }, + { + "key": "delivery", + "value": "" + }, + { + "key": "file", + "value": "", + "type": "file" + } + ] + }, + "url": { + "raw": "{{baseUrl}}/transformations", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "transformations" + ] + }, + "description": "Find and replace text." + }, + "response": [] + }, + { + "name": "ToDo - Apply OCR", + "protocolProfileBehavior": { + "followRedirects": true, + "disableUrlEncoding": false, + "disableCookies": false + }, + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{token}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "Authorization", + "value": "Bearer {{token}}" + }, + { + "key": "Content-Type", + "value": "multipart/form-data" + } + ], + "body": { + "mode": "formdata", + "formdata": [ + { + "key": "method", + "value": "ocr" + }, + { + "key": "params", + "value": "{\"lang\": \"eng\"}" + }, + { + "key": "delivery", + "value": "" + }, + { + "key": "file", + "value": "", + "type": "file" + } + ] + }, + "url": { + "raw": "{{baseUrl}}/transformations", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "transformations" + ] + }, + "description": "Apply OCR to scanned documents." + }, + "response": [] + }, + { + "name": "X HTML → PDF", + "protocolProfileBehavior": { + "followRedirects": true, + "disableUrlEncoding": false, + "disableCookies": false + }, + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{token}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "Authorization", + "value": "Bearer {{token}}" + }, + { + "key": "Content-Type", + "value": "multipart/form-data" + } + ], + "body": { + "mode": "formdata", + "formdata": [ + { + "key": "method", + "value": "convert" + }, + { + "key": "params", + "value": "{\"to\": \"pdf\"}" + }, + { + "key": "file", + "type": "file", + "src": "Analysis.html" + } + ] + }, + "url": { + "raw": "{{baseUrl}}/conversions", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "conversions" + ] + }, + "description": "Upload an HTML file or URL JSON to convert to PDF. For remote HTML, set file content-type to application/vnd.gonitro.url+json with {\"url\": \"https://example.com\"}." + }, + "response": [] + }, + { + "name": "Deprecated - Linearize", + "protocolProfileBehavior": { + "followRedirects": true, + "disableUrlEncoding": false, + "disableCookies": false + }, + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{token}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "Authorization", + "value": "Bearer {{token}}" + }, + { + "key": "Content-Type", + "value": "multipart/form-data" + } + ], + "body": { + "mode": "formdata", + "formdata": [ + { + "key": "method", + "value": "linearize" + }, + { + "key": "params", + "value": "{}" + }, + { + "key": "delivery", + "value": "" + }, + { + "key": "file", + "value": "", + "type": "file" + } + ] + }, + "url": { + "raw": "{{baseUrl}}/transformations", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "transformations" + ] + }, + "description": "Deprecated / no longer supported. Included for reference." + }, + "response": [] + } + ], + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "// Work in Progress folder: Validate status codes and response structure", + "pm.test(\"Status code is 200 or 201\", function () {", + " pm.expect(pm.response.code).to.be.oneOf([200, 201]);", + "});", + "pm.test(\"Response is an object\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData).to.be.an('object');", + "});" + ] + } + } + ] + } + ], + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "// Collection-level fallback tests for Nitro Automation Platform APIs", + "pm.test(\"Status code is 2xx\", function () {", + " pm.expect(pm.response.code).to.be.within(200, 299);", + "});", + "pm.test(\"Response is JSON or empty\", function () {", + " if(pm.response.text()) {", + " pm.expect(() => pm.response.json()).not.to.throw();", + " }", + "});" + ] + } + } + ] +} \ No newline at end of file diff --git a/postman/Platform-API.postman_collection.json b/postman/Platform-API.postman_collection.json deleted file mode 100755 index ad8f569..0000000 --- a/postman/Platform-API.postman_collection.json +++ /dev/null @@ -1,2133 +0,0 @@ -{ - "info": { - "_postman_id": "b9794fa2-0560-41b7-ac41-124b067fe372", - "name": "Nitro Automation Platform APIs", - "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json", - "_exporter_id": "49176897", - "_collection_link": "https://connective.postman.co/workspace/Personal-Workspace~a573f67d-3b8e-48d5-9420-74f34a276738/collection/49176897-b9794fa2-0560-41b7-ac41-124b067fe372?action=share&source=collection_link&creator=49176897" - }, - "item": [ - { - "name": "Authorization", - "item": [ - { - "name": "Get Bearer Token", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "// Parse the response", - "let responseData = pm.response.json();", - "", - "// Store token in an environment variable", - "pm.environment.set(\"token\", responseData.accessToken);", - "", - "// Optional: Log it to the Postman console", - "console.log(\"Token saved:\", responseData.token);" - ], - "type": "text/javascript", - "packages": {}, - "requests": {} - } - } - ], - "request": { - "method": "POST", - "header": [ - { - "key": "Content-Type", - "value": "application/json" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"clientID\": \"{{clientID}}\",\n \"clientSecret\": \"{{clientSecret}}\"\n}" - }, - "url": { - "raw": "{{baseUrl}}/oauth/token", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "oauth", - "token" - ] - }, - "description": "Generated from cURL: curl --request POST \\\n --url https://api.gonitro.dev/oauth/token \\\n --header 'Content-Type: application/json' \\\n --data '{\n \"clientID\": \"\",\n \"clientSecret\": \"\"\n}'" - }, - "response": [] - } - ], - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "// Authorization folder: Validate status codes and response structure", - "pm.test(\"Status code is 200 or 201\", function () {", - " pm.expect(pm.response.code).to.be.oneOf([200, 201]);", - "});", - "pm.test(\"Response has expected properties\", function () {", - " var jsonData = pm.response.json();", - " pm.expect(jsonData).to.be.an('object');", - " pm.expect(jsonData).to.have.any.keys('access_token', 'token_type', 'expires_in');", - "});" - ] - } - } - ] - }, - { - "name": "Conversions", - "item": [ - { - "name": "Word → PDF", - "protocolProfileBehavior": { - "followRedirects": true, - "disableUrlEncoding": false, - "disableCookies": false - }, - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{token}}", - "type": "string" - } - ] - }, - "method": "POST", - "header": [ - { - "key": "Authorization", - "value": "Bearer {{token}}" - }, - { - "key": "Content-Type", - "value": "multipart/form-data" - } - ], - "body": { - "mode": "formdata", - "formdata": [ - { - "key": "method", - "value": "convert" - }, - { - "key": "params", - "value": "{\"to\": \"pdf\"}" - }, - { - "key": "file", - "type": "file", - "src": "Analysis.docx" - } - ] - }, - "url": { - "raw": "{{baseUrl}}/conversions", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "conversions" - ] - }, - "description": "Upload a Word document (.doc, .docx, .dot, .xml, .docm, .dotx, .dotm, .rtf) and convert to PDF." - }, - "response": [] - }, - { - "name": "Excel → PDF", - "protocolProfileBehavior": { - "followRedirects": true, - "disableUrlEncoding": false, - "disableCookies": false - }, - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{token}}", - "type": "string" - } - ] - }, - "method": "POST", - "header": [ - { - "key": "Authorization", - "value": "Bearer {{token}}" - }, - { - "key": "Content-Type", - "value": "multipart/form-data" - } - ], - "body": { - "mode": "formdata", - "formdata": [ - { - "key": "method", - "value": "convert" - }, - { - "key": "params", - "value": "{\"to\": \"pdf\"}" - }, - { - "key": "file", - "type": "file", - "src": "Feedback.xlsx" - } - ] - }, - "url": { - "raw": "{{baseUrl}}/conversions", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "conversions" - ] - }, - "description": "Upload an Excel workbook (.xlsx, .xls, .xlt, .xlsm, .xltx, .xltm) and convert to PDF." - }, - "response": [] - }, - { - "name": "PowerPoint → PDF", - "protocolProfileBehavior": { - "followRedirects": true, - "disableUrlEncoding": false, - "disableCookies": false - }, - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{token}}", - "type": "string" - } - ] - }, - "method": "POST", - "header": [ - { - "key": "Authorization", - "value": "Bearer {{token}}" - }, - { - "key": "Content-Type", - "value": "multipart/form-data" - } - ], - "body": { - "mode": "formdata", - "formdata": [ - { - "key": "method", - "value": "convert" - }, - { - "key": "params", - "value": "{\"to\": \"pdf\"}" - }, - { - "key": "file", - "value": "", - "type": "file" - } - ] - }, - "url": { - "raw": "{{baseUrl}}/conversions", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "conversions" - ] - }, - "description": "Upload a PowerPoint file (.pptx, .ppt) and convert to PDF." - }, - "response": [] - }, - { - "name": "Image → PDF", - "protocolProfileBehavior": { - "followRedirects": true, - "disableUrlEncoding": false, - "disableCookies": false - }, - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{token}}", - "type": "string" - } - ] - }, - "method": "POST", - "header": [ - { - "key": "Authorization", - "value": "Bearer {{token}}" - }, - { - "key": "Content-Type", - "value": "multipart/form-data" - } - ], - "body": { - "mode": "formdata", - "formdata": [ - { - "key": "method", - "value": "convert" - }, - { - "key": "params", - "value": "{\"to\": \"pdf\"}" - }, - { - "key": "file", - "type": "file", - "src": "GoNitro.png" - } - ] - }, - "url": { - "raw": "{{baseUrl}}/conversions", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "conversions" - ] - }, - "description": "Upload an image (.png, .jpg, .jpeg, .tiff) and convert to PDF." - }, - "response": [] - }, - { - "name": "PDF → Word", - "protocolProfileBehavior": { - "followRedirects": true, - "disableUrlEncoding": false, - "disableCookies": false - }, - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{token}}", - "type": "string" - } - ] - }, - "method": "POST", - "header": [ - { - "key": "Authorization", - "value": "Bearer {{token}}" - }, - { - "key": "Content-Type", - "value": "multipart/form-data" - } - ], - "body": { - "mode": "formdata", - "formdata": [ - { - "key": "method", - "value": "convert" - }, - { - "key": "params", - "value": "{\"to\": \"docx\"}" - }, - { - "key": "file", - "type": "file", - "src": "SampleResume.pdf" - } - ] - }, - "url": { - "raw": "{{baseUrl}}/conversions", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "conversions" - ] - }, - "description": "Upload a PDF and convert to Word (docx)." - }, - "response": [] - }, - { - "name": "PDF → Excel", - "protocolProfileBehavior": { - "followRedirects": true, - "disableUrlEncoding": false, - "disableCookies": false - }, - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{token}}", - "type": "string" - } - ] - }, - "method": "POST", - "header": [ - { - "key": "Authorization", - "value": "Bearer {{token}}" - }, - { - "key": "Content-Type", - "value": "multipart/form-data" - } - ], - "body": { - "mode": "formdata", - "formdata": [ - { - "key": "method", - "value": "convert" - }, - { - "key": "params", - "value": "{\"to\": \"xlsx\"}" - }, - { - "key": "file", - "type": "file", - "src": "Sample Tables.pdf" - } - ] - }, - "url": { - "raw": "{{baseUrl}}/conversions", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "conversions" - ] - }, - "description": "Upload a PDF and convert to Excel (xlsx)." - }, - "response": [] - }, - { - "name": "PDF → Image", - "protocolProfileBehavior": { - "followRedirects": true, - "disableUrlEncoding": false, - "disableCookies": false - }, - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{token}}", - "type": "string" - } - ] - }, - "method": "POST", - "header": [ - { - "key": "Authorization", - "value": "Bearer {{token}}" - }, - { - "key": "Content-Type", - "value": "multipart/form-data" - } - ], - "body": { - "mode": "formdata", - "formdata": [ - { - "key": "method", - "value": "convert" - }, - { - "key": "params", - "value": "{\"to\": \"png\"}" - }, - { - "key": "file", - "type": "file", - "src": "SampleResume.pdf" - } - ] - }, - "url": { - "raw": "{{baseUrl}}/conversions", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "conversions" - ] - }, - "description": "Upload a PDF and convert to image (png/jpg). Modify the `to` field for the desired format." - }, - "response": [] - } - ], - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "// Conversions folder: Validate status codes and response structure", - "pm.test(\"Status code is 200 or 201\", function () {", - " pm.expect(pm.response.code).to.be.oneOf([200, 201]);", - "});", - "pm.test(\"Response has expected properties\", function () {", - " var jsonData = pm.response.json();", - " pm.expect(jsonData).to.be.an('object');", - " pm.expect(jsonData).to.have.any.keys('jobId', 'status', 'outputUrl');", - "});" - ] - } - } - ] - }, - { - "name": "Extractions", - "item": [ - { - "name": "Extract PDF Text", - "protocolProfileBehavior": { - "followRedirects": true, - "disableUrlEncoding": false, - "disableCookies": false - }, - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{token}}", - "type": "string" - } - ] - }, - "method": "POST", - "header": [ - { - "key": "Authorization", - "value": "Bearer {{token}}" - }, - { - "key": "Content-Type", - "value": "multipart/form-data" - } - ], - "body": { - "mode": "formdata", - "formdata": [ - { - "key": "method", - "value": "extract-text" - }, - { - "key": "params", - "value": "{}" - }, - { - "key": "file", - "type": "file", - "src": "SampleResume.pdf" - } - ] - }, - "url": { - "raw": "{{baseUrl}}/extractions", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "extractions" - ] - }, - "description": "Extract plain text from the file." - }, - "response": [] - }, - { - "name": "Extract PDF Form Data", - "protocolProfileBehavior": { - "followRedirects": true, - "disableUrlEncoding": false, - "disableCookies": false - }, - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{token}}", - "type": "string" - } - ] - }, - "method": "POST", - "header": [ - { - "key": "Authorization", - "value": "Bearer {{token}}" - }, - { - "key": "Content-Type", - "value": "multipart/form-data" - } - ], - "body": { - "mode": "formdata", - "formdata": [ - { - "key": "method", - "value": "extract-forms" - }, - { - "key": "params", - "value": "{}" - }, - { - "key": "file", - "type": "file", - "src": "BOB - Student-Loan-Application-Form.pdf" - } - ] - }, - "url": { - "raw": "{{baseUrl}}/extractions", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "extractions" - ] - }, - "description": "Extract form field data." - }, - "response": [] - }, - { - "name": "Extract PDF Table Data", - "protocolProfileBehavior": { - "followRedirects": true, - "disableUrlEncoding": false, - "disableCookies": false - }, - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{token}}", - "type": "string" - } - ] - }, - "method": "POST", - "header": [ - { - "key": "Authorization", - "value": "Bearer {{token}}" - }, - { - "key": "Content-Type", - "value": "multipart/form-data" - } - ], - "body": { - "mode": "formdata", - "formdata": [ - { - "key": "method", - "value": "extract-tables" - }, - { - "key": "params", - "value": "{}" - }, - { - "key": "file", - "type": "file", - "src": "Sample Tables.pdf" - } - ] - }, - "url": { - "raw": "{{baseUrl}}/extractions", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "extractions" - ] - }, - "description": "Extract tabular data." - }, - "response": [] - }, - { - "name": "Extract and Autodetect Bounding Boxes for PII", - "protocolProfileBehavior": { - "followRedirects": true, - "disableUrlEncoding": false, - "disableCookies": false - }, - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{token}}", - "type": "string" - } - ] - }, - "method": "POST", - "header": [ - { - "key": "Authorization", - "value": "Bearer {{token}}" - }, - { - "key": "Content-Type", - "value": "multipart/form-data" - } - ], - "body": { - "mode": "formdata", - "formdata": [ - { - "key": "method", - "value": "extract-pii-bounding-boxes" - }, - { - "key": "params", - "value": "{\"language\":\"en\"}" - }, - { - "key": "file", - "type": "file", - "src": "SampleResume.pdf" - } - ] - }, - "url": { - "raw": "{{baseUrl}}/extractions", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "extractions" - ] - }, - "description": "Detect PII and return bounding boxes." - }, - "response": [] - }, - { - "name": "Extract Bounding Boxes for Strings", - "protocolProfileBehavior": { - "followRedirects": true, - "disableUrlEncoding": false, - "disableCookies": false - }, - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{token}}", - "type": "string" - } - ] - }, - "method": "POST", - "header": [ - { - "key": "Authorization", - "value": "Bearer {{token}}" - }, - { - "key": "Content-Type", - "value": "multipart/form-data" - } - ], - "body": { - "mode": "formdata", - "formdata": [ - { - "key": "method", - "value": "extract-text-bounding-boxes" - }, - { - "key": "params", - "value": "{ \"texts\": [ \"Professional\", \"Location\" ]}" - }, - { - "key": "file", - "type": "file", - "src": "SampleResume.pdf" - } - ] - }, - "url": { - "raw": "{{baseUrl}}/extractions", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "extractions" - ] - }, - "description": "Return coordinates for given strings." - }, - "response": [] - }, - { - "name": "Get PDF Properties", - "protocolProfileBehavior": { - "followRedirects": true, - "disableUrlEncoding": false, - "disableCookies": false - }, - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{token}}", - "type": "string" - } - ] - }, - "method": "POST", - "header": [ - { - "key": "Authorization", - "value": "Bearer {{token}}" - }, - { - "key": "Content-Type", - "value": "multipart/form-data" - } - ], - "body": { - "mode": "formdata", - "formdata": [ - { - "key": "method", - "value": "get-properties" - }, - { - "key": "params", - "value": "{}" - }, - { - "key": "file", - "type": "file", - "src": "SampleResume.pdf" - } - ] - }, - "url": { - "raw": "{{baseUrl}}/extractions", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "extractions" - ] - }, - "description": "Return document properties/metadata." - }, - "response": [] - }, - { - "name": "Set PDF Properties", - "protocolProfileBehavior": { - "followRedirects": true, - "disableUrlEncoding": false, - "disableCookies": false - }, - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{token}}", - "type": "string" - } - ] - }, - "method": "POST", - "header": [ - { - "key": "Authorization", - "value": "Bearer {{token}}" - }, - { - "key": "Content-Type", - "value": "multipart/form-data" - } - ], - "body": { - "mode": "formdata", - "formdata": [ - { - "key": "method", - "value": "set-properties" - }, - { - "key": "params", - "value": "{\"title\": \"the-title\"}" - }, - { - "key": "file", - "type": "file", - "src": "SampleResume.pdf" - } - ] - }, - "url": { - "raw": "{{baseUrl}}/transformations", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "transformations" - ] - }, - "description": "Set document properties/metadata." - }, - "response": [] - } - ], - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "// Extractions folder: Validate status codes and response structure", - "pm.test(\"Status code is 200 or 201\", function () {", - " pm.expect(pm.response.code).to.be.oneOf([200, 201]);", - "});", - "pm.test(\"Response has expected properties\", function () {", - " var jsonData = pm.response.json();", - " pm.expect(jsonData).to.be.an('object');", - " pm.expect(jsonData).to.have.any.keys('extractedData', 'status');", - "});" - ] - } - } - ] - }, - { - "name": "Transformations", - "item": [ - { - "name": "Redact Bounding boxes (scrub PII)", - "protocolProfileBehavior": { - "followRedirects": true, - "disableUrlEncoding": false, - "disableCookies": false - }, - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{token}}", - "type": "string" - } - ] - }, - "method": "POST", - "header": [ - { - "key": "Authorization", - "value": "Bearer {{token}}" - }, - { - "key": "Content-Type", - "value": "multipart/form-data" - } - ], - "body": { - "mode": "formdata", - "formdata": [ - { - "key": "method", - "value": "redact" - }, - { - "key": "params", - "value": "{\n \"redactions\": [\n {\n \"pageIndex\": 0,\n \"boundingBox\": [\n 0.181746726,\n 0.170494927,\n 0.308388903,\n 0.188994937\n ],\n \"PIIType\": \"PHONE\",\n \"confidence\": 0.99\n },\n {\n \"pageIndex\": 0,\n \"boundingBox\": [\n 0.117687911,\n 0.106075797,\n 0.234256545,\n 0.124575798\n ],\n \"PIIType\": \"NAME\",\n \"confidence\": 0.99\n }\n ]\n}\n" - }, - { - "key": "file", - "type": "file", - "src": "SampleResume.pdf" - } - ] - }, - "url": { - "raw": "{{baseUrl}}/transformations", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "transformations" - ] - }, - "description": "Redact sensitive data from documents." - }, - "response": [] - }, - { - "name": "Compress", - "protocolProfileBehavior": { - "followRedirects": true, - "disableUrlEncoding": false, - "disableCookies": false - }, - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{token}}", - "type": "string" - } - ] - }, - "method": "POST", - "header": [ - { - "key": "Authorization", - "value": "Bearer {{token}}" - }, - { - "key": "Content-Type", - "value": "multipart/form-data" - } - ], - "body": { - "mode": "formdata", - "formdata": [ - { - "key": "method", - "value": "compress" - }, - { - "key": "params", - "value": "{\"level\": 2}" - }, - { - "key": "file", - "type": "file", - "src": "BOB - Student-Loan-Application-Form.pdf" - } - ] - }, - "url": { - "raw": "{{baseUrl}}/transformations", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "transformations" - ] - }, - "description": "Compress the PDF size." - }, - "response": [] - }, - { - "name": "Flatten", - "protocolProfileBehavior": { - "followRedirects": true, - "disableUrlEncoding": false, - "disableCookies": false - }, - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{token}}", - "type": "string" - } - ] - }, - "method": "POST", - "header": [ - { - "key": "Authorization", - "value": "Bearer {{token}}" - }, - { - "key": "Content-Type", - "value": "multipart/form-data" - } - ], - "body": { - "mode": "formdata", - "formdata": [ - { - "key": "method", - "value": "flatten" - }, - { - "key": "params", - "value": "{}" - }, - { - "key": "file", - "type": "file", - "src": "Sample Tables.pdf" - } - ] - }, - "url": { - "raw": "{{baseUrl}}/transformations", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "transformations" - ] - }, - "description": "Flatten annotations/form fields." - }, - "response": [] - }, - { - "name": "Rotate Pages", - "protocolProfileBehavior": { - "followRedirects": true, - "disableUrlEncoding": false, - "disableCookies": false - }, - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{token}}", - "type": "string" - } - ] - }, - "method": "POST", - "header": [ - { - "key": "Authorization", - "value": "Bearer {{token}}" - }, - { - "key": "Content-Type", - "value": "multipart/form-data" - } - ], - "body": { - "mode": "formdata", - "formdata": [ - { - "key": "method", - "value": "rotate" - }, - { - "key": "params", - "value": "{ \"rotations\": [ { \"page_index\": 0, \"amount\": 90 }, { \"page_index\": 1, \"amount\": -90 } ]}" - }, - { - "key": "file", - "type": "file", - "src": "SampleResume.pdf" - } - ] - }, - "url": { - "raw": "{{baseUrl}}/transformations", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "transformations" - ] - }, - "description": "Rotate pages by angle." - }, - "response": [] - }, - { - "name": "Delete Pages", - "protocolProfileBehavior": { - "followRedirects": true, - "disableUrlEncoding": false, - "disableCookies": false - }, - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{token}}", - "type": "string" - } - ] - }, - "method": "POST", - "header": [ - { - "key": "Authorization", - "value": "Bearer {{token}}" - }, - { - "key": "Content-Type", - "value": "multipart/form-data" - } - ], - "body": { - "mode": "formdata", - "formdata": [ - { - "key": "method", - "value": "delete-pages" - }, - { - "key": "params", - "value": "{\n\t\"pageIndices\": [\n\t\t0,\n\t\t2\n\t]\n}" - }, - { - "key": "file", - "type": "file", - "src": "SampleResume.pdf" - } - ] - }, - "url": { - "raw": "{{baseUrl}}/transformations", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "transformations" - ] - }, - "description": "Delete specific pages." - }, - "response": [] - }, - { - "name": "Split", - "protocolProfileBehavior": { - "followRedirects": true, - "disableUrlEncoding": false, - "disableCookies": false - }, - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{token}}", - "type": "string" - } - ] - }, - "method": "POST", - "header": [ - { - "key": "Authorization", - "value": "Bearer {{token}}" - }, - { - "key": "Content-Type", - "value": "multipart/form-data" - } - ], - "body": { - "mode": "formdata", - "formdata": [ - { - "key": "method", - "value": "split" - }, - { - "key": "params", - "value": "{ \"pageIndices\": [ [0, 2], [1, 3, 4] ]}" - }, - { - "key": "file", - "type": "file", - "src": "SampleResume.pdf" - } - ] - }, - "url": { - "raw": "{{baseUrl}}/transformations", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "transformations" - ] - }, - "description": "Split a document into parts." - }, - "response": [] - }, - { - "name": "Merge", - "protocolProfileBehavior": { - "followRedirects": true, - "disableUrlEncoding": false, - "disableCookies": false - }, - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{token}}", - "type": "string" - } - ] - }, - "method": "POST", - "header": [ - { - "key": "Authorization", - "value": "Bearer {{token}}" - }, - { - "key": "Content-Type", - "value": "multipart/form-data" - } - ], - "body": { - "mode": "formdata", - "formdata": [ - { - "key": "method", - "value": "merge" - }, - { - "key": "params", - "value": "{}" - }, - { - "key": "file", - "type": "file", - "src": [ - "Sample Tables.pdf", - "SampleResume.pdf" - ] - }, - { - "key": "file2", - "type": "file", - "src": [] - } - ] - }, - "url": { - "raw": "{{baseUrl}}/transformations", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "transformations" - ] - }, - "description": "Merge multiple documents together." - }, - "response": [] - }, - { - "name": "Password Protect", - "protocolProfileBehavior": { - "followRedirects": true, - "disableUrlEncoding": false, - "disableCookies": false - }, - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{token}}", - "type": "string" - } - ] - }, - "method": "POST", - "header": [ - { - "key": "Authorization", - "value": "Bearer {{token}}" - }, - { - "key": "Content-Type", - "value": "multipart/form-data" - } - ], - "body": { - "mode": "formdata", - "formdata": [ - { - "key": "method", - "value": "protect" - }, - { - "key": "params", - "value": "{\"ownerPassword\": \"secret\", \"userPassword\": \"open\"}" - }, - { - "key": "file", - "type": "file", - "src": "SampleResume.pdf" - } - ] - }, - "url": { - "raw": "{{baseUrl}}/transformations", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "transformations" - ] - }, - "description": "Add password protection." - }, - "response": [] - }, - { - "name": "Password Remove", - "protocolProfileBehavior": { - "followRedirects": true, - "disableUrlEncoding": false, - "disableCookies": false - }, - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{token}}", - "type": "string" - } - ] - }, - "method": "POST", - "header": [ - { - "key": "Authorization", - "value": "Bearer {{token}}" - }, - { - "key": "Content-Type", - "value": "multipart/form-data" - } - ], - "body": { - "mode": "formdata", - "formdata": [ - { - "key": "method", - "value": "unprotect" - }, - { - "key": "params", - "value": "{\"ownerPassword\": \"secret\"}" - }, - { - "key": "file", - "type": "file", - "src": "PDF-withpassword.pdf" - } - ] - }, - "url": { - "raw": "{{baseUrl}}/transformations", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "transformations" - ] - }, - "description": "Remove password protection." - }, - "response": [] - } - ], - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "// Transformations folder: Validate status codes and response structure", - "pm.test(\"Status code is 200 or 201\", function () {", - " pm.expect(pm.response.code).to.be.oneOf([200, 201]);", - "});", - "pm.test(\"Response has expected properties\", function () {", - " var jsonData = pm.response.json();", - " pm.expect(jsonData).to.be.an('object');", - " pm.expect(jsonData).to.have.any.keys('jobId', 'status', 'transformedData');", - "});" - ] - } - } - ] - }, - { - "name": "Jobs", - "item": [ - { - "name": "Get Async Job Status", - "protocolProfileBehavior": { - "followRedirects": true, - "disableUrlEncoding": false, - "disableCookies": false - }, - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{token}}", - "type": "string" - } - ] - }, - "method": "GET", - "header": [ - { - "key": "Authorization", - "value": "Bearer {{token}}" - } - ], - "url": { - "raw": "{{baseUrl}}/jobs/{{jobId}}/status", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "jobs", - "{{jobId}}", - "status" - ] - }, - "description": "Fetch status for an asynchronous job by ID." - }, - "response": [] - }, - { - "name": "Get Async Job Result", - "protocolProfileBehavior": { - "followRedirects": true, - "disableUrlEncoding": false, - "disableCookies": false - }, - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{token}}", - "type": "string" - } - ] - }, - "method": "GET", - "header": [ - { - "key": "Authorization", - "value": "Bearer {{token}}" - } - ], - "url": { - "raw": "{{baseUrl}}/jobs/{{jobId}}/result", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "jobs", - "{{jobId}}", - "result" - ] - }, - "description": "Retrieve the result for an asynchronous job by ID." - }, - "response": [] - } - ], - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "// Jobs folder: Validate status codes and response structure", - "pm.test(\"Status code is 200 or 201\", function () {", - " pm.expect(pm.response.code).to.be.oneOf([200, 201]);", - "});", - "pm.test(\"Response has expected properties\", function () {", - " var jsonData = pm.response.json();", - " pm.expect(jsonData).to.be.an('object');", - " pm.expect(jsonData).to.have.any.keys('jobId', 'status', 'createdAt');", - "});" - ] - } - } - ] - }, - { - "name": "Work in Progress", - "item": [ - { - "name": "ToDo - Add Accessibility (Alt Text)", - "protocolProfileBehavior": { - "followRedirects": true, - "disableUrlEncoding": false, - "disableCookies": false - }, - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{token}}", - "type": "string" - } - ] - }, - "method": "POST", - "header": [ - { - "key": "Authorization", - "value": "Bearer {{token}}" - }, - { - "key": "Content-Type", - "value": "multipart/form-data" - } - ], - "body": { - "mode": "formdata", - "formdata": [ - { - "key": "method", - "value": "add-accessibility" - }, - { - "key": "params", - "value": "{\"altText\": [{\"page\": 1, \"objectId\": \"img1\", \"text\": \"Chart of sales\"}]}" - }, - { - "key": "delivery", - "value": "" - }, - { - "key": "file", - "value": "", - "type": "file" - } - ] - }, - "url": { - "raw": "{{baseUrl}}/transformations", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "transformations" - ] - }, - "description": "Add accessibility metadata such as alt text for images." - }, - "response": [] - }, - { - "name": "ToDo - Quick Sign", - "protocolProfileBehavior": { - "followRedirects": true, - "disableUrlEncoding": false, - "disableCookies": false - }, - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{token}}", - "type": "string" - } - ] - }, - "method": "POST", - "header": [ - { - "key": "Authorization", - "value": "Bearer {{token}}" - }, - { - "key": "Content-Type", - "value": "multipart/form-data" - } - ], - "body": { - "mode": "formdata", - "formdata": [ - { - "key": "method", - "value": "sign" - }, - { - "key": "params", - "value": "{\"signature\": \"\"}" - }, - { - "key": "delivery", - "value": "" - }, - { - "key": "file", - "value": "", - "type": "file" - } - ] - }, - "url": { - "raw": "{{baseUrl}}/transformations", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "transformations" - ] - }, - "description": "Apply a simple e-signature." - }, - "response": [] - }, - { - "name": "ToDo - Fill Form", - "protocolProfileBehavior": { - "followRedirects": true, - "disableUrlEncoding": false, - "disableCookies": false - }, - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{token}}", - "type": "string" - } - ] - }, - "method": "POST", - "header": [ - { - "key": "Authorization", - "value": "Bearer {{token}}" - }, - { - "key": "Content-Type", - "value": "multipart/form-data" - } - ], - "body": { - "mode": "formdata", - "formdata": [ - { - "key": "method", - "value": "fill" - }, - { - "key": "params", - "value": "{\"fields\": {\"Name\": \"Ada Lovelace\"}}" - }, - { - "key": "delivery", - "value": "" - }, - { - "key": "file", - "value": "", - "type": "file" - } - ] - }, - "url": { - "raw": "{{baseUrl}}/transformations", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "transformations" - ] - }, - "description": "Programmatically fill PDF forms." - }, - "response": [] - }, - { - "name": "ToDo - Find & Replace Text", - "protocolProfileBehavior": { - "followRedirects": true, - "disableUrlEncoding": false, - "disableCookies": false - }, - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{token}}", - "type": "string" - } - ] - }, - "method": "POST", - "header": [ - { - "key": "Authorization", - "value": "Bearer {{token}}" - }, - { - "key": "Content-Type", - "value": "multipart/form-data" - } - ], - "body": { - "mode": "formdata", - "formdata": [ - { - "key": "method", - "value": "find-and-replace" - }, - { - "key": "params", - "value": "{\"find\": \"foo\", \"replace\": \"bar\"}" - }, - { - "key": "delivery", - "value": "" - }, - { - "key": "file", - "value": "", - "type": "file" - } - ] - }, - "url": { - "raw": "{{baseUrl}}/transformations", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "transformations" - ] - }, - "description": "Find and replace text." - }, - "response": [] - }, - { - "name": "ToDo - Apply OCR", - "protocolProfileBehavior": { - "followRedirects": true, - "disableUrlEncoding": false, - "disableCookies": false - }, - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{token}}", - "type": "string" - } - ] - }, - "method": "POST", - "header": [ - { - "key": "Authorization", - "value": "Bearer {{token}}" - }, - { - "key": "Content-Type", - "value": "multipart/form-data" - } - ], - "body": { - "mode": "formdata", - "formdata": [ - { - "key": "method", - "value": "ocr" - }, - { - "key": "params", - "value": "{\"lang\": \"eng\"}" - }, - { - "key": "delivery", - "value": "" - }, - { - "key": "file", - "value": "", - "type": "file" - } - ] - }, - "url": { - "raw": "{{baseUrl}}/transformations", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "transformations" - ] - }, - "description": "Apply OCR to scanned documents." - }, - "response": [] - }, - { - "name": "X HTML → PDF", - "protocolProfileBehavior": { - "followRedirects": true, - "disableUrlEncoding": false, - "disableCookies": false - }, - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{token}}", - "type": "string" - } - ] - }, - "method": "POST", - "header": [ - { - "key": "Authorization", - "value": "Bearer {{token}}" - }, - { - "key": "Content-Type", - "value": "multipart/form-data" - } - ], - "body": { - "mode": "formdata", - "formdata": [ - { - "key": "method", - "value": "convert" - }, - { - "key": "params", - "value": "{\"to\": \"pdf\"}" - }, - { - "key": "file", - "type": "file", - "src": "Analysis.html" - } - ] - }, - "url": { - "raw": "{{baseUrl}}/conversions", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "conversions" - ] - }, - "description": "Upload an HTML file or URL JSON to convert to PDF. For remote HTML, set file content-type to application/vnd.gonitro.url+json with {\"url\": \"https://example.com\"}." - }, - "response": [] - }, - { - "name": "Deprecated - Linearize", - "protocolProfileBehavior": { - "followRedirects": true, - "disableUrlEncoding": false, - "disableCookies": false - }, - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{token}}", - "type": "string" - } - ] - }, - "method": "POST", - "header": [ - { - "key": "Authorization", - "value": "Bearer {{token}}" - }, - { - "key": "Content-Type", - "value": "multipart/form-data" - } - ], - "body": { - "mode": "formdata", - "formdata": [ - { - "key": "method", - "value": "linearize" - }, - { - "key": "params", - "value": "{}" - }, - { - "key": "delivery", - "value": "" - }, - { - "key": "file", - "value": "", - "type": "file" - } - ] - }, - "url": { - "raw": "{{baseUrl}}/transformations", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "transformations" - ] - }, - "description": "Deprecated / no longer supported. Included for reference." - }, - "response": [] - } - ], - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "// Work in Progress folder: Validate status codes and response structure", - "pm.test(\"Status code is 200 or 201\", function () {", - " pm.expect(pm.response.code).to.be.oneOf([200, 201]);", - "});", - "pm.test(\"Response is an object\", function () {", - " var jsonData = pm.response.json();", - " pm.expect(jsonData).to.be.an('object');", - "});" - ] - } - } - ] - } - ], - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "// Collection-level fallback tests for Nitro Automation Platform APIs", - "pm.test(\"Status code is 2xx\", function () {", - " pm.expect(pm.response.code).to.be.within(200, 299);", - "});", - "pm.test(\"Response is JSON or empty\", function () {", - " if(pm.response.text()) {", - " pm.expect(() => pm.response.json()).not.to.throw();", - " }", - "});" - ] - } - } - ] -} \ No newline at end of file diff --git a/power-automate/README.md b/power-automate/README.md deleted file mode 100644 index 1e66005..0000000 --- a/power-automate/README.md +++ /dev/null @@ -1,89 +0,0 @@ -# Power Automate Integration - -This folder contains instructions for creating a custom connector to integrate the Nitro Platform API with Microsoft Power Automate. - -## Creating Your Custom Connector - -### 1. Create New Custom Connector - -1. Go to [Power Automate](https://make.powerautomate.com) -2. Navigate to **Data** → **Custom connectors** -3. Click **New custom connector** → **Create from blank** -4. Name it "Nitro Platform API" - -### 2. Configure General Settings - -- **Description**: Document processing API for conversions, extractions, and transformations -- **Host**: `api.gonitro.dev` -- **Base URL**: `/` - -### 3. Configure Security - -1. Set **Authentication type** to **API Key** -2. **Parameter label**: API Key -3. **Parameter name**: `X-API-Key` -4. **Parameter location**: Header - -### 4. Add Key Operations - -Add these essential operations: - -#### Convert Document -- **Operation ID**: `convert-document` -- **Summary**: Convert Document -- **Verb**: POST -- **URL**: `/platform/conversions` -- **Request**: - - Body type: `multipart/form-data` - - Parameter: `file` (file upload) - - Parameter: `params` (string, JSON parameters) - -#### Extract Text -- **Operation ID**: `extract-text` -- **Summary**: Extract PDF Text -- **Verb**: POST -- **URL**: `/platform/extractions/pdf-text` -- **Request**: Body with `file` parameter - -#### Get Job Status -- **Operation ID**: `get-job-status` -- **Summary**: Get Job Status -- **Verb**: GET -- **URL**: `/jobs/{jobId}/status` -- **Parameter**: `jobId` (path parameter) - -### 5. Test Your Connector - -1. Go to **Test** tab -2. Create a new connection with your API key -3. Test the "Get Job Status" operation with a sample job ID - -## Sample Flows - -### Document Conversion Flow - -**Trigger**: When a file is added to SharePoint -1. **Get file content** from SharePoint -2. **Convert Document** using your custom connector -3. **Create file** in SharePoint with converted result - -### Batch Processing Flow - -**Trigger**: Scheduled (daily) -1. **List files** from SharePoint folder -2. **Apply to each** file: - - **Convert Document** - - **Get Job Status** (with delay/retry logic) - - **Get Job Result** when complete - - **Update file** in destination folder - -## Best Practices - -- **Error Handling**: Add try-catch blocks around API calls -- **Async Jobs**: Use "Do until" loops to poll job status -- **Rate Limits**: Add 1-2 second delays between API calls -- **File Size**: Check file size limits before processing - -## Authentication - -Get your API key from the Nitro platform dashboard and use it when creating connections to your custom connector. diff --git a/samples/python/extract_data.py b/samples/python/extract_data.py index d6b232c..3e83be2 100644 --- a/samples/python/extract_data.py +++ b/samples/python/extract_data.py @@ -36,7 +36,7 @@ EXAMPLES: python extract_data.py forms application.pdf data.json - python extract_data.py tables invoice.pdf tables.json + python extract_data.py tables "../../test_files/test-pdfs/Sample Tables.pdf" tables.json """ import json diff --git a/test_files/test-batch/Analysis.docx b/test_files/test-batch/Analysis.docx old mode 100755 new mode 100644 index db8c2ac..ec895c4 Binary files a/test_files/test-batch/Analysis.docx and b/test_files/test-batch/Analysis.docx differ diff --git a/test_files/test-batch/Feedback.xlsx b/test_files/test-batch/Feedback.xlsx old mode 100755 new mode 100644 index dabc4d5..ba0afe8 Binary files a/test_files/test-batch/Feedback.xlsx and b/test_files/test-batch/Feedback.xlsx differ diff --git a/test_files/test-pdfs/Sample Tables.pdf b/test_files/test-pdfs/Sample Tables.pdf index e1d49cd..bb34e2d 100755 Binary files a/test_files/test-pdfs/Sample Tables.pdf and b/test_files/test-pdfs/Sample Tables.pdf differ diff --git a/test_files/test-sign/company-policies.pdf b/test_files/test-sign/company-policies.pdf old mode 100755 new mode 100644 index e1d49cd..08aff48 Binary files a/test_files/test-sign/company-policies.pdf and b/test_files/test-sign/company-policies.pdf differ diff --git a/test_files/test-sign/sample-company-policies.pdf b/test_files/test-sign/sample-company-policies.pdf old mode 100755 new mode 100644 index e1d49cd..08aff48 Binary files a/test_files/test-sign/sample-company-policies.pdf and b/test_files/test-sign/sample-company-policies.pdf differ