Property | Type | Description | |
---|---|---|---|
$log_requests | boolean | Log API requests? | |
$override | boolean | ||
$user_id | integer | User ID Performing the API Request |
Property | Type | Description | |
---|---|---|---|
$versions | string | All versions of the API |
Method | Description | |
---|---|---|
__construct ( ) | Setup the Give API | |
add_endpoint ( array $rewrite_rules ) | Registers a new rewrite endpoint for accessing the API | |
api_key_backwards_compat ( string $check, integer $object_id, string $meta_key, boolean $single ) : string | API Key Backwards Compatibility | |
generate_api_key ( integer $user_id, boolean $regenerate = false ) : boolean | Generate new API keys for a user | |
get_customers ( integer $customer = null ) : array | Process Get Customers API Request | |
get_dates ( array $args = [] ) : array | Sets up the dates used to retrieve earnings/donations | |
get_default_version ( ) : string | Retrieves the default version of the API to use | |
get_forms ( integer $form = null ) : array | Process Get Donation Forms API Request | |
get_output ( ) : array | Retrieve the output data | |
get_output_format ( ) : mixed | void | Retrieve the output format | |
get_paged ( ) : integer | Get page number | |
get_queried_version ( ) : string | Retrieve the API version that was queried | |
get_query_mode ( ) : string | Returns the API endpoint requested | |
get_recent_donations ( ) : array | Retrieves Recent Donations | |
get_stats ( array $args = [] ) : array | Process Get Stats API Request | |
get_token ( integer $user_id ) : string | Retrieve the user's token | |
get_user ( string $key = '' ) : boolean | Retrieve the user ID based on the public key provided | |
get_user_public_key ( $user_id ) | ||
get_user_secret_key ( $user_id ) | ||
get_version ( ) | ||
get_versions ( ) : array | Retrieve the API versions | |
output ( integer $status_code = 200 ) | Output Query in either JSON/XML. The query data is outputted as JSON by default | |
per_page ( ) : integer | Number of results to display per page | |
process_api_key ( array $args ) : void | Process an API key generation/revocation | |
process_query ( ) : void | Listens for the API and then processes the API requests | |
query_vars ( array $vars ) : string[] | Registers query vars for API access | |
revoke_api_key ( integer $user_id ) : string | Revoke a users API keys | |
set_query_mode ( ) | Determines the kind of query requested and also ensure it is a valid query | |
update_key ( integer $user_id ) : void | Generate and Save API key | |
user_key_field ( object $user ) : void | Modify User Profile |
Method | Description | |
---|---|---|
generate_private_key ( integer $user_id ) : string | Generate the secret key for a user | |
generate_public_key ( string $user_email = '' ) : string | Generate the public key for a user | |
get_default_earnings_stats ( ) : array | Generate the default earnings stats returned by the 'stats' endpoint | |
get_default_sales_stats ( ) : array | Generate the default sales stats returned by the 'stats' endpoint | |
get_form_data ( object $form_info ) : array | Given a give_forms post object, generate the data for the API output | |
invalid_auth ( ) : void | Displays an authentication failed error if the user failed to provide valid credentials | |
invalid_key ( ) : void | Displays an invalid API key error if the API key provided couldn't be validated | |
invalid_version ( ) : void | Displays an invalid version error if the version number passed isn't valid | |
log_request ( array $data = [] ) : void | Log each API request, if enabled | |
missing_auth ( ) | Displays a missing authentication error if all the parameters aren't provided | |
set_queried_version ( ) | Sets the version of the API that was queried. | |
validate_request ( ) : void | Validate the API request |
public add_endpoint ( array $rewrite_rules ) | ||
$rewrite_rules | array | WordPress Rewrite Rules |
public api_key_backwards_compat ( string $check, integer $object_id, string $meta_key, boolean $single ) : string | ||
$check | string | Whether to check the cache or not |
$object_id | integer | The User ID being passed |
$meta_key | string | The user meta key |
$single | boolean | If it should return a single value or array |
return | string | The API key/secret for the user supplied |
public get_customers ( integer $customer = null ) : array | ||
$customer | integer | Customer ID |
return | array | $customers Multidimensional array of the customers |
public get_default_version ( ) : string | ||
return | string |
public get_output_format ( ) : mixed | void | ||
return | mixed | void |
public get_queried_version ( ) : string | ||
return | string |
public get_query_mode ( ) : string | ||
return | string | $query Query mode |
public get_recent_donations ( ) : array | ||
return | array |
public process_api_key ( array $args ) : void | ||
$args | array | |
return | void |
public process_query ( ) : void | ||
return | void |
public query_vars ( array $vars ) : string[] | ||
$vars | array | Query vars |
return | string[] | $vars New query vars |
public revoke_api_key ( integer $user_id ) : string | ||
$user_id | integer | User ID of user to revoke key for |
return | string |
public set_query_mode ( ) |
public update_key ( integer $user_id ) : void | ||
$user_id | integer | |
return | void |
public user_key_field ( object $user ) : void | ||
$user | object | Current user info |
return | void |