Upload file via URL: Authentification issue

Hi,

I’m trying to upload an image via url.

First, I get my token from here:

response_json=requests.post('https://api.baserow.io/api/user/token-auth/',{

    "username": "myemail@email.com",
    "password": "wonderfulpassword"

}).json()
token=response_json['token']

Then I try to upload my file:

headers = {"Content-Type": "application/json","Authorization": "Bearer " + token}

response=requests.post(url="https://api.baserow.io/api/user-files/upload-via-url/",
            json={"url": "https://gitlab.com/uploads/-/system/project/avatar/10858056/logo.jpg"},
            headers=headers)

Response 401=> ‘{“detail”:“Authentication credentials were not provided.”}’

Could you help me please? I spent 2 hours looking for the issue!

Thank you!

EDIT:
headers Authorization should have been a JWT:


headers = {"Content-Type": "application/json","Authorization": "JWT " + token}
1 Like

I have the same issue, trying to upload an image via POST https://api.baserow.io/api/user-files/upload-file/ for a Make Automation, entering the Authorization Token as Key in my header and then I receive the response “detail”:“Authentication credentials were not provided.”}

Similar to this workflow here Upload file from baserow - Questions & Answers - Make Community

Any help please?

Hi @nyx ,

The authorization header must indeed be prefixed with JTW instead of Bearer. Does this solve the problem?

@artoflogic :

  1. Which block do you use in Make? The Make an API Call block that is specific for Baserow or the general HTTP request node?
  2. Do you authenticate with a database token or a JWT token?

Hi @frederikdc , thanks for replying.

I have to check this again. I find it hard to figure this out. What I am missing is a step-by-step guide on exactly uploading a file in the file column type in Baserow via Make Automation.

I shouldn’t have to use the request module. There should be a Baserow module that offers all the required configurations.

Also, I am confused about why the Standard “Update Baserow” element in Make does not offer the option to upload files. Probably because it’s not straightforward. This is where I got stuck.

I will check the options you mention but I think I am still looking for an exact step-by-step guide how to do this.

Cheers

Is this something you could document a bit better and explain step by step how to do it?

Hi @frederikdc ,

I am completely lost. The problem is this documentation How to upload files via URL with the Baserow API // Baserow does not explain the basics, how to upload a file to a specific cell in Baserow. Also this is for programmers and not really “as promised” for non-technical people.

My questions are the following:

  1. How to correctly authenticate?
  2. How to define which table to upload the file to?
  3. How to define which column to upload the file to?
  4. How to define which row to upload the file to?
  5. How to correctly upload the file to Baserow (I downloaded it first)

See also my question here. Uploading a File to Baserow Table into a File Field - #3 by figuresandnumbers - Questions & Answers - Make Community

If you could kindly explain this step by step so we can follow. What also be appreciated is if you could provide a simple Element in Make.com to handle file uploads. If you could kindly explain and later provide a simpler solution for this that would be very much appreciated. Thank you.

Hi,

How are you trying to upload the file? Does the webhook in your scenario passes a url to a file or does it contains the actual image?

Can you post a screenshot of the output of the webhook?