Coder Social home page Coder Social logo

hiworks-oauth-sdk's Introduction

Hiworks Oauth SDK for PHP

Build Status Latest Stable Version License

Hiworks Oauth v2 PHP 연동 모듈

Install

composer require cobiyu/hiworks-oauth-sdk

Usage

Note: Note: This version of this SDK for PHP requires PHP 5.6 or greater.

Doc Link: https://documenter.getpostman.com/view/6863253/S1TVWcri?version=latest#intro

Generate Hiworks SDK instance

$client = new \Hiworks\Hiworks($app_client_id,$app_password);

Get Access Token using Authorization Code

$client = new \Hiworks\Hiworks($app_client_id,$app_password);

// getAccessToken return Hiworks\Auth\AccessToken instance.
// $auth_code is received parameter(name:auth_code) in your app's callback.
$access_token = $client->getAccessToken->getAccessToken($auth_code);

echo $access_token->getAccessToken();   // print access_toekn (example. fh283nfdsialvcxzvclxzvcxz)

Get Hiworks API response using access token

// $path and $access token must be string.
// api result is object.
$get_response = $client->get($path, $access_token)
$post_response = $client->post($path, $access_token)
$put_response = $client->put($path, $access_token)
$delete_response = $client->delete($path, $access_token)

Exception

Hiworks\Exceptions\HiworksSDKException : package의 최상위 Exception

자세한 exception 내용이 필요하다면 , Hiworks\Exceptions 참조

catch(HiworksSDKException $e)
{
    /// some logic
}

hiworks-oauth-sdk's People

Contributors

cobiyu avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.