Creating a new AdGroup

21 views
Skip to first unread message

Algan

unread,
Sep 12, 2008, 4:38:45 AM9/12/08
to AdWords API Forum
I am trying to create a new group and using v12 version.
I get the error message:"The request body did not contain an operation
or the specified operation does not exist."

Can somebody help me, please?

// Create new ad group structure.
AdGroup adGroup = new AdGroup();
adGroup.name = "Sample Ad Group";
adGroup.keywordMaxCpc = 100000L;
adGroup.keywordMaxCpcSpecified = true;
_AdGroupService.addAdGroup(32090193, adGroup);

AdWords API Advisor

unread,
Sep 12, 2008, 11:35:03 AM9/12/08
to AdWords API Forum
Hello Algan,

There's not that much information in your message--it would be
helpful to see a log of the actual SOAP request and response messages
(with any sensitive password and token information X-ed out) in order
to fully diagnose what's going on. Throwing things out there, I've
seen that error before when an incorrect namespace is used for the
request body, but I don't really know if that's what you're running
into here.

It seems like you're trying to take the .NET sample code and use it
in a production program, which, while it can be done, probably isn't
the best approach for new development. If you're planning on writing
something in .NET, I'd recommend using the .NET client library, which
will simply the process greatly and ships with numerous code samples.
There's a link to it and all the other client libraries at

http://www.google.com/apis/adwords/clients.html

Cheers,
-Jeff Posnick, AdWords API Team

Algan

unread,
Sep 15, 2008, 4:51:31 AM9/15/08
to AdWords API Forum

I only want simply to insert an adrgroup into a campaigne.
How can I do that?

On 12 Sep., 17:35, AdWords API Advisor <adwordsapiadvi...@google.com>
wrote:
> > _AdGroupService.addAdGroup(32090193, adGroup);- Zitierten Text ausblenden -
>
> - Zitierten Text anzeigen -

Jan Piotrowski (AdWords API Guru)

unread,
Sep 15, 2008, 5:06:44 AM9/15/08
to AdWords API Forum
Didn't you read Jeff's answer? Go to the client libraries page and get
the .NET client library. There will be examples and code.

- Jan

Algan

unread,
Sep 15, 2008, 5:40:45 AM9/15/08
to AdWords API Forum
Of course I did.
I can insert, update and delete campaigne, but nothing else.
I get the following error:
{"The request body did not contain an operation or the specified
operation does not exist."}

On 15 Sep., 11:06, "Jan Piotrowski (AdWords API Guru)"
> > > - Zitierten Text anzeigen -- Zitierten Text ausblenden -

Algan

unread,
Sep 15, 2008, 7:21:08 AM9/15/08
to AdWords API Forum
I tryed to run the example once again. I have gotten the error: below
// Creates a user.
Hashtable headers = new Hashtable();
headers.Add("email", "email");
headers.Add("password", "xxxxxx");
headers.Add("clientEmail", "clientemail");
headers.Add("useragent",
"AdWords API DotNet Client Library: Test");
headers.Add("developerToken", "dev_token");
headers.Add("applicationToken", "app_token");
headers.Add("version", "v12");

AdWordsUser user = new AdWordsUser(headers);
user.version = "v12";
user.useSandbox();


// Get the services.
CampaignService campaigneService =
(CampaignService)user.getService("CampaignService");
AdGroupService adgroupService =
(AdGroupService)user.getService("AdGroupService");
AdService adService =
(AdService)user.getService("AdService");


{"Das Objekt mit dem Typ com.google.api.adwords.v11.email kann nicht
in den Typ com.google.api.adwords.v12.email konvertiert werden."}
(It cannot convert from v11 to v12)

Must I use sandbox?

Jan Piotrowski (AdWords API Guru)

unread,
Sep 15, 2008, 9:09:06 AM9/15/08
to AdWords API Forum
There is obviously something wrong with the code/library you are
using. There is a mention of v11 of the API, which will not work any
more. Try to find out why email is of type
"com.google.api.adwords.v11.email" instead of
"com.google.api.adwords.v12.email".

Are you sure you've updated all files?

- Jan
Reply all
Reply to author
Forward
0 new messages