June 9, 2024
Use Include parameter in API calls of Adobe Learning Manager (ALM)
Comments
(0)
June 9, 2024
Use Include parameter in API calls of Adobe Learning Manager (ALM)
https://www.linkedin.com/in/anupam-gogoi-97a14888/
Wizard
Followers: 23 people
(0)

ALM APIs can be used to retrieve many useful information while building a custom application or a headless LMS. The API endpoints can further be included with additional ‘include’ parameters to retrieve the additional information which are in relationship with the data received by default. These relationships are data model relations, for example while making a call to get user details you will receive the user information and relationship of manager ID and the ALM account ID. With the include parameter, we can extract additional details along with the user details such as their manager details and the ALM account details in a comprehensive manner.

For instance, the below endpoint can be used to retrieve details of a user using userID  –

GET /users/{id}

Curl 

curl -X GET --header 'Accept: application/vnd.api+json' --header 'Authorization: oauth 4e8e1025da6457cd4d0597b6fe1ac5af' 'https://learningmanager.adobe.com/primeapi/v2/users/20919106'

Request URL 

https://learningmanager.adobe.com/primeapi/v2/users/20919106

Response Body 

{
  "links": {
    "self": "https://learningmanager.adobe.com/primeapi/v2/users/20919106"
  },
  "data": {
    "id": "20919106",
    "type": "user",
    "attributes": {
      "avatarUrl": "https://cpcontents.adobe.com/public/images/default_user_avatar.svg",
      "binUserId": "ac639cbc-f7ca-4386-8aff-c7f8b4d7ff93",
      "email": "zmertz@example.net",
      "enrollOnClick": false,
      "fields": {
        "Learning Categories": [
          "Finance"
        ],
        "Categories": "Business"
      },
      "gamificationEnabled": false,
      "lastLoginDate": "2023-09-29T18:07:11.000Z",
      "name": "Aglae Cronin",
      "pointsEarned": 0,
      "pointsRedeemed": 0,
      "preferredResolution": "AUTO",
      "profile": "Engineer",
      "roles": [
        "Learner",
        "Instructor"
      ],
      "state": "ACTIVE",
      "userType": "Internal",
      "userUniqueId": "zmertz@example.net"
    },
    "relationships": {
      "account": {
        "data": {
          "id": "108079",
          "type": "account"
        }
      },
      "manager": {
        "data": {
          "id": "20941371",
          "type": "user"
        }
      }
    }
  }
}

As you can see from the above response from ALM, the user data has a relationship with the ALM Account and the Manager and the response only has ID and Type information of the account and manager and no additional details regarding it.

account“: { “data“: { “id“: “108079”, “type“: “account” } }, “manager“: { “data“: { “id“: “20941371”, “type“: “user” } }

Using the include parameter in the request we can retrieve detailed information about the manager as shown below (note that I have not added ‘account’ as a include parameter due to account data being too lengthy, you can try the include values separated by a comma, example ‘manager,account’) –

Curl 

curl -X GET --header 'Accept: application/vnd.api+json' --header 'Authorization: oauth 4e8e1025da6457cd4d0597b6fe1ac5af' 'https://learningmanager.adobe.com/primeapi/v2/users/20919106?include=manager'

Request URL 

https://learningmanager.adobe.com/primeapi/v2/users/20919106?include=manager

Response Body 

