LinkedIn Learning data flows

Here we have outlined the data flows between Totara and LinkedIn Learning using flow diagrams, and we have shown the request/response formats used in the data exchange. For general guidance on getting started with LinkedIn Learning in Totara, please see Set up the LinkedIn Learning integration.

LinkedIn Learning content syncing

  1. Obtain access token using client ID & secret. The following data is sent to the https://www.linkedin.com/oauth/v2/accessToken endpoint. The client ID and secret are obtained from LinkedIn Learning when they are generated there.

    Request:

    {
        "client_id": "XXXXXXXXXX",
        "client_secret": "XXXXXXXXXX",
        "grant_type": "client_credentials",
    }

    Response:

    {
              "access_token": "XXXXXXXXXX",
              "expires_in": "XXXXXXXXXX",
              "grant_type": "client_credentials",
    }

    The access token and its expiration time obtained from the response above are saved in the config table for this component. It is used to make any subsequent requests to LinkedIn Learning. If there is an authentication exception during this request Totara will attempt to refresh the token and repeat the request again.

  2. Sync classifications. This flow is used to fetch classifications from LinkedIn and store them locally to display categorised content without requesting the data from LinkedIn. An example of the classification response is below:

    {
       "paging": {
          "start": 0,
          "count": 100,
          "links": [],
          "total": 3
       },
       "elements": [
          {
            "name": {
              "locale": {
                "country": "US",
                "language": "en"
               },
               "value": "Creative"
             },
            "owner": {
              "urn": "urn:li:organization:1337",
              "name": {
                "locale": {
                  "country": "US",
                  "language": "en"
                },
                "value": "LinkedIn"
              }
            },
            "urn": "urn:li:lyndaCategory:7163",
            "type": "LIBRARY"
          },
       ]
    }

    The synced data is stored in the marketplace_linkedin_classification table.

  3. Sync learning assets. This flow is used to store course metadata in the Totara database. This includes information such as the course title, description, etc. An example of the learning asset response is below:

    {
      "urn": "urn:li:lyndaCourse:252",
      "details": {
        "images": {
          "primary": "https://cdn.lynda.com/course/252/252-636282989834935258-16x9.jpg"
        },
        "descriptionIncludingHtml": {
          "locale": {
            "country": "US",
            "language": "en"
          },
          "value": "Like the other applications in Microsoft Office 2007, Excel 2007 boasts upgraded features and a brand-new look. In <em> Excel 2007 Essential Training </em>, instructor Lorna A. Daly introduces the new version in detail. The training begins with the essentials of using the program, including how and why to use a spreadsheet, how to set up and modify worksheets, and how to import and export data. Lorna then moves on to teach more advanced features, such as working with functions and macros. Exercise files accompany the tutorials."
        },
        "lastUpdatedAt": 1613522076915,
        "publishedAt": 1170201600000,
        "level": "BEGINNER",
        "description": {
          "locale": {
            "country": "US",
            "language": "en"
          },
          "value": "Like the other applications in Microsoft Office 2007, Excel 2007 boasts upgraded features and a brand-new look. In Excel 2007 Essential Training , instructor Lorna A. Daly introduces the new version in detail. The training begins with the essentials of using the program, including how and why to use a spreadsheet, how to set up and modify worksheets, and how to import and export data. Lorna then moves on to teach more advanced features, such as working with functions and macros. Exercise files accompany the tutorials."
        },
        "shortDescription": {
          "locale": {
            "country": "US",
            "language": "en"
          },
          "value": "A detailed look at the features and uses of Excel 2007, including how and why to use spreadsheets."
        },
        "availability": "AVAILABLE",
        "availableLocales": [
          {
            "country": "US",
            "language": "en"
          }
        ],
        "relationships": [],
        "classifications": [
          {
            "assigner": {
              "urn": "urn:li:organization:1337",
              "name": {
                "locale": {
                  "country": "US",
                  "language": "en"
                },
                "value": "LinkedIn"
              }
            },
            "path": [],
            "associatedClassification": {
              "owner": {
                "urn": "urn:li:organization:1337",
                "name": {
                  "locale": {
                    "country": "US",
                    "language": "en"
                  },
                  "value": "LinkedIn"
                }
              },
              "name": {
                "locale": {
                  "country": "US",
                  "language": "en"
                },
                "value": "Microsoft Excel"
              },
              "urn": "urn:li:skill:163",
              "type": "SKILL"
            }
          }
        ],
        "urls": {
          "ssoLaunch": "https://www.linkedin.com/checkpoint/enterprise/login/105587602?pathWildcard=105587602&application=learning&redirect=https%3A%2F%2Fwww%2Elinkedin%2Ecom%2Flearning%2Fexcel-2007-essential-training%3Fu%3D105587602",
          "webLaunch": "https://www.linkedin.com/learning/excel-2007-essential-training",
          "aiccLaunch": "https://www.linkedin.com/learning/aicc?content=urn%3Ali%3AlyndaCourse%3A252&account=urn%3Ali%3AenterpriseApplicationInstance%3A%28urn%3Ali%3AenterpriseAccount%3A105587602%2C113669290%29"
        },
        "shortDescriptionIncludingHtml": {
          "locale": {
            "country": "US",
            "language": "en"
          },
          "value": "A detailed look at the features and uses of Excel 2007, including how and why to use spreadsheets."
        },
        "contributors": [
          {
            "name": {
              "locale": {
                "country": "US",
                "language": "en"
              },
              "value": "Lorna Daly"
            },
            "urn": "urn:li:lyndaAuthor:88",
            "contributionType": "AUTHOR",
            "authorDetails": {
              "lastName": {
                "locale": {
                  "country": "US",
                  "language": "en"
                },
                "value": "Daly"
              },
              "firstName": {
                "locale": {
                  "country": "US",
                  "language": "en"
                },
                "value": "Lorna"
              }
            }
          }
        ],
        "timeToComplete": {
          "duration": 18790,
          "unit": "SECOND"
        }
      },
      "title": {
        "locale": {
          "country": "US",
          "language": "en"
        },
        "value": "Excel 2007 Essential Training"
      },
      "type": "COURSE",
      "contents": [
        {
          "asset": {
            "urn": "urn:li:lyndaChapter:(urn:li:lyndaCourse:252,4472)",
            "title": {
              "locale": {
                "country": "US",
                "language": "en"
              },
              "value": "Introduction"
            },
            "type": "CHAPTER",
            "contents": [
              {
                "asset": {
                  "urn": "urn:li:lyndaVideo:(urn:li:lyndaCourse:252,24961)",
                  "title": {
                    "locale": {
                      "country": "US",
                      "language": "en"
                    },
                    "value": "Welcome"
                  },
                  "type": "VIDEO",
                  "contents": []
                }
              }
            ]
          }
        }
      ]
    }

    The synced learning object data is stored in the marketplace_linkedin_learning_object table.

