Skip to main content
GET
/
analysis
/
{task_id}
Get Analysis Result
curl --request GET \
  --url https://gateway.manka.tz/v1/api/analysis/{task_id} \
  --header 'Authorization: Bearer <token>'
import requests

url = "https://gateway.manka.tz/v1/api/analysis/{task_id}"

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers)

print(response.text)
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

fetch('https://gateway.manka.tz/v1/api/analysis/{task_id}', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => "https://gateway.manka.tz/v1/api/analysis/{task_id}",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => [
    "Authorization: Bearer <token>"
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://gateway.manka.tz/v1/api/analysis/{task_id}"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("Authorization", "Bearer <token>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.get("https://gateway.manka.tz/v1/api/analysis/{task_id}")
  .header("Authorization", "Bearer <token>")
  .asString();
require 'uri'
require 'net/http'

url = URI("https://gateway.manka.tz/v1/api/analysis/{task_id}")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
{
  "status": "processing",
  "task_id": "3f7a1c2e-8b4d-4e9f-a1b2-c3d4e5f60718"
}
{
  "status": "completed",
  "task_id": "3f7a1c2e-8b4d-4e9f-a1b2-c3d4e5f60718",
  "result": { "...": "..." }
}
{
  "status": "failed",
  "task_id": "3f7a1c2e-8b4d-4e9f-a1b2-c3d4e5f60718",
  "error": "Unable to process this PDF"
}
Returns the current status of an analysis job previously created via POST /analysis.
Task records expire 24 hours after creation. A 404 response means the task ID is unknown or has expired.

Path parameters

task_id
string
required
The task_id returned by POST /analysis.

Response

status
string
required
One of processing, completed, or failed.
task_id
string
required
Echo of the task identifier.
result
object
Present when status is completed. Contains the full analysis output.
error
string
Present when status is failed. Human-readable reason the analysis could not be completed.

Status values

ValueMeaning
processingAnalysis is in progress — keep polling
completedAnalysis finished; result contains the full output
failedAnalysis could not be completed; error contains the reason
{
  "status": "processing",
  "task_id": "3f7a1c2e-8b4d-4e9f-a1b2-c3d4e5f60718"
}
{
  "status": "completed",
  "task_id": "3f7a1c2e-8b4d-4e9f-a1b2-c3d4e5f60718",
  "result": { "...": "..." }
}
{
  "status": "failed",
  "task_id": "3f7a1c2e-8b4d-4e9f-a1b2-c3d4e5f60718",
  "error": "Unable to process this PDF"
}

Error responses

StatusReason
401Missing or invalid API token
404Task not found or expired

Polling pattern

curl https://gateway.manka.tz/v1/api/analysis/3f7a1c2e-8b4d-4e9f-a1b2-c3d4e5f60718 \
  -H "Authorization: Bearer $MANKA_API_TOKEN"
import time, requests

while True:
    r = requests.get(
        f"https://gateway.manka.tz/v1/api/analysis/{task_id}",
        headers={"Authorization": f"Bearer {token}"},
    )
    body = r.json()
    if body["status"] in ("completed", "failed"):
        break
    time.sleep(5)
Prefer a callback URL over polling when you control a public HTTPS endpoint.