VeSync Binding not working

Those params are for the OLD auth mechanism - the new one uses a different method and much newer app version.

It’s possibly you have an OLD account that is still using the OLD api calls. The script I posted in the github ticket confirms.

I just need to install pyvesync and add some select print statements to see the syntax it’s using. It’s just a matter of having enough time in the day.

I added debug infos to my script to get the full header, body etc. may this help :slight_smile:
My accound was created 1 week ago so it should be with the new auth mechanism.

➡️ REQUEST: post https://smartapi.vesync.eu/globalPlatform/api/accountAuth/v1/authByPWDOrOTM
JSON Body: {'email': '***', 'method': 'authByPWDOrOTM', 'password': '***', 'acceptLanguage': 'en', 'accountID': '***', 'authProtocolType': 'generic', 'clientInfo': 'pyvesync', 'clientType': 'vesyncApp', 'clientVersion': 'VeSync 5.6.60', 'debugMode': False, 'osInfo': 'Android', 'terminalId': '2dbcd310e7dff4e0f98d0ebedafae7766', 'timeZone': 'America/New_York', 'token': '***', 'userCountryCode': 'US', 'appID': 'ghbh4lq2', 'sourceAppID': 'ghbh4lq2', 'traceId': 'APPe7761757499088-00001'}
✅ RESPONSE 200: https://smartapi.vesync.eu/globalPlatform/api/accountAuth/v1/authByPWDOrOTM
Response Body: {
  "traceId": "APPe7761757499088-00001",
  "code": 0,
  "msg": "request success",
  "result": {
    "accountID": "***",
    "avatarIcon": "https://image.vesync.com/defaultImages/user/avatar_nor.png",
    "nickName": "***",
    "mailConfirmation": true,
    "registerSourceDetail": null,
    "registerAppVersion": "VeSync 5.6.81 build2",
    "registerTime": "2025-09-04 06:33:43",
    "verifyEmail": "***",
    "accountLockTimeInSec": null,
    "bizToken": null,
    "mfaMethodList": null,
    "authorizeCode": "***",
    "emailUpdateToSame": "notUpdate",
    "userType": "1"
  }
}

➡️ REQUEST: post https://smartapi.vesync.eu/user/api/accountManage/v1/loginByAuthorizeCode4Vesync
JSON Body: {'method': 'loginByAuthorizeCode4Vesync', 'authorizeCode': '***', 'acceptLanguage': 'en', 'accountID': '***', 'clientInfo': 'pyvesync', 'clientType': 'vesyncApp', 'clientVersion': 'VeSync 5.6.60', 'debugMode': False, 'emailSubscriptions': False, 'osInfo': 'Android', 'terminalId': '2dbcd310e7dff4e0f98d0ebedafae7766', 'timeZone': 'America/New_York', 'token': '***', 'userCountryCode': 'EU', 'traceId': 'APPe7761757499088-00002'}
✅ RESPONSE 200: https://smartapi.vesync.eu/user/api/accountManage/v1/loginByAuthorizeCode4Vesync
Response Body: {
  "traceId": "APPe7761757499088-00002",
  "code": -11260022,
  "msg": "login trigger cross region error.",
  "module": null,
  "stacktrace": null,
  "result": {
    "birthday": null,
    "gender": null,
    "acceptLanguage": null,
    "measureUnit": null,
    "weightG": null,
    "heightCm": null,
    "weightTargetSt": null,
    "heightUnit": null,
    "heightFt": null,
    "weightTargetKg": null,
    "weightTargetLb": null,
    "weightUnit": null,
    "maximalHeartRate": null,
    "targetBfr": null,
    "displayFlag": null,
    "targetStatus": null,
    "realWeightKg": null,
    "realWeightLb": null,
    "realWeightUnit": null,
    "heartRateZones": null,
    "runStepLongCm": null,
    "walkStepLongCm": null,
    "stepTarget": null,
    "sleepTargetMins": null,
    "regionType": 1,
    "currentRegion": "EU",
    "token": "***",
    "countryCode": "DE",
    "accountID": "***",
    "bizToken": "30120011eyJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJ2ZXN5bmMuY29tIiwiYXVkIjoiMTk3NDQwNjAiLCJleHAiOjE3NTc0OTk5ODgwMDcsImlhdCI6MTc1NzQ5OTA4ODAwNywianRpIjoiY2M5NDEyMGEzZjgyNGM1YjljYjU4OWNmOGY4MmNiNmYifQ.M-4E6Z4mZaPL8WJejXP0jpVfUOyhTi2p7Te-6JZwBXA"
  }
}

