> For the complete documentation index, see [llms.txt](https://klearstack.gitbook.io/klearstack-api-documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://klearstack.gitbook.io/klearstack-api-documentation/auto-classification/extract-document-with-updated-auto-classification-result.md).

# Extract Document With Updated Auto Classification Result

Endpoint Name: `URL/access/klearstack/proceedtoextractionwithautoclassifyresult`

Request type : `POST`

Authorization: Bearer token as header

Endpoint Details: The `proceedtoextractionwithautoclassifyresult` endpoint will be used to process the document again with the updated auto classification results

<table data-header-hidden><thead><tr><th width="119"></th><th></th></tr></thead><tbody><tr><td>Method</td><td>URL</td></tr><tr><td>POST</td><td><code>URL/access/klearstack/proceedtoextractionwithautoclassifyresult</code></td></tr></tbody></table>

### Request Body

<table data-header-hidden><thead><tr><th width="206.20001220703125"></th><th width="84"></th><th width="101.181884765625"></th><th></th></tr></thead><tbody><tr><td>Params</td><td>Values</td><td>Required</td><td>Description</td></tr><tr><td>company_name</td><td>string</td><td>Yes</td><td>Name of the company for which the user is logging in</td></tr><tr><td>batch_id</td><td>string</td><td>Yes</td><td>Batch id received from 'autoclassify' api response</td></tr></tbody></table>

### Shell (cURL)

* Request Body

```sh
curl --location "URL/access/klearstack/proceedtoextractionwithautoclassifyresult" \
  --header "Authorization: Bearer your_token_here" \
  --form "company_name=Replace_Company_Name_Here" \
  --form "batch_id=Replace_batch_id_Here" \
```

### Python

* Request Body

```python
import requests

url = "URL/access/klearstack/proceedtoextractionwithautoclassifyresult"

payload = {'company_name': 'Replace_Company_Name_Here',
'batch_id': 'Replace_batch_id_Here'}
files=[

]
headers = {
  'Authorization': 'Bearer your_token_here'
}

response = requests.request("POST", url, headers=headers, data=payload, files=files)

print(response.text)
```

### Java (OkHttp)

* Request Body

```java
OkHttpClient client = new OkHttpClient().newBuilder()
  .build();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = new MultipartBody.Builder().setType(MultipartBody.FORM)
  .addFormDataPart("company_name","Replace_Company_Name_Here")
  .addFormDataPart("batch_id","Replace_batch_id_Here")
  .build();
Request request = new Request.Builder()
  .url("URL/access/klearstack/proceedtoextractionwithautoclassifyresult")
  .method("POST", body)
  .addHeader("Authorization", "Bearer your_token_here")
  .build();
Response response = client.newCall(request).execute();
```

### Node.js (Axios)

* Request Body

```javascript
const axios = require('axios');
const FormData = require('form-data');
let data = new FormData();
data.append('company_name', 'Replace_Company_Name_Here');
data.append('batch_id', 'Replace_batch_id_Here');

let config = {
  method: 'post',
  maxBodyLength: Infinity,
  url: 'URL/access/klearstack/proceedtoextractionwithautoclassifyresult',
  headers: { 
    'Authorization': 'Bearer your_token_here', 
    ...data.getHeaders()
  },
  data : data
};

axios.request(config)
.then((response) => {
  console.log(JSON.stringify(response.data));
})
.catch((error) => {
  console.log(error);
});
```

### JavaScript (XHR)

* Request Body

```javascript
// WARNING: For POST requests, body is set to null by browsers.
var data = new FormData();
data.append("company_name", "Replace_Company_Name_Here");
data.append("batch_id", "Replace_batch_id_Here");

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function() {
  if(this.readyState === 4) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "URL/access/klearstack/proceedtoextractionwithautoclassifyresult");
xhr.setRequestHeader("Authorization", "Bearer your_token_here");

xhr.send(data);
```

### API Response

<table data-header-hidden><thead><tr><th width="147"></th><th></th></tr></thead><tbody><tr><td>Status code</td><td>Example Response</td></tr><tr><td>200</td><td><p></p><p><code>{'status': 'success', 'description': 'File uploaded for extraction','OCR_ref_no': batch_id}</code></p></td></tr><tr><td>400</td><td><code>{'status': 'fail', 'description': 'No existing classification result found for the provided batch_id'}</code></td></tr><tr><td>500</td><td><code>{'error': error}</code></td></tr></tbody></table>
