API: createUser
  • 11 Minutes to read
  • Dark
    Light

API: createUser

  • Dark
    Light

Article summary

  • Starting June 1, 2022, SmarterU will require 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 createUser method adds a user. Administrators and owners cannot be created using the createUser API method and must be added using the SmarterU interface.

If a user already exists in another SmarterU account, a relationship between the user and your account will be created. Due to security restrictions, information contained within your XML package to the SmarterU API may not be saved to a user record. The following settings may NOT be updated if the user exists in another SmarterU account:

  • Email
  • Given Name
  • Surname
  • Password
The account invitation email is NOT sent to users created with the createUser method.

Who Has Access

The following users have access to the createUser method:

API Call XML Package

<SmarterU>
   <AccountAPI><![CDATA[]]></AccountAPI>
   <UserAPI><![CDATA[]]></UserAPI>
   <Method>createUser</Method>    
   <Parameters>
      <User>
         <Info>
            <Email><![CDATA[]]></Email>
            <EmployeeID><![CDATA[]]></EmployeeID>
            <GivenName><![CDATA[]]></GivenName>
            <Surname><![CDATA[]]></Surname>
            <Password><![CDATA[]]></Password>
            <Timezone><![CDATA[]]></Timezone>
            <LearnerNotifications><![CDATA[]]></LearnerNotifications>
            <SupervisorNotifications><![CDATA[]]></SupervisorNotifications>
            <SendEmailTo><![CDATA[]]></SendEmailTo>
            <AlternateEmail><![CDATA[]]></AlternateEmail>
            <AuthenticationType><![CDATA[]]></AuthenticationType>
         </Info>

         <Profile>
            <Supervisors>
               <Supervisor><![CDATA[]]></Supervisor>
            </Supervisors>

            <Organization><![CDATA[]]></Organization>

            <Teams>
               <Team><![CDATA[]]></Team>
            </Teams>

            <CustomFields>
               <CustomField>
                  <CustomFieldName><![CDATA[]]></CustomFieldName>
                  <CustomFieldValue><![CDATA[]]></CustomFieldValue>
               </CustomField>
            </CustomFields>

            <Language><![CDATA[]]></Language>
            <Status><![CDATA[]]></Status>
            <Title><![CDATA[]]></Title>
            <Division><![CDATA[]]></Division>
            <AllowFeedback><![CDATA[]]></AllowFeedback>
            <PhonePrimary><![CDATA[]]></PhonePrimary>
            <PhoneAlternate><![CDATA[]]></PhoneAlternate>
            <PhoneMobile><![CDATA[]]></PhoneMobile>
            <Fax><![CDATA[]]></Fax>
            <Website><![CDATA[]]></Website>
            <Address1><![CDATA[]]></Address1>
            <Address2><![CDATA[]]></Address2>
            <City><![CDATA[]]></City>
            <Province><![CDATA[]]></Province>
            <Country><![CDATA[]]></Country>
            <PostalCode><![CDATA[]]></PostalCode>
            <SendMailTo><![CDATA[]]></SendMailTo>

            <Roles>
               <Role><![CDATA[]]></Role>
               <RoleID><![CDATA[]]></RoleID>
            </Roles>

            <ReceiveNotifications><![CDATA[]]></ReceiveNotifications>
            <HomeGroup><![CDATA[]]></HomeGroup>
         </Profile>

         <Groups>
            <Group>
               <GroupName><![CDATA[]]></GroupName>
                  - OR -
               <GroupID><![CDATA[]]></GroupID>
               <GroupPermissions>
                  <Permission>
                     <Action><![CDATA[]]></Action>
                     <Code><![CDATA[]]></Code>
                  </Permission>
               </GroupPermissions>
            </Group>
         </Groups>

         <Venues>
            <Venue>
               <VenueName><![CDATA[]]></VenueName>
               <Visibility><![CDATA[]]></Visibility>
               <AutoWaitingList><![CDATA[]]></AutoWaitingList>
            </Venue>
         </Venues>       

         <Wages>
            <Wage>
               <EffectiveDate><![CDATA[]]></EffectiveDate>
               <HourlyWage><![CDATA[]]></HourlyWage>
            </Wage>
         </Wages>

      </User>
   </Parameters>
</SmarterU>

User Tag Group

The User tag group is a container for the user's details.

<User>
   <Info>
      <Email><![CDATA[]]></Email>
      <EmployeeID><![CDATA[]]></EmployeeID>
      <GivenName><![CDATA[]]></GivenName>
      <Surname><![CDATA[]]></Surname>
      <Password><![CDATA[]]></Password>
      <Timezone><![CDATA[]]></Timezone>
      <LearnerNotifications><![CDATA[]]></LearnerNotifications>
      <SupervisorNotifications><![CDATA[]]></SupervisorNotifications>
      <SendEmailTo><![CDATA[]]></SendEmailTo>
      <AlternateEmail><![CDATA[]]></AlternateEmail>
      <AuthenticationType><![CDATA[]]></AuthenticationType>
   </Info>

   <Profile>
      <Supervisors>
         <Supervisor><![CDATA[]]></Supervisor>
      </Supervisors>

      <Organization><![CDATA[]]></Organization>

      <Teams>
         <Team><![CDATA[]]></Team>
      </Teams>

      <CustomFields>
         <CustomField>
            <CustomFieldName><![CDATA[]]></CustomFieldName>
            <CustomFieldValue><![CDATA[]]></CustomFieldValue>
         </CustomField>
      </CustomFields>

      <Language><![CDATA[]]></Language>
      <Status><![CDATA[]]></Status>
      <Title><![CDATA[]]></Title>
      <Division><![CDATA[]]></Division>
      <AllowFeedback><![CDATA[]]></AllowFeedback>
      <PhonePrimary><![CDATA[]]></PhonePrimary>
      <PhoneAlternate><![CDATA[]]></PhoneAlternate>
      <PhoneMobile><![CDATA[]]></PhoneMobile>
      <Fax><![CDATA[]]></Fax>
      <Website><![CDATA[]]></Website>
      <Address1><![CDATA[]]></Address1>
      <Address2><![CDATA[]]></Address2>
      <City><![CDATA[]]></City>
      <Province><![CDATA[]]></Province>
      <Country><![CDATA[]]></Country>
      <PostalCode><![CDATA[]]></PostalCode>
      <SendMailTo><![CDATA[]]></SendMailTo>

      <Roles>
         <Role><![CDATA[]]></Role>
         <RoleID><![CDATA[]]></RoleID>
      </Roles>

      <ReceiveNotifications><![CDATA[]]></ReceiveNotifications>
      <HomeGroup><![CDATA[]]></HomeGroup>
   </Profile>

   <Groups>
      <Group>
         <GroupName><![CDATA[]]></GroupName>
            - OR -
         <GroupID><![CDATA[]]></GroupID>
         <GroupPermissions>
            <Permission>
               <Action><![CDATA[]]></Action>
               <Code><![CDATA[]]></Code>
            </Permission>
         </GroupPermissions>
      </Group>
   </Groups>

   <Venues>
      <Venue>
         <VenueName><![CDATA[]]></VenueName>
         <Visibility><![CDATA[]]></Visibility>
         <AutoWaitingList><![CDATA[]]></AutoWaitingList>
      </Venue>
   </Venues>       

   <Wages>
      <Wage>
         <EffectiveDate><![CDATA[]]></EffectiveDate>
         <HourlyWage><![CDATA[]]></HourlyWage>
      </Wage>
   </Wages>

</User>

The User tag may contain the following.

Info

A container for the user's login information. Refer to Info Tag Group.

Profile

A container for the user's profile information. Refer to Profile Tag Group.

