class Client

Helper class to interface with CloudConvert API

Constants

CC_API

URL for CloudConvert api

Properties

string $apikey Store user api key

Methods

string
_createRequest(string[] $params)

Prepare a request from parameters in an array

__construct(string $apikey)

Constructor

object
listConversions()

Get a list of conversions

deleteConversion(string $url)

Delete conversion

deleteConversions()

Delete all conversions

object
convertDownload(string $inputformat, string $outputformat, string $fileurl, array $params = array())

Convert a file that'll we downloaded by cloudconvert servers to be processed

object
convertUploadData(string $inputformat, string $outputformat, string $data, array $params = array())

Convert some data (to be uploaded to CloudConvert)

object
convertUpload(string $inputformat, string $outputformat, string $file, array $params = array())

Convert a file that'll be uploaded to cloudconvert servers to be processed

execute(string $verb, string $url, array $params = array())

Execute the request

Details

at line 29
protected string _createRequest(string[] $params)

Prepare a request from parameters in an array

Parameters

string[] $params Parameters for the request (associative array key=value)

Return Value

string The params converted to a URL query-string

at line 52
__construct(string $apikey)

Constructor

Parameters

string $apikey The user API key (fetch it from your CloudConvert account)

at line 63
object listConversions()

Get a list of conversions

Return Value

object The list of conversions as a litteral object

at line 75
deleteConversion(string $url)

Delete conversion

Parameters

string $url URL of the conversion to delete ; the URL is returned by listConversions, for example

at line 84
deleteConversions()

Delete all conversions

at line 103
object convertDownload(string $inputformat, string $outputformat, string $fileurl, array $params = array())

Convert a file that'll we downloaded by cloudconvert servers to be processed

Parameters

string $inputformat The input format ('pdf', 'doc', etc.)
string $outputformat The output format ('jpg', 'txt', etc.)
string $fileurl The URL of the file on your webserver
array $params Optionnal parameters

Return Value

object Object litteral describing the request response

at line 125
object convertUploadData(string $inputformat, string $outputformat, string $data, array $params = array())

Convert some data (to be uploaded to CloudConvert)

Parameters

string $inputformat The input format ('pdf', 'doc', etc.)
string $outputformat The output format ('jpg', 'txt', etc.)
string $data String containing the data to convert
array $params Optionnal parameters

Return Value

object Object litteral describing the request response

at line 156
object convertUpload(string $inputformat, string $outputformat, string $file, array $params = array())

Convert a file that'll be uploaded to cloudconvert servers to be processed

Parameters

string $inputformat The input format ('pdf', 'doc', etc.)
string $outputformat The output format ('jpg', 'txt', etc.)
string $file The local path of the file to upload
array $params Optionnal parameters

Return Value

object Object litteral describing the request response

at line 176
execute(string $verb, string $url, array $params = array())

Execute the request

Parameters

string $verb GET/POST/DELETE http verb
string $url CloudConvert API url
array $params Request parameters