Write API ######### We expose a simple HTTP API for storing data in the Performance Platform. There is one endpoint per data-set that can accept one or more JSON records being sent to it via a POST. We use `OAuth 2.0 Bearer tokens `_ to authenticate attempts to write to a data set. You authorize each request by adding an Authorization header with the secret access token you should have been provided for each data-set. The client request: - should use a URL like `https:///data//`, where `` could be something like `www.performance.service.gov.uk` - must have an HTTP Content-Type header of application/json - must have a valid `Authorization header `_ The `backdropsend `_ tool provides a command line interface to the API. This adds support for retrying. Adding data =========== .. http:post:: /data/(string:data_group)/(string:data_type) :synopsis: Insert data into a data set by sending a POST request with JSON in the body. **Example request**: .. sourcecode:: http POST /data/carers-allowance/transaction-count HTTP/1.1 Host: www.performance.service.gov.uk Authorization: Bearer abcdefghijklmnopqrstuvwxyz0123456789abcdefghijklmnopqrstuvwxyz01 Content-Type: application/json [ { "_id": "unique-identifier-1", "_timestamp": "2015-01-01T00:00:00Z", "count": 123 }, { "_id": "unique-identifier-2", "_timestamp": "2015-01-02T00:00:00Z", "count": 456 } ] All of the above headers are important. **Example response**: .. sourcecode:: http HTTP/1.1 200 OK Content-Type: application/json { "status": "ok" } :reqheader Authorization: required OAuth token to authenticate the request :reqheader Content-Type: type of the request body (only JSON is currently supported) :`_ - `Java implementation `_ intended to periodically poll a JDBC data store and push data Performance Platform - `JavaScript `_ - `Python `_