How to Integrate Zoho Flow with PDF.co
Zoho Flow helps to automate business workflows by connecting your apps with Zoho Flow. You can build smart integrations to break the information silos in your business.
PDF.co is available on Zoho Flow platform via Custom Function calls to PDF.co API
Calling PDF.co API Document Parser from Zoho Flow:
// Set up the parameters for the HTTP request
parameters = {"templateId": "YourTemplateId", "async": false, "encrypt": false, "inline": true};
body = {"url": "https://url-to-your-pdf-document"};
headers = {"Content-Type": "application/json", "x-api-key": "your-api-key"};
// Make the API request
response = invokeUrl
[
url: “https://api.pdf.co/v1/pdf/documentparser”,
type: [“POST”],
headers: [headers],
content-type: [“application/json”],
parameters: [parameters],
body: [body]
];
In the above code, we are using the invokeUrl task to make a POST request to the PDF.co Document Parser API. We are passing the API key and the URL of the document we want to parse in the headers and body of the request, respectively. We also set some parameters for the API call, such as the template ID, whether to run the parsing asynchronously, and whether to encrypt the output.
Note that you’ll need to replace the placeholders in the code with your own values, such as YourTemplateId (for example, 1
if you want to use default invoice parser template) and your api-key.
Converting HTML to PDF using PDF.co and Zoho Flow
response = invokeUrl
[
url: "https://api.pdf.co/v1/pdf/convert/from/html",
type: POST
headers: [
"Content-Type": "application/json"
"x-api-key": ""
]
content-type: "application/json"
parameters:
[
"html": "
Hello, World!
“,
“name”: “test.pdf”
]
connection: “pdfco”
detailed: true
response-format: JSON
response-decoding: AUTO
];
Converting URl to PDF using PDF.co and Zoho Flow
// URL to PDF with PDF.co API
response = invokeUrl
[
url: "https://api.pdf.co/v1/pdf/convert/from/url",
type: POST
headers: [
"Content-Type": "application/json"
"x-api-key": ""
]
content-type: "application/json"
parameters:
[
"url": "https://www.google.com",
"name": "test.pdf"
]
connection: "pdfco"
detailed: true
response-format: JSON
response-decoding: AUTO
];
Calling PDF Edit Add API from Zoho Flow
// Set up the endpoint URL
endpointUrl = "https://api.pdf.co/v1/pdf/edit/add";
// Set up the request parameters
requestParams = {
“async”: true,
“name”: “test.pdf”,
“password”: “”,
“url”: “https://bytescout-com.s3.amazonaws.com/files/demo-files/cloud-api/pdf-edit/sample.pdf”,
“searchString”: “Bytescout”,
“text”: “PDF.co”,
“urlSearchString”: “”,
“urlText”: “”,
“x”: “”,
“y”: “”,
“w”: “”,
“h”: “”,
“pages”: “0”,
“urlPages”: “0”,
“encrypt”: false,
“decrypt”: false,
“skipDoubleExtraction”: false,
“asyncProgress”: false,
“description”: “”,
“inline”: true
};
// Set up the headers
headers = {
“Content-Type”: “application/json”,
“x-api-key”: “YOUR_API_KEY”
};
// Make the request using the invokeUrl task
response = invokeUrl
[
url: endpointUrl
type: “POST”
headers: headers
parameters: requestParams
];
// Parse the response and log the result
info response;
For more information on calling PDF.co API from Zoho Flow please see these tutorials: