Hi,
As per my original query. I have already tried using
ProductLinkInvitationService.UpdateProductLinkInvitation method to update
the status of the ProductLinkInvitation to ACCEPTED or REJECTED.

Please find the code below. I am not able to see any pending invitations or
accepted invitations even though I have them here.
I want to fetch those invitations first and then accept the correct one.

I am trying to use the Google AdWords API to accept invitations sent from
the YouTube Account.

I have already set up the connection. Using the PHP library for V16:
https://github.com/googleads/google-ads-php/

I am using this with Laravel

I sent a get request to get the list of product invitation links, but I am
receiving an empty array. I could successfully fetch campaigns from Google
ads.

/////////////////// This works well /////////////
public function getAllCampaigns($customerId)
    {
        $googleAdsServiceClient =
$this->client->getGoogleAdsServiceClient();
        $query = '
        SELECT campaign.id, campaign.name FROM campaign ORDER BY campaign.id
        ';

        $stream = $googleAdsServiceClient->searchStream(
            SearchGoogleAdsStreamRequest::build($customerId, $query)
        );

        $allCampaigns = [];
        foreach ($stream->iterateAllElements() as $row) {
            $allCampaigns[] = [
                'campaign_id' => $row->getCampaign()->getId(),
                'campaign_name' => $row->getCampaign()->getName()
            ];
        }

        return $allCampaigns;
    } ///////////////// This does not work /////////////////
public function listPendingYoutubeLinkInvitations($customerId)
    {
        $googleAdsServiceClient = $this->client->
getGoogleAdsServiceClient();
        $query = '
        SELECT product_link_invitation.status,
product_link_invitation.type,
product_link_invitation.product_link_invitation_id,
product_link_invitation.resource_name FROM product_link_invitation
        ';

        $stream = $googleAdsServiceClient->searchStream(
            SearchGoogleAdsStreamRequest::build($customerId, $query)
        );

        $invitations = [];
        foreach ($stream->iterateAllElements() as $row) {
            $invitations[] = $row->getProductLink();
        }

        return $invitations;
    }

Please let me know how to proceed.


On Tue, May 21, 2024 at 5:18 PM Google Ads API Forum Advisor
<adsapi@forumsupport.google> wrote:

> Hi,
>
> Based on the information provided, I understand that you are looking for
> guidance on how to accept the product invitation using the Google Ads API.
> You can use the ProductLinkInvitationService.UpdateProductLinkInvitation
> <https://developers.google.com/google-ads/api/reference/rpc/v16/ProductLinkInvitationService#updateproductlinkinvitation>
>  method
> to update the status of the ProductLinkInvitation
> <https://developers.google.com/google-ads/api/reference/rpc/v16/ProductLinkInvitation>
>  to ACCEPTED or REJECTED.
> I would recommend you to kindly refer to the "Ways to link accounts
> <https://developers.google.com/google-ads/api/docs/account-management/linking-product-accounts#ways_to_link_accounts>"
> documentation for more information.
>
> This message is in relation to case
> "ref:!00D1U01174p.!5004Q02tJ292:ref" (ADR-00235756)
>
> Thanks,
>
> [image: Google Logo] Google Ads API Team
>
>
>

-- 
Thanks & Regards,
Ansh Ved
+91 8898898131
https://anshved.github.io

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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 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 
"Google Ads API and AdWords API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to adwords-api+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/CA%2BBLo0t%3DH8q5B46AcAu%3Db%3DuDgW0Z2z%2BH4bLpLhgbaMEo-Z-c6w%40mail.gmail.com.
  • Go... Ansh Ved
    • ... 'Google Ads API Forum Advisor' via Google Ads API and AdWords API Forum
      • ... Ansh Ved
        • ... 'Google Ads API Forum Advisor' via Google Ads API and AdWords API Forum
          • ... Ansh Ved
            • ... Ansh Ved
              • ... Ansh Ved
                • ... 'Google Ads API Forum Advisor' via Google Ads API and AdWords API Forum
                • ... Ansh Ved
                • ... Ansh Ved
                • ... Ansh Ved
                • ... Ansh Ved
                • ... 'Google Ads API Forum Advisor' via Google Ads API and AdWords API Forum

Reply via email to