본문으로 건너뛰기
버전: 1.0.0

Create documents

정보
  • 데이터 추가, 읽기, 변경, 삭제를 위해서는 client write secret이 필요합니다.
  • Document에 _idtitle 필드를 필수로 포함해야 합니다.
  • 이미 존재하는 _id를 가진 Document를 추가하려고 하면 409 에러가 발생합니다.

Overview

Path
POST/v1/collections/{collectionName}/documents
  • Collection에 Document를 추가합니다.

Example


curl -X POST https://api.invector.co/v1/collections/{collectionName}/documents \
     -H "Content-Type: application/json" \
     -H "Authorization: Basic base64({CLIENT_ID}:{CLIENT_WRITE_SECRET})" \
     -d '{
       "documents": [
         {
           "_id": "unique_document_id_123",
           "title": "Description of Philip",
           "name": "Philip",
           "age": 22,
           "department": "Engineering",
           "role": "Software Engineer",
           "email": "philipchoi@togglecampus.com"
         }
       ]
     }'

Authorization


Authorization
BasicBasic authorization at Header. Base64 encoding required
client_id
string
client_secret
string
example

 curl -X POST https://api.invector.co/v1/collections/{collectionName}/documents \
      -H "Content-Type: application/json" \
      -H "Authorization: Basic base64({CLIENT_ID}:{CLIENT_WRITE_SECRET})" \
     ...

Path Parameters


collectionName
string

Request Body


documents
array of objectArray of documents to be created.
_id
string (required)Unique Document ID.
title
string (required)Title of the document.
[other fields …]
anyOther fields of the document.
example
{
  "documents": [
    {
      "_id": "unique_document_id_123",
      "title": "Description of Philip",
      "name": "Philip",
      "age": 22,
      "department": "Engineering",
      "role": "Software Engineer",
      "email": "philipchoi@togglecampus.com"
    }
  ]
}

Response Body


documents
array of objectArray of documents to be created.
_id
string (required)Unique Document ID.
title
string (required)Title of the document.
[other fields …]
anyOther fields of the document.
example
{
  "documents": [
    {
      "_id": "unique_document_id_123",
      "title": "Description of Philip",
      "name": "Philip",
      "age": 22,
      "department": "Engineering",
      "role": "Software Engineer",
      "email": "philipchoi@togglecampus.com"
    }
  ]
}