When I check the documentation on Developer.ATT.com I see this example of the format (Code)I should use:
POST https://api.att.com/speech/v3/speechToTextCustom HTTP/1.1
Host: api.att.com
Authorization: Bearer 38C2399A23999
X-SpeechContext: GrammarList
Accept: application/json
Content-length: 7012
Content-Language: en-us
Content-type: multipart/x-srgs-audio; boundary=----------------------------46ef33c653e2
------------------------------46ef33c653e2
Content-Disposition: form-data; name="x-dictionary"; filename="speech_alpha.pls"
Content-Type: application/pls+xml
<?xml version="1.0" encoding="UTF-8"?>
<lexicon version="1.0" alphabet="sampa" xml:lang="en-US">
<lexeme>
<grapheme>Qiang</grapheme>
<phoneme>tS { n</phoneme>
</lexeme>
</lexicon>
------------------------------46ef33c653e2
Content-Disposition: form-data; name="x-grammar"
Content-Type: application/srgs+xml
<grammar root="top" xml:lang="en-US">
<rule id="CONTACT">
<one-of>
<item>Qiang</item>
<item>David</item>
</one-of>
</rule>
<rule id="top" scope="public">
<item>
<one-of>
<item>text</item>
<item>send message to</item>
</one-of>
</item>
<ruleref uri="#CONTACT"/>
</rule>
</grammar>
------------------------------46ef33c653e2
Content-Disposition: form-data; name="x-voice"; filename="speech_ex.amr"
Content-Type: audio/amr
{{...audio data...}}
------------------------------45ef33c653e2--
Since I am having trouble getting this to work I am wondering if I should include the dictionary and grammar parts of the post as well? Why?
To use the customspeech engine (for non-standard languages) the grammar file is required as you need to supply the vocabulary for transcription whenever using the customspeech engine. You are able use the regular speech API for transcription with no grammar file but it may not cover what you are trying to do. It looks like you are trying to take advantage of the large number of non-English languages available with the AT&T customspeech engine. All of those languages do require that you supply a grammar file in order to work. Supported non custom languages are American English and American Spanish.