[SOLVED] How to upload an image using POST API

Hi @eric3, I tweaked your project, and it works now. Check it to see the details. The tma1.jpg image is what I posted through your endpoint.

I think the issue was that the “Initialize / Detect request data” feature should NOT be used. Instead, manually define the parameters as shown. The file parameter can be called whatever you want (“uploaded_image” in this case), as @Jici noted. Additional “field values” for the “thing” being created can be defined at the JSON root.

Here’s a snippet of the payload sent…

{
  "title": "Sorry, Dave",
  "uploaded_image": {
    "filename": "tma1.jpg",
    "contents": "/9j/4AAQSkZJRg [...]"
  }
}

EDIT: As noted in the reference, private and attached_to properties can also be added to uploaded_image.

5 Likes