Open API
Overview
SERVICEME Open API basic call process:
Step 1: Use the interface provided in the authentication section to authenticate and obtain the access token
Authentication is divided into two types: user authentication and client authentication.
- User authentication: Authentication based on personal account identity.
- Client authentication: Authentication using the client code and secret issued by SERVICEME.
Step 2: Use the access token to call the corresponding API
Authentication Methods
User AAD Authentication
This method is a type of user authentication and requires the use of an AAD access token as the basis for authentication.
-
How to obtain the AAD access token:
AAD and React integration documentation: Go to->
AAD and .Net integration documentation: Go to->
AAD and Java integration documentation: Go to->
-
Interface address:
/openapi/auth/user/aad
-
Request method:
post
-
Request body:
Parameter Name | Required | Type | Description |
---|---|---|---|
token | Yes | string | User AAD access token (provided by the integrator) |
- Request example:
curl --location 'https://localhost/openapi/auth/user/aad' \
--header 'Content-Type: application/json' \
--data '{
"token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImtpZCI6IlhSdmtvOFA3QTNVYVdTblU3Yk05blQwTWpoQSJ9.eyJhdWQiOiIzZTEwNjVhYS1jZWYxLTRiYTgtOWRiOS1kMWQ1Y2UzMGYyZDgiLCJpc3MiOiJodHRwczovL2xvZ2luLm1pY3Jvc29mdG9ubGluZS5jb20vNDRjMjRmNDItZDQ5Yi00MT......"
}'
- Response body:
Parameter Name | Sub-parameter | Type | Description |
---|---|---|---|
data | object | Response data | |
access_token | string | SERVICEME system access token | |
expires_in | number | Expiration time, in minutes | |
success | boolean | Whether the request was successful | |
msg | string | Error message if success is false |
- Response example:
{
"data": {
"access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc0V4dGVybmFsIjpmYWxzZSwidXNlcklkIjoiNDAzMDUwMjEwMTEyODgzOTE2OCIsImFjY291bnQiOiJlY210cmlhbEBzZXJ2aWNlbWUub25taWNyb3NvZ......",
"expires_in": 1440
},
"success": true,
"msg": ""
}
Client and User Account Authentication
This authentication method combines client authentication and user account authentication. It authenticates the user account while using client credentials (client code and secret) to ensure the security of the API call. Signature verification is required when calling this interface.
- How to obtain client and secret?
Please contact the system administrator. The administrator will create and assign client credentials for you through the following address:
https://xxx/#/super-admin/client-management
-
Interface address:
/openapi/auth/client_with_account
-
Request method:
post
-
Request body:
Parameter Name | Required | Type | Description |
---|---|---|---|
client | Yes | string | Client code (provided by SERVICEME) |
account | Yes | string | User account (provided by the integrator) |
timestamp | Yes | number | Timestamp (13-digit number, accurate to milliseconds, e.g., 1711537596897) |
nonce | Yes | string | 6-digit random number (can be a combination of numbers or letters) |
signature | Yes | string | Signature, valid for five minutes (signature format: concatenate with colons and then MD5 client:{client}secret:{secret}account:{account}timestamp:{timestamp}nonce:{nonce} to get a 32-character lowercase MD5 value) |
-
JavaScript signature example:
Please create a new HTML file, paste the following content, and open it in a browser
<html>
<head>
<style>
.box {
width: 100%;
height: 100%;
padding: 50px 50px;
}
.row {
display: flex;
height: 50px;
width: 100%;
}
.col1 {
flex: 1;
}
.col2 {
flex: 3;
}
</style>
</head>
<body>
<div class="box">
<div class="row">
<div class="col1">client:</div>
<div class="col2" id="client"></div>
</div>
<div class="row">
<div class="col1">secret:</div>
<div class="col2" id="secret"></div>
</div>
<div class="row">
<div class="col1">account:</div>
<div class="col2" id="account"></div>
</div>
<div class="row">
<div class="col1">timestamp:</div>
<div class="col2" id="timestamp"></div>
</div>
<div class="row">
<div class="col1">nonce:</div>
<div class="col2" id="nonce"></div>
</div>
<div class="row">
<div class="col1">signature:</div>
<div class="col2" id="signature"></div>
</div>
</div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/crypto-js/4.0.0/crypto-js.min.js"></script>
<script>
const client = "openapi"
const secret = "DzYwyICrKbUCEseYthCK0PfSfX7NPEuV"
const account = "test@serviceme.com"
const timestamp = +new Date()
const nonce = "123abc"
const message = `client:${client}secret:${secret}account:${account}timestamp:${timestamp}nonce:${nonce}` // Signature plaintext
const md5Hash = CryptoJS.MD5(message).toString().toLowerCase(); // MD5 32-bit lowercase
console.log(`Signature plaintext: ${message}`)
console.log(`Signature result: ${md5Hash}`)
document.getElementById('client').innerText = client;
document.getElementById('secret').innerText = secret;
document.getElementById('account').innerText = account;
document.getElementById('timestamp').innerText = timestamp;
document.getElementById('nonce').innerText = nonce;
document.getElementById('signature').innerText = md5Hash;
</script>
</body>
</html> -
Request example:
curl --location 'https://localhost/openapi/auth/client_with_account' \
--header 'Content-Type: application/json' \
--data '{
"client": "openapi",
"account": "test@serviceme.com",
"timestamp": 1711537596456,
"nonce": "123abc",
"signature": "182be0c5cdcd5072bb1864cdee4d3d6e"
}'
- Response body:
Parameter Name | Sub-parameter | Type | Description |
---|---|---|---|
data | object | Response data | |
access_token | string | SERVICEME system access token | |
expires_in | number | Expiration time, in minutes | |
success | boolean | Whether the request was successful | |
msg | string | Error message if success is false |
- Response example:
{
"data": {
"access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc0V4dGVybmFsIjpmYWxzZSwidXNlcklkIjoiNDAzMDUwMjEwMTEyODgzOTE2OCIsImFjY291bnQiOiJlY210cmlhbEBzZXJ2ub25ta......",
"expires_in": 1440
},
"success": true,
"msg": ""
}
Chat
Send Message to Copilot
-
Interface address:
/openapi/chat/expert
-
Request method:
post
-
Request header:
Parameter Name | Required | Type | Description |
---|---|---|---|
Authorization | Yes | string | Fill in the SERVICEME access token, format: openapi {access_token} |
- Request body:
Parameter Name | Required | Type | Description |
---|---|---|---|
expertCode | Yes | string | Copilot code in the SERVICEME system (see SERVICEME system) |
content | Yes | string | Question content |
sessionId | No | string | Session ID, representing a chat context. Pass null to start a new session. The new session ID will be returned in the response. From the second Q&A onwards, carry the session ID returned from the previous response. |
stream | No | boolean | Whether to enable streaming (true: on; false: off), default is off |
includeThought | No | boolean | Whether to include thoughts in the response (true: include; false: do not include) |
How to obtain the Q&A code? See the image below:
- Request example:
curl --location 'https://localhost/vee/openapi/chat/expert' \
--header 'Authorization: openapi {access_token}' \
--header 'Content-Type: application/json' \
--data '{
"expertCode": "CHATES",
"content": "Overtime application",
"sessionId": null,
"stream": false,
"includeThought": true
}'
- Response body:
Parameter Name | Sub-parameter | Sub-sub-parameter | Sub-sub-sub-parameter | Type | Description |
---|---|---|---|---|---|
data | object | Response data | |||
chatRecordId | string | Chat record ID | |||
sessionId | string | Session ID | |||
content | string | Text type response content | |||
medias | object | Array of media type response content (images and files) | |||
type | string | image: image; file: file | |||
name | string | Name | |||
suggestionQuestions | array string | Suggested questions | |||
thoughts | array | Thoughts | |||
thought | string | Thought content | |||
pluginName | string | Plugin name | |||
elapsedTime | object | Plugin elapsed time information | |||
model | float | Model elapsed time | |||
action | float | Action elapsed time | |||
total | float | Total elapsed time | |||
state | string | State (success: successful) | |||
finish_reason | string | Whether the response is finished. When the value is stop, it means the response is finished. During the response, the value is null. | |||
success | boolean | Whether the request was successful | |||
msg | string | Error message if success is false |
- Non-streaming response example:
{
"data": {
"chatRecordId": "4299234148041625600",
"sessionId": "4292755814873047040",
"content": "The team leader issues work tasks, clarifies completion nodes and acceptance criteria, and employees can work overtime only after reaching an agreement with their superiors. After completing the overtime, the employee fills in the overtime hours in the time system, submits the overtime process in the system, and the remarks must clearly list the overtime tasks. The team leader/superior approves the overtime application process after accepting the overtime results. HR confirms the clock-in records and calculates the compensatory leave quota.",
"medias": [
{
"type": "image",
"name": null,
"url": "http://localhost:3978/openapi/chat/media/image/FE680A9CCFB1B56E80737FB28562DC33F4A37DEF52A65F046464788B83E0BE77"
},
{
"type": "file",
"name": "Reference Document.pdf",
"url": "https://localhost/#/share/preview?fileId=4268457334348447744&objectType=2&previewType=file&mode=login"
}
],
"suggestionQuestions": [],
"thoughts": [
{
"thought": "To answer this question, I need to query relevant information in the knowledge base.",
"pluginName": "Search Knowledgebase",
"elapsedTime": {
"model": 3612.4722,
"action": 689.5891,
"total": 4302.0613
},
"state": "success"
}
],
"finish_reason": "stop"
},
"success": true,
"msg": ""
}
- Stream Response Example:
data: {"data":{"chatRecordId":"4299228743576059904","sessionId":"4292755079242457089","content":"","medias":[],"suggestionQuestions":[],"thoughts":[{"thought":"In order to answer this question, I need to search the knowledge base for relevant information.","pluginName":"Search Knowledgebase","elapsedTime":{"model": 3612.4722,"action": 689.5891,"total": 4302.0613},"state": "success"}],"finish_reason":null},"success":true,"msg":""}
data: {"data":{"chatRecordId":"4299228743576059904","sessionId":"4292755079242457089","content":"The team leader issues work tasks, clarifies completion deadlines and acceptance criteria, and employees can work overtime only after reaching an agreement with their superiors. After completing overtime, employees should fill in the overtime hours in the time system, submit the overtime process in the system, and clearly state the overtime tasks in the remarks. Complete clock-in and clock-out records at the workplace, and the team leader/superior will approve the overtime application process after accepting the overtime results. HR will confirm the clock-in records and calculate the compensatory leave quota.","medias":[],"suggestionQuestions":[],"thoughts":[],"finish_reason":null},"success":true,"msg":""}
data: {"data":{"chatRecordId":"4299228743576059904","sessionId":"4292755079242457089","content":"","medias":[{"type":"image","name":null,"url":"http://localhost:3978/openapi/chat/media/image/FE680A9CCFB1B56E80737FB28562DC33F4A37DEF52A65F046464788B83E0BE77"}],"suggestionQuestions":[],"thoughts":[],"finish_reason":null},"success":true,"msg":""}
data: {"data":{"chatRecordId":"4299228743576059904","sessionId":"4292755079242457089","content":"","medias":[{"type":"file","name":"Answer Reference File.pdf","url":"https://localhost/#/share/preview?fileId=4268457334348447744&objectType=2&previewType=file&mode=login"}],"suggestionQuestions":[],"thoughts":[],"finish_reason":"stop"},"success":true,"msg":""}
Get Conversation References
-
Endpoint:
/openapi/chat/record/{chatRecordId}/reference
-
Request Method:
get
-
Request Header:
Parameter Name | Required | Type | Description |
---|---|---|---|
Authorization | Yes | string | Fill in the SERVICEME access token, format: openapi {access_token} |
- Request URL Parameters:
Parameter Name | Required | Type | Description |
---|---|---|---|
chatRecordId | Yes | string | Value taken from the chatRecordId field returned by the Q&A interface |
- Request Example:
curl --location 'http://localhost/openapi/chat/record/4299234148041625600/reference' \
--header 'Authorization: openapi {access_token}'
- Response Body:
Parameter Name | Sub-Parameter | Type | Description |
---|---|---|---|
data | object array | Response data | |
title | string | Title | |
content | string | Content of the referenced segment in the conversation record | |
score | float | Relevance (0 to 1, the closer to 1, the more relevant) | |
url | string | Link (currently only file type references have links) | |
type | string | Type enumeration: document (document), image (image), QnA, other | |
success | boolean | Whether the request was successful | |
msg | string | When success is false, this field has a value with some error messages |
- Response Example:
{
"data": [
{
"title": "Company Administrative Policy.pdf",
"content": "Segment One ......",
"score": 0.95,
"url": "https://localhost/#/share/preview?fileId=4268457334348447744&objectType=2&previewType=file&mode=login",
"type": "document"
},
{
"title": "Company Administrative Policy.pdf",
"content": "Segment Two ......",
"score": 0.81,
"url": "https://localhost/#/share/preview?fileId=4268457334348447744&objectType=2&previewType=file&mode=login",
"type": "document"
},
{
"title": "Company Administrative Policy.pdf",
"content": "Segment Three ......",
"score": 0.76,
"url": "https://localhost/#/share/preview?fileId=4268457334348447744&objectType=2&previewType=file&mode=login",
"type": "document"
}
],
"success": true,
"msg": ""
}
File Space
Single File Upload
-
Endpoint:
v1/openapi/workspace/file/upload
-
Request Method:
post
-
Request Header:
Parameter Name | Required | Type | Description |
---|---|---|---|
Authorization | Yes | string | Fill in the SERVICEME access token, format: openapi {access_token} |
- Content Type:
form-data
- Request Body:
Parameter Name | Required | Type | Description |
---|---|---|---|
workspace | Yes | string | File space |
file | Yes | file | File (single) |
eponymousCover | No | bool | Whether to overwrite if a file with the same name exists (default is not to overwrite) |
- Request Example:
curl --location 'http://localhost/v1/openapi/workspace/file/upload' \
--header 'Authorization: openapi {access_token}' \
--form 'workspace="Test Space"' \
--form 'file=@"/C:/test.doc"' \
--form 'eponymousCover="false"'
- Response Body:
Parameter Name | Sub-Parameter | Type | Description |
---|---|---|---|
data | object | Response data | |
fileId | string | File ID | |
fileName | string | File name | |
uploader | string | Uploader | |
success | boolean | Whether the request was successful | |
msg | string | When success is false, this field has a value with some error messages |
- Response Example:
{
"data": {
"fileId": "4345229404125790208",
"fileName": "test.doc",
"uploader": "test@serviceme.com"
},
"success": true,
"msg": ""
}
Multiple File Upload
Submit Files
-
Endpoint:
v1/openapi/workspace/file/upload/batchSubmit
-
Request Method:
post
-
Request Header:
Parameter Name | Required | Type | Description |
---|---|---|---|
Authorization | Yes | string | Fill in the SERVICEME access token, format: openapi {access_token} |
- Content Type:
form-data
- Request Body:
Parameter Name | Required | Type | Description |
---|---|---|---|
workspace | Yes | string | File space |
files | Yes | file | Files (multiple) |
eponymousCover | No | bool | Whether to overwrite if a file with the same name exists (default is not to overwrite) |
- Request Example:
curl --location 'http://localhost/v1/openapi/workspace/file/upload/batchSubmit' \
--header 'Authorization: openapi {access_token}' \
--form 'workspace="Test Space"' \
--form 'files=@"/C:/test1.doc"' \
--form 'files=@"/C:/test2.docx"' \
--form 'eponymousCover="false"'
- Response Body:
Parameter Name | Sub-Parameter | Type | Description |
---|---|---|---|
data | object | Response data | |
stateId | string | Upload state ID, which can be used to continuously poll for the latest upload results | |
success | boolean | Whether the request was successful | |
msg | string | When success is false, this field has a value with some error messages |
- Response Example:
{
"data": {
"stateId": "4345229404125790208"
},
"success": true,
"msg": ""
}
Query Upload Results
-
Endpoint:
v1/openapi/workspace/file/upload/batchSubmit/{stateId}
-
Request Method:
get
-
Request Header:
Parameter Name | Required | Type | Description |
---|---|---|---|
Authorization | Yes | string | Fill in the SERVICEME access token, format: openapi {access_token} |
- Request URL Parameters:
Parameter Name | Required | Type | Description |
---|---|---|---|
stateId | Yes | string | The stateId field value returned by the multiple file submission upload interface |
- Request Example:
curl --location 'http://localhost/v1/openapi/workspace/file/upload/batchSubmit/4345227891722682368' \
--header 'Authorization: openapi {access_token}'
- Response Body:
Parameter Name | Sub-Parameter | Type | Description |
---|---|---|---|
data | object array | Response data | |
fileId | string | File ID | |
fileName | string | File name | |
state | string | State enumeration: underway (in queue), success (successful), fail (failed) | |
uploader | string | Uploader | |
errorMsg | string | When the state is fail, this field stores the reason for the failure | |
finishTime | string | Time when the file processing was completed | |
success | boolean | Whether the request was successful | |
msg | string | When success is false, this field has a value with some error messages |
- Response Example:
{
"data": [
{
"fileId": "4345227925730099200",
"fileName": "test1.doc",
"state": "success",
"uploader": "test@serviceme.com",
"errorMsg": "",
"finishTime": "2024-08-17T05:04:30.0128596Z"
},
{
"fileId": "4345227924266287104",
"fileName": "test2.docx",
"state": "success",
"uploader": "test@serviceme.com",
"errorMsg": "",
"finishTime": "2024-08-17T05:04:29.7952274Z"
}
],
"success": true,
"msg": ""
}
QnA Creation
-
Endpoint:
v1/openapi/workspace/qna/create
-
Request Method:
post
-
Request Header:
Parameter Name | Required | Type | Description |
---|---|---|---|
Authorization | Yes | string | Fill in the SERVICEME access token, format: openapi {access_token} |
- Request Body:
Parameter Name | Sub-Parameter | Required | Type | Description |
---|---|---|---|---|
workspace | Yes | string | File space | |
questions | Yes | string array | Question array, can be multiple | |
answer | Yes | string | Answer | |
metadatas | No | object array | Metadata | |
typeCode | Yes | string | Metadata type | |
content | Yes | string | Content |
- Request Example:
curl --location 'http://localhost/v1/openapi/workspace/qna/create' \
--header 'Content-Type: application/json' \
--header 'Authorization: openapi {access_token}' \
--data '{
"questions": [
"Test Question"
],
"answer": "Test Answer",
"workspace": "Test Space",
"metadatas": [
{
"typeCode": "Document type",
"content": "Test Metadata"
}
]
}'
- Response Body:
Parameter Name | Type | Description |
---|---|---|
success | boolean | Whether the request was successful |
msg | string | When success is false, this field has a value with some error messages |
- Response Example:
{
"success": true,
"msg": ""
}
Query Files
- **API Endpoint:** ```v1/openapi/workspace/file```
- **Request Method:** ```post```
- **Request Header:**
| Parameter Name | Required | Type | Description |
| -------------- | -------- | ------ | --------------------------------------------------------------- |
| Authorization | Yes | string | Fill in the SERVICEME access token, format: openapi `{access_token}` |
- **Request Body:**
| Parameter Name | Required | Type | Description |
| -------------- | -------- | ------ | --------------------- |
| workspace | Yes | string | File workspace |
| pageIndex | No | number | Page number, default is the first page |
| pageSize | No | number | Number of items to retrieve, default is 10 |
- **Request Example:**
```shell
curl --location 'http://localhost/v1/openapi/workspace/file' \
--header 'Content-Type: application/json' \
--header 'Authorization: ••••••' \
--data '{
"workspace": "test workspace",
"pageIndex": 1,
"pageSize": 10
}'
-
Response Body:
Parameter Name Sub-Parameter Sub-Sub-Parameter Type Description data object array Response data id string File ID name string File name size number File size in bytes description string Description fullPath string File path tags object array File tag information id string Tag ID value string Tag content chunkingState string File indexing state: waiting, success, fail, underway previewState string File preview state: waiting, success, fail, underway fileCanPreview boolean Whether the file can be previewed, true: yes; false: no previewUrl string File preview URL createdByRealName string File creator's name createdByAccount string File creator's account created datetime File creation time modifiedByRealName string File editor's name modifiedByAccount string File editor's account modified datetime File modification time success boolean Whether the request was successful msg string Error message if success is false -
Response Example:
{
"data": [
{
"id": "4339013367831199744",
"name": "test.docx",
"size": 15113,
"description": null,
"fullPath": "/",
"tags": [],
"chunkingState": "success",
"previewState": "success",
"fileCanPreview": true,
"previewUrl": "http://localhost.com/#/share/preview?fileId=4339013367831199744&objectType=2&previewType=file&mode=login",
"createdByRealName": "test",
"createdByAccount": "test",
"created": "2024-07-31T01:30:02.88",
"modifiedByRealName": "test",
"modifiedByAccount": "test",
"modified": "2024-07-31T01:30:02.88"
}
],
"pageSize": 10,
"pageIndex": 1,
"totalCount": 1,
"success": true,
"msg": ""
}
Query File Chunks
-
API Endpoint:
v1/openapi/workspace/file/chunk
-
Request Method:
post
-
Request Header:
Parameter Name | Required | Type | Description |
---|---|---|---|
Authorization | Yes | string | Fill in the SERVICEME access token, format: openapi {access_token} |
- Request Body:
Parameter Name | Required | Type | Description |
---|---|---|---|
fileId | Yes | string | File ID |
imageFormat | No | string | Image format, markdown or html, default is markdown |
pageIndex | No | number | Page number, default is the first page |
pageSize | No | number | Number of items to retrieve, default is 10 |
- Request Example:
curl --location 'http://localhost/v1/openapi/workspace/file/chunk' \
--header 'Content-Type: application/json' \
--header 'Authorization: ••••••' \
--data '{
"fileId": "4344174161665458176",
"imageFormat": "html",
"pageIndex": 1,
"pageSize": 10
}'
-
Response Body:
Parameter Name Sub-Parameter Sub-Sub-Parameter Type Description data object array Response data id string Chunk ID content string Chunk content success boolean Whether the request was successful msg string Error message if success is false -
Response Example:
{
"data": [
{
"id": "4339013367831199744",
"content": "test"
}
],
"pageSize": 10,
"pageIndex": 1,
"totalCount": 1,
"success": true,
"msg": ""
}
RAG
-
API Endpoint:
/v1/openapi/rag
-
Request Method:
post
-
Request Header:
Parameter Name | Required | Type | Description |
---|---|---|---|
Authorization | Yes | string | Fill in the SERVICEME access token, format: openapi {access_token} |
- Request Body:
Parameter Name | Type | Required | Default | Description |
---|---|---|---|---|
query | string | No | None | The question or content to be searched. Cannot be null if keywords is also null. |
keywords | string | No | None | Keywords, separated by ` |
workspaces | array | No | None | The file workspace names or IDs to be searched in this RAG. If provided, the search will be limited to these workspaces. |
ragObject | RagObject | Yes | 0 | RAG object type, enumerated values (see RagObject Enum). |
topk | number | Yes | None | Number of results to return. |
minSimilarity | double | No | 0.8 | Minimum similarity, range [0, 1] . |
metadataFilter | array | No | None | Metadata filter types to use. Currently only supports default filter. |
ragMode | SearchMode | Yes | 0 | RAG mode, enumerated values (see SearchMode Enum). |
weights | object | No | None | RRF weights for various indexes, only effective when RagMode is Hybrid . If null, default weights will be used. |
reranker | string | No | None | If null, reranker will not be used. |
- Request Example:
curl --location 'http://localhost/v1/openapi/rag' \
--header 'Authorization: ••••••' \
--header 'Content-Type: application/json' \
--data '{
"query": "What is artificial intelligence?",
"keywords": "AI|machine learning",
"workspaces": ["workspace1", "workspace2"],
"ragObject": 2,
"topk": 3,
"minSimilarity": 0.85,
"metadataFilter": ["default"],
"ragMode": 0,
"weights": {
"Embedding": 0.9,
"FullText": 0.8
},
"reranker": "default"
} '
- Response Body:
Field Name | Type | Description |
---|---|---|
data | object | Response data object, containing search results and search ID information. |
data.results | array | List of search results, each element is an object containing chunk information. |
data.results[].chunkId | string | Chunk ID |
data.results[].fileId | string | File ID to which the chunk belongs |
data.results[].fileName | string | File name to which the chunk belongs |
data.results[].content | string | Chunk content |
data.results[].metadata | json | Chunk metadata |
data.results[].url | string | URL address of the chunk (if any) |
data.results[].searchScore | double | Similarity score |
data.results[].rrfScore | double | RRF score |
data.results[].rerankScore | double | Re-rank score |
data.results[].workspaceId | string | Workspace ID to which the file belongs |
data.results[].workspaceName | string | Workspace name to which the file belongs |
data.searchId | string | Unique identifier for this search operation |
success | boolean | Whether the request was successful |
msg | string | Message returned by the request (if any) |
- Response Example:
{
"data": {
"results": [
{
"chunkId": "4422442085118906369",
"fileId": "4417076017114382336",
"fileName": "file1.pdf",
"content": "...",
"metadata": {
"Url": "https://...",
"FileName": "file1.pdf",
"WorkspaceName": "workspace1",
"FileId": "4417076017114382336",
"FilePath": "/",
"Created": "2025-03-03T11:23:08.803",
"Size": "1160594"
},
"url": "https://...",
"searchScore": 0.153852914388501,
"rrfScore": 0.8768274796195331,
"rerankScore": 0.0,
"workspaceId": "4417069258022846464",
"workspaceName": ""
},
{
"chunkId": "4422442085114712073",
"fileId": "4417076017114382336",
"fileName": "file1.pdf",
"content": "...",
"metadata": {
"Url": "https://...",
"FileName": "file1.pdf",
"WorkspaceName": "workspace1",
"FileId": "4417076017114382336",
"FilePath": "/",
"Created": "2025-03-03T11:23:08.803",
"Size": "1160594"
},
"url": "https://...",
"searchScore": 0.152822583517241,
"rrfScore": 0.8670604574184315,
"rerankScore": 0.0,
"workspaceId": "4417069258022846464",
"workspaceName": ""
},
{
"chunkId": "4422442085114712071",
"fileId": "4417076017114382336",
"fileName": "file1.pdf",
"content": "...",
"metadata": {
"Url": "...",
"FileName": "file1.pdf",
"WorkspaceName": "workspace1",
"FileId": "4417076017114382336",
"FilePath": "/",
"Created": "2025-03-03T11:23:08.803",
"Size": "1160594"
},
"url": "...",
"searchScore": 0.153708375384407,
"rrfScore": 0.8661891817471927,
"rerankScore": 0.0,
"workspaceId": "4417069258022846464",
"workspaceName": ""
}
],
"searchId": "4423568945336811520"
},
"success": true,
"msg": ""
}
- Enumeration Types
RagObject Enumeration
Enumeration Value | Enumeration Number | Description |
---|---|---|
Both | 0 | Retrieve both Q&A and document content. |
Qna | 1 | Retrieve only Q&A content. |
Doc | 2 | Retrieve only document content. |
SearchMode Enumeration
Enumeration Value | Enumeration Number | Description |
---|---|---|
Hybrid | 0 | Hybrid search mode, combining embedding vectors and full-text search. |
Embedding | 1 | Search mode based only on embedding vectors. |
FullText | 2 | Search mode based only on full-text search. |