PDF.co API call with UiPath
In this article, we will review the PDF.co API call activity. We already have seen other activities, like PDF merger, splitting PDF, or converting PDF to different formats, or filling the PDF. These all activities on the need of using the PDF.co API call. If we want to directly consume the API call. We can consume using this activity, main parameters expect are the URL of the API and the input request. The output response will be received in this parameter.
Now let’s see different API is here. On the PDF.co documentation, if you want to go to this page, you can go from PDF.co website into documentation and the REST API docs. Here it is listing out all the API from PDF.co. The API which we are demonstrating in this session is PDF/info.
This particular API, as the name suggests is giving all the information about the PDF. For example, if we have some input PDF provided as the URL then it will give the information about the number of page counts. The author of the PDF, title of the PDF, in which software this PDF is produced, when it is created, if it contains different text, then it will also provide information of that in that keyword property, as well as the size and detailed properties. All information regarding this PDF can be retrieved using the API.
Now try to consume this API in UiPath. I’m copying and pasting the API endpoint in the PDF.co API URL section. Also, add the PDF request from here. It is giving extra space. Copy this input request and it is expecting the input in the string format. I have to provide the escaping characters. For example, instead of the double quotes, I have to provide the two double-quotes. Whenever the request reaches the PDF.co, it will be in the proper format. I think the input request is completed.
Now create a variable for this output response. I’m right-clicking here and creating the variable by naming this as an output response. Add a connecting message box here so that we can display the output in the message box. I’m setting the text as a variable, which we just defined.
Now, let’s see this in action and I’m executing here. Execution has been completed and we can see all the information is received in the message box. This is how easy we can directly consume the PDF.co API call. We can utilize the output in any way. For example, we can parse the JSON response and use any of the keys in whatever the way we want.
UiPath and PDF.co integration
To start, please use the button below: