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?