200 Order successfully retrieved. 400
Copy Event successfully added
cURL Javascript - jQuery Javascript - Fetch Nodejs - Axios PHP - cURL Python
Copy curl --location --request POST 'https://api-dot-solutionsone-211314.ew.r.appspot.com/v1/track'
--header 'Authorization: Bearer [ADD YOUR USER TOKEN HERE]' \
--header 'Content-Type: application/json'
--data-raw '{
"user_id": "da123fg876sfed",
"event_name": "Added To Cart",
"event":
{
product_id: '',
product_type: '',
name: '',
price: ,
currency: '',
quantity: 1,
url: 'https://www.example.com/product/path',
image_url: 'https://www.example.com/product/path.jpg'
},
"datetime": "2020-01-01 20:20:01+01:00"
"session_id": "123a"
}'
Copy var settings = {
"url": "https://api-dot-solutionsone-211314.ew.r.appspot.com/v1/orders",
"method": "POST",
"timeout": 0,
"headers": {
"Authorization": "Bearer [ADD YOUR USER TOKEN HERE]",
"Content-Type": "application/json"
},
"data": JSON.stringify({
"user_id": "da123fg876sfed",
"event_name": "Added To Cart",
"event":
{
product_id: '',
product_type: '',
name: '',
price: ,
currency: '',
quantity: 1,
url: 'https://www.example.com/product/path',
image_url: 'https://www.example.com/product/path.jpg'
},
"datetime": "2020-01-01 20:20:01+01:00"
"session_id": "123a"
}),
};
$.ajax(settings).done(function (response) {
console.log(response);
});
Copy var myHeaders = new Headers();
myHeaders.append("Authorization", "Bearer [ADD YOUR USER TOKEN HERE]");
myHeaders.append("Content-Type", "application/json");
var raw = JSON.stringify({
"user_id": "da123fg876sfed",
"event_name": "Added To Cart",
"event":
{
product_id: '',
product_type: '',
name: '',
price: ,
currency: '',
quantity: 1,
url: 'https://www.example.com/product/path',
image_url: 'https://www.example.com/product/path.jpg'
},
"datetime": "2020-01-01 20:20:01+01:00"
"session_id": "123a"
});
var requestOptions = {
method: 'POST',
headers: myHeaders,
body: raw,
redirect: 'follow'
};
fetch("https://api-dot-solutionsone-211314.ew.r.appspot.com/v1/orders", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));
Copy var axios = require('axios');
var data = JSON.stringify({
"user_id": "da123fg876sfed",
"event_name": "Added To Cart",
"event":
{
product_id: '',
product_type: '',
name: '',
price: ,
currency: '',
quantity: 1,
url: 'https://www.example.com/product/path',
image_url: 'https://www.example.com/product/path.jpg'
},
"datetime": "2020-01-01 20:20:01+01:00"
"session_id": "123a"
});
var config = {
method: 'post',
url: 'https://api-dot-solutionsone-211314.ew.r.appspot.com/v1/orders',
headers: {
'Authorization': 'Bearer [ADD YOUR USER TOKEN HERE]',
'Content-Type': 'application/json'
},
data : data
};
axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data));
})
.catch(function (error) {
console.log(error);
});
Copy <?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://api-dot-solutionsone-211314.ew.r.appspot.com/v1/orders",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS =>"JSON_ENCODE(array(
"user_id" => "da123fg876sfed",
"event_name" => "Added To Cart",
"event" =>
array(
product_id => '',
product_type => '',
name => '',
price => ,
currency => '',
quantity => 1,
url => 'https://www.example.com/product/path',
image_url => 'https://www.example.com/product/path.jpg'
),
"datetime" => "2020-01-01 20:20:01+01:00"
"session_id" => "123a"
))",
CURLOPT_HTTPHEADER => array(
"Authorization: Bearer [ADD YOUR USER TOKEN HERE]",
"Content-Type: application/json"
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
Copy import requests
import json
url = "https://api-dot-solutionsone-211314.ew.r.appspot.com/v1/orders"
event = {
"user_id": "da123fg876sfed",
"event_name": "Added To Cart",
"event":
{
product_id: '',
product_type: '',
name: '',
price: ,
currency: '',
quantity: 1,
url: 'https://www.example.com/product/path',
image_url: 'https://www.example.com/product/path.jpg'
},
"datetime": "2020-01-01 20:20:01+01:00"
"session_id": "123a"
}
payload = json.dumps(event)
headers = {
'Authorization': 'Bearer [ADD YOUR USER TOKEN HERE]',
'Content-Type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data = payload)
print(response.text.encode('utf8'))
Copy YYYY-MM-DD[*HH[:MM[:SS[.fff[fff]]]][+HH:MM[:SS[.ffffff]]]]