Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

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

...

Retrieve the query for an audience

Method

GET

Path

/api/v2/audience/query

Parameters

...

NameTypeRequiredDescription
idnumberY 

Example cURL

Code Block
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

Code Block
{
    "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

...

Code Block
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

Code Block
{
    "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
    }
}

...

Code Block
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

Code Block
{
    "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"
        }
    }
}

...

Code Block
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

Code Block
{
    "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"
        }
    }
}

...

Code Block
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

Code Block
{
    "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"
        }
    }
}

...

Code Block
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

Code Block
{
    "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
        }
    }
}

...

Code Block
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

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