Chapter 3: Edit and Save Document
Edit Speakers and Create Document (Legacy)
This API involves editing a speaker using the deprecated approach.
⚠️ DEPRECATED APPROACH: This documentation shows the legacy implementation using the deprecated simple speaker renaming format. This approach will be removed in a future version.
Please use the current implementation → The new implementation provides structured speaker objects with detailed information including titles, positions, and metadata, offering much better speaker management capabilities.
Once the protocol data is retrieved, the speakerList field (a JSON-stringified object) contains detailed timing and text segments for each speaker.
Example structure:
{
"speaker": "Lisa",
"duration": 70.67,
"textsegment": [
{
"id": "1",
"time": {"start_time": 1, "end_time": 3},
"text": "Hello world.",
"textsegment_duration": 2
},
// ...
]
}
textJson Explaination:
The textJson field is a JSON-stringified array of objects, each representing a sentence spoken by the speaker. It contains:
text: The sentence spoken.start_time: When the sentence begins (in seconds).end_time: When the sentence ends (in seconds).
Legacy Speaker Editing Process:
⚠️ This is the deprecated approach - View current implementation
- Run the
renameSpeakerInTextsegmentmutation.
Mutation Structure (Legacy) (Deprecated)
export const RENAME_SPEAKER_IN_TEXTSEGMENT = `
fragment textsegmentDetails on ApiTextsegmentType {
id
speaker
textJson {
text
startTime
endTime
}
}
mutation RenameSpeakerInTextsegment($protocolSlug:String!, $speakerJson:[SpeakerInput!]!){
renameSpeakerInTextsegment(protocolSlug:$protocolSlug, speakerJson:$speakerJson){
success
textsegmentsForRename{
...textsegmentDetails
}
}
}
`
Parameters for renameSpeakerInTextsegment Mutation (Legacy)
⚠️ This is the deprecated approach - View current implementation
1. protocolSlug
- A unique identifier (slug) for the protocol (meeting or document) where you want to rename the speakers.
- Example: protocolSlug: “team-meeting-april-2025”
2. speakerJSON
To rename speakers, provide a JSON with a speakerList array where each item has old (current name) and new (replacement name) fields.
-
The JSON structure must follow this exact format:
"speakerJson": [ { "old": "Sprecher 1", "new": "Lisa" }, { "old": "Sprecher 2", "new": "Max" } ]
JavaScript Implementation (Legacy)
⚠️ This is the deprecated approach - View current implementation
import axios from "axios";
async function renameSpeakerInTextsegment(protocolSlug, speakerJson) {
const dataObj = {
query: RENAME_SPEAKER_IN_TEXTSEGMENT,
variables: {
protocolSlug: protocolSlug,
speakerJson: JSON.stringify(speakerJson), // Legacy: requires stringification
},
};
return 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,
},
})
.then((response) => {
const responseData = response.data.data.renameSpeakerInTextsegment.textsegmentsForRename
// Legacy approach: Limited speaker information available
return responseData
})
.catch((error) => {
console.log(error);
})
}
- This legacy approach updates only speaker names across all relevant
textsegmententries. - It also creates the first level of document depth, allowing for initial processing or export. In the first step, the document is created with only one depth level. However, multiple depth levels are possible. To add more depths, you can use the
updateAgendaItemByIdmutation to edit the depth at index 0. After that, follow the instructions in the next section of the documentation to continue adding further depth levels to the document.
Why This Approach is Deprecated
The legacy format has several limitations:
- Limited Information: Can only update speaker names, not detailed metadata
- No Structure: Cannot set titles, positions, gender, or party information
- Simple Mapping: Uses basic old/new name mapping instead of structured speaker objects
- Poor Integration: Difficult to maintain consistency across complex speaker data
- No Future Support: This format will be removed in upcoming versions
🚀 Ready to Upgrade?
Switch to the Current Implementation →
The new approach provides structured speaker objects with detailed information including titles, positions, gender, and party affiliation for comprehensive speaker management. Migration is strongly recommended.
Have questions?
Still have questions? Talk to support.