ดึงไฟล์เสียงของ Call
GET
https://api.voice-agent.gowajee.ai/api/call/:callId/record-urlดึงลิงก์ใหม่ 2 ลิงก์สำหรับไฟล์เสียงของ call ลิงก์แรกใช้เปิดฟังในเบราว์เซอร์ อีกลิงก์ใช้ดาวน์โหลดเป็นไฟล์
Path parameters
หัวข้อที่มีชื่อว่า “Path parameters”| ชื่อ | คำอธิบาย |
|---|---|
callId |
ID ของ call |
Request
หัวข้อที่มีชื่อว่า “Request”curl "https://api.voice-agent.gowajee.ai/api/call/fc1c320d-d133-4d48-8118-5932d93149fd/record-url" \ -H "X-API-Key: $GOWAJEE_API_KEY"
# Download the filecurl -L -o recording.wav "<downloadUrl from the response>"const res = await fetch(`https://api.voice-agent.gowajee.ai/api/call/${callId}/record-url`, { headers: { 'X-API-Key': process.env.GOWAJEE_API_KEY },});const body = await res.json();if (res.ok) { const audio = await fetch(body.downloadUrl).then((r) => r.arrayBuffer());} else if (body.code === 'RECORDING_DELETED') { console.log('Recording deleted at', body.expiredAt);}res = requests.get( f"https://api.voice-agent.gowajee.ai/api/call/{call_id}/record-url", headers={"X-API-Key": os.environ["GOWAJEE_API_KEY"]}, timeout=30,)info = res.json()if res.ok: with open("recording.wav", "wb") as f: f.write(requests.get(info["downloadUrl"], timeout=120).content)elif info["code"] == "RECORDING_DELETED": print("Recording deleted at", info["expiredAt"])Response
หัวข้อที่มีชื่อว่า “Response”endpoint นี้ส่ง field มาที่ชั้นบนสุด ไม่มี data ครอบ
{ "success": true, "recordUrl": "https://storage.example.com/recordings/fc1c320d.wav?X-Amz-Expires=3600&X-Amz-Signature=...", "downloadUrl": "https://storage.example.com/recordings/fc1c320d.wav?response-content-disposition=attachment...&X-Amz-Signature=..."}{ "success": false, "statusCode": 410, "code": "RECORDING_DELETED", "message": "Recording deleted by data retention policy", "errors": ["Recording deleted by data retention policy"], "expiredAt": "2026-12-30T02:13:58.592Z"}{ "success": false, "statusCode": 404, "code": "RECORDING_NOT_FOUND", "message": "No recording available for this call", "errors": ["No recording available for this call"]}| Field | Type | คำอธิบาย |
|---|---|---|
success |
boolean | เป็น true เมื่อได้ 200 |
recordUrl |
string | ลิงก์สำหรับเปิดฟัง (เปิดในเบราว์เซอร์) |
downloadUrl |
string หรือ null |
ลิงก์ดาวน์โหลด จะได้ไฟล์ชื่อ recording-<callId>.<ext> |
body ใช้รูปแบบ error ปกติ
| Status | code |
message |
สาเหตุ |
|---|---|---|---|
400 |
INVALID_ID |
callId must be a valid UUID |
ID ใน path ไม่ใช่ UUID |
404 |
CALL_NOT_FOUND |
Call not found |
callId ผิด หรือ call นี้เป็นขององค์กรอื่น |
404 |
RECORDING_NOT_FOUND |
No recording available for this call |
call นี้ไม่มีไฟล์เสียง เช่น NO_ANSWER, BUSY หรือ call ที่ยังคุยไม่จบ |
410 |
RECORDING_DELETED |
Recording deleted by data retention policy |
ระบบลบไฟล์เสียงไปแล้วตาม data retention policy ขององค์กร หรือเพราะลบ campaign ของ call นี้ไปแล้ว expiredAt บอกเวลาที่ลบ (UTC) ถ้าไม่ทราบเวลาจะเป็น null ไฟล์ที่ลบแล้วกู้คืนไม่ได้ |