VOSTPT - Já Não Dá Para Abastecer - API v1

Instructions

How to use API v1

First you need to contact [email protected] for credentials.

You can use the API through the endpoints or through the manual access.

Endpoint for Data Fetching

/api/v1/fetch

CURL

curl -d '{"key":"Key Given by VOSTPT","secret":"Secret Given by VOSTPT"' -H "Content-Type: application/json" -X POST http://localhost:8000/api/v1/fetch

Parameters

key: Access key given by VOSTPT

secret: Access secret given by VOSTPT

Response (JSON)

On Success

[ { id: ..., name: ..., has_gasoline: ..., has_diesel: ..., has_lpg: ..., lat: ..., long: ... }, ... ] }

On Fail

[]

Endpoint for Data Pushing

/api/v1/push

CURL

curl -d '{"key":"Key Given by VOSTPT","secret":"Secret Given by VOSTPT","id":12345, "has_gasoline":0, "has_diesel": 0, "has_lpg": 0}' -H "Content-Type: application/json" -X POST http://localhost:8000/api/v1/push

Parameters

key: Access key given by VOSTPT

secret: Access secret given by VOSTPT

id: ID of Fuel Station (found by fetching)

has_gasoline: 0 or below if station has no gasoline, 1 or above if station has gasoline

has_diesel: 0 or below if station has no diesel, 1 or above if station has diesel

has_lpg: 0 or below if station has no lpg, 1 or above if station has lpg

Response (JSON)

On Success

{"success" => 1}

On Fail

{"success" => 0}

Manual Access

Submit