Code Monkey home page Code Monkey logo

dropboxoauth's Introduction

Dropbox OAuth Client for PHP

A modification of Abraham's TwitterOAuth library to work with Dropbox.

Slight fixes to abstract away the differences between the two site's implementation of the OAuth specifications. If you know how TwitterOAuth works, you'll have no problems implementing Dropbox with this one.

v0.2.0

  • Updated to use API version 1
  • Files Put is now supported through ->put() call

v0.1.0

  • Base functionality only, you can get files, not push files, yet.

Quick Links

Usage

Get Request Token and Redirect

$oauth = new DropboxOAuth($consumer_key,$consumer_secret);

$request = $oauth->getRequestToken($callback_url);

$url = $oauth->getAuthorizeURL($request);

Get Access Token

$oauth = new DropboxOAuth($consumer_key,$consumer_secret,$request['oauth_token'],$request['oauth_token_secret']);

$token = $oauth->getAccessToken();

Using the API

$oauth = new DropboxOAuth($consumer_key,$consumer_secret,$user_key,$user_secret);

$account = $oauth->get("https://api.dropbox.com/1/account/info");

$metadata = $oauth->get("https://api.dropbox.com/1/metadata/dropbox/");

$file = $oauth->pull("https://api-content.dropbox.com/1/files/dropbox/my-test-file.txt");

$upload = $oauth->put("https://api-content.dropbox.com/1/files_put/dropbox/test.txt","/path/to/file.txt");

Please note that ->pull() is used to ->get() without doing the automatic json_decode.

dropboxoauth's People

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  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.