2

using extraction query (which used url decoded for reading):

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

return

{
    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
                    }
      }
   ]
}

but if i use the same filters in my delete query url (which used url decoded for reading):

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

return

{
    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"
    }
}

plz help me ...

beneo
  • 113
  • 2
  • 11
  • i read the keen api reference and google the relative question, i post the question because i cannot find the answer anywhere .... – beneo Feb 10 '15 at 15:03

1 Answers1

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!