API Post Request

Hi everyone,

I would really appreciate help:)

What I am trying to do is this:

  • have my users upload a pdf and safe it to my database (this works)
  • make a API call to a python script that I have running on pythonanywhere where I run code on that pdf and safe the returned value in my bubble database

I am trying to do this via a post request in the API connector, however, I am running into some issues.
I know that my Python script works because if I run the request through my terminal like this curl -X POST -F file=[path_to_file] [link_to_pythonanywhere] I get back what I want.

I am struggling with setting up the POST request though. This is what it looks like right now:

How can I change my API request so that the correct link to the file from my database is inserted and the JSON from the script is returned?

thanks a lot!

Did you try adding a parameter and set it to file?

Do you know how I would then change the value dynamically?

I’ve never seen it where the actual file URL is passed inside the URL of the POST request. Are you sure you aren’t supposed to pass the file as a parameter with the body type of form-data? You can set the file dynamically that way as well.

Try setting it up so it’s just the URL in your POST line, add a parameter as a type of file, and then upload the file. See if it works that way.

Thank you I will try doing that. Do you know of any tutorial where I can see how that is done? Thanks