Closed dixkxnsks closed 1 year ago
@dixkxnsks If you switch from "EU" to "US" region are you still encountering this error trying to access vehicles = user.vehicles()
?
The new vehicles endpoint requires the locale
and countryCode
parameters to be set in the request headers. The country code should be fine but the locale may be incorrect.
By default I have the locale set to en-US
, which is probably why you are experiencing an error making a request to get the user vehicles. (See below)
/src/Api/Api.ts
constructor(accessToken: string, region: string, locale = 'en-US') {
const regions = {
US: '71A3AD0A-CF46-4CCF-B473-FC7FE5BC4592',
CA: '71A3AD0A-CF46-4CCF-B473-FC7FE5BC4592',
EU: '1E8C7794-FF5F-49BC-9596-A1E0C86C5B19',
AU: '5C80A6BB-CF0D-4A30-BDBF-FC804B5C1A98',
};
const countryCode = {
US: 'USA',
CA: 'CAN',
EU: 'EUR',
AU: 'AUS',
};
this.headers = {
'auth-token': accessToken,
Accept: '*/*',
'Accept-Language': 'en-US',
'User-Agent': 'FordPass/24 CFNetwork/1399 Darwin/22.1.0',
'Content-Type': 'application/json',
'Accept-Encoding': 'gzip, deflate, br',
'Application-Id': regions[region],
locale,
countryCode: countryCode[region],
};
}
I get this error (connectedcar.exceptions.ValidationException: Unknown error) after
vehicles = user.vehicles()
. Complete code: