- 1 Minute to read
- Print
- DarkLight
API: getRole
- 1 Minute to read
- Print
- DarkLight
- 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 getRole method retrieves a learning plan's details.
Who Has Access
The following users have access to the getRole method:
- Users with the Manage Learning Plans, Certifications, and Requirements or View Learning Plans, Certifications, and Requirements account permission.
- Administrators and owners.
API Call XML Package
<SmarterU>
<AccountAPI><![CDATA[]]></AccountAPI>
<UserAPI><![CDATA[]]></UserAPI>
<Method>getRole</Method>
<Parameters>
<Role>
<Name><![CDATA[]]></Name>
- OR -
<RoleID><![CDATA[]]></RoleID>
</Role>
</Parameters>
</SmarterU>
Role Tag Group
The Role tag group is a container for the learning plan filters.
<Role>
<Name><![CDATA[]]></Name>
- OR -
<RoleID><![CDATA[]]></RoleID>
</Role>
The Role tag contains one of the following.
Name
The learning plan's name. This tag is mutually exclusive with the RoleID tag.
RoleID
The learning plan's user-specified identifier. This tag is mutually exclusive with the Name tag. This is the RoleID returned by the listRoles method.
API Response XML Package
The API response XML package will always include a Result, Info, and Errors tag.
<SmarterU>
<Result></Result>
<Info>
<Role>
<Name><![CDATA[]]></Name>
<RoleID><![CDATA[]]></RoleID>
<CreatedDate></CreatedDate>
<ModifiedDate></ModifiedDate>
<Description><![CDATA[]]></Description>
<UserCount></UserCount>
<CertificationCount></CertificationCount>
<Status></Status>
</Role>
</Info>
<Errors>
<Error>
<ErrorID></ErrorID>
<ErrorMessage></ErrorMessage>
</Error>
</Errors>
</SmarterU>
The learning plan is contained in a Role tag and may contain the following.
Name
The learning plan's name.
RoleID
The learning plan's user-specified identifier.
CreatedDate
The date the learning plan was created.
ModifiedDate
The date the learning plan was last edited.
Description
The learning plan's description.
UserCount
The number of users who are assigned the learning plan.
CertificationCount
The number of certifications associated with the learning plan.
Status
Example API Response XML Package
Below is an example of an API response XML package.
<SmarterU>
<Result>Success</Result>
<Info>
<Role>
<Name><![CDATA[Forklift Operator]]></Name>
<RoleID><![CDATA[LP-2093]]></RoleID>
<CreatedDate>2014-06-17 20:31:31.33</CreatedDate>
<ModifiedDate>2018-06-06 21:20:37.923</ModifiedDate>
<Description><![CDATA[Forklift operators at Fina Shoes.]]></Description>
<UserCount>12</UserCount>
<CertificationCount>2</CertificationCount>
<Status>Active</Status>
</Role>
</Info>
<Errors>
</Errors>
</SmarterU>
Error Codes
Error Code | Message |
---|---|
GR:01 | The name provided is not valid. |
GR:02 | The required permissions are not met to call the getRole method. |
GR:03 | The requested learning plan does not exist. |
GR:04 | The learning plan ID provided is not valid. |