curl -i -X GET 'https://console.nurrel.io/v1/pulso/calls/550e8400-e29b-41d4-a716-446655440000/recording' \ -H 'X-Api-Key: YOUR_CUSTOMER_KEY'# Read Location from the 302 response, then request it without X-Api-Key.curl 'SIGNED_URL_FROM_LOCATION' --output recording.wav
const response = await fetch('https://console.nurrel.io/v1/pulso/calls/550e8400-e29b-41d4-a716-446655440000/recording', { method: 'GET', headers: { 'X-Api-Key': process.env.NURREL_API_KEY }, redirect: 'manual',});const recordingUrl = response.headers.get('Location');if (response.status !== 302 || !recordingUrl) throw new Error('Recording unavailable');const recording = await fetch(recordingUrl); // No X-Api-Key on this request.
import os, requestsresponse = requests.request('GET', 'https://console.nurrel.io/v1/pulso/calls/550e8400-e29b-41d4-a716-446655440000/recording', headers={ 'X-Api-Key': os.environ['NURREL_API_KEY'] }, allow_redirects=False)recording_url = response.headers.get('Location')if response.status_code != 302 or not recording_url: raise RuntimeError('Recording unavailable')recording_response = requests.get(recording_url) # No X-Api-Key on this request.
HTTP/1.1 302Location: SIGNED_URL
API PULSO: звонки
Получить ссылку на запись
GET /v1/pulso/calls/{callId}/recording
curl -i -X GET 'https://console.nurrel.io/v1/pulso/calls/550e8400-e29b-41d4-a716-446655440000/recording' \ -H 'X-Api-Key: YOUR_CUSTOMER_KEY'# Read Location from the 302 response, then request it without X-Api-Key.curl 'SIGNED_URL_FROM_LOCATION' --output recording.wav
const response = await fetch('https://console.nurrel.io/v1/pulso/calls/550e8400-e29b-41d4-a716-446655440000/recording', { method: 'GET', headers: { 'X-Api-Key': process.env.NURREL_API_KEY }, redirect: 'manual',});const recordingUrl = response.headers.get('Location');if (response.status !== 302 || !recordingUrl) throw new Error('Recording unavailable');const recording = await fetch(recordingUrl); // No X-Api-Key on this request.
import os, requestsresponse = requests.request('GET', 'https://console.nurrel.io/v1/pulso/calls/550e8400-e29b-41d4-a716-446655440000/recording', headers={ 'X-Api-Key': os.environ['NURREL_API_KEY'] }, allow_redirects=False)recording_url = response.headers.get('Location')if response.status_code != 302 or not recording_url: raise RuntimeError('Recording unavailable')recording_response = requests.get(recording_url) # No X-Api-Key on this request.
Заголовок Location ответа 302 содержит временный адрес записи, когда она доступна. Отключите автоматический переход и загрузите запись по этому адресу без X-Api-Key. Во время загрузки запись может быть недоступна.
Ошибки
HTTP
Значение
code
404
Запись недоступна либо звонок не найден.
NOT_FOUND
curl -i -X GET 'https://console.nurrel.io/v1/pulso/calls/550e8400-e29b-41d4-a716-446655440000/recording' \ -H 'X-Api-Key: YOUR_CUSTOMER_KEY'# Read Location from the 302 response, then request it without X-Api-Key.curl 'SIGNED_URL_FROM_LOCATION' --output recording.wav
const response = await fetch('https://console.nurrel.io/v1/pulso/calls/550e8400-e29b-41d4-a716-446655440000/recording', { method: 'GET', headers: { 'X-Api-Key': process.env.NURREL_API_KEY }, redirect: 'manual',});const recordingUrl = response.headers.get('Location');if (response.status !== 302 || !recordingUrl) throw new Error('Recording unavailable');const recording = await fetch(recordingUrl); // No X-Api-Key on this request.
import os, requestsresponse = requests.request('GET', 'https://console.nurrel.io/v1/pulso/calls/550e8400-e29b-41d4-a716-446655440000/recording', headers={ 'X-Api-Key': os.environ['NURREL_API_KEY'] }, allow_redirects=False)recording_url = response.headers.get('Location')if response.status_code != 302 or not recording_url: raise RuntimeError('Recording unavailable')recording_response = requests.get(recording_url) # No X-Api-Key on this request.