feat: ym api key

This commit is contained in:
2025-03-26 06:44:52 +03:00
parent 677a1c8b9c
commit 03a5fbf87f

View File

@@ -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}"'
}