Get aggregate count of participants of a participant type.
1 min
code examples curl request get \\ \ url 'https //{domain}/app/api/v2/teams/filter?aggregatequery=\[{%22name%22%3a%22state count%22%2c%22field%22%3a%22state keyword%22%2c%22aggregation%22%3a%22terms%22}]\&query=object' \\ \ header 'accept application/json' \\ \ header 'x coreos tid os1devs' \\ \ header 'x coreos access string'var myheaders = new headers(); myheaders append("accept", "application/json"); myheaders append("content type", "application/json"); myheaders append("x coreos tid", "os1devs"); myheaders append("x coreos access", "string"); var requestoptions = { method 'get', headers myheaders, redirect 'follow' }; fetch("https //{domain}/app/api/v2/teams/filter?aggregatequery=\[{\\"name\\" \\"state count\\",\\"field\\" \\"state keyword\\",\\"aggregation\\" \\"terms\\"}]\&query=object", requestoptions) then(response => response text()) then(result => console log(result)) catch(error => console log('error', error));require "uri" require "json" require "net/http" url = uri("https //{domain}/app/api/v2/teams/filter?aggregatequery=\[{\\"name\\" \\"state count\\",\\"field\\" \\"state keyword\\",\\"aggregation\\" \\"terms\\"}]\&query=object") https = net http new(url host, url port) https use ssl = true request = net http get new(url) request\["accept"] = "application/json" request\["content type"] = "application/json" request\["x coreos tid"] = "os1devs" request\["x coreos access"] = "string" response = https request(request) puts response read body import requests import json url = "https //{domain}/app/api/v2/teams/filter?aggregatequery=\[{\\"name\\" \\"state count\\",\\"field\\" \\"state keyword\\",\\"aggregation\\" \\"terms\\"}]\&query=object" payload = {} headers = { 'accept' 'application/json', 'content type' 'application/json', 'x coreos tid' 'os1devs', 'x coreos access' 'string' } response = requests request("get", url, headers=headers, data=payload) print(response text) responses // bad request { "data" { "data" { "aggregateresult" {} } } }// default error response { "error" { "code" "", "description" "", "additionalinfo" {} }, "request" { "uri" "", "requestid" "", "querystring" "", "body" {}, "method" "" } }