IWebmasterApi.SubmitUrl
1 |
API Reference > IWebmasterApi Members |
1 2 3 4 |
void SubmitUrl( string siteUrl, string url ) |
1 2 3 4 5 6 7 8 9 |
POST /webmaster/api.svc/pox/SubmitUrl?apikey=EEDECC1EA4AE341CC57365E075EBC8B6 HTTP/1.1 Content-Type: application/xml; charset=utf-8 Host: ssl.bing.com Content-Length: 127 <SubmitUrl xmlns="http://schemas.datacontract.org/2004/07/Microsoft.Bing.Webmaster.Api"> <siteUrl>http://example.com</siteUrl> <url>http://example.com/url1.html</url> </SubmitUrl> |
from : https://msdn.microsoft.com/en-us/library/jj554133.aspx
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
namespace kutayzorlucom_webServeice_BING_API_EXAMPLE { using System; using System.Linq; using System.ServiceModel; internal class Program { private static void Main(string[] args) { var api = new WebmasterApi.WebmasterApiClient(); try { var oneMonthAgo = DateTime.Now.AddMonths(-1); var stats = api.GetRankAndTrafficStats("http://www.kutayzorlu.com/") .Where(s => s.Date > oneMonthAgo) .OrderBy(s => s.Date); Console.WriteLine("Date\tImpressions\tClicks"); foreach (var value in stats) { Console.WriteLine( value.Date.ToShortDateString()+", "+value.Impressions, value.Clicks); } } catch (FaultException<WebmasterApi.ApiFault> fault) { Console.WriteLine("Failed to add site: {0}", fault.Message); } } } } |
How to get API KEY (https://msdn.microsoft.com/en-us/library/hh969388.aspx)
1 2 3 4 5 6 7 8 9 |
Getting your API Key To be able to get your Webmaster API Key, follow the steps below: Sign into your Bing Webmaster account at http://www.bing.com/webmaster with your LiveID. If you do not already have a LiveID you can get one by clicking "Sign up with Windows LiveID” If you have no verified sites, please add and verify one. Then click on any site and select Webmaster API on the left hand side. Read the Terms and Conditions if not done so already Select on Generate to create an API Key. You only get 1 API key at a time |
Bing Webmaster Tools API Services
The Bing Webmaster Tools API Services has the following protocols that can be used to get, call, submit, and retrieve data from Bing Webmaster to your website.
Webmaster API supports the following protocols:
SOAP – Simple Object Access Protocol
Simple Object Access Protocol (“SOAP”) is a structure on which to exchange information with Extensible Markup Language (“XML”). Example of SOAP is that you could send a SOAP message to a website that has Web Services Enabled and receive information back from the website in XML that could then be used or implemented into a website.
POX/HTTP – Plain Old XML over HTTP
Plain Old XML (“POX”) is a term for basic XML and is an information format style. POX is compatible with the XML Schema. POX messages can be sent and received by many types of clients, including clients such as Web browsers that do not have any native support for SOAP-based protocols. POX is a suitable choice for services that exchange data over HTTP and have no requirement to use the advanced protocol capabilities of SOAP and WS-* such as non-HTTP transports, message exchange patterns other than request/response, and message-based security, reliability, and transactions.
JSON/HTTP – JavaScript Object Notation over HTTP
JavaScript Object Notation (“JSON”) is an imitated or copied from the JavaScript Language in order to provide simple data structures that can be text based.