Cognitive Search API
Cognitive Search API makes it possible for the system to read, infer meaning, and deliver precise answers from large sets of documents with high accuracy.

[Notice] Parameter Deprecation on 12/9/2021

Due to technical changes made to the preview feature, we will deprecate the below parameters from webapi/mrc endpoint on 12/9/2021.
Parameters to be deprecated: returnPreview (request), body (response), css (response)

Uploading Q&A and Documents

Please sign up and sign in to the Alli dashboard first. You must select 'Cognitive Search' for the Project Type when you sign up. Go to the Q&A tab on the dashboard to upload question-answer pairs. If you want to upload unstructured text data such as Word, PDF, Powerpoint, and Excel file, go to the Documents tab in the dashboard and upload the documents.
If you want to automatically sync with your data source, such as MS OneDrive, please go to the Source tab. Uploading the document via API is in the Upload Document section in this page.

Getting the API KEY

Please provide your API key in the request header API-KEY. Your API key can be found in your dashboard Settings menu, under the General tab.

Providing Agent or User Information

For certain endpoints, you can add agent or user information in the request header to specify who makes the call.
Agent information can be provided in the request header AGENT-EMAIL. You can find your agents' email information in your dashboard Settings > Agent menu. Below is an example.
1
-H 'AGENT-EMAIL: [email protected]'
Copied!
A user ID can be provided in the request header OWN-USER-ID. The user ID can be either a new one or an existing one, and if a new user ID is provided, Alli will create a new user with that ID. Any future API calls with the same OWN-USER-ID header will be considered as they're from the same user.
If you want to update the user's email address at the same time, you can provide the email address in the request header USER-EMAIL. Below is an example.
1
-H 'OWN-USER-ID: 5f1234567a409876c082487z' \
2
-H 'USER-EMAIL: [email protected]'
Copied!
You cannot use non-ASCII characters for OWN-USER-ID. If the user ID includes any non-ASCII characters, you can encode the ID to base64 and use base64:CONVERTED_ID.
You can find saved user ID and email information in your Alli dashboard Customers menu.

Error Messages

Please read the error message you get if you don't get the response that you expected. For example, if you don't use the right HTTP method for the API, you'll get this type of error as response:
1
{“error”: “Method Not Allowed POST: /webapi/faq_feedbacks”}
Copied!
post
https://backend.alli.ai
/webapi/faq
Search from Q&A

Request Example

Please replace YOUR_API_KEY with your one in the example below. Please see getting-api-key section.
1
curl -d '{
2
"query": "How much is it?",
3
"maxResults": 3,
4
"hashtags": ["wiki", "knowledge"],
5
"hashtagsOperator": "OR",
6
"format": "text"}' \
7
-H 'API-KEY: YOUR API KEY' \
8
-H 'Content-Type: application/json' \
9
https://backend.alli.ai/webapi/faq
Copied!

Response Example

1
{"result":
2
[
3
{
4
"confidence": 0.8371959004827834,
5
"effectiveConfidence": 0.9698303406362148,
6
"question": "How is the product priced?",
7
"answer": "We have a pricing table that includes a free plan.",
8
"id": "ClMVIjCoNDAiZDLyNWZhM1O3YTUIIKZjPPRcER==",
9
"hashtags": [],
10
"lastUpdatedDate": "2020-11-19",
11
"agentFeedback": {
12
"positiveCount": 1,
13
"negativeCount": 0
14
},
15
"userFeedback": {
16
"positiveCount": 1,
17
"negativeCount": 0
18
}
19
},
20
{
21
"confidence": 0.6119840535714456,
22
"effectiveConfidence": 0.7738889000171243,
23
"question": "Do you have a pricing table?",
24
"answer": "Yes we do. Please check out our website",
25
"id": "RkFROjVmNDAwZDMyNWZhM2Y4YTA1ZDZjNWUwMQ==",
26
"hashtags": [],
27
"lastUpdatedDate": "2020-11-20",
28
"agentFeedback": {
29
"positiveCount": 1,
30
"negativeCount": 0
31
},
32
"userFeedback": {
33
"positiveCount": 1,
34
"negativeCount": 0
35
}
36
],
37
"count": 2,
38
"hashId": "d4ca12d4e64766er0c2b45f4aa5463a4"
39
}
Copied!
post
https://backend.alli.ai
/webapi/mrc
Search from Documents

Request Example

Please replace YOUR_API_KEY with your one in the example below. Please see getting-api-key section.
1
curl -d '{
2
"query": "can I disclose the composite ratings?",
3
"maxResults": 3,
4
"hashtags": ["wiki", "knowledge"],
5
"hashtagsOperator": "OR",
6
"format": "text",
7
"returnPreview": true}' \
8
-H 'API-KEY: YOUR API KEY' \
9
-H 'Content-Type: application/json' \
10
https://backend.alli.ai/webapi/mrc
Copied!

Response Example

