Net::D...ox::API(3pm)
๐ Net::Dropbox::API ๐
okay bestie, gather round, because this is Net::Dropbox::API โ a whole entire Dropbox API interface, living its best life in the User Contributed Perl Documentation section (3pm). yes it's a Perl module. yes it's iconic. let's get into it ๐ซถ
โจ NAME โจ
Net::Dropbox::API โ a Dropbox API interface. that's the whole vibe. it talks to Dropbox so you don't have to. ๐
๐ธ VERSION ๐ธ
Version 1.9.8 โ periodt.
๐ฆ SYNOPSIS ๐ฆ
so the Dropbox API is OAuth-based (iykyk), and this module tries to abstract as much of that away as possible so you don't need to know too much about it. literally the point. here's how it goes:
use Net::Dropbox::API;
my $box = Net::Dropbox::API->new({key => 'KEY', secret => 'SECRET'});
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
not me making OAuth look easy ๐ญ see the examples for a working Mojolicious web client using the Dropbox API โ it's giving main character energy.
and if you wanna read the source material, Dropbox's API documentation lives at <https://www.dropbox.com/developers/web_docs> โจ
๐ FUNCTIONS ๐
๐ login
This sets up the initial OAuth handshake and returns the login URL. this URL has to be clicked by the user and then the user has to accept the application in dropbox. no click, no entry, bestie.
Dropbox then redirects back to the callback URL defined with $self->callback_url. and here's a lil tea: if the user already accepted the application, the redirect may happen without the user actually clicking anywhere. sneaky. ๐
๐ auth
The auth method changes the initial request token into access token that we need for subsequent access to the API. You only have to call this method once after login. one and done, slay.
โญ account_info
account_info polls the users info from dropbox. that's it. that's the function. ๐
๐ list
lists all files in the path defined:
$data = $box->list(); # top-level
$data = $box->list( "/Photos" ); # folder
The data returned is a ref to a hash containing various fields returned by Dropbox, including a "hash" value, which can be used later to check if Dropbox data beneath a specified folder has changed since the last call. caching queen behavior.
For this, list() accepts an optional 'hash' argument:
$data = $box->list({ hash => "ce9ccbfb8f255f234c93adcfef33b5a6" },
"/Photos");
This will either return
{ http_response_code => 304 }
in which case nothing has changed since the last call โ like, at all, no notes โ or
{ http_response_code => 200,
# ... various other fields
}
if there were modifications. changes detected, we love to see it ๐ฅ
๐ง copy
copies a folder
copy($from, $to)
๐ซ move
move a folder
move($from, $to)
๐ธ mkdir
creates a folder
mkdir($path)
๐ฆ delete
delete a folder
delete($path)
okay be careful with this one, bestie โ it's called delete for a reason ๐
๐ view
creates a cookie protected link for the user to look at.
view($path)
๐ metadata
creates a cookie protected link for the user to look at.
metadata($path)
๐ putfile
uploads a file to dropbox
โญ getfile
get a file from dropbox
๐ debug
Set this to a non-false value in order to print some debugging information to STDOUT.
debug(1)
๐ฎ INTERNAL API ๐ฎ
๐ซถ _talk
_talk handles the access to the restricted resources. You should normally not need to access this directly. like, stay out of the kitchen unless you're the chef, yk?
๐ nonce
Generate a different nonce for every request. fresh nonce every time, no cap. โจ
๐ AUTHOR ๐
Lenz Gschwendtner, "<norbu09 at cpan.org>"
With Bug fixes from:
- Greg Knauss
"gknauss at eod.com" - Chris Prather
"chris at prather.org" - Shinichiro Aska
[ktdreyer]- SureVoIP <http://www.surevoip.co.uk>
shoutout to the whole squad, they really carried ๐ซถ
๐ญ 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. teamwork makes the dream work fr fr.
๐ SUPPORT ๐
You can find documentation for this module with the perldoc command.
perldoc Net::Dropbox::API
You can also look for information at:
- AnnoCPAN: Annotated CPAN documentation <http://annocpan.org/dist/Net-Dropbox-API>
- CPAN Ratings <http://cpanratings.perl.org/d/Net-Dropbox-API>
- Search CPAN <http://search.cpan.org/dist/Net-Dropbox-API/>
๐ COPYRIGHT & LICENSE ๐
Copyright 2010 Lenz Gschwendtner.
This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.
See <http://dev.perl.org/licenses/> for more information.
and that's the whole page, bestie ๐ this was perl v5.34.0, dated 2022-06-16, and it's Net::Dropbox::API โ now go forth and API responsibly ๐
โจ๐ฆ
๐ฆ where this page comes from
- debian bookworm: libnet-dropbox-api-perl 1.9-2 ยท Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libnet-dropbox-api-perl 1.9-2 ยท Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libnet-dropbox-api-perl 1.9-2 ยท Artistic-1.0-Perl OR GPL-1.0-or-later
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms