Run this command to install the SDK:

npm install cloudmersive-documentai-api-client --save


Or add this snippet to your package.json:

  "dependencies": {
    "cloudmersive-documentai-api-client": "^1.3.1"
  }


var CloudmersiveDocumentaiApiClient = require('cloudmersive-documentai-api-client');
var defaultClient = CloudmersiveDocumentaiApiClient.ApiClient.instance;

// Configure API key authorization: Apikey
var Apikey = defaultClient.authentications['Apikey'];
Apikey.apiKey = 'YOUR API KEY';



var apiInstance = new CloudmersiveDocumentaiApiClient.RunBatchJobApi();

var opts = { 
  'asyncJobID': "asyncJobID_example" // String | Job ID for the batch job to get the status of
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.getAsyncJobStatus(opts, callback);

Run this command to install the SDK:

pip install cloudmersive-documentai-api-client


from __future__ import print_function
import time
import cloudmersive_documentai_api_client
from cloudmersive_documentai_api_client.rest import ApiException
from pprint import pprint

# Configure API key authorization: Apikey
configuration = cloudmersive_documentai_api_client.Configuration()
configuration.api_key['Apikey'] = 'YOUR_API_KEY'



# create an instance of the API class
api_instance = cloudmersive_documentai_api_client.RunBatchJobApi(cloudmersive_documentai_api_client.ApiClient(configuration))
async_job_id = 'async_job_id_example' # str | Job ID for the batch job to get the status of (optional)

try:
    # Get the status and result of an Extract Document Batch Job
    api_response = api_instance.get_async_job_status(async_job_id=async_job_id)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling RunBatchJobApi->get_async_job_status: %s\n" % e)

Run this command to install the SDK:

Install-Package Cloudmersive.APIClient.NET.DocumentAI -Version 3.0.4


using System.Collections.Generic;
using System.Diagnostics;
using System.Net.Http;
using Cloudmersive.APIClient.NET.DocumentAI.Api;
using Cloudmersive.APIClient.NET.DocumentAI.Client;
using Cloudmersive.APIClient.NET.DocumentAI.Model;

namespace Example
{
    public class GetAsyncJobStatusExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://api.cloudmersive.com";
            // Configure API key authorization: Apikey
            config.AddApiKey("Apikey", "YOUR_API_KEY");
            
            // config.AddApiKeyPrefix("Apikey", "Bearer");

            // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes
            HttpClient httpClient = new HttpClient();
            HttpClientHandler httpClientHandler = new HttpClientHandler();
            var apiInstance = new RunBatchJobApi(httpClient, config, httpClientHandler);
            var asyncJobID = "asyncJobID_example";  // string | Job ID for the batch job to get the status of (optional) 

            try
            {
                // Get the status and result of an Extract Document Batch Job
                ExtractDocumentJobStatusResult result = apiInstance.GetAsyncJobStatus(asyncJobID);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling RunBatchJobApi.GetAsyncJobStatus: " + e.Message);
                Debug.Print("Status Code: " + e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

To install with Maven, add a reference to the repository in pom.xml:



And add a reference to the dependency in pom.xml:



To install with Gradle, add it in your root build.gradle at the end of repositories:



And add the dependency in build.gradle:



Run this command to install the SDK:

composer require cloudmersive/cloudmersive_documentai_api_client


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

// Configure API key authorization: Apikey
$config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('Apikey', 'YOUR_API_KEY');



$apiInstance = new Swagger\Client\Api\RunBatchJobApi(
    
    
    new GuzzleHttp\Client(),
    $config
);
$async_job_id = "async_job_id_example"; // string | Job ID for the batch job to get the status of

try {
    $result = $apiInstance->getAsyncJobStatus($async_job_id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling RunBatchJobApi->getAsyncJobStatus: ', $e->getMessage(), PHP_EOL;
}
?>

Add the Objective-C client to your Podfile:



Add the Ruby client to your Gemfile:

gem 'cloudmersive-documentai-api-client', '~> 2.2'


# load the gem
require 'cloudmersive-documentai-api-client'
# setup authorization
CloudmersiveDocumentaiApiClient.configure do |config|
  # Configure API key authorization: Apikey
  config.api_key['Apikey'] = 'YOUR API KEY'
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  #config.api_key_prefix['Apikey'] = 'Bearer'
end

api_instance = CloudmersiveDocumentaiApiClient::RunBatchJobApi.new

opts = { 
  async_job_id: 'async_job_id_example' # String | Job ID for the batch job to get the status of
}

begin
  #Get the status and result of an Extract Document Batch Job
  result = api_instance.get_async_job_status(opts)
  p result
rescue CloudmersiveDocumentaiApiClient::ApiError => e
  puts "Exception when calling RunBatchJobApi->get_async_job_status: #{e}"
end

Download and copy the /client folder into your Apex project:

Download Apex Client

SwagRunBatchJobApi api = new SwagRunBatchJobApi();
SwagClient client = api.getClient();

// Configure API key authorization: Apikey
ApiKeyAuth Apikey = (ApiKeyAuth) client.getAuthentication('Apikey');
Apikey.setApiKey('YOUR API KEY');

Map<String, Object> params = new Map<String, Object>{
    'asyncJobID' => 'asyncJobID_example'
};

try {
    // cross your fingers
    SwagExtractDocumentJobStatusResult result = api.getAsyncJobStatus(params);
    System.debug(result);
} catch (Swagger.ApiException e) {
    // ...handle your exceptions
}

Install libcurl in your C/C++ project:

libcurl/7.75.0
CURL *curl;
CURLcode res;
curl = curl_easy_init();
if(curl) {
     curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "GET");
     curl_easy_setopt(curl, CURLOPT_URL, "https://api.cloudmersive.com/document-ai/document/batch-job/batch-job/status?AsyncJobID=%3Cstring%3E");
     curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);
     curl_easy_setopt(curl, CURLOPT_DEFAULT_PROTOCOL, "https");
     struct curl_slist *headers = NULL;
     headers = curl_slist_append(headers, "Apikey: YOUR-API-KEY-HERE");
     curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
     res = curl_easy_perform(curl);
}
curl_easy_cleanup(curl);
curl --location --request GET 'https://api.cloudmersive.com/document-ai/document/batch-job/batch-job/status?AsyncJobID=%3Cstring%3E' \
--header 'Apikey: YOUR-API-KEY-HERE'
import Foundation
#if canImport(FoundationNetworking)
import FoundationNetworking
#endif

var semaphore = DispatchSemaphore (value: 0)

var request = URLRequest(url: URL(string: "https://api.cloudmersive.com/document-ai/document/batch-job/batch-job/status?AsyncJobID=%3Cstring%3E")!,timeoutInterval: Double.infinity)
request.addValue("YOUR-API-KEY-HERE", forHTTPHeaderField: "Apikey")

request.httpMethod = "GET"

let task = URLSession.shared.dataTask(with: request) { data, response, error in 
     guard let data = data else {
          print(String(describing: error))
          semaphore.signal()
          return
     }
     print(String(data: data, encoding: .utf8)!)
     semaphore.signal()
}

task.resume()
semaphore.wait()

This code snippet uses the built-in JavaScript XHR request capability


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

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

xhr.open("GET", "https://api.cloudmersive.com/document-ai/document/batch-job/batch-job/status?AsyncJobID=%3Cstring%3E");
xhr.setRequestHeader("Apikey", "YOUR-API-KEY-HERE");

xhr.send();
package main

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

func main() {

     url := "https://api.cloudmersive.com/document-ai/document/batch-job/batch-job/status?AsyncJobID=%3Cstring%3E"
     method := "GET"

     client := &http.Client {
     }
     req, err := http.NewRequest(method, url, nil)

     if err != nil {
          fmt.Println(err)
          return
     }
     req.Header.Add("Apikey", "YOUR-API-KEY-HERE")

     res, err := client.Do(req)
     if err != nil {
          fmt.Println(err)
          return
     }
     defer res.Body.Close()

     body, err := ioutil.ReadAll(res.Body)
     if err != nil {
          fmt.Println(err)
          return
     }
     fmt.Println(string(body))
}

Walkthrough Video