2017 © Pedro Peláez
 

library flowfact-api-php

A simple wrapper around the FLOWFACT API, featuring a fluent interface

image

gruentee/flowfact-api-php

A simple wrapper around the FLOWFACT API, featuring a fluent interface

  • Wednesday, August 3, 2016
  • by gruentee
  • Repository
  • 1 Watchers
  • 0 Stars
  • 10 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

flowfact-api-php

A simple wrapper around the FLOWFACT API., (*1)

  • Uses Guzzle for HTTP requests.
  • Features a fluent interface for building HTTP queries: build any resource path via dynamic method calls
  • Returns HTTP responses according to PSR-7

Usage example

Building resource paths (ie. /users/<UUID>/contacs/<UUID>) through chaining method calls with the name of the desired resource prefixed by either for or get. Single resources can be specified by passing the identifier as an argument to the call denoting the resource, same goes for adding query parameters., (*2)

The request is finally made by calling an HTTP method at the end of the chain., (*3)

// install via Composer
composer require gruentee/flowfact-api-php

// initialize client
$client = new Client('USERNAME', 'PASSWORD', 'CUSTOMER_ID', 'https://api.baseurl.tld/');

// build URL: prefix the desired resource with "get" or "for"
// /users/68ed219e-5755-11e6-8b77-86f30ca893d3/contacts
$client->getUsers("68ed219e-5755-11e6-8b77-86f30ca893d3")
    ->getContacts();
// submit request
$response = $client->get();

// POST /users/68ed219e-5755-11e6-8b77-86f30ca893d3/contacts
$data = [
    'name' => ['lastname' => 'TestUser']
];

$resp = $client->forUsers('AAC94B33-01F8-3783-B597-AE7456DF1B78')
    ->forContacts()
    ->post($data);


TODO

  • Map XML and JSON responses to PHP classes corresponding to response models

Thanks

Idea of intercepting method calls borrowed from [sendgrid/php-http-client](https://github .com/sendgrid/php-http-client/). :thumbsup:, (*4)

About

FLOWFACT logo ProfessionalCenter Logo, (*5)

This project was built during an educational cooperation project by the Professional Center of the University of Cologne and the FLOWFACT GmbH., (*6)

The Versions

03/08 2016

dev-master

9999999-dev https://github.com/gruentee/flowfact-api-php

A simple wrapper around the FLOWFACT API, featuring a fluent interface

  Sources   Download

MIT

The Requires

 

The Development Requires

api rest wrapper flowfact

31/07 2016

v0.1.3

0.1.3.0 https://github.com/gruentee/flowfact-api-php

A simple wrapper around the FLOWFACT API, featuring a fluent interface

  Sources   Download

MIT

The Requires

 

The Development Requires

api rest wrapper flowfact

29/07 2016

0.1

0.1.0.0

A simple wrapper around the FLOWFACT API, featuring a fluent interface

  Sources   Download

The Requires

 

The Development Requires