How to set HubDB image value through API?

There is no documentation about how to set a image cell value through the HubDB API.

I managed to upload the file to the file manager and get its ID and URL.

But now I don’t know how to use that into HubDB.

I tried many things, none worked.

I tried: a STRING url, it gives me

[message] => error when updating datatable row 63392861046 in table 5315761 for portal 3077106: the value {type=string, value=} for column image was of type STRING, but we’re expecting MAP

Then I tried with [ type => image, value => http:// ] and many other combinations using both url, path, and ID.

No errors but nothing is set.

With an image column type you can just insert an image using the normal Hubspot image selector when editing the HubDB

Alternatively, if you want to point to a URL where an image is hosted instead of selecting one of your own images, use the URL column type and add the full address e.g. https://via.placeholder.com/350x150

Sorry, I meant throught the API, not through the interface.

@gufoe ah sorry, I misunderstood. I think you have to pass it an object as a value, like so

{"width": null, "height": null, "url": "[full url of image including https://]"}

as that’s how images are represented in HubDB. A map is a dict, i.e. a set of key value pairs.

Sorry for the late reply. This method is not working aswell.

I get the following error: error when updating datatable row 65217422972 in table 5297224 for portal 3077106: null

This is my request content for the column [

[width] => 10
[height] => 10
[url] => https://academy.dakota.eu/hubfs/On%20Page%20-%20section5-1.png
]

Any other idea?

I tried passing null to width and height but I get the very same error

In addition to width and height, a type key with a value of image is also needed. For example if you’re using JSON, here is a valid image object you can post with the API:

"image_property_name": {
 "url": "https://example.com/image.png",
 "width": 100,
 "height": 100,
 "type": "image"
}