Audience

Retrieve the settings for one or more audiences

Method

GET

Path

/api/v2/audience

Parameters

NameTypeRequiredDescription
enabledbooleanN 
idnumberNUse to retrieve a specific audience by its ID
namestringN 
realtimebooleanN 

Example cURL

curl -X GET \
'https://platform.flxone.com/api/v2/audience?id=3423' \
-H 'Cache-Control: no-cache' \
-H 'X-Auth: es5a88dmlpktb5t6k9eifm6Pqjd0l70otkm1p2dv6g13h3h2thkptomb3k8dqe3ms3Xvorgr72h99uec0n92mf9hki9d23aprtsmds3' \
-H 'X-CSRF: 14f61670139eb434adf7f148bbea1a30'

Output

{
    "response": {
        "status": "OK",
        "audience": {
            "id": "3423",
            "type": "lookalike",
            "environment": null,
            "realtime": false,
            "customerId": "11",
            "categoryId": "0",
            "userId": "29",
            "scheduleId": null,
            "name": "Black Friday - TV Sales",
            "configuration": null,
            "cost_per_thousand": null,
            "size": null,
            "size_previous": "0",
            "status": "N/A",
            "error": null,
            "enabled": true,
            "deleted": "0",
            "created": "2015-01-12 14:16:54",
            "modified": "2018-02-15 23:00:49",
            "last_run": null,
            "last_bloomfilter_update": "2018-02-15 23:00:49"
        }
    }
}

Check if an audience might be eligible for realtime processing before creating it

Method

GET

Path

/api/v2/pre-realtime-eligible

Parameters

NameTypeRequiredDescription
platform_integration_idnumberY 
rulesstring (JSON)Y 

Example cURL

 curl -X GET \
'https://platform.flxone.com/api/v2/audience/pre-realtime-eligible?platform_integration_id=123&rules=[{%22id%22:%22flx_pixel_id%22,%22comparator%22:%22%3E%22,%22value%22:%220%22}]' \
-H 'Cache-Control: no-cache' \
-H 'X-Auth: es5a88dmlpktb5t6k9eifm6Pqjd0l70otkm1p2dv6g13h3h2thkptomb3k8dqe3ms3Xvorgr72h99uec0n92mf9hki9d23aprtsmds3' \
-H 'X-CSRF: 14f61670139eb434adf7f148bbea1a30'

 

Output

{
    "response": {
        "status": "OK",
        "realtime_eligible_errors": []
    }
} 

Retrieve the query for an audience

Method

GET

Path

/api/v2/audience/query

Parameters

NameTypeRequiredDescription
idnumberY 

Example cURL

curl -X GET \
https://platform.flxone.com/api/v2/audience/query?id=2157 \
-H 'Cache-Control: no-cache' \
-H 'X-Auth: es5a88dmlpktb5t6k9eifm6Pqjd0l70otkm1p2dv6g13h3h2thkptomb3k8dqe3ms3Xvorgr72h99uec0n92mf9hki9d23aprtsmds3' \
-H 'X-CSRF: 14f61670139eb434adf7f148bbea1a30'

Example Output

{
    "response": {
        "status": "OK",
        "query": "SELECT /* audience_id=2157 */ DISTINCT goc.uuid FROM flxone_internal.go_customer_orc goc  WHERE  (bdate >= '{$date-7}' AND bdate <= '{$date}') AND goc.uuid NOT IN ('0','1','2','3','4','5')  GROUP BY 1 HAVING ((count_if(\"interaction_type\" = 4 and \"interaction_value\" >= 5) > 0)) LIMIT 5000000"
    }
}

 

Check if an audience is eligible for realtime processing

Method

GET

Path

/api/v2/audience/realtime-eligible

Parameters

none

Example cURL

curl -X GET \
https://platform.flxone.com/api/v2/audience/realtime-eligible \
-H 'Cache-Control: no-cache' \
-H 'X-Auth: es5a88dmlpktb5t6k9eifm6Pqjd0l70otkm1p2dv6g13h3h2thkptomb3k8dqe3ms3Xvorgr72h99uec0n92mf9hki9d23aprtsmds3' \
-H 'X-CSRF: 14f61670139eb434adf7f148bbea1a30'

Output

