menu button

Chapter 3: Edit and Save Document

Protocol Retrieval (Legacy)


⚠️ DEPRECATED APPROACH: This documentation shows the legacy implementation using the deprecated speaker string 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 instead of simple strings, offering better speaker identification and data consistency.


After importing the Audio file to the server, next steps are given below

  • Fetch a protocol using getProtocolBySlug query
  • If the protocol is not found, an error message is returned.
  • If the protocol status is true, it is editable.

When editable, two key parameters are populated:

  • summaryPerSpeakerList
  • speakerList

Example getProtocolBySlug Query (Legacy)

⚠️ This is the deprecated approach - View current implementation

export const GET_PROTOCOL_BY_SLUG = `
  fragment protocolDetails on ApiProtocolType {
    slug
    name
    status
    editStage
    date
    bucketAws
  }

  query GetProtocolBySlug($protocolSlug: String!){
    getProtocolBySlug(protocolSlug:$protocolSlug){
      protocol{
        ...protocolDetails
      }

      speakerList 
      
      summaryPerSpeakerList {
        createdAt
        updatedAt
        speaker
        speakerSuggestion
        textList
      }
    }
  }
`;

JavaScript Implementation (Legacy)

⚠️ This is the deprecated approach - View current implementation

import axios from "axios";

async function getProtocolBySlug(protocolSlug) {
  const dataObj = {
    query: GET_PROTOCOL_BY_SLUG, // Legacy format
    variables: {
      protocolSlug: protocolSlug,
    },
  };

  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.getProtocolBySlug; 
      
      return responseData 
    })
    .catch((error) => {
      console.log(error);
    })
}

These parameters are crucial for identifying speakers for the initial renaming process — a key step to ensure the quality of the resulting document.

Why This Approach is Deprecated

The legacy format has several limitations:

  • Limited Information: speaker field contains only a simple string
  • No Structure: Cannot access individual name components or metadata
  • Poor Integration: Difficult to match with other API responses
  • Inconsistent Data: Speaker identification can be unreliable
  • 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, better speaker identification, and enhanced data consistency. Migration is strongly recommended.

Have questions?

Still have questions? Talk to support.