Using the generic connector for AI - APIs required by the generic connector for AI
OVERVIEW
Your AI service must support specific APIs to allow the AI Hub to connect to the service, authenticate, send files and receive data. In addition, the HighQ service will provide a webhook URL that your service should call when document metadata has been extracted, and is ready to be pulled back into the HighQ system by your customers.
Authorisation
Your AI service must provide a “client ID” and “secret key” that will be used by the HighQ AI Hub to authorise requests to your AI APIs. This client ID and secret key is entered by the HighQ System Administrator when they configure the connection, and should not be shared. Each customer should have their own client ID and secret key. The client ID and key can be ASCII text up to 250 characters, and will be used to request an access token from your AI service. The access token will be included in every API request in order to authenticate the request.
Root URL
Your AI service must make all APIs available on a root URL. This root URL can be at any level – for example, www.myAI.com and www.myAI.com/services/ai/extraction are both valid root URLs. Each API endpoint must be found on this root endpoint: for example, www.myAI.com/services/ai/extraction/authorize must exist for the connection to work.
Whitelisting IP range
In addition, to enable connection from the HighQ AI Hub to your AI service, you may need to whitelist the HighQ data centre IP ranges. If your service requires IP whitelisting, please contact the HighQ support team and request the IP ranges to whitelist.
API details
Your AI service must support the HighQ GET and POST APIs in the table below in order to comply with the HighQ AI Hub generic connector for AI specification.
Sr No. | API Title | Request Type | HighQ Will provide in request | Expected response | Notes |
---|---|---|---|---|---|
1 | /authorize | POST |
parameters: client_id(String) client_secret(String) |
access_token(String) |
client_id client_secret access_token This API specification was changed from GET to POST in 5.6.17 version. |
2 | /heartbeat | GET | - | No response needed. But system should provide status code (200) | Confirms if the AI service is available. |
3 | /callback | POST |
parameters: clientCallbackUrl(url) aiUniqueIdentifier(String) |
"SUCCESS"/"FAILURE"(String) |
clientCallbackUrl aiUniqueIdentifier |
4 | /projects | GET | - | [ { projectId(String) projectName(String) projectDescription(String) } ] |
projectID Classifier that allows the AI engine and site to handle multiple Projects. A user can associate documents with a specific project. |
5 | /document/upload | POST |
parameters: file(MultipartFile) projectID(String) |
jobID(String) | jobID Unique ID provided by the AI service. This ID is used for all further API calls for uploaded documents |
6 | /questions | GET | List<projectID(String)> | [ { questionID(String) questionText(String) [ projectID(String) ] } ] |
projectID questionID questionText |
7 | /answers | GET | jobID(String) | [ { questionID(String) questionText(String) [ answer(String) ] } ] |
jobID answer |
Planned for future releases
Sr No. | API Title | Request Type | HighQ Will provide in request | Expected response | Notes |
---|---|---|---|---|---|
1 | /project/create | POST | { projectId(String) templateID(String) projectName(String) projectDescription(String) } |
projectID(String) | - |
2 | /templates | GET | - | [ { templateId(String) templateName(String) templateDescription(String) } ] |
- |
3 | /reanalyze | POST | [ jobID(String) ] |
"SUCCESS"/"FAILURE"(String) | - |
4 | /delete | DELETE | [ jobID(String) ] |
"SUCCESS"/"FAILURE"(String) | - |
Comments
0 Comments