API: createCredential
  • 6 Minutes to read
  • Dark
    Light

API: createCredential

  • 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 createCredential method adds a global action.

Actions were previously referred to credentials.  

Who Has Access

The following users have access to the createCredential method:

API Call XML Package

<SmarterU>
   <AccountAPI><![CDATA[]]></AccountAPI>
   <UserAPI><![CDATA[]]></UserAPI>
   <Method>createCredential</Method>
   <Parameters>
      <Credential>
         <Name></Name>
         <Status></Status>
         <Description></Description>
         <AllowsAttachments></AllowsAttachments>
         <Expires></Expires>
         <DaysGood></DaysGood>
         <ExpirationDate></ExpirationDate>
         <RecallDays></RecallDays>
         <VisibleToLearners></VisibleToLearners>

         <AddedPrerequisites>
            <LearningModules></LearningModules>
            <Credentials></Credentials>
         </AddedPrerequisites>

         <RequiresConfirmation></RequiresConfirmation>
         <ConfirmationAttachments></ConfirmationAttachments>
         <ConfirmationNotification></ConfirmationNotification>

         <Permissions>
            <Types>
               <Type></Type>
            </Types>
         </Permissions>

         <Tags2>
            <Tag2>
               <TagID><![CDATA[]]></TagID>
                  - OR -
               <TagName><![CDATA[]]></TagName>
               <TagValues><![CDATA[]]></TagValues>
            </Tag2>
         </Tags2>

         <TrainingCost>
            <Trainer>
               <TrainerID></TrainerID>
                  - OR -
               <TrainerEmail><![CDATA[]]></TrainerEmail>
                  - OR -
               <TrainerEmployeeID><![CDATA[]]></TrainerEmployeeID>
            </Trainer>
            <LearnerHours></LearnerHours>
            <TrainerHours></TrainerHours>
            <ExtraCostAmount></ExtraCostAmount>
            <ExtraCostDescription><![CDATA[]]></ExtraCostDescription>
         </TrainingCost>

      </Credential>
   </Parameters>
</SmarterU>

Credential Tag Group

The Credential tag group is a container for the action's details. 

<Credential>
   <Name></Name>
   <Status></Status>
   <Description></Description>
   <AllowsAttachments></AllowsAttachments>
   <Expires></Expires>
   <DaysGood></DaysGood>
   <ExpirationDate></ExpirationDate>
   <RecallDays></RecallDays>
   <VisibleToLearners></VisibleToLearners>

   <AddedPrerequisites>
      <LearningModules></LearningModules>
      <Credentials></Credentials>
   </AddedPrerequisites>

   <RequiresConfirmation></RequiresConfirmation>
   <ConfirmationAttachments></ConfirmationAttachments>
   <ConfirmationNotification></ConfirmationNotification>

   <Permissions>
      <Types>
         <Type></Type>
      </Types>
   </Permissions>

   <Tags2>
      <Tag2>
         <TagID><![CDATA[]]></TagID>
            - OR -
         <TagName><![CDATA[]]></TagName>
         <TagValues><![CDATA[]]></TagValues>
      </Tag2>
   </Tags2>

   <TrainingCost>
      <Trainer>
         <TrainerID></TrainerID>
            - OR -
         <TrainerEmail><![CDATA[]]></TrainerEmail>
            - OR -
         <TrainerEmployeeID><![CDATA[]]></TrainerEmployeeID>
      </Trainer>
      <LearnerHours></LearnerHours>
      <TrainerHours></TrainerHours>
      <ExtraCostAmount></ExtraCostAmount>
      <ExtraCostDescription><![CDATA[]]></ExtraCostDescription>
   </TrainingCost>

</Credential>

The Credential tag may contain the following.

Name

The action's name.

Status

The action's status. Acceptable values are Active and Inactive.

Description

The description of the action.

AllowsAttachments (optional)

This is only used when the VisibleToLearners tag is set to 1

