Uploading Files to bika.ai via HTTP modules

Hi all,
I’m looking for a way to upload files into bika.ai, and I can update a record via their API, but unfortunately, I’m struggling to understand how to convert a cURL command into a “make a request” module.

They say:

Step 1
Run this cURL command to upload your file and save the data in response for the next step:
curl ‘https://bika.ai/api/openapi/bika/v1/spaces/{SPACE_ID}/attachments
-H “Authorization: Bearer {YOUR_ACCESS_TOKEN}”
-F ‘file=@./example.png’

Step 2
Use a PATCH request to update the record with the uploaded attachment:
curl -X PATCH “https://bika.ai/api/openapi/bika/v1/spaces/{SPACE_ID}/resources/databases/{NODE_ID}/records
-H “Authorization: Bearer {YOUR_ACCESS_TOKEN}”
-H “Content-Type: application/json”
-d ‘{
“cells”: {
“attachmentField”: [
{
“id”: “attpcZFhfBmt6KFA4MbKKoO1”,
“path”: “openapi/teCC2LGpyEOUWZsXET9I6.png”,
“size”: 211047,
“bucket”: “bika”,
“mimeType”: “image/png”,
“name”: “teCC2LGpyEOUWZsXET9I6.png”
}
]
},
“id”: “recif5tp0iMl4y6JHwIaCtvm”
}’

Would anyone be able to provide a visual example of these two modules and their settings? Thanks so much!

You’ll need two HTTP modules, since it’s two steps.

You can save the auth token so that it’s stored as a separate connection, and you won’t have to retype it each time you want to call this external service, or update individual modules.

To do this, you can try using the HTTP “Make an API Key Auth request” module —

Sends an HTTPS request to a specified URL that requires API Key Auth authorization and processes the response.

For more information about the Make an API Key Auth request module and HTTP app, see the corresponding Integrations page and the Help Centre documentation.

Hope this helps! Let me know if there are any further questions or issues.

@samliew