HTTP Request - Post an Excel file

Hello all,
I’m seeking assistance with a challenge involving sending an Excel file (.xlsx) via API. While I’ve successfully attached it to the binary body in Postman without encountering any issues,
I consistently face HTTP status 500 or 400 errors when attempting the same in UiPath using HTTP requests.

Can anyone offer guidance on resolving this issue? Your help would be greatly appreciated. Thank you

Hello DigiSea,

Providing you one pdf file which have all the instructions how to upload a file via API.
Please try following steps on Postman.

Getting Started With File Upload in APIs.pdf (754.1 KB)

Adding one more pdf which will give you guidance how to upload file using postman.

How to Upload a File in Postman.pdf (739.4 KB)

Please let me know if my suggestion resolves your issue.

Thank you :slight_smile:
Happy Automation!!
Hrishikesh Kothale.

Thank @hrishikesh.k for your supporting documents

In Postman, I’ve successfully attached it to the binary body in Postman without encountering any issues
In UiPath, I consistently face HTTP status 500 or 400 errors when attempting the same in UiPath using HTTP requests

Hello DigiSea,

Please try “PUT” method once!

Please let me know if my suggestion resolves your issue.

Thank you :slight_smile:
Happy Automation!!
Hrishikesh Kothale.

Hi @DigiSea ,

There is a file attachment property in HTTP activity. You can try using that

@DigiSea,

Attachments with HTTPS request works differently than Postman.
In HTTP request, you will have to pass the attachment in Attachments property.

Thanks,
Ashok :slight_smile:

Thank @ashokkarale and @muktadir
I encountered the issue HTTP status 405 errors when attempting to use attachment property.
Could you please provide me a sample of it?

@DigiSea,

Suggest me a public domain API which supports attachment upload. I will try to recreate it for you.

@DigiSea,

I think it’s the Body Format which is resulting in this issue. Change it to multipart/form-data and it should work if other arguments and attachment file paths passed correctly.

image

Thanks,
Ashok :slight_smile: