API
Parse PDF
Create Synchronization Job
"Synchronization" mean that you can receive results immediately after a request is completed
Example Request:
curl -X POST 'https://api.netmind.ai/inference-api/agent/v1/parse-pdf' \
--header 'Authorization: Bearer {{API_TOKEN}}' \
--header 'Content-Type: application/json' \
--data-raw '{
    "url": "https://netmind-public-files.s3.us-west-2.amazonaws.com/test.pdf",
    "format": "json"
}'import requests
import json
url = "https://test.api.netmind.ai/inference-api/agent/v1/parse-pdf"
payload = json.dumps({
   "url": "https://netmind-public-files.s3.us-west-2.amazonaws.com/test.pdf",
   "format": "json"
})
headers = {
   'Authorization': 'Bearer {{API_TOKEN}}',
   'Content-Type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
Example Response:
[
    {
        "id": "0eKSDqCl",
        "version": "1.0.1",
        "page": 1,
        "seq_no": 1,
        "sentence": "FABSA: An aspect-based sentiment analysis dataset of user reviews",
        "type": "title",
        "text_location": {
            "location": [
                [
                    37,
                    629,
                    427,
                    613
                ]
            ],
            "location_raw": [
                [
                    37,
                    164,
                    427,
                    180
                ]
            ]
        },
        "info": {}
    },
    ...
]Create Asynchronous Job
"Asynchronous" mean that you need to obtain results through another request (Get Job)
Example Request:
curl -X POST 'https://api.netmind.ai/inference-api/agent/v1/parse-pdf/async' \
--header 'Authorization: Bearer {{API_TOKEN}}' \
--header 'Content-Type: application/json' \
--data-raw '{
    "url": "https://netmind-public-files.s3.us-west-2.amazonaws.com/test.pdf",
    "format": "json"
}'
import requests
import json
url = "https://api.netmind.ai/inference-api/agent/v1/parse-pdf/async"
payload = json.dumps({
   "url": "https://netmind-public-files.s3.us-west-2.amazonaws.com/test.pdf",
   "format": "json"
})
headers = {
   'Authorization': 'Bearer {{API_TOKEN}}',
   'Content-Type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)Example Response:
{
    "task_id":"1a9e46e...2a9fb",
    "status":"PENDING"
}Get Job
Example Request:
curl -X GET 'https://api.netmind.ai/inference-api/agent/v1/parse-pdf/async/{{TASK_ID}}' \
--header 'Authorization: Bearer {{API_TOKEN}}'import requests
url = "https://api.netmind.ai/inference-api/agent/v1/parse-pdf/async/{{TASK_ID}}"
payload={}
headers = {
   'Authorization': 'Bearer {{API_TOKEN}}'
}
response = requests.request("GET", url, headers=headers, data=payload)
print(response.text)Example Response:
[
    {
        "id": "0eKSDqCl",
        "version": "1.0.1",
        "page": 1,
        "seq_no": 1,
        "sentence": "FABSA: An aspect-based sentiment analysis dataset of user reviews",
        "type": "title",
        "text_location": {
            "location": [
                [
                    37,
                    629,
                    427,
                    613
                ]
            ],
            "location_raw": [
                [
                    37,
                    164,
                    427,
                    180
                ]
            ]
        },
        "info": {}
    },
    ...
]Last updated
Was this helpful?