API: getUserGroups
  • 1 Minute to read
  • Dark
    Light

API: getUserGroups

  • 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 getUserGroups method retrieves a user's groups.

Who Has Access

The following users have access to the getUserGroups method:

API Call XML Package

<SmarterU>
   <AccountAPI><![CDATA[]]></AccountAPI>
   <UserAPI><![CDATA[]]></UserAPI>
   <Method>getUserGroups</Method>

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

</SmarterU>

User Tag Group

The User tag group is a container for the user filter.

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

The User tag contains one of the following. 

ID

The user's system-generated identifier. This tag is mutually exclusive with the Email and EmployeeID tags. This is the ID returned by the getUser method.

Email

The user's email address. This tag is mutually exclusive with the ID and EmployeeID tags. This is the Email returned by the getUser and listUsers methods.

EmployeeID

The user's employee ID. This tag is mutually exclusive with the ID and Email tags. This is the EmployeeID returned by the getUser and listUsers method. 

API Response XML Package

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

<UserGroups>
   <Group>
      <Name><![CDATA[]]></Name>
      <Identifier><![CDATA[]]></Identifier>
      <IsHomeGroup><![CDATA[]]></IsHomeGroup>

      <Permissions>
         <Permission><![CDATA[]]></Permission>
      </Permissions>
   </Group>
</UserGroups>

The UserGroups tag is a container for the groups returned by the getUserGroups method. Each group is contained in a Group tag and may contain the following.

Name

The group's name.

Identifier

The user-specified group identifier.

IsHomeGroup

Indicates whether the group is the user's home group:

  • 0 - The group is not the user's home group.
  • 1 - The group is the user's home group. 

Permissions

A container for the user's group permissions. Each permission is contained in a Permission tag.

Example API Response XML Package

Below is an example of an API response XML package.

<SmarterU>
   <Result>Success</Result>
   <Info>
      <UserGroups>
         <Group>
            <Name><![CDATA[Distribution]]></Name>
            <Identifier/>
            <IsHomeGroup>No</IsHomeGroup>

            <Permissions>
               <Permission><![CDATA[MANAGE_GROUP_USERS]]></Permission>
               <Permission><![CDATA[MANAGE_USERS]]></Permission>
               <Permission><![CDATA[VIEW_LEARNER_RESULTS]]></Permission>
            </Permissions>
         </Group>

         <Group>
            <Name><![CDATA[Human Resources]]></Name>
            <Identifier/>
            <IsHomeGroup>Yes</IsHomeGroup>

            <Permissions>
               <Permission><![CDATA[MANAGE_GROUP]]></Permission>
            </Permissions>
         </Group>

         <Group>
            <Name><![CDATA[Manufacturing]]></Name>
            <Identifier/>
            <IsHomeGroup>No</IsHomeGroup>

            <Permissions>
               <Permission><![CDATA[MANAGE_GROUP_USERS]]></Permission>
               <Permission><![CDATA[MANAGE_USERS]]></Permission>
               <Permission><![CDATA[VIEW_LEARNER_RESULTS]]></Permission>
            </Permissions>
         </Group>

         <Group>
            <Name><![CDATA[Retail]]></Name>
            <Identifier><![CDATA[G-3039]]></Identifier>
            <IsHomeGroup>No</IsHomeGroup>

            <Permissions>
               <Permission><![CDATA[MANAGE_GROUP_USERS]]></Permission>
               <Permission><![CDATA[MANAGE_USERS]]></Permission>
               <Permission><![CDATA[VIEW_LEARNER_RESULTS]]></Permission>
            </Permissions>
         </Group>
      </UserGroups>
   </Info>

   <Errors>
   </Errors>
</SmarterU> 

Error Codes

Error CodeMessage
GUG:01
The email address provided is not valid.
GUG:02
The employee ID provided is not valid.
GUG:03
The user ID provided is not valid.

Was this article helpful?