Oh my sweet jesus I was using 'body' instead of 'payload' in UrlFetchApp's 
.fetch method this whole time.
Gods damn this UrlFetchApp implementation.

Thanks for your help Yasar, all's fixed.
On Wednesday, October 5, 2022 at 10:07:19 AM UTC+9 Warren Halderman wrote:

> Hi Yasar,
>
> Thank you for the quick response.
> The curl sample you sent works fine, but my problem is with making the 
> equivalent request in Google Apps Script.
> Making the exact same request (same endpoint, same headers [with my 
> tokens], same body)  using UrlFetchApp.fetch returns an INVALID_VALUE error.
> On Wednesday, October 5, 2022 at 12:45:44 AM UTC+9 adsapi wrote:
>
>> Hi Warren,
>>
>> Thanks for reaching out to the Google Ads API Forum.
>>
>> Kindly note that the *INVALID_VALUE* 
>> <https://developers.google.com/google-ads/api/reference/rpc/v11/KeywordPlanIdeaErrorEnum.KeywordPlanIdeaError#invalid_value>
>>  
>> error indicates that the field's value is invalid. The REST endpoint for 
>> generateKeywordIdeas in order to get a list of keyword ideas. 
>>
>>
>> POST 
>> https://googleads.googleapis.com/v11/customers/{customerId}:generateKeywordIdeas
>>
>> You may try below cURL:
>>
>>
>> curl --location --request POST 
>> 'https://googleads.googleapis.com/v11/customers/***:generateKeywordIdeas' \
>>
>> --header 'Authorization: Bearer ****' \
>>
>> --header 'developer-token: ** \
>>
>> --header 'User-Agent: curl' \
>>
>> --header "login-customer-id: ****" \
>>
>> --header 'Accept: application/json' \
>>
>> --header 'Content-Type: application/json' \
>>
>> --data-raw '{ "keywordSeed": { "keywords": [ "coffee" ] } }'
>>
>> If you encounter any API error, then you may provide complete logs 
>> (complete *request* 
>> <https://developers.google.com/google-ads/api/docs/concepts/field-service#request>
>>  
>> and *response* 
>> <https://developers.google.com/google-ads/api/docs/concepts/field-service#response>
>>  
>> logs with *request ID* 
>> <https://developers.google.com/google-ads/api/docs/concepts/call-structure#request-id>
>>  
>> and *request header* 
>> <https://developers.google.com/google-ads/api/docs/concepts/call-structure#request_headers>)
>>  
>> generated, so that we can check better.  You may send the complete logs via 
>> reply privately to author option.
>>
>> Regards,
>> [image: Google Logo] 
>> Yasar 
>> Google Ads API Team 
>>   
>>
>> ref:_00D1U1174p._5004Q2ex5Oy: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 
"Google Ads API and AdWords 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/907924ba-1796-4edd-a079-f9c0dbbe82e1n%40googlegroups.com.
  • IN... Warren Halderman
    • ... 'Google Ads API Forum Advisor' via Google Ads API and AdWords API Forum
      • ... Warren Halderman
        • ... Warren Halderman

Reply via email to