GetCurrentUser API¶
Returns the properties of the currently authenticated user. This is a convenience wrapper around GetUser that does not require a userName parameter - the user is determined from the authentication ticket.
Endpoint¶
Methods¶
- GET
/srv.asmx/GetCurrentUser?authenticationTicket=... - POST
/srv.asmx/GetCurrentUser(form data) - SOAP Action:
http://tempuri.org/GetCurrentUser
Parameters¶
| Parameter | Type | Required | Description |
|---|---|---|---|
authenticationTicket |
string | Yes | Authentication ticket obtained from AuthenticateUser |
Response¶
Success Response¶
<root success="true">
<User exists="true"
UserID="42"
FirstName="John"
LastName="Smith"
Email="jsmith@example.com"
Enabled="TRUE"
UserName="jsmith"
Domain="MyLibrary"
LastLogonDate="2026-02-15T10:30:00"
LastPasswordChangeDate="2026-01-10T08:00:00"
AuthenticationAuthority="Native"
ReadOnlyUser="FALSE">
<Preferences>
<!-- User preferences -->
</Preferences>
<TaskRedirectionTo>
<StartDate>2026-10-20T00:00:00Z</StartDate>
<EndDate>2026-10-27T00:00:00Z</EndDate>
<UserId>57</UserId>
<UserName>ajones</UserName>
<FullName>Anne Jones</FullName>
<Email>ajones@example.com</Email>
</TaskRedirectionTo>
<TaskRedirectionsFrom>
<TaskRedirection>
<!-- StartDate, EndDate, UserId, UserName, FullName, Email of a user redirecting to you -->
</TaskRedirection>
</TaskRedirectionsFrom>
</User>
</root>
Response Attributes¶
| Attribute | Type | Description |
|---|---|---|
exists |
string | true if the user exists |
UserID |
int | Unique identifier of the user |
FirstName |
string | User's first name |
LastName |
string | User's last name |
Email |
string | User's email address |
Enabled |
string | TRUE if the user account is enabled, FALSE if disabled |
UserName |
string | User's login name |
Domain |
string | Domain/library the user belongs to |
LastLogonDate |
string | Date of last login (empty if never logged in) |
LastPasswordChangeDate |
string | Date of last password change (empty if never changed) |
AuthenticationAuthority |
string | Authentication source (e.g., Native, LDAP, OAuth) |
ReadOnlyUser |
string | TRUE if the user is a read-only (reader) user, FALSE otherwise |
Error Response¶
Required Permissions¶
The caller must be authenticated. Anonymous users cannot call this API.
Example¶
Request (GET)¶
Request (POST)¶
POST /srv.asmx/GetCurrentUser HTTP/1.1
Content-Type: application/x-www-form-urlencoded
authenticationTicket=abc123-def456
Request (SOAP 1.1)¶
POST /srv.asmx HTTP/1.1
Content-Type: text/xml; charset=utf-8
SOAPAction: "http://tempuri.org/GetCurrentUser"
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<GetCurrentUser xmlns="http://tempuri.org/">
<authenticationTicket>abc123-def456</authenticationTicket>
</GetCurrentUser>
</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;
}
The account the ticket belongs to. It takes no user name.
const root = await call('GetCurrentUser', { authenticationTicket: ticket });
console.log(root.querySelector('User').getAttribute('UserName'));
The same <User> element GetUser returns, for whoever is signed in, with the logon
dates filled in.
Notes¶
- This API internally calls the same logic as
GetUserwith the username resolved from the authentication ticket - Task redirections are in this answer only.
TaskRedirectionTois where your own tasks are redirected,TaskRedirectionsFromlists the users redirecting their tasks to you; each is left out when there is none. GetUser and the user lists (GetAllUsers,GetManagers,GetDomainMembers...) do not carry them - for another user, use GetUserTaskRedirectionTo and GetUserTaskRedirectionsFrom. - See also:
GetUserto retrieve properties of any user by username
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 |