IWebmasterApi.AddSiteRoles

Namespace: Microsoft.Bing.Webmaster.Api

IWebmasterApi.AddSiteRoles Method

Delegate site access to user

Syntax

void AddSiteRoles(
string siteUrl,
string delegatedUrl,
string userEmail,
string authenticationCode,
bool isAdministrator,
bool isReadOnly
)

Parameters

siteUrl
Type: System.String
Site url

delegatedUrl
Type: System.String
Url to delegate

userEmail
Type: System.String
LiveId email

authenticationCode
Type: System.String
Authentication code

isAdministrator
Type: System.Boolean
Make user administrator (has access to user role management)

isReadOnly
Type: System.Boolean
Restrict user to only view data

Remarks

queryParameter may contain only unreserved letters and colon symbol (:).
The site can has only limited number of url normalization marameters.

Examples

XML request sample

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

<AddSiteRoles xmlns="http://schemas.datacontract.org/2004/07/Microsoft.Bing.Webmaster.Api">
<siteUrl>http://example.com</siteUrl>
<delegatedUrl>http://host1.example.com</delegatedUrl>
<userEmail>webmaster@example.com</userEmail>
<authenticationCode>258CAD36B9EEE22F1CFDEB4C239D26BB</authenticationCode>
<isAdministrator>false</isAdministrator>
<isReadOnly>true</isReadOnly>
</AddSiteRoles>

XML response sample

HTTP/1.1 200 OK
Content-Length: 0

JSON request sample

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


{
"siteUrl":"http:\/\/example.com",
"delegatedUrl":"http:\/\/host1.example.com",
"userEmail":"webmaster@example.com",
"authenticationCode":"258CAD36B9EEE22F1CFDEB4C239D26BB",
"isAdministrator":false,
"isReadOnly":true
}

JSON response sample

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


{
"d":null
}

See Also

Show: