Skip to content

I would like to suggest this method name for edit_ad_groups for update ad groups in sponsored brand. #212

@leollon

Description

@leollon

Since the request body for update ad groups in sponsored products is as follows:

{
  "adGroups": [
    {
      "name": "string",
      "state": "ENABLED",
      "adGroupId": "string",
      "defaultBid": 0.1
    }
  ]
}

When sending request for updating ad groups, it is like:

return self._request(kwargs.pop('path'), data=Utils.convert_body(kwargs.pop('body'), False), params=kwargs, headers=headers)

meanwhile the request body for updating ad groups in sponsored brand:

{
  "adGroups": [
    {
      "name": "string",
      "state": "ENABLED",
      "adGroupId": "string"
    }
  ]
}

When sending request for updating ad groups

return self._request(kwargs.pop('path'), data=Utils.convert_body(kwargs.pop('body'), False) , params=kwargs, headers=headers)

Therefore, they have something in common. when update this two kinds of ad group in a loop while, it could goes like:

def demo(ad_group_category = "sp"):
    ad_group_class = {"sb": "AdGroupsV4", "sp": "adGroupv3"}
    ad_group_client = ad_group_class["ad_group_category"]
    ad_groups = [{"name": "demo", "adGroupId": "123458992",  "state": "ENABLED"}]
   try:
       ad_group_client.edit_ad_groups(body={"adGroups": ad_groups})
   except Exception:
       pass

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions