IWebmasterApi.VerifySite(String) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Try to verify user site
public:
bool VerifySite(System::String ^ siteUrl);
[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 bool VerifySite (string siteUrl);
abstract member VerifySite : string -> bool
Public Function VerifySite (siteUrl As String) As Boolean
Parameters
- siteUrl
- String
Returns
- Attributes
Examples
XML request sample
POST /webmaster/api.svc/pox/VerifySite?apikey=sampleapikeyedecc1ea4ae341cc8b6 HTTP/1.1
Content-Type: application/xml; charset=utf-8
Host: ssl.bing.com
<VerifySite xmlns="http://schemas.datacontract.org/2004/07/Microsoft.Bing.Webmaster.Api">
<siteUrl>http://example.com</siteUrl>
</VerifySite>
XML response sample
HTTP/1.1 200 OK
Content-Length: 83
Content-Type: application/xml; charset=utf-8
<Boolean xmlns="http://schemas.microsoft.com/2003/10/Serialization/">true</boolean>
JSON request sample
POST /webmaster/api.svc/json/VerifySite?apikey=sampleapikeyedecc1ea4ae341cc8b6 HTTP/1.1
Content-Type: application/json; charset=utf-8
Host: ssl.bing.com
{
"siteUrl":"http://example.com"
}
JSON response sample
HTTP/1.1 200 OK
Content-Length: 10
Content-Type: application/json; charset=utf-8
{
"d":true
}
Exception | Condition |
---|---|
Thrown with error code InvalidUrl if url is not valid. |
|
Thrown with error code NotAuthorized if the site was not added to user site list. |