Remove content from libraries: Migration guide
This guide outlines the main differences between the Remove content from libraries endpoint and the v1 deleteFromGroupLibrary endpoint.
Key changes
- Restricted scope: The v2 endpoint is restricted and requires the following scope:
groups:bulk. To request this scope, reach out to your Customer Success Partner (CSP).- Bulk operation: The v2 endpoint operates as a bulk endpoint, allowing you to process up to 20,000 objects asynchronously. The v1 endpoint was a synchronous operation for a single group.
- Request structure: The v2 endpoint shifts from using multiple top-level JSON arrays (organized by type) to a single input array of objects.
Documentation links
Here are the links to the API reference for:
Endpoint mapping
Here's the direct correlation between the v1 and v2 endpoint URLs:
- API v1:
/api/v1/groups/:group_id/library - API v2:
/api/v2/bulk/groups/library
Behavior changes
This section details the specific changes in the internal behavior of the API.
- Asynchronous processing: API v2 shifts from synchronous to asynchronous operations. Instead of an immediate success (
200 OK), it returns a202 Acceptedstatus code. A successful response code does not mean the content is already removed, but that the task has started. The response includes aLocationheader to track the bulk operation's status. - Bulk scope: The v2 endpoint is designed for bulk removal, allowing removal of multiple content associations across different groups and content types in a single call (up to 20,000 items). The v1 endpoint only supported removal from a single group per request.
Input changes
This section details the specific alterations to the input requirements between API versions.
API v1 input example
curl --location --request DELETE 'https://app.360learning.com/api/v1/groups/6470744ad045da027bccafd1/library' \
--header 'Content-Type: application/json' \
--data '{
"courses": ["6475f4696935d28559684d22"]
}'API v2 input example
curl --request DELETE \
--url https://app.360learning.com/api/v2/bulk/groups/library \
--header '360-api-version: v2.0' \
--header 'accept: application/json' \
--header 'authorization: Bearer your_access_token' \
--header 'content-type: application/json' \
--data '
{
"input": [
{
"groupId": "6470744ad045da027bccafd1",
"contentType": "course",
"contentId": "6475f4696935d28559684d22"
},
{
"groupId": "507f1f77bcf86cd799439032",
"contentId": "545f1f77bcf86cd799439011",
"contentType": "path"
}
]
}
'Main input differences
Change type | API v1 | API v2 |
|---|---|---|
Removed |
| Replaced by |
Removed |
| Removed because the underlying feature (Programs) has been retired from the platform and is not supported in API v2. |
Removed |
| Content IDs and types are now specified using the nested fields |
Removed |
| Content IDs and types are now specified using the nested fields |
Added |
| |
Added |
| |
Added |
| |
Added |
| |
Added |
|
Output changes
This section details the specific alterations to the successful output returned between API versions.
API v1 output example
{
"status": "group_updated"
}
API v2 output example
No JSON body is returned for a successful submission. The 202 status code is the key response indicator.
Main output differences
API v2 shifted from synchronous (200 OK) to asynchronous operations (202 Accepted). The primary change is the response code and the inclusion of the Location header to track the operation's status.
Change type | API v1 | API v2 |
|---|---|---|
Removed |
| |
Modified |
|
|
Updated about 2 months ago
