IWebmasterApi.SubmitContent(String, String, String, String, Int32) Method

Definition

Submit Content

public:
 void SubmitContent(System::String ^ siteUrl, System::String ^ url, System::String ^ httpMessage, System::String ^ structuredData, int dynamicServing);
[System.ServiceModel.FaultContract(typeof(Microsoft.Bing.Webmaster.Api.Interfaces.ApiFault))]
[System.ServiceModel.OperationContract]
[System.ServiceModel.Web.WebInvoke(BodyStyle=System.ServiceModel.Web.WebMessageBodyStyle.WrappedRequest, Method="POST")]
public void SubmitContent (string siteUrl, string url,string httpMessage, string structuredData, int dynamicServing);
abstract member SubmitContent :string * string * string * string * int -> unit
Public Sub SubmitContent (siteUrl As String, url As String,httpMessage AS String, structuredData AS String, dynamicServing AS Integer)

Parameters

siteUrl
String

Site url E.g.: http://example.com

url
String

Url to submit E.g.: http://example.com/url1.html

httpMessage
String

HTTP status line, such as HTTP/1.1 200 OK, HTTP Headers, an empty line and optional HTTP message body data equivalent of the response based64 encoded if bingbot was fetching this URL. The request/status line and headers must all end with <CR> <LF> (that is, a carriage return followed by a line feed). The empty line must consist of only <CR> <LF> and no other whitespace.

structuredData
String

Structured Data (typically JSON-LD ) provided based64 encoded typically used for submitting to bing structured Data for non-HTML content types as images, PDF files.Empty if no structured data provided.

dynamicServing
Int32

{none = 0, PC-laptop = 1, mobile = 2, AMP = 3, tablet = 4, non-visual browser = 5}. Set this field to a value greater than 0 only if your web site dynamically serves different content based on customer devices visiting your web site

Attributes

Examples

XML request sample

POST /webmaster/api.svc/pox/SubmitContent?apikey=sampleapikeyedecc1ea4ae341cc8b6 HTTP/1.1 
Content-Type: application/xml; charset=utf-8 
Host: ssl.bing.com 

<SubmitContent xmlns="http://schemas.datacontract.org/2004/07/Microsoft.Bing.Webmaster.Api"> 
<siteUrl>http://example.com</siteUrl> 
<url>http://example.com/url1.html</url> 
<httpMessage>SFRUUC8xLjEgMjAwIE9LDQpEYXRlOiBTdW4sIDEwIE9jdCAyMDE3IDIzOjI2OjA3IEdNVA0KQWNjZXB0LVJhbmdlczogYnl0ZXMNCkNvbnRlbnQtTGVuZ3RoOiAxMTMNCkNvbm5lY3Rpb246IGNsb3NlDQpDb250ZW50LVR5cGU6IHRleHQvaHRtbA0KDQo8IURPQ1RZUEUgaHRtbD4NCjxodG1sPg0KPGhlYWQ+DQo8dGl0bGU+VGVzdCBQYWdlPC90aXRsZT4NCjwvaGVhZD4NCjxib2R5Pg0KPHA+SGVsbG8gd29ybGQhPC9wPg0KPC9ib2R5Pg0KPC9odG1sPg==</httpMessage> 
<structuredData></structuredData> 
<dynamicServing>0</dynamicServing>
</SubmitContent> 

Note:

  1. Do not forget the HTTP status line, such as HTTP/1.1 200 OK

  2. The request/status line and headers must all end with <CR> <LF>(\r\n) (that is, a carriage return followed by a line feed). The empty line must consist of only <CR> <LF>(\r\n) and no other whitespace. In other words, there are 2 <CR> <LF>(\r\n) before the http body.

httpMessage value is the base64 encoded version of :

HTTP/1.1 200 OK
Date: Sun, 10 Oct 2017 23:26:07 GMT
Accept-Ranges: bytes
Content-Length: 113
Connection: close
Content-Type: text/html

<!DOCTYPE html>
<html>
<head>
<title>Test Page</title>
</head>
<body>
<p>Hello world!</p>
</body>
</html>

XML response sample

HTTP/1.1 200 OK
Content-Length: 0

JSON request sample

POST /webmaster/api.svc/json/SubmitContent?apikey=sampleapikeyedecc1ea4ae341cc8b6 HTTP/1.1 
Content-Type: application/json; charset=utf-8 
Host: ssl.bing.com 

{ 
"siteUrl":"http://example.com", 
"url":"http://example.com/url1.html", 
"httpMessage":"SFRUUC8xLjEgMjAwIE9LDQpEYXRlOiBTdW4sIDEwIE9jdCAyMDE3IDIzOjI2OjA3IEdNVA0KQWNjZXB0LVJhbmdlczogYnl0ZXMNCkNvbnRlbnQtTGVuZ3RoOiAxMTMNCkNvbm5lY3Rpb246IGNsb3NlDQpDb250ZW50LVR5cGU6IHRleHQvaHRtbA0KDQo8IURPQ1RZUEUgaHRtbD4NCjxodG1sPg0KPGhlYWQ+DQo8dGl0bGU+VGVzdCBQYWdlPC90aXRsZT4NCjwvaGVhZD4NCjxib2R5Pg0KPHA+SGVsbG8gd29ybGQhPC9wPg0KPC9ib2R5Pg0KPC9odG1sPg==", 
"structuredData":"", 
"dynamicServing":"0" 
} 

JSON response sample

HTTP/1.1 200 OK
Content-Length: 10
Content-Type: application/json; charset=utf-8

{
"d":null
}

Remarks

It is possible to submit only limited number of URLs. GetContentSubmissionQuota(String) should be called to determine how many urls can be submitted.

Currently, API Supports upto 10MB payload uncompressed for the content per request. API supports http Gzip compression.

Applies to