API: updateUserSupervisorsByEmployeeID

Prev Next
  • SmarterU requires all API calls to POST to HTTPS. Any POST to HTTP will result in the SU:01 error (i.e., No POST data detected.).

  • If you are viewing the help in a language other than English, please change your language to English before copying and pasting any code. All API attributes and functions are in English.

  • Tags are required unless specified.

Description

The updateUserSupervisorsByEmployeeID method adds or removes a user's supervisors using each supervisor's employee ID.

  • Administrators and owners cannot be updated through the API.

  • A user cannot be set as their own supervisor.

Who Has Access

The following users have access to the updateUserSupervisorsByEmployeeID method:

API Call XML Package

<SmarterU>
   <AccountAPI><![CDATA[]]></AccountAPI>
   <UserAPI><![CDATA[]]></UserAPI>
   <Method>updateUserSupervisorsByEmployeeID</Method>
   <Parameters>
      <User>
         <Identifier>
            <Email><![CDATA[]]></Email>
               - OR -
            <EmployeeID><![CDATA[]]></EmployeeID>
         </Identifier>

         <Supervisors>
            <Supervisor>
               <SupervisorEmployeeID><![CDATA[]]></SupervisorEmployeeID>
               <SupervisorAction><![CDATA[]]></SupervisorAction>
            </Supervisor>
         </Supervisors>
      </User>
   </Parameters>
</SmarterU>

The Identifier tag within the User tag group contains the information for the user you want to update. The Supervisors tag group specifies the supervisors to add to or remove from the user.

User Tag Group

The User tag group is a container for the user whose supervisors you want to update.

<User>
   <Identifier>
      <Email><![CDATA[]]></Email>
         - OR -
      <EmployeeID><![CDATA[]]></EmployeeID>
   </Identifier>

   <Supervisors>
      <Supervisor>
         <SupervisorEmployeeID><![CDATA[]]></SupervisorEmployeeID>
         <SupervisorAction><![CDATA[]]></SupervisorAction>
      </Supervisor>
   </Supervisors>
</User>

The User tag contains the following.

Identifier

The identifier of the user you want to update. This tag contains one of the following.

Tag

Description

Email

The user's email address. This tag is mutually exclusive with the EmployeeID tag. The email address can be up to 75 characters long. This is the Email returned by the getUser and listUsers methods.

EmployeeID

The user's employee ID. This tag is mutually exclusive with the Email tag. The employee ID must be between 1 and 100 characters long. This is the EmployeeID returned by the getUser and listUsers methods.

Supervisors

A container for the supervisors to add to or remove from the user. Refer to Supervisors Tag Group.

Supervisors Tag Group

The Supervisors tag group is a container for the user's supervisors. The Supervisors tag must contain at least one Supervisor tag.

<Supervisors>
   <Supervisor>
      <SupervisorEmployeeID><![CDATA[]]></SupervisorEmployeeID>
      <SupervisorAction><![CDATA[]]></SupervisorAction>
   </Supervisor>
</Supervisors>

Each supervisor is contained in a Supervisor tag and contains the following.

SupervisorEmployeeID

The supervisor's employee ID. The supervisor must already exist within your SmarterU account, and cannot be the user being updated. The employee ID must be between 1 and 100 characters long. This is the EmployeeID returned by the getUser and listUsers methods.

SupervisorAction

Indicates whether the supervisor is to be added to or removed from the user. Acceptable values are:

  • Add - Adds the supervisor to the user.

  • Remove - Removes the supervisor from the user.

In the following example, the supervisor with the employee ID E-10482 would be added to the user, and the supervisor with the employee ID E-20917 would be removed from the user.

<Supervisors>
   <Supervisor>
      <SupervisorEmployeeID><![CDATA[E-10482]]></SupervisorEmployeeID>
      <SupervisorAction><![CDATA[Add]]></SupervisorAction>
   </Supervisor>

   <Supervisor>
      <SupervisorEmployeeID><![CDATA[E-20917]]></SupervisorEmployeeID>
      <SupervisorAction><![CDATA[Remove]]></SupervisorAction>
   </Supervisor>
</Supervisors>

API Response XML Package

The API response XML package will always include a Result, Info, and Errors tag.

<SmarterU>
   <Result></Result>
   <Info></Info>

   <Errors>
      <Error>
         <ErrorID></ErrorID>
         <ErrorMessage></ErrorMessage>
      </Error>
   </Errors>
</SmarterU>

Example API Response XML Package

Below is an example of an API response XML package.

<SmarterU>
   <Result>Success</Result>
   <Info></Info>

   <Errors>
   </Errors>
</SmarterU>

Error Codes

Error Code

Message

UUSBE:01

The email address provided is not valid.

UUSBE:02

The employee ID provided must be between 1-100 characters long.

UUSBE:03

The supervisor employee ID provided is not valid.

UUSBE:04

The required permissions are not met to call the updateUserSupervisorsByEmployeeID method.

UUSBE:05

The email address provided is not linked to a user in your account.

UUSBE:06

The employee ID provided is not linked to a user in your account.

UUSBE:07

The requested user cannot be updated via the API.

UUSBE:08

One or more supervisors provided cannot be used.

UUSBE:09

Account user update failed.

UUSBE:10

One or more supervisor actions is invalid. Accepted values are Add or Remove.