curl --request POST \
--url https://gateway.widebot.net/api/v1/RAG/Answer \
--header 'Content-Type: application/json' \
--header 'x-bot: <api-key>' \
--header 'x-user-auth: <api-key>' \
--data '
{
"Question": "ما هو الاسم الكامل لمحمد صلاح؟",
"IndexNames": [
"Mohamed Salah"
],
"Limit": 10,
"Temperature": 0.1,
"MaxOutputTokens": 1024,
"IsStream": false
}
'import requests
url = "https://gateway.widebot.net/api/v1/RAG/Answer"
payload = {
"Question": "ما هو الاسم الكامل لمحمد صلاح؟",
"IndexNames": ["Mohamed Salah"],
"Limit": 10,
"Temperature": 0.1,
"MaxOutputTokens": 1024,
"IsStream": False
}
headers = {
"x-user-auth": "<api-key>",
"x-bot": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-user-auth': '<api-key>',
'x-bot': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
Question: 'ما هو الاسم الكامل لمحمد صلاح؟',
IndexNames: ['Mohamed Salah'],
Limit: 10,
Temperature: 0.1,
MaxOutputTokens: 1024,
IsStream: false
})
};
fetch('https://gateway.widebot.net/api/v1/RAG/Answer', 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://gateway.widebot.net/api/v1/RAG/Answer",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'Question' => 'ما هو الاسم الكامل لمحمد صلاح؟',
'IndexNames' => [
'Mohamed Salah'
],
'Limit' => 10,
'Temperature' => 0.1,
'MaxOutputTokens' => 1024,
'IsStream' => false
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-bot: <api-key>",
"x-user-auth: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://gateway.widebot.net/api/v1/RAG/Answer"
payload := strings.NewReader("{\n \"Question\": \"ما هو الاسم الكامل لمحمد صلاح؟\",\n \"IndexNames\": [\n \"Mohamed Salah\"\n ],\n \"Limit\": 10,\n \"Temperature\": 0.1,\n \"MaxOutputTokens\": 1024,\n \"IsStream\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-user-auth", "<api-key>")
req.Header.Add("x-bot", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://gateway.widebot.net/api/v1/RAG/Answer")
.header("x-user-auth", "<api-key>")
.header("x-bot", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"Question\": \"ما هو الاسم الكامل لمحمد صلاح؟\",\n \"IndexNames\": [\n \"Mohamed Salah\"\n ],\n \"Limit\": 10,\n \"Temperature\": 0.1,\n \"MaxOutputTokens\": 1024,\n \"IsStream\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://gateway.widebot.net/api/v1/RAG/Answer")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-user-auth"] = '<api-key>'
request["x-bot"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"Question\": \"ما هو الاسم الكامل لمحمد صلاح؟\",\n \"IndexNames\": [\n \"Mohamed Salah\"\n ],\n \"Limit\": 10,\n \"Temperature\": 0.1,\n \"MaxOutputTokens\": 1024,\n \"IsStream\": false\n}"
response = http.request(request)
puts response.read_body{
"StatusCode": 200,
"Response": {
"answer": "محمد صلاح حامد محروس غالي",
"chat_history": "<array>",
"retrieved_documents": [
{
"text": "<string>",
"score": 123,
"metadata": {
"file_id": "<string>",
"Section Title": "<string>"
}
}
]
},
"Consumption": "3600/10000000"
}Answer Question
Answer questions using Retrieval-Augmented Generation from your indexed documents with source citations.
Requirements:
- Documents must be pre-indexed via AI Knowledge Feature
- Specify IndexNames to search specific document collections
Key Features:
- Semantic document retrieval
- Source-backed answers
- Relevance scoring
- Multi-document synthesis
Note: Example requests/responses shown here are illustrative. When using the live “Try it” tool, you may see two responses: an HTTP status preview from the client and the API’s JSON body (StandardResponse envelope).
curl --request POST \
--url https://gateway.widebot.net/api/v1/RAG/Answer \
--header 'Content-Type: application/json' \
--header 'x-bot: <api-key>' \
--header 'x-user-auth: <api-key>' \
--data '
{
"Question": "ما هو الاسم الكامل لمحمد صلاح؟",
"IndexNames": [
"Mohamed Salah"
],
"Limit": 10,
"Temperature": 0.1,
"MaxOutputTokens": 1024,
"IsStream": false
}
'import requests
url = "https://gateway.widebot.net/api/v1/RAG/Answer"
payload = {
"Question": "ما هو الاسم الكامل لمحمد صلاح؟",
"IndexNames": ["Mohamed Salah"],
"Limit": 10,
"Temperature": 0.1,
"MaxOutputTokens": 1024,
"IsStream": False
}
headers = {
"x-user-auth": "<api-key>",
"x-bot": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-user-auth': '<api-key>',
'x-bot': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
Question: 'ما هو الاسم الكامل لمحمد صلاح؟',
IndexNames: ['Mohamed Salah'],
Limit: 10,
Temperature: 0.1,
MaxOutputTokens: 1024,
IsStream: false
})
};
fetch('https://gateway.widebot.net/api/v1/RAG/Answer', 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://gateway.widebot.net/api/v1/RAG/Answer",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'Question' => 'ما هو الاسم الكامل لمحمد صلاح؟',
'IndexNames' => [
'Mohamed Salah'
],
'Limit' => 10,
'Temperature' => 0.1,
'MaxOutputTokens' => 1024,
'IsStream' => false
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-bot: <api-key>",
"x-user-auth: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://gateway.widebot.net/api/v1/RAG/Answer"
payload := strings.NewReader("{\n \"Question\": \"ما هو الاسم الكامل لمحمد صلاح؟\",\n \"IndexNames\": [\n \"Mohamed Salah\"\n ],\n \"Limit\": 10,\n \"Temperature\": 0.1,\n \"MaxOutputTokens\": 1024,\n \"IsStream\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-user-auth", "<api-key>")
req.Header.Add("x-bot", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://gateway.widebot.net/api/v1/RAG/Answer")
.header("x-user-auth", "<api-key>")
.header("x-bot", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"Question\": \"ما هو الاسم الكامل لمحمد صلاح؟\",\n \"IndexNames\": [\n \"Mohamed Salah\"\n ],\n \"Limit\": 10,\n \"Temperature\": 0.1,\n \"MaxOutputTokens\": 1024,\n \"IsStream\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://gateway.widebot.net/api/v1/RAG/Answer")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-user-auth"] = '<api-key>'
request["x-bot"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"Question\": \"ما هو الاسم الكامل لمحمد صلاح؟\",\n \"IndexNames\": [\n \"Mohamed Salah\"\n ],\n \"Limit\": 10,\n \"Temperature\": 0.1,\n \"MaxOutputTokens\": 1024,\n \"IsStream\": false\n}"
response = http.request(request)
puts response.read_body{
"StatusCode": 200,
"Response": {
"answer": "محمد صلاح حامد محروس غالي",
"chat_history": "<array>",
"retrieved_documents": [
{
"text": "<string>",
"score": 123,
"metadata": {
"file_id": "<string>",
"Section Title": "<string>"
}
}
]
},
"Consumption": "3600/10000000"
}Authorizations
Your API key from account settings
Your bot ID from account settings
Body
The question to answer using indexed documents
"ما هو الاسم الكامل لمحمد صلاح؟"
Names of document indexes to search (each matches a knowledge unit title). Required for the streaming endpoint; optional for the standard endpoint.
["Mohamed Salah"]
Number of document chunks to retrieve
1 <= x <= 5010
Maximum number of documents to process
1 <= x <= 5010
Controls creativity in answer generation
0 <= x <= 10.1
Maximum tokens in generated answer
1 <= x <= 40961024
Whether to update global context
false
Whether to stream the response
false
Was this page helpful?