{
    "response": {
        "status": "OK",
        "audiences": [
            {
                "id": "1132",
                "type": "custom",
                "environment": "staging",
                "realtime": true,
                "customerId": "11",
                "categoryId": "0",
                "userId": "156",
                "scheduleId": "5926",
                "name": "Black Friday - TV Sales",
                "configuration": {
                    "rules": [
                        {
                            "name": "Country",
                            "id": "flx_geo_country",
                            "type": "dimension",
                            "value": "NLD",
                            "comparator": "=",
                            "orRule": []
                        }
                    ],
                    "filters": [
                        {
                            "name": "Country",
                            "dimension": "flx_geo_country",
                            "include": "NLD",
                            "orFilters": []
                        }
                    ],
                    "dimensions": null,
                    "platform": "flxone",
                    "userPlatform": "appnexus",
                    "googleAdvertiser": "",
                    "googleRefreshToken": "",
                    "createGoogleAudience": false,
                    "audienceListId": "",
                    "mailchimpLists": "",
                    "marketoList": "",
                    "integration_id": 12,
                    "outputs": [
                        {
                            "platform": "appnexus",
                            "segments": [
                                "3113277"
                            ]
                        }
                    ],
                    "map_uids": "appnexus",
                    "query": "SELECT DISTINCT goc.uuid FROM flxone_internal.go_customer_orc goc  WHERE  (bdate >= '{$date-7}' AND bdate < '{$date}') AND goc.uuid NOT IN ('0','1','2','3','4','5') AND (( ((\"geo_country\" IN ('NLD'))) )) "
                },
                "cost_per_thousand": null,
                "size": "1423220",
                "size_previous": "527069",
                "status": "N/A",
                "error": null,
                "enabled": true,
                "deleted": "0",
                "created": "2015-07-14 09:30:13",
                "modified": "2018-02-15 23:01:03",
                "last_run": "2015-12-17 04:01:02",
                "last_bloomfilter_update": "2018-02-15 23:01:03"
            },
            {
                "id": "1514",
                "type": "custom",
                "environment": "production",
                "realtime": true,
                "customerId": "11",
                "categoryId": "0",
                "userId": "966",
                "scheduleId": "6346",
                "name": "Black Friday - Console Sales",
                "configuration": {
                    "rules": [
                        {
                            "name": "Recency",
                            "id": "recency",
                            "type": "dimension",
                            "value": "30",
                            "comparator": ">=",
                            "orRule": []
                        },
                        {
                            "name": "Segment",
                            "id": "flx_interaction_segment",
                            "type": "dimension",
                            "value": "855",
                            "comparator": "=",
                            "orRule": []
                        },
                        {
                            "name": "Pixel Loads",
                            "id": "flx_pixel_loads_dmp",
                            "type": "measure",
                            "value": "3",
                            "min": "3",
                            "comparator": ">=",
                            "orRule": []
                        }
                    ],
                    "filters": [
                        {
                            "name": "Recency",
                            "dimension": "date",
                            "date_start": "date-30",
                            "date_end": "date-1",
                            "orFilters": []
                        },
                        {
                            "name": "Segment",
                            "dimension": "flx_interaction_segment",
                            "include": "855",
                            "orFilters": []
                        },
                        {
                            "name": "Pixel Loads",
                            "measure": "flx_pixel_loads_dmp",
                            "min": "3",
                            "orFilters": []
                        }
                    ],
                    "dimensions": null,
                    "platform": "flxone",
                    "userPlatform": "appnexus",
                    "googleAdvertiser": "",
                    "googleRefreshToken": "",
                    "createGoogleAudience": false,
                    "audienceListId": "",
                    "mailchimpLists": "",
                    "optimizelyProjects": "",
                    "marketoList": "",
                    "integration_id": "23",
                    "outputs": [
                        {
                            "platform": "appnexus",
                            "segments": [
                                "3730281"
                            ]
                        }
                    ],
                    "map_uids": "appnexus",
                    "query": "SELECT DISTINCT goc.uuid FROM flxone_internal.go_customer_orc goc  WHERE  (bdate >= '{$date-30}' AND bdate <= '{$date-1}') AND goc.uuid NOT IN ('0','1','2','3','4','5') AND (( (((case when \"interaction_type\" = 15 and \"interaction_user_defined_subtype\" != 0 then (( cast(\"interaction_user_defined_subtype\" AS varchar))) else null end) IN ('855'))) ))  GROUP BY 1 HAVING (((ROUND(SUM(case when ((\"event_type\")) = 2 OR ((\"interaction_type\")) = 10 OR ((\"interaction_type\")) = 15 then 1 end), 6)) >= 3))"
                },
                "cost_per_thousand": null,
                "size": "1",
                "size_previous": "2",
                "status": "N/A",
                "error": null,
                "enabled": true,
                "deleted": "0",
                "created": "2015-10-30 11:59:35",
                "modified": "2018-02-15 23:01:16",
                "last_run": "2017-03-07 11:42:25",
                "last_bloomfilter_update": "2018-02-15 23:01:16"
            }
		]
	}
}

