GetManagedDomainsByUser API¶
Returns the list of domains/libraries that a user has management (administration) rights on. Omitting userName retrieves the managed domains of the currently authenticated user. Another user's managed domains are answered to whoever may look that user up: administrators, User Managers, the managers of the user's library, and the user's co-workers. Up to 9.0 it was administrators only.
Endpoint¶
Methods¶
- GET
/srv.asmx/GetManagedDomainsByUser?authenticationTicket=...&userName=... - POST
/srv.asmx/GetManagedDomainsByUser(form data) - SOAP Action:
http://tempuri.org/GetManagedDomainsByUser
Parameters¶
| Parameter | Type | Required | Description |
|---|---|---|---|
authenticationTicket |
string | Yes | Authentication ticket obtained from AuthenticateUser |
userName |
string | No | Username whose managed domains to retrieve. Leave empty or omit to retrieve the authenticated user's own managed domains. |
Response¶
Success Response¶
<root success="true">
<domains>
<domain
DomainID="1"
DomainName="Corporate"
AnonymousDomain="FALSE"
IsArchive="FALSE"
IsHidden="FALSE"
WelcomeMessage="Welcome to the Corporate library" />
<domain
DomainID="5"
DomainName="HRDocuments"
AnonymousDomain="FALSE"
IsArchive="FALSE"
IsHidden="FALSE"
WelcomeMessage="" />
</domains>
</root>
When the user manages no domains the <domains> element is empty:
Error Response¶
Domain Attributes¶
| Attribute | Type | Description |
|---|---|---|
DomainID |
int | Unique numeric identifier of the domain/library |
DomainName |
string | Name of the domain/library |
AnonymousDomain |
TRUE/FALSE | Whether anonymous (unauthenticated) access is enabled on this library |
IsArchive |
TRUE/FALSE | Whether this library is an archived (offline) library |
IsHidden |
TRUE/FALSE | Whether this library is hidden from the library listing |
WelcomeMessage |
string | Welcome message configured for the library (may be empty) |
Required Permissions¶
- Any authenticated user may retrieve their own managed domains (omit
userNameor pass their own username). - Retrieving another user's managed domains is allowed to whoever may look that user up (see AdministrativeRoles): administrators, members of
[User Managers], the managers of the user's library, and the user's co-workers - members of a library the caller also belongs to. Anyone else receives4030. Up to 9.0 only an administrator could ask about another user, so a User Manager could not see who manages what.
Example Requests¶
Get own managed domains (GET)¶
Get another user's managed domains (GET)¶
GET /srv.asmx/GetManagedDomainsByUser?authenticationTicket=abc123-def456&userName=jsmith HTTP/1.1
Host: yourserver
POST Request¶
POST /srv.asmx/GetManagedDomainsByUser HTTP/1.1
Host: yourserver
Content-Type: application/x-www-form-urlencoded
authenticationTicket=abc123-def456&userName=jsmith
SOAP 1.1 Request¶
POST /srv.asmx HTTP/1.1
Content-Type: text/xml; charset=utf-8
SOAPAction: "http://tempuri.org/GetManagedDomainsByUser"
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<GetManagedDomainsByUser xmlns="http://tempuri.org/">
<authenticationTicket>abc123-def456</authenticationTicket>
<userName>jsmith</userName>
</GetManagedDomainsByUser>
</soap:Body>
</soap:Envelope>
JavaScript¶
Every call answers XML with HTTP 200, success or not, so success is the thing to branch on and
errorCode is the number to report.
async function call(action, params) {
const response = await fetch(`/srv.asmx/${action}?${new URLSearchParams(params)}`);
const root = new DOMParser()
.parseFromString(await response.text(), 'text/xml')
.documentElement;
if (root.getAttribute('success') !== 'true') {
throw new Error(`${root.getAttribute('errorCode')}: ${root.getAttribute('error')}`);
}
return root;
}
Lists the libraries one user manages.
const root = await call('GetManagedDomainsByUser', {
authenticationTicket: ticket,
userName: 'jsmith' // empty answers for the caller
});
userName is optional: leaving it empty answers for whoever is asking rather than being refused.
A name nobody has is 4000 here, where most of this family answers 4041 for a missing user.
Notes¶
- Omitting
userName(or passing an empty string) returns the managed domains of the currently authenticated user — no elevated permissions required. - The
userNamefield in the SOAP contract is non-nullable; pass an empty string""to retrieve the current user's own managed domains via SOAP. - Compare with GetDomainMembershipsOfUser which returns domains the user is a member of, regardless of management rights.
- Compare with GetManagers which returns the managers of a specific domain.
Error Codes¶
The errorCode values this operation returns, checked against a running server:
errorCode |
When |
|---|---|
4010 |
the ticket is expired or unknown, or there is no ticket at all |
4000 |
no user by that name - note this is 4000, not the 4041 its neighbours use |
| Error | Description |
|---|---|
[901] |
Session expired or invalid authentication ticket |
[4030] |
Access denied - the caller may not look up the user asked about (errorCode 4030). Up to 9.0 this was [1573] "Only the system administrator can perform this operation" for every non-administrator; up to 8.7 it said only search administrators could. |
| User not found | The specified userName does not exist |