Skip to content

Latest commit

 

History

History
172 lines (122 loc) · 12.6 KB

File metadata and controls

172 lines (122 loc) · 12.6 KB

Feedback

(feedback)

Overview

Use to provide positive or negative feedback along with details.

Available Operations

  • submit - Submit Feedback
  • list - Get All Feedback

submit

Submit Feedback

Example Usage

import { InkeepAnalytics } from "@inkeep/inkeep-analytics";

const inkeepAnalytics = new InkeepAnalytics({
  apiIntegrationKey: process.env["INKEEPANALYTICS_API_INTEGRATION_KEY"] ?? "",
});

async function run() {
  const result = await inkeepAnalytics.feedback.submit({
    type: "negative",
    messageId: "<id>",
  });

  // Handle the result
  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { InkeepAnalyticsCore } from "@inkeep/inkeep-analytics/core.js";
import { feedbackSubmit } from "@inkeep/inkeep-analytics/funcs/feedbackSubmit.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 feedbackSubmit(inkeepAnalytics, {
    type: "negative",
    messageId: "<id>",
  });

  if (!res.ok) {
    throw res.error;
  }

  const { value: result } = res;

  // Handle the result
  console.log(result);
}

run();

Parameters

Parameter Type Required Description
request operations.SubmitFeedbackRequestBody ✔️ 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.

Response

Promise<operations.SubmitFeedbackResponseBody>

Errors

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 */*

list

Get All Feedback

Example Usage

import { InkeepAnalytics } from "@inkeep/inkeep-analytics";

const inkeepAnalytics = new InkeepAnalytics();

async function run() {
  const result = await inkeepAnalytics.feedback.list({
    webIntegrationKey: process.env["INKEEPANALYTICS_WEB_INTEGRATION_KEY"] ?? "",
  });

  // Handle the result
  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { InkeepAnalyticsCore } from "@inkeep/inkeep-analytics/core.js";
import { feedbackList } from "@inkeep/inkeep-analytics/funcs/feedbackList.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 feedbackList(inkeepAnalytics, {
    webIntegrationKey: process.env["INKEEPANALYTICS_WEB_INTEGRATION_KEY"] ?? "",
  });

  if (!res.ok) {
    throw res.error;
  }

  const { value: result } = res;

  // Handle the result
  console.log(result);
}

run();

Parameters

Parameter Type Required Description
security operations.GetAllFeedbackSecurity ✔️ 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.

Response

Promise<components.GetAllFeedbackResponse>

Errors

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 */*