Manager Account
https://dtrnk0o2zy01c.cloudfront.net/openapi/en-us/dest/ManagerAccount_prod_3p.json
A Manager Account lets you manage a group of Amazon Advertising accounts.
- class ad_api.api.ManagerAccounts(account='default', marketplace: Marketplaces = Marketplaces.EU, credentials=None, proxies=None, verify=True, timeout=None, debug=False, access_token=None)
- list_manager_accounts() ApiResponse
Returns all Manager accounts that a given Amazon Advertising user has access to.
### Example getting a list of manager accounts
import logging from ad_api.api import ManagerAccounts from ad_api.base import AdvertisingApiException def list_manager_accounts(): try: result = ManagerAccounts(account="bestq", debug=True).list_manager_accounts() logging.info(result) except AdvertisingApiException as error: logging.info(error) if __name__ == '__main__': list_manager_accounts()
- create_manager_account(body: dict, str) ApiResponse
Creates a new Amazon Advertising Manager account.
body: | REQUIRED
{‘managerAccountName’: string Name of the Manager account.‘managerAccountType’: string Type of the Manager account, which indicates how the Manager account will be used. Use Advertiser if the Manager account will be used for your own products and services, or Agency if you are managing accounts on behalf of your clients. Enum: [ Advertiser, Agency ]}
### Example creating a manager account
import logging from ad_api.api import ManagerAccounts from ad_api.base import AdvertisingApiException def create_manager_account(data: dict or str): try: result = ManagerAccounts(debug=True).create_manager_account( body=data ) logging.info(result) except AdvertisingApiException as error: logging.info(error) if __name__ == '__main__': manager_account_name = 'ManagerMyAccount' manager_account_type = 'Agency' # Agency Advertiser account = \ { 'managerAccountName': manager_account_name, 'managerAccountType': manager_account_type, } create_manager_account(account)
- associate_manager_accounts(managerAccountId: str, body: dict, str) ApiResponse
Link Amazon Advertising accounts or advertisers with a Manager Account.
path managerAccountId:string | Required. Id of the Manager Account.
body: | REQUIRED
{“accounts”: A list of Advertising accounts or advertisers to link/unlink with Manager Account. User can pass a list with a maximum of 20 accounts/advertisers using any mix of identifiers.[{“roles”: “list”, The types of role that will exist with the Amazon Advertising account. Depending on account type, the default role will be ENTITY_USER or SELLER_USER. Only one role at a time is currently supported [ ENTITY_OWNER, ENTITY_USER, ENTITY_VIEWER, SELLER_USER ]“id”: “string”, Id of the Amazon Advertising account.“type”: The type of the Id, Enum: [ ACCOUNT_ID, DSP_ADVERTISER_ID ]}]}
### Example associating a manager account with and advertiser account
import logging from ad_api.api import ManagerAccounts from ad_api.base import AdvertisingApiException def associate_manager_accounts(manager_account_id: str, data: dict or str): try: result = ManagerAccounts(debug=True).associate_manager_accounts( managerAccountId=manager_account_id, body=data, ) logging.info(result) except AdvertisingApiException as error: logging.info(error) if __name__ == '__main__': amz_manager_account_id = 'amzn1.ads1.ma1.ewpohpn123456789987654321' account_id = 'ENTITY1123456789012' roles = ['ENTITY_VIEWER'] type_account = 'ACCOUNT_ID' association = \ { 'accounts': [ { 'roles': roles, 'id': account_id, 'type': type_account } ] } associate_manager_accounts(amz_manager_account_id, association)
- disassociate_manager_accounts(managerAccountId: str, body: dict, str) ApiResponse
Unlink Amazon Advertising accounts or advertisers with a Manager Account.
path managerAccountId:string | Required. Id of the Manager Account.
body: | REQUIRED
{“accounts”: A list of Advertising accounts or advertisers to link/unlink with Manager Account. User can pass a list with a maximum of 20 accounts/advertisers using any mix of identifiers.[{“roles”: “list”, The types of role that will exist with the Amazon Advertising account. Depending on account type, the default role will be ENTITY_USER or SELLER_USER. Only one role at a time is currently supported [ ENTITY_OWNER, ENTITY_USER, ENTITY_VIEWER, SELLER_USER ]“id”: “string”, Id of the Amazon Advertising account.“type”: The type of the Id, Enum: [ ACCOUNT_ID, DSP_ADVERTISER_ID ]}]}
### Example unlinking a manager account with and advertiser account
import logging from ad_api.api import ManagerAccounts from ad_api.base import AdvertisingApiException def disassociate_manager_accounts(manager_account_id: str, data: dict or str): try: result = ManagerAccounts(debug=True).disassociate_manager_accounts( managerAccountId=manager_account_id, body=data, ) logging.info(result) except AdvertisingApiException as error: logging.info(error) if __name__ == '__main__': amz_manager_account_id = 'amzn1.ads1.ma1.ewpohpn123456789987654321' account_id = 'ENTITY1123456789012' type_account = 'ACCOUNT_ID' disassociation = \ { 'accounts': [ { 'id': account_id, 'type': type_account } ] } disassociate_manager_accounts(amz_manager_account_id, disassociation)