A TypeScript AWS Lambda function for retrieving canned responses from the Genesys Cloud Response Management API. Supports fetching responses by ID, library, or name, with optional attribute substitution and plain text conversion.
- Fetch Genesys canned responses by ID, library ID, or library name
- Optional attribute substitution using conversation participant attributes
- Option to return responses as plain text (HTML stripped)
- Type-safe request and response types
- Ready for AWS Lambda deployment
- Deno
- Genesys Cloud API credentials
This function requires Genesys Cloud API credentials to be configured in your Genesys Cloud function configuration. The credentials are passed to the function via AWS Lambda context headers.
Configure the following headers in your Genesys Cloud function configuration:
Header Name | Description | Example |
---|---|---|
X-Genesys-API-Host |
The base URL of your Genesys Cloud region | https://api.mypurecloud.com |
X-Genesys-API-Key |
OAuth 2.0 client ID for your Genesys Cloud application | your-client-id |
X-Genesys-API-Secret |
OAuth 2.0 client secret for your Genesys Cloud application | your-client-secret |
- Navigate to your Genesys Cloud organization
- Go to Admin > Integrations > Actions
- Find your deployed function and click Configure
- In the function configuration, add the required headers with your API credentials
- Save the configuration
Important: Keep your client secret secure and never expose it in client-side code or public repositories.
To obtain your Genesys Cloud API credentials:
- Log in to your Genesys Cloud organization
- Navigate to Admin > Integrations > OAuth
- Click Add Client to create a new OAuth client
- Configure the client with appropriate permissions for Response Management API
- Note down the Client ID and Client Secret for use in the headers above
Clone the repository and cache dependencies:
git clone https://github.com/DanzigerGeist/genesys-cloud-function-response-getter.git
cd genesys-cloud-function-response-getter
deno cache src/mod.ts
Deploy the function to Genesys. The handler expects a request matching the FunctionRequest
type.
{
"libraryName": "My Library",
"responseName": "Welcome Message",
"useSubstitutions": true,
"conversationId": "12345"
}
Bundle the function for deployment:
make package
genesys-cloud-function-scaffold/
├── build/
│ └── build.ts
├── dist/
│ └── (build output, e.g., index.js, docs, lambda.zip)
├── src/
│ ├── mod.ts
│ └── types/
│ ├── Credentials.ts
│ ├── FunctionHandler.ts
│ ├── FunctionRequest.ts
│ ├── FunctionResponse.ts
│ └── mod.ts
├── test/
│ └── (unit tests)
├── README.md
├── Makefile
└── deno.json
- Source code is in
src/
(main logic inmod.ts
, types intypes/
). - Build scripts are in
build/
. - Build artifacts and docs go to
dist/
. - Tests are in
test/
. - Project configuration:
Makefile
,deno.json
,README.md
.
For questions, issues, or feature requests, please open an issue in the GitHub repository.
For Genesys Cloud API documentation and support, visit the Genesys Cloud Developer Center.
Community support is also available via the Genesys Cloud Community Forum.