Sponsored Display Reports - struggle to get it going #119
michalaleksandrowicz
started this conversation in
General
Replies: 1 comment 1 reply
-
Hi Michael,
Yes, the url you get to download the report is not accesible by itself, means is not public, you can’t follow directly so I made a helper to download the file:
https://python-amazon-ad-api.readthedocs.io/en/latest/sd/reports.html#ad_api.api.sd.Reports.Reports.download_report <https://python-amazon-ad-api.readthedocs.io/en/latest/sd/reports.html#ad_api.api.sd.Reports.Reports.download_report>
Here is the snippet:
from ad_api.api.sd.reports import Reports
# the url=location is obtained from get_report method need to in stay 'status': 'SUCCESS' if is 'IN_PROGRESS' the report cannot be downloaded
location = 'https://advertising-api-eu.amazon.com/v1/reports/amzn1.clicksAPI.v1.p44551.61549C5E.e4599469-7392-4624-a858-fc1fecdb165c/download'
# path = '/Users/your-profile/Downloads/report_name'
# mode = "data" # "data (list), raw, url, json, zip, gzip default is url"
result = Reports().download_report(
url=location,
# file=path,
# format=mode
)
So just when you obtained the ‘url’ you mention, pass to the function just have a look at the params explanation:
url (string): [required] The location obatined from get_report
file (string): [optional] The path to save the file if mode is download json, zip or gzip.
format (string): [optional] The mode to download the report: data (list), raw, url, json, zip, gzip. Default (url)
Let me know if it works for you.
Kindest regards,
Daniel.
… El 28 feb 2023, a las 1:07, michalaleksandrowicz ***@***.***> escribió:
Hey,
I am an amateur developer, very basic, but managed to streamline my Amazon selling account reporting with a couple of reporting scripts I made with help of this library. I am successfully pulling the reports for Amazon Sponsored Products and this great!
yet I struggle to pull reports for Sponsored display. I am using the example below:
https://python-amazon-ad-api.readthedocs.io/en/latest/sd/reports.html#ad_api.api.sd.Reports <https://python-amazon-ad-api.readthedocs.io/en/latest/sd/reports.html#ad_api.api.sd.Reports>
Have tried all the avenues possible, but the report link I get for SD always gets me this output:
// 20230227180054
// https://advertising-api-eu.amazon.com/v1/reports/amzn1.sdAPI.v1.p4.63FCE179.f25a9144-7867-4845-aa5a-2fec39367bd2/download <https://advertising-api-eu.amazon.com/v1/reports/amzn1.sdAPI.v1.p4.63FCE179.f25a9144-7867-4845-aa5a-2fec39367bd2/download>
{
"code": "UNAUTHORIZED",
"details": "HTTP 401 Unauthorized",
"requestId": "6PYX71FQE2EVNGBXWNC1"
}
The authentication is proper, credentials are working because I can list all the SD campaigns in a console. Yet I can't get the reports, anytime I try it says "HTTP 401 Unauthorized". What is different in the SD logic compared to getting SP reports? Does the download link need to be accessed in some other way? Any advice appreciated! Thanks!
—
Reply to this email directly, view it on GitHub <#119>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AD4ENUS672RRERFTKQWJM63WZTNOZANCNFSM6AAAAAAVJVJARM>.
You are receiving this because you are subscribed to this thread.
|
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hey,
I am an amateur developer, very basic, but managed to streamline my Amazon selling account reporting with a couple of reporting scripts I made with help of this library. I am successfully pulling the reports for Amazon Sponsored Products and this great!
yet I struggle to pull reports for Sponsored display. I am using the example below:
https://python-amazon-ad-api.readthedocs.io/en/latest/sd/reports.html#ad_api.api.sd.Reports
Have tried all the avenues possible, but the report link I get for SD always gets me this output:
// 20230227180054
// https://advertising-api-eu.amazon.com/v1/reports/amzn1.sdAPI.v1.p4.63FCE179.f25a9144-7867-4845-aa5a-2fec39367bd2/download
{
"code": "UNAUTHORIZED",
"details": "HTTP 401 Unauthorized",
"requestId": "6PYX71FQE2EVNGBXWNC1"
}
The authentication is proper, credentials are working because I can list all the SD campaigns in a console. Yet I can't get the reports, anytime I try it says "HTTP 401 Unauthorized". What is different in the SD logic compared to getting SP reports? Does the download link need to be accessed in some other way? Any advice appreciated! Thanks!
Beta Was this translation helpful? Give feedback.
All reactions