Skip to content

Instantly share code, notes, and snippets.

@alexmuller
Last active August 29, 2015 14:02
Show Gist options
  • Save alexmuller/95d1c8247f7fd61c1241 to your computer and use it in GitHub Desktop.
Save alexmuller/95d1c8247f7fd61c1241 to your computer and use it in GitHub Desktop.
Register to vote integration with Performance Platform

Register to vote integrating with Performance Platform

The _timestamp in the JSON body represents the beginning of the period you're sending data for.

All of the data in a given data set (in your case, register-to-vote/volumetrics) must be the same granularity eg daily data.

To send us new data:

curl --request POST -d @age_band.json --header "Content-type: application/json" --header 'Authorization: Bearer BEARER_TOKEN' https://www.performance.service.gov.uk/data/register-to-vote/volumetrics
curl --request POST -d @local_authority.json --header "Content-type: application/json" --header 'Authorization: Bearer BEARER_TOKEN' https://www.performance.service.gov.uk/data/register-to-vote/volumetrics

To empty the data set, send an empty array as a PUT:

curl --request PUT --data "[]" --header "Content-type: application/json" --header 'Authorization: Bearer BEARER_TOKEN' https://www.performance.service.gov.uk/data/register-to-vote/volumetrics
[
{
"_timestamp": "2014-06-12T00:00:00+00:00",
"metric": "age_band",
"value": "18-24",
"count": 50
},
{
"_timestamp": "2014-06-12T00:00:00+00:00",
"metric": "age_band",
"value": "25-30",
"count": 100
}
]
[
{
"_timestamp": "2014-06-12T00:00:00+00:00",
"metric": "local_authority",
"value": "camden",
"count": 50
},
{
"_timestamp": "2014-06-12T00:00:00+00:00",
"metric": "local_authority",
"value": "hounslow",
"count": 100
}
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment