How Can I Make a Long and Detailed Query?

Context: You want to use the API to make a long query that uses many text characters.

How To in v3 Analytics

For queries with query parameters that would exceed the HTTP GET specification limit of 230 characters, use a POST request and pass a JSON object in the request body.
[POST] /v3/analytics/reports
{
    "report_type":"performance",
    "start_date":"2014-11-26",
    "end_date":"2014-12-04",
    "filters": "((device_type==\"desktop\")) AND ((country==\"us\"))",
    "metrics": "plays_requested,displays,video_starts",
    "sort":"plays_requested",
    "dimensions":"device_type",
    "limit": 12,
    "api_key":"(yourApiKey)"
}               
~$: curl -H "Content-Type: application/json" -d '{"report_type":"performance", "start_date":"2014-11-26", "end_date":"2014-12-04", "filters": "((device_type==\"desktop\")) AND ((country==\"us\"))", "metrics": "plays_requested,displays,video_starts", "sort":"plays_requested", "dimensions":"device_type", "limit": 12, "api_key":"(YOUR API KEY HERE)"}' http://api.ooyala.com/v3/analytics/reports

Response:

                     
{  
   "status":"OK",
   "results":[  
      {  
         "data":[  
            {  
               "metrics":{  
                  "displays":11,
                  "plays_requested":7,
                  "video_starts":7
               },
               "group":{  
                  "device_type":"desktop"
               }
            }
         ],
         "start_date":"2014-11-26T00:00Z",
         "end_date":"2014-12-4T00:00Z"
      }
   ],
   
   "status_code":"200",
   "total_count":"1",
   "result_count":"1"
}

해당 내용이 도움 되었습니까?