How to build a drupal module with apigee php sdk

Hi,

I'm very new to drupal module development and php. How do I use the edge-php-sdk in a custom drupal module in the developer portal?

For example I'm trying to use listRoles() and getUserByRole(). Is there some sort of config that is required?

Solved Solved
0 4 1,438
1 ACCEPTED SOLUTION

calling devconnect_init() does the trick but a number of the other devconnect methods call devconnect_init() so you may not need to call it directly.

View solution in original post

4 REPLIES 4

Is it something like this?

if (!module_exists('libraries')) {
  module_load_include('module', 'libraries');
}
$lib_dir = libraries_get_path('mgmt-api-php-sdk');

if (empty($lib_dir)) {
  $lib_dir = 'profiles/apigee/libraries/mgmt-api-php-sdk';
}
require_once $lib_dir . '/vendor/autoload.php';

actually, since I have devconnect as a dependency, can I just do

devconnect_init() 

calling devconnect_init() does the trick but a number of the other devconnect methods call devconnect_init() so you may not need to call it directly.

You should be able to look at the examples dir, or check out how we are using it in devconnect_developer_apps module.

However, we do have a new project named Apigee client library for PHP that is a newer version you may want to check out.