Configure sharing settings of content packages via the API

Introduction

You can configure the sharing settings of a SCORM or AICC content package directly in the Learn365 Admin Center or via LMS365 (Learn365) API endpoints. This article provides information on what API to use to check the current sharing settings of a content package, and what API you can use to configure or update the content package sharing settings.

 

Get SCORM data, including sharing settings

To get data related to a SCORM content package, including its current sharing settings, follow these steps:

1. Go to https://api.365.systems/ and make sure you are authorized with the relevant API key. You can find more about the authorization process in this article.

2. Find and expand the Scorms section, find the GET method /odata/v2/Scorms with the Returns the list of Scorms description, and select Try it out.

3. For the response to contain the sharing settings of the content package in question, enter Sharing in the $expand field.

You can narrow the response by configuring the $filter field:

  • If you have the ID of the SCORM in question, enter Id eq SCORM ID, where SCORM ID is replaced with the relevant data, for example Id eq 2d1e1525-5c04-45d6-9c72-048333f2f6c1.
  • If you have the title of the SCORM in question, enter Title eq 'SCORM title', where SCORM title is replaced with the relevant data, for example Title eq 'A Useful Guide to Appraisals'.

4. When ready, select Execute to run the request.

 

Checking_Scorm_sharing_settings_via_API

 

5. Go to the Responses block to check the results.

  • Number 2xx (for example, 200) under Code shows that the request worked correctly. 
  • In the Response body field, you can see the content packages (including its data) of the tenant, as well as their sharing settings. Search via Ctrl+F for the specific content package. 
  • The response contains information on content packages that match any filtering parameters that were set.

 

Scorm_sharing_setting_via_API

 

6. Copy all the data of the content package in question because it'll be needed to run the update request later in the process.

7. You can Download the data from the response to your computer in .JSON format.

 

Configure sharing settings

NOTE   

The PUT method updates the entire content package. This means that if you want to partially update the content package, for example only its sharing settings, you'll need to enter all content package data. Otherwise, any parameters that you skip will be overwritten and removed from the content package data. 

 

By configuring the sharing settings of a content package via API, you can add or remove sharing to a specific catalog or course, or configure sharing to the tenant.

To do this, follow these steps:

1. Find and expand the Scorms section, find the PUT method /odata/v2/Scorms({Id}) with the Updates a SCORM description, and select Try it out.

2. Complete the fields:

  • key: Id, a required parameter. Enter the ID of the content package for which you want to update the settings.
  • In the Edit Value field, complete all the parameters of the request, using the data from the response in the section above. 

3. Under Sharing, configure the sharing settings according to your needs:

  • Id, an optional parameter. This Id will be generated by the system automatically. 
  • AccessType, a required parameter. Replace string with the access type you want to set: Read, Edit or FullControl.
  • SharingType, a required parameter. Replace string with the sharing area you want to set: Courses (to share the content package with the selected courses), CourseCatalogs (to configure the catalogs with which you want to share the content package), or Tenant (to make the content package shared to all catalogs of the tenant).
  • EntityId, a required parameter. Replace string with the ID of the relevant course or catalog for the Courses and CourseCatalogs sharing type, respectively. If the Tenant sharing type is selected, then replace string with null
  • EntityTitle, a required parameter. Replace string with the title of the relevant course or catalog for the Courses and CourseCatalogs sharing type, respectively. If the Tenant sharing type is selected, then replace string with null

Here are some requests to configure the sharing settings of a content package, with examples:

  • To remove sharing to a catalog, delete from the Sharing part any parameters that relate to the catalog in question, then run the request.

EXAMPLE

Before
"Sharing": [ {"Id": "53bebfe5-4e8d-4e11-8516-cedec2799f3d", "AccessType": "Read", "SharingType": "CourseCatalogs", "EntityId": "3b5cd8e8-d685-4ce5-9184-64847d07956c", "EntityTitle": "ACADEMY"},
{ "Id": "cc058bba-4692-4b62-80e9-e8fdba570fdd", "AccessType": "FullControl", "SharingType": "CourseCatalogs", "EntityId": "d4d0b82f-e67f-46d7-a142-fc347a520973", "EntityTitle": "My learning hub"}]

After 

"Sharing": { "Id": "cc058bba-4692-4b62-80e9-e8fdba570fdd", "AccessType": "FullControl", "SharingType": "CourseCatalogs", "EntityId": "d4d0b82f-e67f-46d7-a142-fc347a520973", "EntityTitle": "My learning hub" }

 

  • To include a catalog in the content package sharing settings, add to the Sharing part the parameters that relate to this catalog, then run the request.

EXAMPLE

Before

"Sharing": { "Id": "cc058bba-4692-4b62-80e9-e8fdba570fdd", "AccessType": "FullControl",  "SharingType": "CourseCatalogs",  "EntityId": "d4d0b82f-e67f-46d7-a142-fc347a520973", "EntityTitle": "My learning hub" }

After 

