The purpose of this article is to describe API endpoints for meta-data tagging.
The meta-data tagger generates the following information based on the article content:
- assigns a topic based on predefined list of topics
- find all named entities present in the article, considering every mention of an entity, then
- select the most important named entities without repeating them,
- determine a sentiment score for each of the most important named entities, and
- determine a set of topics that describe the article and that will be used to tag the article appropriately on a website.
Authentication
For authentication, the api_key GET parameter should be set. Customer support should provide you with a valid key for authentication.
Example:
/api/brands/:brandId/meta_data/content?api_key=xxxxxxxx
Endpoints
Content analysis
This way of usage implies issuing an API call to a content endpoint, which in turn responds with detection results.
Content endpoint
This is a JSON POST endpoint
Endpoint path:
/api/brands/:brandId/meta_data/content
:brandId parameter is the id of your brand, which will be provided by our customer support.
JSON request payload example:
{
"content": "The quick brown fox jumps over the lazy dog"
}
URL object properties used to create a request:
**content** - mandatory value, it represents the entire text of your article
JSON response example:
{
"request_id": 1,
"status": "COMPLETED",
"data": {
"avg_sentiment": 0,
"entities": [ "fox", "dog" ],
"sentiment": [ "0", "0" ],
"top_entities": [ "fox", "dog" ],
"topics": [ "Nature" ]
}
}
In case we successfully processed your request but were unable to tag article text, you would receive following response:
JSON response example:
{
"request_id": 1,
"status": "FAILED",
"message": "Failed to tag article"
}
In case of errors, you would get an error response with the corresponding HTTP status code and JSON payload with the error message.
Example:
HTTP status code 400
Response body:
{
"message": "Invalid request parameters, missing content parameter.",
"status": "FAILED"
}