Example Queries with SAPI Query Objects

Examples of SAPI queries using SAPI query objects include opening a stream, filtering a stream, changing the stream type, and monitoring campaign performance.

Example: Opening a stream

{
    “access_token” : “your_token”, 
    “command” : “stream”, 
    “stream_type” : “return_all”, 
    “query” : “select *”, 
    “api_version” : “2.0”,
    “schema_version” : “2.0”
}

Example: Filtering a stream

{
    “command” : “filter”, 
    “query”: “select cs-host”, 
    “api_version” :  “2.0”,
    “schema_version” : “2.0”
}

Example: Changing the stream type

{
    “command” : “stream”, 
    “stream_type” : “traffic_source”, 
    “query” : “select wt.vt_f_s”, 
    “api_version” : “2.0”,
    “schema_version” : “2.0”
}