Groups

A container for the user's groups and group permissions. Refer to Groups Tag Group.

Venues

A container for the user's venues. Refer to Venues Tag Group.

Wages

A container for the user's wages. Refer to Wages Tag Group.

Info Tag Group

The Info tag group is a container for the user's login information.

<Info>
   <Email><![CDATA[]]></Email>
   <EmployeeID><![CDATA[]]></EmployeeID>
   <GivenName><![CDATA[]]></GivenName>
   <Surname><![CDATA[]]></Surname>
   <Password><![CDATA[]]></Password>
   <Timezone><![CDATA[]]></Timezone>
   <LearnerNotifications><![CDATA[]]></LearnerNotifications>
   <SupervisorNotifications><![CDATA[]]></SupervisorNotifications>
   <SendEmailTo><![CDATA[]]></SendEmailTo>
   <AlternateEmail><![CDATA[]]></AlternateEmail>
   <AuthenticationType><![CDATA[]]></AuthenticationType>
</Info>

The Info tag group may contain the following. 

Email

The user's email address. This tag can be empty if the EmployeeID tag is provided.

EmployeeID

The user's employee ID. This must be a unique value between all users in your SmarterU account. If a blank value is provided, an employee ID is not assigned to the user. A value must be provided if no value is provided for the Email tag.

GivenName

The user's first name.

Surname

The user's last name.

Password

The user's password. The password must comply with the account's password requirements. If no password is provided, a random password will be generated for the user. Regardless of whether a random password is generated or one is provided, the user must change their password the next time they log in (if Single Sign On is not used).

TimeZone (optional)

The user's primary time zone

Acceptable values are listed in the Provided Name column on the Time Zones page. If this tag is not provided, the user’s time zone will default to the account’s time zone.

LearnerNotifications

Indicates whether the user should receive weekly reminders of their pending or outstanding courses in SmarterU:

  • 1 - The user will receive weekly reminders.
  • 0 - The user will not receive weekly reminders. 

SupervisorNotifications

Indicates whether the user should receive weekly reports on the status of their supervisees:

  • 1 - The user will receive weekly reports on their supervisees.
  • 0 - The user will not receive weekly reports on their supervisees.

SendEmailTo

Indicates where the user's emails should be sent:

  • Supervisor -  Emails to the user will be sent to the supervisors' email addresses. If the user has multiple supervisors, emails will be sent to all of the user's supervisors. A supervisor must have a primary email address specified for this option to be allowed. 
  • Self  - Emails to the user are sent to the user's primary email address. An email address must be provided for this option to be allowed.
  • Alternate - Emails to the user will be sent to the email address specified in the AlternateEmail tag. For this option to be allowed, a valid email address must be provided in the AlternateEmail tag.

AlternateEmail

This value is required if the SendEmailTo tag is set to Alternate.

AuthenticationType

Indicates how you would like the user to authenticate:

  • SmarterU - The user will log into SmarterU via the SmarterU interface. 
  • External - The user will log into SmarterU via an external system using single-sign on.
  • Both - The user will log into SmarterU via the SmarterU interface or an external system.

The default is SmarterU.

Profile Tag Group

The Profile tag group is a container for the user's profile information. 

