Skip to content
This repository was archived by the owner on Nov 11, 2022. It is now read-only.

Commit 4e94fa1

Browse files
committed
Added new OAUTH endpoint.
1 parent bb75c31 commit 4e94fa1

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

python/bmw.py

+7-3
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,12 @@
1515
import time
1616

1717
# API Gateway
18-
ROOT_URL = "https://b2vapi.bmwgroup.com/webapi"
19-
API_ROOT_URL = ROOT_URL + '/v1'
18+
# North America: b2vapi.bmwgroup.us
19+
# Rest of World: b2vapi.bmwgroup.com
20+
# China: b2vapi.bmwgroup.cn:8592
21+
SERVER = "b2vapi.bmwgroup.us"
22+
AUTH_URL = 'https://' + SERVER + '/gcdm/oauth/token'
23+
API_ROOT_URL = 'https://' + SERVER + '/webapi/v1'
2024

2125
# What are we pretending to be? Not sure if this is important.
2226
# Might be tied to OAuth consumer (auth_basic) credentials?
@@ -72,7 +76,7 @@ def generateCredentials(self):
7276
"scope": "remote_services vehicle_data"
7377
}
7478

75-
r = requests.post(ROOT_URL + "/oauth/token/", data=data, headers=headers)
79+
r = requests.post(AUTH_URL, data=data, headers=headers)
7680
json_data = r.json()
7781

7882
# Get the access token

0 commit comments

Comments
 (0)