Table of Contents | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
|
...
Insert excerpt | ||||||||
---|---|---|---|---|---|---|---|---|
|
...
Code Block |
---|
curl --location 'http://gateway.<baseUrl>/ingestion/graphql' \ --header 'Content-Type: <MIME_TYPE>' \ --header 'Authorization: Bearer <your-access-token>' \ --data '{"query":"mutation ContentUpsert($input: ContentCreateInput!, $scopeId: String, $sourceOwnerType: String, $sourceName: String, $storeInternally: Boolean) , $text: String, $sourceKind: String)\r\n{\r\n contentUpsert(\r\n input: $input\r\n scopeId: $scopeId\r\n sourceOwnerType: $sourceOwnerType\r\n sourceName: $sourceName\r\n storeInternally: $storeInternally\r\n ) {text: $text\r\n idsourceKind: $sourceKind\r\n ) {\r\n keyid\r\n textkey\r\n byteSize\r\n mimeType\r\n ownerType\r\n ownerId\r\n writeUrl\r\n readUrl\r\n createdAt\r\n internallyStoredAt\r\n }\r\n}\r\n","variables":{"input":{"keytitle":"<arbitrary id. Can be an external id, file name, etc>", "metadata": "{}","text": "Lorem Ipsum", "mimeType":"<DOCUMENT_MIME_TYPE>Lorem Ipsum","key":"<unique identifier of the content>","ownerType":"<COMPANY | SCOPE>SCOPE | USER | CHAT>","byteSizemimeType":<DOCUMENT_BYTE_SIZE>"text/html"},"scopeId":"<SCOPE_ID | PATH | COMPANY>","sourceOwnerType":"<USER | COMPANY | SCOPE>","storeInternallysourceKind":<boolean>,"sourceName": "<Custom string to identify the source>"<UNIQUE_BLOB_STORAGE | FILE_DOWNLOAD | ATLASSIAN_CONFLUENCE_CLOUD | ATLASSIAN_CONFLUENCE_ONPREM | MICROSOFT_365_SHAREPOINT | INTRANET>","text":"Lorem Ipsum"}}' |
Parameters:
input
[json]
key
required [string]
A unique external identifier of this content. Since the ingestion is an upsert, ingesting with the same key and scopeId will update the content. Therefore, to update content, post the same payload with the updated text, title, etc.
metadata
mimeType
required [jsonstring]
The document metadata.title
MIME type of the content, see https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types
ownerType
required [enum]USER
, COMPANY
, CHAT,
SCOPE
title
optional [string]
The title of this content. This will be shown when a reference is displayed in the answer from the AI.
url
optional [string]
The url to the source of the content. This will be shown when a reference is displayed in the answer from the AI.
source
required [object]
kind
required [enum]UNIQUE_BLOB_STORAGE
, FILE_DOWNLOAD
, ATLASSIAN_CONFLUENCE_CLOUD
, ATLASSIAN_CONFLUENCE_ONPREM
, MICROSOFT_365_SHAREPOINT
, INTRANET
name
optional [string]
The name of the source, for example “Intranet connector”.
ownerType
optional [string]
metadata
optional [json]
The document metadata.
text
optional [string]
The main text content that will be ingested. This can be a string of raw text, HTML, or Markdown. When using HTML or Markdown, it is strongly advised to cut unnecessary and unrelevant data (like header, footer, etc.).
mimeType
optional [string]
ownerType
optional [enum]
USER
, COMPANY
, CHAT,
SCOPE
scopeId
optional [string]
This will be provided by Unique during the setup phase (depending on the scope).
storedInternally
optional [boolean]
Whether the documents are persisted in Unique’s storage.
sourceKind
optional [boolean]UNIQUE_BLOB_STORAGE
(default), FILE_DOWNLOAD
, ATLASSIAN_CONFLUENCE_CLOUD
, ATLASSIAN_CONFLUENCE_ONPREM
, MICROSOFT_365_SHAREPOINT
, INTRANET
sourceName
optional [boolean]
The name of the source, for example “Intranet connector”.
sourceOwnerType
optional [enum]USER
, COMPANY
, CHAT,
SCOPE
Example
Example JSON with the structure that our Confluence connector uses:
Code Block |
---|
{ "input": { "title": "Example Title", "key": "123", "ownerType": "COMPANY", "text": "Lorem Ipsum" "ownerTypemimeType": "COMPANYtext/html" }, "scopeId": "COMPANY", "sourceOwnerType": "COMPANY", "sourceKind": "INTRANET" "text": "Lorem Ipsum" } |
Ingestion (File)
General Flow
...
Scope management (retrieval of existing scopes, creation of new scopes, etc) through the API is documented here.
Call to Ingestion service: parameters
...