After reading above article, I am able to get, add, edit data in Monday.com through UiPath HTTP Request
I am able to upload files as well, however, my .pdf file converted to .file after sending upload request to Monday, therefore,
my question is how to upload PDF file by using UiPath HTTP Request through Monday.com API, and make sure the file is still a .pdf file but not .file
My current approach is converting my local file to base64 string, then place it in the api query
Below is the feedback on my approach from Monday.com support
"(uploading files base64 encoded) and unfortunately, this is not officially supported, this is why all files are uploaded with the same generic data name and no file extension is added, because there is no way to specify this information in a base64 encoded file string unless is specifically handled in the server end that receives the file.
the officially supported method to do so is with multipart/form-data requests, which does send this information as part of the request. You can check the documentation about it here."
My second question is how to convert local file path to multipart/form-data without using invoke code, curl, postman, or vb.net?
Hmm perhaps to isolate the problem could you try to make the API call via Postman? So that we can see if it’s a problem with the UiPath robot sending the request, or is it the request itself that’s having a problem.
Hello Max! To upload a PDF file to Monday.com using UiPath HTTP Request activity, you can follow these steps:
Obtain an API key from Monday.com: You’ll need an API key with appropriate permissions to upload files to your Monday.com account. If you don’t have one, you can generate it from the Monday.com developer settings.
Create a new request in UiPath: In UiPath Studio, drag and drop an HTTP Request activity onto your workflow.
Configure the HTTP Request activity:
Set the “Method” property to “POST”.
Set the “Endpoint” property to the Monday.com API URL for file uploads, which is https://api.monday.com/v2/file.
Add headers:
Click on the “Headers” property to open the Headers Collection Editor.
Add a new header with the key “Authorization” and the value “YOUR_API_KEY”, replacing “YOUR_API_KEY” with the API key you obtained from Monday.com.
Build the request body:
Create a new Dictionary variable to hold the request body parameters.
Add a key-value pair to the dictionary with the key “query” and the value as a JSON string containing the necessary information. For example:
Replace “YOUR_ITEM_ID” with the ID of the item in Monday.com where you want to upload the file, and “YOUR_COLUMN_ID” with the ID of the column in that item where the file should be uploaded.
Read the PDF file as bytes:
Use the Read PDF Text or Read PDF with OCR activity to read the PDF file as a byte array.
Store the resulting byte array in a variable.
Update the request body:
Update the “variables.file” value in the request body dictionary with the byte array obtained from the PDF file.
Convert the request body to JSON:
Use the Serialize JSON activity to convert the request body dictionary to a JSON string.
Store the JSON string in a variable.
Set the request body in the HTTP Request activity:
Set the “Body” property of the HTTP Request activity to the JSON string variable created in the previous step.
Send the HTTP request:
Execute the HTTP Request activity to send the request to Monday.com.
Process the response:
Handle the response from Monday.com as needed in your workflow. The response may contain information about the uploaded file, such as the file ID.
Make sure to customize the API endpoint, headers, query, and other parameters according to your specific requirements and the Monday.com API documentation.