Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

159
Views
How to change the value of the “alternativeText” property of an image after having uploaded it to the route /upload API?

I’ve gone through the docs without any answer to my problem. I download an image that is on a bucket and I want to upload it to Strapi via the path "/upload" API. No problem, it works except that the “alternativeText” property is empty. I want to fill this value. Following the POST response from the image upload, I got the image ID. Now I want to update the “alternativeText” property by making a POST request on the route /upload?id=imageId with a payload but it does not work. I do it in Python. How do you do it on your side please?

files = {
    'files': 
        (
            'image_name', 
           'path/files' , 
            'type_mime'
        ),
}

headers = {
    "accept" : "application/json",
    "Authorization" : 'Bearer my_token' ,
}

responseUploadImage= requests.post(
    url= 'http://localhost:1337/api/upload',
    files=files,
    headers=headers
)

content = json.loads(responseUploadImage.content)
imageID= content[0]['id']

payload= json.dumps({
    'fileInfo': {"alternativeText":"alt","caption":"caption","name":"iamage_name"}
})

response= requests.post(
    url=  'http://localhost:1337/api/upload?id=' + str(imageID),
    data=payload,
    headers = {
        "accept" : "application/json",
        "Authorization" : 'Bearer ' + os.environ['API_KEY'],
    }
)
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!