Indicates whether learners must upload an attachment with the action in order for it to be accepted. Acceptable values are:

  • Yes - Learners may upload a file with the action.
  • No - Learner do not have to upload a file in order for the action to be confirmed.
  • Required - Learners must upload a file with the action in order for the action to be confirmed. 

Expires (optional)

Indicates whether the action expires. Acceptable values are:

  • 0  - The action doesn't expire.
  • 1 - The action expires.

DaysGood  (optional)

This tag is only used when the Expires tag is set to and you want the action to expire after the specified number of days. The number of days the action is valid.

ExpirationDate (optional)

This tag is only used when the Expires tag is set to 1 and you want the action to expire on a specific date. The date the action will expire in D-MMM format.

RecallDays (optional)

This tag is only used when the Expires tag is set to 1. The number of days prior to the action's expiration when the status will change to Warning.

VisibleToLearners (optional)

Indicates whether the action is visible to learners. Acceptable values are:

  • 0  - The action isn't visible to learners.
  • 1 - The action is visible to learners.

AddedPrerequisites

A container for the action's prerequisites. The tag may contain the following.

TagDescription

LearningModules

The prerequisite course's system-generated identifier. To specify multiple courses, separate each with a comma. 

Credentials

The prerequisite action's system-generated identifier. To specify multiple actions, separate each with a comma. 

RequiresConfirmation (optional)

Indicates whether a user other than the learner must confirm the action before its status can be set to Accepted. Acceptable values are: 

  • 0 - The action doesn't require confirmation.
  • 1 - The action requires confirmation.

ConfirmationAttachments

This tag is only used when the RequiresConfirmation tag is set to 1

Indicates whether the user confirming the action must upload an attachment with the action in order for it to be confirmed. Acceptable values are:

  • Yes - The user confirming the action may upload a file with the action. 
  • No - The user confirming the action does not have to upload a file in order for the action to be confirmed.
  • Required - The user confirming the action must upload a file with the action in order for the action to be confirmed. 

ConfirmationNotification

This tag is only used when the RequiresConfirmation tag is set to 1

Indicates whether the Action Confirmation Notification email will be sent to the selected users. Acceptable values are: 

  • 0  - The email isn't sent.
  • 1 - The email is sent.

Permissions

The Permissions tag is a container for the user types who are able to confirm the action. Each user type is contained in a Types tag and may contain the following.

TagDescription

Type

The type of user who is able to confirm the action. Acceptable values are:

  • GM - Users with the Group Manager group permission.
  • SUP - The learner's supervisor(s).
  • MGU - Users with the Manage Group Users group permission.

Tags2 (optional)

A container for the action's tags. Refer to Tags2 Tag Group.

TrainingCost (optional)

A container for the action's training cost. Refer to TrainingCost Tag Group.

Tags2 Tag Group

The Tags2 tag group is a container for the action's tags.

<Tags2>
   <Tag2>
      <TagID><![CDATA[]]></TagID>
         - OR -
      <TagName><![CDATA[]]></TagName>
      <TagValues><![CDATA[]]></TagValues>
   </Tag2>
</Tags2>

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

TagID

To obtain a tag's ID:

  1. Navigate to the Tag Management Dashboard.
  2. Right click on a tag.
  3. Click Inspect (or Inspect Element, in some browsers). This displays the Developer Tools in your browser. The tag's ID will be located within the code. 

If you do not see the code, you may need to view a different tab within your Developer Tools.

TagName

The tag's name. The tag must already exist within your SmarterU account. This tag is mutually exclusive with the TagID tag.

TagValues

A comma-separated list of values for the tag. The allowed values are controlled by the tag's settings.

TrainingCost Tag Group

The TrainingCost tag group is a container for the action's training cost.

<TrainingCost>
   <Trainer>
      <TrainerID></TrainerID>
         - OR -
      <TrainerEmail><![CDATA[]]></TrainerEmail>
         - OR -
      <TrainerEmployeeID><![CDATA[]]></TrainerEmployeeID>
   </Trainer>
   <LearnerHours></LearnerHours>
   <TrainerHours></TrainerHours>
   <ExtraCostAmount></ExtraCostAmount>
   <ExtraCostDescription><![CDATA[]]></ExtraCostDescription>
</TrainingCost>

The TrainingCost tag group may contain the following.

Trainer

A container for specifying the action's trainer. The trainer must already exist in SmarterU. 

The Trainer tag must contain one of the following.

TagDescription
TrainerIDThe trainer's system-generated identifier.
TrainerEmailThe trainer's email address.
TrainerEmployeeIDThe trainer's employee ID.

LearnerHours

The number of hours the learner spends completing this action.

TrainerHours

The number of hours the selected trainer spends on this action.

ExtraCostAmount

The amount of any additional cost associated with this action.

ExtraCostDescription

A description for any additional cost associated with this action.

API Response XML Package

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

<SmarterU>
   <Result></Result>
   <Info>
      <Credential><![CDATA[]]></Credential>
      <CredentialID></CredentialID>
   </Info>

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

The response may also contain the following.

Credential

The action's name.

CredentialID

The action's system-generated identifier.

Example API Response XML Package

Below is an example of an API response XML package.

<SmarterU>
   <Result>Success</Result>
   <Info>
      <Credential><![CDATA[In-person Interview]]></Credential>
      <CredentialID></CredentialID>
   </Info>

   <Errors>
   </Errors>
</SmarterU>

Error Codes

Error Code
Message
CC:01
The name provided is invalid.
CC:02
The status provided is invalid.
CC:03
The description provided is invalid.
CC:04
The allow attachments is invalid.
CC:05
The expires provided is invalid.
CC:06
The days good is invalid.
CC:07
The visible to learner provided is invalid.
CC:08
The learning modules provided is invalid.
CC:09
The credentials provided is invalid.
CC:10
The added prerequisites provided is invalid.
CC:11
The removed prerequisites provided is invalid.
CC:12
The learning modules provided is invalid.
CC:13
The credentials provided is invalid.
CC:14
The requires confirmation provided is invalid.
CC:15
The confirmation attachments provided is invalid.
CC:16
The confirmation notification provided is invalid.
CC:17  
The permissions provided is invalid.
CC:18
One or more permission types provided are not valid. Only GM, MGU and SUP are allowed values.
CC:19
One or more Learning Modules provided are not valid.
CC:20
One or more Credentials provided are not valid.
CC:21
Credential name cannot be used.
CC:22
Credential ID cannot be used.
CC:23
The required permissions are not met to call the createCredential method.
CC:24
Type not specified.
CC:25
Permissions are required when requires confirmation is 1.
CC:26
Days good should be greater than recall days.
CC:27
The allows attachments provided is not valid. Only NO, YES or REQUIRED are allowed values.
CC:28
The learning modules provided is invalid.
CC:29
The confirmation attachments provided is not valid. Only NO, YES or REQUIRED are allowed values.
CC:30
The required permissions are not met to call the createCredential method.
CC:31
The status provided is not valid. Only ACTIVE or INACTIVE are allowed values.
CC:32
One or more of the credential provided are not valid. Credentials cannot be added more than once.
CC:33
The recall days provided is invalid.
CC:34
Either DaysGood or ExpirationDate can be provided.
CC:36One or more tags do not exist in the provided account.
CC:37All tags provided must have at least one value.
CC:38Values must be from the pre-defined list specified for the tag.
CC:39The training cost provided is invalid.
CC:40The trainer provided is invalid.
CC:41The trainer ID provided is invalid.
CC:42The trainer email provided is invalid.
CC:43The trainer employee ID provided is invalid.
CC:44The learner hours provided is invalid.
CC:45The trainer hours provided is invalid.
CC:46The extra cost amount provided is invalid.
CC:47The extra cost description provided is invalid.
CC:48The trainer does not exist.

Was this article helpful?