List document tag answers
Lists the tags attached to a document with latest answers and validation state.
curl -X GET "https://api.textmine.com/v3/documents/123/tags" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_TOKEN (`tm_<key>`)"
import requests
import json
url = "https://api.textmine.com/v3/documents/123/tags"
headers = {
"Content-Type": "application/json",
"Authorization": "Bearer YOUR_API_TOKEN (`tm_<key>`)"
}
response = requests.get(url, headers=headers)
print(response.json())
const response = await fetch("https://api.textmine.com/v3/documents/123/tags", {
method: "GET",
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer YOUR_API_TOKEN (`tm_<key>`)"
}
});
const data = await response.json();
console.log(data);
package main
import (
"fmt"
"net/http"
)
func main() {
req, err := http.NewRequest("GET", "https://api.textmine.com/v3/documents/123/tags", nil)
if err != nil {
panic(err)
}
req.Header.Set("Content-Type", "application/json")
req.Header.Set("Authorization", "Bearer YOUR_API_TOKEN (`tm_<key>`)")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
fmt.Println("Response Status:", resp.Status)
}
require 'net/http'
require 'json'
uri = URI('https://api.textmine.com/v3/documents/123/tags')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Get.new(uri)
request['Content-Type'] = 'application/json'
request['Authorization'] = 'Bearer YOUR_API_TOKEN (`tm_<key>`)'
response = http.request(request)
puts response.body
{
"document_id": 67890,
"status": "processed",
"tags": [
{
"tag_id": 456,
"name": "Termination notice period",
"question": "example_string",
"answer": "30 days",
"confidence": 0.89,
"reasoning": "example_string",
"run_at": "2024-12-25T10:00:00Z",
"validation": {
"is_valid": true,
"validated_answer": "30 days written notice",
"comment": "example_string",
"validated_by_id": 123,
"validated_by_name": "John Doe",
"validated_at": "2024-12-25T10:00:00Z"
}
}
]
}
{
"error": "Bad Request",
"message": "The request contains invalid parameters or malformed data",
"code": 400,
"details": [
{
"field": "email",
"message": "Invalid email format"
}
]
}
{
"error": "Unauthorized",
"message": "Authentication required. Please provide a valid API token",
"code": 401
}
{
"error": "Forbidden",
"message": "You don't have permission to access this resource",
"code": 403
}
{
"error": "Not Found",
"message": "The requested resource was not found",
"code": 404
}
GET
/v3/documents/{documentId}/tagsGET
Base URLstring
Target server for requests. Edit to use your own host.
Bearer Token (`tm_<key>`)
Bearer Tokenstring
RequiredUse Authorization: Bearer tm_<key> for API-key access to /v3/** endpoints. V3 also accepts Auth0 JWT and HTTP Basic for user-session contexts.
Use
Authorization: Bearer tm_<key> for API-key access to /v3/** endpoints. V3 also accepts Auth0 JWT and HTTP Basic for user-session contexts.path
documentIdinteger
RequiredDocument ID.
Format: int64
Request Preview
Response
Response will appear here after sending the request
Authentication
header
Authorizationstring
RequiredBearer token (tm_<key>). Use Authorization: Bearer tm_<key> for API-key access to /v3/** endpoints. V3 also accepts Auth0 JWT and HTTP Basic for user-session contexts.
Path Parameters
documentIdinteger
RequiredDocument ID.
Responses
document_idinteger
statusstring
tagsarray
Was this page helpful?