"Sharing": [ {"Id": "53bebfe5-4e8d-4e11-8516-cedec2799f3d", "AccessType": "Read", "SharingType": "CourseCatalogs", "EntityId": "3b5cd8e8-d685-4ce5-9184-64847d07956c", "EntityTitle": "ACADEMY"},
{ "Id": "cc058bba-4692-4b62-80e9-e8fdba570fdd", "AccessType": "FullControl", "SharingType": "CourseCatalogs", "EntityId": "d4d0b82f-e67f-46d7-a142-fc347a520973", "EntityTitle": "My learning hub"}]

 

  • To add sharing to a course, add to the Sharing part the parameters that relate to this course, then run the request.

EXAMPLE

Before

"Sharing": { "Id": "a45445b7-a2a2-470d-b864-bf2f08301374", "AccessType": "Edit", "SharingType": "Tenant", "EntityId": null, "EntityTitle": null }

After 

"Sharing": [ { "Id": "a45445b7-a2a2-470d-b864-bf2f08301374", "AccessType": "Edit", "SharingType": "Tenant", "EntityId": null, "EntityTitle": null }, { "Id": "350f60cc-2b7a-4a69-b99b-6dcad7d7d69e", "AccessType": "FullControl", "SharingType": "Courses", "EntityId": "065778c6-6d0c-45f0-b1de-7396952a8b2a", "EntityTitle": "Management skills" } ]

 

  • To configure sharing to the whole tenant, either add the relevant parameters to enable sharing to all catalogs across the tenant, or remove the parameters to limit sharing across the tenant catalogs.

EXAMPLE

Before

"Sharing": { "Id": "350f60cc-2b7a-4a69-b99b-6dcad7d7d69e", "AccessType": "FullControl", "SharingType": "Courses", "EntityId": "065778c6-6d0c-45f0-b1de-7396952a8b2a", "EntityTitle": "Management skills" } 

After 

"Sharing": [ { "Id": "a45445b7-a2a2-470d-b864-bf2f08301374", "AccessType": "Edit", "SharingType": "Tenant", "EntityId": null, "EntityTitle": null }, { "Id": "350f60cc-2b7a-4a69-b99b-6dcad7d7d69e", "AccessType": "FullControl", "SharingType": "Courses", "EntityId": "065778c6-6d0c-45f0-b1de-7396952a8b2a", "EntityTitle": "Management skills" } ]

 

4. When ready. select Execute to run the request.

Here is an example of a request to update sharing settings of a content package, which includes sharing of this content package to a specific course and two catalogs.


EXAMPLE

{
"Id": "6bfa1fe2-f3ad-4116-8b19-cad3c4b5b819",
"Title": "Code of Conduct",
"Description": "This content package provides guidelines about the company's policies for employee conduct.",
"Configuration": "{\"AllowBrowse\":false,\"AllowReview\":false,\"AllowContinueIfCompletionStatusEqualsNo\":true,

\"ControlModeFlow\":true,\"ShowStatisticsForLearner\":false,\"NavOptions\":0,

\"ShowCompletionStatus\":false,\"FinishByLessonStatus\":true,\"RedirectIfCompleted\":true,

\"AutoContinue\":true,\"CompleteAsPassed\":false,\"Tag\":\"\",\"TocWidth\":null,\"AsyncCommit\":false,

\"Attempts\":null,\"Timeout\":null,\"NewWindow\":false,\"DlgWidth\":null,\"DlgHeight\":null,

\"AllowResizing\":false,\"MinimalWidth\":null,\"MinimalHeight\":null}",
"Version": 0,
"ContentType": "Scorm",
"Location": "9d087e7bc31c440cb976ad8a54c3863a",
"FileName": "employee-conduct-scorm12-l1x6ufa-.zip",
"CreatedAt": "2022-06-17T08:44:41.667Z",
"ModifiedAt": "2022-10-20T11:05:56.523Z",
"Sharing": [
{
"Id": "72fa2368-08cb-4fe9-baad-fc40d1a8da8e",
"AccessType": "Read",
"SharingType": "CourseCatalogs",
"EntityId": "3b92a150-b439-4d85-ab9b-10174fe93ae6",
"EntityTitle": "Customer care and service training"
},
{
"Id": "2f207cbc-5ea5-4f3b-954f-33d70a28a85e",
"AccessType": "Read",
"SharingType": "CourseCatalogs",
"EntityId": "d4d0b82f-e67f-46d7-a142-fc347a520973",
"EntityTitle": "My learning hub"
},
{
"Id": "c4c0afb2-0d3f-40dc-b037-aeec0aeeab54",
"AccessType": "FullControl",
"SharingType": "Courses",
"EntityId": "a89d5cc6-91da-4640-b213-f35efc9a219d",
"EntityTitle": "Code of Conduct"
}
]

 

Content_package_sharing_settings_update_request

 

5. Go to the Responses block to check the results:

  • Number 2xx (for example, 200) under Code shows that the request worked correctly. 
  • In the Response body field, you can see the data of the content package, including the updated sharing settings.
  • You can check the results in the Learn365 Admin Center > Content > Content package storage > select the relevant content package > Edit content package and check the sharing settings.

 

Was this article helpful?
0 out of 0 found this helpful

Comments

Article is closed for comments.