// For complete examples and data files, please go to 
https://github.com/aspose-words-cloud/aspose-words-cloud-dotnet

// Get client credentials from https://dashboard.aspose.cloud/
string clientSecret = "4d84d5f6584160cbd91dba1fe145db14";
string clientID = "bb959721-5780-4be6-be35-ff5c3a6aa4a2";

// create configuration object using ClinetID and Client Secret details
var config = new Aspose.Words.Cloud.Sdk.Configuration { ClientId = clientID, ClientSecret = clientSecret };
// initialize WordsApi instance
var wordsApi = new WordsApi(config);

// input word document
string inputFile = "file-sample.docx";
string format = "HTML";
string resultant = "converted.html";

try
{
 // load the file from local drive
    using (var file = System.IO.File.OpenRead(inputFile))
    {
        var uploadFileRequest = new UploadFileRequest(file, inputFile);
        
        // upload file to Cloud storage
        wordsApi.UploadFile(uploadFileRequest);
   }
    
    // create DocumentWithFormat request object
    var response = new GetDocumentWithFormatRequest(inputFile, format,outPath: resultant);
    
    // trigger the document operation
    wordsApi.GetDocumentWithFormat(response);

    // print success message if conversion is successful
    if (response != null && response.Equals("OK"))
    {
        Console.WriteLine("Word to HTML conversion successfull !");
        Console.ReadKey();
    }
}catch (Exception ex)
{
    Console.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}