Discussions
New chargeID not recognised by 'stop charge'
15 days ago by null
Hello,
apparently today the chargeID format changed, until yesterday the chargeID was a 8-digit number, and today it shows a 18-digit long one.
curl --request GET \
--url 'https://public-api.monta.com/api/v1/charges?chargePointId=2942448&page=0&perPage=1' \
--header 'accept: application/json' \
--header 'authorization: Bearer aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee'
{
"data": [
{
"id": 628861823576030600,
"chargePointId": xxxxxxx,
"createdAt": "2024-10-01T07:52:22Z",
"updatedAt": "2024-10-01T07:52:55Z",
"cablePluggedInAt": "2024-10-01T07:52:22Z",
"startedAt": "2024-10-01T07:52:23Z",
"stoppedAt": null,
"fullyChargedAt": null,
"failedAt": null,
"timeoutAt": null,
"state": "paused",
"consumedKwh": 0,
"kwhLimit": null,
"startMeterKwh": 7212.327,
"endMeterKwh": 7212.327,
"cost": 0,
"price": 0,
"priceLimit": null,
"averagePricePerKwh": 0,
"averageCo2PerKwh": 0,
"averageRenewablePerKwh": 0,
"failureReason": null,
"stopReason": "",
"note": null,
"currency": {
"identifier": "eur",
"name": "Euros",
"decimals": 2
},
"soc": null,
"socLimit": null
}
],
"meta": {
"itemCount": 1,
"currentPage": 0,
"perPage": 1,
"totalPageCount": 475,
"totalItemCount": 475
}
}
That's fine, but the problem is that the new chargeId is not recognised when trying to stop it with the API.
The request:
curl --request POST \
--url https://public-api.monta.com/api/v1/charges/628861823576030600/stop \
--header 'accept: application/json' \
--header 'authorization: Bearer aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee'
and the result:
{
"status": "NOT_FOUND",
"message": "Charge with ID `628861823576030600` not found.",
"readableMessage": "Not Found",
"errorCode": "RESOURCE_NOT_FOUND",
"context": null
}
Any idea?
Thanks