diff --git a/README.md b/README.md index eb7accb..993ac01 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ Please follow instructions on [Apple documentation](https://developer.apple.com/ With your *key ID*, *key file* (you can either pass the path to the file or the content of it as a string) and *issuer ID* create a new API instance: ```python -from appstoreconnect import Api +from appstoreconnect import Api, UserRole api = Api(key_id, path_to_key_file, issuer_id) ``` @@ -57,6 +57,10 @@ for bundle_id in api.list_bundle_ids(): for certificate in api.list_certificates(): print(certificate.name) +# modify a user +user = api.list_users(filters={'username': 'finance@nemoidstudio.com'})[0] +api.modify_user_account(user, roles=[UserRole.FINANCE, UserRole.ACCESS_TO_REPORTS]) + # download sales report api.download_sales_and_trends_reports( filters={'vendorNumber': '123456789', 'frequency': 'WEEKLY', 'reportDate': '2019-06-09'}, save_to='report.csv') diff --git a/example.py b/example.py index a808c94..7186683 100644 --- a/example.py +++ b/example.py @@ -1,7 +1,7 @@ #!/usr/bin/env python import sys -from appstoreconnect import Api +from appstoreconnect import Api, UserRole if __name__ == "__main__": @@ -19,6 +19,10 @@ apps = api.list_apps(filters={'sku': 'DINORUSH', 'name': 'Dino Rush'}) print("%d apps found" % len(apps)) + # modify a user + user = api.list_users(filters={'username': 'finance@nemoidstudio.com'})[0] + api.modify_user_account(user, roles=[UserRole.FINANCE, UserRole.APP_MANAGER, UserRole.ACCESS_TO_REPORTS]) + # download sales report api.download_sales_and_trends_reports( filters={'vendorNumber': '123456789', 'frequency': 'WEEKLY', 'reportDate': '2019-06-09'}, save_to='report.csv')