Constructing the request

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

Field

Value

HTTP method

POST

URL

https://language.googleapis.com/v1/documents:analyzeSentiment?key=API_KEY

Request body

// SNIPP SNIPP
{
"encodingType": "UTF8",
"document":
{
"type": "PLAIN_TEXT",
"content": "Enjoy your vacation!"
}
}
// SNIPP SNIPP


In the preceding fields, update the API 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.83.96