Re: BudgetOrderService and DateRange

20 views
Skip to first unread message
Message has been deleted

Milind Sankeshware (AdWords API Team)

unread,
Oct 24, 2018, 11:51:34 AM10/24/18
to AdWords API and Google Ads API Forum
Hello, 

I deleted your post as it contains your confidential information such as billing information. In the future, you may refer to this post for guidelines on posting in this forum

On Wednesday, October 24, 2018 at 6:58:33 AM UTC-4, Максим Пахряев wrote:
First I try to get a list of BudgetOrders:
$budget = $google->service(BudgetOrderService::class)->getService()->get(new Selector([]))->getEntries()[0];

Result:
BudgetOrder {#809 ▼
  #billingAccountId: "#######"
  #id: ########
  #billingAccountName: "AdWords #######"
  #poNumber: null
  #budgetOrderName: null
  #primaryBillingId: "#########"
  #secondaryBillingId: null
  #spendingLimit: Money {#### ▶}
  #totalAdjustments: Money {#### ▶}
  #startDateTime: "20160421 180610 Asia/Yekaterinburg"
  #endDateTime: "20371231 125959 Asia/Yekaterinburg"
  #lastRequest: BudgetOrderRequest {#### ▶}
}

Then I try to get a list of Budget Orders by specifying DateRange:
$dateRange->setMin(Carbon::now()->subMonth()->format('Ymd'));
$dateRange->setMax(Carbon::now()->format('Ymd'));
$selector = new Selector();
$selector->setDateRange($dateRange);
$budget2 = $google->service(BudgetOrderService::class)->getService()->get($selector)->getEntries()[0];

And result again:
BudgetOrder {#739 ▼
  #billingAccountId: "######"
  #id: ####
  #billingAccountName: "AdWords ######"
  #poNumber: null
  #budgetOrderName: null
  #primaryBillingId: "######"
  #secondaryBillingId: null
  #spendingLimit: Money {#### ▶}
  #totalAdjustments: Money {#### ▶}
  #startDateTime: "20160421 180610 Asia/Yekaterinburg"
  #endDateTime: "20371231 125959 Asia/Yekaterinburg"
  #lastRequest: BudgetOrderRequest {#### ▶}
}

Why is the DateRange parameter ignored?

Milind Sankeshware (AdWords API Team)

unread,
Oct 24, 2018, 2:03:47 PM10/24/18
to AdWords API and Google Ads API Forum
Hi,

The daterange field is only used by the report download service. For all other services, it is ignored. You could filter based on the BudgetOrder.startDateTime or BudgetOrder.endDateTime. This post about the same topic should be helpful for you.

Thanks,
Milind, AdWords API Team
Reply all
Reply to author
Forward
0 new messages