Skip to content

GetDomains API

Returns the domains/libraries the calling user belongs to, directly or through a user group, together with the ones that allow anonymous access, sorted alphabetically by domain name. Archived and hidden libraries are included on the same terms. No role widens the list: an administrator or a User Manager sees only the libraries they are a member of. For every library a caller may administer, membership aside, use GetLibrariesForAdministration.

Endpoint

/srv.asmx/GetDomains

Methods

  • GET /srv.asmx/GetDomains?authenticationTicket=...
  • POST /srv.asmx/GetDomains (form data)
  • SOAP Action: http://tempuri.org/GetDomains

Parameters

Parameter Type Required Description
authenticationTicket string Yes Authentication ticket obtained from AuthenticateUser.

Response

Success Response

Returns a <domains> collection with one <domain> element per domain, sorted alphabetically by name.

<response success="true" error="">
  <domains>
    <domain DomainID="123"
            DomainName="Finance"
            AnonymousDomain="FALSE"
            IsArchive="FALSE"
            IsHidden="FALSE"
            WelcomeMessage="Finance department documents" />
    <domain DomainID="456"
            DomainName="HR"
            AnonymousDomain="FALSE"
            IsArchive="FALSE"
            IsHidden="FALSE"
            WelcomeMessage="" />
    <domain DomainID="789"
            DomainName="OldProjects"
            AnonymousDomain="FALSE"
            IsArchive="TRUE"
            IsHidden="FALSE"
            WelcomeMessage="Archived project files" />
  </domains>
</response>

Error Response

<response success="false" error="[ErrorCode] Error message" />

Domain Element Attributes

Attribute Description
DomainID Unique numeric ID of the domain.
DomainName Name of the domain/library.
AnonymousDomain TRUE if anonymous (guest) access is allowed; FALSE otherwise.
IsArchive TRUE if the domain is archived (offline); FALSE if active.
IsHidden TRUE if the domain is hidden from regular library listings; FALSE otherwise.
WelcomeMessage The domain's configured welcome/description message. May be empty.

Required Permissions

Any authenticated user can call this API.


Example

GET Request

GET /srv.asmx/GetDomains
  ?authenticationTicket=3f2504e0-4f89-11d3-9a0c-0305e82c3301
HTTP/1.1

POST Request

POST /srv.asmx/GetDomains HTTP/1.1
Content-Type: application/x-www-form-urlencoded

authenticationTicket=3f2504e0-4f89-11d3-9a0c-0305e82c3301

SOAP Request

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
               xmlns:tns="http://tempuri.org/">
  <soap:Body>
    <tns:GetDomains>
      <tns:AuthenticationTicket>3f2504e0-4f89-11d3-9a0c-0305e82c3301</tns:AuthenticationTicket>
    </tns:GetDomains>
  </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 every library the caller can see.

const root = await call('GetDomains', { authenticationTicket: ticket });

for (const domain of root.querySelectorAll('domains > domain')) {
  console.log(domain.getAttribute('DomainName'), domain.getAttribute('IsArchive'));
}

A library and a domain are the same thing. The operations are named Domain, the messages say library, and the XML element is <domain>. Its flags come back as the words TRUE and FALSE rather than true/false.

A caller with no ticket is answered as the anonymous user, so the list holds only the libraries flagged anonymous. GetMemberDomains narrows it further, to the ones the caller actually belongs to.

Notes

  • Returns the caller's libraries, including archived (IsArchive="TRUE") and hidden (IsHidden="TRUE") ones they belong to. It never returns a library the caller is not a member of, unless it allows anonymous access; for those, see GetLibrariesForAdministration.
  • Results are sorted alphabetically by domain name.
  • To get only the domains where the calling user is a member, use GetMemberDomains.
  • To get the memberships of a specific user, use GetDomainMembershipsOfUser.
  • For large installations with many domains, this call may return a substantial list.


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
Error Description
[900] Authentication failed Invalid or missing authentication ticket.
[901] Session expired or Invalid ticket The ticket has expired or does not exist.
SystemError:... An unexpected server-side error occurred.