> This documentation belongs to Invofox, an AI-powered document processing
> platform. The API extracts structured data (fields) from unstructured
> documents (invoices, contracts, forms, bank statements, and more).
> Key concepts: Account, Environment, Document Type, Field, File, Import,
> and Document. When answering, prefer the exact terminology defined in the
> Glossary and cite the relevant API Reference endpoint when applicable.

# Get document plain ocr text

GET https://api.invofox.com/documents/{id}/text

Reference: https://developers.invofox.com/api-reference/main-reference/documents/get-document-plain-ocr-text

## Authentication

- `x-api-key` header (required) — API Key authentication via header

## Request

### Path parameters

- `id` (string, required) — id of the document to get

## Response

### 200

Document ocr text by id

- `result` (list of string, optional) — Array of pages read

## Errors

### 400 Bad Request Error

Provided id is not correctly formatted

- `code` (string, optional)

### 403 Forbidden Error

User is not authorized to carry out this action

- `code` (string, optional)

### 404 Not Found Error

Element was not found

- `code` (string, optional)
- `additionalInfo` (DocumentsIdTextGetResponsesContentApplicationJsonSchemaAdditionalInfo, optional)

### 429 Too Many Requests Error

Too many requests were sent to the server in a short period of time. The response contains headers conforming to the [ratelimit standardization draft adopted by the IETF](https://github.com/ietf-wg-httpapi/ratelimit-headers/blob/main/draft-ietf-httpapi-ratelimit-headers.md/) * RateLimit-Limit - Limit of requests per window * RateLimit-Remaining - Remaining requests for current window * RateLimit-Reset - Seconds until window resets * Retry-After - Seconds caller should wait before retrying

- `code` (string, optional)

### 500 Internal Server Error

Unkown server error

- `code` (string, optional)

## Types

### DocumentsIdTextGetResponsesContentApplicationJsonSchemaAdditionalInfo

## Examples

**Request**

```json
{}
```

**Response**

```json
{
  "result": [
    "Invoice #12345\nDate: 2024-04-20\nSupplier: Acme Corp\nTotal Amount: $1,250.00\nThank you for your business."
  ]
}
```

**SDK Code**

```python
import requests

url = "https://api.invofox.com/documents/id/text"

payload = {}
headers = {
    "x-api-key": "<apiKey>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript
const url = 'https://api.invofox.com/documents/id/text';
const options = {
  method: 'GET',
  headers: {'x-api-key': '<apiKey>', 'Content-Type': 'application/json'},
  body: '{}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

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

func main() {

	url := "https://api.invofox.com/documents/id/text"

	payload := strings.NewReader("{}")

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

	req.Header.Add("x-api-key", "<apiKey>")
	req.Header.Add("Content-Type", "application/json")

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

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

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.invofox.com/documents/id/text")

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

request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{}"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://api.invofox.com/documents/id/text")
  .header("x-api-key", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{}")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.invofox.com/documents/id/text', [
  'body' => '{}',
  'headers' => [
    'Content-Type' => 'application/json',
    'x-api-key' => '<apiKey>',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.invofox.com/documents/id/text");
var request = new RestRequest(Method.GET);
request.AddHeader("x-api-key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "x-api-key": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.invofox.com/documents/id/text")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```