The ThinkAutomation Server provides a local HTTP REST API for accessing the Message Store. This can be used to integrate message store views with your own applications or to create custom front-ends to the ThinkAutomation message store using any development platform. This API will enable you to create a custom message store view with the same functionality as the Message Store view in the ThinkAutomation Studio.
The REST API can also be used to save & search articles in the Embedded Knowledge Store.
You need ThinkAutomation version 5.0.950 or higher to use this API.
The ThinkAutomation Server listens on port 9898 for HTTPS requests and port 9899 for HTTP requests. The port numbers can be changed in your ThinkAutomation Server settings.
Secure | None Secure |
---|---|
https://localhost:9898/ | http://localhost:9899/ |
Replace 'localhost' with the IP/computer name of the ThinkAutomation Server when accessing remotely. You should always use the secure endpoint unless there is a specific reason not to.
By default the ThinkAutomation Server uses a self-signed SSL certificate for HTTPS requests. This will cause warnings for direct requests from most browsers. You can assign a trusted certificate using the ThinkAutomation Server settings.
The ThinkAutomation server only accepts requests from IP addresses that have been included in the Whitelist. By default, localhost and 192.168.* are included. You can add additional IP ranges using the ThinkAutomation Server settings.
All successful responses are in JSON format. Successful responses will return a 200/202 HTTP response code. Unsuccessful responses will return a 400+ HTTP error status.
Authenticated users must have access to the SolutionID's used on requests. A 402 error will be returned if the user does not have access.
For any DELETE operations the authenticated user must have Can Delete Messages right enabled.
Before using the Message Store REST API you must call authorize method with a valid username and password. The authorize method returns an authentication key.
Store the AuthKey property value from the authorize response. This must then be included on each subsequent method call (see below).
Store the MessageStoreFlags array from the authorize response if you want to provide a Flags filter on your message store view.
You should then call the solutions method to get a list of Solutions that the user has access to.
Store each Solution from the solutions response array. Each solution also includes an Automations array which contains details of each automation in the solution. Each automation includes MessagesTotal and MessagesToday properties allowing you to display message totals. Each automation includes a Folders array containing each sub-folder (or null if no sub-folders have been defined). The MessagesTotal property of each folder will contain the total number of messages in the folder.
You can now create a treeview style interface listing each solution, then each automation in the solution, followed by any sub-folders under each automation.
When a user selects an automation (and optionally a sub-folder) call the messagestorecount method to read a count of messages to setup paging. Then call the messagestorepage method to read each page of message summaries when pages are selected.
When a user selects a specific message call the messagestorebody method to get the detail and display.
Before any calls can be made to the Message Store REST API you must authenticate. A successful authorize response contains an AuthKey property value. This value must then be included with each subsequent request either as a authorization header or &authorization={authkey} query string parameter. The AuthKey will be valid for 7 days (or until your ThinkAutomation Server is restarted or the user password is changed).
Authorize a user.
Example:
http://localhost:9899/authorize?username={username}&password={password}
Returns
{
"UserName": "Admin",
"Name": "System Administrator",
"Email": "test@mycompany.com",
"AuthKey": "84C528A85976822B9B4253B311E4DC877A3544A3C0170251",
"Rights": {
"Administrator": false,
"SystemAdministrator": true,
"CanViewMessageSources": true,
"CanReprocess": true,
"CanViewLogs": true,
"CanViewMessageStore": true,
"CanDeleteMessages": true,
"CanEditProperties": true,
"CanEditCustomActions": true
},
"RegisteredUser": "My Company",
"MessageStoreFlags": [
{
"Number": 1,
"Description": "Blue Flag",
"ColorHex": "#FF6A94C8"
},
{
"Number": 2,
"Description": "Green Flag",
"ColorHex": "#FF92B250"
},
{
"Number": 3,
"Description": "Yellow Flag",
"ColorHex": "#FFFFFF00"
}
]
}
The MessageStoreFlags array contains a list of Message Store flags. Use this if you want to provide a Flags filter on your message store view.
After authorizing you must call the solutions method to get a list of Solutions that the user has access to.
Get a list of Solutions and message store message counts for all solutions that the authenticated user has access to.
Example:
http://localhost:9899/solutions
Returns:
xxxxxxxxxx
[
{
"Id": "631602a0a703121a94f64ccc",
"Name": "Sales Processing",
"Enabled": true,
"MessageSources": [
{
"Id": "631602b1a703121a94f64cda",
"Name": "Office 365 Sales",
"SourceDescription": "Sales Team (Inbox)",
"Enabled": true,
"MessagesToday": 18,
"BytesReceived": 139466,
"LastError": ""
}
],
"Automations": [
{
"Id": "631602efa703121a94f64cdc",
"Name": "Office 365 Sales Automation",
"Enabled": true,
"MessagesTotal": 0,
"MessagesToday": 18,
"MessagesOut": 0,
"MessagesFailed": 0,
"LastError": "",
"Folders": [
{
"Id": "63160308a703121a94f64ce9",
"ParentId": "",
"Name": "New",
"MessagesTotal": 6
},
{
"Id": "63160310a703121a94f64ceb",
"ParentId": "",
"Name": "Quoted",
"MessagesTotal": 3
}
]
}
]
}
]
The array will contain a list of Solutions that the user has access to:
xxxxxxxxxx
{
"Id": "631602a0a703121a94f64ccc",
"Name": "Solution Name",
"Enabled": true,
"MessageSources": [],
"Automations": []
}
Each Solution object will contain arrays of MessageSources and Automations.
MessageSource Items :
xxxxxxxxxx
{
"Id": "631602b1a703121a94f64cda",
"Name": "Message Source Name",
"SourceDescription": "",
"Enabled": true,
"MessagesToday": 0,
"BytesReceived": 0,
"LastError": ""
}
The MessagesToday value contains the number of messages received by the message source for the current day.
Automation Items :
xxxxxxxxxx
{
"Id": "631602efa703121a94f64cdc",
"Name": "Automation Name",
"Enabled": true,
"MessagesTotal": 0,
"MessagesToday": 0,
"MessagesOut": 0,
"MessagesFailed": 0,
"LastError": "",
"Folders": []
}
The MessagesToday value will contain the number of messages processed by the automation for the current day. The MessagesTotal value contains the total number of messages held in the message store for the Automation.
Each Automation will contain an array of Folders (or null if no sub-folders have been created).
Folder Items :
xxxxxxxxxx
{
"Id": "63160308a703121a94f64ce9",
"ParentId": "",
"Name": "Folder Name",
"MessagesTotal": 0
}
The MessagesTotal value contains the total number of messages held in the message store for the Automation/Folder.
Reading messages from the message store involves first requesting a count. (optionally based on criteria). The count will return the total number of messages for the given criteria. Message summaries are then requested by page. Each page will return a maximum of 1000 massages. So if the count returns 10,100 then this represents 11 pages number 1-11. The first 10 pages will return 1000 messages. The 11th page will return 100.
Get a count of messages for the specified criteria.
Parameters:
Parameter Name | Value |
---|---|
solutionid | The Solution ID. |
automationid | The selected Automation ID. |
folderid | Optional. The selected Folder ID. |
fromdate | Optional. From message date (yyyy-mm-dd hh:mm:ss) UTC. |
todate | Optional. To message date (yyyy-mm-dd hh:mm:ss) UTC. |
searchtext | Optional. Search text. Only messages containing the search text in Subject, SentFrom, SentTo or AutomationReturnValue. |
flag | Optional (Integer). Include only messages with flag number. |
returnonly | Optional (Integer). Include only messages 0=All, 1=Success only, 2=Failed only |
sentitems | Optional (boolean). If true only return Sent Items. |
outbox | Optional (boolean). If true only return Outbox Items. |
Example:
http://localhost:9899/messagestorecount?solutionid=631602a0a703121a94f64ccc&automationid=631602efa703121a94f64cdc
Returns:
xxxxxxxxxx
{
"Messages": null,
"SentItems": null,
"Outbox": null,
"_id": "63160666a7031217d496c3ac",
"SolutionId": "631602a0a703121a94f64ccc",
"MessageSourceId": "",
"AutomationId": "631602efa703121a94f64cdc",
"FolderId": "",
"FromDate": "0001-01-01T00:00:00",
"ToDate": "0001-01-01T00:00:00",
"SearchText": "",
"Flag": 0,
"ReturnOnly": 0,
"PageNumber": 0,
"RowsPerPage": 1000,
"IsCount": true,
"IsDelete": false,
"IsSentItems": false,
"IsOutbox": false,
"Count": 9
}
The IsCount value will be true. The Count value will contain the number of messages. Divide this by the RowsPerPage value to obtain the number of pages available.
Get a page of message store message summaries.
Parameters:
Parameter Name | Value |
---|---|
solutionid | The Solution ID. |
automationid | The selected Automation ID. |
page | The page number. |
folderid | Optional. The selected Folder ID. |
fromdate | Optional. From message date (yyyy-mm-dd hh:mm:ss) UTC. |
todate | Optional. To message date (yyyy-mm-dd hh:mm:ss) UTC. |
searchtext | Optional. Search text. Only messages containing the search text in Subject, SentFrom, SentTo or AutomationReturnValue. |
flag | Optional (Integer). Include only messages with flag number. |
returnonly | Optional (Integer). Include only messages 0=All, 1=Success only, 2=Failed only |
sentitems | Optional (boolean). If true only return Sent Items. |
outbox | Optional (boolean). If true only return Outbox Items. |
Example:
http://localhost:9899/messagestorepage?solutionid=631602a0a703121a94f64ccc&automationid=631602efa703121a94f64cdc&page=1
Returns:
xxxxxxxxxx
{
"Messages": [
{
"_id": "631602faa703120d1c24a75d",
"SolutionId": "631602a0a703121a94f64ccc",
"MessageSourceId": "631602b1a703121a94f64cda",
"IncomingUid": "AAMkADdmM2MzZDNiLTNmNTctNGE4gBGAAAAAADGimcp7ED3Sacl9O",
"Subject": "ThinkAutomation Evaluation Registration",
"SentFrom": "no-reply@parkersoftware.com",
"SentTo": "\"Sales\" <sales@parkersoftware.com>",
"Importance": "N",
"MessageDate": "2022-07-05T11:33:49",
"MessageFlags": 0,
"MessageSize": 7842,
"AutomationId": "631602efa703121a94f64cdc",
"AutomationPending": false,
"AutomationSuccess": true,
"AutomationError": false,
"AutomationErrorValue": "",
"AutomationReturnValue": "",
"AutomationDate": "2022-09-05T14:08:58.273286",
"AutomationLog": null,
"Attachments": false,
"AttachmentNames": "",
"Mime": null,
"Body": null
},
{
.
}
],
"SentItems": null,
"Outbox": null,
"_id": "63160682a7031217d496c3ad",
"SolutionId": "631602a0a703121a94f64ccc",
"MessageSourceId": "",
"AutomationId": "631602efa703121a94f64cdc",
"FolderId": "",
"FromDate": "0001-01-01T00:00:00",
"ToDate": "0001-01-01T00:00:00",
"SearchText": "",
"Flag": 0,
"ReturnOnly": 0,
"PageNumber": 1,
"RowsPerPage": 1000,
"IsCount": false,
"IsDelete": false,
"IsSentItems": false,
"IsOutbox": false,
"Count": 0
}
The Messages array will contain message summaries for each message in the requested page. If you requested Sent Items using the sentitems parameter then the SentItems array will be populated. If you requested Outbox Items using the outbox parameter then the Outbox array will be populated.
When reading message summaries the Mime, Body and AutomationLog properties will always be null. You can request the detail of an individual message using the messagestorebody or messagestoremessage methods.
Messages are returned in date order - newest first.
Get the detail for a message including the full MIME text.
Parameters:
Parameter Name | Value |
---|---|
solutionid | The Solution ID. |
id | The Message ID. |
Example:
http://localhost:9899/messagestoremessage?solutionid=631602a0a703121a94f64ccc&id=631602faa703120d1c24a75d
The message id is obtained from the summary page : _id property of an individual message in the Messages array.
Returns:
xxxxxxxxxx
{
"_id": "631602faa703120d1c24a75d",
"SolutionId": "631602a0a703121a94f64ccc",
"MessageSourceId": "631602b1a703121a94f64cda",
"IncomingUid": "AAMkADdmM2MzZDNiLTNmNTctNGE4gBGAAAAAADGimcp7ED3Sacl9O",
"Subject": "ThinkAutomation Evaluation Registration",
"SentFrom": "no-reply@parkersoftware.com",
"SentTo": "\"Sales\" <sales@parkersoftware.com>",
"Importance": "N",
"MessageDate": "2022-07-05T11:33:49",
"MessageFlags": 0,
"MessageSize": 7842,
"AutomationId": "631602efa703121a94f64cdc",
"AutomationPending": false,
"AutomationSuccess": true,
"AutomationError": false,
"AutomationErrorValue": "",
"AutomationReturnValue": "",
"AutomationDate": "2022-09-05T14:08:58.273286",
"AutomationLog": [
{
"MessageStoreId": "631602faa703120d1c24a75d",
"AutomationId": "631602efa703121a94f64cdc",
"LineNumber": 0,
"Dated": "2022-09-05T14:08:58.25765",
"IsError": false,
"LineText": "Process Message, Dated 7/5/2022 12:33:49 PM, From no-reply@parkersoftware.com, (7.7KB), Subject: ThinkAutomation Evaluation Registration",
"NodeName": "SPVMWINDOWS2019"
}
],
"Attachments": false,
"AttachmentNames": "",
"Mime": "//full mime text//",
"Body": null,
}
The Mime value will contain the full email MIME text including attachments. The Body value will be blank.
The AutomationLog array will contain all Automation log lines for the processed message.
The AttachmentNames will contain a comma separated list of attachment file names (if any).
Get the detail for a message and the message body for previewing. This method differs from the messagestoremessage method in that the message body is returned ready for previewing. The messagestoremessage method returns the full MIME text of the message which you would need to decode to access the body.
Parameters:
Parameter Name | Value |
---|---|
solutionid | The Solution ID. |
id | The Message ID. |
Example:
http://localhost:9899/messagestorebody?solutionid=631602a0a703121a94f64ccc&id=631602faa703120d1c24a75d
The message id is obtained from the summary page : _id property of an individual message in the Messages array.
Returns:
xxxxxxxxxx
{
"_id": "631602faa703120d1c24a75d",
"SolutionId": "631602a0a703121a94f64ccc",
"MessageSourceId": "631602b1a703121a94f64cda",
"IncomingUid": "AAMkADdmM2MzZDNiLTNmNTctNGE4gBGAAAAAADGimcp7ED3Sacl9O",
"Subject": "ThinkAutomation Evaluation Registration",
"SentFrom": "no-reply@parkersoftware.com",
"SentTo": "\"Sales\" <sales@parkersoftware.com>",
"Importance": "N",
"MessageDate": "2022-07-05T11:33:49",
"MessageFlags": 0,
"MessageSize": 7842,
"AutomationId": "631602efa703121a94f64cdc",
"AutomationPending": false,
"AutomationSuccess": true,
"AutomationError": false,
"AutomationErrorValue": "",
"AutomationReturnValue": "",
"AutomationDate": "2022-09-05T14:08:58.273286",
"AutomationLog": [
{
"MessageStoreId": "631602faa703120d1c24a75d",
"AutomationId": "631602efa703121a94f64cdc",
"LineNumber": 0,
"Dated": "2022-09-05T14:08:58.25765",
"IsError": false,
"LineText": "Process Message, Dated 7/5/2022 12:33:49 PM, From no-reply@parkersoftware.com, (7.7KB), Subject: ThinkAutomation Evaluation Registration",
"NodeName": "SPVMWINDOWS2019"
}
],
"Attachments": true,
"AttachmentNames": "text.txt",
"Mime": "",
"Body": "<html><body><p>This is the message body</p></body></html>"
}
The Body value will contain the message body in HTML format. You can then display this in a iframe tag to preview the message body. The Mime value will be blank.
The AutomationLog array will contain all Automation log lines for the processed message.
Get an attachment for a message.
Parameters:
Parameter Name | Value |
---|---|
solutionid | The Solution ID. |
id | The Message ID. |
filename | The Attachment filename. |
Example:
http://localhost:9899/messagestoreattachment?solutionid=631602a0a703121a94f64ccc&id=631602faa703120d1c24a75d&filename=test.txt
The message id is obtained from the summary page : _id property of an individual message in the Messages array. The filename is obtained from the AttachmentNames property.
Returns:
xxxxxxxxxx
{
"MessageId": "63ca723a90ca1b0c10d051ef",
"FileName": "test.txt",
"ContentType": "application/octet-stream",
"ContentId": "",
"Size": 2431,
"Data": "RDpcQ29kZVNpZ25cc2lnbnRvb2wuZXhlIHNpZ24gL3QgImh0dHA6Ly90aW1lc3RhbXAuZGlnaWNlcnQuY29tIiAvZiAiRDpcQ29kZVNpZ25cUEFSS0VSIFNPRlRXQVJFIExJTUlURUQgLSBDb2Rlc2lnbiAyMDIyLTIzLnBmeCIgL3AgIiZKcDN7Ml84XSFEZjcuOTw1Pi........"
}
The Data value contains the base64 encoded binary data for the attachment.
Deletes a message.
Parameters:
Parameter Name | Value |
---|---|
solutionid | The Solution ID. |
id | The Message ID. |
Gets the detail for any Sent Item message.
Parameters:
Parameter Name | Value |
---|---|
solutionid | The Solution ID. |
id | The Sent Item Message ID. |
Example:
http://localhost:9899/messagestoresentitem?solutionid=631602a0a703121a94f64ccc&id=631602faa703120d1c24b324
The message id is obtained from the summary page : _id property of an individual message in the SentItems array.
Deletes a message store Sent Item message.
Parameters:
Parameter Name | Value |
---|---|
solutionid | The Solution ID. |
id | The Sent Item Message ID. |
Gets the detail for any Outbox message.
Parameters:
Parameter Name | Value |
---|---|
solutionid | The Solution ID. |
id | The Outbox Item Message ID. |
Example:
http://localhost:9899/messagestoreoutboxitem?solutionid=631602a0a703121a94f64ccc&id=631602faa703120d1c24c253
The message id is obtained from the summary page : _id property of an individual message in the Outbox array.
Deletes an Outbox item.
Parameter Name | Value |
---|---|
solutionid | The Solution ID. |
id | The Outbox Item Message ID. |
Individual message store messages can be reprocessed by ThinkAutomation. The selected message will be added back to the process queue and processed again by the Automation.
Parameter Name | Value |
---|---|
solutionid | The Solution ID. |
id | The Message ID. |
Messages in the Message Store are assigned an AutomationId. This is the Automation that processed the message. Messages can also be assigned a FolderId - which is the optional subfolder id. Users can create sub-folders using the ThinkAutomation Studio and messages can be assigned a folder during Automation processing.
Adds or updates a message store folder.
Parameters:
Parameter Name | Value |
---|---|
solutionid | The Solution ID. |
automationid | The Automation ID. |
Post Body:
xxxxxxxxxx
{
"FolderId": "",
"ParentId": "",
"Name": "New Folder"
}
If the FolderId value is blank then a new folder is created otherwise the existing folder is updated. If a ParentId is specified then parent folder must exist (within the same Automation). The folder will be added as a child of the parent. The SolutionId and AutomationId parameters must be specified, and the automation specified must belong to the solution specified.
Returns:
xxxxxxxxxx
{
"FolderId": "6319af04a7031218d857f7c7",
"ParentId": "",
"Name": "New Folder",
"MessagesTotal": 0
}
Delete a message store folder.
Important: All messages in the folder and any sub-folders will also be deleted.
Parameters:
Parameter Name | Value |
---|---|
solutionid | The Solution ID. |
folderid | The Folder ID. |
You can request counts of processed and failed messages for a Solution and search criteria. You can use this data to provide a dashboard style view of your ThinkAutomation server processing load.
Get daily counts of processed messages for the specified criteria.
Parameters:
Parameter Name | Value |
---|---|
solutionid | The Solution ID. |
automationid | Optional. The selected Automation ID. |
fromdate | Optional. From execution date (yyyy-mm-dd). |
todate | Optional. To execution date (yyyy-mm-dd). |
searchtext | Optional. Search text. Only messages containing the search text in Subject, SentFrom, SentTo or AutomationReturnValue. |
flag | Optional (Integer). Include only messages with flag number. |
Example:
http://localhost:9899/messagestoresummary?
solutionid=631602a0a703121a94f64ccc&fromate=2022-09-07&todate=2022-09-08
Returns:
xxxxxxxxxx
{
"SolutionId": "631602a0a703121a94f64ccc",
"AutomationId": "",
"FromExecutionDate": "2022-09-01T00:00:00",
"ToExecutionDate": "2022-09-14T00:00:00",
"SearchText": "",
"Flag": 0,
"Success": 2,
"Failed": 0,
"Bytes": 1452,
"ExecuteMS": 4713,
"Automations": [
{
"AutomationId": "631602efa703121a94f64cdc",
"Success": 2,
"Failed": 0,
"Bytes": 1452,
"ExecuteMS": 4713,
"Days": [
{
"Dated": "2022-09-07T00:00:00",
"Success": 1,
"Failed": 0,
"Bytes": 726,
"ExecuteMS": 4661
},
{
"Dated": "2022-09-08T00:00:00",
"Success": 1,
"Failed": 0,
"Bytes": 726,
"ExecuteMS": 52
}
]
}
]
}
The top level Success, Failed, Bytes and ExecuteMS (execution time in milliseconds) values contain the totals of messages processed for all Automations in the Solution (unless you have requested a single Automation with the &automationid parameter).
The Automations array contains each Automation.
Each Automation has a Days array containing the totals for each day within the requested fromdate and todate.
The from and to dates related to the Automation Execution Date - not the date of the message (which could be different based on the Message Source).
This operation reads the message store and returns a list of messages between two email addresses with the same subject. The message store will be searched for all messages where the From and To addresses match either of the email addresses specified and have the same subject (any 'FW:' or 'RE:' subject prefixes will be ignored). Only messages processed within the same Solution will be searched.
Get a list of messages between two email addresses that have the same subject.
Parameters:
Parameter Name | Value |
---|---|
solutionid | The Solution ID. |
from | The first email address. |
to | The second email address. |
subject | The subject. |
value | The maximum number of messages to return. Optional: defaults to 100 messages. |
period | The maximum age of messages to return (in days). Optional: defaults to 30 days. |
Example:
http://localhost:9899/messagestoreconversation?
solutionid=631602a0a703121a94f64ccc&from=email1@test.com&to=email2@another.com&subject=Test&value=100
Returns:
xxxxxxxxxx
{
"SolutionId": "64789a1b90ca1b7f949f7bfb",
"Subject": "Test",
"FromAddress": "email1@test.com",
"ToAddress": "email2@another.com",
"MaxMessages": 100,
"MaxAgeDays": 30,
"Items": [
{
"_id": "6493e04f90ca1b7a24c21f5c",
"Body": "Hi there..",
"SentFrom": "email1@test.com",
"SentTo": "email2@another.com",
"Importance": "N",
"MessageDate": "2023-06-22T05:46:55",
"MessageSize": 496,
"AutomationId": "648ea14790ca1b50e0c309fb",
"AutomationSuccess": true,
"AutomationReturnValue": "",
"Attachments": false,
"AttachmentNames": ""
},
{
"_id": "6493e06990ca1b7a24c21f68",
"Body": "Hello. How can I help?",
"SentFrom": "email2@another.com",
"SentTo": "email1@test.com",
"Importance": "N",
"MessageDate": "2023-06-22T05:47:21",
"MessageSize": 533,
"AutomationId": "648ea14790ca1b50e0c309fb",
"AutomationSuccess": true,
"AutomationReturnValue": "",
"Attachments": false,
"AttachmentNames": ""
}
]
}
The Items array contains the messages in summary format. The Body value will be the message body in plain text format. The _id property is the message id. You can use this to read the full message if required.
If you want to read a chat transcript for messages saved via the Web Chat Form message source - the 'bot' replies will be in the AutomationReturnValue rather than being a separate message.
Delete messages between two email addresses that have the same subject.
Parameters:
Parameter Name | Value |
---|---|
solutionid | The Solution ID. |
from | The first email address. |
to | The second email address. |
subject | The subject. |
Example:
http://localhost:9899/messagestoreconversation?
solutionid=631602a0a703121a94f64ccc&from=email1@test.com&to=email2@another.com&subject=Test
Returns the list of messages deleted (in the same format as the GET operation).
You can also use the Message Store REST API to update & search articles in the Embedded Knowledge Store database.
All Knowledge Store operations require a Collection Name. Collection names cannot contain spaces or special characters, and should be a maximum of 100 characters. Collection names are case insensitive.
Get a list of collection names and article counts.
Parameters: none
Example:
http://localhost:9899/knowledgestorecollections
Returns:
xxxxxxxxxx
[
{
"Name": "KnowledgeBase",
"Count": 719
},
{
"Name": "support",
"Count": 1283
}
]
Get a single Knowledge Store article from the specified collection.
Parameters:
Parameter Name | Value |
---|---|
collection | The Knowledge Store collection name. |
title | The article title. |
Example:
http://localhost:9899/knowledgestorearticle?collection=KnowledgeBase&title=ThinkAutomation
Returns:
xxxxxxxxxx
{
"Title": "ThinkAutomation",
"Text": "ThinkAutomation is a business process automation (BPA) solution designed to automate on-premises and cloud-based business processes that are triggered from incoming messages. Messages can be received by email, database updates, webhooks, web forms, chat bots, SMS messages, Twitter, Teams messages, documents, local files and other messages *sources*.",
"Tag": "",
"Dated": "2023-06-21T09:49:38.538381Z",
"Tokens": 662
}
A 404 error will be returned if the Title does not exist.
Get a list of all Knowledge Store articles in the specified collection.
Parameters:
Parameter Name | Value |
---|---|
collection | The Knowledge Store collection name. |
Example:
http://localhost:9899/knowledgestorearticle?collection=KnowledgeBase&title=ThinkAutomation
Returns:
xxxxxxxxxx
[
{
"Title": "Message Store",
"Tag": "",
"Dated": "2023-06-21T10:43:35.5425234Z",
"Tokens": 234
},
{
"Title": "ThinkAutomation",
"Tag": "",
"Dated": "2023-06-21T09:49:38.538381Z",
"Tokens": 662
}
]
Searches the Knowledge Store for articles in the specified collection. The most relevant articles relating to the search text will be returned.
Parameters:
Parameter Name | Value |
---|---|
collection | The Knowledge Store collection name. |
searchtext | The search text. |
value | Optional. The maximum articles to return. Defaults to 5. |
Example:
http://localhost:9899/knowledgestoresearch?collection=KnowledgeBase&searchtext=Message%20Store
Returns:
xxxxxxxxxx
[
{
"Title": "Message Store",
"Text": "ThinkAutomation stores each processed message in the *Message Store*. The Message Store contains a copy of each message processed along with a log of Automation actions. You can view the Message Store using the ThinkAutomation Studio. The Message Store Database will be created when ThinkAutomation is run for the first time. \r\n\r\nYou can use the built-in SQLite database for the Message Store, or an external Microsoft SQL Server, MySQL or MongoDB database.\r\n\r\nThe built-in SQLite database provides the simplest configuration and will work on any computer without any additional software. Using an external database may provide better performance.",
"Tag": "",
"Tokens": 234,
"Similarity": 0.79010
},
{
"Title": "ThinkAutomation",
"Text": "ThinkAutomation is a business process automation (BPA) solution designed to automate on-premises and cloud-based business processes that are triggered from incoming messages. Messages can be received by email, database updates, webhooks, web forms, chat bots, SMS messages, Twitter, Teams messages, documents, local files and other messages *sources*.",
"Tag": "",
"Tokens": 662,
"Similarity": 0.77122
}
]
The articles will be in Similarity order.
Note: When searching the Knowledge Store, if you have entered an OpenAI API Key into the ThinkAutomation Server Settings, then the OpenAI Embeddings will be obtained for the search text. This will provide a much more accurate list of relevant articles then regular keyword based searches.
Delete a single Knowledge Store article from the specified collection.
Parameters:
Parameter Name | Value |
---|---|
collection | The Knowledge Store collection name. |
title | The article title to delete. |
Returns:
xxxxxxxxxx
[
"Document deleted in embedded database KnowledgeBase_Store.KnowledgeBase with id Message Store"
]
A 404 error will be returned if the Title does not exist.
Delete all articles from the specified collection.
Parameters:
Parameter Name | Value |
---|---|
collection | The Knowledge Store collection name. |
Returns:
xxxxxxxxxx
[
"Embedded database KnowledgeBase_Store collection KnowledgeBase dropped."
]
This operation drops the collection. All articles will be removed.
Adds or updates a Knowledge Store article in the specified collection.
Parameters:
Parameter Name | Value |
---|---|
collection | The Knowledge Store collection name. |
title | The Article Title. |
If the specified collection does not exist it will be created.
Post Body:
The post body can be the raw article text, x-www-form-urlencoded, form-data or email MIME text.
If email MIME text is specified then the Body text of the email will be used as the article text. If the email contains attachments then any document attachments will be converted to plain text and appended to the article text. For form-data posts, any file form fields will be processed as files (and converted to text as above).
The following document file types are supported: PDF, Word, Open Document, Richtext, Excel - along with any file with content-type text/plain. When using Document attachments - a separate article will be created for each page within the document.
If the article text contains Markdown - then a separate article will be created for each # Heading level (heading levels 1-4) if the article text is greater than 10,000 characters.
When separate articles are created due to attached documents, Markdown levels, or where the article text is greater than 10,000 characters - the additional article titles will be title: Page: nnn
Returns:
xxxxxxxxxx
[
"Document inserted into embedded database KnowledgeBase_Store.KnowledgeBase with id Studio"
]
The returned Json is a string array containing a string for each article updated.
Any article that already exists with the same title will be updated, otherwise a new article will be created.
Note: If you have entered an OpenAI API Key into the ThinkAutomation Server Settings, then the OpenAI Embeddings will be obtained for the article text and saved with the article in the Knowledge Store. This will improve accuracy when articles are searched. The call to OpenAI may take several seconds.
ThinkAutomation Business Process Automation Software. Copyright (c) 2023 Parker Software Limited.