Today’s tutorial will help many of you plan for custom application development using CCB’s API.

You could meet the daily CCB API call maximum if you’re not careful.  Maxing out to the CCB API limit could leave reporting, emailing, backup, syncing and other API-dependent applications dead in the water for a day.

I suggest planning out how many API calls are made within a given day.  Also, don’t forget to define and plan for how many applications are created that use the CCB API.

For example, let’s say you create a home-grown group finder application for attendees and members to find and join a life or community group.  Enter the daily CCB api call maximum. Such an application could very well put your CCB account at or beyond the daily CCB API call maximum.

Another example of eclipsing the daily CCB api call maximum is churches with high hundreds or thousands of attendees and members that use bi-directional backup or synchronization of CCB data.

The maximum number of daily CCB API calls/requests

Again, depending on how much data your Church Community Builder (CCB) account has, there is a possibility that you could hit the maximum number of daily API calls/requests.

The answer to how many CCB API calls can be made in a day is simple.  It’s 10,000 API calls/requests. No worries, the limit is reset to 10,000 daily.

But again, you have to develop a plan to allocate the use of 10,000 for both development and production API calls.

Lower API calls/requests using CCB Partner Development Environment

In terms of development, CCB does offer a development website for partners to use to program their applications against. For more information about the partner development environment, contact CCB Support to obtain development login credentials.

The one downside to the development environment is that is it a shared environment by all partners.  In addition, the partner development environment may not mirror how your church uses CCB in an apples to apples comparison.

You could hit the max API call/request limit should you use your church’s respective CCB environment for development and production combined.  Another downside to production development using your CCB account is that you could cause great harm to data by an untested or inadvertent API call that modifies, adds, and deletes data altogether.

Checking API call maximum and use status

If you haven’t figured out by now, you’ll be using the CCB API call to check on the number of API calls made within a given day and retrieve the max limit.

CCB provides an API service that allows you to check the daily CCB API call maximum and number of calls you’ve amassed within a given day: api_status.

Using the api_status service, you’re able to obtain the following data:

  • last_run_date – the last day and time that an API call was made
  • daily_limit – the maximum number of API calls that can be made (you may be able to negoitate higher volumes by contacting CCB Support)
  • counter – the number of API calls used today

Use the PHP framework from previous tutorials (shown below).  For more in-depth instruction and explanation of the code below, review the following tutorial: Creating a reusable function for CCB API calls.

First, define the apiService variable and assign it the api_status API service name.

Next, define the urlData variable and assign it an array that binds the apiService variable to the srv label.

Next, define the rss variable and assign the ccbDetails function, passing get as the first argument and the urlData variable as the second argument.

To parse the XML response using PHP’s XPath query, set the expression to //response.  Now, you’re ready to set the response_object variable that is inside the foreach statement and return the api_status service data points listed above.

Time to test code

That’s all it takes to determine the number of API calls you’ve made in a day, and retrieve the CCB API call maximum.  Copy the code into a PHP file, upload it to a public or local web environment, and execute the file in your web browser.  That’s it!

Stay tuned until the tutorial… Cheers!

<?PHP

// contains resusable globals and functions
include("includes/config.php");

$apiService = 'api_status'; // CCB api service

$urlData = array_filter( array(
	'srv' => "$apiService"
	) );

$rss = ccbDetails('get',$urlData); // transform to XML

$nodes = $rss->xpath('//response');  // xpath for individuals->individual

$response_object = '';

foreach ($nodes as $node)
{
    $response_object .= 'Last Run: '.$node->last_run_date.' <br/>Daily Limit: '.$node->daily_limit.' <br/> Used Count:'.$node->counter.'<br/>';  // now print the api status information (See CCB API documentation for more $apiService fields)
}

echo $response_object;

?>

 

Related Posts

Subscribe and receive the following...

  • Inside CCB tips and tricks
  • Instant CCB tutorial alerts and updates
  • CCB How To's, Videos, Webinars and more...