The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

WWW::GudangAPI - Client library for GudangAPI.com

VERSION

version 0.02

SYNOPSIS

 use WWW::GudangAPI qw(get_ga_ssuri);
 my $uri = get_ga_ssuri(
     module => 'tax/id/npwp',
     sub    => 'parse_npwp',
     #https => 1, # use https, default is 0
 );
 my $res = $uri->call(npwp=>'00.000.001.8-000');
 say "valid!" if $res->[0] == 200; # prints 'valid!'

DESCRIPTION

This module is the Perl client library for GudangAPI, http://www.gudangapi.com/. It is currently a very thin wrapper for Sub::Spec::URI, since GudangAPI is Sub::Spec::HTTP-compliant. As a matter of fact, you can just do:

 my $uri = Sub::Spec::URI->new("http://gudangapi.com/ga/MODULE::FUNC");
 my $res = $uri->call(ARG=>..., ...);

and skip this module altogether. But in the future some convenience features will be added to this module.

This module uses Log::Any.

This module's functions has Sub::Spec specs.

FUNCTIONS

None are exported, but they are exportable.

get_ga_ssuri(%args) -> [STATUS_CODE, ERR_MSG, RESULT]

Create Sub::Spec::URI object to access GudangAPI.com API functions.

Once a Sub::Spec::URI object is created, you can call function, get function spec, etc. See Sub::Spec::URI documentation for more details.

Returns a 3-element arrayref. STATUS_CODE is 200 on success, or an error code between 3xx-5xx (just like in HTTP). ERR_MSG is a string containing error message, RESULT is the actual result.

Arguments (* denotes required arguments):

  • module* => str

    Name of module to call.

  • sub => str

    Name of function to call.

  • https => bool (default 0)

    Whether to use HTTPS instead of HTTP.

    You might want to use HTTPS if you send sensitive data such as password or financial data. Note that HTTPS access has higher latency.

  • user => str (default "ga")

    GudangAPI username.

SEE ALSO

Sub::Spec::HTTP

Sub::Spec::URI

http://www.gudangapi.com/

AUTHOR

Steven Haryanto <stevenharyanto@gmail.com>

COPYRIGHT AND LICENSE

This software is copyright (c) 2011 by Steven Haryanto.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.