Optimize an audience's rules

(info) This is only available for custom audiences. The endpoint will attempt to analyze the filters, rules, and query to reduce unnecessary calculations and mappings. It will NOT save changes by default (see the Parameters below).

Method

PUT

Path

/audience/optimize

Parameters

NameTypeRequiredDescription
idnumberY 
commitnumberNset this parameter to 1 to have the optimizations saved

Example cURL

curl -X PUT \
https://platform.flxone.com/api/v2/audience/optimize?id=1792 \
-H 'Cache-Control: no-cache' \
-H 'X-Auth: es5a88dmlpktb5t6k9eifm6Pqjd0l70otkm1p2dv6g13h3h2thkptomb3k8dqe3ms3Xvorgr72h99uec0n92mf9hki9d23aprtsmds3' \
-H 'X-CSRF: 14f61670139eb434adf7f148bbea1a30'


Example Output

{
    "response": {
        "status": "OK",
        "changes": [],
        "rules_before": [
            {
                "name": "Country",
                "id": "flx_geo_country",
                "type": "dimension",
                "value": "NLD",
                "comparator": "=",
                "orRule": []
            }
        ],
        "rules_after": [
            {
                "name": "Country",
                "id": "flx_geo_country",
                "type": "dimension",
                "value": "NLD",
                "comparator": "=",
                "orRule": []
            }
        ],
        "filters_before": [
            {
                "name": "Country",
                "dimension": "flx_geo_country",
                "include": "NLD",
                "orFilters": []
            }
        ],
        "filters_after": [
            {
                "name": "Country",
                "dimension": "flx_geo_country",
                "include": "NLD",
                "orFilters": []
            }
        ],
        "query_before": "SELECT /* audience_id=1172 */ DISTINCT goc.uuid FROM flxone_internal.go_customer_orc goc  WHERE  (bdate >= '{$date-7}' AND bdate <= '{$date}') AND goc.uuid NOT IN ('0','1','2','3','4','5') AND (( ((\"geo_country\" IN ('NLD'))) ))  LIMIT 5000000",
        "query_after": "SELECT /* audience_id=1172 */ DISTINCT goc.uuid FROM flxone_internal.go_customer_orc goc  WHERE  (bdate >= '{$date-7}' AND bdate <= '{$date}') AND goc.uuid NOT IN ('0','1','2','3','4','5') AND (( ((\"geo_country\" IN ('NLD'))) ))  LIMIT 5000000",
        "committed": false
    }
}

Enable or disable cross-device matching for an audience

Method

PUT

Path

/audience/xdev

Parameters

NameTypeRequiredDescription
idnumberY 
xdevnumberNset to 1 to enable cross-device matching; set to 0 to disable
xdev_probnumberNset to 1 to enable probablistic cross-device matching; set to 0 to disable

Example cURL

curl -X PUT \
'https://platform.flxone.com/api/v2/audience/xdev?id=2157&xdev=1&xdev_prob=1' \
-H 'Cache-Control: no-cache' \
-H 'X-Auth: es5a88dmlpktb5t6k9eifm6Pqjd0l70otkm1p2dv6g13h3h2thkptomb3k8dqe3ms3Xvorgr72h99uec0n92mf9hki9d23aprtsmds3' \
-H 'X-CSRF: 14f61670139eb434adf7f148bbea1a30'

Example Output

{
    "response": {
        "status": "OK",
        "audience": {
            "id": "2157",
            "type": "custom",
            "environment": "staging",
            "realtime": true,
            "customerId": "121",
            "categoryId": "0",
            "userId": "97",
            "scheduleId": "7194",
            "name": "Test 2",
            "configuration": {
                "rules": [
                    {
                        "name": "Time on Page",
                        "id": "time_on_page",
                        "type": "dimension",
                        "value": "5",
                        "min": "5",
                        "comparator": ">=",
                        "orRule": []
                    }
                ],
                "filters": [
                    {
                        "name": "Time on Page",
                        "measure": "flx_time_on_site_avg",
                        "method": "count_if",
                        "min": "5",
                        "orFilters": []
                    }
                ],
                "dimensions": null,
                "platform": "flxone",
                "userPlatform": "appnexus",
                "googleAdvertiser": "",
                "googleRefreshToken": "",
                "createGoogleAudience": false,
                "audienceListId": "",
                "mailchimpLists": "",
                "optimizelyProjects": "",
                "marketoList": "",
                "integration_id": "32",
                "xdev": true,
                "outputs": [
                    {
                        "platform_integration_id": 32,
                        "platform": "appnexus",
                        "segments": [
                            "75126362"
                        ]
                    }
                ],
                "map_uids": "appnexus",
                "query": "SELECT DISTINCT goc.uuid FROM flxone_internal.go_customer_orc goc  WHERE  (bdate >= '{$date-7}' AND bdate <= '{$date}') AND goc.uuid NOT IN ('0','1','2','3','4','5')  GROUP BY 1 HAVING ((count_if(\"interaction_type\" = 4 and \"interaction_value\" >= 5) > 0)) LIMIT 5000000",
                "xdev_prob": true
            },
            "cost_per_thousand": null,
            "size": "108",
            "size_previous": null,
            "status": "N/A",
            "error": null,
            "enabled": true,
            "deleted": "0",
            "created": "2017-01-06 13:55:54",
            "modified": "2018-04-20 18:56:45",
            "last_run": "2017-01-06 14:26:00",
            "last_bloomfilter_update": "2018-04-19 23:06:10"
        }
    }
}

