Hi,

For each service the API documentation shows the valid field names you can 
use in your *Selector*.

https://developers.google.com/adwords/api/docs/appendix/selectorfields

In your particular case, the fields you want for 
BudgetService<https://developers.google.com/adwords/api/docs/appendix/selectorfields#v201402-BudgetService>
 are: 
BudgetId, BudgetName, Amount.  Note that you can also get the field names 
by reading the *Description* column of the type returned by each service, 
e.g., the 
Budget<https://developers.google.com/adwords/api/docs/reference/v201402/BudgetService.Budget>
 type 
doc shows *This field can be selected using the value "BudgetId"* in the 
description for *budgetId*.

Cheers,
Josh, AdWords API Team

On Sunday, March 16, 2014 4:14:51 PM UTC-4, Moe wrote:
>
> Hi All,
>
> I am trying to change the GetCampaigns.php example in the php library to 
> Get Budget instead.
>
> So I proceeded by changing the CampaignService to BudgetService. I am 
> trying to retreive the name and amount of the budget. But I am getting the 
> following error:
>
> An error has occurred: [SelectorError.INVALID_FIELD_NAME @ selector; 
> trigger:'na
> me', SelectorError.INVALID_FIELD_NAME @ selector; trigger:'amount']
>
>
> The following is a snippet of the code:
>
> function GetBudgetExample(AdWordsUser $user) {
>   // Get the service, which loads the required classes.
>   $budgetService = $user->GetService('BudgetService', ADWORDS_VERSION);
>
>   // Create selector.
>   $selector = new Selector();
>   $selector->fields = array('name', 'amount');
>  // $selector->ordering[] = new OrderBy('name', 'ASCENDING');
>
>   // Create paging controls.
>   $selector->paging = new Paging(0, 
> AdWordsConstants::RECOMMENDED_PAGE_SIZE);
>
>   do {
>     // Make the get request.
>     $page = $budgetService->get($selector);
>
>     // Display results.
>     if (isset($page->entries)) {
>       foreach ($page->entries as $budget) {
>         printf("Budget with name '%s' and amount '%s' was found.\n",
>             $budget->name, $budget->amount);
>       }
>     } else {
>       print "No budgets were found.\n";
>     }
>
>     // Advance the paging index.
>     $selector->paging->startIndex += 
> AdWordsConstants::RECOMMENDED_PAGE_SIZE;
>   } while ($page->totalNumEntries > $selector->paging->startIndex);
> }
>
> Thanks. Please I need a quick reply if possible.
>

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and Google+:
https://googleadsdeveloper.blogspot.com/
https://plus.google.com/+GoogleAdsDevelopers/posts
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API Forum" group.
To post to this group, send email to adwords-api@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"AdWords API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to adwords-api+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
  • BudgetService Moe
    • Re: BudgetService Josh Radcliff (AdWords API Team)

Reply via email to