(conversations)
- log - Log Conversation
- list - Get All Conversations
- get - Get Conversation
- delete - Delete Conversation
Logs a new conversation or updates an existing one with new messages. Always include all messages.
API Key Types: WEB
, API
import { InkeepAnalytics } from "@inkeep/inkeep-analytics";
const inkeepAnalytics = new InkeepAnalytics();
async function run() {
const result = await inkeepAnalytics.conversations.log({
webIntegrationKey: process.env["INKEEPANALYTICS_WEB_INTEGRATION_KEY"] ?? "",
}, {
type: "support_ticket",
messages: [
{
role: "<value>",
},
],
});
// Handle the result
console.log(result);
}
run();
The standalone function version of this method:
import { InkeepAnalyticsCore } from "@inkeep/inkeep-analytics/core.js";
import { conversationsLog } from "@inkeep/inkeep-analytics/funcs/conversationsLog.js";
// Use `InkeepAnalyticsCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const inkeepAnalytics = new InkeepAnalyticsCore();
async function run() {
const res = await conversationsLog(inkeepAnalytics, {
webIntegrationKey: process.env["INKEEPANALYTICS_WEB_INTEGRATION_KEY"] ?? "",
}, {
type: "support_ticket",
messages: [
{
role: "<value>",
},
],
});
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result);
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
request |
components.CreateConversation | ✔️ | The request object to use for the request. |
security |
operations.LogConversationSecurity | ✔️ | The security requirements to use for the request. |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body , are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<components.Conversation>
Error Type | Status Code | Content Type |
---|---|---|
errors.BadRequest | 400 | application/problem+json |
errors.Unauthorized | 401 | application/problem+json |
errors.Forbidden | 403 | application/problem+json |
errors.UnprocessableEntity | 422 | application/problem+json |
errors.InternalServerError | 500 | application/problem+json |
errors.APIError | 4XX, 5XX | */* |
Get All Conversations
import { InkeepAnalytics } from "@inkeep/inkeep-analytics";
const inkeepAnalytics = new InkeepAnalytics({
apiIntegrationKey: process.env["INKEEPANALYTICS_API_INTEGRATION_KEY"] ?? "",
});
async function run() {
const result = await inkeepAnalytics.conversations.list({});
// Handle the result
console.log(result);
}
run();
The standalone function version of this method:
import { InkeepAnalyticsCore } from "@inkeep/inkeep-analytics/core.js";
import { conversationsList } from "@inkeep/inkeep-analytics/funcs/conversationsList.js";
// Use `InkeepAnalyticsCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const inkeepAnalytics = new InkeepAnalyticsCore({
apiIntegrationKey: process.env["INKEEPANALYTICS_API_INTEGRATION_KEY"] ?? "",
});
async function run() {
const res = await conversationsList(inkeepAnalytics, {});
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result);
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
request |
operations.GetAllConversationRequest | ✔️ | The request object to use for the request. |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body , are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<operations.GetAllConversationResponseBody>
Error Type | Status Code | Content Type |
---|---|---|
errors.BadRequest | 400 | application/problem+json |
errors.Unauthorized | 401 | application/problem+json |
errors.Forbidden | 403 | application/problem+json |
errors.NotFound | 404 | application/problem+json |
errors.UnprocessableEntity | 422 | application/problem+json |
errors.InternalServerError | 500 | application/problem+json |
errors.APIError | 4XX, 5XX | */* |
Get Conversation
import { InkeepAnalytics } from "@inkeep/inkeep-analytics";
const inkeepAnalytics = new InkeepAnalytics();
async function run() {
const result = await inkeepAnalytics.conversations.get({
webIntegrationKey: process.env["INKEEPANALYTICS_WEB_INTEGRATION_KEY"] ?? "",
}, {
id: "<id>",
});
// Handle the result
console.log(result);
}
run();
The standalone function version of this method:
import { InkeepAnalyticsCore } from "@inkeep/inkeep-analytics/core.js";
import { conversationsGet } from "@inkeep/inkeep-analytics/funcs/conversationsGet.js";
// Use `InkeepAnalyticsCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const inkeepAnalytics = new InkeepAnalyticsCore();
async function run() {
const res = await conversationsGet(inkeepAnalytics, {
webIntegrationKey: process.env["INKEEPANALYTICS_WEB_INTEGRATION_KEY"] ?? "",
}, {
id: "<id>",
});
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result);
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
request |
operations.GetConversationRequest | ✔️ | The request object to use for the request. |
security |
operations.GetConversationSecurity | ✔️ | The security requirements to use for the request. |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body , are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<components.Conversation>
Error Type | Status Code | Content Type |
---|---|---|
errors.BadRequest | 400 | application/problem+json |
errors.Unauthorized | 401 | application/problem+json |
errors.Forbidden | 403 | application/problem+json |
errors.NotFound | 404 | application/problem+json |
errors.UnprocessableEntity | 422 | application/problem+json |
errors.InternalServerError | 500 | application/problem+json |
errors.APIError | 4XX, 5XX | */* |
Delete Conversation
import { InkeepAnalytics } from "@inkeep/inkeep-analytics";
const inkeepAnalytics = new InkeepAnalytics();
async function run() {
const result = await inkeepAnalytics.conversations.delete({
webIntegrationKey: process.env["INKEEPANALYTICS_WEB_INTEGRATION_KEY"] ?? "",
}, {
id: "<id>",
});
// Handle the result
console.log(result);
}
run();
The standalone function version of this method:
import { InkeepAnalyticsCore } from "@inkeep/inkeep-analytics/core.js";
import { conversationsDelete } from "@inkeep/inkeep-analytics/funcs/conversationsDelete.js";
// Use `InkeepAnalyticsCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const inkeepAnalytics = new InkeepAnalyticsCore();
async function run() {
const res = await conversationsDelete(inkeepAnalytics, {
webIntegrationKey: process.env["INKEEPANALYTICS_WEB_INTEGRATION_KEY"] ?? "",
}, {
id: "<id>",
});
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result);
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
request |
operations.DeleteConversationRequest | ✔️ | The request object to use for the request. |
security |
operations.DeleteConversationSecurity | ✔️ | The security requirements to use for the request. |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body , are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<operations.DeleteConversationResponseBody>
Error Type | Status Code | Content Type |
---|---|---|
errors.BadRequest | 400 | application/problem+json |
errors.Unauthorized | 401 | application/problem+json |
errors.Forbidden | 403 | application/problem+json |
errors.NotFound | 404 | application/problem+json |
errors.UnprocessableEntity | 422 | application/problem+json |
errors.InternalServerError | 500 | application/problem+json |
errors.APIError | 4XX, 5XX | */* |