1
{
2
"count": 2,
3
"result": [
4
{
5
"answer": "an institution’s board of directors and senior management",
6
"answerHash": "8430cf3b9af628abc1bb063802db39be",
7
"confidence": 0.9998937845230103,
8
"effectiveConfidence": 1,
9
"documentId": "S25vd2xlZGdlQmFzZTo1ZjMzODFkZmNhYWJjYWUyMjkzYjFhY2U=",
10
"documentName": "Policy document 1.docx",
11
"hashtags": [
12
"hashtag1",
13
"hashtag2"
14
],
15
"pageNo": 5,
16
"createdDate": "2020-11-18",
17
"agentFeedback": {
18
"positiveCount": 1,
19
"negativeCount": 0
20
},
21
"userFeedback": {
22
"positiveCount": 0,
23
"negativeCount": 0
24
},
25
"body": "PREVIEW_HTML_BODY1",
26
"css": "PREVIEW_CSS1"
27
},
28
{
29
"answer": "banks cannot, except in very limited circumstances",
30
"answerHash": "d849a49662a4f21df51de24d06196547",
31
"confidence": 0.9998629689216614,
32
"effectiveConfidence": 0.9998629689216614,
33
"documentId": "S25vd2xlZGdlQmFzZTo1ZjMzODFkZmNhYWJjYWUyMjkzYjFhY2U=",
34
"documentName": "Bank policy 2020.pdf",
35
"hashtags": [
36
"hashtag1",
37
"hashtag2"
38
],
39
"pageNo": 220,
40
"createdDate": "2020-11-18",
41
"agentFeedback": {
42
"positiveCount": 1,
43
"negativeCount": 0
44
},
45
"userFeedback": {
46
"positiveCount": 0,
47
"negativeCount": 0
48
},
49
"body": "PREVIEW_HTML_BODY2",
50
"css": "PREVIEW_CSS2"
51
}
52
]
53
}
Copied!
get
https://backend.alli.ai
/webapi/single_faq
Get Single Q&A

Request Example

Please replace YOUR_API_KEY with your one in the example below. Please see getting-api-key section to get the api key.
1
curl -X GET \
2
-d '{"id": "iuHjHBhjHGbhjm==", "format": "text"}' \
3
-H "API-KEY: YOUR API KEY" \
4
https://backend.alli.ai/webapi/single_faq
Copied!

Response Example

1
{
2
"result": {
3
"question": "Who is there?",
4
"answer": "Elmo",
5
"id": "RkFROjYwMmY2ZTQ0YWZmMWQ5YmQ0NmM5Y2VkNw==",
6
"userFeedback": {
7
"positiveCount": 0,
8
"negativeCount": 0
9
},
10
"agentFeedback": {
11
"positiveCount": 0,
12
"negativeCount": 1
13
},
14
"lastUpdatedDate": "2021-02-19",
15
"createdDate": "2021-02-19",
16
"hashtags": []
17
}
18
}
Copied!
get
https://backend.alli.ai
/webapi/single_document
Get Single Document

Request Example

Please replace YOUR_API_KEY with your one in the example below. Please see getting-api-key section to get the api key.
1
curl -X GET \
2
-d '{"id": "S25vd2xlZGdlQmFzZTo1ZjMzODFkZmNhYWJjYWUyMjkzYjFhY2U="}' \
3
-H "API-KEY: YOUR API KEY" \
4
https://backend.alli.ai/webapi/single_document
Copied!

Response Example

1
{"result": {
2
"id": "S25vd2xlZGdlQmFzZTo1ZjMzODFkZmNhYWJjYWUyMjkzYjFhY2U=",
3
"documentName": "Policy document 1.docx",
4
"createdDate": "2020-11-12",
5
"agentFeedback": {
6
"positiveCount": 1,
7
"negativeCount": 0
8
},
9
"userFeedback": {
10
"positiveCount": 0,
11
"negativeCount": 0
12
},
13
"hashtags" : ["hashtag1", "hashtag2"]
14
}
15
}
Copied!
get
https://backend.alli.ai
/webapi/faq_feedbacks
Q&A Feedbacks

Request Example

Please replace YOUR_API_KEY with your one in the example below. Please see getting-api-key section to get the api key.
1
curl -X GET \
2
-d '{"offset": 0, "limit": 10}' \
3
-H "API-KEY: YOUR API KEY" \
4
https://backend.alli.ai/webapi/faq_feedbacks
Copied!

Response Example

1
{
2
"result": [
3
{
4
"query": "where is the office?",
5
"feedbacks": [
6
{
7
"faqId": "RkFROjVmNDA1MWVkMTFmOWJjMTJjOGUwMTg5YQ==",
8
"positive": true
9
},
10
{
11
"faqId": "RkFROjVmNDA1MWVkMTFmOWJjMTJjOGUwMThhNA==",
12
"positive": false
13
},
14
{
15
"faqId": "RkFROjVmNDA1MWVjMTFmOWJjMTJjOGUwMTgyYw==",
16
"positive": true
17
}
18
]
19
},
20
{
21
"query": "Are you funded?",
22
"feedbacks": [
23
{
24
"faqId": "RkFROjVmNDA1MWVjMTFmOWJjMTJjOGUwMTgyNw==",
25
"positive": true
26
}
27
]
28
}
29
],
30
"count": 4
31
}
Copied!
post
https://backend.alli.ai
/webapi/faq_feedback
Q&A Feedback

Request Example

Please replace YOUR_API_KEY with your one in the example below. Please see getting-api-key section to get the api key.
Please replace Q&A_ID accordingly. About getting Q&A_ID, please take a look at Search from Q&A or Q&A Feedbacks section. It's id in Response Example of Search from Q&A section, or faq_id in Response Example of Q&A Feedbacks.
1
curl https://backend.alli.ai/webapi/faq_feedback \
2
-d '{"query": "What do I do if I didn't get a receipt?",
3
"id": "Q&A_ID",
4
"isPositive": true}' \
5
-H "API-KEY: YOUR API KEY" \
6
-H "Content-Type: application/json"
Copied!

Response Example

