Using CloudConvert API in WordPress

Just tested on my end, and it’s working fine. Looks like something went wrong with the installation. Here are steps to follow to get it working:

  1. In the plug-in root directory create composer.json file with the following content: { "name": "Example Application", "description": "This is an example", "require": { "cloudconvert/cloudconvert-php": "2.2.*" } }
  2. run composer install command on the same directory (in case you haven’t installed composer, you can download and install from here). It will install cloudconvert with dependencies into the vendor directory, and will create vendor/autoload.php which you will include in your project.
  3. require autoload.php from your plug-in: require __DIR__ . '/vendor/autoload.php'; use \CloudConvert\Api; $api = new Api("your_api_key"); var_dump($api); exit;

You can wrap the functionality you use cloudconvert in a class, attach hooks, and include that file whenever you need to operate with.

Leave a Comment