Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Commands returning 403 forbidden #121

Open
sushi86 opened this issue Dec 30, 2023 · 6 comments
Open

Commands returning 403 forbidden #121

sushi86 opened this issue Dec 30, 2023 · 6 comments

Comments

@sushi86
Copy link

sushi86 commented Dec 30, 2023

Hey,

I can succesfully login and retrieve vehicle information, but as soon as I want to send a command like start charging or lock doors, I get "403 Forbidden".

I created the access_token and refresh_token via the iOS App "Auth for Tesla".

Do I need something else?

Example Code:

c, err := tesla.NewClient(ctx, tesla.WithTokenFile(tokenPath))
if err != nil {
return err
}

vehicles, err := c.Vehicles()
if err != nil {
	return err
}

for i, v := range vehicles {
	if i > 0 {
		fmt.Println("----")
	}

	wakeup, err := v.Wakeup()
	if err != nil {
		fmt.Println("Wake up err")
		fmt.Println(err)
	}

	fmt.Println(wakeup)

	fmt.Printf("ID: %x\n", v.ID)
	fmt.Printf("Name %s\n", v.DisplayName)

	enabled, err := v.MobileEnabled()
	fmt.Println(enabled) <--- True
	if err != nil {
		fmt.Println("mobile enabled err")
		fmt.Println(err)
	}

	err = v.LockDoors() <--- 403 Forbidden
	if err != nil {
		return err
	}

Thanks for your help!

@sushi86
Copy link
Author

sushi86 commented Dec 30, 2023

Seems like it has something to do with the new Third Party API, right (https://www.tesla.com/developer-docs)?

Does this API Wrapper already supports this?

@andig
Copy link
Collaborator

andig commented Dec 30, 2023

It doesn't and it likely won't. Tesla Vehicle Commands is a separate API.

@sushi86
Copy link
Author

sushi86 commented Dec 30, 2023

Thanks for your reply. So this api wrapper won’t be able to send commands any more. 😞

@andig
Copy link
Collaborator

andig commented Dec 30, 2023

It will as long as the owners api works.

@sushi86
Copy link
Author

sushi86 commented Dec 30, 2023

Then what I‘m doing wrong?

@sushi86
Copy link
Author

sushi86 commented Jan 16, 2024

sad

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants