Skip to main content

Hello,

I am wondering if it is possible to include the raw data for an image (pdf or jpg) in an events’ properties when posting a Create Event to /api/events.

We have a customer confirmation email which needs to include a QR code for the post office to scan. I’d rather not have to create website links for the QR code images.

Any ideas?

Many thanks,

Mat

 

 

 

Hi @matcwhite!

At this time, it’s not possible to include images in the Create Event API call, but I will update the thread if anything changes.

 

Best,

Brian


Hi ​@matcwhite - I was hitting the same wall. You can do it, but you might not want to.

 

I was able to send the qr code base64 data 

{
"attributes":{
"properties":{
"img":"data:image/png;base64,iVBOxxxxx"
...

as an event attribute. This allowed me to dynamically set an image to event.img and embed the content of the image directly in the email.

However, this ends up with potential compatibility issues. 1] 

 

In production I’m actually using the /api/images endpoint o2] with the import_from_url attribute.

The import_from_url allows you to set a base64 encoded string instead of a url. I’m capturing the new Klaviyo URL and Image ID in the response. The Klaviyo URL is a drop-in replacement for the above img event attribute.

(And I’m saving the Klaviyo Image IDs for future clean up.)

 

 

 

 


Reply