Sites API (2024.10)

Download OpenAPI specification:Download

Fragment Management

List all Content Fragments

This operation provides support for retrieving all the Content Fragments accessible to the current user, determined via the applied request authorization. By default this call will return a maximum of 50 items.

The caller can define other limits suited to their application (see the limit query parameter), but the limit cannot be higher than 50. To ask for the next set of items pass the value of the cursor provided in the response to the cursor query parameter.

SecuritybearerAuth
Request
query Parameters
cursor
string (Cursor) non-empty

For a paginated request, this parameter defines the cursor from which to retrieve the next set of items.

limit
integer <int32> (Limit) [ 1 .. 50 ]

For a paginated request, this parameter defines the maximum number of items to retrieve.

path
string

Optional UTF-8 encoded parameter to specify a path where to start looking for content fragments.

Examples:
Get exactly one '/aem-cloud-service-from-a-developer-perspective' content fragment.
path=/content/dam/adaptto/presentations/aem-cloud-service-from-a-developer-perspective
Get all child content fragments under '/presentations' folder.
path=/content/dam/adaptto/presentations
references
string (References)
Default: "direct-hydrated"

When the path query parameter identifies a Content Fragment, this parameter allows controlling the way the references are retrieved for that fragment. When this parameter is missing, the references will not be populated.

The following options are available:

  • direct - only direct references will be collected; they will not be hydrated;
  • direct-hydrated - only direct references will be collected; they will be fully hydrated;
  • all - all references up to the maximum allowed depth will be collected; they will not be hydrated;
  • all-hydrated - all references up to the maximum allowed depth will be collected; they will be fully hydrated

Non-hydrated responses will only include the properties defined by the BaseReference type when embedding references. Hydrated responses are defined by each implementation of the BaseReference type. In particular, for Content Fragment references the response will include the fragment's fields, variations, tags.

Enum: "direct" "direct-hydrated" "all" "all-hydrated"
Responses
200

A response containing a potentially paginated list of content fragments.

400

Bad Request. The Problem Details object will provide more information about the exact cause.

406

Unacceptable. indicates that the target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request.

500

The server encountered an unexpected error. Retrying the request after a certain time could help.

get/cf/fragments
Request samples
Response samples
application/json
{
  • "items": [
    ],
  • "cursor": "string"
}

Create a Content Fragment

SecuritybearerAuth
Request
Request Body schema: application/json
required
title
required
string

The title of the new Content Fragment.

description
string

The description of the new Content Fragment.

modelId
required
string (Base64URLId)

Defines a base64url with no padding encoded ID.

parentPath
required
string

The folder in which the new Content Fragment has to be created. This path is relative to the /content/dam folder.

name
string

Optional parameter that represents the name used when storing the new Content Fragment. When missing, the value will be derived by the server from the title value.

Array of objects (ContentFragmentField)

Data needed for populating the content fragment fields defined in the model

Responses
201

The Content Fragment was successfully created.

400

Bad Request. The Problem Details object will provide more information about the exact cause.

403

Forbidden

406

Unacceptable. indicates that the target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request.

409

Conflict

415

Unsupported Media Type. When provided as a response to a PATCH request, the response will provide an Accept-Patch response header to notify the client what patch document media types are supported.

500

The server encountered an unexpected error. Retrying the request after a certain time could help.

post/cf/fragments
Request samples
application/json
{
  • "title": "Snowboarding",
  • "name": "snowboarding-cf",
  • "description": "This new CF is created with the new POST endpoint",
  • "modelId": "L2NvbmYvZ2xvYmFsL3NldHRpbmdzL2RhbS9jZm0vbW9kZWxzL3NpbXBsZS1jZg",
  • "parentPath": "/wknd-shared/en/adventures",
  • "fields": [
    ]
}
Response samples
application/json
{
  • "path": "/content/dam/wknd-shared/en/adventures/snowboarding-cf",
  • "title": "Snowboarding",
  • "description": "This new CF is created with the new POST endpoint",
  • "id": "04dbb683-a63c-4144-9a27-7d019bd3e50e",
  • "created": {
    },
  • "modified": { },
  • "status": "NEW",
  • "fields": [
    ],
  • "variations": [ ],
  • "tags": [ ],
  • "references": [ ],
  • "model": {
    },
  • "validationStatus": [ ],
  • "fieldTags": [ ]
}

Get a Content Fragment

SecuritybearerAuth
Request
path Parameters
fragmentId
required
string <uuid> (UUID)

Content Fragment unique identifier

Example: 49af775d-0e7a-46c3-913d-00f762528373
query Parameters
references
string (References)
Default: "direct-hydrated"

This parameter defines how references will be retrieved for Content Fragments. The following options are available:

  • direct - only direct references will be collected; they will not be hydrated;
  • direct-hydrated - only direct references will be collected; they will be fully hydrated;
  • all - all references up to the maximum allowed depth will be collected; they will not be hydrated;
  • all-hydrated - all references up to the maximum allowed depth will be collected; they will be fully hydrated

Non-hydrated responses will only include the properties defined by the BaseReference type when embedding references. Hydrated responses are defined by each implementation of the BaseReference type. In particular, for Content Fragment references the response will include the fragment's fields, variations, tags.

Enum: "direct" "direct-hydrated" "all" "all-hydrated"
header Parameters
If-None-Match
string

The If-None-Match header field makes the request method conditional on a recipient cache or origin server either not having any current representation of the target resource, when the field value is "*", or having a selected representation with an entity tag that does not match any of those listed in the field value.

For more details, please head over to RFC9110.

Responses
200

OK

304

Not Modified

400

Bad Request. The Problem Details object will provide more information about the exact cause.

403

Forbidden

404

Not Found

406

Unacceptable. indicates that the target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request.

500

The server encountered an unexpected error. Retrying the request after a certain time could help.

get/cf/fragments/{fragmentId}
Request samples
Response samples
application/json
{
  • "path": "/content/dam/wknd-shared/en/contributors/ian-provo",
  • "title": "Ian Provo",
  • "description": "",
  • "id": "6d980e6a-c9e7-444b-af43-5503c46a061c",
  • "created": {
    },
  • "modified": {
    },
  • "status": "DRAFT",
  • "fields": [
    ],
  • "variations": [
    ],
  • "tags": [
    ],
  • "references": [
    ],
  • "model": {
    },
  • "validationStatus": [ ],
  • "fieldTags": [ ],
  • "etag": "79d1081c7b275f62a99ccd92828c4c83"
}

Edit a Content Fragment

This operation allows editing a Content Fragment. The changes are passed as JSON Patch documents.

Save conflicts are detected by leveraging conditional HTTP requests. When a conflict occurs, the server will reply with a 412 response. It becomes the caller's responsibility to resolve the conflict, either by accepting the values from the server, or by overwriting them.

Edit requests should pass the most recent ETag value received from the server for a representation with fully hydrated direct references.

SecuritybearerAuth
Request
path Parameters
fragmentId
required
string <uuid> (UUID)

Content Fragment unique identifier

Example: 49af775d-0e7a-46c3-913d-00f762528373
header Parameters
If-Match
required
string

The If-Match header field makes the request method conditional on the recipient origin server either having at least one current representation of the target resource, when the field value is "*", or having a current representation of the target resource that has an entity tag matching a member of the list of entity tags provided in the field value.

For more details, please head over to RFC9110.

Request Body schema: application/json-patch+json
required
Array
One of:

Adds the contents of the value parameter to the location indicated by the path parameter.

path
required
string non-empty

The location where information should be added

op
required
string >= 3 characters

Identifies this operation as an add operation

Value: "add"
required
string or number or Array of any or object

The information to place at the location indicated by the path parameter

Responses
200

OK

400

Bad Request. The Problem Details object will provide more information about the exact cause.

404

Not Found

406

Unacceptable. indicates that the target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request.

409

Conflict

412

Precondition Failed

415

Unsupported Media Type. When provided as a response to a PATCH request, the response will provide an Accept-Patch response header to notify the client what patch document media types are supported.

428

Precondition Required

500

The server encountered an unexpected error. Retrying the request after a certain time could help.

patch/cf/fragments/{fragmentId}
Request samples
application/json-patch+json
[
  • {
    },
  • {
    },
  • {
    }
]
Response samples
application/json
{
  • "path": "/content/dam/wknd-shared/en/contributors/ian-provo",
  • "title": "Title has been replaced",
  • "description": "",
  • "id": "6d980e6a-c9e7-444b-af43-5503c46a061c",
  • "created": {
    },
  • "modified": {
    },
  • "status": "DRAFT",
  • "fields": [
    ],
  • "variations": [
    ],
  • "tags": [
    ],
  • "references": [
    ],
  • "model": {
    },
  • "validationStatus": [ ],
  • "fieldTags": [ ]
}

Update all mutable properties of a Content Fragment

This operation allows fully updating mutable properties of a Content Fragment. The changes are passed as JSON.

Update requests should pass the most recent ETag value received from the server for a representation with fully hydrated direct references.

SecuritybearerAuth
Request
path Parameters
fragmentId
required
string <uuid> (UUID)

Content Fragment unique identifier

Example: 49af775d-0e7a-46c3-913d-00f762528373
header Parameters
If-Match
required
string

The If-Match header field makes the request method conditional on the recipient origin server either having at least one current representation of the target resource, when the field value is "*", or having a current representation of the target resource that has an entity tag matching a member of the list of entity tags provided in the field value.

For more details, please head over to RFC9110.

Request Body schema: application/json
required
title
required
string

Updated title of the Content Fragment.

description
string

Updated description of the Content Fragment.

Array of objects (ContentFragmentField)

Updated fields on the Content Fragment.

Responses
200

OK

400

Bad Request. The Problem Details object will provide more information about the exact cause.

404

Not Found

406

Unacceptable. indicates that the target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request.

412

Precondition Failed

415

Unsupported Media Type. When provided as a response to a PATCH request, the response will provide an Accept-Patch response header to notify the client what patch document media types are supported.

428

Precondition Required

500

The server encountered an unexpected error. Retrying the request after a certain time could help.

put/cf/fragments/{fragmentId}
Request samples
application/json
{
  • "title": "Snowboarding",
  • "description": "This new CF is created with the new PUT endpoint",
  • "fields": [
    ]
}
Response samples
application/json
{
  • "path": "/content/dam/wknd-shared/en/contributors/ian-provo",
  • "title": "Title has been replaced",
  • "description": "",
  • "id": "6d980e6a-c9e7-444b-af43-5503c46a061c",
  • "created": {
    },
  • "modified": {
    },
  • "status": "DRAFT",
  • "fields": [
    ],
  • "variations": [
    ],
  • "tags": [
    ],
  • "references": [
    ],
  • "model": {
    },
  • "validationStatus": [ ],
  • "fieldTags": [ ]
}

Delete a Content Fragment

This operation deletes a Content Fragment.

Deletes are based on conditional HTTP requests. When a conflict occurs, the server will reply with a 412 response.

Delete requests should pass the most recent ETag value received from the server for a representation with fully hydrated direct references.

SecuritybearerAuth
Request
path Parameters
fragmentId
required
string <uuid> (UUID)

Content Fragment unique identifier

Example: 49af775d-0e7a-46c3-913d-00f762528373
header Parameters
If-Match
required
string

The If-Match header field makes the request method conditional on the recipient origin server either having at least one current representation of the target resource, when the field value is "*", or having a current representation of the target resource that has an entity tag matching a member of the list of entity tags provided in the field value.

For more details, please head over to RFC9110.

Responses
204

No Content

400

Bad Request. The Problem Details object will provide more information about the exact cause.

403

Forbidden

404

Not Found

412

Precondition Failed

428

Precondition Required

500

The server encountered an unexpected error. Retrying the request after a certain time could help.

delete/cf/fragments/{fragmentId}
Request samples
Response samples
application/problem+json
{}

Get the preview URLs for a Content Fragment

SecuritybearerAuth
Request
path Parameters
fragmentId
required
string <uuid> (UUID)

Content Fragment unique identifier

Example: 49af775d-0e7a-46c3-913d-00f762528373
Responses
200

OK

400

Bad Request. The Problem Details object will provide more information about the exact cause.

404

Not Found

406

Unacceptable. indicates that the target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request.

500

The server encountered an unexpected error. Retrying the request after a certain time could help.

get/cf/fragments/{fragmentId}/previewUrl
Request samples
Response samples
application/json
{}

Get the scheduled publication status for a Content Fragment

SecuritybearerAuth
Request
path Parameters
fragmentId
required
string <uuid> (UUID)

Resource unique identifier

Example: 49af775d-0e7a-46c3-913d-00f762528373
Responses
200

OK

400

Bad Request. The Problem Details object will provide more information about the exact cause.

403

Forbidden

404

Not Found

406

Unacceptable. indicates that the target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request.

500

The server encountered an unexpected error. Retrying the request after a certain time could help.

get/cf/fragments/{fragmentId}/scheduledPublicationStatus
Request samples
Response samples
application/json
{
  • "action": "PUBLISH",
  • "status": "PENDING",
  • "scheduledBy": "admin",
  • "scheduledDate": "2023-08-04T12:11:09.120Z"
}

Get the current's user permissions on a list of resources

This operation returns the list of permissions the user has over a list of resources. The resources have to be either Content Fragments or Folders and be stored under /content/dam.

SecuritybearerAuth
Request
Request Body schema: application/json

Request parameters to retrieve permissions.

paths
required
Array of strings non-empty

The list of resource paths - Content Fragments, Content Fragment Models and Folder - for which the system has to return the list of permissions for a user. The Content Fragments are expected to be within the /content/dam directory, the Content Fragment Models within the /conf directory, and the Folders could be within either /content/dam or the /conf directory.

preferredPermissions
Array of strings (Permission)

The preferred list of permissions to return.

Items Enum: "READ" "EDIT" "RENAME" "DELETE" "PUBLISH" "CREATE_CONTENT_FRAGMENT" "CREATE_CONTENT_FRAGMENT_MODEL"
Responses
200

OK

400

Bad Request. The Problem Details object will provide more information about the exact cause.

406

Unacceptable. indicates that the target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request.

413

"The HTTP 413 Content Too Large response status code indicates that the request entity is larger than limits defined by server; the server might close the connection or return a Retry-After header field. Prior to RFC 9110 the response phrase for the status was Payload Too Large. That name is still widely used."

415

Unsupported Media Type. When provided as a response to a PATCH request, the response will provide an Accept-Patch response header to notify the client what patch document media types are supported.

500

The server encountered an unexpected error. Retrying the request after a certain time could help.

post/cf/fragments/permissions
Request samples
application/json
{
  • "paths": [
    ],
  • "preferredPermissions": [
    ]
}
Response samples
application/json
{
  • "items": [
    ]
}

Publish Content Fragments

This operation starts an AEM workflow for publishing Content Fragments.

SecuritybearerAuth
Request
Request Body schema: application/json

Request parameters to publish content fragments.

ids
Array of strings <uuid> (UUID) <= 50 items unique

The list of content fragment IDs.

paths
Array of strings (Path) <= 50 items unique

The list of content fragment paths.

agentId
string
Default: "publish"

The agent id used for publishing the content fragments.

filterReferencesByStatus
required
Array of any <= 3 items

Provides the option to filter the references by status.

Items Enum: "DRAFT" "UNPUBLISHED" "MODIFIED"
workflowModelId
string
Default: "/etc/workflow/models/scheduled_activation_with_references"

The workflow model id used for initiating the workflow instance to handle the publication. AEM provides the designated model /etc/workflow/models/scheduled_activation_with_references for publishing content fragments including their references.

workflowTitle
string

A freely defined non-empty string used to identify the workflow when it executes.

scheduledTime
integer <int64>

The scheduled time as an epoch timestamp.

Responses
200

OK

400

Bad Request. The Problem Details object will provide more information about the exact cause.

406

Unacceptable. indicates that the target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request.

413

"The HTTP 413 Content Too Large response status code indicates that the request entity is larger than limits defined by server; the server might close the connection or return a Retry-After header field. Prior to RFC 9110 the response phrase for the status was Payload Too Large. That name is still widely used."

415

Unsupported Media Type. When provided as a response to a PATCH request, the response will provide an Accept-Patch response header to notify the client what patch document media types are supported.

500

The server encountered an unexpected error. Retrying the request after a certain time could help.

post/cf/fragments/publish
Request samples
application/json
{
  • "paths": [
    ],
  • "filterReferencesByStatus": [
    ],
  • "workflowModelId": "/etc/workflow/models/scheduled_activation_with_references",
  • "workflowTitle": "A workflow that publishes a fragment with its references",
  • "scheduledTime": 1635244063701
}
Response samples
application/json
{
  • "ids": [
    ],
  • "filterReferencesByStatus": [
    ],
  • "workflowModelId": "/etc/workflow/models/scheduled_activation_with_references",
  • "workflowTitle": "Workflow Title",
  • "scheduledTime": 1635244063701
}

Copy a Content Fragment

This operation copies a Content Fragment from one location to another.

SecuritybearerAuth
Request
path Parameters
fragmentId
required
string <uuid> (UUID)

The unique identifier of the Content Fragment to be copied.

Example: 49af775d-0e7a-46c3-913d-00f762528373
Request Body schema: application/json
required
parentPath
required
string (RelativePath) ^(\/content\/dam.*?)$|^((?!\/).*)$

Path to a resource relative to the /content/dam folder. It either starts with /content/dam or is relative to it. The relative path never starts with a / character.

name
string

This property allows you to specify a new name for the resource being copied.

When a value is not provided the original name of the resource will be used. In case of resource conflicts in the destination folder, the server will automatically generate an alternative resource name based on the provided value.

When a value is provided and a conflict exists in the destination folder, the caller will have to explicitly solve the conflict.

Responses
201

The Content Fragment was successfully copied.

400

Bad Request. The Problem Details object will provide more information about the exact cause.

403

Forbidden

404

Not Found

406

Unacceptable. indicates that the target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request.

409

Conflict

415

Unsupported Media Type. When provided as a response to a PATCH request, the response will provide an Accept-Patch response header to notify the client what patch document media types are supported.

500

The server encountered an unexpected error. Retrying the request after a certain time could help.

post/cf/fragments/{fragmentId}/copy
Request samples
application/json
{
  • "parentPath": "string",
  • "name": "string"
}
Response samples
application/json
{
  • "path": "/content/dam/wknd-shared/en/contributors/ian-provo",
  • "title": "Ian Provo",
  • "description": "",
  • "id": "6d980e6a-c9e7-444b-af43-5503c46a061c",
  • "created": {
    },
  • "modified": {
    },
  • "status": "DRAFT",
  • "fields": [
    ],
  • "variations": [
    ],
  • "tags": [
    ],
  • "references": [
    ],
  • "model": {
    },
  • "validationStatus": [ ],
  • "fieldTags": [ ],
  • "etag": "79d1081c7b275f62a99ccd92828c4c83"
}

Find and replace text in Content Fragments

This operation provides support for bulk editing the selected content fragments in the sense of replacing text occurrences for all fields of type text and long-text. This operation executes synchronously. For performance considerations, the operation applies on a batch of selected CFs identified by a list of their paths.

SecuritybearerAuth
Request
Request Body schema: application/json

Request payload for Content Fragments Bulk Edit Find and Replace

paths
required
Array of strings (ContentFragmentPath) <= 20 items

The list of Content Fragments paths on which Find And Replace operation is performed.

find
required
string^[^<>]*$

String we want to replace in all TEXT fields in selected Content Fragments

replace
required
string^[^<>]*$

Replacement string.

dryRun
required
boolean

Find And Replace operation runs in simulation mode, we only get simulated results and no change is committed in JCR.

ignoreErrors
required
boolean

True means that we want replacement taking place for all cases when Replacement would be successful and do nothing for cases in error.

isCaseSensitive
boolean
Default: true

True means that we want to perform case sensitive search.

matchExactWord
boolean
Default: false

A flag indicating whether to only consider the exact matches of the find String When set to true (optional), the replacement will occur only for occurrences of the find String that are entire words, excluding parts of compound words. When set to false (default), the replacement will happen for any occurrence of the find String, including within compound words.

Responses
200

A response containing s result for FindAndReplace operation for each of the selected Content Fragment.

400

Bad Request. The Problem Details object will provide more information about the exact cause.

403

Forbidden

406

Unacceptable. indicates that the target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request.

415

Unsupported Media Type. When provided as a response to a PATCH request, the response will provide an Accept-Patch response header to notify the client what patch document media types are supported.

500

The server encountered an unexpected error. Retrying the request after a certain time could help.

post/cf/fragments/findAndReplace
Request samples
application/json
{
  • "paths": [
    ],
  • "find": "adventure",
  • "replace": "fun",
  • "dryRun": true,
  • "ignoreErrors": true
}
Response samples
application/json
{
  • "items": [
    ]
}

Change the model of a Content Fragment

This operation allows a caller to change the Content Fragment Model for a Content Fragment. As a result of this operation, the Content Fragment can become invalid if the new Model does not match the existing content. To edit the Content Fragment's fields after a Content Fragment Model change, use a partial or a full update operation on the Fragment.

SecuritybearerAuth
Request
path Parameters
fragmentId
required
string <uuid> (UUID)

Content Fragment unique identifier

Example: 49af775d-0e7a-46c3-913d-00f762528373
header Parameters
If-Match
required
string

The If-Match header field makes the request method conditional on the recipient origin server either having at least one current representation of the target resource, when the field value is "*", or having a current representation of the target resource that has an entity tag matching a member of the list of entity tags provided in the field value.

For more details, please head over to RFC9110.

Request Body schema: application/json
required
modelId
required
string (Base64URLId)

Defines a base64url with no padding encoded ID.

Responses
204

No Content

400

Bad Request. The Problem Details object will provide more information about the exact cause.

404

Not Found

406

Unacceptable. indicates that the target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request.

412

Precondition Failed

428

Precondition Required

500

The server encountered an unexpected error. Retrying the request after a certain time could help.

put/cf/fragments/{fragmentId}/model
Request samples
application/json
{
  • "modelId": "string"
}
Response samples
application/problem+json
{}