WEB API

for end-users

Quick Start

    EXAMPLES #

    This Quick Start contains examples of curl requests to Groupe PSA’s web api for End-Users. 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 connection information refer to this section.

    GET YOUR INFO #

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

    $ curl \
      --request GET \
      --url 'https://api.groupe-psa.com/connectedcar/v4/user?client_id=<client_id>' \
      --header 'Authorization: Bearer <access_token>' \
      --header 'x-introspect-realm: <realm>' 
      --header 'Accept: application/hal+json' \ 
    

    GET A LIST OF VEHICLES #

    The ‘/user/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.groupe-psa.com/connectedcar/v4/user/vehicles?client_id=<client_id>&indexRange=<element_per_page>&pageSize=<nb_of_pages>' \
      --header 'Authorization: Bearer <access_token>' \
      --header 'x-introspect-realm: <realm>' 
      --header 'Accept: application/hal+json' \ 
    

    GET A VEHICLE POSITION #

    The ‘/user/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.groupe-psa.com/connectedcar/v4/user/vehicles/{id}/lastPosition?client_id=<client_id>' \
      --header 'Authorization: Bearer <access_token>' \
      --header 'x-introspect-realm: <realm>' 
      --header 'Accept: application/vnd.geo+json' \
    
    

    GET ALERTS OF A VEHICLE #

    The ‘/user/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.groupe-psa.com/connectedcar/v4/user/vehicles/{id}/alerts?client_id=<client_id>&indexRange=<element_per_page>&pageSize=<nb_of_pages>&locale=<language>' \
      --header 'Authorization: Bearer <access_token>' \
      --header 'x-introspect-realm: <realm>' 
      --header 'Accept: application/hal+json' \ 
    

    POST NEW MONITOR #

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

    • Path parameter {id} is the unique identifier of one of your vehicles.
    $ curl \
      --request POST \
      --url 'https://api.groupe-psa.com/connectedcar/v4/user/vehicles/{id}/monitors?client_id=<client_id>' \
      --header 'Authorization: Bearer <access_token>' \
      --header 'x-introspect-realm: <realm>' 
      --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 ‘/user/vehicles/{id}/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.groupe-psa.com/connectedcar/v4/user/vehicles/{id}/monitors/{mid}?client_id=<client_id>&indexRange=<element_per_page>&pageSize=<nb_of_pages>&locale=<language>' \
      --header 'Authorization: Bearer <access_token>' \
      --header 'x-introspect-realm: <realm>' 
      --header 'Accept: application/hal+json' \ 
    

    SEE ALSO #

    TRY OUT!

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

    CONNECT

    Groupe PSA’s web API for end-users utilizes OAuth2 connection, follow this link for connection tutorial.