There are a few ways to get this information.
You can use the
AdGroupService to
get all ad groups. If you include the
Id and
CampaignId fields in your
Selector, then you'll get back the ad group ID and campaign ID combination for each ad group. If you are using one of our client libraries, check out the
GetAdGroups example in the client library's
basicoperations folder (e.g., the Java example is
here).