API: getCredential
  • 5 Minutes to read
  • Dark
    Light

API: getCredential

  • 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 getCredential method retrieves an action's details.

Actions were previously referred to credentials.  

Who Has Access

The following users have access to the getCredential method:

API Call XML Package

<SmarterU>
   <AccountAPI><![CDATA[]]></AccountAPI>
   <UserAPI><![CDATA[]]></UserAPI>
   <Method>getCredential</Method>
   <Parameters>
      <Credential>
         <Name><![CDATA[]]></Name>
            - OR -  
         <ID></ID>
      </Credential>
   </Parameters>
</SmarterU>

Credential Tag Group

The Credential tag group is a container for the action filters.

<Credential>
   <Name><![CDATA[]]></Name>
      - OR - 
   <ID></ID>
</Credential>

The Credential tag contains one of the following.

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 not yet an ID that you can access through the SmarterU system. Please contact our Success Desk to request your IDs.

API Response XML Package

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

<SmarterU>
   <Result></Result>
   <Info>
      <Credential>
         <Name><![CDATA[]]></Name>
         <CredentialID><![CDATA[]]></CredentialID>
         <CreatedDate></CreatedDate>
         <ModifiedDate></ModifiedDate>
         <Description></Description>
         <AllowsAttachments></AllowsAttachments>
         <Expires></Expires>
         <ExpirationType></ExpirationType>
         <DaysGood></DaysGood>
         <ExpirationDate></ExpirationDate>
         <RecallDays></RecallDays>
         <VisibleToLearners></VisibleToLearners>
         <RequiresConfirmation></RequiresConfirmation>
         <ConfirmationAttachments><![CDATA[]]></ConfirmationAttachments>
         <ConfirmationNotification></ConfirmationNotification>

         <PreRequisites>
            <PreRequisite>
               <Name><![CDATA[]]></Name>
               <Type><![CDATA[]]></Type>
               <CredentialID></CredentialID>
            </PreRequisite>
            <PreRequisite>
               <Name><![CDATA[]]></Name>
               <Type><![CDATA[]]></Type>
               <LearningModuleID></LearningModuleID>
               <LearningModuleType><![CDATA[]]></LearningModuleType>
            </PreRequisite>
         </PreRequisites>

         <Requirements>
            <Requirement>
               <ID></ID>
               <Name></Name>
            </Requirement>
         </Requirements>

         <Status></Status>

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

         <TrainingCost>
            <Trainer>
               <TrainerID></TrainerID>
               <TrainerEmail><![CDATA[]]></TrainerEmail>
               <TrainerEmployeeID><![CDATA[]]></TrainerEmployeeID>
               <TrainerGivenName><![CDATA[]]></TrainerGivenName>
               <TrainerSurname><![CDATA[]]></TrainerSurname>
            </Trainer>
            <LearnerHours></LearnerHours>
            <TrainerHours></TrainerHours>
            <ExtraCostAmount></ExtraCostAmount>
            <ExtraCostDescription><![CDATA[]]></ExtraCostDescription>
         </TrainingCost>
     </Credential>
   </Info>

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

The action is contained in a Credential tag and may contain the following.

Name

The action's name.

CredentialID

The action's system-generated identifier. 

CreatedDate

The date the action was added.

ModifiedDate

The date the action was last edited.

Description

The description of the action.

AllowsAttachments

This is only returned 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

Indicates whether the action expires. Acceptable values are:

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

ExpirationType

This is only returned when the Expires tag is set to 1

Indicates how the action expires. Possible values are:

DaysGood

This tag is only returned when the Expires tag returns and the ExpirationType tag returns ByDays. The number of days the action is valid

ExpirationDate

This tag is only returned when the Expires tag returns and the ExpirationType tag returns ByDate. The date the action expires. 

RecallDays

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

VisibleToLearners

Indicates whether the action is visible to learners.

RequiresConfirmation

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 returned if the RequiresConfirmation tag returns 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 returned if the RequiresConfirmation tag returns 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.

Prerequisites

The Prerequisites tag is a container for the action's prerequisites. Each prerequisite is contained in a Prerequisite tag and contains the following.

TagDescription

Name

The name of the prerequisite course or action.

Type

Indicates whether the prerequisite is a course or action.

CredentialID

