Snapforce::API - Perl module for simple use of the Snapforce API.
use Snapforce::API; blah blah blah
This module acts as a simple in-between between a Perl user and the Snapforce API. All of this can be reasonably done by the end-user; this module is meant to simplify the process. Each call of fetchRecords performs an API call to Snapforce according to their API: https://www.snapforce.com/crm/resources/developers/api/
At the moment, only the "fetchRecords()" API function is implemented, but explicit calls to other methods are allowed with the "runAPI" function, as long as the appropriate parameters are passed. See /runAPI for more details.
/runAPI
This is the constructor method for Snapforce::API. This method has two required parameters: the authentication username and authentication key provided by your Snapforce account.
Primary read-only function of the API. The options that are available for this method are available for all API call methods:
module
The module the API call will be using. This value can be Leads, Accounts, Contacts, Opportunities, or Events.
Leads
Accounts
Contacts
Opportunities
Events
status
Can be set to either Active or Inactive
Active
Inactive
format
This is the output format from the API call. At the moment, the Snapforce API itself only allows xml and txt as values.. When that changes, this module will be updated to support the additional types.
xml
txt
All of the other API functions prepare their data to be passed to this function, which is where the actual API call is made. The options that this accepts are the same as fetchRecords, but also includes a few others. runAPI should always be called with a method parameter, but if not, a warning will be thrown that it will default to fetchRecords. Methods such as inputRecords will also take other key=>value pairs in the form of $fieldname = $fieldvalue> as passed parameters.
method
$fieldname =
Not strictly required by this module, as you are free to deal with the returned xml from other methods yourself, but parseXML will turn the returned XML document (if format = 'xml'> is specified or no format is given) into a hash tree. For example: my %tree = parseXML($response); print $tree{'accounts'}{'account-12345'}{'account_name'};
format =
This will output the account name of account 12345 from the returned xml document.
Please check the official Snapforce API documentation, located at https://www.snapforce.com/crm/resources/developers/api/ to get a list of all functions and parameters. Anything that this module doesn't specifically cover can still be explicitly called using the runAPI function.
Gabriel Benamy, <gabrielbenamy@snapforce.com>
Copyright (C) 2016 by Snapforce
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.18.2 or, at your option, any later version of Perl 5 you may have available.
1 POD Error
The following errors were encountered while parsing the POD:
You forgot a '=back' before '=head1'
To install Snapforce::API, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Snapforce::API
CPAN shell
perl -MCPAN -e shell install Snapforce::API
For more information on module installation, please visit the detailed CPAN module installation guide.