API: updateCredential
  • 7 Minutes to read
  • Dark
    Light

API: updateCredential

  • 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 updateCredential method edits an action.

Actions were previously referred to credentials.  

Who Has Access

The following users have access to the updateCredential method:

API Call XML Package

<SmarterU>
   <AccountAPI><![CDATA[]]></AccountAPI>
   <UserAPI><![CDATA[]]></UserAPI>
   <Method>updateCredential</Method>
   <Parameters>
      <Credential>
         <Identifier>
            <Name></Name>
               - OR - 
            <ID></ID>
         </Identifier>
         <Name></Name>
         <Status></Status>
         <Description></Description>
         <AllowsAttachments></AllowsAttachments>
         <Expires></Expires>
         <DaysGood></DaysGood>
         <ExpirationDate></ExpirationDate>
         <RecallDays></RecallDays>
         <VisibleToLearners></VisibleToLearners>

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

         <RemovedPrerequisites>
            <LearningModules></LearningModules>
            <Credentials></Credentials>
         </RemovedPrerequisites>

         <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>
   <Identifier>
      <Name></Name>
         - OR -
      <ID></ID>
   </Identifier>
   <Name></Name>
   <Status></Status>
   <Description></Description>
   <AllowsAttachments></AllowsAttachments>
   <Expires></Expires>
   <DaysGood></DaysGood>
   <ExpirationDate></ExpirationDate>
   <RecallDays></RecallDays>
   <VisibleToLearners></VisibleToLearners>

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

   <RemovedPrerequisites>
      <LearningModules></LearningModules>
      <Credentials></Credentials>
   </RemovedPrerequisites>

   <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.

The Identifier tag contains the information for the action you want to update. The remaining tags in the Credential tag group specify the updates to the action. 

Identifier

The identifier of the action you want to update. This tag contains the following.

TagDescription

Name

The action's name. This tag is mutually exclusive with the ID tag.

ID

The action's system-generated identifier. This tag is mutually exclusive with the Name tag. This is the CredentialID returned by the getCredential method. 

Name (optional)

The action's name.

Status (optional)

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

Description (optional)

The description of the action.

AllowsAttachments (optional)

This is tag only required 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 (optional)

A container for the prerequisites that you want to add to the action. 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. 

RemovedPrerequisites (optional)

A container for the prerequisites that you want to remove from the action. 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.
If you are changing RequiresConfirmation from 0 to 1 and the required permissions were not previously specified, you will also need to include the Permissions tag. 

ConfirmationAttachments (optional)

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 (optional)

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. The tags specified will replace any tags already assigned to the action.   

<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.

If no Tag2 tags are included, all existing tags and values assigned to the action will be removed.

TrainingCost Tag Group

The TrainingCost tag group is a container for the action's training cost. The training cost information specified will replace any training cost information already assigned to the action.   

<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 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><![CDATA[]]></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><![CDATA[10122]]></CredentialID>
   </Info>

   <Errors>
   </Errors>
</SmarterU>

Error Codes

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

Was this article helpful?