Constructing the request

Now, using Postman, we are going to construct a request and fire it to the Google Speech API. Click on New and then Request inside Postman, and provide a name as applicable. I created a new collection named Cloud Speech API and placed this request inside that. You can import that collection into your Postman as well. This file is available in the Chapter 5APIPostman folder. Update the new request as follows:

Field

Value

HTTP method

POST

URL

https://speech.googleapis.com/v1/speech:recognize?key=API_KEY

Request body

// SNIPP SNIPP
{
"config":
{
"encoding": "LINEAR16",
"sampleRateHertz": 44100,
"languageCode": "en-us"
},
"audio":
{
"content": "-- BASE64 AUDIO CONTTENT --"
}
}
// SNIPP SNIPP

 

In the previous fields, update the API key and base64 encoded string as applicable.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.139.105.159