How to Post an endpoint URL with a file and its path

Hi there! I'm a newbie in using APIs with file post so i will use your help. I'm creating an app for educational purposes and i want to incorporate the following curl code:
curl -X POST 'https://api.sightengine.com/1.0/check.json'
-F 'media=@/path/to/image.jpg'
-F 'models=genai'
-F 'api_user={api_user}'
-F 'api_secret={api_secret}'

I tried the ready made solutions for converting curl to blocks but with no result. I tried using dictionaries, lists but i still get a "failure" feedback. Can anyone help me please?

Show us the blocks you tried
Set the header and try the PostFile method

In case the API is using multipart/formdata, the following extension could be an alternative

Taifun
PS: here is the link to the API documentation Get started with Image Moderation seems to be an interesting API...

Thank you for your quick response. Unfortunately i don't want to use extensions but only the default appinventor's blocks. I created the following endpoint url https://api.sightengine.com/1.0/check.json&models=genai&api_user=.....&api_secret=.... and the i sent the file path with the Web1.PostFile. Firstly sth I'm doing wrong as i didn't find a way to send both url and file. I didn't use any headers.

Set the headers and show us a screenshot of the blocks
Here is a similar example App Inventor Tutorials and Examples: Dropbox | Pura Vida Apps

Taifun

The web component is not able to send multipart/formdata

Try this

And add a Web.GotText event to find out the response comtent

Taifun

Just now i got this answer from sightengine. Can we bypass it?

after testing your solution a got this
image

Follow that recommendation

You forgot to show us a screenshot of your updated blocks

Taifun

I don't have any personal server to upload the images as the recommendation says

It said "upload the image to somewhere online"
This could also be for example your Google Drive, you later only have to provide a public url to the uploaded file

See here Pick Files and Upload to Google Drive - #4 by TIMAI2

Taifun

It could be something but in terms of the app, this is not practical. So is there any other way?

Why is this not practical? This is a 2 step process

  1. upload the file to somewhere
  2. call rhe api together with the corresponding url to the image

It looks like that's how that API is working
Taifun

I want sth more simple as it is for a school project. All check it out though. Thanks for your help!