GetLibraryItemCommand

Retrieves details about a library item for an Amazon Q App, including its metadata, categories, ratings, and usage statistics.

Example Syntax

Use a bare-bones client and the command you need to make an API call.

import { QAppsClient, GetLibraryItemCommand } from "@aws-sdk/client-qapps"; // ES Modules import
// const { QAppsClient, GetLibraryItemCommand } = require("@aws-sdk/client-qapps"); // CommonJS import
const client = new QAppsClient(config);
const input = { // GetLibraryItemInput
  instanceId: "STRING_VALUE", // required
  libraryItemId: "STRING_VALUE", // required
  appId: "STRING_VALUE",
};
const command = new GetLibraryItemCommand(input);
const response = await client.send(command);
// { // GetLibraryItemOutput
//   libraryItemId: "STRING_VALUE", // required
//   appId: "STRING_VALUE", // required
//   appVersion: Number("int"), // required
//   categories: [ // CategoryList // required
//     { // Category
//       id: "STRING_VALUE", // required
//       title: "STRING_VALUE", // required
//       color: "STRING_VALUE",
//       appCount: Number("int"),
//     },
//   ],
//   status: "STRING_VALUE", // required
//   createdAt: new Date("TIMESTAMP"), // required
//   createdBy: "STRING_VALUE", // required
//   updatedAt: new Date("TIMESTAMP"),
//   updatedBy: "STRING_VALUE",
//   ratingCount: Number("int"), // required
//   isRatedByUser: true || false,
//   userCount: Number("int"),
//   isVerified: true || false,
// };

Example Usage

//
const input = {
"instanceId": "0b95c9c4-89cc-4aa8-9aae-aa91cbec699f",
"libraryItemId": "18cbebaa-196a-4aa5-a840-88d548e07f8f"
};
const command = new GetLibraryItemCommand(input);
const response = await client.send(command);
/* response ==
{
"appId": "0b95c9c4-89cc-4aa8-9aae-aa91cbec699f",
"appVersion": 1,
"categories": [
{
"id": "9c871ed4-1c41-4065-aefe-321cd4b61cf8",
"title": "HR"
},
{
"id": "fdc4b483-c4e2-44c9-b4b2-6c850bbdb579",
"title": "General"
},
{
"id": "c1c4e374-118c-446f-81fb-cba6225d88da",
"title": "IT"
}
],
"createdAt": "2024-05-08T16:09:56.080Z",
"createdBy": "a841e300-40c1-7062-fa34-5b46dadbbaac",
"isRatedByUser": false,
"isVerified": false,
"libraryItemId": "18cbebaa-196a-4aa5-a840-88d548e07f8f",
"ratingCount": 0,
"status": "PUBLISHED",
"updatedAt": "2024-05-08T16:09:56.080Z",
"updatedBy": "a841e300-40c1-7062-fa34-5b46dadbbaac",
"userCount": 1
}
*\/
// example id: example-1
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
JavaScriptLn 1, Col 1
Errors: 0 Warnings: 0

GetLibraryItemCommand Input

See GetLibraryItemCommandInput for more details

Parameter
Type
Description
instanceId
Required
string | undefined

The unique identifier of the Amazon Q Business application environment instance.

libraryItemId
Required
string | undefined

The unique identifier of the library item to retrieve.

appId
string | undefined

The unique identifier of the Amazon Q App associated with the library item.

GetLibraryItemCommand Output

Parameter
Type
Description
$metadata
Required
ResponseMetadata
Metadata pertaining to this request.
appId
Required
string | undefined

The unique identifier of the Q App associated with the library item.

appVersion
Required
number | undefined

The version of the Q App associated with the library item.

categories
Required
Category[] | undefined

The categories associated with the library item for discovery.

createdAt
Required
Date | undefined

The date and time the library item was created.

createdBy
Required
string | undefined

The user who created the library item.

libraryItemId
Required
string | undefined

The unique identifier of the library item.

ratingCount
Required
number | undefined

The number of ratings the library item has received from users.

status
Required
string | undefined

The status of the library item, such as "Published".

isRatedByUser
boolean | undefined

Whether the current user has rated the library item.

isVerified
boolean | undefined

Indicates whether the library item has been verified.

updatedAt
Date | undefined

The date and time the library item was last updated.

updatedBy
string | undefined

The user who last updated the library item.

userCount
number | undefined

The number of users who have associated the Q App with their account.

Throws

Name
Fault
Details
AccessDeniedException
client

The client is not authorized to perform the requested operation.

InternalServerException
server

An internal service error occurred while processing the request.

ResourceNotFoundException
client

The requested resource could not be found.

ThrottlingException
client

The requested operation could not be completed because too many requests were sent at once. Wait a bit and try again later.

UnauthorizedException
client

The client is not authenticated or authorized to perform the requested operation.

ValidationException
client

The input failed to satisfy the constraints specified by the service.

QAppsServiceException
Base exception class for all service exceptions from QApps service.