GET https://assistants.twilio.com/v1/Sessions/{id}
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 fetchSession() {11const session = await client.assistants.v112.sessions("your-session-id")13.fetch();1415console.log(session.id);16}1718fetchSession();
1{2"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",3"assistant_id": "aia_asst",4"date_created": "2009-07-06T20:30:00Z",5"date_updated": "2009-07-06T20:30:00Z",6"id": "your-session-id",7"identity": "identity",8"verified": false9}
GET https://assistants.twilio.com/v1/Sessions
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 listSessions() {11const sessions = await client.assistants.v1.sessions.list({ limit: 20 });1213sessions.forEach((s) => console.log(s.id));14}1516listSessions();
1{2"meta": {3"first_page_url": "https://www.example.com",4"key": "key",5"next_page_url": "https://www.example.com",6"page": 42,7"page_size": 42,8"previous_page_url": "https://www.example.com",9"url": "https://www.example.com"10},11"sessions": [12{13"id": "id",14"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",15"assistant_id": "aia_asst",16"verified": false,17"identity": "identity",18"date_created": "2009-07-06T20:30:00Z",19"date_updated": "2009-07-06T20:30:00Z"20}21]22}