2017 © Pedro Peláez
 

symfony-bundle yahoo-api-bundle

Yahoo OAuth2 protected APIs to fetch contacts

image

agupta/yahoo-api-bundle

Yahoo OAuth2 protected APIs to fetch contacts

  • Saturday, December 10, 2016
  • by agupta
  • Repository
  • 1 Watchers
  • 0 Stars
  • 24 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 14 % Grown

The README.md

A Symfony2 Wrapper for the Yahoo API., (*1)

Installation

Add this to your composer.json file:, (*2)

"require": {
    "agupta/yahoo-api-bundle": "dev-master",
}

or install using composer, (*3)

composer require agupta/yahoo-api-bundle:dev-master

Register bundle in app/AppKernel.php, (*4)

$bundles = array(
    // ...
    new Yahoo\ApiBundle\YahooApiBundle(),
);

Configuration

Add this to your config.yml:, (*5)

imports:
    # ...
    - { resource: "@YahooApiBundle/Resources/config/services.yml" }
yahoo_api:
    application_id: 'app-id'
    consumer_key: 'consumer-key'
    consumer_secret: 'consumer-secret'
    callback_url: 'callback-url'

Add this to your routing.yml:, (*6)

yahoo_api:
    resource: "@YahooApiBundle/Resources/config/routing.yml"
    prefix:   /

Usage

STEP1:, (*7)

Call this url for authorization and getting code from the Yahoo api:, (*8)

Above url will auto redirect to your callback_url with additional parameter 'code', (*9)

STEP2:, (*10)

Add following code in your callback_url action to get yahoo contacts:, (*11)

public function CallbackUrlAction(Request $request)
{
    // ...
    $code = $request->get('code',null); 
    if($code) {
        $yahooService = $this->get('AG.Yahoo.OAuth2.Service');  
        $contacts = $yahooService->getContacts($code);
        var_dump($contacts);
    }
    // ...
}

The Versions

10/12 2016

dev-master

9999999-dev https://github.com/ajay-gupta/YahooApiBundle

Yahoo OAuth2 protected APIs to fetch contacts

  Sources   Download

MIT

The Requires

  • php >=5.3.8

 

by Ajay Gupta

api bundle symfony yahoo contacts