Aggregate Records
curl --request POST \
--url https://{tenant_id}.api.useago.com/api/v1/crm/objects/{type_key}/records/aggregate \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"metric": "count",
"attribute": "<string>",
"group_by": "<string>",
"period": "<string>",
"filter": {}
}
'import requests
url = "https://{tenant_id}.api.useago.com/api/v1/crm/objects/{type_key}/records/aggregate"
payload = {
"metric": "count",
"attribute": "<string>",
"group_by": "<string>",
"period": "<string>",
"filter": {}
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
metric: 'count',
attribute: '<string>',
group_by: '<string>',
period: '<string>',
filter: {}
})
};
fetch('https://{tenant_id}.api.useago.com/api/v1/crm/objects/{type_key}/records/aggregate', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));CRM objects
Aggregate Records
Count records, or sum, average, minimum or maximum a number attribute, over the records matching a filter, optionally grouped by an attribute (dates by day, week or month).
POST
/
api
/
v1
/
crm
/
objects
/
{type_key}
/
records
/
aggregate
Aggregate Records
curl --request POST \
--url https://{tenant_id}.api.useago.com/api/v1/crm/objects/{type_key}/records/aggregate \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"metric": "count",
"attribute": "<string>",
"group_by": "<string>",
"period": "<string>",
"filter": {}
}
'import requests
url = "https://{tenant_id}.api.useago.com/api/v1/crm/objects/{type_key}/records/aggregate"
payload = {
"metric": "count",
"attribute": "<string>",
"group_by": "<string>",
"period": "<string>",
"filter": {}
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
metric: 'count',
attribute: '<string>',
group_by: '<string>',
period: '<string>',
filter: {}
})
};
fetch('https://{tenant_id}.api.useago.com/api/v1/crm/objects/{type_key}/records/aggregate', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));Body
application/json
Response
200
OK
