API: createRole
  • 2 Minutes to read
  • Dark
    Light

API: createRole

  • 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

Learning Plans were previously referred to as roles

The createRole method adds a learning plan.

Who Has Access

The following users have access to the createRole method:

API Call XML Package

<SmarterU>
   <AccountAPI><![CDATA[]]></AccountAPI>
   <UserAPI><![CDATA[]]></UserAPI>
   <Method>createRole</Method>
   <Parameters>
      <Role>
         <Name><![CDATA[]]></Name>
         <RoleID><![CDATA[]]></RoleID>
         <Status><![CDATA[]]></Status>
         <Description><![CDATA[]]></Description>
         <Certifications>
            <Certification>
               <CertificationName><![CDATA[]]></CertificationName>
               <MandateLevel><![CDATA[]]></MandateLevel>
            </Certification>
         </Certifications>
      </Role>
   </Parameters>
</SmarterU>

Role Tag Group

The Role tag group is a container for the learning plan's details.

<Role>
   <Name><![CDATA[]]></Name>
   <RoleID><![CDATA[]]></RoleID>
   <Status><![CDATA[]]></Status>
   <Description><![CDATA[]]></Description>
   <Certifications>
      <Certification>
         <CertificationName><![CDATA[]]></CertificationName>
         <MandateLevel><![CDATA[]]></MandateLevel>
      </Certification>
   </Certifications>
</Role>

 The Role tag may contain the following. 

Name

The learning plan's name

RoleID (optional tag)

A learning plan's user-specified identifier.

Status

The learning plan's status. Acceptable values are Active or Inactive

Description

The learning plan's description.

Certifications

A container for the learning plan's certifications. Refer to Certifications Tag Group.

Certifications Tag Group

The Certifications tag group is a container for the learning plan's certifications.

<Certifications>
   <Certification>
      <CertificationName><![CDATA[]]></CertificationName>
      <MandateLevel><![CDATA[]]></MandateLevel>
   </Certification>
</Certifications>

Each certification is contained in a Certification tag and may contain the following.

CertificationName

The certification's name

MandateLevel

The certification's mandate level. Acceptable values are:

  • Mandatory - The certification is required for the learning plan.
  • Recommended - The certification is not required, but recommended for the learning plan.
  • Optional - The certification is optional for the learning plan. 

API Response XML Package

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

<SmarterU>
   <Result></Result>
   <Info>
      <Role><![CDATA[]]></Role>
      <RoleID><![CDATA[]]></RoleID>
   </Info>
   <Errors>
      <Error>
         <ErrorID></ErrorID>
         <ErrorMessage></ErrorMessage>
      </Error>
   </Errors>
</SmarterU>

The response may also contain the following.

Role

The learning plan's name.

RoleID

The learning plan's user-specified identifier.

Example API Response XML Package

Below is an example of an API response XML package.

<SmarterU>
   <Result>Success</Result>
   <Info>
      <Role><![CDATA[Manufacturing Floor Manager]]></Role>
      <RoleID><![CDATA[LP-1324]]></RoleID>
   </Info>

   <Errors>
   </Errors>
</SmarterU> 

Error Codes

Error CodeMessage
CR:01
The name provided is not valid.
CR:02
The status provided is not valid.
CR:03
The description provided is not valid.
CR:04
The certification name provided is not valid.
CR:05
The mandate level provided is not valid.
CR:06
The required permissions are not met to call the createRole method.
CR:07
One or more of the certification names provided are not valid.
CR:08
One or more mandate levels provided are not valid. Acceptable values are Mandatory, Optional, or Recommended.
CR:09
The status provided is not valid. Acceptable values are Active or Inactive.
CR:10
Learning plan name cannot be used.
CR:11
One or more certifications provided are not valid. Certifications cannot be added more than once.
CR:12
Learning plan ID cannot be used.
CR:13
The learning plan ID provided is not valid.

Was this article helpful?


What's Next