Created
April 16, 2020 20:23
-
-
Save brianmfear/dfc90371ea3bf8385581c8b37df3449a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class AWSTranscribeExample extends AWS { | |
public override void init() { | |
endpoint = new Url('https://transcribe.us-west-2.amazonaws.com/'); | |
resource = '/'; | |
region = 'us-west-2'; | |
service = 'transcribe'; | |
accessKey = 'my-key-here'; | |
method = HttpMethod.XPOST; | |
payload = Blob.valueOf('{"LanguageCode": "en-US","Media": {"MediaFileUri": "S3 audio file link"},"MediaFormat": "mp4","MediaSampleRateHertz": 44100,"TranscriptionJobName": "SampleRestJob7"}'); | |
setHeader('x-amz-target','Transcribe.StartTranscriptionJob'); | |
setHeader('content-type', 'application/x-amz-json-1.1'); | |
createSigningKey('my-secret-key-here'); | |
} | |
public String executeCallout() { | |
return sendRequest().getBody(); | |
} | |
} | |
// See https://gist.github.com/brianmfear/92cf05807ac4becbd21f for AWS |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@brianmfear I'm getting below error when trying this code
<Error><Code>MalformedXML</Code><Message>The XML you provided was not well-formed or did not validate against our published schema</Message><RequestId>XXXXXX</RequestId><HostId>XXXX+XXXX=</HostId></Error>