Google search console apis with visual basic net
Google search console apis with visual basic net - Hallo sahabat Breaking News, Pada Artikel yang anda baca kali ini dengan judul Google search console apis with visual basic net, kami telah mempersiapkan artikel ini dengan baik untuk anda baca dan ambil informasi didalamnya. mudah-mudahan isi postingan
Artikel SEO, yang kami tulis ini dapat anda pahami. baiklah, selamat membaca.
Judul : Google search console apis with visual basic net
link : Google search console apis with visual basic net
But with google console search API you can do it automatically.
Google api end point is: PUT https://www.googleapis.com/webmasters/v3/sites/siteUrl
But when I use with rest API
like this: PUT https://www.googleapis.com/webmasters/v3/sites/siteUrl?access_token=myToken
google give Unauthorized
So I try wih authorization by .NET api library
Here is the code:
Dim webmasterScope() As String = New String() {WebmastersService.Scope.Webmasters}
Dim scopes As String() = webmasterScope
credential = GoogleWebAuthorizationBroker.AuthorizeAsync(New ClientSecrets() With { _
.ClientId = yourAppClientID, _
.ClientSecret = yourAppClientSecret _
}, scopes, "user", CancellationToken.None).Result
Here is my code to Add site to google webmaster console:
Dim initializer As New BaseClientService.Initializer()
initializer.HttpClientInitializer = credential
initializer.ApplicationName = "VB.NET Webmaster Tools"
Dim service As WebmastersService = New WebmastersService(initializer)
service.Sites.Add(sUrlToAdd).Execute()
Anda sekarang membaca artikel Google search console apis with visual basic net dengan alamat link https://gpbn1.blogspot.com/2018/01/google-search-console-apis-with-visual.html
Judul : Google search console apis with visual basic net
link : Google search console apis with visual basic net
Google search console apis with visual basic net
As webmaster you may add yout site to google webmaster console manually.But with google console search API you can do it automatically.
Google api end point is: PUT https://www.googleapis.com/webmasters/v3/sites/siteUrl
But when I use with rest API
like this: PUT https://www.googleapis.com/webmasters/v3/sites/siteUrl?access_token=myToken
google give Unauthorized
So I try wih authorization by .NET api library
Here is the code:
Dim webmasterScope() As String = New String() {WebmastersService.Scope.Webmasters}
Dim scopes As String() = webmasterScope
credential = GoogleWebAuthorizationBroker.AuthorizeAsync(New ClientSecrets() With { _
.ClientId = yourAppClientID, _
.ClientSecret = yourAppClientSecret _
}, scopes, "user", CancellationToken.None).Result
Here is my code to Add site to google webmaster console:
Dim initializer As New BaseClientService.Initializer()
initializer.HttpClientInitializer = credential
initializer.ApplicationName = "VB.NET Webmaster Tools"
Dim service As WebmastersService = New WebmastersService(initializer)
service.Sites.Add(sUrlToAdd).Execute()
Demikianlah Artikel Google search console apis with visual basic net
Sekianlah artikel Google search console apis with visual basic net kali ini, mudah-mudahan bisa memberi manfaat untuk anda semua. baiklah, sampai jumpa di postingan artikel lainnya.
Anda sekarang membaca artikel Google search console apis with visual basic net dengan alamat link https://gpbn1.blogspot.com/2018/01/google-search-console-apis-with-visual.html
Posting Komentar untuk "Google search console apis with visual basic net"