Skip to content

🚗 REST API which accepts static bearer tokens and sends end-to-end authenticated commands to your vehicle

License

Notifications You must be signed in to change notification settings

L480/tesla-http-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

tesla-http-api

REST API based on tesla-http-proxy and Tesla's proxy Go package. tesla-http-api sends end-to-end authenticated commands to your vehicle and takes care about the authorization flow and token refresh.

tesla-http-api request flow

Usage

Run tesla-http-api

# Step 1: Clone repo
git clone https://github.com/L480/tesla-http-api.git
# Step 2: Modify environment variables in docker-compose.yml
# Check out https://developer.tesla.com/docs/fleet-api/authentication/overview
nano docker-compose.yml
# Step 3: Create working directory
mkdir -p /opt/tesla-http-api
# Step 4: Copy your private key to working directory
cp my-private-key.pem /opt/tesla-http-api/private-key.pem
# Step 5: Change directory ownership as container image does not run as root
chown -R 93761:93761 /opt/tesla-http-api
# Step 6: Pull and start container
docker compose up -d

Important

tesla-http-api is designed to run behind a proxy (like nginx, Cloudflare etc.).

Use tesla-http-api

curl -H "Authorization: Bearer $API_TOKEN" \
     -H "Content-Type: application/json" \
     --data "{}" \
     -X POST \
     -i https://tesla-http-api.example.com/api/1/vehicles/{VIN}/command/flash_lights

You can find all API endpoints in Tesla's Fleet API documentation.

Health check

curl -X GET \
     -i https://tesla-http-api.example.com/health

About

🚗 REST API which accepts static bearer tokens and sends end-to-end authenticated commands to your vehicle

Topics

Resources

License

Stars

Watchers

Forks

Packages