WEB API

for fleet owner

Quick Start

    EXAMPLES #

    This Quick Start contains examples of curl requests to Groupe PSA’s web api for Fleet Owners. These examples will show you how to deal with single objects, collections, geo-json objects and an example of POST and DELETE HTTP request.

    To retrieve authentication information refer to this section.

    GET YOUR INFO #

    Web API base endpoint ‘/fleets’ allow you to retrieve info about your account in Groupe PSA’s Network.

    $ curl \
      --request GET \
      --url 'https://api-cert.groupe-psa.com/connectedcar/{version}/fleets?client_id=<client_id>' \
      --cert 'path/to/client_cert.pem[:<cert_password>]'
      --key 'path/to/key.pem'
      --cacert 'path/to/ca_cert.pem'
      --header 'Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==' \
      --header 'Accept: application/hal+json' \ 
    

    {version} depends on your subscription:

    • v2: delegation publique
    • v3: connected fleet / TMTS / UBI

    GET A LIST OF VEHICLES #

    The ‘/fleets/{fid}/vehicles’ endpoint allow you to retrieve a list of your vehicles.

    See preview for explanation about indexRange and pageSize.

    $ curl \
      --request GET \
      --url 'https://api-cert.groupe-psa.com/connectedcar/{version}/fleets/{fid}/vehicles?client_id=<client_id>&indexRange=<element_per_page>&pageSize=<nb_of_pages>' \
      --cert 'path/to/client_cert.pem[:<cert_password>]'
      --key 'path/to/key.pem'
      --cacert 'path/to/ca_cert.pem'
      --header 'Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==' \
      --header 'Accept: application/hal+json' \ 
    

    GET A VEHICLE POSITION #

    The ‘/fleets/{fid}/vehicles/{id}/lastPosition’ endpoint allow you to retrieve the last known position for a vehicle.

    Note that the ‘Accept’ header is not --header 'Accept: application/hal+json' but Accept: application/vnd.geo+json.

    $ curl \
      --request GET \
      --url 'https://api-cert.groupe-psa.com/connectedcar/{version}/fleets/{fid}/vehicles/{id}/lastPosition?client_id=<client_id>' \
      --cert 'path/to/client_cert.pem[:<cert_password>]'
      --key 'path/to/key.pem'
      --cacert 'path/to/ca_cert.pem'
      --header 'Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==' \
      --header 'Accept: application/vnd.geo+json' \
    

    GET ALERTS OF A VEHICLE #

    The ‘/fleets/{fid}/vehicles/{id}/alerts’ endpoint allow you to retrieve a list of alerts for a vehicle.

    • Path parameter {id} is the unique identifier of one of your vehicles.
    • Query parameter locale will change the language of the alert message.
    $ curl \
      --request GET \
      --url 'https://api-cert.groupe-psa.com/connectedcar/{version}/fleets/{fid}/vehicles/{id}/alerts?client_id=<client_id>&indexRange=<element_per_page>&pageSize=<nb_of_pages>&locale=<language>' \
      --cert 'path/to/client_cert.pem[:<cert_password>]'
      --key 'path/to/key.pem'
      --cacert 'path/to/ca_cert.pem'
      --header 'Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==' \
      --header 'Accept: application/hal+json' \ 
    

    POST NEW MONITOR #

    The ‘/fleets/{fid}/monitors’ endpoint allow you to create a new monitor. Have a look to the monitor section

    $ curl \
      --request POST \
      --url 'https://api-cert.groupe-psa.com/connectedcar/{version}/fleets/{fid}/monitors?client_id=<client_id>' \
      --cert 'path/to/client_cert.pem[:<cert_password>]'
      --key 'path/to/key.pem'
      --cacert 'path/to/ca_cert.pem'
      --header 'Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==' \
      --header 'Accept: application/hal+json' \ 
      --header 'Content-type: application/json' \
      --data '<HTTP_body>' \
    

    Where <HTTP_body> is:

    {
       "label":"IDF Zone monitor With Data Triggering:[vehicle.energy.electric.level] OR on Mondays",
       "subscribeParam":{
          "refreshEvent":600,
          "retryPolicy":{
             "policy":"Always",
             "maxRetryNumber":3,
             "retryDelay":120
          },
          "batchNotify":{
             "size":10,
             "timeWindow":300
          },
          "callback":{
             "target":"http://my.dn/monitors/cb1",
             "name":"HTTP_CB",
             "attributes":[
                {
                   "type":"Query",
                   "key":"vin",
                   "value":"$vin"
                },
                {
                   "type":"Header",
                   "key":"Authorization",
                   "value":"Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ=="
                }
             ]
          }
       },
       "extendedEventParam":[
          "vehicle.alerts",
          "vehicle.status"
       ],
       "triggerParam":{
          "triggers": [
          {
             "name": "outOfParis",
             "zone": {
                "transition": "Out",
                "circle": {
                   "radius": 20,
                   "center": {
                   "longitude": 2.333333,
                   "latitude": 48.866667
                   }
                }
             },
             "name": "onMonday",
             "time": {
                "times": [
                   {
                   "recurrence": "Daily",
                   "start": "PT14H30M",
                   "occurence": {
                      "day": [
                         "Mon"
                      ]
                   },
                   "duration": "PT04H30M"
                 }
                ],
                "time.zone": "Europe/Paris"
             },
             "name": "batteryIsLow",
             "data": {
              "data": "vehicle.energy.electric.level",
              "op": "lowerThan",
              "value": [
                "50"
                ]
            }
          }
        ],
        "bool.exp": "((outOfParis & (batteryIsLow | onMonday)"
      }
    }
    

    DELETE A MONITOR #

    The ‘/fleets/{fid}/monitors/{mid}’ endpoint allow you to retrieve a list of alerts for a vehicle.

    • Path parameter {id} is the unique identifier of one of your vehicles.
    • Query parameter locale will change the language of the alert message.
    $ curl \
      --request DELETE \
      --url 'https://api-cert.groupe-psa.com/connectedcar/{version}/fleets/{fid}/monitors/{mid}?client_id=<client_id>&indexRange=<element_per_page>&pageSize=<nb_of_pages>&locale=<language>' \
      --cert 'path/to/client_cert.pem[:<cert_password>]'
      --key 'path/to/key.pem'
      --cacert 'path/to/ca_cert.pem'
      --header 'Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==' \
      --header 'Accept: application/hal+json' \ 
    

    SEE ALSO #

    TRY OUT!

    Retrieve all reference of this API, go to the API List.

    AUTHENTICATION

    Groupe PSA’s web API for fleet owner utilizes mutual authentication. Follow this step-by-step tutorial and obtain your own certificate.