2017 © Pedro Peláez
 

library api-client-php

PHP Client for the API

image

vectorface/api-client-php

PHP Client for the API

  • Monday, December 9, 2013
  • by ckdarby
  • Repository
  • 3 Watchers
  • 1 Stars
  • 16 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 1 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

API-client-php

A very simple/naive JSON/REST API client on top of cURL., (*1)

Prerequisites

  • Must have username, password and url for the REST API
  • Must be running PHP >= 7.0

Example

<?php

require_once './vendor/autoload.php';

use VectorFace\Client\API;

/* Initialize the API client */
$api = new API([
    'username' => 'example',
    'password' => '3x4mpl3',
    'url' => 'http://domain.tld'
]);

/*
 * This will:
 *  - Make a request to
 *    http://domain.tld/users?filters=fname:Jon&fields=user_id,fname,lname
 *  - JSON-decode the response
 *  - return the result
 */
$response = $api->request('/users', [
    'filters' => 'fname:Jon',
    'fields' => 'user_id,fname,lname'
]);

// $response should contain a decoded JSON response from the API

The Versions

09/12 2013

dev-master

9999999-dev https://github.com/Vectorface/API-client-php/

PHP Client for the API

  Sources   Download

MIT

The Requires

  • ext-curl *
  • php >=5.4.0