Below is an end-to-end example of submitting a request for various methods using C# programming language:


// Simple program to showcasing how to queue up and run multiple requests using the LEADTOOLS CloudServices.
// In order to run this program, the following changes will need to be added:
//	1) Place your Application ID in the AppId variable in the InitClient method.
//	2) Place your Application Password in the Password variable in the InitClient method.
//
// The program will perform the following operations in order:
//	1)Perform an UploadFile request to the LEADTOOLS CloudServices.  A successfully made request will return a unique identifier.
//    We will use this identifier to queue up further methods. 
//	2)We will queue up an ExtractText method using the identifier that was returned from the UploadFile method. 
//	3)After we verify the ExtractText method was queued, we will then queue up a Conversion method to convert the file to TIFF.
//  4)Once the Conversion request has been queued, we will make a call to the Run method.  This will mark the file as ready to be processed.
//    **Note** Once a file has been marked for processing, or has finished processing, no further requests can be queued or run on that file.
//	5)We will then query the services using the GUID -- if the file is finished processing, the body will contain all the 
//	  request data.
//  6)We will take the json data that was returned, parse it, and display all the information that was returned. 

// This program makes use of the following NuGet Packages:
//  1) Newtonsoft.Json

using System;
using System.Text;
using System.Threading.Tasks;
using System.Net;
using System.Net.Http;
using System.Net.Http.Headers;
using System.IO;
using Newtonsoft.Json.Linq;

namespace Azure_Code_Snippets.Tutorial_Code
{
	class CloudServices_Queueing
	{
		private string hostedServicesUrl = "https://azure.leadtools.com/api/";
		public async Task Queue()
		{
			var client = InitClient();

			// If using URL to the file
			string fileURL = "https://www.leadtools.com/support/publicforumimages/test/multipage.tif";
			string uploadUrl = string.Format("UploadFile?fileurl={0}", fileURL);
			var result = await client.PostAsync(uploadUrl, null);

			/*
			//If uploading a file as multi-part content:
			HttpContent byteContent = new ByteArrayContent(File.ReadAllBytes(@"path/to/file"));
			byteContent.Headers.ContentDisposition = new ContentDispositionHeaderValue("form-data")
			{
				Name = "attachment",
				FileName = "file-name"
			};
			var formData = new MultipartFormDataContent();
			formData.Add(byteContent, "formFieldName");

			string uploadUrl = "UploadFile";
			var result = await client.PostAsync(uploadUrl, formData);
			formData.Dispose();
			*/

			if (result.StatusCode == HttpStatusCode.OK)
			{
				//Unique ID returned by the services
				string id = await result.Content.ReadAsStringAsync();
				Console.WriteLine("Unique ID returned by the services: " + id);
				await CheckFileForVerification(id, client);
			}
			else
				Console.WriteLine("Request failed with the following response: " + result.StatusCode);
		}

		private async Task QueueExtractText(string id, HttpClient client)
		{
			//The first page in the file to mark for processing
			int firstPage = 1;

			//Sending a value of -1 will indicate to the service that all pages in the file should be processed.
			int lastPage = -1;

			string recognitionUrl = string.Format("Recognition/ExtractText?firstPage={0}&lastPage={1}&guid={2}", firstPage, lastPage, id);

			var result = await client.PostAsync(recognitionUrl, null);
			if (result.StatusCode == HttpStatusCode.OK)
				await QueueConversion(id, client);
			else
				Console.WriteLine("Request failed with the following response: " + result.StatusCode);
		}

		private async Task QueueConversion(string id, HttpClient client)
		{
			//The first page in the file to mark for processing
			int firstPage = 1;

			//Sending a value of -1 will indicate to the service that all pages in the file should be processed.
			int lastPage = -1;

			//Enum corresponding to the output format for the file. For the purposes of this script, we will be converting to tif.
			int fileFormat = 4;

			string conversionUrl = string.Format("Conversion/Convert?firstPage={0}&lastPage={1}&guid={2}&format={3}", firstPage, lastPage, id, fileFormat);

			var result = await client.PostAsync(conversionUrl, null);
			if (result.StatusCode == HttpStatusCode.OK)
				await Run(id, client);
			else
				Console.WriteLine("Conversion Request failed to queue with the following response: " + result.StatusCode);
		}

		private async Task Run(string id, HttpClient client)
		{
			string uploadUrl = string.Format("Run?id={0}", id);
			var result = await client.PostAsync(uploadUrl, null);
			if (result.StatusCode == HttpStatusCode.OK)
				await Query(id, client);
			else
				Console.WriteLine("Request failed with the following response: " + result.StatusCode);
		}

		private async Task CheckFileForVerification(string id, HttpClient client)
		{
			string queryUrl = string.Format("Query?id={0}", id.ToString());
			var result = await client.PostAsync(queryUrl, null);
			var returnedContent = await result.Content.ReadAsStringAsync();
			var returnedData = JObject.Parse(returnedContent);
			var fileStatus = (int)returnedData.SelectToken("FileStatus");
			if (fileStatus == 123)
			{
				//The file is still being verified.  We will check every half a second to make sure that the file has been verified
				await Task.Delay(500);
				await Query(id, client);
				return;
			}
			if(fileStatus == 122)
				QueueExtractText(string id, HttpClient client);
			else
				Console.WriteLine("File failed verification with File Status: " + fileStatus);
		}

		private async Task Query(string id, HttpClient client)
		{
			string queryUrl = string.Format("Query?id={0}", id.ToString());
			var result = await client.PostAsync(queryUrl, null);
			var returnedContent = await result.Content.ReadAsStringAsync();
			var returnedData = JObject.Parse(returnedContent);
			if ((int)returnedData.SelectToken("FileStatus") == 100)
			{
				//The file is still being processed -- we will sleep the current thread for 5 seconds before trying again. 
				await Task.Delay(5000);
				await Query(id, client);
				return;
			}

			Console.WriteLine("File has finished processing with return code: " + returnedData.SelectToken("FileStatus"));
			if ((int)returnedData.SelectToken("FileStatus") != 200)
				return;

			ParseJson(returnedData.SelectToken("RequestData").ToString());
		}

		private void ParseJson(string json)
		{
			JArray requestArray = JArray.Parse(json);
			foreach (var requestReturn in requestArray)
			{
				Console.WriteLine("Service Type: " + requestReturn.SelectToken("ServiceType"));
				Console.WriteLine("Returned Data:");
				Console.WriteLine();
				if (requestReturn.SelectToken("ServiceType").ToString() == "Conversion")
				{
					var UrlArray = JArray.Parse(requestReturn.SelectToken("urls").ToString());
					foreach (var obj in UrlArray)
						Console.WriteLine(obj.ToString());
				}
				else
				{
					Console.WriteLine("Returned Data:" + requestReturn.SelectToken("data"));
				}
				Console.WriteLine("***********************************************");
			}
		}

		private HttpClient InitClient()
		{
			string AppId = "Replace with Application ID";
			string Password = "Replace with Application Password";

			HttpClient client = new HttpClient();
			client.BaseAddress = new Uri(hostedServicesUrl);
			client.DefaultRequestHeaders.Accept.Clear();
			client.DefaultRequestHeaders.Accept.Add(new 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;
		}
	}
}



Note: This example uses the following additional third-party libraries: Newtonsoft.Json.