Start a new topic
Answered

Upload images to multiple records at the same time through SQL Server queries or API

Hi,


I'm looking to import images to multiple records at the same time using SQL Server queries or API.

Is it possible?


Thanks,

Christian


Best Answer

Hello Christian,


It does not seem possible to natively import images (binary attributes) trough REST API, not due to any Semarchy restrictions, but because binary data isn't natively supported by JSON.


However, after doing some research on internet, I was able to find this workaround:
Please note that it advises to use postman-echo to get the base64 string of your file - which can lead to confidentiality issues regarding your data - but there may be other solutions to make this conversion, maybe your integration team can help you with it.


This is only 1 suggestion based on a little research on the web, so please analyze it based on your context and requirements. Other solutions might be available and best suited for you that I'm not aware of as it is outside of Semarchy's reach.


Hope this helps.

Have a good day.

Alexia


Hello Christian,


Could you please detail a little bit more your use case?

In which context do you require to load images for a record?


This will help us to better guide you.


BR,

Alexia

Hi Alexia,


We have a bank of images (logos, player photos) that we want to import on our records.

I imagined a workflow where we could retrieve each file, query our database and retrieve the correct record in order to integrate the image (converted in base64 as it seems to be what Semarchy delivers through the API).

Is it something possible?


Thanks,

Hi Christian,


I'm still not sure to fully understand the use case.


What is the purpose of those images?

To display them in the UI (if so in which capacity: display card, form field...)?

To store them (if so, what is the type of your attribute)?


Depending on that, I can guide you on how to achieve this.


Thank you

BR,

Alexia

Hi Alexia,


These images will be stored on Semarchy, and one of our vendors will retrieve the base64 code from the image using the API.


The attribute is a binary file.


image

Thank you,

Regards,

Christian


Answer

Hello Christian,


It does not seem possible to natively import images (binary attributes) trough REST API, not due to any Semarchy restrictions, but because binary data isn't natively supported by JSON.


However, after doing some research on internet, I was able to find this workaround:
Please note that it advises to use postman-echo to get the base64 string of your file - which can lead to confidentiality issues regarding your data - but there may be other solutions to make this conversion, maybe your integration team can help you with it.


This is only 1 suggestion based on a little research on the web, so please analyze it based on your context and requirements. Other solutions might be available and best suited for you that I'm not aware of as it is outside of Semarchy's reach.


Hope this helps.

Have a good day.

Alexia

Login to post a comment