WEB API

for fleet owner

    Quickstart - Examples

    Note: Stellantis Fleet Owner API for ex Groupe PSA brands (Citroën, DS, Peugeot, Opel and Vauxhall) are made for business partners owning fleet of vehicles. If you are looking for end-user API please look at this.

    Examples #

    This Quick Start contains examples of curl requests to Stellantis Fleet Owners API for ex Groupe PSA brands (Citroën, DS, Peugeot, Opel and Vauxhall). 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 Stellantis’s Network.

    1
    2
    3
    4
    5
    6
    7
    8
    
    $ 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 standards for explanation about indexRange and pageSize.

    1
    2
    3
    4
    5
    6
    7
    8
    
    $ 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.

    1
    2
    3
    4
    5
    6
    7
    8
    
    $ 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.
    1
    2
    3
    4
    5
    6
    7
    8
    
    $ 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

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    
    $ 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:

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    
    {
       "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.
    1
    2
    3
    4
    5
    6
    7
    8
    
    $ 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.

    Tutorial

    A Quick Start guide is provided to help you understand the basics and get started.