1
{
2
"result": {
3
"faqTrainSearchResult": {
4
"faq": {
5
"id": "RkFROjVlOTc5MWExMjM5NjFiNzYzOTcxMWI1Mg=="
6
},
7
"agentFeedback": {
8
"positiveCount": 1,
9
"negativeCount": 0
10
}
11
}
12
},
13
"errors": null
14
}
Copied!
post
https://backend.alli.ai
/webapi/faq/user_feedback
Q&A User Feedback

Request Example

1
curl https://backend.alli.ai/webapi/faq/user_feedback \
2
-H 'API-KEY: YOUR_API_KEY' \
3
-H "Content-Type: application/json" \
4
-d '{
5
"query": "QUERY",
6
"prev": PREVIOUSLY_ASSIGNED_FEEDBACK,
7
"id": "FAQ_ID",
8
"positive": true
9
}'
Copied!

Response Example

1
{
2
"result": {
3
"userFeedback": {
4
"positiveCount": 1,
5
"negativeCount": 0
6
}
7
}
8
}
Copied!
post
https://backend.alli.ai
/webapi/upload_faq_file
Upload Q&As

Request Example

Please replace YOUR_API_KEY with your one in the example below. To get the api key, please see getting-api-key section.
1
curl -F '[email protected]/location/to/your_file' \
2
-H 'API-KEY: YOUR_API_KEY'
3
https://backend.alli.ai/webapi/upload_faq_file
Copied!

Response Example

1
{
2
"result": "success",
3
"notUploaded": [
4
{
5
"question": "How to teach AI",
6
"state": "dup"
7
},
8
{
9
"question": "I'd like to schedule a meeting or a demo.",
10
"state": "up"
11
}
12
]
13
}
Copied!
post
https://backend.alli.ai
/webapi/register_faq
Add Q&A

Request Example

Please replace YOUR_API_KEY with your one in the example below. To get the api key, please see getting-api-key section.
1
curl 'https://backend.alli.ai/webapi/register_faq' \
2
-H 'API-KEY: YOUR_API_KEY' \
3
-H 'Content-Type: application/json' \
4
-d '{
5
"status": "ON",
6
"question": "Where is the office?",
7
"similarQuestions": ["Office location?", "Office address?"],
8
"answer": "We have offices in Oakland(US), Seoul(Korea), and Tokyo(Japan)",
9
"hashtags": ["office", "location"],
10
"memo": "Added by api"
11
}'
Copied!

Response Example

1
{
2
"result": {
3
"status": "created",
4
"id": "RkFROkYwYRQxYzIzMDcxYWM5M3JlOWR5Y2EeOQ=="
5
},
6
"errors": null
7
}
Copied!
post
https://backend.alli.ai
/webapi/delete_faq
Delete Q&A

Request Example

Please replace YOUR_API_KEY with your one in the example below. To get the api key, please see getting-api-key section.
1
curl 'https://backend.alli.ai/webapi/delete_faq' \
2
-H 'API-KEY: YOUR_API_KEY' \
3
-H 'Content-Type: application/json' \
4
-d {
5
"id": "RkFROkYwYRQxYzIzMDcxYWM5M3JlOWR5Y2EeOQ=="
6
}
Copied!

Response Example

1
{
2
"result": {
3
"status": "deleted"
4
},
5
"errors": null
6
}
Copied!
get
https://backend.alli.ai
/webapi/faqs
List Q&As

Request Example

Please replace YOUR_API_KEY with your one in the example below. To get the api key, please see getting-api-key section.
1
curl -X GET 'https://backend.alli.ai/webapi/faqs' \
2
-H 'API-KEY: YOUR_API_KEY' \
3
-H 'Content-Type: application/json' \
4
-d '{
5
"searchTerm": "Allganize",
6
"isUsed": true,
7
"hashtags": ["company", "Alli"],
8
"hashtagsOperator": "OR",
9
"createdByAgent": true,
10
"answeredByMrc": true,
11
"autoGenerated": false,
12
"editedByAgent": false,
13
"format": "text",
14
"offset": 0,
15
"limit": 10
16
}'
Copied!

Response Example

1
{
2
"offset": 0,
3
"count": 2,
4
"totalCount": 2,
5
"results": [
6
{
7
"id": "RkRODjYwUIr2YTUzYTc0MjNmMDgxOTFkZTRlNA==",
8
"question": "How many people work at Allganize?",
9
"answer": "Currently (Nov 2019), we have 16 employees working at three different locations.",
10
"hashtags": [
11
"company",
12
"actual"
13
],
14
"userFeedback": {
15
"positiveCount": 0,
16
"negativeCount": 0
17
},
18
"agentFeedback": {
19
"positiveCount": 0,
20
"negativeCount": 0
21
},
22
"lastUpdatedDate": "2021-05-04",
23
"createdDate": "2021-02-23"
24
},
25
{
26
"id": "RkFROjYwIdU4YTUzYTc0MjNmUR2wOTFkZTU1OA==",
27
"question": "Do you have any references or case studies?",
28
"answer": "We do! Check out our recent case studies and other articles on our blog: https://blog.allganize.ai/",
29
"hashtags": [
30
"company",
31
"actual"
32
],
33
"userFeedback": {
34
"positiveCount": 0,
35
"negativeCount": 0
36
},
37
"agentFeedback": {
38
"positiveCount": 0,
39
"negativeCount": 0
40
},
41
"lastUpdatedDate": "2021-05-04",
42
"createdDate": "2021-02-23"
43
}
44
]
45
}
Copied!
get
https://backend.alli.ai
/webapi/faq_candidates
Q&A Candidates

