Getting a List of Possible Property Values

This request is used in order to get a list of possible values for the selected property. This data is then used to build filters or segments as required.

Request/Response Parameters Summary

POST /meta/propertyValues

The request and response are both JSON objects. The following is a summary of the properties inside the request and response objects.

Request Properties

Property

Description

Request JSON Object

user (string)—The username of your Usage Intelligence user account. Required only for non-cookie authentication.
sessionId (string)—The sessionId obtained via POST /auth/login. Required only for non-cookie authentication.
productId (integer)—The product ID on which this request is being done.
property (string)—The name of the property to retrieve listing for
filter (object)—An optional value used to filter very long meta lists. This feature is not available if the property is geography. Details about filtering can be found in the Filtering Long Lists section.
granularity (string)—Required only when property is os, geography, or gpu. The values can be as follows:

If geography: 

continent
country
usState

If os: 

platform
version
edition

If gpu: 

vendor
model
startAfter (string)—Optional value. To be used for paging on long lists. When paging, this should contain the value of lastValue from the previous response.
getFullList (boolean)—Optional value. Can be used when property is os, osLanguage, or geography. Instructs the server to return a list of all known values by the system instead of showing only the ones that were collected in this particular product. Default is false.

Request Headers

Content-Type—Can be set to application/json or text/javascript 
Accept—Should be set to text/javascript 

Response Headers

Content-Type—Will contain text/javascript 

Status Codes

200 OK—OK (no error)
400 Bad Request—Malformed request
403 Forbidden—Wrong username, sessionId, session expired, or not authorized

Response JSON Object

status (string)—Contains OK if successful or SYNTAX ERROR or AUTH ERROR.
reason (string)—Present only if status is not OK. Contains error message (reason).
results (array)—Present only if status is OK. Contains the list of property values. Each item is presented in a JSON object as follows:
value (string)—Present in all responses. This contains the value that is to be used for filtering and segmentation.
shortName (string)—Present if property is os. Contains an abbreviated OS name that can fit better in some user interfaces.
fullName (string)—Present if property is geography or osLanguage. Contains the full continent, country, US state, or language name while the value property contains an abbreviated code.
truncated (boolean)—Present only if the list is too long. Use filtering in order to retrieve shorter lists or use paging by using the startAfter parameter. See Filtering Long Lists.
lastValue (boolean)—Contains the last value of the list. To be used for paging. This value is to be sent as the startAfter parameter in the next request.

Example Request

POST /meta/propertyValues  HTTP/1.1

Host: api.revulytics.com

Content-Type: application/json

Accept: application/json

 

{

    "user": "testuser@test.com",

    "sessionId": "VSB8E2BzSC2eZSJm4QmTpA",

    "productId": 12345678901,

    "property": "os",

    "granularity": "version"

}

Example Response

HTTP/1.1 200 OK

Content-Type: application/json

 

{

     "status": "OK",

     "results": [

                     {

                         "value": "Microsoft Windows XP",

                         "shortName": "MS Win XP"

                     },

                     {

                         "value": "Microsoft Windows Server 2003",

                         "shortName": "MS Win Srv 2003"

                     },

                     {

                         "value": "Microsoft Windows Vista",

                         "shortName": "MS Win Vista"

                     },

                     {

                         "value": "Microsoft Windows Server 2008",

                         "shortName": "MS Win Srv 2008"

                     },

                     {

                         "value": "Microsoft Windows 7",

                         "shortName": "MS Win 7"

                     }

                ]

}

Filtering Long Lists

When the list of property values is too long, the list will get truncated. This is especially common on requests related with custom properties. The filter property is a JSON object which should contain the following values:

type (string)—Can be either regex or string. Normally, regex should be used because string is to be used only to verify existence of a certain value.
value (string)—A string normally containing a regular expression that defines the filter to be applied.