I have fixed this. The problem was caused by the fact that I'm running a 32-bit version of PHP locally, which causes the ID to overflow. I've since installed a 64-bit version and it works flawlessly.
Op dinsdag 9 oktober 2018 12:58:28 UTC+2 schreef Mike Hagendoorn: > > Hi, > > I'm trying to create ads using the PHP API. The problem I'm having is the > following: > > I'm using this example code found on GitHub > <https://github.com/googleads/googleads-php-lib/blob/master/examples/AdWords/v201809/BasicOperations/GetAdGroups.php> > to > retrieve my AdGroups. This seems to work fine and returns the 2 AdGroups I > have, (I omitted the last 3 chars of the IDs): > > Ad group with ID -1627709*** and name 'AdGroup 2018-10-08 09:59:11' was found. >> Ad group with ID -1780708*** and name 'AdGroup 2018-10-09 08:56:30' was >> found. >> Number of results found: 2 >> >> > However, when I try to create a ad with one of the ID's mentioned above > using > this example found on GitHub > <https://github.com/googleads/googleads-php-lib/blob/master/examples/AdWords/v201809/BasicOperations/AddExpandedTextAds.php>, > the > code always crashes with this error: > > *Fatal error*: Uncaught Google\AdsApi\AdWords\v201809\cm\ApiException: >> [EntityNotFound.INVALID_ID @ operations[0].operand.adGroupId; >> trigger:'TempAdGroupId: 1780708912'] in > > > After some tinkering around, I found that when you open your AdWords > dashboard and navigate to your AdGroups the following is found in the URL: > > &adGroupId=66938767*** > > > When I add that ID to my code instead of the one that is returned by the > GetAdGroups method, the ad is generated just fine. > > I'm at a loss here; am I doing something wrong or is the example wrong? > -- -- =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ 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]. Visit this group at https://groups.google.com/group/adwords-api. To view this discussion on the web visit https://groups.google.com/d/msgid/adwords-api/9fb94d7d-7ccd-430d-a34b-14172786e588%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
