Hi. Aryeh.
Thanks for your previous reply. But we are still having some issues with a
new api.
One of the first steps of getting data from api is to create a client and
pass security credentials into the client. The problem that we have is when
credentials are not valid the API gets stuck and holds the request without
response and without any timeout or error responses. For example, please
see the code below.
Step 1. Creating a new client with *invalid credentials*
client = Google::Ads::GoogleAds::GoogleAdsClient.new do |config|
config.client_id = my_valid_adwords_client_id config.client_secret =
my_valid_adwords_client_secret config.login_customer_id =
my_valid_customer_id config.refresh_token = *'invalid refresh token'*
config.developer_token = my_valid_adwords_developer_token end
Step 2. Trying to retrieve a data from API by using invalid client from
Step 1
def create_keyword_plan operation =
client.operation.create_resource.keyword_plan do |kp| kp.name = "Keyword
plan for traffic estimate ##{timestamp}" kp.forecast_period =
client.resource.keyword_plan_forecast_period do |fp| fp.date_interval =
:NEXT_QUARTER end end keyword_plan_service = client.service.keyword_plan
*response
= keyword_plan_service.mutate_keyword_plans(customer_id:
my_valid_customer_id, operations: [operation])*
response.results.first.resource_name end
When code execution reaches this line
* response = keyword_plan_service.mutate_keyword_plans(customer_id:
my_valid_customer_id, operations: [operation])*
The API gets stuck with no response. The longes that we waited was 30 min.
My questions are. Is there any way to avoid API from getting stuck if
client data is invalid? And what is the API response timeout? Or how to
handle cases like this?
Thanks.
On Monday, November 22, 2021 at 10:11:10 PM UTC adsapi wrote:
> Hi Ruslan,
>
> The sample ad keyword plan code
> <https://developers.google.com/google-ads/api/docs/samples/add-keyword-plan>
> have
> 3 adGroup keywords, you can change then to the ones you want. The sample
> Generate
> Forecast Metrics code
> <https://developers.google.com/google-ads/api/docs/samples/generate-forecast-metrics>
> which
> you can modify will give you 12 months of historical keyword data for each
> of those adGroup keywords.
>
>
> Reminder: Share your feedback about the Google Ads (AdWords) API! Take the
> 2021
> Google Ads API and AdWords API Annual Survey
> <https://google.qualtrics.com/jfe/form/SV_eQbOpf4VxRyyqqO?source=so>
>
> Regards,
> [image: Google Logo]
> Aryeh Baker
> Google Ads API Team
>
>
> ref:_00D1U1174p._5004Q2RA8Jm: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/74d70b17-432a-431c-be55-fb98d5e818edn%40googlegroups.com.