Please note: this set of APIs is scheduled for deprecation in 2017. New implementations should start by using the newly released Evaluation API.
An IQL can be evaluated if the following preconditions are met
- The profile on which the IQL is to be evaluated must exist.
IQL evaluation can be done by making a request to url /v1/companies/<companyId>/buckets/<bucketId>/segment-evaluation. The request should be GET and a successful segment evaluation will result in a 200 OK. The segment-evaluation resource must be called with query parameters profile_id and iql.
Request Headers
Header | Required | Acceptable Value(s) | Description |
---|---|---|---|
Accept | Yes | application/json | |
Content-encoding | No | gzip | Caller can send a gzipped request to the API and set the Content-encoding as gzip. |
Accept-encoding | No | gzip | Caller can request a gzipped response from the API and set the Accept-encoding as gzip. |
Query parameter | Required | Description |
---|---|---|
app_key | No | An app key refers to a collectApp. If an app key is specified, the profile data is added as the collectApp corresponding to that app key. If no app key is specified then profile data is added using the default collectApp "web". Similarly, the response will return the collectApp data corresponding to the app key. The returned data will additionally be filtered though any whitelists and/or blacklists configured for this collect app. If no collect app is specified, data and; blacklist and whitelist configurations of collectApp "web" will be used. |
profile_id | Yes | References an existing profile. |
iql | Yes | Refers to an IQL expression. |
filteredProfile | No | filteredProfile can have a value of "true" or "false". If filteredProfile is set to true and the result of the iql evaluation is true, then the response json will contain an additional field called filteredProfile. The filtered profile contains the parts of the profile which matched the iql evaluation. |
Example: Response of a requested a IQL Evaluation
{ "segment-evaluation":{ "result":<true|false> }, "links":{ "self":"http://<hostname>/v1/companies/<companyId>/buckets/<bucketId>/segment-evaluation" } } |
Example: Response of requesting an IQL Evaluation with filteredProfile set to true and a successful evaluation
{ "segment-evaluation":{ "result":true, "filteredProfile":{ "id":"<profileId>", "sessions":[ ... ], "attributes":[ ... ] } }, "links":{ "self":"https://<hostname>/v1/companies/<companyId>/buckets/<bucketId>/segment-evaluation" } } |