.\" Automatically generated by Pod::Man 2.25 (Pod::Simple 3.16) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is turned on, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .ie \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . nr % 0 . rr F .\} .el \{\ . de IX .. .\} .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "Net::Dropbox::API 3pm" .TH Net::Dropbox::API 3pm "2012-10-23" "perl v5.14.2" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Net::Dropbox::API \- A dropbox API interface .SH "VERSION" .IX Header "VERSION" Version 1.9.8 .SH "SYNOPSIS" .IX Header "SYNOPSIS" The Dropbox \s-1API\s0 is a OAuth based \s-1API\s0. I try to abstract as much away as possible so you should not need to know too much about it. This is how it works: .PP .Vb 1 \& use Net::Dropbox::API; \& \& my $box = Net::Dropbox::API\->new({key => \*(AqKEY\*(Aq, secret => \*(AqSECRET\*(Aq}); \& my $login_link = $box\->login; # user needs to click this link and login \& $box\->auth; # oauth keys get exchanged \& my $info = $box\->account_info; # and here we have our account info .Ve .PP See the examples for a working Mojolicious web client using the Dropbox \&\s-1API\s0. .PP You can find Dropbox's \s-1API\s0 documentation at .SH "FUNCTIONS" .IX Header "FUNCTIONS" .SS "login" .IX Subsection "login" This sets up the initial OAuth handshake and returns the login \s-1URL\s0. This \&\s-1URL\s0 has to be clicked by the user and the user then has to accept the application in dropbox. .PP Dropbox then redirects back to the callback \s-1URL\s0 defined with \&\f(CW\*(C`$self\->callback_url\*(C'\fR. If the user already accepted the application the redirect may happen without the user actually clicking anywhere. .SS "auth" .IX Subsection "auth" The auth method changes the initial request token into access token that we need for subsequent access to the \s-1API\s0. This method only has to be called once after login. .SS "account_info" .IX Subsection "account_info" account_info polls the users info from dropbox. .SS "list" .IX Subsection "list" lists all files in the path defined: .PP .Vb 2 \& $data = $box\->list(); # top\-level \& $data = $box\->list( "/Photos" ); # folder .Ve .PP The data returned is a ref to a hash containing various fields returned by Dropbox, including a \f(CW\*(C`hash\*(C'\fR value, which can be used later to check if Dropbox data beneath a specified folder has changed since the last call. .PP For this, \f(CW\*(C`list()\*(C'\fR accepts an optional 'hash' argument: .PP .Vb 2 \& $data = $box\->list({ hash => "ce9ccbfb8f255f234c93adcfef33b5a6" }, \& "/Photos"); .Ve .PP This will either return .PP .Vb 1 \& { http_response_code => 304 } .Ve .PP in which case nothing has changed since the last call, or .PP .Vb 3 \& { http_response_code => 200, \& # ... various other fields \& } .Ve .PP if there were modifications. .SS "copy" .IX Subsection "copy" copies a folder copy($from, \f(CW$to\fR) .SS "move" .IX Subsection "move" move a folder move($from, \f(CW$to\fR) .SS "mkdir" .IX Subsection "mkdir" creates a folder mkdir($path) .SS "delete" .IX Subsection "delete" delete a folder delete($path) .SS "view" .IX Subsection "view" creates a cookie protected link for the user to look at. view($path) .SS "metadata" .IX Subsection "metadata" creates a cookie protected link for the user to look at. metadata($path) .SS "putfile" .IX Subsection "putfile" uploads a file to dropbox .SS "getfile" .IX Subsection "getfile" get a file from dropbox .SS "debug" .IX Subsection "debug" Set this to a non-false value in order to print some debugging information to \s-1STDOUT\s0. \fIdebug\fR\|(1) .SH "INTERNAL API" .IX Header "INTERNAL API" .SS "_talk" .IX Subsection "_talk" _talk handles the access to the restricted resources. You should normally not need to access this directly. .SS "nonce" .IX Subsection "nonce" Generate a different nonce for every request. .SH "AUTHOR" .IX Header "AUTHOR" Lenz Gschwendtner, \f(CW\*(C`\*(C'\fR .PP With Bug fixes from: .PP Greg Knauss \f(CW\*(C`gknauss at eod.com\*(C'\fR .PP Chris Prather \f(CW\*(C`chris at prather.org\*(C'\fR .PP Shinichiro Aska .PP [ktdreyer] .PP SureVoIP .SH "BUGS" .IX Header "BUGS" Please report any bugs through the web interface at https://github.com/norbu09/Net\*(--Dropbox/issues . I will be notified, and then you'll automatically be notified of progress on your bug as I make changes. .SH "SUPPORT" .IX Header "SUPPORT" You can find documentation for this module with the perldoc command. .PP .Vb 1 \& perldoc Net::Dropbox::API .Ve .PP You can also look for information at: .IP "\(bu" 4 AnnoCPAN: Annotated \s-1CPAN\s0 documentation .Sp http://annocpan.org/dist/Net\-Dropbox\-API .IP "\(bu" 4 \&\s-1CPAN\s0 Ratings .Sp http://cpanratings.perl.org/d/Net\-Dropbox\-API .IP "\(bu" 4 Search \s-1CPAN\s0 .Sp http://search.cpan.org/dist/Net\-Dropbox\-API/ .SH "COPYRIGHT & LICENSE" .IX Header "COPYRIGHT & LICENSE" Copyright 2010 Lenz Gschwendtner. .PP This program is free software; you can redistribute it and/or modify it under the terms of either: the \s-1GNU\s0 General Public License as published by the Free Software Foundation; or the Artistic License. .PP See http://dev.perl.org/licenses/ for more information.