is it possible to add a new feeditem and a feeditemtarget belonging to it by making a single atomic Google Ads API call?

21 views
Skip to first unread message

So

unread,
Jun 1, 2020, 9:44:26 AM6/1/20
to AdWords API and Google Ads API Forum
Hi,

I am a .net developer.
I've heard that you can mutate different kinds of related resources by only one request, which is a sort of transaction in RDBMS(all or nothing). 
Also I've heart that to do so you've got to give a negative integer to the id which you are trying to create.

So, My code is something like below

**********************************
    var googleAdsService = client.GetService(Google.Ads.GoogleAds.Services.V3.GoogleAdsService);

    googleAdsService.Mutate(googleAdsId, new List<MutateOperation>

                    {
                        new MutateOperation
                        {
                            FeedItemOperation = new FeedItemOperation
                            {
                                Create = new FeedItem {  ResourceName = "customers/{customers_id}/feedItems/{feed_id}~-1", ... }
                            },
                        new MutateOperation
                        {
                            FeedItemTargetOperation = new FeedItemTargetOperation
                            {
                                Create = new FeedItemTarget { FeedItem = "customers/{customers_id}/feedItems/{feed_id}~-1", ... }
                            }
                        },
                    });

**********************************

But, I only get an error saying  something like this : "you do not have the permission to do this kind of operation".
I can add a feeditem to a feed by making one request and then add an feeditemtarget to it by making another request, but this is not exactly what I want to do.
Succeeding in Adding a feeditem and then failing in adding a feeditemtarge to it is what I want to avoid the most.

Where am I wrong?
Is there any good idea?

Thanks

Google Ads API Forum Advisor Prod

unread,
Jun 1, 2020, 2:17:49 PM6/1/20
to so.ot...@gmail.com, adwor...@googlegroups.com
Hi,

Thank you for reaching out. This can be performed through a batch processing operation. Both of those operations are supported in the MutateJobService. You can find information on using temporary IDs here. They are necessary when one of your operations in your batch job is dependent on a resource being created in another operation.

If you are still receiving any errors, please share your complete detailed request and response logs via Reply privately to author so I can further investigate the issue. You can find information on enabling logging here (set log level to DEBUG).

Regards,
Mitchell
Google Ads API Team

ref:_00D1U1174p._5004Q1ztO9a:ref
Reply all
Reply to author
Forward
0 new messages