hacf-fr / renault-api

https://readthedocs.org/projects/renault-api/
MIT License
107 stars 39 forks source link

('err.func.wired.not-found', 'The specified url does not exist') -- get_vehicles() #994

Open MRus00 opened 1 year ago

MRus00 commented 1 year ago

When executing the sample script:

import aiohttp
import asyncio

from renault_api.renault_client import RenaultClient

async def main():
   async with aiohttp.ClientSession() as websession:
      client = RenaultClient(websession=websession, locale="fr_FR")
      await client.session.login('[removed for issue report]', '[removed for issue report])
      print(f"Accounts: {await client.get_person()}") # List available accounts, make a note of kamereon account id

      account_id = "Your Kamereon account id"
      account = await client.get_api_account(account_id)
      print(f"Vehicles: {await account.get_vehicles()}") # List available vehicles, make a note of vehicle VIN

      vin = "Your vehicle VIN"
      vehicle = await account.get_api_vehicle(vin)
      print(f"Cockpit information: {await vehicle.get_cockpit()}")
      print(f"Battery status information: {await vehicle.get_battery_status()}")

loop = asyncio.get_event_loop()
loop.run_until_complete(main())

The get_person call is successful, however the get_vehicles fails with the following exception....

_File "/home/matt/Documents/shareddocs-synced-local-copy/Development/python/ev/getVehicleInfo.py", line 22, in loop.run_until_complete(main()) File "/usr/lib/python3.10/asyncio/base_events.py", line 649, in run_until_complete return future.result() File "/home/matt/Documents/shareddocs-synced-local-copy/Development/python/ev/getVehicleInfo.py", line 14, in main print(f"Vehicles: {await account.get_vehicles()}") # List available vehicles, make a note of vehicle VIN File "/home/matt/.local/lib/python3.10/site-packages/renault_api/renault_account.py", line 62, in get_vehicles return await self.session.get_account_vehicles( File "/home/matt/.local/lib/python3.10/site-packages/renault_api/renault_session.py", line 188, in get_account_vehicles return await kamereon.get_account_vehicles( File "/home/matt/.local/lib/python3.10/site-packages/renault_api/kamereon/init.py", line 241, in get_account_vehicles await request( File "/home/matt/.local/lib/python3.10/site-packages/renault_api/kamereon/init.py", line 159, in request kamereon_response.raise_for_error_code() File "/home/matt/.local/lib/python3.10/site-packages/renault_api/kamereon/models.py", line 135, in raise_for_error_code error.raise_for_error_code() File "/home/matt/.local/lib/python3.10/site-packages/renault_api/kamereon/models.py", line 97, in raise_for_error_code raise exceptions.KamereonResponseException( renaultapi.kamereon.exceptions.KamereonResponseException: ('err.func.wired.not-found', 'The specified url does not exist')

epenet commented 1 year ago

Please try again later. Renault servers are sometimes misbehaving.

epenet commented 1 year ago

Note: if you know the VIN of your vehicle, you can skip directly to the next step.

rickbaud commented 1 year ago

Thanks. Le jeudi 12 octobre 2023 à 08:43:43 UTC+2, epenet @.***> a écrit :

Please try again later. Renault servers are sometimes misbehaving.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you are subscribed to this thread.Message ID: @.***>

kelyaenn commented 1 year ago

The endpoint to get the kamereon account id (and the vehicles) seems to have been deleted by Renault. It doesn't work anymore since more than one week A working url is https://myr.renault.fr/agg/v2/account/connexion?product=MYRENAULT&country=fr&needProfile=MYRENAULT&lang=fr&brand=renault by passing oneSession={jwttoken} in cookie headers

curl --location 'https://myr.renault.fr/agg/v2/account/connexion?product=MYRENAULT&country=fr&needProfile=MYRENAULT&lang=fr&brand=renault' \
--header 'Cookie: oneSession=jwttoken'
epenet commented 11 months ago

It is still working for me... but maybe it stopped working for new clients? All PRs are welcome if there is a new way of doing things...