Marks a file for processing and can be called with a POST or GET Request to the following URL:
No additional parameters.
A successful request will return a JSON object containing the number of pages remaining, and the number of pages that are queued for the application.
//This sample uses the Request NodeJs library.
const request = require('request');
var servicesUrl = "https://azure.leadtools.com/api/";
var checkPagesUrl = servicesUrl + "CheckPages";
request.post(getRequestOptions(checkPagesUrl), requestCallback);
function requestCallback(error, response, body){
if(!error && response.statusCode == 200){
console.log(body);
}else{
console.log("Request failed with status code: " + response.statusCode);
}
}
function getRequestOptions(url){
//Function to generate and return HTTP request options.
var requestOptions ={
url: url,
headers: {
'Content-Length' : 0
},
auth: {
user:"Enter Application ID",
password:"Enter Application Password"
}
};
return requestOptions;
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Threading;
using System.Net;
using System.Net.Http;
using System.Net.Http.Headers;
using Newtonsoft.Json.Linq;
namespace Azure_Code_Snippets.DocumentationSnippets
{
class CloudServices_CheckPages_Demo
{
private string hostedServicesUrl = "https://azure.leadtools.com/api/";
public async void CheckPages()
{
string checkPagesUrl = "CheckPages";
var client = InitClient();
var result = await client.PostAsync(checkPagesUrl, null);
if (result.StatusCode == HttpStatusCode.OK)
{
//Unique ID returned by the services
string serializedPages = await result.Content.ReadAsStringAsync();
var pageObject= JObject.Parse(serializedPages) ;
Console.WriteLine("Pages Remaining: " + returnedData.SelectToken("RemainingPages"));
Console.WriteLine("Queued PAges: " + returnedData.SelectToken("QueuedPages"));
}
else
Console.WriteLine("Request failed with the following response: " + result.StatusCode);
}
private HttpClient InitClient()
{
string AppId = "Enter Application ID";
string Password = "Enter Application Password";
HttpClient client = new HttpClient();
client.BaseAddress = new Uri(hostedServicesUrl);
client.DefaultRequestHeaders.Accept.Clear();
client.DefaultRequestHeaders.Accept.Add(new System.Net.Http.Headers.MediaTypeWithQualityHeaderValue("application/json"));
string authData = string.Format("{0}:{1}", AppId, Password);
string authHeaderValue = Convert.ToBase64String(Encoding.UTF8.GetBytes(authData));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", authHeaderValue);
return client;
}
}
}
#Simple script to make an ExtractBarcodes request to the LEADTOOLS CloudServices and parse the resulting JSON.
import requests, sys, time
servicesUrl = 'https://azure.leadtools.com/api/'
baseCheckPagesUrl ='{}CheckPages'
baseCheckPagesUrl = baseCheckPagesUrl.format(servicesUrl)
#The application ID.
appId = "Enter Application ID";
#The application password.
password = "Enter Application Password";
request = requests.post(baseCheckPagesUrl, auth=(appId, password))
if request.status_code != 200:
print("Error sending the conversion request \n")
print(request.text)
sys.exit()
print(request.text);
<?php
$servicesBaseUrl = "https://azure.leadtools.com/api/";
$checkPagesUrl = "%sCheckPages";
$checkPagesUrl = sprintf($checkPagesUrl, $servicesBaseUrl);
$requestOptions = GeneratePostOptions($checkPagesUrl);
$request = curl_init();
curl_setopt_array($request, $requestOptions);
if(!$response = curl_exec($request)) //Make sure that the request was successful
{
if(curl_errno($request)){
echo "There was an error queueing the request \n\r";
echo curl_error($request);
curl_close($request);
return false;
}
}
curl_close($request);
echo $response;
function GeneratePostOptions($url)
{
$appId = "Enter Application ID";
$password = "Enter Application Password";
$headers = array(
"Content-Length : 0"
);
$postOptions = array(
CURLOPT_POST => 1,
CURLOPT_URL => $url,
CURLOPT_FRESH_CONNECT => 1,
CURLOPT_RETURNTRANSFER => 1,
CURLOPT_USERPWD => "$appId:$password",
CURLOPT_FORBID_REUSE => 1,
CURLOPT_HTTPHEADER => $headers
);
return $postOptions;
}
?>
use base 'HTTP::Message';
use LWP::UserAgent ();
my $servicesUrl = "https://azure.leadtools.com/api/";
my $appId = 'Enter Application ID';
my $password = 'Enter Application Password';
my $headers = HTTP::Headers->new(
Content_Length => 0
);
$headers->authorization_basic($appId, $password);
#The User Agent to be used when making requests
my $ua = LWP::UserAgent->new;
my $checkPagesUrl = $servicesUrl . 'CheckPages';
my $request = HTTP::Request->new(POST => $checkPagesUrl, $headers);
my $response = $ua->request($request);
if(!$response->is_success){
print STDERR $response->status_line, "\n";
exit;
}