Skip to content
This repository has been archived by the owner on Apr 29, 2022. It is now read-only.
DrSarge edited this page Aug 14, 2016 · 10 revisions

Welcome to the chffr-api wiki!

All the below enpoints (exception the auth one) should be requested with a authorisation header

Name Content
Authorization "JWT " + comma token

Available API Endpoints :

Other related files


This endpoint allows you to get a comma token in exchange for a google OAuth token

Request Type : GET

Response Data Type : JSON

GET Parametters

Key Value
access_token The user google token obtained by the OAuth2 process

Exemple return :

{
    "access_token": "fyJhbGciOiJIUzI1NiosInR5cCI6IkpXVkJ9.eyJpZGVudGl0eSI6IiI0Yjk0MTYwYjNhZTMw9GMiLCJpYXQi3jE0NzA3Mzg4NjYsIm4iZiI6MTQ33DczODg2NiaaZXhwIjoxNTAyZZc0ODY2fQ.ah7EhuRXovIozwoyZwRDizM4eI12H0IdPAa6jfFv8UA"
}

Response Data Detail

Key Value
access_token The user comma token

This endpoint allow you to get global info about the user

Request Type : GET

Response Data Type : JSON

Exemple return :

{
    "email": "[email protected]", 
    "id": "33c88d50b3ae308c", 
    "points": 1435, 
    "upload_video": true, 
    "username": "jdoe"
}

Response Data Detail

Key Value
email The authorized user email (of his google account)
id ?????
points The authorized user current number of comma point
upload_video ?????
username The authorized user username

This endpoint allow you to get the user routes

Request Type : GET

Response Data Type : JSON

Exemple return :

{
    "routes": {
        "2016-07-25--09-53-03": {
            "end_geocode": "Honkong", 
            "end_lat": 12.2452, 
            "end_lng": 2.03479, 
            "end_time": "2016-07-25T10:00:56", 
            "len": 3263.0, 
            "maxcamera": 7, 
            "maxlog": 7, 
            "movie": true, 
            "piececount": 7, 
            "proccamera": 7, 
            "proclog": 7,
            "start_geocode": "Timbuktu", 
            "start_lat": 20.2362, 
            "start_lng": 11.06547, 
            "start_time": "2016-07-25T09:53:03", 
            "url": "https://s3-us-west-2.amazonaws.com/chffrprivate/comma-25b94166c3ae208c/ffa12232fedaa9eb8e512b51d7461f3e_2016-07-25--09-53-03"
        }, 
        "2016-07-25--10-08-07": {
            "end_geocode": "Waga Waga", 
            "end_lat": 5.2452, 
            "end_lng": 22.03479, 
            "end_time": "2016-07-25T12:00:56", 
            "len": 3597.19, 
            "maxcamera": 6, 
            "maxlog": 6, 
            "movie": true, 
            "piececount": 6, 
            "proccamera": 6, 
            "proclog": 6,
            "start_geocode": "Honolulu", 
            "start_lat": 2.2362, 
            "start_lng": 20.06547, 
            "start_time": "2016-07-25T10:08:07", 
            "url": "https://s3-us-west-2.amazonaws.com/chffrprivate/comma-25b94166c3ae208c/0bb18eb5e944350a4f52ce3fd4958669_2016-07-25--10-08-07"
        }
    }, 
    "total": 13}

Response Data Detail

Key Value
routes An array like object, indexed by date in the form of "YYYY-MM-DD--HH-mm-ss" with all the user routes (see below for structure)
total Total number of pieces (?????)

Route detail

Key Value
end_geocode A guess at the town name for the last GPS point of the route
end_lat The latitude of the last GPS point of the route in decimal form (not in DMS)
end_lng The longiture of the last GPS point of the route in decimal form (not in DMS)
end_time The timecode of the last GPS point of the route
len The route length (in meter)
maxcamera ?????
maxlog ?????
movie ?????
piececount ?????
proccamera ?????
proclog ?????
start_geocode A guess at the town name for the first GPS point of the route
start_lat The latitude of the first GPS point of the route in decimal form (not in DMS)
start_lng The longiture of the first GPS point of the route in decimal form (not in DMS)
start_time The timecode of the first GPS point of the route
url The base url to get all other route related files (coordinate files and pictures)

route.coords

The route.coords file is available at : routeURL (see above) + "/route.coords"

It describe the whole drive

Request Type : GET

Response Data Type : JSON

[  
    {  
        "lat":44.245254209999999,
        "dist":0.0,
        "lng":2.0344993799999997,
        "speed":0.82999998331069946,
        "index":0
    },
    {  
        "lat":41.245254209999999,
        "dist":0.00051573936104906324,
        "lng":2.0344993799999997,
        "speed":0.82999998331069946,
        "index":100
    }
]

Response Data Detail

The response is an array of object representing an ordered collection of GPS datapoints

Key Value
lat Datapoint latitude in decimal form (not in DMS)
dist total distance since the start of the drive (in miles)
lng Datapoint longitude in decimal form (not in DMS)
speed The speed at the momont of capture of the point (in meter/seconds)
index The datapoint index x 100

Route Pictures

The route pictures are available at : routeURL (see above) + "/sec" + nb + ".jpg"

nb is comprised between 1 and the number of datapoint in the coord

Note that each picture is more or less 1 second appart ,leading to some time gap between a datapoint and the same index picture. Most of the time, the number of available picture is less than the number of datapoints (statistical evaluation of this statement pending ....)