Insert rows into table
curl --request POST \
--url https://{resource_uuid}.api.seahorse.dnotitia.ai/v2/data \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: text/plain' \
--data '{"id":"random1\\u001E1","metadata":"{\"file_name\": \"abc.pdf\"}","text":"hello","embedding":[1.0,2.0,...,3.0]}
{"id":"random1\\u001E2","metadata":"{\"file_name\": \"def.pdf\"}","text":"world","embedding":[4.0,5.0,...,6.0]}
{"id":"random1\\u001E3","metadata":"{\"file_name\": \"ghi.pdf\"}","text":"rust","embedding":[7.0,8.0,...,9.0]}'import requests
url = "https://{resource_uuid}.api.seahorse.dnotitia.ai/v2/data"
payload = "{\"id\":\"random1\\\\u001E1\",\"metadata\":\"{\\\"file_name\\\": \\\"abc.pdf\\\"}\",\"text\":\"hello\",\"embedding\":[1.0,2.0,...,3.0]}\n{\"id\":\"random1\\\\u001E2\",\"metadata\":\"{\\\"file_name\\\": \\\"def.pdf\\\"}\",\"text\":\"world\",\"embedding\":[4.0,5.0,...,6.0]}\n{\"id\":\"random1\\\\u001E3\",\"metadata\":\"{\\\"file_name\\\": \\\"ghi.pdf\\\"}\",\"text\":\"rust\",\"embedding\":[7.0,8.0,...,9.0]}"
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "text/plain"
}
response = requests.post(url, data=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'text/plain'},
body: '{"id":"random1\\u001E1","metadata":"{\"file_name\": \"abc.pdf\"}","text":"hello","embedding":[1.0,2.0,...,3.0]}\n{"id":"random1\\u001E2","metadata":"{\"file_name\": \"def.pdf\"}","text":"world","embedding":[4.0,5.0,...,6.0]}\n{"id":"random1\\u001E3","metadata":"{\"file_name\": \"ghi.pdf\"}","text":"rust","embedding":[7.0,8.0,...,9.0]}'
};
fetch('https://{resource_uuid}.api.seahorse.dnotitia.ai/v2/data', 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://{resource_uuid}.api.seahorse.dnotitia.ai/v2/data",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "{\"id\":\"random1\\\\u001E1\",\"metadata\":\"{\\\"file_name\\\": \\\"abc.pdf\\\"}\",\"text\":\"hello\",\"embedding\":[1.0,2.0,...,3.0]}\n{\"id\":\"random1\\\\u001E2\",\"metadata\":\"{\\\"file_name\\\": \\\"def.pdf\\\"}\",\"text\":\"world\",\"embedding\":[4.0,5.0,...,6.0]}\n{\"id\":\"random1\\\\u001E3\",\"metadata\":\"{\\\"file_name\\\": \\\"ghi.pdf\\\"}\",\"text\":\"rust\",\"embedding\":[7.0,8.0,...,9.0]}",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: text/plain"
],
]);
$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://{resource_uuid}.api.seahorse.dnotitia.ai/v2/data"
payload := strings.NewReader("{\"id\":\"random1\\\\u001E1\",\"metadata\":\"{\\\"file_name\\\": \\\"abc.pdf\\\"}\",\"text\":\"hello\",\"embedding\":[1.0,2.0,...,3.0]}\n{\"id\":\"random1\\\\u001E2\",\"metadata\":\"{\\\"file_name\\\": \\\"def.pdf\\\"}\",\"text\":\"world\",\"embedding\":[4.0,5.0,...,6.0]}\n{\"id\":\"random1\\\\u001E3\",\"metadata\":\"{\\\"file_name\\\": \\\"ghi.pdf\\\"}\",\"text\":\"rust\",\"embedding\":[7.0,8.0,...,9.0]}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "text/plain")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://{resource_uuid}.api.seahorse.dnotitia.ai/v2/data")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "text/plain")
.body("{\"id\":\"random1\\\\u001E1\",\"metadata\":\"{\\\"file_name\\\": \\\"abc.pdf\\\"}\",\"text\":\"hello\",\"embedding\":[1.0,2.0,...,3.0]}\n{\"id\":\"random1\\\\u001E2\",\"metadata\":\"{\\\"file_name\\\": \\\"def.pdf\\\"}\",\"text\":\"world\",\"embedding\":[4.0,5.0,...,6.0]}\n{\"id\":\"random1\\\\u001E3\",\"metadata\":\"{\\\"file_name\\\": \\\"ghi.pdf\\\"}\",\"text\":\"rust\",\"embedding\":[7.0,8.0,...,9.0]}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{resource_uuid}.api.seahorse.dnotitia.ai/v2/data")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'text/plain'
request.body = "{\"id\":\"random1\\\\u001E1\",\"metadata\":\"{\\\"file_name\\\": \\\"abc.pdf\\\"}\",\"text\":\"hello\",\"embedding\":[1.0,2.0,...,3.0]}\n{\"id\":\"random1\\\\u001E2\",\"metadata\":\"{\\\"file_name\\\": \\\"def.pdf\\\"}\",\"text\":\"world\",\"embedding\":[4.0,5.0,...,6.0]}\n{\"id\":\"random1\\\\u001E3\",\"metadata\":\"{\\\"file_name\\\": \\\"ghi.pdf\\\"}\",\"text\":\"rust\",\"embedding\":[7.0,8.0,...,9.0]}"
response = http.request(request)
puts response.read_body{
"code": 200,
"data": {
"elapsed_time": null,
"inserted_record_batches": 1,
"inserted_row_count": 4
},
"exception": null,
"success": true
}{
"code": 400,
"data": null,
"exception": {
"error_code": 400001,
"error_message": "Bad Request: Multiple nodes found, it supported only for single node deployment."
},
"success": false
}{
"code": 500,
"data": null,
"exception": {
"error_code": 500001,
"error_message": "Internal error: "
},
"success": false
}테이블 (Table)
Insert rows into table
Insert rows into table from the given request. The rows are in json format.
POST
/
v2
/
data
Insert rows into table
curl --request POST \
--url https://{resource_uuid}.api.seahorse.dnotitia.ai/v2/data \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: text/plain' \
--data '{"id":"random1\\u001E1","metadata":"{\"file_name\": \"abc.pdf\"}","text":"hello","embedding":[1.0,2.0,...,3.0]}
{"id":"random1\\u001E2","metadata":"{\"file_name\": \"def.pdf\"}","text":"world","embedding":[4.0,5.0,...,6.0]}
{"id":"random1\\u001E3","metadata":"{\"file_name\": \"ghi.pdf\"}","text":"rust","embedding":[7.0,8.0,...,9.0]}'import requests
url = "https://{resource_uuid}.api.seahorse.dnotitia.ai/v2/data"
payload = "{\"id\":\"random1\\\\u001E1\",\"metadata\":\"{\\\"file_name\\\": \\\"abc.pdf\\\"}\",\"text\":\"hello\",\"embedding\":[1.0,2.0,...,3.0]}\n{\"id\":\"random1\\\\u001E2\",\"metadata\":\"{\\\"file_name\\\": \\\"def.pdf\\\"}\",\"text\":\"world\",\"embedding\":[4.0,5.0,...,6.0]}\n{\"id\":\"random1\\\\u001E3\",\"metadata\":\"{\\\"file_name\\\": \\\"ghi.pdf\\\"}\",\"text\":\"rust\",\"embedding\":[7.0,8.0,...,9.0]}"
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "text/plain"
}
response = requests.post(url, data=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'text/plain'},
body: '{"id":"random1\\u001E1","metadata":"{\"file_name\": \"abc.pdf\"}","text":"hello","embedding":[1.0,2.0,...,3.0]}\n{"id":"random1\\u001E2","metadata":"{\"file_name\": \"def.pdf\"}","text":"world","embedding":[4.0,5.0,...,6.0]}\n{"id":"random1\\u001E3","metadata":"{\"file_name\": \"ghi.pdf\"}","text":"rust","embedding":[7.0,8.0,...,9.0]}'
};
fetch('https://{resource_uuid}.api.seahorse.dnotitia.ai/v2/data', 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://{resource_uuid}.api.seahorse.dnotitia.ai/v2/data",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "{\"id\":\"random1\\\\u001E1\",\"metadata\":\"{\\\"file_name\\\": \\\"abc.pdf\\\"}\",\"text\":\"hello\",\"embedding\":[1.0,2.0,...,3.0]}\n{\"id\":\"random1\\\\u001E2\",\"metadata\":\"{\\\"file_name\\\": \\\"def.pdf\\\"}\",\"text\":\"world\",\"embedding\":[4.0,5.0,...,6.0]}\n{\"id\":\"random1\\\\u001E3\",\"metadata\":\"{\\\"file_name\\\": \\\"ghi.pdf\\\"}\",\"text\":\"rust\",\"embedding\":[7.0,8.0,...,9.0]}",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: text/plain"
],
]);
$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://{resource_uuid}.api.seahorse.dnotitia.ai/v2/data"
payload := strings.NewReader("{\"id\":\"random1\\\\u001E1\",\"metadata\":\"{\\\"file_name\\\": \\\"abc.pdf\\\"}\",\"text\":\"hello\",\"embedding\":[1.0,2.0,...,3.0]}\n{\"id\":\"random1\\\\u001E2\",\"metadata\":\"{\\\"file_name\\\": \\\"def.pdf\\\"}\",\"text\":\"world\",\"embedding\":[4.0,5.0,...,6.0]}\n{\"id\":\"random1\\\\u001E3\",\"metadata\":\"{\\\"file_name\\\": \\\"ghi.pdf\\\"}\",\"text\":\"rust\",\"embedding\":[7.0,8.0,...,9.0]}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "text/plain")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://{resource_uuid}.api.seahorse.dnotitia.ai/v2/data")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "text/plain")
.body("{\"id\":\"random1\\\\u001E1\",\"metadata\":\"{\\\"file_name\\\": \\\"abc.pdf\\\"}\",\"text\":\"hello\",\"embedding\":[1.0,2.0,...,3.0]}\n{\"id\":\"random1\\\\u001E2\",\"metadata\":\"{\\\"file_name\\\": \\\"def.pdf\\\"}\",\"text\":\"world\",\"embedding\":[4.0,5.0,...,6.0]}\n{\"id\":\"random1\\\\u001E3\",\"metadata\":\"{\\\"file_name\\\": \\\"ghi.pdf\\\"}\",\"text\":\"rust\",\"embedding\":[7.0,8.0,...,9.0]}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{resource_uuid}.api.seahorse.dnotitia.ai/v2/data")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'text/plain'
request.body = "{\"id\":\"random1\\\\u001E1\",\"metadata\":\"{\\\"file_name\\\": \\\"abc.pdf\\\"}\",\"text\":\"hello\",\"embedding\":[1.0,2.0,...,3.0]}\n{\"id\":\"random1\\\\u001E2\",\"metadata\":\"{\\\"file_name\\\": \\\"def.pdf\\\"}\",\"text\":\"world\",\"embedding\":[4.0,5.0,...,6.0]}\n{\"id\":\"random1\\\\u001E3\",\"metadata\":\"{\\\"file_name\\\": \\\"ghi.pdf\\\"}\",\"text\":\"rust\",\"embedding\":[7.0,8.0,...,9.0]}"
response = http.request(request)
puts response.read_body{
"code": 200,
"data": {
"elapsed_time": null,
"inserted_record_batches": 1,
"inserted_row_count": 4
},
"exception": null,
"success": true
}{
"code": 400,
"data": null,
"exception": {
"error_code": 400001,
"error_message": "Bad Request: Multiple nodes found, it supported only for single node deployment."
},
"success": false
}{
"code": 500,
"data": null,
"exception": {
"error_code": 500001,
"error_message": "Internal error: "
},
"success": false
}Authorizations
bearerAuthapiKeyAuth
Bearer token authentication. Include the token in the Authorization header as 'Bearer '
Query Parameters
Number of the maximum rows to insert at a time. It determines the size of each record batch. Default is 1024.
Required range:
x >= 0