YouTube API v3.0 CommentsThread.list proccessing f

2019-06-06 02:35发布

问题:

When I send a comments thread. List request to the YouTube API I get the following exception "But not for all videos":

Google.GoogleApiException: Google.Apis.Requests.RequestError
The API server failed to successfully process the request. 

While this can be a transient error, it usually indicates that the requests input is invalid. Check the structure of the commentThread resource in the request body to ensure that it is valid. [400].

And for those videos I double checked the inputs sent with the request and I make the request with the same data directly from the YouTube API requests trial section but everything goes right!

I want to know why this request becomes valid on some video ID's but invalid on the others ? I'll appreciate any help.

Here is the full written log: System.AggregateException: One or more errors occurred. ---> Google.GoogleApiException: Google.Apis.Requests.RequestError The API server failed to successfully process the request. While this can be a transient error, it usually indicates that the requests input is invalid. Check the structure of the commentThread resource in the request body to ensure that it is valid. [400] Errors [ Message[The API server failed to successfully process the request. While this can be a transient error, it usually indicates that the requests input is invalid. Check the structure of the commentThread resource in the request body to ensure that it is valid.] Location[body - other] Reason[processingFailure] Domain[youtube.commentThread] ]

at Microsoft.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at Microsoft.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccess(Task task) at Google.Apis.Requests.ClientServiceRequest`1.d__0.MoveNext() in c:\ApiaryDotnet\default\Src\GoogleApis\Apis\Requests\ClientServiceRequest.cs:line 0 --- End of inner exception stack trace ---

回答1:

CommentThreads.list API doesn't need a request body as indicated in the API reference

Request body

Do not provide a request body when calling this method.

This may have caused the RequestError on your call. Try to remove any objects passed when calling this API, hopefully this would fix the issue.



标签: youtube-api