This module is for connecting via OAuth to the Blackbaud SKY API. That is all this does, but it gives you a method and a class to work with to call the API to get results.

Drupal 8

No requirements needed to use this module. Works out of the box.

Drupal 7

This module require Composer Manager & Xautoload (version >5.0).

After you install these module and configure Composer Manager, then run this in the composer directory:

composer require guzzlehttp/guzzle

How to Use

Once you setup and authorize the module here: /admin/config/services/blackbaud

In your files do this:

use Drupal\blackbaud_sky_api\BlackbaudAPI;

function whatever() {
  $bb = new BlackbaudAPI();

  // This will return an object on success or NULL if it fails
  // Endpoints defined here: https://developer.sky.blackbaud.com/docs/services/
  $api = $bb->callAPI('endpoint');
}

All API calls default to GET. If you wanted to POST, PATCH or DELETE, do this instead:

use Drupal\blackbaud_sky_api\BlackbaudAPI;

function whatever() {
  $bb = new BlackbaudAPI();

  // This will return an object on success or NULL if it fails
  // Endpoints defined here: https://developer.sky.blackbaud.com/docs/services/
  $api = $bb->callAPI('endpoint', 'POST');
}

Extending the Class

You can do this if you need to add more magic, etc

namespace Drupal\YOURMODULE;

use Drupal\blackbaud_sky_api\BlackbaudAPI;

YOURCLASS extends BlackbaudAPI {
 // codez
}

D7 Variable

I added a variable called blackbaud_sky_api_quota_reached to basically handle 403 based responses for daily quote limit reached (typically 25,000 on free accounts). This is useful in a batch situation when you need to exit early. It also sends a watchdog message telling when you can hit the API again.

Supporting organizations: 

Project information

Releases