Adding an image to a listing via REST API

Hi!
I’m trying to add an image via REST API (from a python script).
My plan was first to

  1. find the listing ID using the Title,
  2. set the image as the property of the listing.

In order to find the listing ID I was trying to access:
/wp-json/hivepress/v1/listings with
HTTPBasicAuth(wp_username, wp_password)
but I’m getting 406 response.
Any clue?

any other way to achieve the above?

I’m sorry for the delay.

The best way to do this is using the attachment upload REST API endpoint first, then the returned image ID can be used to update the listing and save the ID in the “image” field of a listing.

Hope this helps