πSearch API
This section explains different REST APIs which enable the users to insert or search data within Engines.
List Private Engines
GET /v1/engine/user/list
This endpoint allows the users to list all the Private Engines associated with a private API key.
Header:
x-api-key: user private api keyRequest Example:
curl --location --request GET \
'https://api.sepana.io/v1/engine/user/list' \
--header 'x-api-key: <replace-with-your-api-key>'import requests
headers = {
'x-api-key': '<replace-with-your-api-key>',
}
response = requests.get('https://api.sepana.io/v1/engine/user/list', headers=headers)fetch('https://api.sepana.io/v1/engine/user/list', {
headers: {
'x-api-key': '<replace-with-your-api-key>'
}
});package main
import (
"fmt"
"io/ioutil"
"log"
"net/http"
)
func main() {
client := &http.Client{}
req, err := http.NewRequest("GET", "https://api.sepana.io/v1/engine/user/list", nil)
if err != nil {
log.Fatal(err)
}
req.Header.Set("x-api-key", "<replace-with-your-api-key>")
resp, err := client.Do(req)
if err != nil {
log.Fatal(err)
}
defer resp.Body.Close()
bodyText, err := ioutil.ReadAll(resp.Body)
if err != nil {
log.Fatal(err)
}
fmt.Printf("%s\n", bodyText)
}List Public Engines
GET /v1/engine/public/list
This endpoint allows the users to list all the Public Engines existing within Sepana via any private API key belonging to them.
Header:
Request Example:
Insert Data
POST /v1/engine/insert_data
This endpoint is responsible for ingesting the data within a Sepana Engine. The data is provided in the form of JSON documents. Upon successful call to this endpoint, an internal data indexing job is created which is responsible for persisting the data. A maximum of 500 records can be inserted at a time.
Note: While ingesting the data, users can send unique _id along with each record. This acts as an identifier for that row in the dataset. If not specified explicitly by the user, Sepana automatically assigns one to each row.
Example below:
RfEFzoQBxqv6fmT099iM and RvELzoQBxqv6fmT0odgB are system generated identifiers (_id) for the two records present within <engine-id-1>. If the user wants to update the data within these two data points in future, they can simply create an ingestion request with new data while adding _id identifier to it. This will overwrite the older data present with _id.
Header:
Parameters:
Request Example:
Delete Data
DELETE /v1/engine/data/delete
This endpoint is responsible for deleting data from a Sepana Engine. The users can delete the data providing delete_query and engine_id as inputs. Users can initially perform search with a query and delete those records using the same query as delete_query. To perform deletion, the user must own an API key for an Engine with a minimum of Admin access.
Header:
Parameters:
Request Example:
Delete the records from Engine "a88d58e6-15bf-409c-a09d-84603894c56e" where user_name is Louis Pearson
Engine Remapping
POST /v1/engine/remap_fields
This endpoint allows users to reconfigure Engines for which they have admin access. It allows users to redefine and update the field data types. Upon calling this endpoint, an asynchronous pipeline is created which updates the data mapping of the engines based on the past configurations. The example mentioned updates the Engine mapping from previous endpoint (/engine/insert_data). Changes field "age" from "float" to "integer" and adds another field "expense" with data type "integer"
Header:
Parameters:
Request Example:
Job Status
GET /v1/job/status/{job_id}
Both Data Ingestion and Engine Reconfiguration are long running tasks. The system, therefore, creates asynchronous pipelines to execute those tasks. Every task is assigned a Job ID. You can track and update Job IDs using this endpoint.
Header:
Parameters:
Request Example:
Search
POST /v1/search
This endpoint allows users to search through data in a single or multiple Engines. There are various filters and options to choose from.
Header:
Parameters:
Request Examples:
Last updated
Was this helpful?