Hi Bryan.
Once again many thanks for the reply.
*Current Issue*
Previous issue was resolved. Currently, I am getting a different error.
This is the error,
* Streaming calls are not supported while using the
REST transport.*
*More comments*
1. Yes I am using the example you are referring.
2. Here is my code,
public static function runExample(GoogleAdsClient $googleAdsClient, int
$customerId)
{
$googleAdsServiceClient =
$googleAdsClient->getGoogleAdsServiceClient();
// Creates a query that retrieves all campaigns.
$query = 'SELECT campaign.id, campaign.name FROM campaign ORDER BY
campaign.id';
// Issues a search stream request.
/** @var GoogleAdsServerStreamDecorator $stream */
$stream = $googleAdsServiceClient->searchStream($customerId,
$query);
// Iterates over all rows in all messages and prints the requested
field values for
// the campaign in each row.
foreach ($stream->readAll() as $response) {
/** @var SearchGoogleAdsStreamResponse $response */
foreach ($response->getResults() as $googleAdsRow) {
/** @var GoogleAdsRow $googleAdsRow */
printf(
"Campaign with ID %d and name '%s' was found.%s",
$googleAdsRow->getCampaign()->getId()->getValue(),
$googleAdsRow->getCampaign()->getName()->getValue(),
PHP_EOL
);
}
}
}
It looks like getting the error, in this line,
$stream = $googleAdsServiceClient->searchStream($customerId, $query);
And it occurs because the function searchStream(.....).
3. Is there anyway I can get the CUSTOMER_ID dynamically, after log in?
Currently, I am using CUSTOMER_ID as a constant.
Please help me to resolve the issue.
Thanks,
Amit
On Wednesday, March 25, 2020 at 12:54:01 AM UTC+5:30, adsapiforumadvisor
wrote:
>
> Hi Amit,
>
> I see that you have several inquiries. You can find my answers below.
>
> For parts 1 and 2, I see that you're trying to use a curl request and
> using our PHP client libraries together. Could you confirm if you're using
> this
> example
> <https://developers.google.com/google-ads/api/docs/samples/get-campaigns>
> to obtain the campaigns?
>
> For part 3, I see that you're having an issue that is with an invalid
> argument. It looks like you're trying to query the campaign information
> from the manager account. You aren't able to perform this action on manager
> accounts as they only manage accounts, not campaigns. For you to obtain
> this information, you will need to query the campaign information from each
> account under the manager account.
>
> 4. You are able to see the customer ID of the current account you're
> logged into by clicking the "?" button on the top right hand corner of the
> UI. It should list your Customer ID.
>
> 5. It is possible to have the same client id, client secret, refresh
> token, and developer token used in the same API call type for all 10
> different accounts. You just need to make sure that the user is given
> correct access in the manager account that holds these 10 accounts. You can
> check this by going into "Tools & Settings" > "Setup" > "Account Access".
> Under the "Users" tab, you should be able to find a list of users that are
> given access to the manager account and the accounts underneath it.
>
> Let me know if you have further questions.
>
> Thank you,
> Bryan, Google Ads API Team
>
> ref:_00D1U1174p._5001UXVi3P:ref
>
--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog:
https://googleadsdeveloper.blogspot.com/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
You received this message because you are subscribed to the Google
Groups "AdWords API and Google Ads API Forum" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
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 and Google Ads API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/adwords-api/34c9f481-2fb2-4459-886a-ebef3914553e%40googlegroups.com.