Edit a group: Migration guide
This guide outlines the changes introduced in the Edit a group v2 endpoint (previously known as updateGroup
in v1).
Key changes
- HTTP method: The v2 endpoint uses the
PATCH
method, while v1 used thePUT
method.
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
- API v2:
/api/v2/groups/{groupId}
Input changes
This section details the specific alterations to the input requirements between API versions.
API v1 input example
curl --location -g --request PUT 'https://{{host}}/api/v1/groups/:group_id?company={{company}}&apiKey={{apiKey}}' \
--form 'name="MyAPIUpdatedGroup"' \
--form 'public="false"' \
--form 'custom="A new custom info"'
API v2 input example
curl --request PATCH \
--url https://app.360learning.com/api/v2/groups/groupId \
--header '360-api-version: v2.0' \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--data '
{
"privacyPolicy": {
"url": "https://example.com/policy",
"explicitConsent": true
},
"moderationCharter": {
"url": "https://example.com/policy",
"explicitConsent": true
},
"termsOfUse": {
"url": "https://example.com/policy",
"explicitConsent": true
},
"bannerImageId": "507f1f77bcf86cd799439011",
"custom": "Unit 102",
"name": "Marketing Team",
"public": true,
"parentId": "507f1f77bcf86cd799439011"
}
'
Main input differences
Change type | API v1 | API v2 |
---|---|---|
Modified Body parameter | parent : unique ID of the parent group | parentId : unique ID of the parent group |
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
{
"privacyPolicy": {
"url": "https://example.com/policy",
"explicitConsent": true
},
"moderationCharter": {
"url": "https://example.com/policy",
"explicitConsent": true
},
"termsOfUse": {
"url": "https://example.com/policy",
"explicitConsent": true
},
"bannerImageId": "507f1f77bcf86cd799439011",
"_id": "507f1f77bcf86cd799439011",
"name": "Engineering Team",
"custom": "Unit 101",
"public": true,
"parentId": "507f1f77bcf86cd799439011"
}
Main output differences
API v2 response is now completely different and returns the updated group instead of an acknowledgment of the update operation. Please refer to the Retrieve a group: Migration guide for an overview of the group output differences.
Updated 4 days ago