api call
# support
h
Can i make an api call and get the Transcript of the call??
s
k
Hey HCI, checking if this is resolved for you?
h
Hi I need soemthing in which i can make an api call get all the converstaion of the user and vpai and the recording ??
@Shubham Bajaj ??
s
@HCl There are two main ways to get this information. 1. Using the GET /call/:id endpoint which returns: - Full transcript of the conversation - Recording URLs - Complete message history curl -X GET 'https://api.vapi.ai/call/{callId}' \ -H 'Authorization: Bearer YOUR_API_KEY' This returns the complete call data including:
Copy code
json
{
  "artifact": {
    "transcript": "Full conversation transcript",
    "recordingUrl": "https://storage.url/recording.wav",
    "stereoRecordingUrl": "https://storage.url/stereo-recording.wav",
    "messages": [
      // Array of conversation messages
    ]
  }
}
2. Using server messages during the call: You can receive real-time transcripts and call artifacts by configuring
serverMessages
to include: - "transcript" - For real-time transcriptions - "end-of-call-report" - For final transcript and recordings Configure your assistant's
serverMessages
to include:
Copy code
json
{
  "serverMessages": [
    "transcript",
    "end-of-call-report"
  ]
}
Your server will receive real-time transcripts and recordings via webhooks:
Copy code
json
{
  "message": {
    "type": "transcript",
    "transcript": "User's speech text",
    "role": "user",
    "transcriptType": "final"
  }
}
And at the end of call:
Copy code
json
{
  "message": {
    "type": "end-of-call-report",
    "artifact": {
      "transcript": "Complete conversation",
      "recordingUrl": "https://storage.url/recording.wav",
      "stereoRecordingUrl": "https://storage.url/stereo-recording.wav"
    }
  }
}