Request Example

Please replace YOUR_API_KEY with your one in the example below. To get the api key, please see getting-api-key section.
1
curl -X GET \
2
-d '{ "hashtags": ["wiki"],
3
"searchTerm": "user",
4
"order": "FREQUENCY_DESC",
5
"state": "ALL",
6
"offset": 0,
7
"limit": 10}' \
8
-H "API-KEY: YOUR API KEY" \
9
https://backend.alli.ai/webapi/faq_candidates
Copied!

Response Example

1
{
2
"result": {
3
"faqCandidates": [
4
{
5
"id": "RkFRQ2FuZGlkYXRlOjVlYjA3OGU5MGFmZmMyM2QxZjc4ZTMzMQ==",
6
"frequency": 1,
7
"textAnswer": "This is how to use it, A from Z.\n— From User Guide.pdf",
8
"state": "ACTIVE",
9
"createdAt": 1588623593321,
10
"questions": [{
11
"id": "RkFRQ2FuZGlkYXRlUXVlc3Rpb246NWViMDc4ZTkwYWZmYzIzZDFmNzhlMzMw",
12
"question": "User manual?",
13
"frequency": 1,
14
"history": {
15
"id": "Q29udmVyc2F0aW9uOjVlYjA3OGI2NWUyMTJlMTMzZDM4NDAzOA=="
16
}
17
}]
18
},
19
{
20
"id": "RkFRQ2FuZGlkYXRlOjVlOWEzZWI2MmZlOTFkMzIwYjE2YWQyOQ==",
21
"frequency": 1,
22
"textAnswer": "You can cancel the policy in 15 days\n— From UserPolicy.pdf",
23
"state": "ACTIVE",
24
"createdAt": 1587166902114,
25
"questions": [{
26
"id": "RkFRQ2FuZGlkYXRlUXVlc3Rpb246NWU5YTNlYjYyZmU5MWQzMjBiMTZhZDI4",
27
"question": "Can I cancel?",
28
"frequency": 1,
29
"history": {
30
"id": "Q29udmVyc2F0aW9uOjVlOWEzZDliNjU5YmM2NTEyMTk5MDQ3Ng=="
31
}
32
}]
33
}
34
],
35
"count": 1
36
},
37
"errors": null
38
}
Copied!
post
https://backend.alli.ai
/webapi/add_faq_candidates
Q&A Candidates

Request Example

Please replace YOUR_API_KEY with your one in the example below. To get the api key, please see getting-api-key section.
1
curl https://backend.alli.ai/webapi/add_faq_candidates \
2
-d '{"queries": ["what is that processor", "how much does the processor cost"]}' \
3
-H "Content-Type: application/json" \
4
-H "API-KEY: YOUR_API_KEY"
Copied!

Response Example

1
{
2
"result": {
3
"candidates": [
4
{
5
"id": "RkFRQ2FuZGlkYXRlOjVmOGE1ZDA0ODgxNzc0OWNjMWUwMzRiNg=="
6
},
7
{
8
"id": "iGBiuGIGIugBIGBIugBIuBGiHBiJUhbhIBgIbKHJBJCYUBLHKGJfBJbIb=="
9
}
10
]
11
},
12
"errors": null
13
}
Copied!
get
https://backend.alli.ai
/webapi/mrc_feedbacks
Documents Feedbacks

Request Example

Please replace YOUR_API_KEY with your one in the example below. To get the api key, please see getting-api-key section.
1
curl -X GET \
2
-d '{"offset": 0, "limit": 10}' \
3
-H "API-KEY: YOUR API KEY" \
4
https://backend.alli.ai/webapi/mrc_feedbacks
Copied!

Response Example

1
{
2
"result": [
3
{
4
"query": "cancel the policy",
5
"feedbacks": [
6
{
7
"documentId": "S25vd2xlZGdlQmFzZTo1ZWM1YmJiZTczNmUxNmM0NDRjZDI2ZGM=",
8
"answer": "You can cancel the policy in 30 days.",
9
"answerHash": "44094c4a281484daadf28e67a4745747",
10
"positive": true
11
},
12
{
13
"documentId": "S25vd2xlZGdlQmFzZTo1ZWM1YmJiZTczNmUxNmM0NDRjZDI2ZGM=",
14
"answer": "This is how you enroll the policy.",
15
"answerHash": "296ffa9691166c583b00365fb6839a06",
16
"positive": false
17
},
18
{
19
"documentId": "S25vd2xlZGdlQmFzZTo1ZWM1YmJiZTczNmUxNmM0NDRjZDI2ZGM=",
20
"answer": "You cannot get refunded upon cancelation after 30 days.",
21
"answerHash": "48e5273910c913dbf0fc08482f7cd22c",
22
"positive": true
23
}
24
]
25
}
26
],
27
"count": 3
28
}
Copied!
post
https://backend.alli.ai
/webapi/mrc_feedback
Documents Search Feedback

Request Example

Please replace YOUR_API_KEY with your one in the example below. To get the api key, please see getting-api-key section. Please replace DOCUMENT_ID and ANSWER_HASH accordingly. About getting document id and answer hash, please take a look at Search from Documents or Documents Feedbacks section.
1
curl https://backend.alli.ai/webapi/mrc_feedback \
2
-d '{"query": "what is that processor",
3
"id": "DOCUMENT_ID",
4
"answerHash": "ANSWER_HASH",
5
"isPositive": false}' \
6
-H "Content-Type: application/json" \
7
-H "API-KEY: YOUR_API_KEY"
Copied!

