Migrate updateCustomUserLink
This guide outlines the changes introduced in the Replace custom user links v2 endpoint (previously known as updateCustomUserLink in v1).
Key changes
- Resource identification: API v2 uses specific path parameters (
userIdandcustomUserLinkId) to identify the resource. API v1 relied on a combination oftypewithin the request body.- Full resource replacement: Unlike v1, v2 requires you to provide all mandatory fields (
customLinkIdandurl) in the request body, even if only one value is being changed.
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/customuserlinks - API v2:
/api/v2/users/{userId}/custom-links/{customUserLinkId}
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://app.360learning.com/api/v1/customlinks?company={{company}}&apiKey={{apiKey}}' \
--header 'Content-Type: application/json' \
--data-raw '{
"type": "calendar link",
"mail": "[email protected]",
"update":
{
"url": "https://360learning.com",
"type": "new calendar link"
}
}'API v2 input example
curl --request PUT \
--url https://app.360learning.com/api/v2/users/507f1f77bcf86cd799439011/custom-links/612f1f77bcf86cd799439011 \
--header '360-api-version: v2.0' \
--header 'accept: application/json' \
--header 'authorization: Bearer access_token' \
--header 'content-type: application/json' \
--data '
{
"customLinkId": "1a2b3c4d5e6f7a8b9c8d7e6f",
"url": "https://360learning.com"
}
'Main input differences
Change type | API v1 | API v2 |
|---|---|---|
Removed |
| |
Removed |
| |
Removed |
| |
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": "custom_user_link_updated"
}API v2 output example
{
"_id": "1a2b3c4d5e6f7a8b9c8d7e6f",
"customLinkId": "1a2b3c4d5e6f7a8b9c8d7e6f",
"url": "https://360learning.com"
}Main output differences
Change type | API v1 | API v2 |
|---|---|---|
Removed |
| |
Added |
| |
Added |
| |
Added |
|
Updated 22 days ago