The Profile tag group is required even if doesn't contain any tags.
<Profile>
   <Supervisors>
      <Supervisor><![CDATA[]]></Supervisor>
   </Supervisors>

   <Organization><![CDATA[]]></Organization>
 
   <Teams>
      <Team><![CDATA[]]></Team>
   </Teams>

   <CustomFields>
      <CustomField>
         <CustomFieldName><![CDATA[]]></CustomFieldName>
         <CustomFieldValue><![CDATA[]]></CustomFieldValue>
      </CustomField>
   </CustomFields>

   <Language><![CDATA[]]></Language>
   <Status><![CDATA[]]></Status>
   <Title><![CDATA[]]></Title>
   <Division><![CDATA[]]></Division>
   <AllowFeedback><![CDATA[]]></AllowFeedback>
   <PhonePrimary><![CDATA[]]></PhonePrimary>
   <PhoneAlternate><![CDATA[]]></PhoneAlternate>
   <PhoneMobile><![CDATA[]]></PhoneMobile>
   <Fax><![CDATA[]]></Fax>
   <Website><![CDATA[]]></Website>
   <Address1><![CDATA[]]></Address1>
   <Address2><![CDATA[]]></Address2>
   <City><![CDATA[]]></City>
   <Province><![CDATA[]]></Province>
   <Country><![CDATA[]]></Country>
   <PostalCode><![CDATA[]]></PostalCode>
   <SendMailTo><![CDATA[]]></SendMailTo>

   <Roles>
      <Role><![CDATA[]]></Role>
      <RoleID><![CDATA[]]></RoleID>
   </Roles>

   <ReceiveNotifications><![CDATA[]]></ReceiveNotifications>
   <HomeGroup><![CDATA[]]></HomeGroup>
</Profile>

The Profile tag may contain the following. 

Supervisors (optional)

A container for the user's supervisors .  

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

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

TagDescription
SupervisorThe supervisor's email address.

Organization (optional)

Teams (optional)

A container for the user's teams

<Teams>
    <Team><![CDATA[]]></Team>
</Teams>

Each team is contained in a Team tag and contains the following. 

TagDescription
TeamThe team's name.

CustomFields (optional)

A container for the account's custom user fields

<CustomFields>
   <CustomField>
      <CustomFieldName><![CDATA[]]></CustomFieldName>
      <CustomFieldValue><![CDATA[]]></CustomFieldValue>
   </CustomField>
</CustomFields>

Each custom field is contained in a CustomField tag and contains the following. 

TagDescription
CustomFieldNameThe custom user field's name.
CustomFieldValueThe value to assign to the custom user field. To specify the values for a hierarchical custom user field, separate each level's value with a greater than symbol (>).

Language (optional)

The language used for the user's account.

Status (optional)

The user's status:

  • Active - The user account may be used to access SmarterU. 
  • Inactive - The user account may not be used to access SmarterU. 

The default is Active.

Title (optional)

Division (optional)

AllowFeedback (optional)

Indicates whether the user can provide feedback on online course tasks:

  • 1 - The user can provide feedback on online course tasks. 
  • - The user cannot provide feedback on online course tasks. 
This tag also accepts true or false (must be in lowercase).

PhonePrimary (optional)

PhoneAlternate (optional)

PhoneMobile (optional)

Fax (optional)

Website (optional)

The user's website in its full URL format (eg. https://www.domain.com).

Address1 (optional)

Address2 (optional)

City (optional)

Province (optional)

Country (optional)

The country of the user's address:

  • Canada
  • United States
  • International

PostalCode (optional)

SendMailTo (optional)

Indicates where the user's physical mail should be sent:

Roles (optional)

A container for the user's learning plans

<Roles>
   <Role><![CDATA[]]></Role>
   <RoleID><![CDATA[]]></RoleID>
</Roles>

This tag contains the following.

TagDescription
Role (optional)The learning plan's name.
RoleID (optional)The learning plan's user-specified identifier. This is the RoleID returned by the listRoles method.

ReceiveNotifications (optional)

Indicates whether the user will receive email notifications:

  • True - The user will receive email notifications. 
  • False - The user will not receive email notifications.

The default is True.

HomeGroup (optional)

The name of the user's home group.

If this tag is not provided, the first group in the Group tag group will be used as the user's home group.

Groups Tag Group

The Groups tag group is a container for the user's groups and group permissions

  • At least one group must be added to the user even if they're not assigned any group permissions. 
  • The groups that a user can be added to are linked to the permissions that the calling User API key grants.