Response Example

1
{
2
"result": {
3
"mrcFeedbackSearchResult": {
4
"agentFeedback": {
5
"positiveCount": 0,
6
"negativeCount": 1
7
}
8
}
9
},
10
"errors": null
11
}
Copied!
post
https://backend.alli.ai
/webapi/mrc/user_feedback
Documents Search User Feedback

Request Example

1
curl -request POST 'https://backend.alli.ai/webapi/mrc/user_feedback' \
2
--header 'API-KEY: YOUR_API_KEY' \
3
-d '{
4
"query": "QUERY",
5
"answer": "RECEIVED_ANSWER",
6
"answerHash": "RESULT_ID",
7
"id": "DOCUMENT_ID",
8
"positive": true
9
}'
Copied!

Response Example

1
{
2
"result": {
3
"userFeedback": {
4
"positiveCount": 1,
5
"negativeCount": 0
6
}
7
}
8
}
Copied!
post
https://backend.alli.ai
/webapi/upload_file
Upload Documents

Request Example

Please replace [email protected]/location/to/your_file with the location and the name of the file you are uploading, and YOUR_HASH_TAG with the hashtag you want to add to the file. Also, please replace YOUR_API_KEY with your actual API key. To get the api key, please see getting-api-key section.
1
curl -F '[email protected]"/location/to/your_file"' \
2
-F 'hashtags="[\"api1\", \"api2\"]"' \
3
-F 'footerUrl="www.allganize.ai"' \
4
-F 'footerTitle="Allganize website"' \
5
-H 'API-KEY: YOUR_API_KEY' https://backend.alli.ai/webapi/upload_file
Copied!

Response Example

1
{
2
"result": {
3
"id": "S25vd2xlZGdlQmA23To2MGJjIsjA1YjM1Nz9iRc1YWIzYjA1ODk=",
4
"fileName": "policy.docx",
5
"hashtags": [
6
"api1",
7
"api2"
8
],
9
"footer": "{\"blocks\": [{\"key\": \"oio7\", \"text\": \"— From ocr_en.png\", \"type\": \"unstyled\", \"depth\": 0, \"inlineStyleRanges\": [{\"offset\": 0, \"length\": 17, \"style\": \"ITALIC\"}], \"entityRanges\": [{\"offset\": 7, \"length\": 10, \"key\": 0}], \"data\": {}}], \"entityMap\": {\"0\": {\"type\": \"LINK\", \"mutability\": \"MUTABLE\", \"data\": {\"url\": \"https://download.alli.ai/download_document/UHJvamUiddDo1ZGMxYmI1qwe0ZTk0YWNmMmY5MjRlMzU=/S12vd2xlZGdlQmFzZTo2MGJijef1YjM1Nzc4NTc1YWIzYjA1ODk=\"}}}}"
10
}
11
}                                                                                                           
Copied!
post
https://backend.alli.ai
/webapi/upload_from_s3
Upload Documents from S3

Request Example

Please replace YOUR_API_KEY with your one in the example below. To get the api key, please see getting-api-key section.
1
curl https://backend.alli.ai/webapi/upload_from_s3 -d '{
2
"path": "s3://YOUR_S3_FILE_PATH",
3
"secretKey": "YOUR_SECRET_KEY",
4
"accessKey": “YOUR_ACCESS_KEY",
5
"bucket": "YOUR_BUCKET_NAME",
6
"hashtags": ["HASHTAG_1", "HASHTAG_2"],
7
"footerTitle": "Allganize API documentation",
8
"footerUrl": "docs.allganize.ai"}' \
9
-H "Content-Type: application/json" \
10
-H "API-KEY: YOUR_API_KEY"
Copied!

Response Example

1
{
2
"result": {
3
"id": "S25vd2xlZGdlQmA23To2MGJjIsjA1YjM1Nz9iRc1YWIzYjA1ODk=",
4
"fileName": "policy.docx",
5
"hashtags": [
6
"api1",
7
"api2"
8
],
9
"footer": "{\"blocks\": [{\"key\": \"oio7\", \"text\": \"— From ocr_en.png\", \"type\": \"unstyled\", \"depth\": 0, \"inlineStyleRanges\": [{\"offset\": 0, \"length\": 17, \"style\": \"ITALIC\"}], \"entityRanges\": [{\"offset\": 7, \"length\": 10, \"key\": 0}], \"data\": {}}], \"entityMap\": {\"0\": {\"type\": \"LINK\", \"mutability\": \"MUTABLE\", \"data\": {\"url\": \"https://download.alli.ai/download_document/UHJvamUiddDo1ZGMxYmI1qwe0ZTk0YWNmMmY5MjRlMzU=/S12vd2xlZGdlQmFzZTo2MGJijef1YjM1Nzc4NTc1YWIzYjA1ODk=\"}}}}"
10
}
11
}
Copied!
get
https://backend.alli.ai
/webapi/check_file_status
Check Document Status

Request Example

Please replace YOUR_API_KEY to your one in the example below. To get the api key, please see getting-api-key section. Please replace DOCUMENT_ID accordingly as well. About getting document id, please take a look at Search from Documents or the Documents Feedbacks section.
1
curl -X GET https://backend.alli.ai/webapi/check_file_status \
2
-d '{"id": "DOCUMENT_ID"}' \
3
-H "API-KEY: YOUR_API_KEY" \
4
-H "Content-Type: application/json"
Copied!

Response Example

