Optional calls
Get Transcript by Start and End Id
Use this API to fetch transcript textsegments between a start and an end id. The response includes speaker metadata and timestamps for each textsegment.
export const GET_TRANSCRIPT_BY_START_END_ID = `
fragment transcriptDetails on TranscriptSegment{
text
startTime
endTime
}
fragment apiSpeakerDetails on ApiSpeakerType{
slug
gender
givenName
familyName
preTitle
postTitle
posShort
posLong
systemId
}
query GetTranscriptByStartEndId($protocolSlug:String!, $startId:String!,$endId:String!){
getTranscriptByStartEndId(protocolSlug:$protocolSlug, startId:$startId, endId:$endId){
id
speakerObj{
...apiSpeakerDetails
}
textJson{
...transcriptDetails
}
pos
}
}
Usage notes:
protocolSlug(required): Identifier of the protocol. Get this from the core API calls.agendaItemId(required): ID of the agenda item where you want to see the connected textsegments.
JavaScript example
import axios from "axios";
async function getTranscriptByStartEndId(startId, endId = null) {
const dataObj = {
query: GET_TRANSCRIPT_BY_START_END_ID,
variables: { startId, endId },
};
try {
const response = await axios({
method: "post",
url: process.env.VUE_APP_GRAPHQL_API,
data: JSON.stringify(dataObj),
headers: {
"Content-Type": "application/json",
"x-api-key": process.env.VUE_APP_API_KEY,
},
});
return response.data.data.getTranscriptByStartEndId;
} catch (error) {
console.error(error);
throw error;
}
} Have questions?
Still have questions? Talk to support.