Conversation Intelligence (classic) - Transcript Sentence Subresource
A Transcript Sentence subresource represents a transcribed sentence from a given Conversation Intelligence (classic) Transcript.
Offset from the beginning of the transcript when this sentence starts.
A 34 character string that uniquely identifies this Sentence.
^GX[0-9a-fA-F]{32}$Min length: 34Max length: 34Detailed information for each of the words of the given Sentence.
GET https://intelligence.twilio.com/v2/Transcripts/{TranscriptSid}/Sentences
The unique SID identifier of the Transcript.
^GT[0-9a-fA-F]{32}$Min length: 34Max length: 34Grant access to PII Redacted/Unredacted Sentences. If redaction is enabled, the default is true to access redacted sentences.
Returns word level timestamps information, if word_timestamps is enabled. The default is false.
How many resources to return in each list page. The default is 50, and the maximum is 5000.
1Maximum: 5000The page token. This is provided by the API.
The GET request shown below returns a list of Transcript Sentences for a given Transcript, with the WordTimestamps query parameter set to true.
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 at twilio.com/console5// Provision API Keys at twilio.com/console/runtime/api-keys6// and set the environment variables. See http://twil.io/secure7// For local testing, you can use your Account SID and Auth token8const accountSid = process.env.TWILIO_ACCOUNT_SID;9const apiKey = process.env.TWILIO_API_KEY;10const apiSecret = process.env.TWILIO_API_SECRET;11const client = twilio(apiKey, apiSecret, { accountSid: accountSid });1213async function listSentence() {14const sentences = await client.intelligence.v215.transcripts("GTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")16.sentences.list({ limit: 20 });1718sentences.forEach((s) => console.log(s.mediaChannel));19}2021listSentence();
Response
1{2"sentences": [3{4"media_channel": 1,5"sentence_index": 0,6"start_time": null,7"end_time": null,8"transcript": "test test",9"sid": "GXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",10"confidence": null,11"words": [12{13"word": "test",14"start_time": null,15"end_time": null16},17{18"word": "test",19"start_time": null,20"end_time": null21}22]23}24],25"meta": {26"key": "sentences",27"page": 0,28"page_size": 50,29"first_page_url": "https://intelligence.twilio.com/v2/Transcripts/GTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Sentences?PageSize=50&Page=0",30"url": "https://intelligence.twilio.com/v2/Transcripts/GTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Sentences?PageSize=50&Page=0",31"next_page_url": null,32"previous_page_url": null33}34}
If PII redaction was enabled at the time the associated Transcript was created, you can retrieve the redacted or unredacted Sentences.
If Redacted is true (the default value), the redacted Sentences are returned.
If Redacted is false , the original, unredacted Sentences are returned.
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 at twilio.com/console5// Provision API Keys at twilio.com/console/runtime/api-keys6// and set the environment variables. See http://twil.io/secure7// For local testing, you can use your Account SID and Auth token8const accountSid = process.env.TWILIO_ACCOUNT_SID;9const apiKey = process.env.TWILIO_API_KEY;10const apiSecret = process.env.TWILIO_API_SECRET;11const client = twilio(apiKey, apiSecret, { accountSid: accountSid });1213async function listSentence() {14const sentences = await client.intelligence.v215.transcripts("GTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")16.sentences.list({17redacted: false,18limit: 20,19});2021sentences.forEach((s) => console.log(s.mediaChannel));22}2324listSentence();
Response
1{2"sentences": [3{4"media_channel": 1,5"sentence_index": 0,6"start_time": null,7"end_time": null,8"transcript": "test test",9"sid": "GXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",10"confidence": null,11"words": [12{13"word": "test",14"start_time": null,15"end_time": null16},17{18"word": "test",19"start_time": null,20"end_time": null21}22]23}24],25"meta": {26"key": "sentences",27"page": 0,28"page_size": 50,29"first_page_url": "https://intelligence.twilio.com/v2/Transcripts/GTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Sentences?PageSize=50&Page=0",30"url": "https://intelligence.twilio.com/v2/Transcripts/GTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Sentences?PageSize=50&Page=0",31"next_page_url": null,32"previous_page_url": null33}34}
Get the encrypted data of the Transcript Sentences by fetching the /Encrypted subresource.
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 at twilio.com/console5// Provision API Keys at twilio.com/console/runtime/api-keys6// and set the environment variables. See http://twil.io/secure7// For local testing, you can use your Account SID and Auth token8const accountSid = process.env.TWILIO_ACCOUNT_SID;9const apiKey = process.env.TWILIO_API_KEY;10const apiSecret = process.env.TWILIO_API_SECRET;11const client = twilio(apiKey, apiSecret, { accountSid: accountSid });1213async function fetchEncryptedSentences() {14const encryptedSentence = await client.intelligence.v215.transcripts("GTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")16.encryptedSentences()17.fetch();1819console.log(encryptedSentence.location);20}2122fetchEncryptedSentences();
Response
1{2"location": "https://com.twilio.us1.sentences.s3.amazonaws.com/GTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",3"transcript_sid": "GTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",4"url": "https://intelligence.twilio.com/v2/Transcripts/GTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Sentences/Encrypted"5}