{
  "links": {
    "self": "https://learningmanager.adobe.com/primeapi/v2/users/20919106?include=manager"
  },
  "data": {
    "id": "20919106",
    "type": "user",
    "attributes": {
      "avatarUrl": "https://cpcontents.adobe.com/public/images/default_user_avatar.svg",
      "binUserId": "ac639cbc-f7ca-4386-8aff-c7f8b4d7ff93",
      "email": "zmertz@example.net",
      "enrollOnClick": false,
      "fields": {
        "Learning Categories": [
          "Finance"
        ],
        "Categories": "Business"
      },
      "gamificationEnabled": false,
      "lastLoginDate": "2023-09-29T18:07:11.000Z",
      "name": "Aglae Cronin",
      "pointsEarned": 0,
      "pointsRedeemed": 0,
      "preferredResolution": "AUTO",
      "profile": "Engineer",
      "roles": [
        "Learner",
        "Instructor"
      ],
      "state": "ACTIVE",
      "userType": "Internal",
      "userUniqueId": "zmertz@example.net"
    },
    "relationships": {
      "account": {
        "data": {
          "id": "108079",
          "type": "account"
        }
      },
      "manager": {
        "data": {
          "id": "20941371",
          "type": "user"
        }
      }
    }
  },
  "included": [
    {
      "id": "20941371",
      "type": "user",
      "attributes": {
        "avatarUrl": "https://cpcontents.adobe.com/public/images/default_user_avatar.svg",
        "binUserId": "59a8dd42-65f7-45dd-9c3e-6cc06edc2517",
        "contentLocale": "en-US",
        "email": "blockchainism15@gmail.com",
        "enrollOnClick": true,
        "fields": {
          "Learning Categories": [
            "Security"
          ],
          "Categories": "IT"
        },
        "gamificationEnabled": false,
        "lastLoginDate": "2024-06-09T10:25:11.000Z",
        "metadata": {},
        "name": "Blker Chin",
        "pointsEarned": 5720,
        "pointsRedeemed": 0,
        "preferredResolution": "AUTO",
        "profile": "Helpdesk specialist",
        "roles": [
          "Learner",
          "Admin",
          "Author",
          "Instructor",
          "Integration Admin",
          "Manager"
        ],
        "state": "ACTIVE",
        "timeZoneCode": "187",
        "uiLocale": "en-US",
        "userType": "Internal",
        "userUniqueId": "blockchainism15@gmail.com"
      },
      "relationships": {
        "account": {
          "data": {
            "id": "108079",
            "type": "account"
          }
        }
      }
    }
  ]
}

————————————————————————————-

Taking an example of learning objects like courses, learning paths certifications –

The below endpoint retrieves the details of a course and the information regarding the course is returned with its relationships with other data models –

GET/learningObjects/{id}

Curl

curl -X GET --header 'Accept: application/vnd.api+json' --header 'Authorization: oauth 4e8e1025da6457cd4d0597b6fe1ac5af' 'https://learningmanager.adobe.com/primeapi/v2/learningObjects/course%3A9756365'

Request URL

https://learningmanager.adobe.com/primeapi/v2/learningObjects/course:9756365

Response Body

{
  "links": {
    "self": "https://learningmanager.adobe.com/primeapi/v2/learningObjects/course:9756365"
  },
  "data": {
    "id": "course:9756365",
    "type": "learningObject",
    "attributes": {
      "authorNames": [
        "er",
        "test"
      ],
      "dateCreated": "2024-06-03T13:24:48.000Z",
      "datePublished": "2024-06-03T13:25:22.000Z",
      "dateUpdated": "2024-06-03T19:24:11.000Z",
      "duration": 147,
      "effectiveModifiedDate": "2024-06-03T19:29:11.000Z",
      "effectivenessIndex": 0,
      "enrollmentType": "Self Enroll",
      "hasOptionalLoResources": false,
      "hasPreview": false,
      "isExternal": false,
      "isMqaEnabled": false,
      "isPrerequisiteEnforced": false,
      "isSubLoOrderEnforced": false,
      "loFormat": "Self Paced",
      "loResourceCompletionCount": 4,
      "loType": "course",
      "moduleResetEnabled": false,
      "state": "Published",
      "tags": [
        "test"
      ],
      "unenrollmentAllowed": false,
      "uniqueId": "test_Vix",
      "localizedMetadata": [
        {
          "description": "Vix",
          "locale": "en-US",
          "name": "Skinns",
          "overview": "Vix",
          "richTextOverview": "<p>Vix</p>"
        }
      ],
      "rating": {
        "averageRating": 0,
        "ratingsCount": 0
      }
    },
    "relationships": {
      "instances": {
        "data": [
          {
            "id": "course:9756365_10438978",
            "type": "learningObjectInstance"
          }
        ]
      },
      "prerequisiteLOs": {
        "data": [
          {
            "id": "course:6070220",
            "type": "learningObject"
          }
        ]
      },
      "skills": {
        "data": [
          {
            "id": "course:9756365_414411",
            "type": "learningObjectSkill"
          },
          {
            "id": "course:9756365_414663",
            "type": "learningObjectSkill"
          }
        ]
      },
      "supplementaryLOs": {
        "data": [
          {
            "id": "jobAid:72992",
            "type": "learningObject"
          }
        ]
      },
      "supplementaryResources": {
        "data": [
          {
            "id": "course:9756365_9756365_1_attachment",
            "type": "resource"
          }
        ]
      }
    }
  }
}

