-
-
Notifications
You must be signed in to change notification settings - Fork 60
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The endpoint should be /stores/{brandEntityId}/asinMetrics
#192
Comments
/stores/{brandEntityId}/asinMetrics
per [docs](https://advertising.amazon.com/API/docs/en-us/stores/open-api#tag/Stores-Analytics/operation/getAsinEngagementForStore)./stores/{brandEntityId}/asinMetrics
Please I added in last commit that endpoint, could you please check @tilschuenemann
Hi @drewxa please have a look if you have time and confirm if I upload a new version |
@denisneuf When trying the other endpoint, an exception occurs: from ad_api.api import Stores
from ad_api.base import Marketplaces, AdvertisingApiException
import logging
credentials = {
"refresh_token": "Atzr|IwEB......",
"client_id": "amzn1.....",
"client_secret": ".....",
"profile_id": ".....",
}
def get_asin_engagement_for_store(brand_entity_id: str = None, data: dict = None):
logging.info("---------------------------------")
logging.info("getAsinEngagementForStore")
logging.info("---------------------------------")
try:
result = Stores(
credentials=credentials, marketplace=Marketplaces.IT, debug=True
).get_insights_for_store_api(brandEntityId=brand_entity_id, body=data)
logging.info(result)
payload = result.payload
logging.info(payload)
# location = payload.get("location")
except AdvertisingApiException as error:
logging.info(error)
if __name__ == "__main__":
dictionary = {
"startDate": "2024-01-01",
"endDate": "2024-02-29",
"dimension": "PAGE",
"maxResult": 1500,
"metrics": ["VIEWS"],
}
get_asin_engagement_for_store("MYENTITY", dictionary) 2024-03-04 14:24:40,147:INFO:{"startDate": "2024-01-01", "endDate": "2024-02-29", "dimension": "PAGE", "maxResult": 1500, "metrics": ["VIEWS"]}
2024-03-04 14:24:40,147:INFO:{'_content': b'{"message":"\'Atza|IwE.....\' not a valid key=value pair (missing equal-sign) in Authorization header: ....... I'll look into this some more when I get the time. |
Yes I had the same result with the other endpoint but according the Amazon should be ok, I will release it when I got time and if some other could test or find problems we could fix later |
v0.5.6 |
The endpoint should be
/stores/{brandEntityId}/asinMetrics
per docs.Originally posted by @tilschuenemann in #190 (reply in thread)
The text was updated successfully, but these errors were encountered: