attachments
create-property
Create content property for attachment
Creates a new content property for an attachment.
Permissions required: Permission to update the attachment.
POST /attachments/{attachment-id}/properties
| Flag | Type | Required | Description |
|---|---|---|---|
--attachment-id | string | Yes | The ID of the attachment to create a property for. |
--body | string | No | request body (JSON string, @file, or - for stdin) |
Example:
cf attachments create-property --attachment-id <attachment-id>delete
Delete attachment
Delete an attachment by id.
Deleting an attachment moves the attachment to the trash, where it can be restored later. To permanently delete an attachment (or "purge" it), the endpoint must be called on a trashed attachment with the following param purge=true.
Permissions required: Permission to view the container of the attachment. Permission to delete attachments in the space. Permission to administer the space (if attempting to purge).
DELETE /attachments/{id}
| Flag | Type | Required | Description |
|---|---|---|---|
--id | string | Yes | The ID of the attachment to be deleted. |
--purge | string | No | If attempting to purge the attachment. |
Example:
cf attachments delete --id <id>delete-property-by-id
Delete content property for attachment by id
Deletes a content property for an attachment by its id.
Permissions required: Permission to attachment the page.
DELETE /attachments/{attachment-id}/properties/{property-id}
| Flag | Type | Required | Description |
|---|---|---|---|
--attachment-id | string | Yes | The ID of the attachment the property belongs to. |
--property-id | string | Yes | The ID of the property to be deleted. |
Example:
cf attachments delete-property-by-id --attachment-id <attachment-id> --property-id <property-id>get
Get attachments
Returns all attachments. The number of results is limited by the limit parameter and additional results (if available) will be available through the next URL present in the Link response header.
Permissions required: Permission to view the container of the attachment.
GET /attachments
| Flag | Type | Required | Description |
|---|---|---|---|
--cursor | string | No | Used for pagination, this opaque cursor will be returned in the next URL in the Link response header. Use the relative URL in the Link header to retrieve the next set of results. |
--filename | string | No | Filters on the file-name of attachments. Only one may be specified. |
--limit | string | No | Maximum number of attachments per result to return. If more results exist, use the Link header to retrieve a relative URL that will return the next set of results. |
--mediaType | string | No | Filters on the mediaType of attachments. Only one may be specified. |
--sort | string | No | Used to sort the result by a particular field. |
--status | string | No | Filter the results to attachments based on their status. By default, current and archived are used. |
Example:
cf attachments getget-by-id
Get attachment by id
Returns a specific attachment.
Permissions required: Permission to view the attachment's container.
GET /attachments/{id}
| Flag | Type | Required | Description |
|---|---|---|---|
--id | string | Yes | The ID of the attachment to be returned. If you don't know the attachment's ID, use Get attachments for page/blogpost/custom content. |
--include-collaborators | string | No | Includes collaborators on the attachment. |
--include-labels | string | No | Includes labels associated with this attachment in the response. |
| The number of results will be limited to 50 and sorted in the default sort order. | |||
A meta and _links property will be present to indicate if more results are available and a link to retrieve the rest of the results. | |||
--include-operations | string | No | Includes operations associated with this attachment in the response, as defined in the Operation object. |
| The number of results will be limited to 50 and sorted in the default sort order. | |||
A meta and _links property will be present to indicate if more results are available and a link to retrieve the rest of the results. | |||
--include-properties | string | No | Includes content properties associated with this attachment in the response. |
| The number of results will be limited to 50 and sorted in the default sort order. | |||
A meta and _links property will be present to indicate if more results are available and a link to retrieve the rest of the results. | |||
--include-version | string | No | Includes the current version associated with this attachment in the response. |
By default this is included and can be omitted by setting the value to false. | |||
--include-versions | string | No | Includes versions associated with this attachment in the response. |
| The number of results will be limited to 50 and sorted in the default sort order. | |||
A meta and _links property will be present to indicate if more results are available and a link to retrieve the rest of the results. | |||
--version | string | No | Allows you to retrieve a previously published version. Specify the previous version's number to retrieve its details. |
Example:
cf attachments get-by-id --id <id>get-comments
Get attachment comments
Returns the comments of the specific attachment. The number of results is limited by the limit parameter and additional results (if available) will be available through the next URL present in the Link response header.
Permissions required: Permission to view the attachment and its corresponding containers.
GET /attachments/{id}/footer-comments
| Flag | Type | Required | Description |
|---|---|---|---|
--body-format | string | No | The content format type to be returned in the body field of the response. If available, the representation will be available under a response field of the same name under the body field. |
--cursor | string | No | Used for pagination, this opaque cursor will be returned in the next URL in the Link response header. Use the relative URL in the Link header to retrieve the next set of results. |
--id | string | Yes | The ID of the attachment for which comments should be returned. |
--limit | string | No | Maximum number of comments per result to return. If more results exist, use the Link header to retrieve a relative URL that will return the next set of results. |
--sort | string | No | Used to sort the result by a particular field. |
--version | string | No | Version number of the attachment to retrieve comments for. If no version provided, retrieves comments for the latest version. |
Example:
cf attachments get-comments --id <id>get-content-properties
Get content properties for attachment
Retrieves all Content Properties tied to a specified attachment.
Permissions required: Permission to view the attachment.
GET /attachments/{attachment-id}/properties
| Flag | Type | Required | Description |
|---|---|---|---|
--attachment-id | string | Yes | The ID of the attachment for which content properties should be returned. |
--cursor | string | No | Used for pagination, this opaque cursor will be returned in the next URL in the Link response header. Use the relative URL in the Link header to retrieve the next set of results. |
--key | string | No | Filters the response to return a specific content property with matching key (case sensitive). |
--limit | string | No | Maximum number of attachments per result to return. If more results exist, use the Link header to retrieve a relative URL that will return the next set of results. |
--sort | string | No | Used to sort the result by a particular field. |
Example:
cf attachments get-content-properties --attachment-id <attachment-id>get-content-properties-by-id
Get content property for attachment by id
Retrieves a specific Content Property by ID that is attached to a specified attachment.
Permissions required: Permission to view the attachment.
GET /attachments/{attachment-id}/properties/{property-id}
| Flag | Type | Required | Description |
|---|---|---|---|
--attachment-id | string | Yes | The ID of the attachment for which content properties should be returned. |
--property-id | string | Yes | The ID of the content property to be returned |
Example:
cf attachments get-content-properties-by-id --attachment-id <attachment-id> --property-id <property-id>get-labels
Get labels for attachment
Returns the labels of specific attachment. The number of results is limited by the limit parameter and additional results (if available) will be available through the next URL present in the Link response header.
Permissions required: Permission to view the parent content of the attachment and its corresponding space. Only labels that the user has permission to view will be returned.
GET /attachments/{id}/labels
| Flag | Type | Required | Description |
|---|---|---|---|
--cursor | string | No | Used for pagination, this opaque cursor will be returned in the next URL in the Link response header. Use the relative URL in the Link header to retrieve the next set of results. |
--id | string | Yes | The ID of the attachment for which labels should be returned. |
--limit | string | No | Maximum number of labels per result to return. If more results exist, use the Link header to retrieve a relative URL that will return the next set of results. |
--prefix | string | No | Filter the results to labels based on their prefix. |
--sort | string | No | Used to sort the result by a particular field. |
Example:
cf attachments get-labels --id <id>get-operations
Get permitted operations for attachment
Returns the permitted operations on specific attachment.
Permissions required: Permission to view the parent content of the attachment and its corresponding space.
GET /attachments/{id}/operations
| Flag | Type | Required | Description |
|---|---|---|---|
--id | string | Yes | The ID of the attachment for which operations should be returned. |
Example:
cf attachments get-operations --id <id>get-version-details
Get version details for attachment version
Retrieves version details for the specified attachment and version number.
Permissions required: Permission to view the attachment.
GET /attachments/{attachment-id}/versions/{version-number}
| Flag | Type | Required | Description |
|---|---|---|---|
--attachment-id | string | Yes | The ID of the attachment for which version details should be returned. |
--version-number | string | Yes | The version number of the attachment to be returned. |
Example:
cf attachments get-version-details --attachment-id <attachment-id> --version-number <version-number>get-versions
Get attachment versions
Returns the versions of specific attachment.
Permissions required: Permission to view the attachment and its corresponding space.
GET /attachments/{id}/versions
| Flag | Type | Required | Description |
|---|---|---|---|
--cursor | string | No | Used for pagination, this opaque cursor will be returned in the next URL in the Link response header. Use the relative URL in the Link header to retrieve the next set of results. |
--id | string | Yes | The ID of the attachment to be queried for its versions. If you don't know the attachment ID, use Get attachments and filter the results. |
--limit | string | No | Maximum number of versions per result to return. If more results exist, use the Link header to retrieve a relative URL that will return the next set of results. |
--sort | string | No | Used to sort the result by a particular field. |
Example:
cf attachments get-versions --id <id>list
List attachments on a page
| Flag | Type | Required | Description |
|---|---|---|---|
--page-id | string | No | Page ID to list attachments for (required) |
Example:
cf attachments listupdate-property-by-id
Update content property for attachment by id
Update a content property for attachment by its id.
Permissions required: Permission to edit the attachment.
PUT /attachments/{attachment-id}/properties/{property-id}
| Flag | Type | Required | Description |
|---|---|---|---|
--attachment-id | string | Yes | The ID of the attachment the property belongs to. |
--body | string | No | request body (JSON string, @file, or - for stdin) |
--property-id | string | Yes | The ID of the property to be updated. |
Example:
cf attachments update-property-by-id --attachment-id <attachment-id> --property-id <property-id>upload
Upload an attachment to a page (v1 API)
| Flag | Type | Required | Description |
|---|---|---|---|
--file | string | No | Path to file to upload (required) |
--page-id | string | No | Page ID to upload attachment to (required) |
Example:
cf attachments upload