2017 © Pedro Peláez
 

library iweventos-api-client

IWEventos api client

image

dmandrade/iweventos-api-client

IWEventos api client

  • Thursday, May 4, 2017
  • by dmandrade
  • Repository
  • 1 Watchers
  • 0 Stars
  • 39 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

IWEventos Api Client

PHP Library based on Guzzle to consume IWEventos API., (*1)

The biggest advantage in using Guzzle is that you can easely attach Guzzle plugins to your client. Here, for example,you can see how to attach the log plugin and write all your requests to a file., (*2)

For more information about api methods, see Official documentation for IWEventos API, (*3)

To use this api you must have an access token and the server ip authenticated next to IWEventos, (*4)

Installation

The recommended way to install this library is through Composer. For information about Composer and how to install in look here., (*5)

From the command line run, (*6)

composer require dmandrade/iweventos-api-client

Usage

<?php

// This file is generated by Composer
require_once 'vendor/autoload.php';

$iweventos = new \Dmandrade\IWEventos\Api\Client("insert_here_api_base_url", "insert_here_api_access_token");

$response = $iweventos->eventos();

print_r($response);

cURL options

If you want to set a specific timeout, sust set the cURL timeout options in the client:, (*7)


$iweventos = new \Dmandrade\IWEventos\Api\Client("insert_here_api_base_url", "insert_here_api_access_token"); // set cURL timeout, you can specify any cURL options $iweventos->setConfig(array( 'curl.options' => array( CURLOPT_TIMEOUT => 2, CURLOPT_CONNECTTIMEOUT => 2 ) )); $response = $iweventos->eventos(); print_r($response);

Available method

  • congressistasById(array|null $parameters = null)
  • congressistasBy(array|null $parameters = null)
  • datas(array|null $parameters = null)
  • salas(array|null $parameters = null)
  • tipoAtividades(array|null $parameters = null)
  • eventos(array|null $parameters = null)
  • funcoesPalestrantes(array|null $parameters = null)
  • palestrantes(array|null $parameters = null)
  • atividades(array|null $parameters = null)
  • subatividades(array|null $parameters = null)

Attach Guzzle plugin

Here you can see how to attach Guzzle Log plug to your client and save all your requests to a file., (*8)

NB: To run this script you need monolog/monolog, (*9)

<?php
// This file is generated by Composer
require_once 'vendor/autoload.php';

use Guzzle\Log\MessageFormatter;
use Guzzle\Log\MonologLogAdapter;
use Guzzle\Plugin\Log\LogPlugin;
use Monolog\Handler\StreamHandler;
use Monolog\Logger;

$logger = new Logger('client');
$logger->pushHandler(new StreamHandler('/tmp/iweventos_api.log'));
$adapter = new MonologLogAdapter($logger);
$logPlugin = new LogPlugin($adapter, MessageFormatter::DEBUG_FORMAT);

$iweventos = new \Dmandrade\IWEventos\Api\Client("insert_here_api_base_url", "insert_here_api_access_token");;
$iweventos->addSubscriber($logPlugin);

$response = $iweventos->eventos();

print_r($response);

Now in /tmp/iweventos_api.log you can see all your requests., (*10)

The Versions

04/05 2017

dev-master

9999999-dev

IWEventos api client

  Sources   Download

MIT

The Requires

 

api client guzzle iweventos

04/05 2017

1.0.0

1.0.0.0

IWEventos api client

  Sources   Download

MIT

The Requires

 

api client guzzle iweventos