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
APIError: There were no sales for the date specified. Any way to get Units sold for a free app? #15
Comments
Thank you for reporting this issue. |
@rolflocher I tried on my account and I am able to download reports even on days with no sales. Here is the example call I do Can you paste the call you are doing and the python traceback you get? |
But that is for last month, when I change the date to this month it works fine. |
Well, then I think it means that you had no downloads on 2020-04-10.
You should call the API in a try / except block like this: from appstoreconnect.api import APIError
try:
api.download_sales_and_trends_reports(filters={'vendorNumber': '99999999', 'frequency': 'DAILY', 'reportDate': '2020-04-10'}, save_to='report.csv')
except APIError as e:
print("Could not download report because: ", e) I am also closing this issue as raising an exception on errors is the desired behavior. |
Our app is free so there is no sales - $ sales data, but there is sales - # units data which I am interested in. I am having trouble getting the download_sales_and_trends_reports to return anything because of this. Also, perhaps the script shouldn't crash when there is a day without sales?
I ended up ditching the manual jwt encoding to try your wrapper because I couldn't set the authorization header with String("Bearer ") + Bytes(encoded_jwt). Perhaps you could help me? Thanks
The text was updated successfully, but these errors were encountered: