Skip to content

Latest commit

 

History

History
79 lines (49 loc) · 1.72 KB

image.md

File metadata and controls

79 lines (49 loc) · 1.72 KB

The Image Client

The Image client wraps the image section of 46elks.se docs

Available services

Unlike Sms and Phone calls no sub services exist for the image client.

Access the client

The image client may be accessed like this

// Initialize client
use Tarre\Php46Elks\Client as Php46ElkClient;
$Php46ElksClient = new Php46ElkClient('username', 'password');

$image = $Php46ElksClient->image();

Get images

Get MMS Image History

// Initialize client
use Tarre\Php46Elks\Client as Php46ElkClient;
$Php46ElksClient = new Php46ElkClient('username', 'password');

$image = $Php46ElksClient->image();

$result = $image->get(); 

print_r($result);

Get image by id

Get MMS Image by ID

// Initialize client
use Tarre\Php46Elks\Client as Php46ElkClient;
$Php46ElksClient = new Php46ElkClient('username', 'password');

$image = $Php46ElksClient->image();

$result = $image->getById('enter id here'); 

print_r($result);

Get image file by id

Returns the image file of the image with the specified ID.

// Initialize client
use Tarre\Php46Elks\Client as Php46ElkClient;
$Php46ElksClient = new Php46ElkClient('username', 'password');

$image = $Php46ElksClient->image();

$result = $image->getFileById('enter id here'); 

// You can either save the file to your disk
$result->saveToDisk('/var/downloads', 'my-file.jpg');

// or get the raw image data
$result->getContent();