locked
Response Error but no details provided from server RRS feed

  • Question

  • Hi,

    I am testing REST API. I follow all the steps from the documentation but I am not able to get the transcript back from the server. Could you please giving me some support about what I am doing wrong?

    Please find the code used below.

    var bingRecognitionEndpoint = 'https://speech.platform.bing.com/recognize';
    var url     = bingRecognitionEndpoint   + '/query?version=3.0' 
                                                    + '&appid=D4D52672-91D7-4C74-8AD8-42B1D98141A5' 
                                                    + '&requestid=' + guid 
                                                    + '&format=json' 
                                                    + '&locale=en-US' 
                                                    + '&device.os=Windows OS' 
                                                    + '&scenarios=websearch' 
                                                    + '&instanceid=' + guid2;
    
            var fd      = new FormData();
            fd.append('fname', 'speech.wav');
            fd.append('data', blob);
            
            $.ajax({
                type: "POST",
                url: url,
                data: fd,
                processData: false,
                contentType: 'audio/wav;samplerate=16000;sourcerate=8000;trustsourcerate=false',
                beforeSend: function (xhr) 
                {
                    xhr.setRequestHeader("Authorization", "Bearer @ViewBag.authToken");
                },
                success: function (response) 
                {
                    console.log(response);
                },
                error: function (response) 
                {
                    console.log(response);
                }
            });

    I get the following response from success handler:

    {
      "version": "3.0",
      "header": {
        "status": "error",
        "properties": {
          "requestid": "b4cfede8-4b2e-4c8b-af0e-e77e6b4a1de6"
        }
      }
    }


    Thursday, January 14, 2016 11:42 AM