1
{"result":
2
{"id": "S25vd2xlZGdlQmFzZTo1ZWM1YmJiZTczNmUxNmM0NDRjZDI2ZGM",
3
"status": "initializing"}}
Copied!
Status contains one of the following values.
1
'initializing : preparing for the processing or waiting
2
'converting': converting the files
3
'conversion_complete'
4
'conversion_fail'
5
'parsing': parsing for retrievers
6
'parsing_fail'
7
'completed': parsing and embedding are done
Copied!
post
https://backend.alli.ai
/webapi/delete_file
Delete Documents

Request Example

Please replace YOUR_API_KEY with your one in the example below. To get the api key, please see getting-api-key section. Please replace DOCUMENT_ID accordingly as well. About getting document id, please take a look at Search from Documents or Documents Feedbacks section.
1
curl -d '{"ids": ["DOCUMENT_ID"]}' \
2
-H "API-KEY: YOUR_API_KEY" \
3
-H "Content-Type: application/json" \
4
https://backend.alli.ai/webapi/delete_file
Copied!

Response Example

1
{
2
"result": {
3
"ok": true,
4
},
5
"errors": null
6
}
Copied!
get
https://backend.alli.ai
/webapi/knowledge_bases
List Documents

Request Example

Please replace YOUR_API_KEY with your one in the example below. To get the api key, please see getting-api-key section.
1
curl -X GET -d '{"status": true,
2
"offset": 0,
3
"limit": 10,
4
"order": "FILE_NAME_ASC",
5
"searchTerm": "term1 OR term2"
6
"hashtags": ["policy", "insurance"],
7
"hashtagsSearchOperator": "OR"}' \
8
-H 'API-KEY: YOUR_API_KEY' \
9
https://backend.alli.ai/webapi/knowledge_bases
Copied!
You can use one of the following values for the order parameter.
Value
Description
FILE_NAME_ASC
Ascending order by file name.
FILE_NAME_DESC
Descending order by file name.
TYPE_ASC
Ascending order by file type.
TYPE_DESC
Descending order by file type.
STATUS_ASC
Ascending order by on/off status.
STATUS_DESC
Descending order by on/off status.
CREATED_AT_ASC
Ascending order by uploaded date&time.
CREATED_AT_DESC
Descending order by uploaded date&time.

Response Example

1
{
2
"result": {
3
"items": [
4
{
5
"id": "S23wd2xlZGdlQmRzZTo1ZmFmMzYwZ3IyYjliMTI2OTAyMWVmMDQ=",
6
"fileName": "policy1.docx",
7
"hashtags": ["policy"]
8
},
9
{
10
"id": "S75vd2elZGdlQmFzZTo1ZmFlMjdhYmMx22E3MWM1MzA0NDI3ZWQ=",
11
"fileName": "insurance_policy.pdf",
12
"hashtags": ["policy", "insurance"]
13
}
14
]
15
},
16
"errors": null
17
}
Copied!
post
https://backend.alli.ai
/webapi/update_kb_name
Rename Documents (Knowledge Base)

Request Example

Please replace YOUR_API_KEY with your one in the example below. To get the api key, please see getting-api-key section. Please replace DOCUMENT_ID accordingly as well. About getting document id, please take a look at Search from Documents or Documents Feedbacks section.
1
curl -L -X POST 'https://backend.alli.ai/webapi/update_kb_name' \
2
-H 'Content-Type: application/json' \
3
-H 'API-KEY: YOUR_API_KEY' \
4
--data-raw '{"id": "DOCUMENT_ID", "filename": "FILENAME"}'
Copied!

Response Example

1
{
2
"result": {
3
"id": "DOCUMENT_ID",
4
"filename": "policy.docx"
5
}
6
}
Copied!
post
https://backend.alli.ai
/webapi/update_document
Update Documents

Request Example

Please replace YOUR_API_KEY with your one in the example below. To get the api key, please see getting-api-key section. Please replace DOCUMENT_ID accordingly as well. About getting document id, please take a look at Search from Documents or Documents Feedbacks section.
1
curl -L -X POST 'https://backend.alli.ai/webapi/update_document' \
2
-H 'Content-Type: application/json' \
3
-H 'API-KEY: YOUR_API_KEY' \
4
-d '{
5
"hashtags": ["hashtag1", "hashtag2"],
6
"id": "DOCUMENT_ID",
7
"footerTitle": "Allganize API documentation",
8
"footerUrl": "docs.allganize.ai"
9
}'
Copied!

Response Example

1
{
2
"result": {
3
"knowledgeBase": {
4
"id": "S25vd1iuRGdlQmFzZTo2MGJhYjQzERHjYTNiNWE0PLD3MDk1YTg=",
5
"hashtags": [
6
"hashtag1",
7
"hashtag2"
8
],
9
"footer": "{\"blocks\": [{\"key\": \"qn8p\", \"text\": \"— From Allganize API documentation\", \"type\": \"unstyled\", \"depth\": 0, \"inlineStyleRanges\": [], \"entityRanges\": [{\"offset\": 7, \"length\": 27, \"key\": 0}], \"data\": {}}], \"entityMap\": {\"0\": {\"type\": \"LINK\", \"mutability\": \"MUTABLE\", \"data\": {\"url\": \"docs.allganize.ai\"}}}}"
10
}
11
},
12
"errors": null
13
}
Copied!
post
https://backend.alli.ai
/webapi/toggle_documents
Knowledge Base Toggle Status

Request Example

