c# - GoogleApiException in Google.Apis.Adexchangebuyer.v13 when calling AdexchangebuyerService.Creatives.List -
i getting exception when calling list high number ( > 20 ) creative ids. when calling list 10 creatives, works fine, , takes 30 s each call.
below exception details :
google.googleapiexception caught hresult=-2146233088 message=google.apis.requests.requesterror backend error [500] errors [ message[backend error] location[ - ] reason[backenderror] domain[global] ] source=google.apis servicename=adexchangebuyer stacktrace: @ google.apis.requests.clientservicerequest`1.execute() in c:\code\google.com\google-api-dotnet-client\default\tools\google.apis.release\bin\debug\test\default\src\googleapis\apis\requests\clientservicerequest.cs:line 102 innerexception:
this calling code using google.apis.adexchangebuyer.v1_3 1.9.0.48: (i tried using 1.9.0.51)
var listrequest = this.adexchangebuyerservice.creatives.list(); listrequest.maxresults = 1000; listrequest.buyercreativeid = new repeatable<string>(creativeids ); // creativeids ienumerable<string>; (fails 20 creative ids, passes 10) var listofcreatives = listrequest.execute(); // -- exception thrown here
the request captured in fiddler using client library:
get https://www.googleapis.com/adexchangebuyer/v1.3/creatives?key={your_api_key}&pagetoken=mypagetoken&maxresults=1000&buyercreativeid=i7bhb44u&buyercreativeid=f5bfbul2 http/1.1 user-agent: adexchangebuyer google-api-dotnet-client/1.9.1.12394 (gzip)
this request using web interface (https://developers.google.com/ad-exchange/buyer-rest/v1.3/creatives/list):
get https://www.googleapis.com/adexchangebuyer/v1.3/creatives?buyercreativeid=i7bhb44u&buyercreativeid=f5bfbul2&key={your_api_key}
it looks call long , kind of getting timeout. recommend try 1 of following:
- if have more x (in case 10) items, split more 1 call. looks 10 items takes more 20s, can split it, , not sort of timeout.
change default timeout higher number default (which read somewhere that's 100s, didn't find in official documentation - https://msdn.microsoft.com/en-us/library/system.net.http.httpclient.timeout%28v=vs.118%29.aspx). can following:
this.adexchangebuyerservice.httpclient.timeout = timespan.fromseconds(200);
Comments
Post a Comment