menu button

API process flow

Init Protocol Multi

  • Use initProtocolMulti when a single session consists of multiple audio files (e.g. a recording split into parts). All files are sent to the audio converter as a single session.

  • This mutation is identical to initProtocol, with two key differences:

    • It accepts uniqueObjNames: [String!]! (a list) instead of uniqueObjName: String!
    • The protocol slug is derived from uniqueObjNames[0]

Flow

  1. Call getUploadUrl once per file to obtain a pre-signed S3 URL.
  2. Upload each file to S3.
  3. Call initProtocolMulti with all uniqueObjNames in one request.

Input Parameters

  • uniqueObjNames ([String!]!) List of object names — one per uploaded file. The first entry is used to derive the protocol slug. Each name must be unique (30-character random ID recommended).

  • date (Date!) The date associated with the session.

  • name (String!) The name or title of the protocol.

  • language (String!) Language code of the audio content. Supported options:

    • 'de-DE' (German - Germany)
    • 'de-CH' (German - Switzerland)
    • 'de-AT' (German - Austria)
    • 'en-EN' (English)
  • projectSlug (String!) The slug of the target project.

  • typeOfDocument (String!)

    • summary
    • politics
  • addressConfig (AddressConfigInput) Controls which speaker name fields appear in the generated document output. All fields default to true if omitted.

    FieldMeaning
    genderHerr / Frau / Divers prefix
    givenNameFirst name
    familyNameLast name
    preTitlee.g. Dr., Prof.
    postTitlee.g. MBA
    partyParty / organisation
    posLongFunktionsbezeichnung lang
    posShortFunktionsbezeichnung kurz
  • speakerList ([PersonInputList]) — optional pre-defined speaker list.

  • agendaItemList ([AgendaItemListInput]) — optional agenda items.


Example GraphQL Mutation (initProtocolMulti):

fragment protocolDetails on ApiProtocolType {
  slug
  name
  status
  date
  language
  empty
  creatingStep
  renamedSpeakers
}

mutation InitProtocolMulti(
  $uniqueObjNames: [String!]!
  $projectSlug: String!
  $name: String!
  $date: Date!
  $language: String!
  $typeOfDocument: String!
  $addressConfig: AddressConfigInput
  $agendaItemList: [AgendaItemListInput]
  $speakerList: [PersonInputList]
) {
  initProtocolMulti(
    uniqueObjNames: $uniqueObjNames
    projectSlug: $projectSlug
    name: $name
    date: $date
    language: $language
    typeOfDocument: $typeOfDocument
    addressConfig: $addressConfig
    agendaItemList: $agendaItemList
    speakerList: $speakerList
  ) {
    success
    protocol {
      ...protocolDetails
    }
  }
}

Example Variables

{
  "uniqueObjNames": ["part1_abc123def456ghi789jkl012", "part2_mno345pqr678stu901vwx234"],
  "projectSlug": "my-project",
  "name": "Stadtratssitzung 2024-03-18",
  "date": "2024-03-18",
  "language": "de-DE",
  "typeOfDocument": "politics",
  "addressConfig": {
    "gender": true,
    "givenName": true,
    "familyName": true,
    "preTitle": true,
    "postTitle": false,
    "party": true,
    "posLong": true,
    "posShort": false
  },
  "agendaItemList": [
    { "title": "TOP 1", "systemId": "top-1", "startTime": "" },
    { "title": "TOP 2", "systemId": "top-2", "startTime": "" }
  ]
}

Example JS Code

import axios from "axios";

async function createMultiFileProtocol(session, uniqueObjNames) {
  const dataObj = {
    query: INIT_PROTOCOL_MULTI,
    variables: {
      uniqueObjNames,
      projectSlug: session.projectSlug,
      name: session.name,
      date: session.date,
      language: session.language,
      typeOfDocument: session.typeOfDocument,
      addressConfig: session.addressConfig,
      agendaItemList: session.agendaItemList,
      speakerList: session.speakerList,
    },
  };

  await axios({
    method: "post",
    url: "https://api-v2.speechmind.com/external/v2/graphql",
    data: JSON.stringify(dataObj),
    headers: {
      "Content-Type": "application/json",
      "x-api-key": process.env.SPEECHMIND_API_KEY,
    },
  })
    .then(() => {
      console.log("Multi-file protocol created successfully");
    })
    .catch((error) => {
      console.log(error);
    });
}

Each step builds upon the previous one:

  • Call getUploadUrl once per file and upload each to S3,
  • Then call initProtocolMulti with all names to start processing as a single session.

Have questions?

Still have questions? Talk to support.