ner0tic/php-api-core

core elements of a REST styled api walker

2.0.4 2013-05-06 00:00 UTC

This package is not auto-updated.

Last update: 2024-12-21 16:15:25 UTC


README

ORM agnostic php library to access REST apis

Usage

use Ner0tic\ApiEngine\Api\AbstractApi;

$api = new AbstractApi();
$client = $api->getClient();

If you have api keys to use, mash them into a pem file and set the certificate option to the path of the file.

$client->setOption('certificate', $pem_file);

Make a query

$result = $api->get($endpoint, $parameters, $request_options);

Working example:

use Ner0tic\ApiEngine\Api\AbstractApi();

$api = new AbstractApi();
$client = $api->getClient();

$users = $client->get('users', array('last_name' => 'smith'));

foreach($users as $user)
  $user = new \Acme\UserBundle\Entity\User($user);

// ... use $users as needed