From the above response, we got the below relationships of the course –

instances

prerequisiteLOs

skills

supplementaryLOs

supplementaryResources

Now to get a detailed data of the instances and skills we can include ‘instances,skills’ in the include parameter, the sample response is shown below –

Request URL 

https://learningmanager.adobe.com/primeapi/v2/learningObjects/course%3A9756365?include=instances,skills

Response Body 

{
  "links": {
    "self": "https://learningmanager.adobe.com/primeapi/v2/learningObjects/course:9756365?include=instances,skills"
  },
  "data": {
    "id": "course:9756365",
    "type": "learningObject",
    "attributes": {
      "authorNames": [
        "er",
        "test"
      ],
      "dateCreated": "2024-06-03T13:24:48.000Z",
      "datePublished": "2024-06-03T13:25:22.000Z",
      "dateUpdated": "2024-06-03T19:24:11.000Z",
      "duration": 147,
      "effectiveModifiedDate": "2024-06-03T19:29:11.000Z",
      "effectivenessIndex": 0,
      "enrollmentType": "Self Enroll",
      "hasOptionalLoResources": false,
      "hasPreview": false,
      "isExternal": false,
      "isMqaEnabled": false,
      "isPrerequisiteEnforced": false,
      "isSubLoOrderEnforced": false,
      "loFormat": "Self Paced",
      "loResourceCompletionCount": 4,
      "loType": "course",
      "moduleResetEnabled": false,
      "state": "Published",
      "tags": [
        "test"
      ],
      "unenrollmentAllowed": false,
      "uniqueId": "test_Vix",
      "localizedMetadata": [
        {
          "description": "Vix",
          "locale": "en-US",
          "name": "Skinns",
          "overview": "Vix",
          "richTextOverview": "<p>Vix</p>"
        }
      ],
      "rating": {
        "averageRating": 0,
        "ratingsCount": 0
      }
    },
    "relationships": {
      "instances": {
        "data": [
          {
            "id": "course:9756365_10438978",
            "type": "learningObjectInstance"
          }
        ]
      },
      "prerequisiteLOs": {
        "data": [
          {
            "id": "course:6070220",
            "type": "learningObject"
          }
        ]
      },
      "skills": {
        "data": [
          {
            "id": "course:9756365_414411",
            "type": "learningObjectSkill"
          },
          {
            "id": "course:9756365_414663",
            "type": "learningObjectSkill"
          }
        ]
      },
      "supplementaryLOs": {
        "data": [
          {
            "id": "jobAid:72992",
            "type": "learningObject"
          }
        ]
      },
      "supplementaryResources": {
        "data": [
          {
            "id": "course:9756365_9756365_1_attachment",
            "type": "resource"
          }
        ]
      }
    }
  },
  "included": [
    {
      "id": "course:9756365_10438978",
      "type": "learningObjectInstance",
      "attributes": {
        "completionDeadline": "2024-06-30T18:29:59.000Z",
        "dateCreated": "2024-06-03T13:24:49.000Z",
        "isDefault": true,
        "isFlexible": false,
        "state": "Active",
        "localizedMetadata": [
          {
            "locale": "en-US",
            "name": "Default Instance"
          }
        ]
      },
      "relationships": {
        "l1FeedbackInfo": {
          "data": {
            "id": "course:9756365_10438978_l1Feedback",
            "type": "feedbackInfo"
          }
        },
        "learningObject": {
          "data": {
            "id": "course:9756365",
            "type": "learningObject"
          }
        },
        "loResources": {
          "data": [
            {
              "id": "course:9756365_10438978_15250166_0",
              "type": "learningObjectResource"
            },
            {
              "id": "course:9756365_10438978_15250167_0",
              "type": "learningObjectResource"
            },
            {
              "id": "course:9756365_10438978_15251398_0",
              "type": "learningObjectResource"
            },
            {
              "id": "course:9756365_10438978_15251399_0",
              "type": "learningObjectResource"
            }
          ]
        }
      }
    },
    {
      "id": "course:9756365_414411",
      "type": "learningObjectSkill",
      "attributes": {
        "credits": 1,
        "learningObjectId": "course:9756365"
      },
      "relationships": {
        "skillLevel": {
          "data": {
            "id": "414411_1",
            "type": "skillLevel"
          }
        }
      }
    },
    {
      "id": "course:9756365_414663",
      "type": "learningObjectSkill",
      "attributes": {
        "credits": 1,
        "learningObjectId": "course:9756365"
      },
      "relationships": {
        "skillLevel": {
          "data": {
            "id": "414663_1",
            "type": "skillLevel"
          }
        }
      }
    }
  ]
}

