How to encode as a muiltipart/form-data request?

Status
Not open for further replies.

Andrew L

Member
Hi,

I am wanting to send attachments from HubSpot to an Asana task. I have accomplished the API called to query the attachments URLs. I know roughly how to send an attachment to Asana using their Upload an Attachment API.

Only bit I am stuck on is creating a Pabbly API POST to send the URL as a multipart/form-data as the documentation requires.

Note that I am sending it as an 'external' type rather than sending the image. So I just need to encode the URL. I'm not sure Pabbly has a way of accomplishing that.

The request would look a little like this below:

POST /api/1.0/attachments HTTP/1.1
Accept: application/json
Content-Type: multipart/form-data; boundary=---[24 digits of 0 and 1s]
Authorization: Bearer [API key]
Host: app.asana.com
Content-Length: [content length number]

-----[24 digits of 0 and 1s]
Content-Disposition: form-data; name="URL"

-----[24 digits of 0 and 1s] Conte...ype" external -----[24 digits of 0 and 1s]--
 

Supreme

Well-known member
Staff member
Hey @Andrew L

Currently, we do not support the attachment field on the platform here, but as a workaround, you can use the "Upload An Attachment" action step to upload a file URL as Asana which only supports the external URL.

1675768662365.png
 
Status
Not open for further replies.
Top