Providing binary to a REST API from a filedocument

0
Hi all, I am utilising a speech to text API using Azure Speech Services.    In my app we have a widget that records the user and stores the audio file in an entity which generalises to System.FileDocument.    The api specifies it needs the audio in a binary form.   I have tried setting the REST call request to use Form-data and provide the entity directly but no luck, the response says "no audio data received". I have also tried using the Base64 encode file but this gets the same issue. When using the custom request template option instead and sending the base 64 encoded string gets a 200 (success) responce and recognises the length of the audio, but the transcription is blank which googling suggests is due to the wrong format.    Is there a way to convert a file to binary format for use in this API? Does it need a custom java action? Does anyone have any experience with this that can help?
asked
1 answers
1

Hello there :),

 

in the request tab in your rest service, go for binary for the entire request. Then in Content, select your object of the fileDocument and use Contents attribute. For example ->image.png

 

Contents are always in binary and exactly what you need.

answered