简体   繁体   中英

How to extract property that is an object in keen.io

Using extractions api in keen.io I can't get back specific properties that are objects.

curl "https://api.keen.io/3.0/projects/PROJECT_ID/queries/extraction?api_key=READ_KEY&event_collection=COLLECTION_NAME&timeframe=this_7_days"

Gives me back all properties, let's say

{"result": [
  {
     "userId": 1, 
     "keen": {"timestamp": 'val', "created_at": 'val'},        
     "name":'val'
  }
]}

But if I want to get just "userId" and "keen", the "keen" gets ignored.

curl "https://api.keen.io/3.0/projects/PROJECT_ID/queries/extraction?api_key=READ_KEY&event_collection=COLLECTION_NAME&timeframe=this_7_days&property_names=["userId","keen"]"

{"result": [{"userId": 1}...]}

I also noticed that I can get back specific properties from keen object if I specify:

property_names=["userId", "keen.timestamp"]

Result

{"result": [
  {
    "userId":"1", 
    "keen":{"timestamp":"val"}
  }
]}    

But I would like to get the whole object without specifying all properties. I have a top level property that is an object with many properties.

After contacting keen.io (very responsive and informative) I confirmed that retrieving just specified object with all its properties is not implemented at the moment and the only solution for now is to either get all of them or specify each property in the request (like i did in question above).

They will discuss adding this feature as it makes sense to have it working like that.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM