cURL
curl --request POST \
--url https://api.unize.org/v1/storage/{graph_id}/retrieval/ \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"question": "<string>",
"system": "rt-0.5"
}
'import requests
url = "https://api.unize.org/v1/storage/{graph_id}/retrieval/"
payload = {
"question": "<string>",
"system": "rt-0.5"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({question: '<string>', system: 'rt-0.5'})
};
fetch('https://api.unize.org/v1/storage/{graph_id}/retrieval/', 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://api.unize.org/v1/storage/{graph_id}/retrieval/",
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' => '<string>',
'system' => 'rt-0.5'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$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://api.unize.org/v1/storage/{graph_id}/retrieval/"
payload := strings.NewReader("{\n \"question\": \"<string>\",\n \"system\": \"rt-0.5\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<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://api.unize.org/v1/storage/{graph_id}/retrieval/")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"question\": \"<string>\",\n \"system\": \"rt-0.5\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.unize.org/v1/storage/{graph_id}/retrieval/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"question\": \"<string>\",\n \"system\": \"rt-0.5\"\n}"
response = http.request(request)
puts response.read_body{
"retrieval_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}Unize Retrieval Endpoints
Ask Question to Graph
Ask a question to the knowledge graph
POST
/
v1
/
storage
/
{graph_id}
/
retrieval
/
cURL
curl --request POST \
--url https://api.unize.org/v1/storage/{graph_id}/retrieval/ \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"question": "<string>",
"system": "rt-0.5"
}
'import requests
url = "https://api.unize.org/v1/storage/{graph_id}/retrieval/"
payload = {
"question": "<string>",
"system": "rt-0.5"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({question: '<string>', system: 'rt-0.5'})
};
fetch('https://api.unize.org/v1/storage/{graph_id}/retrieval/', 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://api.unize.org/v1/storage/{graph_id}/retrieval/",
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' => '<string>',
'system' => 'rt-0.5'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$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://api.unize.org/v1/storage/{graph_id}/retrieval/"
payload := strings.NewReader("{\n \"question\": \"<string>\",\n \"system\": \"rt-0.5\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<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://api.unize.org/v1/storage/{graph_id}/retrieval/")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"question\": \"<string>\",\n \"system\": \"rt-0.5\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.unize.org/v1/storage/{graph_id}/retrieval/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"question\": \"<string>\",\n \"system\": \"rt-0.5\"\n}"
response = http.request(request)
puts response.read_body{
"retrieval_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}Authorizations
Send the API generated from the Playground:
Authorization: <api_key>
Path Parameters
The graph_id of the knowledge graph to ask a question to. A graph_id is an alphanumeric string that uniquely identifies a knowledge graph.
Body
application/jsonapplication/x-www-form-urlencodedmultipart/form-data
Response
202 - application/json
The alphanumeric string that uniquely identifies the retrieval request.
⌘I