1
curl -X 'POST'
2
-H 'API-KEY: YOUR_API_KEY'
3
-d '{
4
"ids":[YOUR_FIRST_DOCUMENT_ID,
5
YOUR_SECOND_DOCUMENT_ID, ETC],
6
"use": true
7
}'
8
https://backend.alli.ai/webapi/toggle_documents
Copied!

Response Example

1
{
2
"result": {
3
"knowledgeBases": [
4
{
5
"id": "YOUR_FIRST_DOCUMENT_ID",
6
"status": true
7
},
8
{
9
"id": "YOUR_SECOND_DOCUMENT_ID",
10
"status": false
11
}
12
]
13
},
14
"errors": null
15
}
Copied!
post
https://backend.alli.ai
/webapi/kb_auto_hashtag
Knowledge Base Auto Hashtag (Classification)

Request Example

Please replace YOUR_API_KEY with your one in the example below. To get the api key, please see getting-api-key section. Please replace DOCUMENT_ID accordingly as well. About getting document id, please take a look at Search from Documents or Documents Feedbacks section.
1
curl -X POST -d '{"ids": ["DOCUMENT_ID"]}' \
2
-H 'API-KEY: YOUR_API_KEY' \
3
https://backend.alli.ai/webapi/kb_auto_hashtag
Copied!

Response Example

1
{
2
"result": {
3
"updated": [
4
{
5
"id": "S25vd2xlZGdlQmFzZTo1ZmY3Y2U0YzZiNzk4MjM0YTAwNGRkNGE=",
6
"autoHashtags": [
7
{
8
"id": "S25vd2xlZGdlQmFzZUF1dG9IYXNodGFnOjVmZmRmMDg5ZmMzYjUwNjJlY2ZlZWIzOA==",
9
"state": "SUGGESTED",
10
"bestConfidence": 0.9866862297058105,
11
"autoHashtag": {
12
"hashtag": "CLASSIFICATION_RESULT"
13
}
14
},
15
{
16
"id": "S25vd2xlZGdlQmFzZUF1dG9IYXNodGFnOjVmZmUwMWFmZTcwZGYzMGUwYzQ2NTQ3Yg==",
17
"state": "SUGGESTED",
18
"bestConfidence": 0.9445914626121521,
19
"autoHashtag": {
20
"hashtag": "CLASSIFICATION_RESULT"
21
}
22
}
23
]
24
}
25
]
26
},
27
"errors": null
28
}
Copied!
post
https://backend.alli.ai
/webapi/kb_auto_hashtag_feedback
Knowledge Base Auto Hashtag Feedback (Classification)

Request Example

Please replace YOUR_API_KEY with your one in the example below. To get the api key, please see getting-api-key section. Please replace HASHTAG_ID accordingly as well. About getting hashtag ids, please take a look at Knowledge Base Auto Hashtag (Classification) section.
1
curl -X POST -d '{
2
"autoHashtagFeedbacks": [
3
{"id": "HASHTAG_ID_1", "state": "approved"},
4
{"id": "HASHTAG_ID_2", "state": "declined"}
5
]
6
}' \
7
-H 'API-KEY: YOUR_API_KEY' \
8
https://backend.alli.ai/webapi/kb_auto_hashtag_feedback
Copied!

Response Example

1
{
2
"result": [
3
{
4
"id": "S25vd2xlZGdlQmFzZUF1dG9IYXNodGFnOjVmZjhmZmJlYzJkNmUyNjJkOTVlZTQyYg==",
5
"state": "approved"
6
},
7
{
8
"id": "S25vd2xlZGdlQmFzZUF1dG9IYXNodGFnOjVmZjhmZTdmYzJkNmUyNjJkOTVlZTI5OQ==",
9
"state": "declined"
10
}
11
]
12
}
Copied!
post
https://backend.alli.ai
/webapi/faq/select_answer
Select Answer

Request Example

Please replace YOUR_API_KEY with your one in the example below. To get the api key, please see getting-api-key section. Please replace FAQ_ID accordingly as well. About getting FAQ ids, please take a look at Search from Q&A section.
1
curl -X POST -d '{
2
"id": "FAQ_ID",
3
"hashId": "Hash ID from Q&A search result"
4
}' \
5
-H 'API-KEY: YOUR_API_KEY' \
6
https://backend.alli.ai/webapi/faq/select_answer
Copied!

Response Example

1
{
2
"result": "Success"
3
}
Copied!
post
https://backend.alli.ai
/webapi/agent_management
Agent Management

Request Example

Please replace YOUR_API_KEY with your one in the example below. To get the api key, please see getting-api-key section.
1
curl https://backend.alli.ai/webapi/agent_management \
2
-d '{"email": "[email protected]",
3
"deleteFlag": true,
4
"password": "Password_4321",
5
"locale": "en"}' \
6
-H "Content-Type: application/json" \
7
-H "API-KEY: YOUR_API_KEY"
Copied!

Response Example

1
{
2
"result": {
3
"id" : "QWdlbnQ6NWZkMmFjMzIwODQ4MzY1ZDI4NWFjMGUw",
4
"status": "created"
5
},
6
"errors": null
7
}
Copied!
get
https://backend.alli.ai
/webapi/hashtags
Get All Hashtags

Request Example

Please replace YOUR_API_KEY with your one in the example below. To get the api key, please see getting-api-key section.
1
curl -X GET \
2
-H "API-KEY: YOUR API KEY" \
3
https://backend.alli.ai/webapi/hashtags
Copied!

Response Example

1
{
2
"result": {
3
"sample_tag1": 2,
4
"sample_tag2": 1,
5
}
6
}
Copied!
get
https://backend.alli.ai
/webapi/faq_histories
Q&A Query History

