Perform a pre-check before either creating a new content item or a new revision of a content item. Since it is possible that some of the content's dependencies have already been uploaded as part of other content items, it is preferable to avoid uploading duplicates.
The response to this pre-check not only verifies that the user is allowed to perform the operation they are requesting, it also indicates which of the dependencies should be uploaded to the server.
POST /api/v1/content/upload-precheck HTTP/1.1
Authorization: Bearer ...
Content-Type: application/json
{
"contentId": "a26ea8ef-1e6b-4d0b-8f0a-735c09b3e1e7",
"operation": "create",
"dependencies": [
{
"entityId": "3d65ae55-d7f3-4f5e-b870-da25ff21677d",
"revisionId": "9105f69b-81c7-42f2-acc3-52226cc25ac3"
},
{
"entityId": "56b9c5e8-cfe8-4c48-9931-1e0173a8dc70",
"revisionId": "ec2d1b30-77cf-4ec1-8299-154d28279b5e"
},
{
"entityId": "a877426a-7a22-47ac-aed5-9ff8cffeb30e",
"revisionId": "8ca437d2-dd66-4a62-b858-2778f89078d1"
}
],
"packages": [
"e4304791-a586-4560-b509-3379ce3ad61f",
"297f0f5e-e77a-453e-a097-ee4a0f347e15"
]
}
----------------------------------------
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
Content-Length: 324
ETag: W/"144-X8aZlOjejtxeHt36vM8GJOBxjjc"
{
"needed": [
{
"entityId": "3d65ae55-d7f3-4f5e-b870-da25ff21677d",
"revisionId": "9105f69b-81c7-42f2-acc3-52226cc25ac3"
}, {
"entityId": "56b9c5e8-cfe8-4c48-9931-1e0173a8dc70",
"revisionId": "ec2d1b30-77cf-4ec1-8299-154d28279b5e"
}, {
"entityId": "a877426a-7a22-47ac-aed5-9ff8cffeb30e",
"revisionId": "8ca437d2-dd66-4a62-b858-2778f89078d1"
}
],
"neededPackages": [
"e4304791-a586-4560-b509-3379ce3ad61f",
"297f0f5e-e77a-453e-a097-ee4a0f347e15"
]
}Authentication is required. Authorization fails if the user is trying to create:
| Name | Description | Value |
|---|---|---|
| contentId | the content ID to check, as a GUID with dashes | string |
| operation | the operation the user wishes to perform, one of:
| string |
| dependencies | a list of entities that make up this content item | array of object; see EntityReference |
| packages | a list of packages (asset bundles) that make up this content item, as an array of package IDs | array of string |
| Name | Description | Value |
|---|---|---|
| entityId | the entity ID as a GUID with dashes | string |
| revisionId | the entity's revision ID as a GUID with dashes | string |
Successful responses are code 200 with data in the response body. Other error responses are standard.
| Name | Description | Value |
|---|---|---|
| needed | the entities that should be uploaded prior to the next step (either creating content or creating a revision) | array of object; see EntityReference |
| neededPackages | the packages that should be uploaded prior to the next step | array of string |