API process flow
Get Results
This API involves getting the result items created by AI
Get Results
This is the final call in the main API process flow.
- Retrieve all AI-generated items related to a specific protocol.
- This includes protocol metadata, agenda items, and task items.
- The
getResultsdocs can be found here.
Overview
- Use the
getResultsquery to fetch all AI-created results for a given protocol. - If
creationDoneisfalse, the creation process is still ongoing. - You can check the current creation progress in the
creatingStepfield ofApiProtocolType.
Example GraphQL Query
fragment protocolDetails on ApiProtocolType {
slug
name
date
language
empty
creatingStep
status
}
fragment agendaDetails on ApiAgendaItemType {
id
classType
title
depth
maxDepth
metaData
textList
resolutionList {
resolution
decision
}
createdAt
updatedAt
}
fragment taskDetails on ApiTaskType {
id
text
date
assignedTo
done
createdAt
updatedAt
}
query GetResults($protocolSlug: String!) {
getResults(protocolSlug: $protocolSlug) {
creationDone
protocol {
...protocolDetails
}
agendaItemList {
...agendaDetails
}
taskItemList {
...taskDetails
}
}
}
Example JavaScript Implementation
import axios from "axios";
export const GET_RESULTS = `...`; // GraphQL query from above
export async function getResults(protocolSlug) {
const queryData = {
query: GET_RESULTS,
variables: { protocolSlug },
};
try {
const response = await axios.post(
process.env.VUE_APP_GRAPHQL_API,
JSON.stringify(queryData),
{
headers: {
"Content-Type": "application/json",
"x-api-key": process.env.VUE_APP_API_KEY,
},
}
);
const result = response.data.data.getResults;
const { creationDone, protocol, agendaItemList, taskItemList } = result;
return { creationDone, protocol, agendaItemList, taskItemList };
} catch (error) {
console.error("Error fetching results:", error.response?.data || error.message);
throw error;
}
}
Notes
-
You can poll this query periodically until creationDone becomes true. Set the interval to around 3 minutes. Usually it takes 40% of the audio length to process the whole data.
-
The creatingStep field shows which phase the AI is currently processing.
-
AgendaItem.textList has different detail levels. For summary the correct textList looks the following: ”{“0”: […]}“. For politics the correct textList looks the following: ”{“0”: […], “1”: […], “2”: […]}“.
-
An agendaItem.textList value can also be empty - it then has the following content: ”{}“. This means that the AI was not able to map it to the given file content.
Next steps
The core API process flow is complete: you can go from an audio or video file to a fully generated protocol based on the AI-generated or your own agenda, including the content for each agenda item.
Optional API calls let you further modify the generated content, access the underlying data used to create the agenda items, or delete individual files or entire protocols.
Have questions?
Still have questions? Talk to support.