Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

Google Adwords API 404 Status

463 views
Skip to first unread message

Sam

unread,
May 16, 2013, 7:22:38 AM5/16/13
to adwor...@googlegroups.com

I am using google adwords api to get all accounts, I am getting The request failed with HTTP status 404: Not Found., on this line :

ManagedCustomerPage page = managedCustomerService.get(selector);

When searching found out need to use latest service, but as you can see I am using v201302, can someone please point me to right direction.

Here is my code:

 static AdWordsUser user;

        public void GetAccounts()
        {
            user = new AdWordsUser();
            ManagedCustomerService managedCustomerService = (ManagedCustomerService)user.GetService(AdWordsService.v201302.ManagedCustomerService);

            //create a selector
            Selector selector = new Selector();
            selector.fields = new string[] { "Login", "CustomerId", "Name" };

            //get all campaigns
            ManagedCustomerPage page = managedCustomerService.get(selector);

            //Display all Campaigns
            if (page != null && page.entries != null && page.entries.Length > 0)
            {
                foreach (ManagedCustomer mc in page.entries)
                {
                    string s = string.Format("campaign with id = '{0}', name = '{1}', and status = '{2}' was found.", mc.login, mc.customerId, mc.name);
                }
            }

Oliver

unread,
May 16, 2013, 10:16:28 AM5/16/13
to adwor...@googlegroups.com
You need to specify which user to access data for.  You need to create an AdwordsSession object.  Check the example Java code here on how to do this:


Oliver
Reply all
Reply to author
Forward
0 new messages