➡️Importing data via API

Step-by-Step guide for Inserting data in Engines

Prerequisites

  • Register with Sepana

  • Have at least read-write access to the Engine. Sepana automatically creates an API key with owner access. The Engine creator can use that key for inserting the data. Alternatively, they can create another key with "Read-Write" or "Admin" ACL and use it. If you are not the creator of the Engine, you will need someone (owner or admin of the Engine) to assign you the API key access. (Discussed here)

  • Data in JSON form. Currently, our API supports indexing data in JSON form. You can manually upload other supported data types(CSV, JSON, TSV) via the developer dashboard.

Steps

Fetch API key

Navigate to the "Engine View" and Click on API Keys.

Engine View

You should see the API keys accessible to you along with their permissions. As you can see, one of the keys has Admin rights while the other has Read_only rights. So, for this particular Engine, we can use the "Share API" key because it has "Admin" rights.

Convert Documents to JSON format

Sepana REST API for insertion currently only supports JSON documents. Therefore, this step requires converting our input documents to JSON format. A maximum of 500 documents (or objects) can be inserted in a single API call.

Insert

Now, that we have the Engine ID, API key, and documents in JSON format. We can call the insert data endpoint. For this example, we will be inserting two documents.

Upon calling the insertion endpoint, the request is queued and handled by the system asynchronously. You can check the status of the job using Job Status endpoint.

Last updated

Was this helpful?