<Groups>
   <Group>
      <GroupName><![CDATA[]]></GroupName>
         - OR -
      <GroupID><![CDATA[]]></GroupID>
      <GroupPermissions>
         <Permission>
            <Action><![CDATA[]]></Action>
            <Code><![CDATA[]]></Code>
         </Permission>
      </GroupPermissions>
   </Group>
</Groups>

Each group is contained in a Group tag and may contain the following. 

GroupName

The group's name. This tag is mutually exclusive with the GroupID tag. This is the Name returned by the getGroup and listGroups methods.

GroupID

The group's user-specified identifier. This tag is mutually exclusive with the GroupName tag. This is the GroupID returned by the getGroup and listGroups methods.

GroupPermissions

A container for the user's group permissions.

<GroupPermissions>
   <Permission>
      <Action><![CDATA[]]></Action>
      <Code><![CDATA[]]></Code>
   </Permission>
</GroupPermissions>

Each permission is contained in a Permission tag and contains the following.

TagDescription
ActionIndicates whether your granting or denying the permission:
  • Grant
  • Deny

Although acceptable values are Grant or Deny, you'll likely only use Grant when creating a usre.

CodeThe permission's code:

In the following example, the user would be assigned to the Legal group and granted the Manage Users and Manage Group Users permissions.

<Groups>
   <Group>
      <GroupName>Legal</GroupName>
      <GroupPermissions>
         <Permission>
            <Action>Grant</Action>
            <Code>MANAGE_USERS</Code>
         </Permission>

         <Permission>
            <Action>Grant</Action>
            <Code>MANAGE_GROUP_USERS</Code>
         </Permission>
      </GroupPermissions>
   </Group>
</Groups>

If no child tags are added to the GroupPermissions tag, no group permissions will be granted, but the user will be assigned to the group. In the following example, the user would be added to the Legal group, but would have no permissions on the group.

<Groups>
   <Group>
      <GroupName>Legal</GroupName>
      <GroupPermissions></GroupPermissions>
   </Group>
</Groups>

Venues Tag Group

The Venues tag group is a container for the user's venues.

<Venues>
   <Venue>
      <VenueName><![CDATA[]]></VenueName>
      <Visibility><![CDATA[]]></Visibility>
      <AutoWaitingList><![CDATA[]]></AutoWaitingList>
   </Venue>
</Venues>

Each venue is contained in a Venue tag and contains the following. 

VenueName

The venue's name

Visibility

Indicates whether the venue is visible to the user by default:

  • 1 - The venue is visible to the user by default. 
  • 0 - The venue is not visible to the user by default.

AutoWaitingList

Not yet implemented.

Wages Tag Group

The Wages tag group is a container for the user's wages.

<Wages>
   <Wage>
      <EffectiveDate><![CDATA[]]></EffectiveDate>
      <HourlyWage><![CDATA[]]></HourlyWage>
   </Wage>
 </Wages>

Each wage is contained in a Wage tag and contains the following. 

EffectiveDate

The date that the user's wage took effect. Effective dates are unique for a user's wages.

HourlyWage

The user's wage as a decimal

API Response XML Package

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

<SmarterU>
   <Result></Result>
   <Info>
      <Email><![CDATA[]]></Email>
      <EmployeeID><![CDATA[]]></EmployeeID>
   </Info>

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

The response may also contain the following. 

Email

The user's email address.

EmployeeID

The user's employee ID.

Example API Response XML Package

Below is an example of an API response XML package.

<SmarterU>
   <Result>Success</Result>
   <Info>
      <Email><![CDATA[lori.tran@finashoes.com]]></Email>
      <EmployeeID><![CDATA[U-230495]]></EmployeeID>
   </Info>

   <Errors>
   </Errors>
</SmarterU> 

Error Codes

