feat: ym api key
This commit is contained in:
@@ -20,10 +20,15 @@ class YandexmarketMarketplaceApi(BaseMarketplaceApi):
|
||||
logging.error(f"Couldn't load auth data for marketplace [{self.marketplace.id}]")
|
||||
self.is_valid = False
|
||||
return
|
||||
api_key = auth_data.get('apiKey')
|
||||
if api_key:
|
||||
self.limiter_key = str(marketplace.company_id) + str(api_key) + str(self.marketplace.campaign_id)
|
||||
self.headers = {
|
||||
'Api-Key': api_key
|
||||
}
|
||||
else:
|
||||
access_token = auth_data.get('accessToken')
|
||||
|
||||
self.limiter_key = str(marketplace.company_id) + str(access_token) + str(self.marketplace.campaign_id)
|
||||
|
||||
self.headers = {
|
||||
'Authorization': f'OAuth oauth_token="{access_token}", oauth_client_id="{YANDEX_CLIENT_ID}"'
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user