Skip to main content

contents

Creates, updates, deletes, gets or lists a contents resource.

Overview

Namecontents
TypeResource
Idaws.wisdom.contents

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
namestringThe name of the content. (pattern: <code>^[a-zA-Z0-9\s_.,-]+</code>)
content_arnstringThe Amazon Resource Name (ARN) of the content. (pattern: <code>^arn:[a-z-]?:wisdom:[a-z0-9-]?:[0-9]{12}:[a-z-]*?/[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}(?:/[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12})?$</code>)
content_idstringThe identifier of the content. (pattern: <code>^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$</code>)
content_typestringThe media type of the content. (pattern: <code>^(text/(plain|html|csv))|(application/(pdf|vnd.openxmlformats-officedocument.wordprocessingml.document))|(application/x.wisdom-json;source=(salesforce|servicenow|zendesk))$</code>)
knowledge_base_arnstringThe Amazon Resource Name (ARN) of the knowledge base. (pattern: <code>^arn:[a-z-]?:wisdom:[a-z0-9-]?:[0-9]{12}:[a-z-]*?/[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}(?:/[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12})?$</code>)
knowledge_base_idstringThe identifier of the knowledge base. This should not be a QUICK_RESPONSES type knowledge base if you're storing Wisdom Content resource to it. (pattern: <code>^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$</code>)
link_out_uristringThe URI of the content.
metadataobjectA key/value map to store attributes without affecting tagging or recommendations. For example, when synchronizing data between an external system and Wisdom, you can store an external version identifier as metadata to utilize for determining drift.
revision_idstringThe identifier of the content revision.
statusstringThe status of the content. (CREATE_IN_PROGRESS, CREATE_FAILED, ACTIVE, DELETE_IN_PROGRESS, DELETE_FAILED, DELETED, UPDATE_FAILED)
tagsobjectThe tags used to organize, track, or control access for this resource.
title_stringThe title of the content.
urlstringThe URL of the content.
url_expirystring (date-time)The expiration time of the URL as an epoch timestamp.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_contentselectcontent_id, knowledge_base_id, regionRetrieves content, including a pre-signed URL to download the content.
search_contentselectknowledge_base_id, regionmaxResults, nextTokenSearches for content in a specified knowledge base. Can be used to get a specific content resource by its name.
list_contentsselectknowledge_base_id, regionmaxResults, nextTokenLists the content.
create_contentinsertknowledge_base_id, region, name, uploadIdCreates Wisdom content. Before to calling this API, use StartContentUpload to upload an asset.
update_contentupdatecontent_id, knowledge_base_id, regionUpdates information about the content.
delete_contentdeletecontent_id, knowledge_base_id, regionDeletes the content.
start_content_uploadexecknowledge_base_id, region, contentTypeGet a URL to upload content to a knowledge base. To upload content, first make a PUT request to the returned URL with your file, making sure to include the required headers. Then use CreateContent to finalize the content creation process or UpdateContent to modify an existing resource. You can only upload content to a knowledge base of type CUSTOM.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
content_idstringThe identifier of the content. Can be either the ID or the ARN. URLs cannot contain the ARN.
knowledge_base_idstringThe identifier of the knowledge base. This should not be a QUICK_RESPONSES type knowledge base if you're storing Wisdom Content resource to it. Can be either the ID or the ARN. URLs cannot contain the ARN.
regionstringAWS region (default: us-east-1)
maxResultsintegerThe maximum number of results to return per page.
nextTokenstringThe token for the next set of results. Use the value returned in the previous response in the next request to retrieve the next set of results.

SELECT examples

Retrieves content, including a pre-signed URL to download the content.

SELECT
name,
content_arn,
content_id,
content_type,
knowledge_base_arn,
knowledge_base_id,
link_out_uri,
metadata,
revision_id,
status,
tags,
title_,
url,
url_expiry
FROM aws.wisdom.contents
WHERE content_id = '{{ content_id }}' -- required
AND knowledge_base_id = '{{ knowledge_base_id }}' -- required
AND region = '{{ region }}' -- required
;

INSERT examples

Creates Wisdom content. Before to calling this API, use StartContentUpload to upload an asset.

INSERT INTO aws.wisdom.contents (
clientToken,
metadata,
name,
overrideLinkOutUri,
tags,
title,
uploadId,
knowledge_base_id,
region
)
SELECT
'{{ clientToken }}',
'{{ metadata }}',
'{{ name }}' /* required */,
'{{ overrideLinkOutUri }}',
'{{ tags }}',
'{{ title }}',
'{{ uploadId }}' /* required */,
'{{ knowledge_base_id }}',
'{{ region }}'
RETURNING
content
;

UPDATE examples

Updates information about the content.

UPDATE aws.wisdom.contents
SET
metadata = '{{ metadata }}',
overrideLinkOutUri = '{{ overrideLinkOutUri }}',
removeOverrideLinkOutUri = {{ removeOverrideLinkOutUri }},
revisionId = '{{ revisionId }}',
title = '{{ title }}',
uploadId = '{{ uploadId }}'
WHERE
content_id = '{{ content_id }}' --required
AND knowledge_base_id = '{{ knowledge_base_id }}' --required
AND region = '{{ region }}' --required
RETURNING
content;

DELETE examples

Deletes the content.

DELETE FROM aws.wisdom.contents
WHERE content_id = '{{ content_id }}' --required
AND knowledge_base_id = '{{ knowledge_base_id }}' --required
AND region = '{{ region }}' --required
;

Lifecycle Methods

Get a URL to upload content to a knowledge base. To upload content, first make a PUT request to the returned URL with your file, making sure to include the required headers. Then use CreateContent to finalize the content creation process or UpdateContent to modify an existing resource. You can only upload content to a knowledge base of type CUSTOM.

EXEC aws.wisdom.contents.start_content_upload
@knowledge_base_id='{{ knowledge_base_id }}' --required,
@region='{{ region }}' --required
@@json=
'{
"contentType": "{{ contentType }}",
"presignedUrlTimeToLive": {{ presignedUrlTimeToLive }}
}'
;