Skip to content

Instantly share code, notes, and snippets.

@dustinlarimer
Last active August 29, 2015 14:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dustinlarimer/911e48ffe715c5c8a0df to your computer and use it in GitHub Desktop.
Save dustinlarimer/911e48ffe715c5c8a0df to your computer and use it in GitHub Desktop.
# POST many events
$ curl https://api.keen.io/3.0/projects/<PROJECT_ID>/events \
    -H 'Authorization: <WRITE_KEY>' \
    -H 'Content-Type: application/json' \
    -d '{
      "purchases": [
        {
          "item_id": "f9802334-23423",
          "customer": "janet.username@gmail.com",
          "transaction_id": "t23432423-234234",
          "amount": 22131,
          "keen": {
            "timestamp": "2014-11-06T19:10:39.205000Z"
          }
        },
        {
          "item_id": "f4322987-76652",
          "customer": "janet.username@gmail.com",
          "transaction_id": "t23432423-234234",
          "amount": 43123,
          "keen": {
            "timestamp": "2014-11-06T19:10:39.205000Z"
          }
        }
      ],
      "transactions": [
        {
          "customer": "janet.username@gmail.com",
          "transaction_id": "t23432423-234234",
          "total": 65254,
          "keen": {
            "timestamp": "2014-11-06T19:10:39.205000Z"
          }
        }
      ]
    }'

# Post a single event
$ curl http://api.keen.io/3.0/projects/<PROJECT_ID>/events/<EVENT_NAME> \
    -H 'Authorization: <WRITE_KEY>' \
    -H 'Content-Type: application/json' \
    -d '{
      "key": 123
    }'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment