THIS MODULE IS UNDER CONSTRUCTION. INTERFACES AND RESPONCES ARE NOT STABLE.
Net::Nakamap - A Perl interface to the Nakamap API
This document describes Net::Nakamap version 0.02.
use Net::Nakamap; my $nakamap = Net::Nakamap->new( client_id => $client_id, client_secret => $client_secret, ); # generate uri for authentication my $auth_uri = $nakamap->auth_uri(); # get access token my $res = $nakamap->auth_code({ code => $code }); my $token = $res->{access_token}; # GET my $me = $nakamap->get('/1/me', { token => $token }); # POST $nakamap->post('/1/me/profile', { token => $token, name => 'Alice', });
Tiny helper for using Nakamap API.
$nakamap = Net::Nakamap->new(%options)
Creates a new Net::Nakamap instance.
%options is a Hash. kesy of %option are:
%options
%option
client_id
client id for your app.
client_secret
client secret for your app.
token
Not required. If given, you can ommit token for each get or post method.
get
post
$nakamap->auth_uri($params)
Generate uri for authentication. Returns URI object.
$params is a HashRef. keys of $params are:
$params
response_type
scope
$nakamap->auth_code($code)
Authenticate authorization code. Returns hash including token.
$nakamap->get($path, $params)
Send GET request to Nakamap API.
$nakamap->post($path, $params, $files)
Send POST request to Nakamap API.
files in $files are sent as multipart/form-data.
$files
$files = { icon => 'path/to/file', }
or
$files = { icon => \$binary_data, }
Developer Site for Nakamap.
http://developer.nakamap.com
Nakamap API document.
https://github.com/nakamap/docs/wiki/Api-docs
GitHub
https://github.com/kayac/p5-Net-Nakamap
NAGATA Hiroaki <handlename> <handle _at_ cpan _dot_ org>
Copyright (c) 2013, NAGATA Hiroaki <handlename>. All rights reserved.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Net::Nakamap, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Net::Nakamap
CPAN shell
perl -MCPAN -e shell install Net::Nakamap
For more information on module installation, please visit the detailed CPAN module installation guide.