Last Updated on

(Last Updated On: July 11, 2016)

This API classifies the input image as per batch class identifier provided. This API will depend on the three plugin for completion “CREATE_THUMBNAILS_PLUGIN”, “CLASSIFY_IMAGES_PLUGIN” and “DOCUMENT_ASSEMBLER_PLUGIN”.  If any batch class doesn’t have those plugin then the API will not work.

Request Method POST

Input Parameters

Input Parameter Values Descriptions
batchClassId This value should not be empty and it should be a valid batch class identifier as BC1. This parameter is used for providing batch class identifier on which image classification will be performed.


Web Service URL: http://{serverName}:{port}/dcma/rest/classifyImage


  1. Input file should be single page tif/tiff file only.
  2. batchClassId should be valid batch class identifier and must have the plugins “CREATE_THUMBNAILS_PLUGIN”, “CLASSIFY_IMAGES_PLUGIN” and “DOCUMENT_ASSEMBLER_PLUGIN”.

Sample client code using apache commons http client:-

private static void classifyImage() {
		HttpClient client = new HttpClient();
		String url = "http://localhost:8080/dcma/rest/classifyImage";
		PostMethod mPost = new PostMethod(url);
		// Adding tif file for processing
		File file1 = new File("C:\\sample\\US-Invoice.tif");
		Part[] parts = new Part[2];
		try {
			parts[0] = new FilePart(file1.getName(), file1);
			// Adding parameter for batchClassId
			String batch = "BC8";
			parts[1] = new StringPart("batchClassId", batch);
			MultipartRequestEntity entity = new MultipartRequestEntity(parts, mPost.getParams());
			int statusCode = client.executeMethod(mPost);
			if (statusCode == 200) {
				System.out.println("Web service executed successfully..");
				String responseBody = mPost.getResponseBodyAsString();
				System.out.println(statusCode + " *** " + responseBody);
			} else if (statusCode == 403) {
				System.out.println("Invalid username/password..");
			} else {
		} catch (FileNotFoundException e) {
			System.err.println("File not found for processing..");
		} catch (HttpException e) {
		} catch (IOException e) {
		} finally {
			if (mPost != null) {

Was this article helpful to you?