Is it possible to make an API HTTP request with a JSON and base64 encoded payload?
I am trying to integrate a JSON below and also pass various variables dynamically based on user activity, in this case, an event (purchase) made on through the app.
This triggers a series of events inside a CRM.
Some docs: https://www.klaviyo.com/docs
{
“token” : “API_KEY”,
“event” : “Placed Order”,
“customer_properties” : {
“$email” : "john.smith@example.com",
“$first_name” : “John”,
“$last_name” : “Smith”
},
“properties” : {
“$event_id” : “1234”,
“$value” : 29.98,
“Categories” : [“Fiction”, “Classics”, “Children”],
“ItemNames” : [“Winnie the Pooh”, “A Tale of Two Cities”],
“Brands” : [“Kids Books”, “Harcourt Classics”],
“Items” : [
{
“SKU” : “WINNIEPOOH”,
“Name” : “Winnie the Pooh”,
“Quantity” : 1,
“ItemPrice” : 9.99,
“RowTotal” : 9.99,
“ProductURL” : “http://www.example.com/path/to/product”,
“ImageURL” : “http://www.example.com/path/to/product/image.png”,
“Categories” : [“Fiction”, “Children”],
“Brand” : “Kids Books”
},
{
“SKU” : “TALEOFTWO”,
“Name” : “A Tale of Two Cities”,
“Quantity” : 1,
“ItemPrice” : 19.99,
“RowTotal” : 19.99,
“ProductURL” : “http://www.example.com/path/to/product2”,
“ImageURL” : “http://www.example.com/path/to/product/image2.png”,
“Categories” : [“Fiction”, “Classics”],
“Brand” : “Harcourt Classics”
}
]
},
“time” : 1387302423
}