Question

Upload image on SysImage using ODATA

Hi community,

 

I'm tryng to upload an image in SysImage entity using odata 4.0 services.

I followed this creatio guide Integrations & API (creatio.com).

Page 22 explains how to create the record on the SysImage entity and how to load the image, but missing how to pass the stream data to the odata service.

Using postman I send a PUT command with a  json  like this

{ "Name": "file.png", "Data": stream image }

the call is completed succesfully, but nothing is uploaded.
Here the postman call to odata service

Like 0

Like

7 comments

Hi Stefano,

Please break your request into two separate ones. 
One with JSON body for "Name" and the second one with binary type body. You need to  attach the  .png file to that second request.

Best regards,
Yurii

Thank you Yuril,
it works fine!

Stefano Bassoli,

Hi Yuril,
the image is uploaded correctly on SysImage entity.
I updated the Contact.PhotoId field using the id of SysImage record used for upload image,
The contact page show a white image for the contact.
What Am I doing wrong?

Stefano Bassoli,

Please make sure that the image is indeed updated, to do so send a GET request to /0/odata/SysImage(id)/Data

Also, make sure to send PATCH request to 0/odata/Contact(id)

to check if the id is updated send another GET request to /0/odata/Contact(id) and check if PhotoId is indeed equal to SysImage.Id of the image you've created. 

Yurii.

Yurii Sokil,
I checked every data are correct, but the image is white.

I loaded the image showed below 

and on contact.PhotoId the SysImage.Id is referenced

Stefano Bassoli,
Hi Yurii,
after some minutes the contact picture is showed correctly,
Thank you very much

Stefano Bassoli,

Hello, I am facing the exact issue, but unfortunately, the image is still white despite waiting over a day. Can you please tell me how you sent the Image content?

Show all comments