Created
February 2, 2015 14:37
-
-
Save shon/3ea673fa72319cb38786 to your computer and use it in GitHub Desktop.
It was good waste of time to figure out how to delete a keen.io event preferrably using Python. While I understand keen folks don't like deletes but wish there was better python API to do so.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
import requests | |
API_KEY = '' | |
PROJECT_ID = '' | |
COLLECTION_NAME = '' | |
filters = [{'property_name': 'keen.timestamp', 'operator': 'eq', 'property_value': '2015-02-02T10:20:00.000'}] | |
resp = requests.delete('https://api.keen.io/3.0/projects/' + PROJECT_ID + '/events/' + COLLECTION_NAME +'?api_key=' + API_KEY + '&filters=' + json.dumps(filters)) | |
print(resp.status_code) # 204 | |
print(resp.text) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment