Ponytech / appstoreconnectapi

Python wrapper around Apple App Store Api
https://ponytech.net/projects/app-store-connect
MIT License
161 stars 74 forks source link

api.download_sales_and_trends_reports() sends error when specifying reportType #10

Closed foundmason closed 4 years ago

foundmason commented 4 years ago

When making a 'api.download_sales_and_trends_reports' call with reportType set to 'SUBSCRIPTION'. apple store connect replies with 'APIError: Please include the version parameter. The latest version for this report is 1_2.'

ppawlak commented 4 years ago

Thanks for reporting this issue! I'll have a look and fix it as soon as possible.

ppawlak commented 4 years ago

@foundmason I had a look at this issue.

As an immediate workaround you can manually set this required version parameter in your call:

api.download_sales_and_trends_reports( filters={
'vendorNumber': '123456789', 
'reportDate': '2020-01-01', 
'reportType': 'SUBSCRIPTION', 
'version': '1_2'
}, save_to='report.csv')

I'll try to automatically add it in a future release though.

foundmason commented 4 years ago

Thanks. It worked. I wonder if calling different versions will be useful in the future... for now it seems to just break. I will eagerly await the future release :).

Cheers~

ppawlak commented 4 years ago

Fixed by https://github.com/Ponytech/appstoreconnectapi/commit/b73d4314e2a9f9098f3287f57fff687563e70b28

GClunies commented 4 years ago

@ppawlak any chance you will update these changes on pypi anytime soon?

ppawlak commented 4 years ago

@GClunies I am planning to release a new version when I'll fix #20 (and maybe #21 as well). I hope to do this soon now, I was on vacation in July.

ppawlak commented 4 years ago

@ppawlak any chance you will update these changes on pypi anytime soon?

@GClunies I just did, it is in version 0.8.1 Sorry for the long delay.