Custom action - curl -F

Hello need help to make a custom action with this curl:

curl https://api.openai.com/v1/images/edits \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -F image='@otter.png' \
  -F mask='@mask.png' \
  -F prompt="A cute baby sea otter wearing a beret" \
  -F n=2 \
  -F size="1024x1024"

where to insert the F curl?

Welcome to the community @dksstudios

Follow this documentation:

Also, @theadaloguy created a tutorial for this API: How to use AI in your Adalo App

Thanks @Flawless , but in that adalo tuturial, nothing about the Curl - F , is a Filter ? ( where to insert that to get returne? @theadaloguy you can help? This is for image edit AI in Open ai.

Thanks for your help

You don’t use the curl, you use the custom action. Follow the video Using the OpenAI API in Adalo is easy! Learn how to use artificial intelligence with no code. - YouTube

1 Like

yes @Flawless , I know about the custom action, and the tutorial you send is about text in open ai, thats ok, we can do that, and is easy.

But in this case, is for generate image in Open AI,
first: we had made a custom action easy for generate images from prompt, ok, we get a image.
second: After that we need to edit a image, bur we dont know where insert the -F and whats is the -F to get the image edited.

See: OpenAI API

Based on his video, you should try to create the body json using the values.

{
"image":"🪄",
"mask":"🪄",
"prompt":"🪄",
"n":🪄,
"size":"🪄"
}

Replace all wands (:magic_wand:) with the magic text from the prompts you create.

1 Like

thats in not a valid Json @Flawless


Switch the = for :

yes I already make this before insert the topic in the forum.
But the problem is the same this in not a json “body” custom action.

Need to understand where to insert the -F in the adalo custom action.

-F image=‘@otter.png
-F mask=‘@mask.png
-F prompt=“A cute baby sea otter wearing a beret”
-F n=2
-F size=“1024x1024”

because -d is json body

 -d '{
    "prompt": "a white siamese cat",
    "n": 1,
    "size": "1024x1024"
  }'

-F, --form <name=content> (HTTP) This lets curl emulate a filled-in form in which a user has pressed the submit button . This causes curl to POST data using the Content-Type multipart/form-data according to RFC 2388. This enables uploading of binary files etc.

@dksstudios did you solve this? I’m facing the same issue :smirk:

No, I think maybe we have to insert the F ( paramet…) in Query Param.
In Json, Ive try a lot of options and nothing.

What you think about?

Best Regards
Ricardo

A 2022-12-13 14:59, Gam via Adalo escreveu:

Currently, I’m looking at using Zapier, to connect adalo to Firebase, then use a cloud function to make the call, and return the response in a firebase collection - and then update Adalo record.

It seems very complicated though. I wish this was supported through custom actions

I also tried setting the content-type as multipart/form but that didn’t work

@theadaloguy @Flawless do you have any tips on this? Still struggling with it

I can try playing with the API a little bit later and I’ll get back to you.

You are correct here. Adalo custom actions do not currently support uploading multi-part form data like this and so they cannot be placed into a typical JSON object, header, or as query parameters. The best option for making this happen is to setup a Make, n8n, or Zapier webhook to receive this for you from a custom action, then setup a multipart form upload in a subsequent module/step.

1 Like

Thanks @pford , I was send a ticket to Adalo, to specify if that will be possible. Thanks for the sugestion, we go try by that way.

@Flawless and @gambo123 the solution will be like @pford says.

Got it, cheers @pford and @dksstudios