Retrieving processing status
Retrieve the status of a processing based on the analyzerId. The status value in statusDetails is Completed, InProgress or Failed.
Syntax: GET /ca/rest/content/v1/contentAnalyzer/{analyzerId}
| Property | Data Type | Description |
|---|---|---|
apiKey header (required)
|
String | To authenticate API call. |
analyzerIdpath (required)
|
String | Unique identifier for each analyzer. Get from POST /contentAnalyzer response. |
GET/contentAnalyzer/{analyzerId}
cURL: Example
request
curl -X GET -u 'Functional ID:Password' 'https://requesturl/ca/rest/content/v1/contentAnalyzer/{analyzerId}' -H 'accept: application/json' -H 'apiKey: ecfc7da2-19af-4734-bdd7-9d0da7bb4852'
Python: Example
request
iimport requests
import base64
encoding = base64.b64encode(b'Functional ID:Password')
url = "https://requesturl/ca/rest/content/v1/contentAnalyzer/{analyzerId}"
headers = {
"apiKey" : "d7239f16-98f0-4024-9688-604750a98abb",
"authorization": "Basic " + str(encoding)
}
response = requests.request("GET", url, headers=headers)JavaScript: Example request
var fs = require("fs");
var request = require("request");
var Base64 = require('js-base64').Base64;
var encoding = Base64.encode('Functional ID:Password');
var options = {
method: 'GET',
url: 'https://requesturl/ca/rest/content/v1/contentAnalyzer/{analyzerId}',
headers:
{
'apiKey' : 'd7239f16-98f0-4024-9688-604750a98abb',
'authorization': "Basic " + encoding
}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
});
Java: Example
request
import java.io.IOException;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.Response;
import java.util.Base64;
String encoding = Base64.getEncoder().encodeToString(("Functional ID:Password").getBytes());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("https://requesturl/ca/rest/content/v1/contentAnalyzer/{analyzerId}")
.get()
.addHeader("apiKey", "d7239f16-98f0-4024-9688-604750a98abb")
.addHeader("Authorization", "Basic " + encoding)
.addHeader("Cache-Control", "no-cache")
.build();
Response response = client.newCall(request).execute();
/*
* The JAR files in Referenced Libraries could be found in the Download section with the following link:
* 1. okhttp.jar - https://github.com/square/okhttp
* 2. okio.jar - https://github.com/square/okio
*/Example
response{
"status": {
"code": 200,
"messageId": "CIWCA12002",
"message": "Successfully retrieved the content analyzer details"
},
"data": {
"analyzerId": "fe76c510-e2d8-11e8-9ee8-81a7944aa061",
"uniqueId": "",
"creationDate": "2018-11-07T22:03:47.520Z",
"fileName": "car.pdf",
"numPages": 1,
"statusDetails": [
{
"type": "JSON",
"status": "Completed",
"completedPages": 1,
"progress": 100
},
{
"type": "PDF",
"status": "InProgress"
},
{
"type": "UTF8",
"status": "Failed"
}
]
}
}