Skip to content

Commit 6254c0f

Browse files
committed
Pass through api_path object to connection
1 parent af02613 commit 6254c0f

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

bigcommerce/api.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66

77
class BigcommerceApi(object):
8-
def __init__(self, host=None, basic_auth=None,
8+
def __init__(self, host=None, api_path=None, basic_auth=None,
99
client_id=None, store_hash=None, access_token=None, rate_limiting_management=None):
1010
self.api_service = os.getenv('BC_API_ENDPOINT', 'api.bigcommerce.com')
1111
self.auth_service = os.getenv('BC_AUTH_SERVICE', 'login.bigcommerce.com')
@@ -14,6 +14,7 @@ def __init__(self, host=None, basic_auth=None,
1414
self.connection = connection.Connection(host, basic_auth)
1515
elif client_id and store_hash:
1616
self.connection = connection.OAuthConnection(client_id, store_hash, access_token, self.api_service,
17+
api_path=api_path,
1718
rate_limiting_management=rate_limiting_management)
1819
else:
1920
raise Exception("Must provide either (client_id and store_hash) or (host and basic_auth)")

bigcommerce/connection.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,11 +187,11 @@ class OAuthConnection(Connection):
187187
"""
188188

189189
def __init__(self, client_id, store_hash, access_token=None, host='api.bigcommerce.com',
190-
api_path='/stores/{}/v2/{}', rate_limiting_management=None):
190+
api_path=None, rate_limiting_management=None):
191191
self.client_id = client_id
192192
self.store_hash = store_hash
193193
self.host = host
194-
self.api_path = api_path
194+
self.api_path = api_path if api_path else "/stores/{}/v2/{}"
195195
self.timeout = 7.0 # can attach to session?
196196
self.rate_limiting_management = rate_limiting_management
197197

0 commit comments

Comments
 (0)