Monitors
Create a new Monitor.
Create a Monitor for all Vehicles of the fleet. This is a kind of vehicle monitor that generates an event following the transition state of one of the (monitored) data of the vehicles. As for example the fuel level, the moving out of a defined geographical area.
When the trigger occurs, the built event expressed as a JSON object will be sent over the subscribed callback.
post/fleets/{fid}/monitors
Request
- Base URLhttps://api-cert.groupe-psa.com/connectedcar/v3
- AuthHTTP basic and API key in query parameter client_id
- TypeScripthttps://skmtc.dev/groupe-psa/apis/groupe-psa-connected-car-b2b-api/docs/fleets/:fid/monitors/post.tsA function with typed inputs. Its response is checked against the schema.
Path parameters
fidstring required
Resource is related to this fleet ID only.
Request body
Example request
{
"subscribeParam": {
"retryPolicy": {
"retryNumber": 10,
"retryDelay": 60
},
"callback": {
"webhook": {
"target": "https://my.post.callback",
"name": "My_Webhook",
"attributes": [
{
"type": "Header",
"key": "X-Vehicle_Id",
"value": "$vin"
}
]
}
},
"refreshEvent": 120
},
"triggerParam": {
"triggers": [
{
"zone": {
"transition": "Out",
"place": {
"radius": 20,
"center": {
"longitude": 2.333333,
"latitude": 48.866667
}
}
},
"time": {
"times": [
{
"recurrence": "Daily",
"start": "PT8H30M",
"duration": "PT7H30M",
"occurence": [
"Mon",
"Tue",
"Thu",
"Fri"
]
}
],
"timeZone": "Europe/Paris"
},
"data": {
"data": "vehicle.energy.electric.level",
"op": "greaterThan",
"value": [
"75"
]
}
}
],
"boolExp": "((z1 & t1) | (z2 & !t1) | (f & z1) | (a & (z1|t)) | (o & (z1 | z2)))"
}
}Response
Monitor created or updated successfully
Example response
{
"_links": {
"fleet": {
"href": "http://example.com",
"deprecation": "http://example.com"
},
"monitor": {
"href": "http://example.com",
"deprecation": "http://example.com"
}
}
}Changes
No recorded changes to this operation across all 1 revision of this API.