Google Webmaster API - Mark crawlerros as fixed

125 views Asked by At

While marking the crawl-errors as fixed via the API, I got an 403 error „Insufficient Permission“. If I only read the erros via the api, I got no errors. I’m the owner of the site and I logged with my google webmaster credentials. I've created the API creditals with the developer console and I'm using OAuth. Is there any configuration that disallow writing via the API?

I've found this similar question on StackOverflow: Google Analytics reports API - Insufficient Permission 403 I cant find the View-ID

1

There are 1 answers

0
Thomas On BEST ANSWER

I've found the solution. Just set the Scope to WebmastersService.Scope.Webmasters instead of WebmastersService.Scope.WebmastersReadonly

string[] scopes = { WebmastersService.Scope.Webmasters };

            UserCredential credential = GoogleWebAuthorizationBroker.AuthorizeAsync(new ClientSecrets { ClientId = "clientId", ClientSecret = "clientSecret" }
               , scopes
               , "My Name"
               , CancellationToken.None).Result;