---
title: "API: getCredential"
slug: "api-getcredential"
updated: 2022-08-23T16:37:06Z
published: 2022-08-23T16:37:06Z
canonical: "support.smarteru.com/api-getcredential"
---

> ## Documentation Index
> Fetch the complete documentation index at: https://support.smarteru.com/llms.txt
> Use this file to discover all available pages before exploring further.

# API: getCredential

- 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](/v1/docs/actions) details.

[Actions](/v1/docs/actions) were previously referred to *credentials*.  

## **Who Has Access**

The following users have access to the getCredential method:

- Users with the [Manage Learning Plans, Certifications, and Requirements](/v1/docs/account-permission-manage-learning-plans-certifications-and-requirements) account permission.
- [Administrators and owners](/v1/docs/user-profile-information#access-level).

## **API Call XML Package**

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

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

The Credential tag contains one of the following.

### **Name**

The [action's name](/v1/docs/action-main#name). This tag is mutually exclusive with the [ID](https://help.smarteru.com/api-getcredential$credential_Id) tag.

### **ID**

The action's system-generated identifier. This tag is mutually exclusive with the [](https://help.smarteru.com/api-getcredential$credential_Name)[Name tag](/v1/docs/api-getcredential#name).

This is not yet an ID that you can access through the SmarterU system. Please contact our [Success Desk](mailto:success@neovation.com) to request your IDs.

## **API Response XML Package**

The [API response XML package](/v1/docs/api-response-xml-package) will always include a Result, Info, and [Errors](/v1/docs/api-getcredential#error-codes) tag.

```markup
<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](/v1/docs/action-main#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](/v1/docs/action-main#description).

### AllowsAttachments

This is only returned when the [VisibleToLearners tag](/v1/docs/api-getcredential#visibletolearners) 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](https://support.smarteru.com/v1/docs/action-expiration#expires). Acceptable values are:

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

### ExpirationType

This is only returned when the [Expires tag](/v1/docs/api-getcredential#expires) is set to *1*.

Indicates how the action expires. Possible values are:

- *ByDays* - The action expires after the days specified in the [DaysGood tag](/v1/docs/api-getcredential#daysgood).
- *ByDate* - The action expires on the date specified in the [ExpirationDate tag](/v1/docs/api-getcredential#expirationdate).

### **DaysGood**

This tag is only returned when the [Expires tag](https://help.smarteru.com/api-getcredential$response_Expires) returns *1* and the [ExpirationType tag](https://help.smarteru.com/api-getcredential$response_ExpirationType) returns *ByDays*. The [number of days the action is valid](https://help.smarteru.com/action-expiration$setting_action_valid_for).

### **ExpirationDate**

This tag is only returned when the [Expires tag](/v1/docs/api-getcredential#expires) returns *1* and the [ExpirationType tag](/v1/docs/api-getcredential#expirationtype) returns *ByDate*. The date the action expires.

### **RecallDays**

This tag is only returned when the [Expires tag](/v1/docs/api-getcredential#expires) returns 1. The [number of days prior to the action's expiration when the status will change to *Warning*](/v1/docs/action-expiration#warning-period-should-start).

### **VisibleToLearners**

Indicates whether the [action is visible to learners](/v1/docs/action-main#visible-to-learners).

### **RequiresConfirmation**

Indicates [whether a user other than the learner must confirm the action](https://support.smarteru.com/v1/docs/action-confirmation#requires-confirmation) 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](/v1/docs/api-getcredential#requiresconfirmation) returns *1*.

Indicates whether the user confirming the action must [upload an attachment with the action in order for it to be confirmed](/v1/docs/action-confirmation#allow-confirmation-attachments). 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](/v1/docs/api-getcredential#requiresconfirmation) 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](/v1/docs/action-prerequisites). Each prerequisite is contained in a Prerequisite tag and contains the following.

| Tag | Description |
| --- | --- |
| **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.

| Tag | Description |
| --- | --- |
| **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](/v1/docs/action-tags). Each tag is contained in a Tag2 tag and contains the following.

| Tag | Description |
| --- | --- |
| **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](/v1/docs/action-training-cost).

| Tag | Description |
| --- | --- |
| **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.

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

## Related

- [Actions](/actions.md)
- [API: createCredential](/api-createcredential.md)
- [API: listCredentials](/api-listcredentials.md)
- [API: updateCredential](/api-updatecredential.md)
