Segments - Create *



* This is an advanced endpoint. To use, please make sure your plan has advanced access.

Endpoint

POST /v1.1/segments/create

Description

Create a new segment

Parameters
required *

apiKey *  string Your API access key
brandid *  integer Brand ID to associate with segment
name *  string Name of segment
description  string Description of segment
active  integer Active state of segment (0 or 1)
domain  string Associate a domain with segment
trackoptinonly  boolean only record activity (including logins) for opted in members
simplemetrics  boolean default dashboard insights for conversion metrics to simple view

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

Example Request

curl -X POST "https://api.theappreciationengine.com/v1.1/segments/create?apiKey=0a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p&brandid=1234"
$curl = curl_init();

curl_setopt_array($curl, array( 
	CURLOPT_URL => "https://api.theappreciationengine.com/v1.1/segments/create?apiKey=0a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p&brandid=1234", 
	CURLOPT_RETURNTRANSFER => true, 
	CURLOPT_ENCODING => "", 
	CURLOPT_MAXREDIRS => 10, 
	CURLOPT_TIMEOUT => 0, 
	CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, 
	CURLOPT_CUSTOMREQUEST => "POST", 
));

$response = curl_exec($curl);

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

url = "https://api.theappreciationengine.com/v1.1/segments/create?apiKey=0a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p&brandid=1234"

headers = {}
payload = {}

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

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

Example Response

{
"ID": 1701,
"BrandID": "33333",
"Name": "Launching the new Enterprise",
"Description": "Users who love the new Enterprise",
"Active": "1",
"TrackOptinOnly": 0,
"SimpleMetrics": 0,
"Domain": null,
"Created": "2360-05-06 14:00:00",
"LastEdited": "2360-05-06 14:00:00"
}