Batch Profile Aggregations
curl --request POST \
--url https://api.{tenant}.getomneo.com/api/v3/profile/aggregations/batch.json \
--header 'Content-Type: application/json' \
--data '
{
"aggregations": [
{
"profile_id": "<string>",
"shop_days": 123,
"shop_count": 123,
"spend_12m": 123,
"spend_12m_now": 123,
"spend_all": 123,
"spend_atv_12m": 123,
"spend_atv_all": 123,
"spend_first_date": "2023-11-07T05:31:56Z",
"spend_last_date": "2023-11-07T05:31:56Z",
"dimension_frequency": "<string>",
"dimension_recency": "<string>",
"dimension_join": "<string>",
"channel": "<string>",
"likely_country": "<string>",
"likely_country_score": 123,
"purchased_brands": [
"<string>"
],
"discount_avg": 123,
"total_shop_days": 123,
"first_shop_days": 123,
"second_shop_days": 123,
"latest_shop_days": 123,
"average_shop_days": 123,
"second_shop_date": "2023-11-07T05:31:56Z",
"previous_shop_date": "2023-11-07T05:31:56Z",
"at_risk_date": "2023-11-07T05:31:56Z",
"latest_shop_spend": 123,
"latest_shop_currency_id": 123,
"latest_transacted_location_id": 123,
"transacted_locations": [
"<string>"
],
"likely_country_iso": "<string>",
"likely_country_iso_score": 123,
"likely_state_iso": "<string>",
"likely_state_iso_score": 123,
"likely_region": "<string>",
"likely_region_score": 123,
"most_spend_location_id": 123,
"most_spend_12m_location_id": 123,
"top_historic_status_id": 123
}
]
}
'import requests
url = "https://api.{tenant}.getomneo.com/api/v3/profile/aggregations/batch.json"
payload = { "aggregations": [
{
"profile_id": "<string>",
"shop_days": 123,
"shop_count": 123,
"spend_12m": 123,
"spend_12m_now": 123,
"spend_all": 123,
"spend_atv_12m": 123,
"spend_atv_all": 123,
"spend_first_date": "2023-11-07T05:31:56Z",
"spend_last_date": "2023-11-07T05:31:56Z",
"dimension_frequency": "<string>",
"dimension_recency": "<string>",
"dimension_join": "<string>",
"channel": "<string>",
"likely_country": "<string>",
"likely_country_score": 123,
"purchased_brands": ["<string>"],
"discount_avg": 123,
"total_shop_days": 123,
"first_shop_days": 123,
"second_shop_days": 123,
"latest_shop_days": 123,
"average_shop_days": 123,
"second_shop_date": "2023-11-07T05:31:56Z",
"previous_shop_date": "2023-11-07T05:31:56Z",
"at_risk_date": "2023-11-07T05:31:56Z",
"latest_shop_spend": 123,
"latest_shop_currency_id": 123,
"latest_transacted_location_id": 123,
"transacted_locations": ["<string>"],
"likely_country_iso": "<string>",
"likely_country_iso_score": 123,
"likely_state_iso": "<string>",
"likely_state_iso_score": 123,
"likely_region": "<string>",
"likely_region_score": 123,
"most_spend_location_id": 123,
"most_spend_12m_location_id": 123,
"top_historic_status_id": 123
}
] }
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
aggregations: [
{
profile_id: '<string>',
shop_days: 123,
shop_count: 123,
spend_12m: 123,
spend_12m_now: 123,
spend_all: 123,
spend_atv_12m: 123,
spend_atv_all: 123,
spend_first_date: '2023-11-07T05:31:56Z',
spend_last_date: '2023-11-07T05:31:56Z',
dimension_frequency: '<string>',
dimension_recency: '<string>',
dimension_join: '<string>',
channel: '<string>',
likely_country: '<string>',
likely_country_score: 123,
purchased_brands: ['<string>'],
discount_avg: 123,
total_shop_days: 123,
first_shop_days: 123,
second_shop_days: 123,
latest_shop_days: 123,
average_shop_days: 123,
second_shop_date: '2023-11-07T05:31:56Z',
previous_shop_date: '2023-11-07T05:31:56Z',
at_risk_date: '2023-11-07T05:31:56Z',
latest_shop_spend: 123,
latest_shop_currency_id: 123,
latest_transacted_location_id: 123,
transacted_locations: ['<string>'],
likely_country_iso: '<string>',
likely_country_iso_score: 123,
likely_state_iso: '<string>',
likely_state_iso_score: 123,
likely_region: '<string>',
likely_region_score: 123,
most_spend_location_id: 123,
most_spend_12m_location_id: 123,
top_historic_status_id: 123
}
]
})
};
fetch('https://api.{tenant}.getomneo.com/api/v3/profile/aggregations/batch.json', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.{tenant}.getomneo.com/api/v3/profile/aggregations/batch.json",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'aggregations' => [
[
'profile_id' => '<string>',
'shop_days' => 123,
'shop_count' => 123,
'spend_12m' => 123,
'spend_12m_now' => 123,
'spend_all' => 123,
'spend_atv_12m' => 123,
'spend_atv_all' => 123,
'spend_first_date' => '2023-11-07T05:31:56Z',
'spend_last_date' => '2023-11-07T05:31:56Z',
'dimension_frequency' => '<string>',
'dimension_recency' => '<string>',
'dimension_join' => '<string>',
'channel' => '<string>',
'likely_country' => '<string>',
'likely_country_score' => 123,
'purchased_brands' => [
'<string>'
],
'discount_avg' => 123,
'total_shop_days' => 123,
'first_shop_days' => 123,
'second_shop_days' => 123,
'latest_shop_days' => 123,
'average_shop_days' => 123,
'second_shop_date' => '2023-11-07T05:31:56Z',
'previous_shop_date' => '2023-11-07T05:31:56Z',
'at_risk_date' => '2023-11-07T05:31:56Z',
'latest_shop_spend' => 123,
'latest_shop_currency_id' => 123,
'latest_transacted_location_id' => 123,
'transacted_locations' => [
'<string>'
],
'likely_country_iso' => '<string>',
'likely_country_iso_score' => 123,
'likely_state_iso' => '<string>',
'likely_state_iso_score' => 123,
'likely_region' => '<string>',
'likely_region_score' => 123,
'most_spend_location_id' => 123,
'most_spend_12m_location_id' => 123,
'top_historic_status_id' => 123
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.{tenant}.getomneo.com/api/v3/profile/aggregations/batch.json"
payload := strings.NewReader("{\n \"aggregations\": [\n {\n \"profile_id\": \"<string>\",\n \"shop_days\": 123,\n \"shop_count\": 123,\n \"spend_12m\": 123,\n \"spend_12m_now\": 123,\n \"spend_all\": 123,\n \"spend_atv_12m\": 123,\n \"spend_atv_all\": 123,\n \"spend_first_date\": \"2023-11-07T05:31:56Z\",\n \"spend_last_date\": \"2023-11-07T05:31:56Z\",\n \"dimension_frequency\": \"<string>\",\n \"dimension_recency\": \"<string>\",\n \"dimension_join\": \"<string>\",\n \"channel\": \"<string>\",\n \"likely_country\": \"<string>\",\n \"likely_country_score\": 123,\n \"purchased_brands\": [\n \"<string>\"\n ],\n \"discount_avg\": 123,\n \"total_shop_days\": 123,\n \"first_shop_days\": 123,\n \"second_shop_days\": 123,\n \"latest_shop_days\": 123,\n \"average_shop_days\": 123,\n \"second_shop_date\": \"2023-11-07T05:31:56Z\",\n \"previous_shop_date\": \"2023-11-07T05:31:56Z\",\n \"at_risk_date\": \"2023-11-07T05:31:56Z\",\n \"latest_shop_spend\": 123,\n \"latest_shop_currency_id\": 123,\n \"latest_transacted_location_id\": 123,\n \"transacted_locations\": [\n \"<string>\"\n ],\n \"likely_country_iso\": \"<string>\",\n \"likely_country_iso_score\": 123,\n \"likely_state_iso\": \"<string>\",\n \"likely_state_iso_score\": 123,\n \"likely_region\": \"<string>\",\n \"likely_region_score\": 123,\n \"most_spend_location_id\": 123,\n \"most_spend_12m_location_id\": 123,\n \"top_historic_status_id\": 123\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.{tenant}.getomneo.com/api/v3/profile/aggregations/batch.json")
.header("Content-Type", "application/json")
.body("{\n \"aggregations\": [\n {\n \"profile_id\": \"<string>\",\n \"shop_days\": 123,\n \"shop_count\": 123,\n \"spend_12m\": 123,\n \"spend_12m_now\": 123,\n \"spend_all\": 123,\n \"spend_atv_12m\": 123,\n \"spend_atv_all\": 123,\n \"spend_first_date\": \"2023-11-07T05:31:56Z\",\n \"spend_last_date\": \"2023-11-07T05:31:56Z\",\n \"dimension_frequency\": \"<string>\",\n \"dimension_recency\": \"<string>\",\n \"dimension_join\": \"<string>\",\n \"channel\": \"<string>\",\n \"likely_country\": \"<string>\",\n \"likely_country_score\": 123,\n \"purchased_brands\": [\n \"<string>\"\n ],\n \"discount_avg\": 123,\n \"total_shop_days\": 123,\n \"first_shop_days\": 123,\n \"second_shop_days\": 123,\n \"latest_shop_days\": 123,\n \"average_shop_days\": 123,\n \"second_shop_date\": \"2023-11-07T05:31:56Z\",\n \"previous_shop_date\": \"2023-11-07T05:31:56Z\",\n \"at_risk_date\": \"2023-11-07T05:31:56Z\",\n \"latest_shop_spend\": 123,\n \"latest_shop_currency_id\": 123,\n \"latest_transacted_location_id\": 123,\n \"transacted_locations\": [\n \"<string>\"\n ],\n \"likely_country_iso\": \"<string>\",\n \"likely_country_iso_score\": 123,\n \"likely_state_iso\": \"<string>\",\n \"likely_state_iso_score\": 123,\n \"likely_region\": \"<string>\",\n \"likely_region_score\": 123,\n \"most_spend_location_id\": 123,\n \"most_spend_12m_location_id\": 123,\n \"top_historic_status_id\": 123\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.{tenant}.getomneo.com/api/v3/profile/aggregations/batch.json")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"aggregations\": [\n {\n \"profile_id\": \"<string>\",\n \"shop_days\": 123,\n \"shop_count\": 123,\n \"spend_12m\": 123,\n \"spend_12m_now\": 123,\n \"spend_all\": 123,\n \"spend_atv_12m\": 123,\n \"spend_atv_all\": 123,\n \"spend_first_date\": \"2023-11-07T05:31:56Z\",\n \"spend_last_date\": \"2023-11-07T05:31:56Z\",\n \"dimension_frequency\": \"<string>\",\n \"dimension_recency\": \"<string>\",\n \"dimension_join\": \"<string>\",\n \"channel\": \"<string>\",\n \"likely_country\": \"<string>\",\n \"likely_country_score\": 123,\n \"purchased_brands\": [\n \"<string>\"\n ],\n \"discount_avg\": 123,\n \"total_shop_days\": 123,\n \"first_shop_days\": 123,\n \"second_shop_days\": 123,\n \"latest_shop_days\": 123,\n \"average_shop_days\": 123,\n \"second_shop_date\": \"2023-11-07T05:31:56Z\",\n \"previous_shop_date\": \"2023-11-07T05:31:56Z\",\n \"at_risk_date\": \"2023-11-07T05:31:56Z\",\n \"latest_shop_spend\": 123,\n \"latest_shop_currency_id\": 123,\n \"latest_transacted_location_id\": 123,\n \"transacted_locations\": [\n \"<string>\"\n ],\n \"likely_country_iso\": \"<string>\",\n \"likely_country_iso_score\": 123,\n \"likely_state_iso\": \"<string>\",\n \"likely_state_iso_score\": 123,\n \"likely_region\": \"<string>\",\n \"likely_region_score\": 123,\n \"most_spend_location_id\": 123,\n \"most_spend_12m_location_id\": 123,\n \"top_historic_status_id\": 123\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>",
"errors": {}
}Profile Aggregation
Batch Profile Aggregations
A POST to the /profile/aggregations/batch.json endpoint allows your application to process profile aggregations in batch.
POST
/
v3
/
profile
/
aggregations
/
batch.json
Batch Profile Aggregations
curl --request POST \
--url https://api.{tenant}.getomneo.com/api/v3/profile/aggregations/batch.json \
--header 'Content-Type: application/json' \
--data '
{
"aggregations": [
{
"profile_id": "<string>",
"shop_days": 123,
"shop_count": 123,
"spend_12m": 123,
"spend_12m_now": 123,
"spend_all": 123,
"spend_atv_12m": 123,
"spend_atv_all": 123,
"spend_first_date": "2023-11-07T05:31:56Z",
"spend_last_date": "2023-11-07T05:31:56Z",
"dimension_frequency": "<string>",
"dimension_recency": "<string>",
"dimension_join": "<string>",
"channel": "<string>",
"likely_country": "<string>",
"likely_country_score": 123,
"purchased_brands": [
"<string>"
],
"discount_avg": 123,
"total_shop_days": 123,
"first_shop_days": 123,
"second_shop_days": 123,
"latest_shop_days": 123,
"average_shop_days": 123,
"second_shop_date": "2023-11-07T05:31:56Z",
"previous_shop_date": "2023-11-07T05:31:56Z",
"at_risk_date": "2023-11-07T05:31:56Z",
"latest_shop_spend": 123,
"latest_shop_currency_id": 123,
"latest_transacted_location_id": 123,
"transacted_locations": [
"<string>"
],
"likely_country_iso": "<string>",
"likely_country_iso_score": 123,
"likely_state_iso": "<string>",
"likely_state_iso_score": 123,
"likely_region": "<string>",
"likely_region_score": 123,
"most_spend_location_id": 123,
"most_spend_12m_location_id": 123,
"top_historic_status_id": 123
}
]
}
'import requests
url = "https://api.{tenant}.getomneo.com/api/v3/profile/aggregations/batch.json"
payload = { "aggregations": [
{
"profile_id": "<string>",
"shop_days": 123,
"shop_count": 123,
"spend_12m": 123,
"spend_12m_now": 123,
"spend_all": 123,
"spend_atv_12m": 123,
"spend_atv_all": 123,
"spend_first_date": "2023-11-07T05:31:56Z",
"spend_last_date": "2023-11-07T05:31:56Z",
"dimension_frequency": "<string>",
"dimension_recency": "<string>",
"dimension_join": "<string>",
"channel": "<string>",
"likely_country": "<string>",
"likely_country_score": 123,
"purchased_brands": ["<string>"],
"discount_avg": 123,
"total_shop_days": 123,
"first_shop_days": 123,
"second_shop_days": 123,
"latest_shop_days": 123,
"average_shop_days": 123,
"second_shop_date": "2023-11-07T05:31:56Z",
"previous_shop_date": "2023-11-07T05:31:56Z",
"at_risk_date": "2023-11-07T05:31:56Z",
"latest_shop_spend": 123,
"latest_shop_currency_id": 123,
"latest_transacted_location_id": 123,
"transacted_locations": ["<string>"],
"likely_country_iso": "<string>",
"likely_country_iso_score": 123,
"likely_state_iso": "<string>",
"likely_state_iso_score": 123,
"likely_region": "<string>",
"likely_region_score": 123,
"most_spend_location_id": 123,
"most_spend_12m_location_id": 123,
"top_historic_status_id": 123
}
] }
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
aggregations: [
{
profile_id: '<string>',
shop_days: 123,
shop_count: 123,
spend_12m: 123,
spend_12m_now: 123,
spend_all: 123,
spend_atv_12m: 123,
spend_atv_all: 123,
spend_first_date: '2023-11-07T05:31:56Z',
spend_last_date: '2023-11-07T05:31:56Z',
dimension_frequency: '<string>',
dimension_recency: '<string>',
dimension_join: '<string>',
channel: '<string>',
likely_country: '<string>',
likely_country_score: 123,
purchased_brands: ['<string>'],
discount_avg: 123,
total_shop_days: 123,
first_shop_days: 123,
second_shop_days: 123,
latest_shop_days: 123,
average_shop_days: 123,
second_shop_date: '2023-11-07T05:31:56Z',
previous_shop_date: '2023-11-07T05:31:56Z',
at_risk_date: '2023-11-07T05:31:56Z',
latest_shop_spend: 123,
latest_shop_currency_id: 123,
latest_transacted_location_id: 123,
transacted_locations: ['<string>'],
likely_country_iso: '<string>',
likely_country_iso_score: 123,
likely_state_iso: '<string>',
likely_state_iso_score: 123,
likely_region: '<string>',
likely_region_score: 123,
most_spend_location_id: 123,
most_spend_12m_location_id: 123,
top_historic_status_id: 123
}
]
})
};
fetch('https://api.{tenant}.getomneo.com/api/v3/profile/aggregations/batch.json', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.{tenant}.getomneo.com/api/v3/profile/aggregations/batch.json",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'aggregations' => [
[
'profile_id' => '<string>',
'shop_days' => 123,
'shop_count' => 123,
'spend_12m' => 123,
'spend_12m_now' => 123,
'spend_all' => 123,
'spend_atv_12m' => 123,
'spend_atv_all' => 123,
'spend_first_date' => '2023-11-07T05:31:56Z',
'spend_last_date' => '2023-11-07T05:31:56Z',
'dimension_frequency' => '<string>',
'dimension_recency' => '<string>',
'dimension_join' => '<string>',
'channel' => '<string>',
'likely_country' => '<string>',
'likely_country_score' => 123,
'purchased_brands' => [
'<string>'
],
'discount_avg' => 123,
'total_shop_days' => 123,
'first_shop_days' => 123,
'second_shop_days' => 123,
'latest_shop_days' => 123,
'average_shop_days' => 123,
'second_shop_date' => '2023-11-07T05:31:56Z',
'previous_shop_date' => '2023-11-07T05:31:56Z',
'at_risk_date' => '2023-11-07T05:31:56Z',
'latest_shop_spend' => 123,
'latest_shop_currency_id' => 123,
'latest_transacted_location_id' => 123,
'transacted_locations' => [
'<string>'
],
'likely_country_iso' => '<string>',
'likely_country_iso_score' => 123,
'likely_state_iso' => '<string>',
'likely_state_iso_score' => 123,
'likely_region' => '<string>',
'likely_region_score' => 123,
'most_spend_location_id' => 123,
'most_spend_12m_location_id' => 123,
'top_historic_status_id' => 123
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.{tenant}.getomneo.com/api/v3/profile/aggregations/batch.json"
payload := strings.NewReader("{\n \"aggregations\": [\n {\n \"profile_id\": \"<string>\",\n \"shop_days\": 123,\n \"shop_count\": 123,\n \"spend_12m\": 123,\n \"spend_12m_now\": 123,\n \"spend_all\": 123,\n \"spend_atv_12m\": 123,\n \"spend_atv_all\": 123,\n \"spend_first_date\": \"2023-11-07T05:31:56Z\",\n \"spend_last_date\": \"2023-11-07T05:31:56Z\",\n \"dimension_frequency\": \"<string>\",\n \"dimension_recency\": \"<string>\",\n \"dimension_join\": \"<string>\",\n \"channel\": \"<string>\",\n \"likely_country\": \"<string>\",\n \"likely_country_score\": 123,\n \"purchased_brands\": [\n \"<string>\"\n ],\n \"discount_avg\": 123,\n \"total_shop_days\": 123,\n \"first_shop_days\": 123,\n \"second_shop_days\": 123,\n \"latest_shop_days\": 123,\n \"average_shop_days\": 123,\n \"second_shop_date\": \"2023-11-07T05:31:56Z\",\n \"previous_shop_date\": \"2023-11-07T05:31:56Z\",\n \"at_risk_date\": \"2023-11-07T05:31:56Z\",\n \"latest_shop_spend\": 123,\n \"latest_shop_currency_id\": 123,\n \"latest_transacted_location_id\": 123,\n \"transacted_locations\": [\n \"<string>\"\n ],\n \"likely_country_iso\": \"<string>\",\n \"likely_country_iso_score\": 123,\n \"likely_state_iso\": \"<string>\",\n \"likely_state_iso_score\": 123,\n \"likely_region\": \"<string>\",\n \"likely_region_score\": 123,\n \"most_spend_location_id\": 123,\n \"most_spend_12m_location_id\": 123,\n \"top_historic_status_id\": 123\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.{tenant}.getomneo.com/api/v3/profile/aggregations/batch.json")
.header("Content-Type", "application/json")
.body("{\n \"aggregations\": [\n {\n \"profile_id\": \"<string>\",\n \"shop_days\": 123,\n \"shop_count\": 123,\n \"spend_12m\": 123,\n \"spend_12m_now\": 123,\n \"spend_all\": 123,\n \"spend_atv_12m\": 123,\n \"spend_atv_all\": 123,\n \"spend_first_date\": \"2023-11-07T05:31:56Z\",\n \"spend_last_date\": \"2023-11-07T05:31:56Z\",\n \"dimension_frequency\": \"<string>\",\n \"dimension_recency\": \"<string>\",\n \"dimension_join\": \"<string>\",\n \"channel\": \"<string>\",\n \"likely_country\": \"<string>\",\n \"likely_country_score\": 123,\n \"purchased_brands\": [\n \"<string>\"\n ],\n \"discount_avg\": 123,\n \"total_shop_days\": 123,\n \"first_shop_days\": 123,\n \"second_shop_days\": 123,\n \"latest_shop_days\": 123,\n \"average_shop_days\": 123,\n \"second_shop_date\": \"2023-11-07T05:31:56Z\",\n \"previous_shop_date\": \"2023-11-07T05:31:56Z\",\n \"at_risk_date\": \"2023-11-07T05:31:56Z\",\n \"latest_shop_spend\": 123,\n \"latest_shop_currency_id\": 123,\n \"latest_transacted_location_id\": 123,\n \"transacted_locations\": [\n \"<string>\"\n ],\n \"likely_country_iso\": \"<string>\",\n \"likely_country_iso_score\": 123,\n \"likely_state_iso\": \"<string>\",\n \"likely_state_iso_score\": 123,\n \"likely_region\": \"<string>\",\n \"likely_region_score\": 123,\n \"most_spend_location_id\": 123,\n \"most_spend_12m_location_id\": 123,\n \"top_historic_status_id\": 123\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.{tenant}.getomneo.com/api/v3/profile/aggregations/batch.json")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"aggregations\": [\n {\n \"profile_id\": \"<string>\",\n \"shop_days\": 123,\n \"shop_count\": 123,\n \"spend_12m\": 123,\n \"spend_12m_now\": 123,\n \"spend_all\": 123,\n \"spend_atv_12m\": 123,\n \"spend_atv_all\": 123,\n \"spend_first_date\": \"2023-11-07T05:31:56Z\",\n \"spend_last_date\": \"2023-11-07T05:31:56Z\",\n \"dimension_frequency\": \"<string>\",\n \"dimension_recency\": \"<string>\",\n \"dimension_join\": \"<string>\",\n \"channel\": \"<string>\",\n \"likely_country\": \"<string>\",\n \"likely_country_score\": 123,\n \"purchased_brands\": [\n \"<string>\"\n ],\n \"discount_avg\": 123,\n \"total_shop_days\": 123,\n \"first_shop_days\": 123,\n \"second_shop_days\": 123,\n \"latest_shop_days\": 123,\n \"average_shop_days\": 123,\n \"second_shop_date\": \"2023-11-07T05:31:56Z\",\n \"previous_shop_date\": \"2023-11-07T05:31:56Z\",\n \"at_risk_date\": \"2023-11-07T05:31:56Z\",\n \"latest_shop_spend\": 123,\n \"latest_shop_currency_id\": 123,\n \"latest_transacted_location_id\": 123,\n \"transacted_locations\": [\n \"<string>\"\n ],\n \"likely_country_iso\": \"<string>\",\n \"likely_country_iso_score\": 123,\n \"likely_state_iso\": \"<string>\",\n \"likely_state_iso_score\": 123,\n \"likely_region\": \"<string>\",\n \"likely_region_score\": 123,\n \"most_spend_location_id\": 123,\n \"most_spend_12m_location_id\": 123,\n \"top_historic_status_id\": 123\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>",
"errors": {}
}⌘I