Stream the spoken audio for an answer
curl --request GET \
--url https://app.demand-iq.com/api/qa/audioimport requests
url = "https://app.demand-iq.com/api/qa/audio"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://app.demand-iq.com/api/qa/audio', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.demand-iq.com/api/qa/audio",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://app.demand-iq.com/api/qa/audio"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://app.demand-iq.com/api/qa/audio")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.demand-iq.com/api/qa/audio")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body"<string>"{
"error": "<string>"
}Q&A
Stream the spoken audio for an answer
Synthesizes an answer that POST /api/qa already produced and streams MP3 audio as it is generated, so playback can start before the clip is complete. The response doesn’t support byte ranges.
Once the clip has been stored for a cached answer, the same token redirects to the stored file. If synthesis can’t start, the endpoint redirects to the default answer clip.
You don’t build this URL yourself. Use the audioUrl returned by POST /api/qa when audioStreamed is true.
Authentication: The sealed token in the t query parameter of QaResponse.audioUrl. Tokens expire after 6 hours.
GET
/
api
/
qa
/
audio
Stream the spoken audio for an answer
curl --request GET \
--url https://app.demand-iq.com/api/qa/audioimport requests
url = "https://app.demand-iq.com/api/qa/audio"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://app.demand-iq.com/api/qa/audio', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.demand-iq.com/api/qa/audio",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://app.demand-iq.com/api/qa/audio"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://app.demand-iq.com/api/qa/audio")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.demand-iq.com/api/qa/audio")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body"<string>"{
"error": "<string>"
}Query Parameters
Sealed answer-audio token from QaResponse.audioUrl
Response
MP3 audio, streamed
The response is of type file.