This API tracks Human Feedback that you gather on AI Assistant responses.
The SID of the Account that created the Feedback.
^AC[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
The SID of the User created the Feedback.
^US[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
The date and time in GMT when the Feedback was created specified in ISO 8601 format.
POST https://assistants.twilio.com/v1/Assistants/{id}/Feedbacks
The assistant ID.
application/json
The text to be given as feedback.
1// Download the helper library from https://www.twilio.com/docs/node/install2const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";34// Find your Account SID and Auth Token at twilio.com/console5// and set the environment variables. See http://twil.io/secure6const accountSid = process.env.TWILIO_ACCOUNT_SID;7const authToken = process.env.TWILIO_AUTH_TOKEN;8const client = twilio(accountSid, authToken);910async function createFeedback() {11const feedback = await client.assistants.v112.assistants("aia_asst_00000000-1111-2222-3333-444444444444")13.feedbacks.create({14session_id: "your-session-id",15score: 0.5,16});1718console.log(feedback.assistantId);19}2021createFeedback();
1{2"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",3"assistant_id": "assistant_id",4"date_created": "2009-07-06T20:30:00Z",5"date_updated": "2009-07-06T20:30:00Z",6"id": "aia_asst_00000000-1111-2222-3333-444444444444",7"message_id": "message_id",8"score": 0.042,9"session_id": "session_id",10"text": "text",11"user_sid": "USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"12}
1// Download the helper library from https://www.twilio.com/docs/node/install2const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";34// Find your Account SID and Auth Token at twilio.com/console5// and set the environment variables. See http://twil.io/secure6const accountSid = process.env.TWILIO_ACCOUNT_SID;7const authToken = process.env.TWILIO_AUTH_TOKEN;8const client = twilio(accountSid, authToken);910async function createFeedback() {11const feedback = await client.assistants.v112.assistants("aia_asst_00000000-1111-2222-3333-444444444444")13.feedbacks.create({14message_id: "aia_msg",15session_id: "your-session-id",16score: 0.5,17});1819console.log(feedback.assistantId);20}2122createFeedback();
1{2"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",3"assistant_id": "assistant_id",4"date_created": "2009-07-06T20:30:00Z",5"date_updated": "2009-07-06T20:30:00Z",6"id": "aia_asst_00000000-1111-2222-3333-444444444444",7"message_id": "message_id",8"score": 0.042,9"session_id": "session_id",10"text": "text",11"user_sid": "USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"12}
GET https://assistants.twilio.com/v1/Assistants/{id}/Feedbacks
The assistant ID.
How many resources to return in each list page. The default is 50, and the maximum is 1000.
1
Maximum: 1000
The page token. This is provided by the API.
1// Download the helper library from https://www.twilio.com/docs/node/install2const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";34// Find your Account SID and Auth Token at twilio.com/console5// and set the environment variables. See http://twil.io/secure6const accountSid = process.env.TWILIO_ACCOUNT_SID;7const authToken = process.env.TWILIO_AUTH_TOKEN;8const client = twilio(accountSid, authToken);910async function listFeedback() {11const feedbacks = await client.assistants.v112.assistants("id")13.feedbacks.list({ limit: 20 });1415feedbacks.forEach((f) => console.log(f.assistantId));16}1718listFeedback();
1{2"feedbacks": [3{4"assistant_id": "assistant_id",5"id": "aia_fdbk",6"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",7"user_sid": "USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",8"message_id": "message_id",9"score": 0.042,10"session_id": "session_id",11"text": "text",12"date_created": "2009-07-06T20:30:00Z",13"date_updated": "2009-07-06T20:30:00Z"14}15],16"meta": {17"first_page_url": "https://www.example.com",18"key": "key",19"next_page_url": "https://www.example.com",20"page": 42,21"page_size": 42,22"previous_page_url": "https://www.example.com",23"url": "https://www.example.com"24}25}