The public API is exposed as part of the BusinessGPT Firewall.
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 dashboard. You need to copy it and send in the request.
Healthcheck service - GET request
GET: https://[firewall API address]/firewallApi/v1/alive
Sample URL for BGD10 environment:
https://bgd10-firewall.agatdemo.com/firewallApi/v1/alive
Chat service - POST request
POST: https://[firewall API address]/firewallApi/v1/chat
Sample URL for BGD10 environment:
https://bgd10-firewall.agatdemo.com/firewallApi/v1/alive
Allows to send prompt to the AI and receive response based on some particular content or all company data
Input parameters - should be sent as JSON:
APIKey
Prompt
PromptScope (Content, Collection, All)
PromptScopeId (id of the content or the collection, not needed for All)
AIModel (optional. Default will be as for the user. Available values: GPT3_5, GPT4)
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.
Output - for HTTP status OK (200):
PromptId
Response
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
POST: https://[firewall API address]/firewallApi/v1/upload
Sample URL for BGD10 environment:
https://bgd10-firewall.agatdemo.com/firewallApi/v1/upload
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
FileContent - binary
Output - for HTTP status OK (200):
ContentId
In case of an error, it will return an error message.
Get classifications service - POST request
POST: https://[firewall API address]/firewallApi/v1/getClassifications
Sample URL for BGD10 environment:
https://bgd10-firewall.agatdemo.com/firewallApi/v1/getClassifications
Allows to get status and classifications of content.
Input parameters - should be sent as JSON:
APIKey
ContentId
Output - for HTTP status OK (200):
Status
Classifications (only if status is Done) - list of classifications found for the content. Each classification contains the following fields:
RuleName
RuleDescription
RulePurpose
RuleType
SensitivityLevel
RuleValue
In case of an error, it will return an error message.
Postman Samples
Attached is the Postman collection with example requests.