APIs

5
Average: 5 (2 votes)

Connected Car (2.0.0)

Introduction

The PSA Group API is organized around REST and we’re using JSON for the data format. We use HAL mediatype for responses except for geolocation data where we use GeoJSON.

We support cross-origin resource sharing, allowing you to interact securely with our API from a client-side web application (never expose your client-secret in any public website's client-side code).

First steps

Befor making your first API Calls you will need to create a developer account and create an app. Just follow these steps.

Create a developer account

Go to #PG4D and click Create an account

Enter an email for your developer account (you will receive a confirmation email), a password (must contain characters of at least 3 different types (lowercase, uppercase, digit or punctuation) and must be at least 8 characters in length), a first name, a last name and a developer organisation.

Read our terms and conditions and accept them by clicking accept. Fill the captcha and finally click create new account

Check your email for a new email from our platform and click on the activation link.

Create an API client

Before you can make any calls to the API you need to create an API client. Go to your app page and click Register New Application.

Enter a title for your project, a descripton and a OAuth Redirect URI. It's the URI where your application will receive the OAuth2 code. click submit

Copy your client_id and your client_secret and keep them in a safe place.

Subscribe to a plan

To make API calls you need to subscribe to API Plan. A API plan is a SLA. There is free plan and paids plan depending on the number of API call you're allowed to do. For this, just go to the API documentation page by browsing the API Products catalog and choose an API to get the available API plans,

Subscribe to the OAuth2 plan

Go to the OAuth2 B2C API Product and click subscribe

Subscribe to the Connected Car plan

Go to the Connected Car v2 Product and click subscribe

Great ! We’re almost ready. Now get you client_id and client_secret and you have requested to API plans. You're ready to make your first API Calls !

Authentication

All requests to the Connected Car API must be authenticated and must include a valid access token. The Connected Car API utilizes the industry-standard OAuth 2.0 protocol.

We’re using oauth to secure the access to our APIs.

Scopes

Each access token is tagged with permission scopes. Scopes control whether the presented credentials allow to perform requested call to the resource server.

For the authorization code and implicit flows, they are displayed to the resource owner on the authorization form.

Supported scopes

Name Description
public Grant read-only access to all data.

Receiving an Access Token

To act on a user’s behalf and make calls from our API you will need an access token. To get an access token you need to go through the access token flow and prompt the user to authorize your application to act on their behalf.

To begin, you will need to send the user to the authorization endPoint. Here’s an example request:

GET https://api-preprod.groupe-psa.com/accounts/signin/v1/citroen/oauth2/authorize?response_type=code&scope=public&redirect_uri=your_redirect_url&client_id=your_client_id

You will be redirected to the authentification pagewhere you have to use your Citroën user account (If you don't have one juste register on http://fr-cpp-preprod.citroen.com/MyCitroen/)

Required parameters

  • client_id should be set to your application’s client ID as found in Apps \> Your app name.

  • redirect_uri should be set to the URL that the user will be redirected

    back to after the request is authorized. The `redirect_uri` must match
    the one in the application.
    
  • response_type must be set to code.

  • scope must be set to public

Server / Code Authentication

The redirect to your application will include a code which you will need in the next step. Once the user has logged in, they will be redirected to the redirect_url. The request will look like the following:

http://your_redirect_url/?code=AAIKiJ1lRG4tLn7Dp-avdJ9KjKSHNJ-_2UCtN5E_63Y_OObtBEJpjUeEWV7wtNzbS-IN-xe4peiCtijaJCcRKpCQdiyYvL2oGydQj1pZMpdk3g

This is a time-limited code that your application can exchange for a full authorization token. To do this you will need to pass the code to the token endPoint by making a POST request to 

curl --request POST \
  --url https://api-preprod.groupe-psa.com/accounts/signin/v1/citroen/oauth2/token \
  --header 'accept: application/json' \
  --header 'content-type: application/x-www-form-urlencoded' \
  --data 'grant_type=authorization_code&client_id=your_client_id&code=AAIKiJ1lRG4tLn7Dp-avdJ9KjKSHNJ-_2UCtN5E_63Y_OObtBEJpjUeEWV7wtNzbS-IN-xe4peiCtijaJCcRKpCQdiyYvL2oGydQj1pZMpdk3g&redirect_uri=your_url'

You are required to pass client_id, and redirect_uri for web applications. These parameters have to match the details for your application, and the redirect_uri must match the redirect_uri used during the Authorize step (above). grant_type has to be set to authorization_code. code must match the code you received in the redirect. If everything works correctly, you will get back a JSON-encoded string containing the token :

{
    "token_type": "bearer",
    "access_token": "AAEkM2I1Mzg5N2MtMjMxOS00NjBhLTk0OWMtYWRjZmEyMjc4ZGY1I4x-UYcXbxeKOE2kYIOc88k-c0bJ8BgYWe1QDBNU93SXBZ92B_QUk8jLObN0Dvr0sSUjmvv29UPA0T8SkGwvrDL7joRGF6oEtD3Pbf4PTnQ",
    "expires_in": 3600,
    "scope": "public",
    "refresh_token": "AAFQAQkFrg-YjKr_8hi79Cebxn2YJJhjCaDUYXhN_qWddAPdxoIF0CTZRkYgP5XFfgQHraWeZAcNuElyWYclowzEbePpyS-oqtgT9qivn-q8y0tjR9MdWjCWdvYIPSthTmY"
}

Limitations

Rate limiting

By default, the API is limited to 120 requests in 60 seconds. If you need more, just ask us and we will consider raising your quota. Every response will contains two headers related to the rate-limiting:

Name Description
X-RateLimit-Limit Maximum number of request allowed in the time window
X-RateLimit-Remaining Current remaining number of requests in the current time window  

When the rate limit is exceeded, the server will respond with a 429 Too Many Requests HTTP code with the following header :

Name Description
X-RateLimit-Reset Time to wait in seconds before the number of remaining requests will be reset

Response format

Dates

All dates are un GMT. The time format is described in the RFC3339

Here is an example of date : 2017-08-10T13:46:39.652+0000

HAL

The default Media Type we use is application/hal+json. The default schema is the following :

Default schema for an object

> This is an example of response with a unique object

{
  "_links": {
    "self": {
      "href": "oper"
    },
    (...)
  },
  (...)
  "createdAt": "2017-08-10T13:46:39.652+0000",
  "updatedAt": "2017-08-10T13:46:39.652+0000",
  "_embedded": {
    (...)
  }
}

When you call a ressource with an id you will retrieve a single object. Every ressource wich respond with a single object respect the following generic schema

Property Type Description
_links object This property contain _links related to the current object. It can be _links to store the current object or _links related to this objects. For example, in the object user you will find _links to the vehicles owned by the user.
_links.self.href string URL of the current object
createdAt date
updatedAt date
_embedded object This property contain commonly related objects to the current object. It can be empty.  

Default schema for a list of objects

> This is an example of response with a list of objects :

{
  "_links": {
    "self": {
      "href": "/connectedcar/v2/trips"
    },
    "first": {
      "href": "/connectedcar/v2/trips/?offset=0"
    },
    "next": {
      "href": "/connectedcar/v2/trips/?offset=10&limit=10"
    },
    "prev": {
      "href": "/connectedcar/v2/trips/?offset=0"
    },
    "last": {
      "href": "/connectedcar/v2/trips/?offset=90&limit=10"
    }
  },
  "total": 100,
  "_embedded": {
    "trips": [{...}]
  }
}                                        

When you call an api with a plural noum you will receive an array of objects. Every ressource wich respond with a list ob object respect the following generic schema.

Property Type Description
_links object This property contain _links related to the current object. You can use these _links in your application to store.
_links.self.href string URL of the current position in the array
_links.first.href string URL for the first page of the array. Optional
_links.next.href string URL for the next page of the array. Optional
_links.prev.href string URL for the previous page of the array. Optional
_links.last.href string URL for the last page of the array. Optional
total integer Total number of elements in the array. Depend on the filters applyed to the search.
_embedded object  

GeoJson

> This is an example of a GeoJson object :

{
  "type": "Feature",
  "geometry": {
    "type": "Point",
    "coordinates": [
      77.3244183, 34.2787387, 5359    
    ]
  },
  "properties": {
    "updatedAt": "2017-08-10T13:46:39.652+0000",
    "createdAt": "2017-08-10T13:46:39.652+0000",
    "id": "665837742587904",
    "heading": 82.0
  }
}

The default Media Type we use for data related with geolocation is application/geo+json.

The coordinate property is an array of :

  • longitude
  • latitude
  • altitude

User

Get User Information

curl --request GET \
  --url 'https://api-preprod.groupe-psa.com/connectedcar/v2/user?client_id=REPLACE_THIS_KEY' \
  --header 'accept: application/hal+json' \
  --header 'authorization: Bearer REPLACE_BEARER_TOKEN'
import http.client

conn = http.client.HTTPSConnection("api-preprod.groupe-psa.com")

headers = {
    'authorization': "Bearer REPLACE_BEARER_TOKEN",
    'accept': "application/hal+json"
    }

conn.request("GET", "/api/connectedcar/v2/user?client_id=REPLACE_THIS_KEY", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
// OkHttpClient from http://square.github.io/okhttp/

OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("https://api-preprod.groupe-psa.com/connectedcar/v2/user?client_id=REPLACE_THIS_KEY")
  .get()
  .addHeader("authorization", "Bearer REPLACE_BEARER_TOKEN")
  .addHeader("accept", "application/hal+json")
  .build();

Response response = client.newCall(request).execute();
import Foundation

let headers = [
  "authorization": "Bearer VALID_BEARER_TOKEN",
  "accept": "application/hal+json"
]

var request = NSMutableURLRequest(URL: NSURL(string: "https://api-preprod.groupe-psa.com/connectedcar/v2/user?client_id=REPLACE_THIS_KEY")!,
                                        cachePolicy: .UseProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.HTTPMethod = "GET"
request.allHTTPHeaderFields = headers

let session = NSURLSession.sharedSession()
let dataTask = session.dataTaskWithRequest(request, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error)
  } else {
    let httpResponse = response as? NSHTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()

> Make sure to replace YOUR_CLIENT_ID with your API key and VALID_BEARER_TOKEN by a valid bearer token. > The above command returns JSON structured like this:

{
    "_links": {
        "self": {
            "href": "/user/"
        },
        "trips": {
            "href": "/trips/"
        },
        "lastTrip": {
            "href": "/trips/123AB1C45D98765AEB5F1234567890F0-123456789-2"
        },
        "lastEcodriving": {
            "href": "/trips/123AB1C45D98765AEB5F1234567890F0-123456789-2/ecodriving"
        }
    },
    "id": "ACNT100000123456",
    "email": "nicolas.cugnot@minitel.fr",
    "firstName": "nicolas",
    "lastName": "cugnot",
    "createdAt": "2000-12-31T15:01:01.000Z",
    "updatedAt": "2017-06-27T09:07:02.000Z",
    "_embedded": {
        "vehicles": [
            {
                "_links": {
                    "self": {
                        "href": "/vehicles/123AB1C45D98765AEB5F1234567890F0"
                    },
                    "lastTrip": {
                        "href": "/trips/123AB1C45D98765AEB5F1234567890F0-123456789-2"
                    },
                    "lastPosition": {
                        "href": "/vehicles/123AB1C45D98765AEB5F1234567890F0/lastPosition"
                    },
                    "trips": {
                        "href": "/vehicles/123AB1C45D98765AEB5F1234567890F0/trips"
                    },
                    "collisions": {
                        "href": "/vehicles/123AB1C45D98765AEB5F1234567890F0/collisions"
                    },
                    "telemetry": {
                        "href": "/vehicles/123AB1C45D98765AEB5F1234567890F0/telemetry"
                    },
                    "maintenance": {
                        "href": "/vehicles/123AB1C45D98765AEB5F1234567890F0/maintenance"
                    },
                    "alerts": {
                        "href": "/vehicles/123AB1C45D98765AEB5F1234567890F0/alerts"
                    },
                    "events": {
                        "href": "/vehicles/123AB1C45D98765AEB5F1234567890F0/events"
                    }
                },
                "id": "123AB1C45D98765AEB5F1234567890F0",
                "vin": "VF00ABCDEFG123456",
                "brand": "C",
                "model": "H5",
                "subModel": "3A",
                "engine": "06",
                "gearbox": "AHXT",
                "createdAt": "2017-06-01T00:00:00.000Z"
            }
        ]
    }
}

This endPoint retrieves information on the logged in user.

HTTP Request

GET https://api-preprod.groupe-psa.com/connectedcar/v2/user?client_id=REPLACE_THIS_KEY

Object properties

Property Type Description
id string Unique id of the user
email string
firstName string
lastName string
createdAt date Creation date of the account
updatedAt date
_embedded object
_embedded.vehicles array List of vehicle owned by the user. Optionnal.

Errors

Error Code Meaning
404 No user found. The user is not found on the system. Should never happend.
500 Internal server error. Sounds like there's a problem on the server. Take it easy, we're on it ;)

Vehicles

Get all Vehicles owned by the user

curl --request GET \
  --url 'https://api-preprod.groupe-psa.com/connectedcar/v2/vehicles?client_id=REPLACE_THIS_KEY&limit=REPLACE_THIS_VALUE&offset=REPLACE_THIS_VALUE' \
  --header 'accept: application/hal+json' \
  --header 'authorization: Bearer VALID_BEARER_TOKEN' 
import http.client

conn = http.client.HTTPSConnection("api-preprod.groupe-psa.com")

headers = {
    'authorization': "Bearer VALID_BEARER_TOKEN",
    'accept': "application/hal+json"
    }

conn.request("GET", "/api/connectedcar/v2/vehicles?client_id=REPLACE_THIS_KEY&limit=REPLACE_THIS_VALUE&offset=REPLACE_THIS_VALUE", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
// OkHttpClient from http://square.github.io/okhttp/

OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("https://api-preprod.groupe-psa.com/connectedcar/v2/vehicles?client_id=REPLACE_THIS_KEY&limit=REPLACE_THIS_VALUE&offset=REPLACE_THIS_VALUE")
  .get()
  .addHeader("authorization", "Bearer VALID_BEARER_TOKEN")
  .addHeader("accept", "application/hal+json")
  .build();

Response response = client.newCall(request).execute();
import Foundation

let headers = [
  "authorization": "Bearer VALID_BEARER_TOKEN",
  "accept": "application/hal+json"
]

var request = NSMutableURLRequest(URL: NSURL(string: "https://api-preprod.groupe-psa.com/connectedcar/v2/vehicles?client_id=REPLACE_THIS_KEY&limit=REPLACE_THIS_VALUE&offset=REPLACE_THIS_VALUE")!,
                                        cachePolicy: .UseProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.HTTPMethod = "GET"
request.allHTTPHeaderFields = headers

let session = NSURLSession.sharedSession()
let dataTask = session.dataTaskWithRequest(request, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error)
  } else {
    let httpResponse = response as? NSHTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()

> Make sure to replace YOUR_CLIENT_ID with your API key and VALID_BEARER_TOKEN by a valid bearer token. > The above command returns JSON structured like this:

{
    "_links": {
        "self": {
            "href": "/vehicles?limit=10&offset=0"
        },
        "first": {
            "href": "/vehicles?limit=10&offset=0"
        },
        "next": {
            "href": "/vehicles?limit=10&offset=0"
        },
        "prev": {
            "href": "/vehicles?limit=10&offset=0"
        },
        "last": {
            "href": "/vehicles?limit=10&offset=0"
        }
    },
    "total": 1,
    "_embedded": {
        "vehicles": [
            {
                "_links": {
                    "self": {
                        "href": "/vehicles/123AB1C45D98765AEB5F1234567890F0"
                    },
                    "lastTrip": {
                        "href": "/trips/123AB1C45D98765AEB5F1234567890F0-123456789-2"
                    },
                    "lastPosition": {
                        "href": "/vehicles/123AB1C45D98765AEB5F1234567890F0/lastPosition"
                    },
                    "trips": {
                        "href": "/vehicles/123AB1C45D98765AEB5F1234567890F0/trips"
                    },
                    "collisions": {
                        "href": "/vehicles/123AB1C45D98765AEB5F1234567890F0/collisions"
                    },
                    "telemetry": {
                        "href": "/vehicles/123AB1C45D98765AEB5F1234567890F0/telemetry"
                    },
                    "maintenance": {
                        "href": "/vehicles/123AB1C45D98765AEB5F1234567890F0/maintenance"
                    },
                    "alerts": {
                        "href": "/vehicles/123AB1C45D98765AEB5F1234567890F0/alerts"
                    },
                    "events": {
                        "href": "/vehicles/123AB1C45D98765AEB5F1234567890F0/events"
                    }
                },
                "id": "123AB1C45D98765AEB5F1234567890F0",
                "vin": "VF00ABCDEFG123456",
                "brand": "C",
                "model": "H5",
                "subModel": "3A",
                "engine": "06",
                "gearbox": "AHXT",
                "createdAt": "2017-06-01T00:00:00.000Z"
            }
        ]
    }
}

This endPoint retrieves all vehicles owned by the user. To add a vehicle to the list, the user need to use the dedicated brand mobile app (MyPeugeot, MyDS or MyCitroen). Adding vehicles to the user account is not allowed throught APIs.

HTTP Request

GET https://api-preprod.groupe-psa.com/connectedcar/v2/vehicles?client_id=REPLACE_THIS_KEY&limit={limit}&offset={offset}

Query Parameters

Parameter Type Required Description Example
limit integer false The limit parameter controls the maximum number of vehicles that may be returned for a single request. This parameter can be thought of as the page size. If no limit is specified, the system defaults to a limit of 10 results per request. 4
offset integer false The offset parameter controls the starting Point within the collection of vehicles results. For example, if you have a collection of 15 vehicles to be retrieved and you specify limit=5, you can retrieve the entire set of results in 3 successive requests by varying the offset value: offset=0, offset=5, and offset=10. Note that the first vehicle in the collection is retrieved by setting a zero offset. 3

Object properties

The result of this request gives you a [list](# default-schema-for-a-list-of-objects) of [vehicles](# object-properties-3).

Errors

Error Code Meaning
404 No vehicles found. The user don't have any vehicles declared in his account. He needs to add ones with the Official Mobile Application : MyPeugeot, MyDS or MyCitroen.
500 Internal server error. Sounds like there's a problem on the server. Take it easy, we're on it ;)

Get a specific Vehicle

curl --request GET \
  --url https://api-preprod.groupe-psa.com/connectedcar/v2/vehicles/REPLACE_ID?client_id=REPLACE_THIS_KEY \
  --header 'accept: application/hal+json' \
  --header 'authorization: Bearer REPLACE_BEARER_TOKEN'
// OkHttpClient from http://square.github.io/okhttp/

OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("https://api-preprod.groupe-psa.com/connectedcar/v2/vehicles/REPLACE_ID?client_id=REPLACE_THIS_KEY")
  .get()
  .addHeader("authorization", "Bearer REPLACE_BEARER_TOKEN")
  .addHeader("accept", "application/hal+json")
  .build();

Response response = client.newCall(request).execute();
import Foundation

let headers = [
  "authorization": "Bearer REPLACE_BEARER_TOKEN",
  "accept": "application/hal+json"
]

var request = NSMutableURLRequest(URL: NSURL(string: "https://api-preprod.groupe-psa.com/connectedcar/v2/vehicles/REPLACE_ID?client_id=REPLACE_THIS_KEY")!,
                                        cachePolicy: .UseProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.HTTPMethod = "GET"
request.allHTTPHeaderFields = headers

let session = NSURLSession.sharedSession()
let dataTask = session.dataTaskWithRequest(request, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error)
  } else {
    let httpResponse = response as? NSHTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
import http.client

conn = http.client.HTTPSConnection("api-preprod.groupe-psa.com")

headers = {
    'authorization': "Bearer VALID_BEARER_TOKEN",
    'accept': "application/hal+json"
    }

conn.request("GET", "/api/connectedcar/v2/vehicles/REPLACE_ID?client_id=REPLACE_THIS_KEY", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))

> Make sure to replace YOUR_CLIENT_ID with your API key and VALID_BEARER_TOKEN by a valid bearer token. > The above command returns JSON structured like this:

{
    "_links": {
        "self": {
            "href": "/vehicles/25D3D93E7319002612A80D6AD8B423FE"
        },
        "lastTrip": {
            "href": "/trips/25D3D93E7319002612A80D6AD8B423FE-909839383-80"
        },
        "lastPosition": {
            "href": "/vehicles/25D3D93E7319002612A80D6AD8B423FE/lastPosition"
        },
        "trips": {
            "href": "/vehicles/25D3D93E7319002612A80D6AD8B423FE/trips"
        },
        "collisions": {
            "href": "/vehicles/25D3D93E7319002612A80D6AD8B423FE/collisions"
        },
        "telemetry": {
            "href": "/vehicles/25D3D93E7319002612A80D6AD8B423FE/telemetry"
        },
        "maintenance": {
            "href": "/vehicles/25D3D93E7319002612A80D6AD8B423FE/maintenance"
        },
        "alerts": {
            "href": "/vehicles/25D3D93E7319002612A80D6AD8B423FE/alerts"
        },
        "events": {
            "href": "/vehicles/25D3D93E7319002612A80D6AD8B423FE/events"
        }
    },
    "id": "25D3D93E7319002612A80D6AD8B423FE",
    "vin": "VF73A5GZTGJ789676",
    "brand": "C",
    "model": "H5",
    "subModel": "3A",
    "engine": "07",
    "gearbox": "5GZT",
    "createdAt": "2017-03-03T00:00:00.000Z"
}

This endPoint retrieves a specific vehicle.

HTTP Request

GET https://api-preprod.groupe-psa.com/connectedcar/v2/vehicles/{id}?client_id=REPLACE_THIS_KEY

Query Parameters

Parameter Type Required Description Example
id string true This is the unique ID of the vehicle. 29245REZ29RTYY54944

Object properties

Property Type Description
id string Unique id of the vehicle
vin string VIN of the vehicle
brand string
model string
subModel string
engine string
gearbox string
energy string
createdAt date
updatedAt date

Errors

Error Code Meaning
404 There is no vehicle with this idon the database.
403 The user don't have access to this car. Usually an error with the vehicle ID.
500 Internal server error. Sounds like there's a problem on the server. Take it easy, we're on it ;)

Get last position of a Vehicle

curl --request GET \
  --url https://api-preprod.groupe-psa.com/connectedcar/v2/vehicles/REPLACE_ID/lastPosition?client_id=REPLACE_THIS_KEY \
  --header 'accept: application/hal+json' \
  --header 'authorization: Bearer REPLACE_BEARER_TOKEN' \
// OkHttpClient from http://square.github.io/okhttp/

OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("https://api-preprod.groupe-psa.com/connectedcar/v2/vehicles/REPLACE_ID/lastPosition?client_id=REPLACE_THIS_KEY")
  .get()
  .addHeader("authorization", "Bearer REPLACE_BEARER_TOKEN")
  .addHeader("accept", "application/hal+json")
  .build();

Response response = client.newCall(request).execute();
import Foundation

let headers = [
  "authorization": "Bearer REPLACE_BEARER_TOKEN",
  "accept": "application/hal+json"
]

var request = NSMutableURLRequest(URL: NSURL(string: "https://api-preprod.groupe-psa.com/connectedcar/v2/vehicles/REPLACE_ID/lastPosition?client_id=REPLACE_THIS_KEY")!,
                                        cachePolicy: .UseProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.HTTPMethod = "GET"
request.allHTTPHeaderFields = headers

let session = NSURLSession.sharedSession()
let dataTask = session.dataTaskWithRequest(request, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error)
  } else {
    let httpResponse = response as? NSHTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
import http.client

conn = http.client.HTTPSConnection("api-preprod.groupe-psa.com")

headers = {
    'authorization': "Bearer VALID_BEARER_TOKEN",
    'accept': "application/hal+json"
    }

conn.request("GET", "/api/connectedcar/v2/vehicles/REPLACE_ID/lastPosition?client_id=REPLACE_THIS_KEY", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))

> Make sure to replace YOUR_CLIENT_ID with your API key and VALID_BEARER_TOKEN by a valid bearer token. > The above command returns JSON structured like this:

{
    "type": "Feature",
    "geometry": {
        "type": "Point",
        "coordinates": [
            1.7402,
            48.98058,
            19
        ]
    },
    "properties": {
        "updatedAt": "2017-06-14T07:10:34.000Z",
        "createdAt": "2017-06-14T07:10:54.000Z",
        "id": "25D3D93E7319002612A80D6AD8B423FE-909839383-20170614071034",
        "heading": 253
    }
}

This endPoint retrieves the last position of a vehicle.

HTTP Request

GET https://api-preprod.groupe-psa.com/connectedcar/v2/vehicles/{id}/lastPosition?client_id=REPLACE_THIS_KEY

Query Parameters

Parameter Type Required Description  Example
id string true This is the unique ID of the vehicle. 29245REZ29RTYY54944

Object properties

Property Type Description
type string
properties object
properties.id string unique id
properties.createdAt date Date of collection of the data.
properties.updatedAt date
properties.heading float heading of the car un degres. 0 for North.

Errors

Error Code Meaning
404 No geolocalisation data found for this vehicle. The user don't allow us to collect geolocalisation data on this vehicle.
403 The user don't have access to this car. Usually an error with the vehicle ID.
500 Internal server error. Sounds like there's a problem on the server. Take it easy, we're on it ;)

Get last alerts of a Vehicle

curl --request GET \
  --url 'https://api-preprod.groupe-psa.com/connectedcar/v2/vehicles/REPLACE_ID/alerts?client_id=REPLACE_THIS_KEY&since=REPLACE_THIS_VALUE&until=REPLACE_THIS_VALUE&limit=REPLACE_THIS_VALUE&offset=REPLACE_THIS_VALUE&locale=REPLACE_THIS_VALUE' \
  --header 'accept: application/hal+json' \
  --header 'authorization: Bearer REPLACE_BEARER_TOKEN' 
// OkHttpClient from http://square.github.io/okhttp/

OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("https://api-preprod.groupe-psa.com/connectedcar/v2/vehicles/REPLACE_ID/alerts?client_id=REPLACE_THIS_KEY&since=REPLACE_THIS_VALUE&until=REPLACE_THIS_VALUE&limit=REPLACE_THIS_VALUE&offset=REPLACE_THIS_VALUE&locale=REPLACE_THIS_VALUE")
  .get()
  .addHeader("authorization", "Bearer REPLACE_BEARER_TOKEN")
  .addHeader("accept", "application/hal+json")
  .build();

Response response = client.newCall(request).execute();
import Foundation

let headers = [
  "authorization": "Bearer REPLACE_BEARER_TOKEN",
  "accept": "application/hal+json"
]

var request = NSMutableURLRequest(URL: NSURL(string: "https://api-preprod.groupe-psa.com/connectedcar/v2/vehicles/REPLACE_ID/alerts?client_id=REPLACE_THIS_KEY&since=REPLACE_THIS_VALUE&until=REPLACE_THIS_VALUE&limit=REPLACE_THIS_VALUE&offset=REPLACE_THIS_VALUE&locale=REPLACE_THIS_VALUE")!,
                                        cachePolicy: .UseProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.HTTPMethod = "GET"
request.allHTTPHeaderFields = headers

let session = NSURLSession.sharedSession()
let dataTask = session.dataTaskWithRequest(request, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error)
  } else {
    let httpResponse = response as? NSHTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
import http.client

conn = http.client.HTTPSConnection("api-preprod.groupe-psa.com")

headers = {
    'authorization': "Bearer VALID_BEARER_TOKEN",
    'accept': "application/hal+json"
    }

conn.request("GET", "/api/connectedcar/v2/vehicles/REPLACE_ID/alerts?client_id=REPLACE_THIS_KEY&since=REPLACE_THIS_VALUE&until=REPLACE_THIS_VALUE&limit=REPLACE_THIS_VALUE&offset=REPLACE_THIS_VALUE&locale=REPLACE_THIS_VALUE", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))

> Make sure to replace YOUR_CLIENT_ID with your API key and VALID_BEARER_TOKEN by a valid bearer token. > The above command returns JSON structured like this:

{
    "_links": {
        "self": {
            "href": "/vehicles/25D3D93E7319002612A80D6AD8B423FE/alerts?limit=10&offset=0&locale=en_US"
        },
        "first": {
            "href": "/vehicles/25D3D93E7319002612A80D6AD8B423FE/alerts?limit=10&offset=0&locale=en_US"
        },
        "next": {
            "href": "/vehicles/25D3D93E7319002612A80D6AD8B423FE/alerts?limit=10&offset=0&locale=en_US"
        },
        "prev": {
            "href": "/vehicles/25D3D93E7319002612A80D6AD8B423FE/alerts?limit=10&offset=0&locale=en_US"
        },
        "last": {
            "href": "/vehicles/25D3D93E7319002612A80D6AD8B423FE/alerts?limit=10&offset=0&locale=en_US"
        }
    },
    "total": 0,
    "_embedded": {
        "alerts": [
      {
        "alert": "gazjel",
        "advise": "hutw",
        "category": "piur",
        "idAlert": "3739013596839936",
        "dateUpdate": "10/13/2051",
        "vin": "waevnul",
        "contract": "ewunad",
        "dateAlertBegin": "5/8/2086",
        "dateAlertEnd": "7/17/2114",
        "alertState": 63460548
      }
    ]
  }
}

This endPoint retrieves the last alerts for a vehicle. Alerts are information the user get on his dashboard : oil pressure alert, fuel level alert, pressure tire alert etc.

HTTP Request

GET https://api-preprod.groupe-psa.com/connectedcar/v2/vehicles/{id}/alerts?client_id=REPLACE_THIS_KEY&since={date}&until={date}&limit={limit}&offset={offset}&locale={lang}

Query Parameters

Parameter Type Required Description Example
id string true This is the unique ID of the vehicle. 29245REZ29RTYY54944
since date false Returns alerts created after the given date. The date is a RFC3339 formated date. 2017-08-10T13:46:39.652+0000
until date false Returns alerts created before the given date. The date is a RFC3339 formated date. 2017-08-10T13:46:39.652+0000
limit integer false The limit parameter controls the maximum number of alerts that may be returned for a single request. This parameter can be thought of as the page size. If no limit is specified, the system defaults to a limit of 10 results per request. 2
offset integer false The offset parameter controls the starting Point within the collection of alert results. For example, if you have a collection of 15 alerts to be retrieved and you specify limit=5, you can retrieve the entire set of results in 3 successive requests by varying the offset value: offset=0, offset=5, and offset=10. Note that the first alert in the collection is retrieved by setting a zero offset. 5
locale enum false Language used for the alert's message. The available values are : fr, en. By default en is used. fr

Object properties

The result of this request gives you a [list](# default-schema-for-a-list-of-objects) of Alert

Property Type Description
id string Unique id for this Alert
active boolean true if the alert is still active (not fixed). Usually the user need to go to a dealer shop to fix it. false when the alert is fixed.
message enum Message of the alert.
severity enum Severity of the alert : low, medium, high. In case of a highalert, the user need to stop his vehicule immediately and call a dealer store.
createdAt date Date of collection of the alert.
updatedAt date Last update of the alert.
__embedded.position object A GeoJson object of the geolocation of the alert.

Errors

Error Code Meaning
404 There is no alerts on the vehicle. Pretty good news.
403 The user don't have access to this car. Usually an error with the vehicle ID.
500 Internal server error. Sounds like there's a problem on the server. Take it easy, we're on it ;)

Get last collisions informations for a Vehicle

curl --request GET \
  --url 'https://api-preprod.groupe-psa.com/connectedcar/v2/vehicles/REPLACE_ID/colissions?client_id=REPLACE_THIS_KEY&since=REPLACE_THIS_VALUE&until=REPLACE_THIS_VALUE&limit=REPLACE_THIS_VALUE&offset=REPLACE_THIS_VALUE' \
  --header 'accept: application/hal+json' \
  --header 'authorization: Bearer REPLACE_BEARER_TOKEN' 
// OkHttpClient from http://square.github.io/okhttp/

OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("https://api-preprod.groupe-psa.com/connectedcar/v2/vehicles/REPLACE_ID/collisions?client_id=REPLACE_THIS_KEY&since=REPLACE_THIS_VALUE&until=REPLACE_THIS_VALUE&limit=REPLACE_THIS_VALUE&offset=REPLACE_THIS_VALUE")
  .get()
  .addHeader("authorization", "Bearer REPLACE_BEARER_TOKEN")
  .addHeader("accept", "application/hal+json")
  .build();

Response response = client.newCall(request).execute();
import Foundation

let headers = [
  "authorization": "Bearer REPLACE_BEARER_TOKEN",
  "accept": "application/hal+json"
]

var request = NSMutableURLRequest(URL: NSURL(string: "https://api-preprod.groupe-psa.com/connectedcar/v2/vehicles/REPLACE_ID/collisions?client_id=REPLACE_THIS_KEY&since=REPLACE_THIS_VALUE&until=REPLACE_THIS_VALUE&limit=REPLACE_THIS_VALUE&offset=REPLACE_THIS_VALUE")!,
                                        cachePolicy: .UseProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.HTTPMethod = "GET"
request.allHTTPHeaderFields = headers

let session = NSURLSession.sharedSession()
let dataTask = session.dataTaskWithRequest(request, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error)
  } else {
    let httpResponse = response as? NSHTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
import http.client

conn = http.client.HTTPSConnection("api-preprod.groupe-psa.com")

headers = {
    'authorization': "Bearer VALID_BEARER_TOKEN",
    'accept': "application/hal+json"
    }

conn.request("GET", "/api/connectedcar/v2/vehicles/REPLACE_ID/collisions?client_id=REPLACE_THIS_KEY&since=REPLACE_THIS_VALUE&until=REPLACE_THIS_VALUE&limit=REPLACE_THIS_VALUE&offset=REPLACE_THIS_VALUE", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))

> Make sure to replace YOUR_CLIENT_ID with your API key and VALID_BEARER_TOKEN by a valid bearer token. > The above command returns JSON structured like this:

{
    "_links": {
        "self": {
            "href": "/vehicles/25D3D93E7319002612A80D6AD8B423FE/collisions?limit=10&offset=0"
        },
        "first": {
            "href": "/vehicles/25D3D93E7319002612A80D6AD8B423FE/collisions?limit=10&offset=0"
        },
        "next": {
            "href": "/vehicles/25D3D93E7319002612A80D6AD8B423FE/collisions?limit=10&offset=0"
        },
        "prev": {
            "href": "/vehicles/25D3D93E7319002612A80D6AD8B423FE/collisions?limit=10&offset=0"
        },
        "last": {
            "href": "/vehicles/25D3D93E7319002612A80D6AD8B423FE/collisions?limit=10&offset=0"
        }
    },
    "total": 1,
    "_embedded": {
        "collisions": [
            {
                "_links": {
                    "self": {
                        "href": "/collisions/25D3D93E7319002612A80D6AD8B423FE-909839383"
                    },
                    "vehicle": {
                        "href": "/vehicles/25D3D93E7319002612A80D6AD8B423FE"
                    },
                    "trip": {
                        "href": "unknown"
                    }
                },
                "id": "25D3D93E7319002612A80D6AD8B423FE-909839383",
                "rollOver": false,
                "rear": {
                    "level": "NONE"
                },
                "front": {
                    "level": "NONE"
                },
                "lateral": {
                    "level": "NONE"
                },
                "pedestrian": false,
                "createdAt": "2017-06-14T07:09:33.000Z",
                "updatedAt": "2017-06-14T07:09:33.000Z"
            }
        ]
    }
} 

This endPoint retrieves the last collisions for a vehicle.

HTTP Request

GET https://api-preprod.groupe-psa.com/connectedcar/v2/vehicles/{id}/collisions?client_id=REPLACE_THIS_KEY&since={date}&until={date}&limit={limit}&offset={offset}

Query Parameters

Parameter Type Required Description Example
id string true This is the unique ID of the vehicle. 29245REZ29RTYY54944
since date false Returns collisions created after the given date. The date is a RFC3339 formated date. 2017-08-10T13:46:39.652+0000
until date false Returns collisions created before the given date. The date is a RFC3339 formated date. 2017-08-10T13:46:39.652+0000
limit integer false The limit parameter controls the maximum number of vehicles that may be returned for a single request. This parameter can be thought of as the page size. If no limit is specified, the system defaults to a limit of 10 results per request. 2
offset integer false The offset parameter controls the starting Point within the collection of vehicles results. For example, if you have a collection of 15 vehicles to be retrieved and you specify limit=5, you can retrieve the entire set of results in 3 successive requests by varying the offset value: offset=0, offset=5, and offset=10. Note that the first vehicle in the collection is retrieved by setting a zero offset. 5

Object properties

Property Type Description
id string Unique id for this Collision
rollOver  boolean true if the vehicle made a roll over during the crash
front.level enum This information is the evaluation of the rear collision. There is 5 levels : none (no collision detected), fixable (the violence of the collision should allow a repair store to fix it), low, medium, high
rear.level enum This information is the evaluation of the rear collision. There is 5 levels : none (no collision detected), fixable (the violence of the collision should allow a repair store to fix it), low, medium, high
lateral.level enum This information is the evaluation of the rear collision. There is 5 levels : none (no collision detected), fixable (the violence of the collision should allow a repair store to fix it), low, medium, high
pedestrian boolean trueif the vehicle have detected a collision with a pedestrian
createdAt date Date of collection of the collision.
updatedAt date Last update of the collision.

Errors

Error Code Meaning
404 There is no collisions detected on the vehicle. We love to ear that !
403 The user don't have access to this car. Usually an error with the vehicle ID.
500 Internal server error. Sounds like there's a problem on the server. Take it easy, we're on it ;)

Get maintenance information for a Vehicle

curl --request GET \
  --url https://api-preprod.groupe-psa.com/connectedcar/v2/vehicles/REPLACE_ID/maintenance?client_id=REPLACE_THIS_KEY \
  --header 'accept: application/hal+json' \
  --header 'authorization: Bearer REPLACE_BEARER_TOKEN' 
import http.client

conn = http.client.HTTPSConnection("api-preprod.groupe-psa.com")

headers = {
    'authorization': "Bearer REPLACE_BEARER_TOKEN",
    'accept': "application/hal+json"
    }

conn.request("GET", "/api/connectedcar/v2/vehicles/REPLACE_ID/maintenance?client_id=REPLACE_THIS_KEY", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
// OkHttpClient from http://square.github.io/okhttp/

OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("https://api-preprod.groupe-psa.com/connectedcar/v2/vehicles/REPLACE_ID/maintenance?client_id=REPLACE_THIS_KEY")
  .get()
  .addHeader("authorization", "Bearer REPLACE_BEARER_TOKEN")
  .addHeader("accept", "application/hal+json")
  .build();

Response response = client.newCall(request).execute();
import Foundation

let headers = [
  "authorization": "Bearer REPLACE_BEARER_TOKEN",
  "accept": "application/hal+json"
]

var request = NSMutableURLRequest(URL: NSURL(string: "https://api-preprod.groupe-psa.com/connectedcar/v2/vehicles/REPLACE_ID/maintenance?client_id=REPLACE_THIS_KEY")!,
                                        cachePolicy: .UseProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.HTTPMethod = "GET"
request.allHTTPHeaderFields = headers

let session = NSURLSession.sharedSession()
let dataTask = session.dataTaskWithRequest(request, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error)
  } else {
    let httpResponse = response as? NSHTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()

> Make sure to replace YOUR_CLIENT_ID with your API key and VALID_BEARER_TOKEN by a valid bearer token. > The above command returns JSON structured like this:

{
    "_links": {
        "self": {
            "href": "/vehicles/25D3D93E7319002612A80D6AD8B423FE/maintenance"
        },
        "vehicle": {
            "href": "/vehicles/25D3D93E7319002612A80D6AD8B423FE"
        }
    },
    "days": 120,
    "mileage": 18960,
    "createdAt": "2017-06-14T07:09:33.000Z",
    "updatedAt": "2017-06-14T07:09:33.000Z"
}

HTTP Request

GET https://api-preprod.groupe-psa.com/connectedcar/v2/vehicles/{id}/maintenance?client_id=REPLACE_THIS_KEY

Query Parameters

Parameter Type Required Description Example
id string true This is the unique ID of the vehicle. 29245REZ29RTYY54944

Object properties

Property Type Description
vin string This is the vin of the vehicle.
days integer Days remaining before the regular maintenance. If negative it means that the regular maintenance is expired since days.
mileage integer Kilometers remaining before the regular maintenance. If negative it means that the regular maintenance is expired since kilometers.

Errors

Error Code Meaning
404 There is no maintenance data on this vehicle.
403 The user don't have access to this car. Usually an error with the vehicle ID.
500 Internal server error. Sounds like there's a problem on the server. Take it easy, we're on it ;)

Get last events on a specific Vehicle

import http.client

conn = http.client.HTTPSConnection("api-preprod.groupe-psa.com")

headers = {
    'authorization': "Bearer VALID_BEARER_TOKEN",
    'accept': "application/hal+json"
    }

conn.request("GET", "/api/connectedcar/v2/vehicles/REPLACE_ID/events?client_id=REPLACE_THIS_KEY&since=REPLACE_THIS_VALUE&until=REPLACE_THIS_VALUE&limit=REPLACE_THIS_VALUE&offset=REPLACE_THIS_VALUE&locale=REPLACE_THIS_VALUE", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
// OkHttpClient from http://square.github.io/okhttp/

OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("https://api-preprod.groupe-psa.com/connectedcar/v2/vehicles/REPLACE_ID/events?client_id=REPLACE_THIS_KEY&since=REPLACE_THIS_VALUE&until=REPLACE_THIS_VALUE&limit=REPLACE_THIS_VALUE&offset=REPLACE_THIS_VALUE&locale=REPLACE_THIS_VALUE")
  .get()
  .addHeader("authorization", "Bearer VALID_BEARER_TOKEN")
  .addHeader("accept", "application/hal+json")
  .build();

Response response = client.newCall(request).execute();
import Foundation

let headers = [
  "authorization": "Bearer VALID_BEARER_TOKEN",
  "accept": "application/hal+json"
]

var request = NSMutableURLRequest(URL: NSURL(string: "https://api-preprod.groupe-psa.com/connectedcar/v2/vehicles/REPLACE_ID/events?client_id=REPLACE_THIS_KEY&since=REPLACE_THIS_VALUE&until=REPLACE_THIS_VALUE&limit=REPLACE_THIS_VALUE&offset=REPLACE_THIS_VALUE&locale=REPLACE_THIS_VALUE")!,
                                        cachePolicy: .UseProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.HTTPMethod = "GET"
request.allHTTPHeaderFields = headers

let session = NSURLSession.sharedSession()
let dataTask = session.dataTaskWithRequest(request, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error)
  } else {
    let httpResponse = response as? NSHTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()

> The above command returns JSON structured like this:

{
    "_links": {
        "self": {
            "href": "/vehicles/25D3D93E7319002612A80D6AD8B423FE/events?limit=2&offset=0"
        },
        "first": {
            "href": "/vehicles/25D3D93E7319002612A80D6AD8B423FE/events?limit=2&offset=0"
        },
        "next": {
            "href": "/vehicles/25D3D93E7319002612A80D6AD8B423FE/events?limit=2&offset=2"
        },
        "prev": {
            "href": "/vehicles/25D3D93E7319002612A80D6AD8B423FE/events?limit=2&offset=0"
        },
        "last": {
            "href": "/vehicles/25D3D93E7319002612A80D6AD8B423FE/events?limit=2&offset=182"
        }
    },
    "total": 184,
    "_embedded": {
        "events": [
            {
                "_links": {
                    "self": {
                        "href": "/collisions/25D3D93E7319002612A80D6AD8B423FE-909839383"
                    }
                },
                "id": "25D3D93E7319002612A80D6AD8B423FE-909839383",
                "type": "COLLISION",
                "eventId": "25D3D93E7319002612A80D6AD8B423FE-909839383",
                "createdAt": "2017-06-14T07:09:33.000Z",
                "updatedAt": "2017-06-14T07:09:33.000Z",
                "_embedded": {
                    "_links": {
                        "self": {
                            "href": "/collisions/25D3D93E7319002612A80D6AD8B423FE-909839383"
                        },
                        "vehicle": {
                            "href": "/vehicles/25D3D93E7319002612A80D6AD8B423FE"
                        },
                        "trip": {
                            "href": "unknown"
                        }
                    },
                    "id": "25D3D93E7319002612A80D6AD8B423FE-909839383",
                    "rollOver": false,
                    "rear": {
                        "level": "NONE"
                    },
                    "front": {
                        "level": "NONE"
                    },
                    "lateral": {
                        "level": "NONE"
                    },
                    "pedestrian": false,
                    "createdAt": "2017-06-14T07:09:33.000Z",
                    "updatedAt": "2017-06-14T07:09:33.000Z"
                }
            }
        ]
    }
}

This endPoint retrieves the last events for a vehicle. Events may be :

  • last trip
  • alert
  • collision
  • refuel detected
  • fuel stolen detected

HTTP Request

GET https://api-preprod.groupe-psa.com/connectedcar/v2/vehicles/{id}/events?client_id=REPLACE_THIS_KEY&since={date}&until={date}&limit={limit}&offset={offset}&locale={lang}

Query Parameters

Parameter Type Required Description Example
id string true This is the unique ID of the vehicle. 29245REZ29RTYY54944
since date false Returns events created after the given date. The date is a RFC3339 formated date. 2017-08-10T13:46:39.652+0000
until date false Returns events created before the given date. The date is a RFC3339 formated date. 2017-08-10T13:46:39.652+0000
limit integer false The limit parameter controls the maximum number of events that may be returned for a single request. This parameter can be thought of as the page size. If no limit is specified, the system defaults to a limit of 10 results per request. 2
offset integer false The offset parameter controls the starting Point within the collection of events results. For example, if you have a collection of 15 events to be retrieved and you specify limit=5, you can retrieve the entire set of results in 3 successive requests by varying the offset value: offset=0, offset=5, and offset=10. Note that the first event in the collection is retrieved by setting a zero offset. 5
locale enum false Language used for the alert's message. The available values are : fr, en. By default en is used. fr

Object properties

Errors

Error Code Meaning
404 There is no events found for this vehicle.
403 The user don't have access to the events for this vehicle. Usually an error with the vehicle ID.
500 Internal server error. Sounds like there's a problem on the server. Take it easy, we're on it ;)

Get last telemetry data for a specific vehicle

curl --request GET \
  --url 'https://api-preprod.groupe-psa.com/connectedcar/v2/vehicles/REPLACE_ID/telemetry?client_id=REPLACE_THIS_KEY&type=REPLACE_THIS_VALUE&since=REPLACE_THIS_VALUE&until=REPLACE_THIS_VALUE&limit=REPLACE_THIS_VALUE&offset=REPLACE_THIS_VALUE' \
  --header 'accept: application/hal+json' \
  --header 'authorization: Bearer REPLACE_BEARER_TOKEN' 
import http.client

conn = http.client.HTTPSConnection("api-preprod.groupe-psa.com")

headers = {
    'authorization': "Bearer REPLACE_BEARER_TOKEN",
    'accept': "application/hal+json"
    }

conn.request("GET", "/api/connectedcar/v2/vehicles/REPLACE_ID/telemetry?client_id=REPLACE_THIS_KEY&type=REPLACE_THIS_VALUE&since=REPLACE_THIS_VALUE&until=REPLACE_THIS_VALUE&limit=REPLACE_THIS_VALUE&offset=REPLACE_THIS_VALUE", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
// OkHttpClient from http://square.github.io/okhttp/

OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("https://api-preprod.groupe-psa.com/connectedcar/v2/vehicles/REPLACE_ID/telemetry?client_id=REPLACE_THIS_KEY&type=REPLACE_THIS_VALUE&since=REPLACE_THIS_VALUE&until=REPLACE_THIS_VALUE&limit=REPLACE_THIS_VALUE&offset=REPLACE_THIS_VALUE")
  .get()
  .addHeader("authorization", "Bearer REPLACE_BEARER_TOKEN")
  .addHeader("accept", "application/hal+json")
  .build();

Response response = client.newCall(request).execute();
import Foundation

let headers = [
  "authorization": "Bearer REPLACE_BEARER_TOKEN",
  "accept": "application/vnd.geo+json"
]

var request = NSMutableURLRequest(URL: NSURL(string: "https://api-preprod.groupe-psa.com/connectedcar/v2/vehicles/REPLACE_ID/lastPosition?client_id=REPLACE_THIS_KEY")!,
                                        cachePolicy: .UseProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.HTTPMethod = "GET"
request.allHTTPHeaderFields = headers

let session = NSURLSession.sharedSession()
let dataTask = session.dataTaskWithRequest(request, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error)
  } else {
    let httpResponse = response as? NSHTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()

> Make sure to replace YOUR_CLIENT_ID with your API key and VALID_BEARER_TOKEN by a valid bearer token. > The above command returns JSON structured like this:

{
    "_links": {
        "self": {
            "href": "/vehicles/25D3D93E7319002612A80D6AD8B423FE/telemetry?limit=60&offset=0"
        },
        "first": {
            "href": "/vehicles/25D3D93E7319002612A80D6AD8B423FE/telemetry?limit=60&offset=0"
        },
        "next": {
            "href": "/vehicles/25D3D93E7319002612A80D6AD8B423FE/telemetry?limit=60&offset=60"
        },
        "prev": {
            "href": "/vehicles/25D3D93E7319002612A80D6AD8B423FE/telemetry?limit=60&offset=0"
        },
        "last": {
            "href": "/vehicles/25D3D93E7319002612A80D6AD8B423FE/telemetry?limit=60&offset=120"
        }
    },
    "total": 60,
    "_embedded": {
        "telemetries": [
            {
                "_links": {
                    "self": {
                        "href": "/telemetry/25D3D93E7319002612A80D6AD8B423FE-909839383-20170614070933-39"
                    },
                    "vehicle": {
                        "href": "/vehicles/25D3D93E7319002612A80D6AD8B423FE"
                    }
                },
                "id": "25D3D93E7319002612A80D6AD8B423FE-909839383-20170614070933-39",
                "vehicle": {
                    "moving": true,
                    "brakingSystem": {
                        "status": "NOBRAKE",
                        "parking": true
                    },
                    "adas": {
                        "acc": "HOLDWITHOVERSPEEDING",
                        "lvv": true,
                        "rvv": "DISABLED",
                        "aebs": "FLASHING",
                        "afil": "FAULT",
                        "esp": true,
                        "abs": true,
                        "fse": true,
                        "sli": 4,
                        "lka": {
                            "right": "ENABLED",
                            "left": "ENABLED"
                        }
                    },
                    "acceleration": {
                        "longitudinal": 0
                    },
                    "lightingSystem": {
                        "signal": {
                            "turn": {
                                "left": true,
                                "right": true
                            }
                        }
                    }
                },
                "passenger": {
                    "seatbelt": {
                        "unbuckled": true
                    }
                },
                "environment": {
                    "luminosity": {
                        "day": true
                    }
                },
                "createdAt": "2017-06-14T07:10:11.000Z",
                "updatedAt": "2017-06-14T07:10:11.000Z"
            },
            {
                "_links": {
                    "self": {
                        "href": "/telemetry/25D3D93E7319002612A80D6AD8B423FE-909839383-20170614070933-10"
                    },
                    "vehicle": {
                        "href": "/vehicles/25D3D93E7319002612A80D6AD8B423FE"
                    }
                },
                "id": "25D3D93E7319002612A80D6AD8B423FE-909839383-20170614070933-10",
                "vehicle": {
                    "moving": true,
                    "engines": [
                        {
                            "speed": 800
                        }
                    ],
                    "fuel": {
                        "consumption": 65535
                    },
                    "brakingSystem": {
                        "status": "NOBRAKE",
                        "parking": true
                    },
                    "transmission": {
                        "gearbox": {
                            "gear": {
                                "recommended": "INVALID"
                            },
                            "mode": {
                                "automatic": true
                            }
                        }
                    },
                    "adas": {
                        "acc": "HOLDWITHOVERSPEEDING",
                        "lvv": true,
                        "rvv": "DISABLED",
                        "aebs": "FLASHING",
                        "afil": "FAULT",
                        "esp": true,
                        "abs": true,
                        "fse": true,
                        "sli": 4,
                        "lka": {
                            "right": "ENABLED",
                            "left": "ENABLED"
                        }
                    },
                    "acceleration": {
                        "longitudinal": 0
                    },
                    "lightingSystem": {
                        "signal": {
                            "turn": {
                                "left": true,
                                "right": true
                            }
                        }
                    }
                },
                "passenger": {
                    "seatbelt": {
                        "unbuckled": true
                    }
                },
                "environment": {
                    "luminosity": {
                        "day": true
                    },
                    "air": {
                        "temp": 0
                    }
                },
                "createdAt": "2017-06-14T07:09:33.000Z",
                "updatedAt": "2017-06-14T07:09:33.000Z"
            }
        ]
    }
}

Telemetry data came from various sensors in the car. You're able to get the telemetry data of the vehicle by making this request. When you call this ressource you will get an array on telemetry objects ordered by date off collect in descending order (the fresher data first). A telemetry object represent a second of data. Each telemetry object contains data collected during this second. You will only get the datas which where present at the moment of the collect. for example, the fuel autonomy is not available every second so you will get this value only in certain telemetry object.

When you cal this API you will receive by default the last 60 seconds of data. You are able to perform some searches applying filter on dates (since and until) and/or on properties. To filter telemetry data on properties, use the parameter type. It's an array of properties. Ex : ['vehicle.fuel.level']. By using this filter you will only get the fuel level of the car.

HTTP Request

GET https://api-preprod.groupe-psa.com/connectedcar/v2/vehicles/{id}/telemetry?client_id=REPLACE_THIS_KEY&since={date}&until={date}&limit={limit}&offset={offset}&type={type}

Query Parameters

Parameter Type Required Description Example
id string true This is the unique ID of the vehicle. 29245REZ29RTYY54944
since date false Returns telemetry objects created after the given date. The date is a RFC3339 formated date. 2017-08-10T13:46:39.652+0000
until date false Returns telemetry objects created before the given date. The date is a RFC3339 formated date. 2017-08-10T13:46:39.652+0000
limit integer false The limit parameter controls the maximum number of telemetry objects that may be returned for a single request. This parameter can be thought of as the page size. If no limit is specified, the system defaults to a limit of 60 results per request. 2
offset integer false The offset parameter controls the starting Point within the collection of telemetry results. For example, if you have a collection of 15 telemetry objects to be retrieved and you specify limit=5, you can retrieve the entire set of results in 3 successive requests by varying the offset value: offset=0, offset=5, and offset=10. Note that the first telemetry object in the collection is retrieved by setting a zero offset. 5
type array false type is an array of properties. Use the dot notation to specify properties. Eg. : vehicle.transmission.gearbox.mode.automatic

Object properties

Property Type Description
vehicle object This object contain
vehicle.odometer float Total mileage of the vehicle. Optional
vehicle.moving boolean True if the vehicle where moving at the moment of the data collection. Optional
vehicle.running boolean True if the vehicle is switch on. Optional
vehicle.engines array array of engines (in the future vehicle might have more than 1 engine (hybrid)). Optional
vehicle.engines[#].coolant object Optional
vehicle.engines[#].coolant.temp float Temperature of coolant in Celsius. Optional
vehicle.engines[#].oil object Optional
vehicle.engines[#].oil.temp float Oil temperature in Celsius. Optional
vehicle.engines[#].oil.level float Oil level in percent. Optional
vehicle.engines[#].speed float Engine speed in knots per minute. Optional
vehicle.engines[#].status enum Optional
vehicle.fuel object Optional
vehicle.fuel.level float Fuel level in percent. Optional
vehicle.fuel.consumption float Instant flue consumption in liters per kilometer. Optional
vehicle.fuel.autonomy float Vehicle’s autonomy in kilometers. Optional
vehicle.brakingSystem object Optional
vehicle.brakingSystem.status enum Optional
vehicle.brakingSystem.parking boolean True if parking break is set. Optional
vehicle.transmission object Optional
vehicle.transmission.gearbox object Optional
vehicle.transmission.gearbox.gear object Optional
vehicle.transmission.gearbox.gear.recommended enum Optional
vehicle.transmission.gearbox.mode object Optional
vehicle.transmission.gearbox.mode.automatic boolean True if the automatic gearbox is in automatic mode. False if it’s set in sequential mode. Optional
vehicle.transmission.gearbox.mode.sport boolean True is the sport mode of the automatic gearbox is set. Optional
vehicle.transmission.gearbox.mode.snow boolean True if the snowmode of the automatic gearbox is set. Optional
vehicle.adas object Optional
vehicle.adas.parkAssist object Optional
vehicle.adas.parkAssist.front enum Optional
vehicle.adas.parkAssist.rear enum Optional
vehicle.adas.acc enum Automatic Cruise Control. Optional
vehicle.adas.lvv enum Speed limit. Optional
vehicle.adas.rvv enum Speed regulator. Optional
vehicle.adas.aebs enum Optional
vehicle.adas.afil enum Optional
vehicle.adas.artiv enum Inter vehicle time. Optional
vehicle.adas.bsm enum Blind spot monitoring
vehicle.adas.esp enum Optional
vehicle.adas.abs enum Optional
vehicle.adas.fse enum Optional
vehicle.adas.sli enum Optional
vehicle.adas.lka object Line keep assist Optional
vehicle.adas.lka.right enum Optional
vehicle.adas.lka.left enum Optional
vehicle.acceleation object Optional
vehicle.acceleration.logitudinal float Optional
vehicle.lightingSystem object Optional
vehicle.lightingSystem.signal object Optional
vehicle.lightingSystem.signal.turn object Optional
vehicle.lightingSystem.signal.turn.left boolean Optional
vehicle.lightingSystem.signal.turn.right boolean Optional
vehicle.lightingSystem.foglight object Optional
vehicle.lightingSystem.foglight.front boolean Optional
vehicle.lightingSystem.foglight.rear boolean Optional
passenger object Optional
passenger.seatbelt object Optional
passenger.seatbelt.unbuckled boolean Optional
environment object Optional
environment.luminosity object Optional
environment.luminosity.day boolean Optional
environment.air object Optional
environment.air.temp float Optional
createdAt date
updatedAt date

Errors

Error Code Meaning
404 There is no telemetry found for this vehicle.
403 The user don't have access to the telemetry data for this vehicle. Usually an error with the vehicle ID.
500 Internal server error. Sounds like there's a problem on the server. Take it easy, we're on it ;)

Get last trips for a specific vehicle

curl --request GET \
  --url 'https://api-preprod.groupe-psa.com/connectedcar/v2/vehicles/REPLACE_ID/trips?client_id=REPLACE_THIS_KEY&since=REPLACE_THIS_VALUE&until=REPLACE_THIS_VALUE&limit=REPLACE_THIS_VALUE&offset=REPLACE_THIS_VALUE' \
  --header 'accept: application/hal+json' \
  --header 'authorization: Bearer REPLACE_BEARER_TOKEN' 
// OkHttpClient from http://square.github.io/okhttp/

OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("https://api-preprod.groupe-psa.com/connectedcar/v2/vehicles/REPLACE_ID/trips?client_id=REPLACE_THIS_KEY&since=REPLACE_THIS_VALUE&until=REPLACE_THIS_VALUE&limit=REPLACE_THIS_VALUE&offset=REPLACE_THIS_VALUE")
  .get()
  .addHeader("authorization", "Bearer REPLACE_BEARER_TOKEN")
  .addHeader("accept", "application/hal+json")
  .build();

Response response = client.newCall(request).execute();
import Foundation

let headers = [
  "authorization": "Bearer REPLACE_BEARER_TOKEN",
  "accept": "application/hal+json"
]

var request = NSMutableURLRequest(URL: NSURL(string: "https://api-preprod.groupe-psa.com/connectedcar/v2/vehicles/REPLACE_ID/trips?client_id=REPLACE_THIS_KEY&since=REPLACE_THIS_VALUE&until=REPLACE_THIS_VALUE&limit=REPLACE_THIS_VALUE&offset=REPLACE_THIS_VALUE")!,
                                        cachePolicy: .UseProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.HTTPMethod = "GET"
request.allHTTPHeaderFields = headers

let session = NSURLSession.sharedSession()
let dataTask = session.dataTaskWithRequest(request, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error)
  } else {
    let httpResponse = response as? NSHTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
import http.client

conn = http.client.HTTPSConnection("api-preprod.groupe-psa.com")

headers = {
    'authorization': "Bearer VALID_BEARER_TOKEN",
    'accept': "application/hal+json"
    }

conn.request("GET", "/api/connectedcar/v2/vehicles/REPLACE_ID/trips?client_id=REPLACE_THIS_KEY&since=REPLACE_THIS_VALUE&until=REPLACE_THIS_VALUE&limit=REPLACE_THIS_VALUE&offset=REPLACE_THIS_VALUE", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))

> Make sure to replace YOUR_CLIENT_ID with your API key and VALID_BEARER_TOKEN by a valid bearer token. > The above command returns JSON structured like this:

{
    "_links": {
        "self": {
            "href": "/vehicles/25D3D93E7319002612A80D6AD8B423FE/trips?limit=1&offset=0"
        },
        "first": {
            "href": "/vehicles/25D3D93E7319002612A80D6AD8B423FE/trips?limit=1&offset=0"
        },
        "next": {
            "href": "/vehicles/25D3D93E7319002612A80D6AD8B423FE/trips?limit=1&offset=10"
        },
        "prev": {
            "href": "/vehicles/25D3D93E7319002612A80D6AD8B423FE/trips?limit=1&offset=0"
        },
        "last": {
            "href": "/vehicles/25D3D93E7319002612A80D6AD8B423FE/trips?limit=1&offset=180"
        }
    },
    "total": 183,
    "_embedded": {
        "trips": [
            {
                "_links": {
                    "self": {
                        "href": "/trips/25D3D93E7319002612A80D6AD8B423FE-909839383-2910005"
                    },
                    "vehicle": {
                        "href": "/vehicles/25D3D93E7319002612A80D6AD8B423FE"
                    },
                    "ecodriving": {
                        "href": "/trips/25D3D93E7319002612A80D6AD8B423FE-909839383-2910005/ecodriving/"
                    },
                    "path": {
                        "href": "/trips/25D3D93E7319002612A80D6AD8B423FE-909839383-2910005/waypoints/"
                    },
                    "alerts": {
                        "href": "/trips/25D3D93E7319002612A80D6AD8B423FE-909839383-2910005/alerts/"
                    },
                    "collisions": {
                        "href": "/trips/25D3D93E7319002612A80D6AD8B423FE-909839383-2910005/collisions/"
                    }
                },
                "id": "25D3D93E7319002612A80D6AD8B423FE-909839383-2910005",
                "reference": true,
                "startedAt": "2017-02-09T18:42:42.000Z",
                "stoppedAt": "2017-02-09T18:43:35.000Z",
                "duration": "53",
                "distance": 0.700195,
                "fuelConsumption": 0.119995,
                "refueling": false,
                "avgConsumption": 17.1374,
                "avgSpeed": 55,
                "co2EmissionEstimated": -1,
                "createdAt": "2017-02-09T18:47:49.000Z",
                "updatedAt": "2017-02-09T18:42:55.000Z",
                "_embedded": {
                    "startPosition": {
                        "type": "Feature",
                        "geometry": {
                            "type": "Point",
                            "coordinates": [
                                48.92995,
                                2.00099,
                                67
                            ]
                        },
                        "properties": {
                            "updatedAt": "2017-02-09T18:42:42.000Z",
                            "createdAt": "2017-02-09T18:42:42.000Z",
                            "id": "25D3D93E7319002612A80D6AD8B423FE-909839383-20170209184242",
                            "heading": 260
                        }
                    },
                    "stopPosition": {
                        "type": "Feature",
                        "geometry": {
                            "type": "Point",
                            "coordinates": [
                                48.92995,
                                2.00099,
                                67
                            ]
                        },
                        "properties": {
                            "updatedAt": "2017-02-09T18:42:42.000Z",
                            "createdAt": "2017-02-09T18:42:42.000Z",
                            "id": "25D3D93E7319002612A80D6AD8B423FE-909839383-20170209184242",
                            "heading": 260
                        }
                    }
                }
            }
        ]
    }
}

HTTP Request

GET https://api-preprod.groupe-psa.com/connectedcar/v2/vehicles/{id}/trips?client_id=REPLACE_THIS_KEY&since={since}&until={until}&limit={limit}&offset={offset}

Query Parameters

Parameter Type Required Description Example
id string true This is the unique ID of the vehicle. 29245REZ29RTYY54944
since date false Returns trips created after the given date. The date is a RFC3339 formated date. 2017-08-10T13:46:39.652+0000
until date false Returns trips created before the given date. The date is a RFC3339 formated date. 2017-08-10T13:46:39.652+0000
limit integer false The limit parameter controls the maximum number of trips that may be returned for a single request. This parameter can be thought of as the page size. If no limit is specified, the system defaults to a limit of 10 results per request. 2
offset integer false The offset parameter controls the starting Point within the collection of trips results. For example, if you have a collection of 15 trips to be retrieved and you specify limit=5, you can retrieve the entire set of results in 3 successive requests by varying the offset value: offset=0, offset=5, and offset=10. Note that the first vehicle in the collection is retrieved by setting a zero offset. 5

Object properties

Property Type Description
id string This is the unique id of the trip.
reference boolean true if this trip is a reference trip. A reference trip is a favourite trip. This information can only be modified by the official application.
startedAt date Starting date of the trip. Ignition on
stoppedAt date Starting date of the trip. Ignition off
duration integer duration of the trip in seconds
distance integer duration of the trip in kilometers
fuelConsumption float fuel consumption during the trip. In liters.
refueling boolean true if the driver made a refuel just defore the trip.
avgConsumption float average fuel consumption during the trip. In liters per 100 km.
avgSpeed float average speed during the trip. In km per hour.
co2EmissionEstimated float CO2 emissions estimation for this trip.
createdAt date Date of collection of the trip.
updatedAt date Last update of the trip.

Errors

Error Code Meaning
404 There is no trips found for this vehicle.
403 The user don't have access to the trip informations for this vehicle. Usually an error with the vehicle ID.
500 Internal server error. Sounds like there's a problem on the server. Take it easy, we're on it ;)

Trips

Get last Trips

curl --request GET \
  --url 'https://api-preprod.groupe-psa.com/connectedcar/v2/trips?client_id=REPLACE_THIS_KEY&since=REPLACE_THIS_VALUE&until=REPLACE_THIS_VALUE&limit=REPLACE_THIS_VALUE&offset=REPLACE_THIS_VALUE' \
  --header 'accept: application/hal+json' \
  --header 'authorization: Bearer REPLACE_BEARER_TOKEN' 
// OkHttpClient from http://square.github.io/okhttp/

OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("https://api-preprod.groupe-psa.com/connectedcar/v2/trips?client_id=REPLACE_THIS_KEY&since=REPLACE_THIS_VALUE&until=REPLACE_THIS_VALUE&limit=REPLACE_THIS_VALUE&offset=REPLACE_THIS_VALUE")
  .get()
  .addHeader("authorization", "Bearer REPLACE_BEARER_TOKEN")
  .addHeader("accept", "application/hal+json")
  .build();

Response response = client.newCall(request).execute();
import Foundation

let headers = [
  "authorization": "Bearer REPLACE_BEARER_TOKEN",
  "accept": "application/hal+json"
]

var request = NSMutableURLRequest(URL: NSURL(string: "https://api-preprod.groupe-psa.com/connectedcar/v2/trips?client_id=REPLACE_THIS_KEY&since=REPLACE_THIS_VALUE&until=REPLACE_THIS_VALUE&limit=REPLACE_THIS_VALUE&offset=REPLACE_THIS_VALUE")!,
                                        cachePolicy: .UseProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.HTTPMethod = "GET"
request.allHTTPHeaderFields = headers

let session = NSURLSession.sharedSession()
let dataTask = session.dataTaskWithRequest(request, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error)
  } else {
    let httpResponse = response as? NSHTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
import http.client

conn = http.client.HTTPSConnection("api-preprod.groupe-psa.com")

headers = {
    'authorization': "Bearer VALID_BEARER_TOKEN",
    'accept': "application/hal+json"
    }

conn.request("GET", "/api/connectedcar/v2/trips?client_id=REPLACE_THIS_KEY&since=REPLACE_THIS_VALUE&until=REPLACE_THIS_VALUE&limit=REPLACE_THIS_VALUE&offset=REPLACE_THIS_VALUE", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))

> Make sure to replace YOUR_CLIENT_ID with your API key and VALID_BEARER_TOKEN by a valid bearer token. > The above command returns JSON structured like this:

{
    "_links": {
        "self": {
            "href": "/trips?limit=1&offset=0"
        },
        "first": {
            "href": "/trips?limit=1&offset=0"
        },
        "next": {
            "href": "/trips?limit=1&offset=1"
        },
        "prev": {
            "href": "/trips?limit=1&offset=0"
        },
        "last": {
            "href": "/trips?limit=1&offset=284"
        }
    },
    "total": 285,
    "_embedded": {
        "trips": [
            {
                "_links": {
                    "self": {
                        "href": "/trips/25D3D93E7319002612A80D6AD8B423FE-909839383-2910004"
                    },
                    "vehicle": {
                        "href": "/vehicles/25D3D93E7319002612A80D6AD8B423FE"
                    },
                    "ecodriving": {
                        "href": "/trips/25D3D93E7319002612A80D6AD8B423FE-909839383-2910004/ecodriving/"
                    },
                    "path": {
                        "href": "/trips/25D3D93E7319002612A80D6AD8B423FE-909839383-2910004/waypoints/"
                    },
                    "alerts": {
                        "href": "/trips/25D3D93E7319002612A80D6AD8B423FE-909839383-2910004/alerts/"
                    },
                    "collisions": {
                        "href": "/trips/25D3D93E7319002612A80D6AD8B423FE-909839383-2910004/collisions/"
                    }
                },
                "id": "25D3D93E7319002612A80D6AD8B423FE-909839383-2910004",
                "reference": true,
                "startedAt": "2017-02-09T18:34:47.000Z",
                "stoppedAt": "2017-02-09T18:42:42.000Z",
                "duration": "475",
                "distance": 4.3999,
                "fuelConsumption": 0.490021,
                "refueling": false,
                "avgConsumption": 11.1371,
                "avgSpeed": 41,
                "co2EmissionEstimated": -1,
                "createdAt": "2017-02-09T18:44:49.000Z",
                "updatedAt": "2017-02-09T18:42:02.000Z",
                "_embedded": {
                    "startPosition": {
                        "type": "Feature",
                        "geometry": {
                            "type": "Point",
                            "coordinates": [
                                48.92995,
                                2.00099,
                                67
                            ]
                        },
                        "properties": {
                            "updatedAt": "2017-02-09T18:42:42.000Z",
                            "createdAt": "2017-02-09T18:42:42.000Z",
                            "id": "25D3D93E7319002612A80D6AD8B423FE-909839383-20170209184242",
                            "heading": 260
                        }
                    },
                    "stopPosition": {
                        "type": "Feature",
                        "geometry": {
                            "type": "Point",
                            "coordinates": [
                                48.92995,
                                2.00099,
                                67
                            ]
                        },
                        "properties": {
                            "updatedAt": "2017-02-09T18:42:42.000Z",
                            "createdAt": "2017-02-09T18:42:42.000Z",
                            "id": "25D3D93E7319002612A80D6AD8B423FE-909839383-20170209184242",
                            "heading": 260
                        }
                    }
                }
            }
        ]
    }
}

This endPoint retrieves a specific vehicle.

HTTP Request

GET https://api-preprod.groupe-psa.com/connectedcar/v2/trips?client_id=REPLACE_THIS_KEY&since={since}&until={until}&limit={limit}&offset={offset}

Query Parameters

Parameter Type Required Description Example
since date false Returns trips created after the given date. The date is a RFC3339 formated date. 2017-08-10T13:46:39.652+0000
until date false Returns trips created before the given date. The date is a RFC3339 formated date. 2017-08-10T13:46:39.652+0000
limit integer false The limit parameter controls the maximum number of trips that may be returned for a single request. This parameter can be thought of as the page size. If no limit is specified, the system defaults to a limit of 10 results per request. 2
offset integer false The offset parameter controls the starting Point within the collection of trips results. For example, if you have a collection of 15 trips to be retrieved and you specify limit=5, you can retrieve the entire set of results in 3 successive requests by varying the offset value: offset=0, offset=5, and offset=10. Note that the first vehicle in the collection is retrieved by setting a zero offset. 5

Object properties

Property Type Description
id string This is the unique id of the trip.
reference boolean true if this trip is a reference trip. A reference trip is a favourite trip. This information can only be modified by the official application.
startedAt date Starting date of the trip. Ignition on
stoppedAt date Starting date of the trip. Ignition off
duration integer duration of the trip in seconds
distance integer duration of the trip in kilometers
fuelConsumption float fuel consumption during the trip. In liters.
refueling boolean true if the driver made a refuel just defore the trip.
avgConsumption float average fuel consumption during the trip. In liters per 100 km.
avgSpeed float average speed during the trip. In km per hour.
co2EmissionEstimated float CO2 emissions estimation for this trip.
createdAt date Date of collection of the trip.
updatedAt date Last update of the trip.

Errors

Error Code Meaning
404 There is no vehicle with this idon the database.
403 The user don't have access to this car. Usually an error with the vehicle ID.
500 Internal server error. Sounds like there's a problem on the server. Take it easy, we're on it ;)

Get a specific trip

curl --request GET \
  --url 'https://api-preprod.groupe-psa.com/connectedcar/v2/trips/REPLACE_TRIP_ID?client_id=REPLACE_THIS_KEY' \
  --header 'accept: application/hal+json' \
  --header 'authorization: Bearer REPLACE_BEARER_TOKEN' 
// OkHttpClient from http://square.github.io/okhttp/

OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("https://api-preprod.groupe-psa.com/connectedcar/v2/trips/REPLACE_TRIP_ID?client_id=REPLACE_THIS_KEY")
  .get()
  .addHeader("authorization", "Bearer REPLACE_BEARER_TOKEN")
  .addHeader("accept", "application/hal+json")
  .build();

Response response = client.newCall(request).execute();
import Foundation

let headers = [
  "authorization": "Bearer REPLACE_BEARER_TOKEN",
  "accept": "application/hal+json"
]

var request = NSMutableURLRequest(URL: NSURL(string: "https://api-preprod.groupe-psa.com/connectedcar/v2/trips/REPLACE_TRIP_ID?client_id=REPLACE_THIS_KEY")!,
                                        cachePolicy: .UseProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.HTTPMethod = "GET"
request.allHTTPHeaderFields = headers

let session = NSURLSession.sharedSession()
let dataTask = session.dataTaskWithRequest(request, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error)
  } else {
    let httpResponse = response as? NSHTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
import http.client

conn = http.client.HTTPSConnection("api-preprod.groupe-psa.com")

headers = {
    'authorization': "Bearer VALID_BEARER_TOKEN",
    'accept': "application/hal+json"
    }

conn.request("GET", "/api/connectedcar/v2/trips/REPLACE_TRIP_ID?client_id=REPLACE_THIS_KEY", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))

> Make sure to replace YOUR_CLIENT_ID with your API key and VALID_BEARER_TOKEN by a valid bearer token. > The above command returns JSON structured like this:

{
    "_links": {
        "self": {
            "href": "/trips/25D3D93E7319002612A80D6AD8B423FE-909839383-2910004"
        },
        "vehicle": {
            "href": "/vehicles/25D3D93E7319002612A80D6AD8B423FE"
        },
        "ecodriving": {
            "href": "/trips/25D3D93E7319002612A80D6AD8B423FE-909839383-2910004/ecodriving/"
        },
        "path": {
            "href": "/trips/25D3D93E7319002612A80D6AD8B423FE-909839383-2910004/waypoints/"
        },
        "alerts": {
            "href": "/trips/25D3D93E7319002612A80D6AD8B423FE-909839383-2910004/alerts/"
        },
        "collisions": {
            "href": "/trips/25D3D93E7319002612A80D6AD8B423FE-909839383-2910004/collisions/"
        }
    },
    "id": "25D3D93E7319002612A80D6AD8B423FE-909839383-2910004",
    "reference": true,
    "startedAt": "2017-02-09T18:34:47.000Z",
    "stoppedAt": "2017-02-09T18:42:42.000Z",
    "duration": "475",
    "distance": 4.3999,
    "fuelConsumption": 0.490021,
    "refueling": false,
    "avgConsumption": 11.1371,
    "avgSpeed": 41,
    "co2EmissionEstimated": -1,
    "createdAt": "unknown",
    "updatedAt": "2017-02-09T18:42:02.000Z",
    "_embedded": {
        "startPosition": {
            "type": "Feature",
            "geometry": {
                "type": "Point",
                "coordinates": [
                    48.92995,
                    2.00099,
                    67
                ]
            },
            "properties": {
                "updatedAt": "2017-02-09T18:42:42.000Z",
                "createdAt": "2017-02-09T18:42:42.000Z",
                "id": "25D3D93E7319002612A80D6AD8B423FE-909839383-20170209184242",
                "heading": 260
            }
        },
        "stopPosition": {
            "type": "Feature",
            "geometry": {
                "type": "Point",
                "coordinates": [
                    48.92995,
                    2.00099,
                    67
                ]
            },
            "properties": {
                "updatedAt": "2017-02-09T18:42:42.000Z",
                "createdAt": "2017-02-09T18:42:42.000Z",
                "id": "25D3D93E7319002612A80D6AD8B423FE-909839383-20170209184242",
                "heading": 260
            }
        }
    }
}

This endPoint retrieves a specific vehicle.

HTTP Request

GET https://api-preprod.groupe-psa.com/connectedcar/v2/trips/{id}?client_id=REPLACE_THIS_KEY

Query Parameters

Parameter Type Required Description Example
id string true This is the unique ID of the trip. 29245REZ29RTYY54944

Object properties

Property Type Description
id string Unique id of the trip

Errors

Error Code Meaning
404 There is no trip with this id on the database.
403 The user don't have access to this trip. Usually an error with the trip ID.
500 Internal server error. Sounds like there's a problem on the server. Take it easy, we're on it ;)

Get collisions for a specific trip

curl --request GET \
  --url 'https://api-preprod.groupe-psa.com/connectedcar/v2/trips/REPLACE_ID/collisions?client_id=REPLACE_THIS_KEY' \
  --header 'accept: application/hal+json' \
  --header 'authorization: Bearer REPLACE_BEARER_TOKEN' 
// OkHttpClient from http://square.github.io/okhttp/

OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("https://api-preprod.groupe-psa.com/connectedcar/v2/trips/REPLACE_ID/collisions?client_id=REPLACE_THIS_KEY")
  .get()
  .addHeader("authorization", "Bearer REPLACE_BEARER_TOKEN")
  .addHeader("accept", "application/hal+json")
  .build();

Response response = client.newCall(request).execute();
import Foundation

let headers = [
  "authorization": "Bearer REPLACE_BEARER_TOKEN",
  "accept": "application/hal+json"
]

var request = NSMutableURLRequest(URL: NSURL(string: "https://api-preprod.groupe-psa.com/connectedcar/v2/trips/REPLACE_ID/collisions?client_id=REPLACE_THIS_KEY")!,
                                        cachePolicy: .UseProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.HTTPMethod = "GET"
request.allHTTPHeaderFields = headers

let session = NSURLSession.sharedSession()
let dataTask = session.dataTaskWithRequest(request, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error)
  } else {
    let httpResponse = response as? NSHTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
import http.client

conn = http.client.HTTPSConnection("api-preprod.groupe-psa.com")

headers = {
    'authorization': "Bearer VALID_BEARER_TOKEN",
    'accept': "application/hal+json"
    }

conn.request("GET", "/api/connectedcar/v2/trips/REPLACE_ID/collisions?client_id=REPLACE_THIS_KEY", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))

> Make sure to replace YOUR_CLIENT_ID with your API key and VALID_BEARER_TOKEN by a valid bearer token. > The above command returns JSON structured like this:

{
    "_links": {
        "self": {
            "href": "/trips/25D3D93E7319002612A80D6AD8B423FE-909839383-2910004/collisions?limit=10&offset=0"
        },
        "first": {
            "href": "/trips/25D3D93E7319002612A80D6AD8B423FE-909839383-2910004/collisions?limit=10&offset=0"
        },
        "next": {
            "href": "/trips/25D3D93E7319002612A80D6AD8B423FE-909839383-2910004/collisions?limit=10&offset=0"
        },
        "prev": {
            "href": "/trips/25D3D93E7319002612A80D6AD8B423FE-909839383-2910004/collisions?limit=10&offset=0"
        },
        "last": {
            "href": "/trips/25D3D93E7319002612A80D6AD8B423FE-909839383-2910004/collisions?limit=10&offset=0"
        }
    },
    "total": 0,
    "_embedded": {
        "collisions": []
    }
}

This endPoint retrieves collisions (if any) for a specific trip.

HTTP Request

GET https://api-preprod.groupe-psa.com/connectedcar/v2/trips/REPLACE_ID/collisions?client_id=REPLACE_THIS_KEY

Query Parameters

Parameter Type Required Description Example
id string true This is the unique ID of the trip. 29245REZ29RTYY54944

Object properties

Property Type Description
id string Unique id of the collision

Errors

Error Code Meaning
404 There is no collisions in the trip referenced by id on the database.
403 The user don't have access to this trip. Usually an error with the trip ID.
500 Internal server error. Sounds like there's a problem on the server. Take it easy, we're on it ;)

Get alerts for a specific trip

curl --request GET \
  --url 'https://api-preprod.groupe-psa.com/connectedcar/v2/trips/REPLACE_ID/alerts?client_id=REPLACE_THIS_KEY' \
  --header 'accept: application/hal+json' \
  --header 'authorization: Bearer REPLACE_BEARER_TOKEN' 
// OkHttpClient from http://square.github.io/okhttp/

OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("https://api-preprod.groupe-psa.com/connectedcar/v2/trips/REPLACE_ID/alerts?client_id=REPLACE_THIS_KEY")
  .get()
  .addHeader("authorization", "Bearer REPLACE_BEARER_TOKEN")
  .addHeader("accept", "application/hal+json")
  .build();

Response response = client.newCall(request).execute();
import Foundation

let headers = [
  "authorization": "Bearer REPLACE_BEARER_TOKEN",
  "accept": "application/hal+json"
]

var request = NSMutableURLRequest(URL: NSURL(string: "https://api-preprod.groupe-psa.com/connectedcar/v2/trips/REPLACE_ID/alerts?client_id=REPLACE_THIS_KEY")!,
                                        cachePolicy: .UseProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.HTTPMethod = "GET"
request.allHTTPHeaderFields = headers

let session = NSURLSession.sharedSession()
let dataTask = session.dataTaskWithRequest(request, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error)
  } else {
    let httpResponse = response as? NSHTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
import http.client

conn = http.client.HTTPSConnection("api-preprod.groupe-psa.com")

headers = {
    'authorization': "Bearer VALID_BEARER_TOKEN",
    'accept': "application/hal+json"
    }

conn.request("GET", "/api/connectedcar/v2/trips/REPLACE_ID/alerts?client_id=REPLACE_THIS_KEY", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))

> Make sure to replace YOUR_CLIENT_ID with your API key and VALID_BEARER_TOKEN by a valid bearer token. > The above command returns JSON structured like this:

{
    "_links": {
        "self": {
            "href": "/trips/25D3D93E7319002612A80D6AD8B423FE-909839383-2910004/alerts?limit=10&offset=0&locale=en_US"
        },
        "first": {
            "href": "/trips/25D3D93E7319002612A80D6AD8B423FE-909839383-2910004/alerts?limit=10&offset=0&locale=en_US"
        },
        "next": {
            "href": "/trips/25D3D93E7319002612A80D6AD8B423FE-909839383-2910004/alerts?limit=10&offset=0&locale=en_US"
        },
        "prev": {
            "href": "/trips/25D3D93E7319002612A80D6AD8B423FE-909839383-2910004/alerts?limit=10&offset=0&locale=en_US"
        },
        "last": {
            "href": "/trips/25D3D93E7319002612A80D6AD8B423FE-909839383-2910004/alerts?limit=10&offset=0&locale=en_US"
        }
    },
    "total": 0,
    "_embedded": {
        "alerts": []
    }
}

This endPoint retrieves a alerts on a specific trip.

HTTP Request

GET https://api-preprod.groupe-psa.com/connectedcar/v2/trips/{id}/alerts?client_id=REPLACE_THIS_KEY

Query Parameters

Parameter Type Required Description Example
id string true This is the unique ID of the trip. 29245REZ29RTYY54944

Object properties

Property Type Description
id string Unique id of the alert

Errors

Error Code Meaning
404 There is no vehicle with this idon the database.
403 The user don't have access to this car. Usually an error with the vehicle ID.
500 Internal server error. Sounds like there's a problem on the server. Take it easy, we're on it ;)

Get Ecodriving evaluation for a specific trip

curl --request GET \
  --url 'https://api-preprod.groupe-psa.com/connectedcar/v2/trips/REPLACE_ID/ecodriving?client_id=REPLACE_THIS_KEY' \
  --header 'accept: application/hal+json' \
  --header 'authorization: Bearer REPLACE_BEARER_TOKEN'
// OkHttpClient from http://square.github.io/okhttp/

OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("https://api-preprod.groupe-psa.com/connectedcar/v2/trips/REPLACE_ID/ecodriving?client_id=REPLACE_THIS_KEY")
  .get()
  .addHeader("authorization", "Bearer REPLACE_BEARER_TOKEN")
  .addHeader("accept", "application/hal+json")
  .build();

Response response = client.newCall(request).execute();
import Foundation

let headers = [
  "authorization": "Bearer REPLACE_BEARER_TOKEN",
  "accept": "application/hal+json"
]

var request = NSMutableURLRequest(URL: NSURL(string: "https://api-preprod.groupe-psa.com/connectedcar/v2/trips/REPLACE_ID/ecodriving?client_id=REPLACE_THIS_KEY")!,
                                        cachePolicy: .UseProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.HTTPMethod = "GET"
request.allHTTPHeaderFields = headers

let session = NSURLSession.sharedSession()
let dataTask = session.dataTaskWithRequest(request, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error)
  } else {
    let httpResponse = response as? NSHTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
import http.client

conn = http.client.HTTPSConnection("api-preprod.groupe-psa.com")

headers = {
    'authorization': "Bearer VALID_BEARER_TOKEN",
    'accept': "application/hal+json"
    }

conn.request("GET", "https://api-preprod.groupe-psa.com/connectedcar/v2/trips/REPLACE_ID/ecodriving?client_id=REPLACE_THIS_KEY", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))

> Make sure to replace YOUR_CLIENT_ID with your API key and VALID_BEARER_TOKEN by a valid bearer token. > The above command returns JSON structured like this:

{
    "_links": {
        "self": {
            "href": "ecodrivings/25D3D93E7319002612A80D6AD8B423FE-909839383-2910002"
        },
        "vehicle": {
            "href": "vehicles/25D3D93E7319002612A80D6AD8B423FE"
        },
        "trip": {
            "href": "trips/25D3D93E7319002612A80D6AD8B423FE-909839383-29100022910002"
        }
    },
    "id": "25D3D93E7319002612A80D6AD8B423FE-909839383-2910002",
    "global": {
        "trend": {
            "score": 3.9735066890716552734375,
            "evaluation": "",
            "advice": "",
            "category": "",
            "label": ""
        },
        "style": {
            "score": 3.766335010528564453125,
            "evaluation": "",
            "advice": "",
            "category": "",
            "label": ""
        },
        "road": {
            "score": 4.1116580963134765625,
            "evaluation": "",
            "advice": "",
            "category": "",
            "label": ""
        }
    },
    "detailed": {
        "acceleration": {
            "score": 4.081346988677978515625,
            "evaluation": "",
            "advice": "",
            "category": "",
            "label": ""
        },
        "braking": {
            "score": 3.9126796722412109375,
            "evaluation": "",
            "advice": "",
            "category": "",
            "label": ""
        },
        "engineSpeed": {
            "score": 2.8676488399505615234375,
            "evaluation": "",
            "advice": "",
            "category": "",
            "label": ""
        },
        "stopAndStart": {
            "score": 999999,
            "evaluation": "",
            "advice": "",
            "category": "",
            "label": ""
        },
        "speed": {
            "score": 3.5033519268035888671875,
            "evaluation": "",
            "advice": "",
            "category": "",
            "label": ""
        },
        "slope": {
            "score": 9.18329620361328125,
            "evaluation": "",
            "advice": "",
            "category": "",
            "label": ""
        },
        "coldTrips": {
            "score": 8.62007904052734375,
            "evaluation": "",
            "advice": "",
            "category": "",
            "label": ""
        }
    }
}

This endPoint retrieves an evaluation of the trip.

HTTP Request

GET https://api-preprod.groupe-psa.com/connectedcar/v2/trips/{id}/ecodriving?client_id=REPLACE_THIS_KEY

Query Parameters

Parameter Type Required Description Example
id string true This is the unique ID of the trip. 29245REZ29RTYY54944

Object properties

Property Type Description
id string Unique id of the vehicle

Errors

Error Code Meaning
404 There is no vehicle with this idon the database.
403 The user don't have access to this car. Usually an error with the vehicle ID.
500 Internal server error. Sounds like there's a problem on the server. Take it easy, we're on it ;)

Get telemetry data for a specific trip

curl --request GET \
  --url 'https://api-preprod.groupe-psa.com/connectedcar/v2/trips/REPLACE_ID/telemetry?client_id=REPLACE_THIS_KEY&type=REPLACE_THIS_VALUE&since=REPLACE_THIS_VALUE&until=REPLACE_THIS_VALUE&limit=REPLACE_THIS_VALUE&offset=REPLACE_THIS_VALUE' \
  --header 'accept: application/hal+json' \
  --header 'authorization: Bearer REPLACE_BEARER_TOKEN' 
// OkHttpClient from http://square.github.io/okhttp/

OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("https://api-preprod.groupe-psa.com/connectedcar/v2/trips/REPLACE_ID/telemetry?client_id=REPLACE_THIS_KEY&type=REPLACE_THIS_VALUE&since=REPLACE_THIS_VALUE&until=REPLACE_THIS_VALUE&limit=REPLACE_THIS_VALUE&offset=REPLACE_THIS_VALUE")
  .get()
  .addHeader("authorization", "Bearer REPLACE_BEARER_TOKEN")
  .addHeader("accept", "application/hal+json")
  .build();

Response response = client.newCall(request).execute();
import Foundation

let headers = [
  "authorization": "Bearer REPLACE_BEARER_TOKEN",
  "accept": "application/hal+json"
]

var request = NSMutableURLRequest(URL: NSURL(string: "https://api-preprod.groupe-psa.com/connectedcar/v2/trips/REPLACE_ID/telemetry?client_id=REPLACE_THIS_KEY&type=REPLACE_THIS_VALUE&since=REPLACE_THIS_VALUE&until=REPLACE_THIS_VALUE&limit=REPLACE_THIS_VALUE&offset=REPLACE_THIS_VALUE")!,
                                        cachePolicy: .UseProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.HTTPMethod = "GET"
request.allHTTPHeaderFields = headers

let session = NSURLSession.sharedSession()
let dataTask = session.dataTaskWithRequest(request, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error)
  } else {
    let httpResponse = response as? NSHTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
import http.client

conn = http.client.HTTPSConnection("api-preprod.groupe-psa.com")

headers = {
    'authorization': "Bearer VALID_BEARER_TOKEN",
    'accept': "application/hal+json"
    }

conn.request("GET", "/api/connectedcar/v2/trips/REPLACE_ID/telemetry?client_id=REPLACE_THIS_KEY&type=REPLACE_THIS_VALUE&since=REPLACE_THIS_VALUE&until=REPLACE_THIS_VALUE&limit=REPLACE_THIS_VALUE&offset=REPLACE_THIS_VALUE", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))

> Make sure to replace YOUR_CLIENT_ID with your API key and VALID_BEARER_TOKEN by a valid bearer token. > The above command returns JSON structured like this:


This endPoint retrieves a specific vehicle.

HTTP Request

GET https://api-preprod.groupe-psa.com/connectedcar/v2/trips/REPLACE_ID/telemetry?client_id=REPLACE_THIS_KEY&type=REPLACE_THIS_VALUE&since=REPLACE_THIS_VALUE&until=REPLACE_THIS_VALUE&limit=REPLACE_THIS_VALUE&offset=REPLACE_THIS_VALUE

Query Parameters

Parameter Type Required Description Example
id string true This is the unique ID of the vehicle. 29245REZ29RTYY54944

Object properties

Property Type Description
id string Unique id of the vehicle

Errors

Error Code Meaning
404 There is no vehicle with this idon the database.
403 The user don't have access to this car. Usually an error with the vehicle ID.
500 Internal server error. Sounds like there's a problem on the server. Take it easy, we're on it ;)

Get wayPoint for a specific trip

import http.client

conn = http.client.HTTPSConnection("api-preprod.groupe-psa.com")

headers = {
    'authorization': "Bearer VALID_BEARER_TOKEN",
    'accept': "application/hal+json"
    }

conn.request("GET", "/api/connectedcar/v2/trips/REPLACE_ID/wayPoints?client_id=REPLACE_THIS_KEY&limit=REPLACE_THIS_VALUE&offset=REPLACE_THIS_VALUE", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
// OkHttpClient from http://square.github.io/okhttp/

OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("https://api-preprod.groupe-psa.com/connectedcar/v2/trips/REPLACE_ID/wayPoints?client_id=REPLACE_THIS_KEY&limit=REPLACE_THIS_VALUE&offset=REPLACE_THIS_VALUE")
  .get()
  .addHeader("authorization", "Bearer VALID_BEARER_TOKEN")
  .addHeader("accept", "application/hal+json")
  .build();

Response response = client.newCall(request).execute();
Property Type Description
id string Unique id of the trip
reference boolean Indicate if the trip is mark by the user as reference. This operation is done with the MyPeugeot, MyCitroen or MsDS application.
startedAt date
stoppedAt date
duration string
distance float Distance of the trip in km
fuelConsumption float
refueling boolean True if the user have refuel the vehiclewhen starting the trip.
avgConsumption float
avgSpeed float
co2EmissionEstimated float
createdAt date
updatedAt date

Collisions

Get informations on a specific collision

Property Type Description
id string Unique id of the event.
rollOver boolean True if the vehicle made a roll over during crash Optional
rear object Optional
rear.level string
front object Optional
front.level string
lateral object Optional
lateral.level string
pedestrian boolean True if a collision with a pedestrian is detected Optional
createdAt date Date of the event
updatedAt date

External tools and code examples

We've created some tutorials and code examples you can freely use and redistribute. We're hosting this material on github. Feel free to contribute !

On this repo you will also find collections for Postman to easely make API calls. If you want another tool feel free to let us know in Github and we will studdy your request.

Thank you very much for using our technology. We really appreciate :)

The # PG4D Team.

0
No votes yet

Eligibility API (2.3.1)

2.3.1 : changing cloudpsa to psa-cloud
````
0
No votes yet

PSA Vehicle Tracker (1.1.1)

    1.1.1 : updated backend URL for production
    1.1.0 : updated backend URL for production
    1.0.1 : updated backend URL for dev
    1.0.0 : initial release