Now suppose if you want to derive more data regarding the relationships associated with the course’s instance like ‘loResources’ (module information of the course), you can apply nested include values ‘instance.loResources’

Request URL

https://learningmanager.adobe.com/primeapi/v2/learningObjects/course:9756365?include=instances,instances.loResources,skills

Response Body

{
  "links": {
    "self": "https://learningmanager.adobe.com/primeapi/v2/learningObjects/course:9756365?include=instances,instances.loResources,skills,"
  },
  "data": {
    "id": "course:9756365",
    "type": "learningObject",
    "attributes": {
      "authorNames": [
        "er",
        "test"
      ],
      "dateCreated": "2024-06-03T13:24:48.000Z",
      "datePublished": "2024-06-03T13:25:22.000Z",
      "dateUpdated": "2024-06-03T19:24:11.000Z",
      "duration": 147,
      "effectiveModifiedDate": "2024-06-03T19:29:11.000Z",
      "effectivenessIndex": 0,
      "enrollmentType": "Self Enroll",
      "hasOptionalLoResources": false,
      "hasPreview": false,
      "isExternal": false,
      "isMqaEnabled": false,
      "isPrerequisiteEnforced": false,
      "isSubLoOrderEnforced": false,
      "loFormat": "Self Paced",
      "loResourceCompletionCount": 4,
      "loType": "course",
      "moduleResetEnabled": false,
      "state": "Published",
      "tags": [
        "test"
      ],
      "unenrollmentAllowed": false,
      "uniqueId": "test_Vix",
      "localizedMetadata": [
        {
          "description": "Vix",
          "locale": "en-US",
          "name": "Skinns",
          "overview": "Vix",
          "richTextOverview": "<p>Vix</p>"
        }
      ],
      "rating": {
        "averageRating": 0,
        "ratingsCount": 0
      }
    },
    "relationships": {
      "instances": {
        "data": [
          {
            "id": "course:9756365_10438978",
            "type": "learningObjectInstance"
          }
        ]
      },
      "prerequisiteLOs": {
        "data": [
          {
            "id": "course:6070220",
            "type": "learningObject"
          }
        ]
      },
      "skills": {
        "data": [
          {
            "id": "course:9756365_414411",
            "type": "learningObjectSkill"
          },
          {
            "id": "course:9756365_414663",
            "type": "learningObjectSkill"
          }
        ]
      },
      "supplementaryLOs": {
        "data": [
          {
            "id": "jobAid:72992",
            "type": "learningObject"
          }
        ]
      },
      "supplementaryResources": {
        "data": [
          {
            "id": "course:9756365_9756365_1_attachment",
            "type": "resource"
          }
        ]
      }
    }
  },
  "included": [
    {
      "id": "course:9756365_10438978",
      "type": "learningObjectInstance",
      "attributes": {
        "completionDeadline": "2024-06-30T18:29:59.000Z",
        "dateCreated": "2024-06-03T13:24:49.000Z",
        "isDefault": true,
        "isFlexible": false,
        "state": "Active",
        "localizedMetadata": [
          {
            "locale": "en-US",
            "name": "Default Instance"
          }
        ]
      },
      "relationships": {
        "l1FeedbackInfo": {
          "data": {
            "id": "course:9756365_10438978_l1Feedback",
            "type": "feedbackInfo"
          }
        },
        "learningObject": {
          "data": {
            "id": "course:9756365",
            "type": "learningObject"
          }
        },
        "loResources": {
          "data": [
            {
              "id": "course:9756365_10438978_15250166_0",
              "type": "learningObjectResource"
            },
            {
              "id": "course:9756365_10438978_15250167_0",
              "type": "learningObjectResource"
            },
            {
              "id": "course:9756365_10438978_15251398_0",
              "type": "learningObjectResource"
            },
            {
              "id": "course:9756365_10438978_15251399_0",
              "type": "learningObjectResource"
            }
          ]
        }
      }
    },
    {
      "id": "course:9756365_414411",
      "type": "learningObjectSkill",
      "attributes": {
        "credits": 1,
        "learningObjectId": "course:9756365"
      },
      "relationships": {
        "skillLevel": {
          "data": {
            "id": "414411_1",
            "type": "skillLevel"
          }
        }
      }
    },
    {
      "id": "course:9756365_414663",
      "type": "learningObjectSkill",
      "attributes": {
        "credits": 1,
        "learningObjectId": "course:9756365"
      },
      "relationships": {
        "skillLevel": {
          "data": {
            "id": "414663_1",
            "type": "skillLevel"
          }
        }
      }
    },
    {
      "id": "course:9756365_10438978_15250166_0",
      "type": "learningObjectResource",
      "attributes": {
        "externalReporting": false,
        "isExpiredSubmission": false,
        "loResourceType": "Content",
        "multipleAttemptEnabled": false,
        "previewEnabled": false,
        "resourceType": "Elearning",
        "submissionEnabled": false,
        "version": 1,
        "learnerAttemptInfo": {
          "attemptsFinishedCount": 0,
          "currentAttemptNumber": 1
        },
        "localizedMetadata": [
          {
            "locale": "en-US",
            "name": "CP_quiz_skins_Vix"
          }
        ],
        "multipleAttempt": {
          "attemptDuration": 0,
          "attemptEndCriteria": "NONE",
          "infiniteAttempts": true,
          "maxAttemptCount": 0,
          "stopAttemptOnSuccessfulComplete": false,
          "timeBetweenAttempts": 0
        }
      },
      "relationships": {
        "learningObject": {
          "data": {
            "id": "course:9756365",
            "type": "learningObject"
          }
        },
        "loInstance": {
          "data": {
            "id": "course:9756365_10438978",
            "type": "learningObjectInstance"
          }
        },
        "resources": {
          "data": [
            {
              "id": "12532004_1_en-US",
              "type": "resource"
            }
          ]
        }
      }
    },
    {
      "id": "course:9756365_10438978_15250167_0",
      "type": "learningObjectResource",
      "attributes": {
        "externalReporting": false,
        "isExpiredSubmission": false,
        "loResourceType": "Content",
        "multipleAttemptEnabled": false,
        "previewEnabled": false,
        "resourceType": "Elearning",
        "submissionEnabled": false,
        "version": 1,
        "learnerAttemptInfo": {
          "attemptsFinishedCount": 0,
          "currentAttemptNumber": 1
        },
        "localizedMetadata": [
          {
            "locale": "en-US",
            "name": "CER11 - Copy test"
          }
        ],
        "multipleAttempt": {
          "attemptDuration": 0,
          "attemptEndCriteria": "NONE",
          "infiniteAttempts": true,
          "maxAttemptCount": 0,
          "stopAttemptOnSuccessfulComplete": false,
          "timeBetweenAttempts": 0
        }
      },
      "relationships": {
        "learningObject": {
          "data": {
            "id": "course:9756365",
            "type": "learningObject"
          }
        },
        "loInstance": {
          "data": {
            "id": "course:9756365_10438978",
            "type": "learningObjectInstance"
          }
        },
        "resources": {
          "data": [
            {
              "id": "12532005_1_en-US",
              "type": "resource"
            }
          ]
        }
      }
    },
    {
      "id": "course:9756365_10438978_15251398_0",
      "type": "learningObjectResource",
      "attributes": {
        "externalReporting": false,
        "isExpiredSubmission": false,
        "loResourceType": "Content",
        "multipleAttemptEnabled": false,
        "previewEnabled": false,
        "resourceType": "Elearning",
        "submissionEnabled": false,
        "version": 2,
        "localizedMetadata": [
          {
            "locale": "en-US",
            "name": "PDF content"
          }
        ]
      },
      "relationships": {
        "learningObject": {
          "data": {
            "id": "course:9756365",
            "type": "learningObject"
          }
        },
        "loInstance": {
          "data": {
            "id": "course:9756365_10438978",
            "type": "learningObjectInstance"
          }
        },
        "resources": {
          "data": [
            {
              "id": "12532855_2_en-US",
              "type": "resource"
            }
          ]
        }
      }
    },
    {
      "id": "course:9756365_10438978_15251399_0",
      "type": "learningObjectResource",
      "attributes": {
        "externalReporting": false,
        "isExpiredSubmission": false,
        "loResourceType": "Content",
        "multipleAttemptEnabled": false,
        "previewEnabled": false,
        "resourceType": "Elearning",
        "submissionEnabled": false,
        "version": 1,
        "localizedMetadata": [
          {
            "locale": "en-US",
            "name": "VideoTT"
          }
        ]
      },
      "relationships": {
        "learningObject": {
          "data": {
            "id": "course:9756365",
            "type": "learningObject"
          }
        },
        "loInstance": {
          "data": {
            "id": "course:9756365_10438978",
            "type": "learningObjectInstance"
          }
        },
        "resources": {
          "data": [
            {
              "id": "11262942_1_en-US",
              "type": "resource"
            }
          ]
        }
      }
    }
  ]
}

This course has 4 modules and a detailed data of these 4 modules are returned.

Use these include methods to bring in more comprehensive information about any available API objects from ALM.

——————————————————————————————————————-

#How to use include parameter in ALM v2 API #what are the include parameters in Adobe Learning Manager API #include values #nested include #Data model relationships #Existing models # Include parameter values for learning object LO badges #user Badges #include parameter course learning path program certification #include parameter values skills skill interest #include parameter value user skill #include parameter value user course learning path certification enrollments #include parameter for learning object enrollment, instances, skills #Get call API #include parameter for LO resources #include parameter value for modules #What are the include parameters for the GET call in ALM API #list of include parameter values in Adobe Learning Manager API

0 Comments
Add Comment