Enable or disable realtime processing for an audience

Method

PUT

Path

/audience/realtime

Parameters

NameTypeRequiredDescription
idnumberY 
realtimenumberNset to 1 to enable realtime processing; set to 0 to disable

Example cURL

curl -X PUT \
'https://platform.flxone.com/api/v2/audience/xdev?id=2157&realtime=1' \
-H 'Cache-Control: no-cache' \
-H 'X-Auth: es5a88dmlpktb5t6k9eifm6Pqjd0l70otkm1p2dv6g13h3h2thkptomb3k8dqe3ms3Xvorgr72h99uec0n92mf9hki9d23aprtsmds3' \
-H 'X-CSRF: 14f61670139eb434adf7f148bbea1a30'

Example Output

{
    "response": {
        "status": "OK",
        "audience": {
            "id": "2157",
            "type": "custom",
            "environment": "staging",
            "realtime": true,
            "customerId": "121",
            "categoryId": "0",
            "userId": "97",
            "scheduleId": "7194",
            "name": "Test 2",
            "configuration": {
                "rules": [
                    {
                        "name": "Time on Page",
                        "id": "time_on_page",
                        "type": "dimension",
                        "value": "5",
                        "min": "5",
                        "comparator": ">=",
                        "orRule": []
                    }
                ],
                "filters": [
                    {
                        "name": "Time on Page",
                        "measure": "flx_time_on_site_avg",
                        "method": "count_if",
                        "min": "5",
                        "orFilters": []
                    }
                ],
                "dimensions": null,
                "platform": "flxone",
                "userPlatform": "appnexus",
                "googleAdvertiser": "",
                "googleRefreshToken": "",
                "createGoogleAudience": false,
                "audienceListId": "",
                "mailchimpLists": "",
                "optimizelyProjects": "",
                "marketoList": "",
                "integration_id": "32",
                "xdev": true,
                "outputs": [
                    {
                        "platform_integration_id": 32,
                        "platform": "appnexus",
                        "segments": [
                            "75126362"
                        ]
                    }
                ],
                "map_uids": "appnexus",
                "query": "SELECT DISTINCT goc.uuid FROM flxone_internal.go_customer_orc goc  WHERE  (bdate >= '{$date-7}' AND bdate <= '{$date}') AND goc.uuid NOT IN ('0','1','2','3','4','5')  GROUP BY 1 HAVING ((count_if(\"interaction_type\" = 4 and \"interaction_value\" >= 5) > 0)) LIMIT 5000000",
                "xdev_prob": true
            },
            "cost_per_thousand": null,
            "size": "108",
            "size_previous": null,
            "status": "N/A",
            "error": null,
            "enabled": true,
            "deleted": "0",
            "created": "2017-01-06 13:55:54",
            "modified": "2018-04-20 18:56:45",
            "last_run": "2017-01-06 14:26:00",
            "last_bloomfilter_update": "2018-04-19 23:06:10"
        }
    }
}

Rename an audience

Method

PUT

Path

/audience/name

Parameters

NameTypeRequiredDescription
idnumberY 
namestringY 

Example cURL

curl -X PUT \
'https://platform.flxone.com/api/v2/audience/name?id=2157&name=Black%20Friday%20Sales' \
-H 'Cache-Control: no-cache' \
-H 'X-Auth: es5a88dmlpktb5t6k9eifm6Pqjd0l70otkm1p2dv6g13h3h2thkptomb3k8dqe3ms3Xvorgr72h99uec0n92mf9hki9d23aprtsmds3' \
-H 'X-CSRF: 14f61670139eb434adf7f148bbea1a30'

 

