Events API
Last updated
Last updated
POST /v1/event HTTP/1.1
Host: events.canvasapp.com
Content-Type: application/json
X-Auth-Token: [your api token]
Content-Length: 237
{
"version" : 1,
"type" : "event",
"event" : "Purchased an Item",
"properties" : {
"revenue" : "39.95",
"shippingMethod" : "2-day"
},
"timestamp" : "2012-12-02T00:30:08.276Z"
}
import requests
url = "https://events.canvasapp.com/v1/event"
payload="{\n \"version\" : 1,\n \"type\" : \"event\",\n \"event\" : \"Purchased an Item\",\n \"properties\" : {\n \"revenue\" : \"39.95\",\n \"shippingMethod\" : \"2-day\"\n },\n \"timestamp\" : \"2012-12-02T00:30:08.276Z\"\n}"
headers = {
'Content-Type': 'application/json',
'X-Auth-Token': '[your_api_token]'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)var axios = require('axios');
var data = JSON.stringify({"version":1,"type":"event","event":"Purchased an Item","properties":{"revenue":"39.95","shippingMethod":"2-day"},"timestamp":"2012-12-02T00:30:08.276Z"});
var config = {
method: 'post',
url: 'https://events.canvasapp.com/v1/event',
headers: {
'Content-Type': 'application/json',
'X-Auth-Token': '[your_api_token]'
},
data : data
};
axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data));
})
.catch(function (error) {
console.log(error);
});