About this endpoint
What it does
Analyzes the sentiment of the submitted text. The request body must include text, and you can optionally provide provider-specific credentials or choose which service to use via requested_service; the response returns a JSON object with a data object containing provider-specific result objects.
Request Body
| Parameter | Type | Mandatory | Description |
|---|---|---|---|
| text | String | Yes | Text to analyze. |
| azure | Object | No | Custom credentials for Azure services. See nested fields below. |
| azure.key | String | No | Azure subscription key. |
| azure.region | String | No | Azure service region. |
| azure.endpoint | String | No | Azure endpoint URL. |
| azure.account_id | String | No | Azure account ID. |
| azure.access_token | String | No | OAuth access token for Azure service. |
| Object | No | Custom credentials for Google services. See nested fields below. | |
| google.google_language | String | No | Target language locale. |
| google.google_credential_json | Object | No | Google credential JSON object. See nested fields below. |
| google.google_credential_json.type | String | No | Service account type. |
| google.google_credential_json.auth_uri | String | No | Authorization URI. |
| google.google_credential_json.client_id | String | No | Client ID. |
| google.google_credential_json.token_uri | String | No | Token URI. |
| google.google_credential_json.project_id | String | No | Project ID. |
| google.google_credential_json.private_key | String | No | Private key. |
| google.google_credential_json.client_email | String | No | Service account email. |
| google.google_credential_json.private_key_id | String | No | Private key ID. |
| google.google_credential_json.universe_domain | String | No | Universe domain. |
| google.google_credential_json.client_x509_cert_url | String | No | Client X.509 certificate URL. |
| google.google_credential_json.auth_provider_x509_cert_url | String | No | Auth provider X.509 certificate URL. |
| encoding | String | No | Text encoding. |
| language | String | No | Language of the input text. |
| requested_service | ENUM | No | Which provider to use. Allowed values: azure, google, apyhub. Default: apyhub. |
Response
Returns a JSON object with a data object field. The data object may contain provider-specific result objects for azure, apyhub, and/or google, depending on the requested service and runtime behavior.
| Parameter | Type | Mandatory | Description |
|---|---|---|---|
| data | Object | No | Container for provider-specific response objects. |
| data.azure | Object | No | Response object from Microsoft Azure Cognitive Services. |
| data.apyhub | Object | No | Response object from ApyHub language tools. |
| data.google | Object | No | Response object from Google Cloud NLP API. |