I am using Google Cloud Console Youtube API V3 and tried to list commentThreads of my own video.
I tried different scopes like YoutubeScope and YoutubeReadOnlyScope but nothing changes. Again I faced that problem:googleapi: Error 403: Request had insufficient authentication scopes. Details: [ { "@type": "type.googleapis.com/google.rpc.ErrorInfo", "domain": "googleapis.com", "metadata": { "method": "youtube.api.v3.V3DataCommentThreadService.List", "service": "youtube.googleapis.com" }, "reason": "ACCESS_TOKEN_SCOPE_INSUFFICIENT" } ]
func listComments(service *youtube.Service, videoId string) error { call := service.CommentThreads.List([]string{"id"}).VideoId(videoId).TextFormat("plainText") response, err := call.Do() if err != nil { return err } fmt.Println(response) return nil }
err = listComments(service, "p1H22env11s") if err != nil { log.Fatalf("Error listing comments: %v", err) }