Table of Contents |
---|
Supported Languages
Text Analysis Endpoints
The Verity text analysis endpoints are:
POST /text/classification
Initiates a new text analysis.
GET /text/classification/{uuid}/status
Returns the status of the text analysis.
GET /text/classification/{uuid}
Returns processed results.
The following example walks through an example text string analysis request.
Example Text Request
This example shows a request to analyze the following text string:
Kubernetes (also known as k8s or kube) is an open source container orchestration platform that automates many of the manual processes
Step 1 – Submit a POST request via curl to /text/classification
Submit a POST request with the text string to be analyzed, for example:
Code Block |
---|
curl -H 'x-api-key: <YOUR_API_KEY_HERE>' -H 'Content-Type: application/json' -X POST -d '{"text":"Kubernetes (also known as k8s or kube) is an open source container orchestration platform that automates many of the manual processes", "languageCode": "en"}' https://verity-api.gumgum.com/text/classification |
Verity API returns a JSON response of Content-Type: application/json; charset=UTF-8 with a uuid for the request and current request status, for example:
Code Block | ||
---|---|---|
| ||
{ "uuid": "c7bcbe04-ea77-4808-8e91-28d325d1b1fc", "acceptedAt": "2020-06-25T23:09:41.729Z" } |
For a list of supported status messages, refer to Application Status Messages.
Step 2 – Submit a GET request to /text/classification/{uuid}/status
Submit a GET request to /text/classification/{uuid}/status, specifying the uuid
returned in the previous step. Within a short period, once analysis of the text is complete, a status change occurs. For example:
Code Block |
---|
curl -H 'x-api-key: <YOUR_API_KEY_HERE>' https://verity-api.gumgum.com/text/classification/c7bcbe04-ea77-4808-8e91-28d325d1b1fc/status |
Verity API returns a JSON response showing the request has the following status:
Code Block | ||
---|---|---|
| ||
{ "uuid" : "c7bcbe04-ea77-4808-8e91-28d325d1b1fc", "status": "ANALYZING" } |
Step 3 – Submit a GET request to /text/classification/{uuid}
Submit a GET request to /text/classification/{uuid} , specifying the uuid returned in the response during Step 1. Within a short period, once analysis of the text is complete, a status change occurs and the classification response is PROCESSED. The classification response is ready, for example:
Code Block |
---|
curl -H 'x-api-key: <YOUR_API_KEY_HERE>' https://verity-api.gumgum.com/text/classification/c7bcbe04-ea77-4808-8e91-28d325d1b1fc |
Example Text JSON Response Body
Code Block | ||
---|---|---|
| ||
{ "uuid": "28b82df1-452d-5054-875d-556abbac5f1b", "data": { "processedAt": "2021-06-06T08:22:24.097Z", "expiresAt": "2021-07-06T08:22:24.097Z", "iab": { "v2": [ { "id": "596", "category": "Technology & Computing", "score": 0.59 }, { "id": "620", "category": "Cloud Computing", "score": 0.21, "parent": { "id": "619", "category": "Internet", "parent": { "id": "599", "category": "Computing", "parent": { "id": "596", "category": "Technology & Computing" } } } }, { "id": "602", "category": "Computer Software and Applications", "score": 0.15, "parent": { "id": "599", "category": "Computing", "parent": { "id": "596", "category": "Technology & Computing" } } } ] }, "keywords": [ "kube", "k8s", "open source container orchestration platform", "kubernetes", "manual processes" ], "safe": true, "threats": [], "sentiments": [ { "sentiment": "neutral", "score": 1 }, { "sentiment": "negative", "score": 0 }, { "sentiment": "positive", "score": 0 } ] } } |
The JSON response details the complete brand safety, keyword, and categorization analysis data for the text. See JSON Response for details about the fields included in the response.