This tag is only returned if the Type returns Action. The prerequisite action's system-generated identifier.

LearningModuleID

This tag is only returned if the Type returns Course. The prerequisite course's system-generated identifier.

LearningModuleType

This tag is only returned if the Type returns Course. The type of prerequisite course (i.e., Online, SCORM, ILT).

Requirements

The Requirements tag is a container for the requirements that include the action. Each requirement is contained in a Requirement tag and contains the following.

TagDescription

ID

The requirement's system-generated identifier.

Name

The requirement's name.

Status

The action's status (i.e., Active, Inactive).

Tags2

A container for the action's tags. Each tag is contained in a Tag2 tag and contains the following.

TagDescription

TagID

The tag's system-generated identifier.

TagName

The tag's name.

TagValues

A comma-separated list of tag values associated with the action.

TrainingCost

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

TagDescription

Trainer

A container for the action's trainer. The Trainer tag contains the following: 

  • TrainerID - The trainer's system-generated identifier.
  • TrainerEmail - The trainer's email address.
  • TrainerEmployeeID - The trainer's employee ID.
  • TrainerGivenName - The trainer's given name, also known as their first name.
  • TrainerSurname - The trainer's surname, also known as their last name.

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.

Example API Response XML Package

Below is an example of an API response XML package.

<SmarterU>
   <Result>Success</Result>
   <Info>
      <Credential>
         <Name><![CDATA[Forklift Operation and Driving Exam]]></Name>
         <CredentialID><![CDATA[6684]]></CredentialID>
         <CreatedDate>2018-03-21 21:40:47.58</CreatedDate>
         <ModifiedDate>2019-09-23 18:16:21.97</ModifiedDate>
         <Description/>
         <AllowsAttachments>Required</AllowsAttachments>
         <Expires>1</Expires>
         <ExpirationType>ByDays</ExpirationType>
         <DaysGood>365</DaysGood>
         <RecallDays>90</RecallDays>
         <VisibleToLearners>1</VisibleToLearners>
         <RequiresConfirmation>1</RequiresConfirmation>
         <ConfirmationAttachments><![CDATA[Required]]></ConfirmationAttachments>
         <ConfirmationNotification>0</ConfirmationNotification>

         <PreRequisites>
            <PreRequisite>
               <Name><![CDATA[Driver's License]]></Name>
               <Type><![CDATA[Credential]]></Type>
               <CredentialID>6682</CredentialID>
            </PreRequisite>
            <PreRequisite>
               <Name><![CDATA[Forklift Operation]]></Name>
               <Type><![CDATA[Course]]></Type>
               <LearningModuleID>104878</LearningModuleID>
               <LearningModuleType><![CDATA[ILT]]></LearningModuleType>
            </PreRequisite>
         </PreRequisites>

         <Requirements>
            <Requirement>
               <ID>14672</ID>
               <Name>Forklift Operator</Name>
            </Requirement>
         </Requirements>

         <Status>Active</Status>

         <Tags2> 
            <Tag2>
               <TagID>7</TagID>
               <TagName><![CDATA[Machinery]]></TagName>
               <TagValues><![CDATA[conveyor belt, forklift]]></TagValues>
            </Tag2>
         </Tags2> 

         <TrainingCost>
            <Trainer>
               <TrainerID>50970</TrainerID>
               <TrainerEmail><![CDATA[james.lee@finashoes.com]]></TrainerEmail>
               <TrainerEmployeeID><![CDATA[59595]]></TrainerEmployeeID>
               <TrainerGivenName><![CDATA[James]]></TrainerGivenName>
               <TrainerSurname><![CDATA[Lee]]></TrainerSurname>
            </Trainer>
            <LearnerHours>1</LearnerHours>
            <TrainerHours>1</TrainerHours>
            <ExtraCostAmount>10</ExtraCostAmount>
            <ExtraCostDescription><![CDATA[Third-party company.]]></ExtraCostDescription>
         </TrainingCost>
     </Credential>
   </Info>

   <Errors>
   </Errors>
</SmarterU>

Error Codes

Error Code
Message
GC:01
The name provided is invalid.
GC:02
The ID provided is invalid.
GC:03
The required permissions are not met to call the getCredential method.
GC:04
The requested Credential does not exist.
GR:05
Credential Name and ID not provided. You must provide a Name or ID.

Was this article helpful?