PHP Class CloudConvert\Api

Http connections use guzzle http client api and result of request are object from this http wrapper
Author: Josias Montag ([email protected])
Show file Open project: cloudconvert/cloudconvert-php

Public Methods

Method Description
__construct ( string $api_key, Client $http_client = null ) Construct a new wrapper instance
convert ( array $parameters ) : Process Shortcut: Create a new Process and start it
createProcess ( array $parameters ) : Process Create a new Process
delete ( string $path, string $content = null, boolean $is_authenticated = true ) Wrap call to CloudConvert APIs for DELETE requests
get ( string $path, string $content = null, boolean $is_authenticated = true ) Wrap call to CloudConvert APIs for GET requests
getApiKey ( ) : string Get the current API Key
getHttpClient ( ) : Client Return instance of http client
post ( string $path, string $content, boolean $is_authenticated = true ) Wrap call to CloudConvert APIs for POST requests
put ( string $path, string $content, boolean $is_authenticated = true ) Wrap call to CloudConvert APIs for PUT requests

Private Methods

Method Description
rawCall ( string $method, string $path, string $content = null, boolean $is_authenticated = true ) : mixed This is the main method of this wrapper. It will sign a given query and return its result.

Method Details

__construct() public method

Construct a new wrapper instance
public __construct ( string $api_key, Client $http_client = null )
$api_key string Key of your application. You can get your API Key on https://cloudconvert.com/user/profile
$http_client GuzzleHttp\Client Instance of http client

convert() public method

Shortcut: Create a new Process and start it
public convert ( array $parameters ) : Process
$parameters array Parameters for starting the Process. See https://cloudconvert.com/apidoc#start
return Process

createProcess() public method

Create a new Process
public createProcess ( array $parameters ) : Process
$parameters array Parameters for creating the Process. See https://cloudconvert.com/apidoc#create
return Process

delete() public method

Wrap call to CloudConvert APIs for DELETE requests
public delete ( string $path, string $content = null, boolean $is_authenticated = true )
$path string path ask inside api
$content string content to send inside body of request
$is_authenticated boolean if the request use authentication

get() public method

Wrap call to CloudConvert APIs for GET requests
public get ( string $path, string $content = null, boolean $is_authenticated = true )
$path string path ask inside api
$content string content to send inside body of request
$is_authenticated boolean if the request use authentication

getApiKey() public method

Get the current API Key
public getApiKey ( ) : string
return string

getHttpClient() public method

Return instance of http client
public getHttpClient ( ) : Client
return GuzzleHttp\Client

post() public method

Wrap call to CloudConvert APIs for POST requests
public post ( string $path, string $content, boolean $is_authenticated = true )
$path string path ask inside api
$content string content to send inside body of request
$is_authenticated boolean if the request use authentication

put() public method

Wrap call to CloudConvert APIs for PUT requests
public put ( string $path, string $content, boolean $is_authenticated = true )
$path string path ask inside api
$content string content to send inside body of request
$is_authenticated boolean if the request use authentication