WebService::Xero::Agent::PrivateApplication - Connects to a Xero Private Application API
Version 0.11
Xero API Applications have a limit of 1,000/day and 60/minute request per organisation.
use WebService::Xero::Agent::PrivateApplication; my $xero = WebService::Xero::Agent::PrivateApplication->new( CONSUMER_KEY => 'YOUR_OAUTH_CONSUMER_KEY', CONSUMER_SECRET => 'YOUR_OAUTH_CONSUMER_SECRET', #KEYFILE => "/path/to/privatekey.pem" PRIVATE_KEY => '-----BEGIN RSA PRIVATE KEY----- MIICXQIBAAKBgQCu2PMZrIHPiFmZujY0s7dz8atk1TofVSTVqhWg5h/fn8tYbwgg koTqpAigxAUCAZ63prtj9LQhIqe3TRNtCDMsxxriyN3O/cxkVD52LwCKAgEoaNmr Vvt97UgxglKyQ6taNO/c6V8FCKvPC945GKd/b7BoIYZcJsrpo+E+8Ek9IQIDAQAB AoGAbbPC+0XIAI0dIp256uEjZkSn89Dw8b27Ka/YeCZKs0UQEYFAiSdE6+9VVoEG X1bi3XloM3PSHMQglJpwaMVvTUwZfdxCFIM0mpgXtdK8Xuh3QTZpgH9S0a2HoXrB uXFEqvwMcT43ig2FCfVQU86RQZAxrb1YfyFSauEayrVtbT0CQQDe8HEXSkbxjUwj I2TdCDA7yOW7rWQPAk3REZ33SqBUdo45qofpkH7vWSx+W6q65uyRYfF4N1JKmW8V OhMxBpFPAkEAyMbGZ2VX6gW37g03OGSoUG6mvXe+CKRqv8hV4UoGeQIUYJTFlt2O ukD2jKyHqWIdU/3tM3iP1b8CY6JyVyhOjwJBAJ/NmDMKohnJn9bcKxOpJ/HiypIh 8sQzcZY4W5QEYTLKHJ7HV08brXFh6VvV12bL2q1HmLAEb69bll2P2Gve+k8CQQC3 1Pi4lxwl1FKSjlsvMUrDSm01Mbw34YM0UlP/0W2XwoWx4MYB2p7ifrTAHQCh4IoF 64wSAqOADEI9w/F5SBiVAkBJVt3jNObeieMfxVU/NOtajXX51sDUj3XCIWPPui8i IKzzVn7G0kH+/TqtTPdizrDJkg/rsnrTpvHi8eeMZlAy -----END RSA PRIVATE KEY-----', ); my $contact_struct = $xero->do_xero_api_call( 'https://api.xero.com/api.xro/2.0/Contacts' );
Private applications use a 2-legged authorisation process. When you register your application, you will select the organisation that is authorised to your application. This cannot be changed afterwards, although you can register another private application if you have multiple organisations.
Private applications require a private RSA keypair which is used to sign each request to the API. You can generate this keypair on Mac OSX or Linux with OpenSSL. For example:
openssl genrsa -out privatekey.pem 1024 openssl req -newkey rsa:1024 -x509 -key privatekey.pem -out publickey.cer -days 365 openssl pkcs12 -export -out public_privatekey.pfx -inkey privatekey.pem -in publickey.cer
You need to upload this public_privatekey.pfx file to your private application in http://api.xero.com.
https://app.xero.com/Application
returns 'WebService::Xero::Agent::PrivateApplication'
INPUT PARAMETERS AS A LIST ( NOT NAMED )
* $uri (required) - the API endpoint URI ( eg 'https://api.xero.com/api.xro/2.0/Contacts/') * $method (optional) - 'POST' or 'GET' .. PUT not currently supported * $xml (optional) - the payload for POST updates as XML
RETURNS The response is requested in JSON format which is then processed into a Perl structure that is returned to the caller.
Peter Scott, <peter at computerpros.com.au>
<peter at computerpros.com.au>
Please report any bugs or feature requests to bug-webservice-xero at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=WebService-Xero. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
bug-webservice-xero at rt.cpan.org
You can find documentation for this module with the perldoc command.
perldoc WebService::Xero
You can also look for information at:
RT: CPAN's request tracker (report bugs here)
http://rt.cpan.org/NoAuth/Bugs.html?Dist=WebService-Xero
AnnoCPAN: Annotated CPAN documentation
http://annocpan.org/dist/WebService-Xero
CPAN Ratings
http://cpanratings.perl.org/d/WebService-Xero
Search CPAN
http://search.cpan.org/dist/WebService-Xero/
Copyright 2016 Peter Scott.
This program is free software; you can redistribute it and/or modify it under the terms of the the Artistic License (2.0). You may obtain a copy of the full license at:
http://www.perlfoundation.org/artistic_license_2_0
Any use, modification, and distribution of the Standard or Modified Versions is governed by this Artistic License. By using, modifying or distributing the Package, you accept this license. Do not use, modify, or distribute the Package, if you do not accept this license.
If your Modified Version has been derived from a Modified Version made by someone other than you, you are nevertheless required to ensure that your Modified Version complies with the requirements of this license.
This license does not grant you the right to use any trademark, service mark, tradename, or logo of the Copyright Holder.
This license includes the non-exclusive, worldwide, free-of-charge patent license to make, have made, use, offer to sell, sell, import and otherwise transfer the Package with respect to any patent claims licensable by the Copyright Holder that are necessarily infringed by the Package. If you institute patent litigation (including a cross-claim or counterclaim) against any party alleging that the Package constitutes direct or contributory patent infringement, then this Artistic License to you shall terminate on the date that such litigation is filed.
Disclaimer of Warranty: THE PACKAGE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS' AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES. THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED TO THE EXTENT PERMITTED BY YOUR LOCAL LAW. UNLESS REQUIRED BY LAW, NO COPYRIGHT HOLDER OR CONTRIBUTOR WILL BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING IN ANY WAY OUT OF THE USE OF THE PACKAGE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
To install WebService::Xero, copy and paste the appropriate command in to your terminal.
cpanm
cpanm WebService::Xero
CPAN shell
perl -MCPAN -e shell install WebService::Xero
For more information on module installation, please visit the detailed CPAN module installation guide.