Request Example

1
curl -X GET \
2
-d { "startDate":"2021-02-19","endDate":"2021-02-23", \
3
"order": "DESC","searchTerm":"life", "limit": 1, "offset": 0 } \
4
-H 'API-KEY: YOUR_API_KEY' \
5
https://backend.alli.ai/webapi/faq_histories
Copied!

Response Example

1
{
2
"result": {
3
"histories": [
4
{
5
"agent": {
6
"id": "QWdlbnQ6NjA0NmMyNWJmNTFjMmVlYjc4Mjg3Zjcy"
7
},
8
"question": "What is life?",
9
"answers": [
10
{
11
"faq": {
12
"id": "RkFROjYwNDZjMmUxM2MzYmQ5MjVmMzgxMGNkOQ=="
13
},
14
"effectiveConfidence": 0.9999999999999927,
15
"confidence": 0.9999999999999927
16
}
17
]
18
}
19
],
20
"count": 1
21
},
22
"errors": null
23
}
Copied!
get
https://backend.alli.ai
/webapi/mrc_histories
Documents Query History

Request Example

1
curl -X GET \
2
-d { "startDate":"2021-02-19","endDate":"2021-02-23", \
3
"order": "DESC","searchTerm":"life", "limit": 1, "offset": 0 } \
4
-H 'API-KEY: YOUR_API_KEY' \
5
https://backend.alli.ai/webapi/mrc_histories
Copied!

Response Example

1
{
2
"result": {
3
"histories": [
4
{
5
"agent": {
6
"id": "QWdlbnQ6NWZiNzc5MGIwZjE3Zjc5ZmNiNzVlYzFh"
7
},
8
"question": "program memory of c004",
9
"answers": [
10
{
11
"knowledgeBase": {
12
"id": "S25vd2xlZGdlQmFzZTo2MDUyODM0ODFiYzgxNDcwZTEzNGRjNDQ=",
13
"fileName": "specification_en.pdf"
14
},
15
"answer": "{\"blocks\": [{\"key\": \"kn13\", \"type\": \"unstyled\", \"text\": \"Type capacity program memory program memory - C004, B04KR: 80KB\", \"depth\": 0, \"inlineStyleRanges\": [], \"entityRanges\": [], \"data\": {}}, {\"key\": \"2vjf\", \"text\": \" \", \"type\": \"unstyled\", \"depth\": 0, \"inlineStyleRanges\": [], \"entityRanges\": [], \"data\": {}}, {\"key\": \"45cb\", \"text\": \"— From specification_en.pdf\", \"type\": \"unstyled\", \"depth\": 0, \"inlineStyleRanges\": [{\"offset\": 0, \"length\": 27, \"style\": \"ITALIC\"}], \"entityRanges\": [{\"offset\": 7, \"length\": 20, \"key\": 0}], \"data\": {}}], \"entityMap\": {\"0\": {\"type\": \"LINK\", \"mutability\": \"MUTABLE\", \"data\": {\"url\": \"https://download.alli.ai/download_document/UHJvamVjdDo1ZmI3NzkwYjBmMTdmNzlmY2I3NWVjMWM=/S25vd2xlZGdlQmFzZTo2MDUyODM0ODFiYzgxNDcwZTEzNGRjNDQ=\"}}}}",
16
"answerHash": "6648c76e9be27864557f84ab7822cde8",
17
"answerFormat": "DRAFTJS",
18
"hashtags": [],
19
"feedbackAvailable": true,
20
"columnFilterValues": []
21
},
22
...
23
{
24
"knowledgeBase": {
25
"id": "S25vd2xlZGdlQmFzZTo2MDUyODM0ODFiYzgxNDcwZTEzNGRjNDQ=",
26
"fileName": "specification_en.pdf"
27
},
28
"answer": "{\"blocks\": [{\"key\": \"87us\", \"type\": \"unstyled\", \"text\": \"Type capacity reload memory reload memory - C004, B04KR: 2048KB\", \"depth\": 0, \"inlineStyleRanges\": [], \"entityRanges\": [], \"data\": {}}, {\"key\": \"p0wr\", \"text\": \" \", \"type\": \"unstyled\", \"depth\": 0, \"inlineStyleRanges\": [], \"entityRanges\": [], \"data\": {}}, {\"key\": \"qpau\", \"text\": \"— From specification_en.pdf\", \"type\": \"unstyled\", \"depth\": 0, \"inlineStyleRanges\": [{\"offset\": 0, \"length\": 27, \"style\": \"ITALIC\"}], \"entityRanges\": [{\"offset\": 7, \"length\": 20, \"key\": 0}], \"data\": {}}], \"entityMap\": {\"0\": {\"type\": \"LINK\", \"mutability\": \"MUTABLE\", \"data\": {\"url\": \"https://download.alli.ai/download_document/UHJvamVjdDo1ZmI3NzkwYjBmMTdmNzlmY2I3NWVjMWM=/S25vd2xlZGdlQmFzZTo2MDUyODM0ODFiYzgxNDcwZTEzNGRjNDQ=\"}}}}",
29
"answerHash": "9537b6560701930d079f39ced8be1b3e",
30
"answerFormat": "DRAFTJS",
31
"hashtags": [],
32
"feedbackAvailable": true,
33
"columnFilterValues": []
34
}
35
]
36
}
37
],
38
"count": 1
39
},
40
"errors": null
41
}
Copied!
Last modified 20h ago