The public API is exposed as part of the BusinessGPT Firewall.
Table of Contents | ||
---|---|---|
|
...
How to get your API KEY
The API allows sending requests to AI service through HTTP requests.
Each user has a unique API key to authenticate the API. The API key is viewed on the User Settings page in the BusinessGPT dashboard . You need to here:
...
You can select the value, copy it, and send in the request.
...
Chat service - POST request
POSTuse it in your API calls.
How to find CollectionID or ContentId?
Several API require PrvaiteDataID . To find the ID select the collection or document line and click on collection info
...
For a document:
...
For a SharePoint folder:
...
1. Chat Service
URL: https://[firewall API address]/firewallApi/v1/chat
Sample URL for
...
BGD15 environment:
https://
...
bgd15-firewall.agatdemo.com/firewallApi/v1/chat
Method: POST
Description: Allows to send a prompt to the AI and receive a response based on some particular content or all company data
Input parameters - should be sent as JSON:
...
APIKey
...
Prompt
...
DataSource (private and public=both, public, private).
...
PrivateDataSource(Content, Collection, All)
...
Request Body:
Code Block | ||
---|---|---|
| ||
{
"APIKey": "see above",
"Prompt": "the question",
"DataSource ": "PrivateAndPublic" / "Public" / "Private",
OPTIONAL FIELDS:
"PrivateDataSource": "Content" / "Collection" / "All",
"PrivateDataID": "ID of the content or the collection",
"AIModel": "",
"AIServerType": "",
"ChatId": "",
"MaxWordsInAnswer": "",
"User": "",
"ChatAIService": "",
"Context": "",
}
|
Info |
---|
All input parameters should be sent to the body in JSON format. The URL is not the same as the Dashboard. Please get in touch with support to get the URL of your environment. Use the supported_models endpoint to retrieve a list of all available models |
Parameters notes
APIKey- see here
DataSource - When the DataSource is set to public, the chat will use the pre-trained LLM knowledge, while the private value will use the uploaded company data. For askng a general question not related to a file or content you upload- use Public. When you want to get answers from company knowledge or files you upload- set to Private.
PrivateDataSource- The PrivateDataSource values are not needed for public-only data. It is needed to scope the question on a specific file or collection
PrivateDataID is not needed when PrivateDataSource=All and for public-only data
AIModel (optional. Default will be as for the user. Available values: GPT3_5, GPT4, WizardLM, GPT4o, GPT_4o_Mini)
AIServerType (optional. Default will be as for the user. Available values: openai, local, awsbedrock)
ChatId (optional): If provided, the question will be added to the existing chat with an external chat ID that equals the provided value. If no chat exists, a new one will be created.
MaxWordsInAnswer (optional) - If provided it should limit the number of words in the answer. The min word limit is 5.
User (optional) - the user that has asked the question
ChatAIService (optional. Default will be BusinessGPTDashboard . Available values: ChatGPT, Gemini, BusinessGPTDashboard , MicrosoftCopilot , Cohere, Claude, SlackBot)
Context (Optional) - the context of the chat. For example, the name of the Slack channel or Word document that the prompt was used from.
ChatName (optional) - the name of the chat in the auditing
Output - for HTTP status OK (200):
PromptId
Response
Response:
Status Code: 200 OK
Response
PromptId
SuggestedQuestions
DataSources
Info |
---|
Use collection in the source and the collection ID in the PrivateDataID to get answers from the content of a SharePoint folder, Site root, or Google Folder. |
In case of an error, it will return an error message.
...
How do you find the ID of the collection or content item for the “PromptScopeId” parameter?
To find the ID triple-click the line to get some system info:
ProjectID is the collection ID:
...
For a document it is the contentID as in the image below
...
Upload service - POST request
...
2. Create Collection
URL: https://[firewall API address]/firewallApi/v1/createcollection
Sample URL for BGD15 environment:
https://bgd15-firewall.agatdemo.com/firewallApi/v1/createcollection
Method: POST
Description: Creates a collection
Request Body:
Code Block | ||
---|---|---|
| ||
{
"APIKey": "",
"CollectionName": "",
OPTIONAL FIELDS:
"CollectionId": "",
"AllowedGroups ": "{}"
"AllowedEmails ": ""
"Action": ""
}
|
Info |
---|
All input parameters should be sent to the body in JSON format. The URL is not the same as the Dashboard. Please get in touch with support to get the URL of your environment. |
Parameters notes
APIKey- see here
Action (string, optional, default: "Add")
The action to be performed on the collection. Possible values include:Add
: Upload a new file (default action).UpdatePermissions
: Modify permissions for an existing file.Rename
: Change the name of an existing file.Delete
: Remove an existing file.
Response:
Status Code: 200 OK
CollectionID
3. Upload File
URL: https://[firewall API address]/firewallApi/v1/upload
Sample URL for
...
BGD15 environment:
https://
...
bgd15-firewall.agatdemo.com/firewallApi/v1/upload
Method: Post
Description: Allows to send file to the AI to be saved in BusinessGPT and receive its ID.
Input parameters - should be sent as form-data:
...
APIKey
...
FileName
...
Request Body:
Code Block | ||
---|---|---|
| ||
{
"APIKey": "",
"FileName": "",
"FileContent:": "in binary!",
OPTIONAL FIELDS:
"ContentSourceName:" "",
"ContentSourceIP": "",
"CollectionId": "",
"ContentId": "string",
"AllowedGroups ": ""
"AllowedEmails ": ""
"FilePath": ""
"Action": ""
} |
Info |
---|
All input parameters should be sent to the body in JSON format. |
Parameters notes
APIKey- see here
FileName - with the extension as will be displayed in the UI for the user.
ContentSourceName (optional)- The name of the client using the API (for example, File loader)
ContentSourceIP (optional)- The IP of the client using the API (for example the host of the File loader)AllowedGroups
Action (string, optional, default: "Add")
AllowedEmails (optional)
...
The action to be performed on the file. Possible values include:Add
: Upload a new file (default action).UpdatePermissions
: Modify permissions for an existing file.Rename
: Change the name of an existing file.Delete
: Remove an existing file.
ContentId (string, required for
UpdatePermissions
,Rename
, orDelete
)CollectionID (Optional)
Response:
Status Code: 200 OK
ContentId
In case of an error, it will return an error message.
...
4. Get classifications
...
GETURL: https://[firewall API address]/firewallApi/v1/getClassifications
Sample URL for BGD10 environment:
https://
...
bgd15-firewall.agatdemo.com/firewallApi/v1/getClassifications
Method: Get
Description: Allows user to get status and classifications of content.
Input parameters - should be sent as JSON:
APIKey
ContentId
Output - for HTTP status OK (200):
Request Body:
Code Block | ||
---|---|---|
| ||
{
"APIKey": "Your KEY",
"ContentId": "Your ContentID"
} |
Info |
---|
All input parameters should be sent to the body in JSON format. |
Parameters notes
APIKey- see here
Response:
Status Code: 200 OK
EmbeddingStatus- of the content (document) - New/SentToQueue/Processing/Done/Failed
Classifications(only if embedding status is Done) - list of classifications found for the content, by rule type (AI/Regular). Each classification contains the following fields:
RuleType - AI/Regular
Status - New/Processing/Done/Error/Skip
ClassificationRules (only if status is Done) - list of rules of the specified type that were matched for the content. Each rule contains the following fields:
RuleName
RuleDescription
RulePurpose
RuleType
SensitivityLevel
RuleValue
In case of an error, it will return an error message.
...
...
5. Get Content Status
URL: https://[firewall API address]/firewallApi/v1/content_status
Sample URL for BGD15 environment:
https://bgd15-firewall.agatdemo.com/firewallApi/v1/content_status
Method: Get
Description: Allow user to get the current status of the content
Request Body:
Code Block | ||
---|---|---|
| ||
{
"APIKey": "",
"AccountId": "",
"UserId": "",
"ContentId": ""
}
|
Info |
---|
All input parameters should be sent to the body in JSON format. |
Parameters notes
APIKey- see here
Action (string, optional, default: "Add")
The action to be performed on the collection. Possible values include:Add
: Upload a new file (default action).UpdatePermissions
: Modify permissions for an existing file.Rename
: Change the name of an existing file.Delete
: Remove an existing file.
Response:
Status Code: 200 OK
Status
6. Alive request
URL: https://[firewall API address]/firewallApi/v1/alive
Sample URL for BGD10 environment:
https://
...
bgd15-firewall.agatdemo.com
/firewallApi/v1/alive
Method: Get
Description: Allows user to get the status of the Firewall
Request Body: This request does not have a body
...
7. Search files in knowledgebase
URL: https://[firewall API address]/firewallApi/v1/search_knowledge_base_for_files
Sample URL for BGD10 environment:
https://bgd15-firewall.agatdemo.com
/firewallApi/v1/search_knowledge_base_for_files
Method: Post
Description: Allow user to get a list of relevant files from the the database saved in BusinessGPT
Request Body:
Code Block | ||
---|---|---|
| ||
{
"AccountId": "{unique identifier of the company}",
"UserId": "{unique identifier of the costumer}",
"APIKey": "",
"Query": "<Search term>",
"SimilaritySearchProvider": "for exmple- BusinessGPT",
OPTIONAL FIELDS:
"UserProfile": "",
"MaxResults": "",
"KRequested": ""
} |
Info |
---|
All input parameters should be sent to the body in JSON format. |
APIKey- see here
"SimilaritySearchProvider": "for exmple- BusinessGPT"
"UserProfile" - (dictionary with 2 string fields: DisplayName and Email) - represent user information
"MaxResults": (int) - amount of maximum results for the request
"KRequested": (int)
Response:
Status Code: 200 OK
Response Content: JSON object with file_name link to S3, search score and relevant text chunk.
Response example:
Code Block language json { "files_and_scores": [ { "file_name": "s3://bgpt-base-testing-files/FILES for BGPT testing/VC investor reach out scripts.pdf", "score": "", "text": "I really relate – I had a similar story that happened just before Yom Kippur! Or 190 chars Linkedin invite AGAT is a bootstrapped company offering ChatGPT-Like capabilities across all company data with an on-prem option to address business needs. Are you open to discussing possible investment? 291 chars Linkedin invite Based on your evident enthusiasm in the AI field, I believe you will be interested in learning about AGAT. AGAT is a bootstrapped company offering ChatGPT-Like capabilities across all company data with an on-prem option to address business needs. Are you open to discussing possible investment?" }, { "file_name": "s3://bgpt-base-testing-files/FILES for BGPT testing/AGAT Software Security and Privacy statement 8329.pdf", "score": "", "text": "This document and the information contained therein is proprietary and confidential. No part of this document may be disclosed in any manner to a third party without the prior written consent of AGAT Software Development LTD CONFIDENTIAL Privacy Policy and Data processing notice Agat Software (“We”) are committed to protecting and respecting your privacy. This privacy and security statement explains what measures we take to secure your data, the personal data we collect from you through our product, and how we use that data. This notice sets out the basis on which personal data we collect from you, or that you provide to us, will be processed by us. Please read the following document carefully to understand our views and practices regarding your personal data protection. Who are we and what do we do AGAT Software Development LTD is an innovative security provider specializing in security, compliance, governance, management, and productivity solutions for Unified Communication and Collaboration (UCC) services. SphereShield, AGAT`s flagship product, handles security threats related to authentication and identity as well as communication control, data protection, and content inspection. Securing your data All data is encrypted in transit to and from the internet, mitigating the risk of third parties accessing your data. Data can also be encrypted at rest if requested. We store data in data centers around the globe in accordance with the need of our customers." } ]
8. Get Topics
URL: https://[firewall API address]/firewallApi/v1/topics
Sample URL for BGD10 environment:
https://bgd15-firewall.agatdemo.com/firewallApi/v1/topics
Method: Post
Description: Allows user to get the 5-top topics of a document or a conversation
Request Body:
Code Block | ||
---|---|---|
| ||
{
"APIKey": "",
"AccountId": "",
"UserId": "",
"InputType": "qa",
"InputData": [{"question": "___", "answer": "___"}],
} |
Info |
---|
All input parameters should be sent to the body in JSON format. |
Parameters notes
APIKey- see here
InputType - the only possible value is ‘qa’
InputData - the data for the topic request in a structure of questions and answers.
Response:
Status Code: 200 OK
Topcis
Usage
In case of an error, it will return an error message.
9. Similar Words
URL: https://[firewall API address]/firewallApi/v1/similar_words
Sample URL for BGD10 environment:
https://bgd15-firewall.agatdemo.com/firewallApi/v1/similar_words
Method: Post
Description: Allows user to get the the similar words to the query in the provided terms
Request Body:
Code Block | ||
---|---|---|
| ||
{
"APIKey": "",
"AccountId": "{unique identifier of the company}",
"UserId": "{unique identifier of the costumer}",
"Terms": "<terms>",
"Texts": [<optional - only if chunk_ids not provided>]
OPTIONAL FIELDS:
"ChunkIds": [<list of the chunk ids>]
"Temperature": ""
} |
Info |
---|
All input parameters should be sent to the body in JSON format. |
Parameters notes
APIKey- see here
Terms - (string), The model will provide similar words for this given terms.
Texts - (list of strings) the text that the model will provide the similar words from
Chunk_ids and texts can’t be provided together but one of them must be in the request
Response:
Status Code: 200 OK
Response Content:
Words array
Usage
In case of an error, it will return an error message.
10. Get Structured Data
URL: https://[firewall API address]/firewallApi/v1/structured_data
Sample URL for BGD10 environment:
https://bgd15-firewall.agatdemo.com/firewallApi/v1/structured_data
Method: Post
Description: Allows user to parse documents based on a specific structure.
Request Body:
option 1:
Code Block | ||
---|---|---|
| ||
{
"APIKey": "","
"AccountId": "{unique identifier of the company}",
"UserId": "{unique identifier of the costumer}",
"ContentId": "{unique identifier of the document}",
"Structure": [a structure of the desierd table]
} |
option 2:
Code Block | ||
---|---|---|
| ||
{
"APIKey": "","
"ContentText": "{the content of the ducument to parse}""
"Structure": [a structure of the desierd table]
} |
Info |
---|
All input parameters should be sent to the body in JSON format. |
Parameters notes
APIKey- see here
Response:
Status Code: 200 OK
Response Content:
Structure -the parsed data according to the given structure
Usage
In case of an error, it will return an error message.
11. Extract Text
URL: https://[firewall API address]/firewallApi/v1/extract_text
Sample URL for BGD10 environment:
https://bgd15-firewall.agatdemo.com/firewallApi/v1/extract_text
Method: Post
Description: Allows user to extract text from base-64 file content
Request Body:
Code Block | ||
---|---|---|
| ||
{
"APIKey": "",
"AccountId": "{unique identifier of the company}",
"UserId": "{unique identifier of the costumer}",
"FileContent": """,
"FileName": ""
} |
Info |
---|
All input parameters should be sent to the body in JSON format. |
Parameters notes
APIKey- see here
FileContent- (string)
Response:
Status Code: 200 OK
Response Content:
ExtractText -the readable file text
In case of an error, it will return an error message.
12. Get supported models
URL: https://[firewall API address]/firewallApi/v1/supported_models
Sample URL for BGD10 environment:
https://bgd15-firewall.agatdemo.com/firewallApi/v1/supported_models
Method: Get
Description: Allows user to receive a list of all available models
Request Body:
Code Block | ||
---|---|---|
| ||
{
"APIKey": "",
} |
Info |
---|
All input parameters should be sent to the body in JSON format. |
Parameters notes
APIKey- see here
Response:
Status Code: 200 OK
Response Content:
models - The model’s list
In case of an error, it will return an error message.
Postman Samples for all APIs
...