LinkedIn Learning non-SSO user login

The process with non-SSO user login is straightforward, since there is no login data exchange between Totara and LinkedIn Learning. The user logs in to Totara and LinkedIn Learning separately with no data exchange.

LinkedIn Learning SSO user login

Totara relies on the SAML plugin for SSO integration with LinkedIn Learning, so the dataflow for SSO is not covered by this documentation. Even though the user authenticates against external IdP, Totara stores the local copy of the user.

LinkedIn Learning user completion

Totara acts as the OAuth2 server and LinkedIn Learning acts as the OAuth2 client in this case. 

  1. Totara uses League's OAuth2 server library to issue and validate OAuth2 access tokens for LinkedIn Learning.
  2. LinkedIn Learning sends back xAPI statements with OAuth2 access tokens with the following statement format:

    {
    "actor": {
    "mbox": "mailto:bolobala@example.com",
    "objectType": "Agent"
    },
    "result": {
    "completion": false,
    "extensions": {
    "https://w3id.org/xapi/cmi5/result/extensions/progress": "39"
    }
    },
    "verb": {
    "display": {
    "en-US": "PROGRESSED"
    },
    "id": "http://adlnet.gov/expapi/verbs/progressed"
    },
    "id": "6a9fefbb-3517-4b92-9d5e-5710aaba924f",
    "object": {
    "definition": {
    "type": "http://adlnet.gov/expapi/activities/course"
    },
    "id": "urn:li:lyndaCourse:1222",
    "objectType": "Activity"
    },
    "timestamp": "2021-08-18T04:44:23.764Z"
    }
  3. Totara validates the access token and generates a completion record based on the statement.