-
Notifications
You must be signed in to change notification settings - Fork 5
PatchCollaboration
Allows to update an existing Song Collaboration. This operation is only allowed when the requestor is the Collaboration owner and the status
is Editing
.
URL: /v1/collaorations/{collaorationId}
Method: PATCH
Path Parameters: None
Query Parameters: None
Headers:
Authorization: Bearer {accessToken}
Content-Type: application/json
Content:
Field | Type | Description | Requirement Type |
---|---|---|---|
string | Email of the Collaborator. | Optional | |
role | string | Collaborator role. | Optional |
royaltyRate | decimal | Percentage of total royalties owned to the Collaborator. | Optional |
credited | boolean | Indicates whether or not the Collaboration should be credited to the Collaborator. | Optional |
featured | boolean | Indicates whether or this Collaboration is for a featured Collaborator. | Optional |
Content example:
{
"email": "[email protected]",
"role": "Composer",
"royaltyRate": 10.5,
"credited": true,
"featured": true
}
Code: 204 NO CONTENT
Headers: None
Code: 401 UNAUTHORIZED
Condition: If {accessToken}
is invalid or expired.
Code: 403 FORBIDDEN
Condition: If the requestor is not the Collaboration owner.
Headers:
Content-Type: application/json
Content example:
{
"code": 403,
"description": "Forbidden",
"cause": "Operation allowed only by owner"
}
Code: 404 NOT FOUND
Condition: If the specified Collaboration is not found.
Headers:
Content-Type: application/json
Content example:
{
"code": 404,
"description": "Not Found",
"cause": "Entity CollaborationEntity, id=d0907e3d-a9a7-43b1-93dc-f3b0ee929021 not found in the database"
}
Code: 409 CONFLICT
Condition: If email
was already used in another collaboration on the same song.
Headers:
Content-Type: application/json
Content example:
{
"code": 409,
"description": "Conflict",
"cause": "Collaboration already exists: songId = a1031b4b-144e-4b97-93aa-d58e2c5c245f, email = [email protected]"
}
Code: 422 UNPROCESSABLE ENTITY
Condition: If any field is malformed, exceeds maximum length allowed or operation attempted when status
is other thanEditing
.
Headers:
Content-Type: application/json
Content example:
{
"code": 422,
"description": "Unprocessable Entity",
"cause": "Operation only allowed when status = Editing"
}