All Projects → simivar → Genius Php

simivar / Genius Php

Licence: mit
PHP library for Genius API (http://genius.com/developers)

Projects that are alternatives of or similar to Genius Php

Node Vault
Client for HashiCorp's Vault
Stars: ✭ 391 (+3810%)
Mutual labels:  api, api-client
Abclinuxuapi
API for http://abclinuxu.cz.
Stars: ✭ 8 (-20%)
Mutual labels:  api, api-client
Datafire
A framework for building integrations and APIs
Stars: ✭ 487 (+4770%)
Mutual labels:  api, api-client
Hubspot Php
HubSpot PHP API Client
Stars: ✭ 273 (+2630%)
Mutual labels:  api, api-client
Pizzly
The simplest, fastest way to integrate your app with an OAuth API 😋
Stars: ✭ 796 (+7860%)
Mutual labels:  api, api-client
Insomnia
The open-source, cross-platform API client for GraphQL, REST, and gRPC.
Stars: ✭ 18,969 (+189590%)
Mutual labels:  api, api-client
Client
DigitalOcean API v2 client for PHP
Stars: ✭ 604 (+5940%)
Mutual labels:  api, api-client
Protoman
Postman for protobuf APIs
Stars: ✭ 241 (+2310%)
Mutual labels:  api, api-client
Client
GitLab API v4 client for PHP
Stars: ✭ 763 (+7530%)
Mutual labels:  api, api-client
Unifi Api Browser
Tool to browse data exposed by Ubiquiti's UniFi Controller API (demo: https://api-browser-demo.artofwifi.net/)
Stars: ✭ 677 (+6670%)
Mutual labels:  api, api-client
Php Curl Class
PHP Curl Class makes it easy to send HTTP requests and integrate with web APIs
Stars: ✭ 2,903 (+28930%)
Mutual labels:  api, api-client
Slack
🎉✨ Slack API client for Node and browsers.
Stars: ✭ 903 (+8930%)
Mutual labels:  api, api-client
Pymisp
Python library using the MISP Rest API
Stars: ✭ 254 (+2440%)
Mutual labels:  api, api-client
Diplomat
A HTTP Ruby API for Consul
Stars: ✭ 358 (+3480%)
Mutual labels:  api, api-client
Httpie
As easy as /aitch-tee-tee-pie/ 🥧 Modern, user-friendly command-line HTTP client for the API era. JSON support, colors, sessions, downloads, plugins & more. https://twitter.com/httpie
Stars: ✭ 53,052 (+530420%)
Mutual labels:  api, api-client
Unifi Api Client
A PHP API client class to interact with Ubiquiti's UniFi Controller API
Stars: ✭ 602 (+5920%)
Mutual labels:  api, api-client
Twitch
Interact with Twitch's API, chat, PubSub and subscribe to WebHooks.
Stars: ✭ 237 (+2270%)
Mutual labels:  api, api-client
Coinapi Sdk
SDKs for CoinAPI
Stars: ✭ 238 (+2280%)
Mutual labels:  api, api-client
Pyowm
A Python wrapper around the OpenWeatherMap web API
Stars: ✭ 654 (+6440%)
Mutual labels:  api, api-client
Cv4pve Api Java
Proxmox VE Client API JAVA
Stars: ✭ 17 (+70%)
Mutual labels:  api, api-client

Genius PHP

Genius PHP is a open source library that allows you to access Genius API from your PHP application. It supports oAuth 2 from version 1.0.

Getting started

Genius PHP is avialable via Composer. Version 1.0 does not implement HTTP Client on it's own anymore and uses HTTPlug abstraction so you are free to choose any HTTP Client you want that depends on php-http/client-implementation virutal package.

composer require simivar/genius-php php-http/message php-http/guzzle6-adapter

Usage

Note: This version of Genius PHP requires PHP version of 5.6 or higher.

You can use every resource available with classes from Resources namespace. You can create main Genius object and use getters or create every object on your own.

require_once('vendor/autoload.php');

$authentication = new \Genius\Authentication\OAuth2(
  'YOUR_CLIENT_ID',
  'YOUR_CLIENT_SECRET',
  'YOUR_REDIRECT_URL',
  new \Genius\Authentication\Scope([
      \Genius\Authentication\Scope::SCOPE_ME,
      \Genius\Authentication\Scope::SCOPE_CREATE_ANNOTATION,
      \Genius\Authentication\Scope::SCOPE_MANAGE_ANNOTATION,
      \Genius\Authentication\Scope::SCOPE_VOTE,
  ]),
  null
);

if (isset($_GET[ 'code' ])) {
    $authentication->refreshToken($_GET[ 'code' ]);
} else {
    // read access token you got for user from your database or redirect him
    if (!$accessTokenFromDatabase) {
        header('Location: ' . $oauth->getAuthUrl());
    } else {
        $oauth->setAccessToken($accessTokenFromDatabase);
    }
}

$genius = new \Genius\Genius($authentication);
$upvoteAnnotation = $genius->getAnnotationsResource()->upvote(11852248);

Complete documentation, installation instructions, and examples are available at: http://simivar.github.io/Genius-PHP/.

Versioning

Genius PHP is created using Semver. All minor and patch updates are backwards compatibile. 0.1 branch is no longer maintained.

License

Please see the license file for more information.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].