2

使用提取查询(使用 url 解码读取):

https://api.keen.io/3.0/projects/xxx/queries/extraction?api_key=xxxx&event_collection=dispatched-orders&filters=[ {"property_name":"features.tradeId","operator":"eq","property_value ":8581}]&timezone=28800

返回

{
    result: [
      {
          mobile:  "13185716746",
          keen  :  {
                       timestamp: "2015-02-10T07:10:07.816Z",
                       created_at: "2015-02-10T07:10:08.725Z",
                       id: "54d9aed03bc6964a7d311f9e"
                   },
          data  :  {
                      itemId: 2130,
                      num: 1
                   },
          features: {
                      communityId: 2000,
                     dispatcherId: 39,
                          tradeId: 8581
                    }
      }
   ]
}

但是如果我在我的删除查询 url 中使用相同的过滤器(它使用 url 解码来读取):

https://api.keen.io/3.0/projects/xxxxx/events/dispatched-orders?api_key=xxxxxx&filters=[ {"property_name":"features.tradeId","operator":"eq","property_value": 8581}]&时区=28800

返回

{
    properties: {
       data.num: "num",
       keen.created_at: "datetime",
       mobile: "string",
       keen.id: "string",
       features.communityId: "num",
       features.dispatcherId: "num",
       keen.timestamp: "datetime",
       features.tradeId: "num",
       data.itemId: "num"
    }
}

请帮助我...

4

1 回答 1

3

It looks like you are issuing a GET request for the delete comment. If you perform a GET on a collection you get back the schema that Keen has inferred for that collection.

You'll want to issue the above as a DELETE request. Here's the cURL command to do that:

curl -X DELETE "https://api.keen.io/3.0/projects/xxxxx/events/dispatched-orders?api_key=xxxxxx&filters=[{"property_name":"features.tradeId","operator":"eq","property_value":8581}]&timezone=28800"

Note that you'll probably need to URL encode that JSON as you mentioned in your above post!

于 2015-02-10T15:19:09.880 回答