Free Support Forum -

Convert Microsoft Word Document to HTML in PHP using Aspose.Words REST API authentication issue

I have downloaded the API of the PHP and it’s my first application. Can you please help me to get the authentication for my first app?


Thanks for your interest in Aspose. Please sign up with and get your APP Key and SID for authentication.

I already have that. I have below queries:

  1. Where should we update our credentials after downloading the SDK
  2. What type of credentials I need to set before run the code
  3. If access token is required then how to generate it


Thanks for your inquiry. Please note when you use the SDKs, then you do not need to generate the access token yourself, SDK will take care of it. You only need to pass your credentials in your code. Please check the installation and sample usage section from readme file. For further reference please check a sample code snippet after installing PHP SDK from packagist.


use Aspose\Words\Configuration;
use Aspose\Words\WordsApi;
use Aspose\Words\Model\Requests;
use Aspose\Words\Model\SaveOptionsData;

//TODO: Get your AppSID and AppKey at (free registration is required).

$config = new Configuration();
$words = new WordsApi(null, $config);

try {	

    $format = "docx";
    $file = "testbullet.html";
    $request = new Requests\ConvertDocumentRequest($file, $format);
    $result = $words->convertDocument($request);	
    echo "Completed!!!!";
} catch (Exception $e) {
    echo  "Something went wrong: ",  $e->getMessage(), "\n";