Push Data API

Knowi provides two modes of working with data:

  • 'Pull' mode to extract and transform data from existing datastores using our UI and/or Cloud9Agent, or,
  • 'Push' which can be used to send real-time data vi our API.

Parameters

Push Mode uses HTTP POST requests in the following format:

curl -X POST --header "X-API-Key: {yourApiKey}" https://www.knowi.com/live

Data is sent as JSON, with the following parameters:

Parameter Comments
entity Name of the dataset to send data to. Creates a new dataset if one does not exist
data Array of Data Points, with one or more key value pairs on each. Example: [{"Some Data":20,"Some Other Data":40}]

Push API Example

  1. Open a terminal and paste the following:

    curl  -i -X POST --header "X-API-Key: ygR9843wrgw94930g39" -d '{"entity": "Push Simple", "data":[{"Some Data":20,"Some Other Data":40}]}' https://www.knowi.com/live/6xaFYvBLSA8ie

    Modify the data section as you see fit. This submits data into Knowi using curl.

  2. See the live results below. It will be automatically updated as you send more data to it.

By default, any incoming data will be added into the dataset. For replacing all data for this dataset, with incoming data, use the replaceAll override strategy like in the following example:

curl  -i -X POST --header "X-API-Key: ygR9843wrgw94930g39" -d '{"entity": "Push Override Test", "data":[{"Transaction ID":1,"Some Data":20,"Some Other Data":240}],"override":{"replaceAll":true}}' https://www.knowi.com/live/6xaFYvBLSA8ie

To update data for a specific set of keys:

curl  -i -X POST --header "X-API-Key: ygR9843wrgw94930g39" -d '{"entity": "Push Override Test", "data":[{"Transaction ID":2,"Some Other Data":240}], "override":{"replaceValuesForKey":["Transaction ID"]}}' https://www.knowi.com/live/6xaFYvBLSA8ie

This will replace all existing data with Transaction ID of 2 with the latest, or insert records when a Transaction ID is not found.