Hello,
I'm consuming Open AI API (post https://api.openai.com/v1/audio/transcriptions), added the authentication of Bearer token, working as expected.
The method SS
It requires two parameters
1. file
2. model
file SS
model SS
In response I'm getting the below error.
{
"error": {
"message": "[{'type': 'value_error', 'loc': ('body', 'file'), 'msg': \"Value error, Expected UploadFile, received: \", 'input': 'ID3\\x04\\x00\\x00\\x00\\x00\\x01............
For me it seems it sending string and expected was file.
I'm passing the binary data from Resource content.
Any help on this?
API Working as expected in Postman.
Hi @Rituraj Chouhan,
It seems the API expects a file upload (like UploadFile), but you’re passing the binary content directly, which might be causing the issue.
In OutSystems, ensure you’re using the correct MultipartFormData content type for the file upload. Instead of passing binary data, use the file input parameter in your API call to properly send the file as multipart data.
If it works in Postman, check how the file is being passed there and replicate that structure in OutSystems.
Let me know if this helps!
+ Addition to the above,
To fix this in OutSystems, follow these steps:
1) Set the Content-Type to multipart/form-data in your API request.
2) For the “file” parameter, use BinaryDataToUpload instead of just binary data. This will properly format the file for the request.
3) Make sure you’re passing the file with the correct filename and MIME type.
Here’s a quick example:
This should resolve the issue.