Events: Error in Query


#1

Hey everyone,

I was trying to pull some data for one of the events but i get the below error:

{
“status”: “fail”,
“error”: “[ “Invalid property : null”]”,
“code”: 400
}

Please find my code below:
{
“event_name”: “Segment Viewed”,
“from”: 20171231,
“to”: 20171201,
“event_properties”: [
{
“Email”: "xxxcdfgv@gmail.com"
}
]
}

P.S: When i remove the event property part of the code, it works. May be something wrong with my code?


#2

Hey @Mirza_Hashim,

Event properties should always be passed in the following manner:

"event_properties": [
        {
            "name": "Email",
            "operator": "contains",
            "value": "xxxcdfgv@gmail.com"
        }
    ], 

Where,
“name” key contains the event property,
“operator” can consists of any of the operator such as “equals”, “contains”, “not equals” etc.
“value” contains the actual value of the event property specified.

Documentation link: https://support.clevertap.com/docs/api/working-with-events.html

Hope this helps.


#3

Hey Suvidhi,

Is there a way where in i can include Common Properties such as technographics as well?

Thanks in Advance!

Mirza


#4

Hey @Mirza_Hashim,

Absolutely, you can include the technographics fields as well in the common properties.

For example:

{
    "common_profile_properties": {
        "technographics": [
            {
                "name": "Device",
                "operator": "equals",
                "value": [
                    "Mobile",
                    "Tablet"
                ]
            },
            {
                "name": "Platform",
                "value": "AndroidApp"
            }
        ]
    }
}

Reference link: https://developer.clevertap.com/docs/clevertap-query-language#section-common-profile-properties

Best,
Suvidhi


#5

{
“event_name”: “l_typeahead”,
“event_properties”: [
{
“name”: “destination”,
“operator”: “does not contain”,
“value”: “p_search_results”
},
],
“event_properties”: [
{
“name”: “value”,
“operator”: “contains”,
“value”: “pizza”
}
]
“from”: 20150810,
“to”: 20151025
}

Can we filter on two event properties.


#6

Hey @Abhishek_Gupta,

Absolutely, you can filter an event on two event properties. The correct payload of the above will be:

{
	"event_name": "l_typeahead",
	"event_properties":[
		{
			"name": "destination",
			"operator": "does not contain",
			"value": "p_search_results"
			
		},
		{
			"name": "value",
			"operator": "contains",
			"value": "pizza"
				
		}
	],
	"from": 20180801,
	"to": 20180816
}

Best,
Suvidhi