Example Output

{
    "response": {
        "status": "OK",
        "audience": {
            "id": "2157",
            "type": "custom",
            "environment": "staging",
            "realtime": "1",
            "customerId": "11",
            "categoryId": "0",
            "userId": "77",
            "scheduleId": "7794",
            "name": "Black Friday Sales",
            "configuration": "{\"rules\":\"[{\"name\":\"Time on Page\",\"id\":\"time_on_page\",\"type\":\"dimension\",\"value\":\"5\",\"min\":\"5\",\"comparator\":\">=\",\"orRule\":[]}]\",\"filters\":\"[{\"name\":\"Time on Page\",\"measure\":\"flx_time_on_site_avg\",\"method\":\"count_if\",\"min\":\"5\",\"orFilters\":[]}]\",\"dimensions\":null,\"platform\":\"flxone\",\"userPlatform\":\"appnexus\",\"googleAdvertiser\":\"\",\"googleRefreshToken\":\"\",\"createGoogleAudience\":false,\"audienceListId\":\"\",\"mailchimpLists\":\"\",\"optimizelyProjects\":\"\",\"marketoList\":\"\",\"integration_id\":\"32\",\"xdev\":true,\"outputs\":[{\"platform_integration_id\":32,\"platform\":\"appnexus\",\"segments\":[\"7512662\"]}],\"map_uids\":\"appnexus\",\"query\":\"SELECT DISTINCT goc.uuid FROM flxone_internal.go_customer_orc goc  WHERE  (bdate >= '{$date-7}' AND bdate <= '{$date}') AND goc.uuid NOT IN ('0','1','2','3','4','5')  GROUP BY 1 HAVING ((count_if(\"interaction_type\" = 4 and \"interaction_value\" >= 5) > 0)) LIMIT 5000000\",\"xdev_prob\":true}",
            "cost_per_thousand": null,
            "size": "108",
            "size_previous": null,
            "status": "N/A",
            "error": null,
            "enabled": "1",
            "deleted": "0",
            "created": "2017-01-06 13:55:54",
            "modified": "2018-04-20 19:06:34",
            "last_run": "2017-01-06 14:26:00",
            "last_bloomfilter_update": "2018-04-19 23:06:10"
        }
    }
}

See the daily upload and match counts for an audience

Method

GET

Path

/audience/uploads-and-matches

Parameters

NameTypeRequiredDescription
idnumberY 

Example cURL

curl -X GET \
'https://platform.flxone.com/api/v2/audience/uploads-and-matches?id=2157' \
-H 'Cache-Control: no-cache' \
-H 'X-Auth: es5a88dmlpktb5t6k9eifm6Pqjd0l70otkm1p2dv6g13h3h2thkptomb3k8dqe3ms3Xvorgr72h99uec0n92mf9hki9d23aprtsmds3' \
-H 'X-CSRF: 14f61670139eb434adf7f148bbea1a30'

Example Output

{
    "response": {
        "status": "OK",
        "dailyUploadsAndMatches": [
            {
                "date": "2018-04-13",
                "matches": 0,
                "uploads": 0
            },
            {
                "date": "2018-04-14",
                "matches": 0,
                "uploads": 0
            },
            {
                "date": "2018-04-15",
                "matches": 0,
                "uploads": 0
            },
            {
                "date": "2018-04-16",
                "matches": 0,
                "uploads": 0
            },
            {
                "date": "2018-04-17",
                "matches": 0,
                "uploads": 0
            },
            {
                "date": "2018-04-18",
                "matches": 0,
                "uploads": 0
            },
            {
                "date": "2018-04-19",
                "matches": 0,
                "uploads": 0
            }
        ],
        "weeklyUploadsAndMatches": {
            "matches": 0,
            "uploads": 0
        }
    }
}

See the sizes of each audience

Method

GET

Path

/audience/sizes

Parameters

none

Example cURL

curl -X GET \
'https://platform.flxone.com/api/v2/audience/sizes' \
-H 'Cache-Control: no-cache' \
-H 'X-Auth: es5a88dmlpktb5t6k9eifm6Pqjd0l70otkm1p2dv6g13h3h2thkptomb3k8dqe3ms3Xvorgr72h99uec0n92mf9hki9d23aprtsmds3' \
-H 'X-CSRF: 14f61670139eb434adf7f148bbea1a30'

 

Example cURL

Example Output

{
    "response": {
        "status": "OK",
        "sizes": {
            "11765": 4237,
            "13966": 12033,
            "19367": 26,
            "29208": 1023,
            "29935": 317,
            "31183": 12931,
            "39324": 9123
        }
    }
}