2017 © Pedro Peláez
 

library singly

A PHP library for the Singly API

image

singly/singly

A PHP library for the Singly API

  • Tuesday, June 18, 2013
  • by tom_anderson
  • Repository
  • 1 Watchers
  • 1 Stars
  • 6 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

Singly PHP Library

This library abstracts the Singly API to PHP service object., (*1)

Example

An example application is included on the example branch. See the README.md in that branch for details., (*2)

Installation

  1. edit composer.json file with following contents:, (*3)

    json "require": { "singly/singly": "dev-master" }, (*4)

  2. install composer via curl -s http://getcomposer.org/installer | php (on windows, download http://getcomposer.org/installer and execute it with PHP)
  3. run php composer.phar install

Use

Create the Singly service, (*5)

use \Singly\Service\Singly;

Singly::configure($clientId, $clientSecret, $redirectUri);
Singly::setAccessToken('access_token');

// Get a login url to authorize a service
$loginUrl = Singly::getLoginUrl('facebook');

De-authorize a service. This will un-link a service from the user's profile., (*6)

Singly::deleteService('facebook');

De-authorize all services. This will delete a user's profile., (*7)

Singly::deleteAll();

Get an access token in a redirectUri / callback handler. Getting an access token with code sets to access token too., (*8)

$code = $_GET['code'];
Singly::getAccessToken($code);

API Services, (*9)

// Get Login URL
Singly::getLoginUrl($service, $parameters = array());
// Valid options: access_token, scope, flag

// Simple Unified Profile
Singly::getProfile($access_token = null);

// Profiles
Singly::getProfiles($service = null, $parameters = array());

// Services
Singly::getServices($service = null, $endpoint = null, $parameters = array());

// Types
Singly::getTypes($type = null, $parameters = array());

// Post to Types
// https://singly.com/docs/sharing
Singly::postTypes($type, $parameters = array());

// Global Items
Singly::getById($id);

// Proxy to Service API
Singly::getProxy($service, $path, $parameters = array())

// By URL
Singly::getByUrl($url, $parameters = array());

// By Contact ID
Singly::getByContact($service, $id, $parameters = array());

// Friends
// https://singly.com/docs/friends
Singly::getFriends($service = null, $parameters = array());

The Versions

18/06 2013

dev-master

9999999-dev http://singly.com

A PHP library for the Singly API

  Sources   Download

MIT

The Requires

 

php singly

12/01 2013

dev-example

dev-example

  Sources   Download

The Requires