Brands - Activity Breakdown Totals



Endpoint

GET /v1.1/brand/[BrandID]/stats/activity

Description

Obtain a tally of the top activities in your network. Can be grouped by "activity" (default) or "type" (eg. Social, Listened, Watched)

Parameters
required *

apiKey *  string Your API access key
[brandID]  integer Filter to user actions and score for a specific brand
segment  integer Filter activity to those defined in specified segment (ID)
members_from_segment  integer Filter activity to members from specified segment (ID)
activityID  integer ID of activity to filter by – determines scores & position. Accepts either a number (e.g. 123) or a comma-separated list (e.g. 123,678)
period  string In format of '[Amount] [Unit]' - eg 2 Month, 1 Day, 3 Week (default: 1 Week)
period_end  string In format of '[Amount] [Unit]' - eg 2 Month, 1 Day, 3 Week (default: 1 Week)
start_date  string In format of 'YYYY-MM-DD HH:MM:SS' – start of date range for results
end_date  string In format of 'YYYY-MM-DD HH:MM:SS' – end of date range for results
limit  string Limit the amount of results from which to make the totals
group_by  string What to group the totals by: activities (default) or type (eg. Social, Listened, Watched)
services  string Calculate your totals only from specific services. Comma separated list – eg. twitter, facebook, lastfm, rdio, youtube, custom, etc
members  string Only include these members, comma separated list of member IDs – eg. 811566,803186
exclude_members  string Ignore these members, comma separated list of member IDs – eg. 811566,803186
id  integer limit results to specific AE member ID
optedin  boolean Value of 1 will only show members who have been opted into this campaign (via optin endpoint call)
paid_only  boolean Filter to users who have a paid service attached eg. Spotify Premium

Sign in with your developer account to use the console, or sign up here

Example Request

curl -v -X GET "https://api.theappreciationengine.com/v1.1/brand/1234/stats/activity?apiKey=0a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p"
$curl = curl_init();

curl_setopt_array($curl, array( 
	CURLOPT_URL => "https://api.theappreciationengine.com/v1.1/brand/1234/stats/activity?apiKey=0a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p", 
	CURLOPT_RETURNTRANSFER => true, 
	CURLOPT_ENCODING => "", 
	CURLOPT_MAXREDIRS => 10, 
	CURLOPT_TIMEOUT => 0, 
	CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, 
	CURLOPT_CUSTOMREQUEST => "GET", 
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
import requests

url = "https://api.theappreciationengine.com/v1.1/brand/1234/stats/activity?apiKey=0a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p"

headers = {}
payload = {}

response = requests.request("GET", url, headers=headers, data=payload)

print(response.text.encode('utf8'))
var request = require('request');
var options = {
	'method': 'GET',
	'url': 'https://api.theappreciationengine.com/v1.1/brand/1234/stats/activity?apiKey=0a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p',
	'headers': {}
};
request(options, function (error, response) {
	if (error) throw new Error(error);
	console.log(response.body);
});

Example Response

[{
"totalSize": 2, "items": [ {
"ActivityID": "1234",
"BrandID": "333333",
"SegmentName": "Basic Social Listening",
"Activity": "Heavy Rotation of a track by Starfleet on Spotify",
"ServiceType": "spotify",
"Count": "250",
"DistinctMembers": "150"
},
{
"ActivityID": "5678",
"BrandID": "333333",
"SegmentName": "Basic Social Listening",
"Activity": "Added a track by Starfleet to library on Spotify",
"ServiceType": "spotify",
"Count": "21",
"DistinctMembers": "8"
} ], "TotalCount": 271, "TotalMembers": 158
}]