List an answer's sources
Returns the pages one AI answer cited.
Required scope: v2:prompts. Takes no query parameters. The list is not paged.
labelcan benull.- A malformed id, or an answer in another workspace, returns
404 PROMPT_RESPONSE_NOT_FOUND.
curl -X GET "https://api.opttab.com/v1/external/responses/44444444-4444-4444-8444-444444444444/sources" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_TOKEN"
import requests
import json
url = "https://api.opttab.com/v1/external/responses/44444444-4444-4444-8444-444444444444/sources"
headers = {
"Content-Type": "application/json",
"Authorization": "Bearer YOUR_API_TOKEN"
}
response = requests.get(url, headers=headers)
print(response.json())
const response = await fetch("https://api.opttab.com/v1/external/responses/44444444-4444-4444-8444-444444444444/sources", {
method: "GET",
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer YOUR_API_TOKEN"
}
});
const data = await response.json();
console.log(data);
package main
import (
"fmt"
"net/http"
)
func main() {
req, err := http.NewRequest("GET", "https://api.opttab.com/v1/external/responses/44444444-4444-4444-8444-444444444444/sources", nil)
if err != nil {
panic(err)
}
req.Header.Set("Content-Type", "application/json")
req.Header.Set("Authorization", "Bearer YOUR_API_TOKEN")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
fmt.Println("Response Status:", resp.Status)
}
require 'net/http'
require 'json'
uri = URI('https://api.opttab.com/v1/external/responses/44444444-4444-4444-8444-444444444444/sources')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Get.new(uri)
request['Content-Type'] = 'application/json'
request['Authorization'] = 'Bearer YOUR_API_TOKEN'
response = http.request(request)
puts response.body
{
"items": [
{
"canonicalUrl": "https://north.example/shoes/daily-trainer",
"domain": "north.example",
"label": "Daily trainer"
}
]
}
{
"error": "API_KEY_INVALID",
"code": "UNAUTHORIZED"
}
{
"error": "API_KEY_SCOPE",
"code": "FORBIDDEN"
}
{
"error": "API_KEY_IP_DENIED",
"code": "FORBIDDEN"
}
{
"error": "PROMPT_RESPONSE_NOT_FOUND",
"code": "NOT_FOUND"
}
{
"error": "ThrottlerException: Too Many Requests",
"code": "RATE_LIMITED"
}
/v1/external/responses/{responseId}/sourcesTarget server for requests. Edit to use your own host.
An API key secret from Settings › API. It starts with opt_live_.
Send it as Authorization: Bearer opt_live_xxxxxxxx. A session cookie, an X-API-Key
header and an ?api_key= query parameter do not authenticate.
opt_live_.
Send it as Authorization: Bearer opt_live_xxxxxxxx. A session cookie, an X-API-Key
header and an ?api_key= query parameter do not authenticate.
The answer's id, from GET /v1/external/prompts/{promptId}/responses.
Request Preview
Response
Response will appear here after sending the request
Authentication
Bearer token. An API key secret from Settings › API. It starts with opt_live_.
Send it as Authorization: Bearer opt_live_xxxxxxxx. A session cookie, an X-API-Key
header and an ?api_key= query parameter do not authenticate.
Path Parameters
The answer's id, from GET /v1/external/prompts/{promptId}/responses.
44444444-4444-4444-8444-444444444444