ianjwhite99 / connected-car-node-sdk

Open-source JavaScript SDK for Ford vehicles connected via FordPass and SYNC.
MIT License
47 stars 10 forks source link

Status is returning forbidden #42

Open ryancornia opened 9 months ago

ryancornia commented 9 months ago

When calling status on a vehicle, a 403/forbidden response is being returned from Ford.

A simple example:

import connectedcar from 'connected-car';

const client = connectedcar.AuthClient('9fb503e0-715b-47e8-adfd-ad4b7770f73b'); 

const token = await client.getAccessTokenFromCredentials({
  username: '*****',
  password: '****',
});

const refreshToken = await client.getAccessTokenFromRefreshToken(token.getRefreshToken());
const user = connectedcar.User(token.getValue());
const vehicles = await user.vehicles();

const vehicleList = []; // Array of vehicles

for (let userVehicle of vehicles) // For each user vehicle
  vehicleList.push(userVehicle['VIN']);

let currentVehicle = connectedcar.Vehicle(vehicleList[0], token.getValue());

console.log(currentVehicle);
const status = await currentVehicle.status();
console.log(status);
brandon-grant commented 9 months ago

Ford is using a new API and is blocking requests to the old API this project is using. Fortunately, it can be fixed.

meilechwieder commented 7 months ago

how can it be fixed @brandon-grant

meilechwieder commented 7 months ago

is there any js package that implements the new API?

ianjwhite99 commented 7 months ago

Hi all,

Working on getting this updated.

ianjwhite99 commented 7 months ago

In looking around a bit, it appears that Ford is changing their FordPass application in favor of their new publicly facing api that will be released at some point in the future. I'll see what I can do to get this library patched up in the meantime.

brandon-grant commented 7 months ago

In looking around a bit, it appears that Ford is changing their FordPass application in favor of their new publicly facing api that will be released at some point in the future. I'll see what I can do to get this library patched up in the meantime.

I've attached a down and dirty solution I put together for myself. OAuth2Client.txt

ianjwhite99 commented 7 months ago

In looking around a bit, it appears that Ford is changing their FordPass application in favor of their new publicly facing api that will be released at some point in the future. I'll see what I can do to get this library patched up in the meantime.

I've attached a down and dirty solution I put together for myself. OAuth2Client.txt

Thanks Brandon. That should help speed things up a bit.

meilechwieder commented 7 months ago

@brandon-grant thank you very much!! Can you share a piece of (sample) code on to start the car, for example, with your OauthClient code that you shared?

iProDeveloping commented 4 months ago

any update on this one? been following this for a while...

iProDeveloping commented 1 month ago

i just received an email from ford developers, they upgraded the API to V3, does that help the case here?