PHP library for communicating with the GroupDocs.Conversion Cloud API
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src/GroupDocs/Conversion
tests/GroupDocs/Conversion
.gitignore
LICENSE
README.md
composer.bat
composer.json
composer.lock
composer.phar
phpcs.xml
phpunit.xml

README.md

GroupDocs.Conversion Cloud SDK for PHP

This repository contains GroupDocs.Conversion Cloud SDK for PHP source code. This SDK allows you to work with GroupDocs.Conversion Cloud REST APIs in your PHP applications.

Dependencies

  • PHP 5.5 or later

Authorization

To use SDK you need AppSID and AppKey authorization keys. You can your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required).

Installation & Usage

Composer

The package is available at Packagist and it can be installed via Composer by executing following command:

composer require groupdocscloud/groupdocs-conversion-cloud

Or you can install SDK via Composer directly from this repository, add the following to composer.json:

{
  "repositories": [
    {
      "type": "git",
      "url": "https://github.com/groupdocs-conversion-cloud/groupdocs-conversion-cloud-php.git"
    }
  ],
  "require": {
    "groupdocscloud/groupdocs-conversion-cloud": "*"
  }
}

Then run composer install

Manual Installation

Clone or download this repository, then run composer install in the root directory to install dependencies and include autoload.php into your code file:

require_once('/path/to/groupdocs-conversion-cloud-php/vendor/autoload.php');

Tests

To run the unit tests set your AppSID and AppKey in json.config and execute following commands:

composer install
./vendor/bin/phpunit

Getting Started

Please follow the installation procedure and then run the following:

<?php

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

//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required).
$configuration = new GroupDocs\Conversion\Configuration();
$configuration->setAppSid("XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX");
$configuration->setAppKey("XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX");

$conversionApi = new GroupDocs\Conversion\ConversionApi($configuration); 

try {
    $request = new GroupDocs\Conversion\Model\Requests\GetAllPossibleConversionsRequest();
    $response = $conversionApi->getAllPossibleConversions($request);

    foreach ($response->getConversions() as $key => $conversion) {
        echo $conversion->getSourceFileType() . " - " .  join(",", $conversion->getPossibleConversions()) . "\n";
    }
} catch (Exception $e) {
    echo  "Something went wrong: ",  $e->getMessage(), "\n";
    PHP_EOL;
}

?>

Licensing

GroupDocs.Conversion for Cloud SDK for PHP is licensed under MIT License.

Resources

Contact Us

Your feedback is very important to us. Please feel free to contact us using our Support Forums.