Obtaining advisor id
FeelGPT AnalyzeFile API endpoint requires an advisor-id as part of the request. This document explains how to get obtain an advisor-id
1. On FeelGPT, click "Let's Start" button on your prefered advisor
2. The advisor-id it located at the top-right of the screen
3. Copy the advisor-id to the clipboard by clicking the "copy" icon.
FeelGPT Get Advisors List
advisors is an HTTP GET enpoint to retrieve a list of all available advisors.
A call to advisors endpoint requires basic authentication. Please refer to Analyze Now Authentication
Here is a sample Javascript code to fetch the advisors list
analyze is an HTTP POST enpoint to start an asynchronus process to analyze an audio file.
The analysis process status reported though a webhook calls from FeelGPT analyzer.
A call to analyze endpoint requires basic authentication. Please refer to Analyze Now Authentication
It is recommended to encrypt the callback payload data by passing an "encryptionKey" string value on the request. Read more
Learn how to obtain the advisor-id for your prefered advisor Here
Parameters
Param Name | Is Mandatory | Comments |
audioLanguge | yes | The spoken language in the audio file |
file | yes | a file to analyze |
analysisLanguage | yes | The language FeelGPT will use for the analysis report |
statusCallbackUrl | yes | A webhook URL for status calls from FeelGPT analysis engine |
sendPdf | no | I "true", send the analysis results in PDF format on analysis completion. The file on the callback is based64 encoded |
encryptionKey | no | Encryption key to encode the "payload" field on webhook callback |
See NodeJS sampke code
Install required libraries
npm install axios form-data
Explanation
- Importing Libraries:
- `axios` for making HTTP requests.
- `form-data` for handling form data, especially for file uploads
- `fs` for file system operations
- `path` for handling file paths.
- Creating the Form Data:
- A new instance of `FormData` is created.
- Required fields are appended to the form, including the audio file using `fs.createReadStream()` to read the file from the disk.
- Making the Request:
- The `axios.post()` method sends a POST request to the specified URL.
- Basic authentication is used via the `auth` option.
- `form.getHeaders()` is used to set the appropriate headers for the form data.
- Handling the Response:
- The response is logged to the console.
- Any errors are caught and logged, with detailed error information if available
- Replace `'path_to_your_audio_file.wav'` with the actual path to your audio file. This code will send a POST request to the "analyze" endpoint with the required form data and handle the response accordingly.
Response Structure
Upon request reception, FeelGPT validate the request parameters. For a valid request FeelGPT will return a "reportId" identifier to be used when recieving asynchronous status updates.
For invalid parameter the response will return an error code and message which indicates the invalid param.
Sample response for a valid request
Sample response for a request with an invalid parameter
Once a valid request accepped on FeelGPT, it starts sending status update to the URL provided on "statusCallbackUrl" parameter.
Sample status callback data
application: always "feelgpt".
eventDate: Time of the event in GMT timezone
payload: contain the actual event data
payload/reportId: The reportId that was provided on the response for the analysis request
payload/status: The current analysis status
encrypted: true of "encryptionKey" parameter sent on the analysis request
Avaialble Status
queued - The analysis request was successfully accepted, and queud for analysis
transcripting - The audio is now on transcription
analyzing - FeelGPT analyze the audio for emotions
completed - The report is ready. the "result" data contains the analysis data
pdfReady - If a PDF report was requested on the request, the payload for this status contains a PDF file in Base64 encoding