Error CodeMessage
CU:01
The email address provided is not valid.
CU:02
The employee ID provided is too long.
CU:03
The given name provided is not valid.
CU:04
The surname provided is not valid.
CU:05
The birth date provided is not valid.
CU:06
The password provided is not valid.
CU:07
The time zone provided is not valid.
CU:08
The option specified to send email to is not valid. Available options are Supervisor, Self, or Alternate.
CU:09
The alternate email provided is not valid.
CU:10
The value for learner notifications must be 1 or 0.
CU:11
The value for supervisor notifications must be 1 or 0.
CU:12
The supervisor email address provided is not valid.
CU:13
The province provided is not valid.
CU:14
The country provided is not valid.
CU:15
The value for a users status must be active or inactive.
CU:16
The title provided is too long.
CU:17
The division provided is too long.
CU:18
The value for allowing feedback must be 1 or 0.
CU:19
The hire date provided is not valid.
CU:20
The termination date provided is not valid.
CU:21
The primary phone number provided is not valid.
CU:22
The alternate phone number provided is not valid.
CU:23
The mobile phone number provided is not valid.
CU:24
The fax number provided is not valid.
CU:25
The web site address provided is not valid.
CU:26
The value of address 1 is too long.
CU:27
The value of address 2 is too long.
CU:28
The city provided is too long.
CU:29
The postal code provided is too long.
CU:30
You must provide a group name.
CU:31
A group permission action must be provided.
CU:32
A group permission code must be provided.
CU:33
The email address provided cannot be used.
CU:34
The employee id provided cannot be used.
CU:35
A valid supervisor user must be provided when the SendEmailTo option is set to SUPERVISOR.
CU:36
A valid email address must be provided when the SendEmailTo option is set to SELF.
CU:37
A valid alternate email address must be provided when the SentEmailTo option is set to ALTERNATE.
CU:38
An employee id must be provided when an email address is not.
CU:39
The supervisor provided cannot be used.
CU:40
The language provided is not valid.
CU:41
The status provided is not valid. Only ACTIVE or INACTIVE are allowed values.
CU:42
User creation failed.
CU:43
Account assignment failed.
CU:44
Group assignment failed.
CU:45
Group permission assignment failed.
CU:46
The organization provided is not valid.
CU:47
You must provide at least one team.
CU:48
One or more of the teams provided are not valid.
CU:49
A minimum of one custom fields must be provided.
CU:50
A custom field name and value must be provided for all custom fields.
CU:51
A custom field name provided is not valid.
CU:52
A custom field value provided is not valid.
CU:53
Custom field assignment failed.
CU:54
One or more of the group names/IDs provided are not valid.
CU:55
The required permissions are not met to call the createUser method.
CU:55
You do not have the appropriate permissions to one or more of the groups provided.
CU:56
The SendMailTo value provided is not valid. Only PERSONAL or ORGANIZATION are allowed values.
CU:57
The home group provided is not valid.
CU:58
The home group provided is not in the list of groups the user will be assigned to.
CU:59
Home group assignment failed.
CU:60
The AuthenticationType value provided is not valid. Only SmarterU, External or Both are allowed values.
CU:61
One or more of the roles provided are not valid.
CU:62
The Venue Visibility provided is not valid. Only 1 or 0 are allowed values.
CU:63
The Venue Auto Waiting List provided is not valid. Only 1 or 0 are allowed values.
CU:64
One or more of the group IDs provided is not valid.
CU:65
One or more of the effective dates provided is not valid.
CU:66
One or more of the hourly wages provided is not valid.
CU:67
Wage assignment failed.
CU:68
Wage effective dates must be unique.
CU:69
Venue assignment failed.
CU:70
One or more of the venue names provided are not valid.
CU:71The password provided must contain at least <AccountMinPasswordLength> characters.
CU:73The password provided must not exceed <AccountMaxPasswordLength> characters.
CU:74The password provided must contain at least one uppercase letter, one number, and one non-alphanumeric character.

Was this article helpful?


What's Next