➡️ REQUEST: post https://smartapi.vesync.eu/user/api/accountManage/v1/loginByAuthorizeCode4Vesync
JSON Body: {'method': 'loginByAuthorizeCode4Vesync', 'acceptLanguage': 'en', 'accountID': '***', 'clientInfo': 'pyvesync', 'clientType': 'vesyncApp', 'clientVersion': 'VeSync 5.6.60', 'debugMode': False, 'emailSubscriptions': False, 'osInfo': 'Android', 'terminalId': '2dbcd310e7dff4e0f98d0ebedafae7766', 'timeZone': 'America/New_York', 'token': '***', 'bizToken': '30120011eyJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJ2ZXN5bmMuY29tIiwiYXVkIjoiMTk3NDQwNjAiLCJleHAiOjE3NTc0OTk5ODgwMDcsImlhdCI6MTc1NzQ5OTA4ODAwNywianRpIjoiY2M5NDEyMGEzZjgyNGM1YjljYjU4OWNmOGY4MmNiNmYifQ.M-4E6Z4mZaPL8WJejXP0jpVfUOyhTi2p7Te-6JZwBXA', 'regionChange': 'last_region', 'userCountryCode': 'DE', 'traceId': 'APPe7761757499089-00003'}
✅ RESPONSE 200: https://smartapi.vesync.eu/user/api/accountManage/v1/loginByAuthorizeCode4Vesync
Response Body: {
  "traceId": "APPe7761757499089-00003",
  "code": 0,
  "msg": "request success",
  "module": null,
  "stacktrace": null,
  "result": {
    "birthday": "",
    "gender": "",
    "acceptLanguage": "de",
    "measureUnit": "Imperial",
    "weightG": 0.0,
    "heightCm": 0.0,
    "weightTargetSt": 0.0,
    "heightUnit": "FT",
    "heightFt": 0.0,
    "weightTargetKg": 0.0,
    "weightTargetLb": 0.0,
    "weightUnit": "KG",
    "maximalHeartRate": 0,
    "targetBfr": 0.0,
    "displayFlag": [],
    "targetStatus": 0,
    "realWeightKg": 0.0,
    "realWeightLb": 0.0,
    "realWeightUnit": "lb",
    "heartRateZones": 0.0,
    "runStepLongCm": 0.0,
    "walkStepLongCm": 0.0,
    "stepTarget": 0.0,
    "sleepTargetMins": 0.0,
    "regionType": 1,
    "currentRegion": "EU",
    "token": "***",
    "countryCode": "DE",
    "accountID": "***",
    "bizToken": null
  }
}
2025-09-10 12:11:30,036 - DEBUG - Login successful
✅ Login erfolgreich

Thanks that’s just what I need! Will see if I can get a token this evening my time.

Edit: wont’ be tonight - I’ve mapped out the differences in the difference JSON requests - ie which components ones are common to all requests and which ones are specific - but I had a big day at work, so won’t get to actually coding it tonight.

All right, thank you very much for taking the trouble to get this stuff working so quickly. :slight_smile:

Any news? Something I can help?

Anything we can do to help?

Paul seems to be very busy - I don’t see any progress in the last 2 months… I don’t know who is the “owner” of the binding or how to find the solution for this problem.