• Share
    • Twitter
    • LinkedIn
    • Facebook
    • Email
  • Feedback
  • Edit
Show / Hide Table of Contents

getUser

Some tooltip text!
• 1 minute to read
 • 1 minute to read

Description

With this method, you can get various information about the logged-in user (using the sessionKey). Just supply the fields you want to retrieve.

Valid fields:

  • user.id
  • user.name
  • user.firstname
  • user.middlename
  • user.lastname
  • user.email
  • user.loginname
  • user.username
  • user.language (0 = English, 1 = Norwegian)

In parameters

Parameter Description
sessionKey A valid session key
userFields An array of strings where each element is one of the above

Out parameters

Parameter Description
errorCode See list of codes
userResult An array of ResultStruct where each element is of the form:
field (name of the requested field)
value (the value of the requested field)
type (the type of the requested field)

Example

admin.adminService adminService = new admin.adminService();
ticket.ticketService ticketService = new ticket.ticketService();

string sessionKey;
string errorCode = ticketService.login("egon", "pass1234", out sessionKey);

if (errorCode.Equals("0"))
{
  admin.ResultStruct[] userResult;
  string[] userFields = new string[2];
  userFields[0] = "user.id";
  userFields[1] = "user.email";
  errorCode = adminService.getUser(sessionKey, userFields, out userResult);

  foreach(admin.ResultStruct i in userResult)
  {
    string field = i.field; // Here you get the field
    string value = i.value; // Here you get the value
    string type = i.type;   // Here you get the type
  }
}
© SuperOffice. All rights reserved.
SuperOffice |  Community |  Release Notes |  Privacy |  Site feedback |  Search Docs |  About Docs |  Contribute |  Back to top