Request
POST https://backend.net0.com/v1/vehicles/{vehicleId}/emissions
This endpoint allows you to add new emissions for a specified vehicle. The emissions will be calculated automatically based on the specification of the vehicle.
curl --location --request POST 'https://backend.net0.com/v1/vehicles/948bde0e-e8b9-4e9e-af74-d605b48d1f57/emissions' \
--header 'x-api-key: <API_KEY>' \
--header 'Content-Type: application/json' \
--data-raw '{
"startDateUtc": "2021-11-28T02:03:30.512Z",
"endDateUtc": "2021-11-29T02:03:30.512Z",
"amount": 2,
"comment": "Vehicle has emssions"
}'
Request Body
{
"startDateUtc": "string",
"endDateUtc": "string",
"amount": 0,
"comment": "string"
}
Field Parameters
Attribute | Type | In | Description |
---|---|---|---|
vehicleId | String | Path | This is the id of the vehicle for which emission is to be added. |
startDateUtc | String | Body | The start date of vehicle transport. |
endDateUtc | String | Body | Describes the end date for vehicle transport. |
amount | Number | Body | Describes the amount. |
comment | String | Body | An optional comment about the emission. |
Response
The response contains all the details about the emission for the vehicle.
{
"startDate": "2021-11-28T02:03:30.512Z",
"endDate": "2021-11-29T02:03:30.512Z",
"amount": 2,
"comment": "Vehicle has emssions",
"totalEmission": 3.88,
"emissionId": "d468771a-867e-4e3b-8be0-66b05ab914e1",
"emission": {
"ch4": 0.004281151495020996,
"co2": 3.8626600001319806,
"n2o": 0.010619235430886761,
"co2e": 3.88,
"unitId": 2,
"companyId": 2,
"id": "d468771a-867e-4e3b-8be0-66b05ab914e1",
"createdAt": "2021-11-27T16:03:26.074Z",
"updatedAt": "2021-11-27T16:03:26.074Z"
},
"vehicleId": "948bde0e-e8b9-4e9e-af74-d605b48d1f57",
"companyId": 2,
"id": "dfb35c1d-79d4-4b14-809f-e0013a6972aa",
"createdAt": "2021-11-27T16:03:26.082Z",
"updatedAt": "2021-11-27T16:03:26.082Z"
}