API process flow
Init Protocol
-
After the upload, the mutation named
initProtocolimports audio into the system for further processing. -
With this mutation, the document element is created in the backend. The
uniqueObjNameparameter from thegetUploadUrlquery is crucial here. It’s required to save the results for the corresponding element.
Input Parameters
-
date(Date!)
The date associated with the audio file, typically representing when it was recorded. -
name(String!)
The name or title of the audio file. -
language(String!)
The language code of the audio content. Supported options include:'de-DE'(German - Germany)'de-CH'(German - Switzerland)'de-AT'(German - Austria)'en-EN'(English)
-
uniqueObjName(String!)
The object name used to locate the audio file, often corresponding to the S3 key or filename. this key needs to be unique, you can use our recommended random number generator to create this object, it should be 30 charactersfunction generateRandomId(length) { let id = ""; const charset = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"; const charsetLength = charset.length; for (let i = 0; i < length; i++) { const randomIndex = Math.floor(Math.random() * charsetLength); id += charset.charAt(randomIndex); } return id; } -
projectSlug(String!)The slug of the project, the projectSlug can be fetch using
getAllProjectsor you can create a new project usingcreateProjectmutation. -
typeOfDocument(String!)
The type of document to generate from the audio. Supported types include:summarypolitics
-
speakerList([PersonInputList])-
[{ "gender":"m", "givenName":"Thomas", "familyName":"Müller", "party":"", "preTitle":"", "postTitle":"", "systemId":"" }, ...]
-
-
agendaItemList([AgendaItemListInput])- The structure must conform to the
AgendaItemListTypedefinition. - The
systemIdfield within each object is used during the export process back to the parent system. - The
startTimeis an optional parameter. If this one is set the agenda item is set on the exact timestamp or just before the sentence if the time is within a sentence. - The
titleis the name of the agenda item. -
"agendaItemList": [ { "title":"TOP 1", "systemId":"1", "startTime":"" },{ "title":"Agenda Point 2", "systemId":"2", "startTime":"" } ]
- The structure must conform to the
Ensure all fields are correctly formatted and valid before calling the mutation.
Example GraphQL Mutation (initProtocol):
const INIT_PROTOCOL = `
fragment protocolDetails on ApiProtocolType {
slug
name
status
date
language
empty
creatingStep
status
renamedSpeakers
}
mutation InitProtocol(
$date: Date!
$name: String!
$agendaItemList: [AgendaItemListInput]
$speakerList: [PersonInputList]
$projectSlug: String!
$language: String!
$uniqueObjName: String!
$typeOfDocument: String!
){
initProtocol(
name: $name
date: $date,
language: $language,
typeOfDocument: $typeOfDocument
agendaItemList: $agendaItemList
speakerList: $speakerList
uniqueObjName: $uniqueObjName
projectSlug: $projectSlug
){
success
protocol{
...protocolDetails
}
}
}
`;
Example Data Object for INIT_PROTOCOL Mutation
{
query: INIT_PROTOCOL,
variables: {
"agendaItemList": [
{
"title":"TOP 1",
"systemId":"1",
"startTime":"",
"resolution":""
},{
"title":"Agenda Point 2",
"systemId":"2",
"startTime":"",
"resolution":""
}
],
"date":"2025-11-20",
"language":"de-DE",
"name":"Testprotokoll",
"projectSlug":"PROJECT_SLUG",
"speakerList":[{
"gender":"m",
"givenName":"Thomas",
"familyName":"Müller",
"party":"",
"preTitle":"",
"postTitle":"",
"systemId":""
},{
"gender":"w",
"givenName":"Maxi",
"familyName":"Musterfrau",
"party":"",
"preTitle":"",
"postTitle":"",
"systemId":""
}],
"typeOfDocument":"politics",
"uniqueObjName":"UNIQUE_OBJ_NAME"
},
};
Example JS code
import axios from "axios";
async function createAudioBackend(audioItem, uniqueObjName) {
let dataObj = {
query: INIT_PROTOCOL,
variables: {
date: audioItem.date,
name: audioItem.name, // max 200 chars
agendaItemList: audioItem.agendaItemList,
speakerList: audioItem.speakerList,
projectSlug: audioItem.projectSlug,
language: audioItem.language,
uniqueObjName: uniqueObjName,
typeOfDocument: audioItem.typeOfDocument // 'summary' or 'politics'
},
};
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(() => {
console.log("Audio created successfully");
})
.catch((error) => {
console.log(error);
})
.finally(() => {
console.log("Upload completed");
});
}
Each step builds upon the previous one:
- The URL from
getUploadUrlis utilized for uploading the file to S3, - And the result is then passed to the
initProtocolmutation to complete the process.
Have questions?
Still have questions? Talk to support.