Skip to content

Dossier Images

POST dossiers/images

Uploads the specified image and returns a filename. The image can then be added to a dossier using the Dossier Creation endpoint.

Request#

curl -X POST 'https://api.pricehubble.com/api/v1/dossiers/images' \
  -H 'Authorization: Bearer 74126eab0a9048d993bda4b1b55ae074' \
  -F 'image=@/path/to/image.jpg'
curl -X POST 'https://api.pricehubble.com/api/v1/dossiers/images' \
  -H 'Authorization: Bearer 74126eab0a9048d993bda4b1b55ae074' \
  -F 'url="https://google.com/sample.jpg"'
Field Description Type Remarks
image The file to upload file JPG, JPEG, PNG, TIFF, HEIC, HEIF files are supported. Max size of 20MB. Required if url isn't provided. Resulting file for TIFF, HEIC, HEIF is converted to JPG.
url Url of the file to upload string JPG, JPEG, PNG, TIFF, HEIC, HEIF files are supported. Max size of 20MB. Required if image isn't provided. Resulting file for TIFF, HEIC, HEIF is converted to JPG.

Code example#

Code example using Python 3 and the Requests library:

import requests

url = "https://upload.wikimedia.org/wikipedia/commons/a/a3/June_odd-eyed-cat.jpg",
token = "<YOUR AUTH TOKEN>"

image = requests.get(url)

response = requests.post(
  f"https://api.pricehubble.com/api/v1/dossiers/images",
  headers={"Authorization": f"Bearer {token}"},
  files={"image": image.content}
)

Response#

{
  "filename": "...e9742b1f0f55.jpg",
  "url": "https://storage.googleapis.com/.../...e9742b1f0f55.jpg"
}
Field Description Type Remarks
filename Name of the file string To be used in the Dossier Creation or the Dossier Update API endpoint
url Url of the uploaded image string