Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
IWebmasterApi.AddBlockedUrl
Collapse the table of content
Expand the table of content

IWebmasterApi.AddBlockedUrl

Namespace: Microsoft.Bing.Webmaster.Api

IWebmasterApi.AddBlockedUrl Method

Block page/directory

Syntax

void AddBlockedUrl(
string siteUrl,
BlockedUrl blockedUrl
)

Parameters

siteUrl
Type: System.String
Site url

blockedUrl
Type: Microsoft.Bing.Webmaster.Api.BlockedUrl
Block request

Examples

XML request sample

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

<AddBlockedUrl xmlns="http://schemas.datacontract.org/2004/07/Microsoft.Bing.Webmaster.Api">
<siteUrl>http://example.com</siteUrl>
<blockedUrl xmlns:a="http://schemas.datacontract.org/2004/07/Microsoft.Bing.Webmaster.Api" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<a:Date>0001-01-01T00:00:00</a:Date>
<a:EntityType>Page</a:EntityType>
<a:RequestType>FullRemoval</a:RequestType>
<a:Url>http://example.com/url1</a:Url>
</blockedUrl>
</AddBlockedUrl>

XML response sample

HTTP/1.1 200 OK
Content-Length: 0

JSON request sample

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


{
"siteUrl":"http:\/\/example.com",
"blockedUrl":
{
"__type":"BlockedUrl:#Microsoft.Bing.Webmaster.Api",
"Date":"\/Date(-62135568000000-0800)\/",
"EntityType":0,
"RequestType":1,
"Url":"http:\/\/example.com\/url1"
}
}

JSON response sample

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


{
"d":null
}

See Also

Show:
© 2015 Microsoft