In Converge
Under admin/extensions/app_modules/ create a file called ipb.php. Here's the basic format of the file
<?php
$METHODS = array(
0 => array( 'title' => "This executes function getData",
'description' => "Does something, just an example",
'key' => 'getData' ),
1 => array( 'title' => "Do something else?",
'description' => "This will execute getOtherData",
'key' => 'getOtherData' ),
);
Next, in the Converge ACP, you have to edit the SENDING application by going to List Applications (in the Applications tab), clicking the menu next to the app, and clicking Manage Application Extension. The above options should be listed now. Note that "key" relates to the function name you will later create. Select the option you want to use for this application and save.
Sending Data (sending application)
In IPB's converge_local/apis/server_functions.php you can see this code
if ( $this->__authenticate( $auth_key, $product_id ) !== FALSE )
{
//-----------------------------------------
// Grab local extension file
//-----------------------------------------
require_once( ROOT_PATH . 'converge_local/apis/local_extension.php' );
$extension = new local_extension( $this->ipsclass );
if ( is_callable( array( $extension, $getdata_key ) ) )
{
$data = @call_user_func( array( $extension, $getdata_key), $email_address );
}
$return = array( 'data' => base64_encode( serialize( $data ) ) );
# return complex data
$this->class_api_server->api_send_reply( $return );
exit();
}
If you create a local_extension.php file with a local_extension class, you can pass the extra data. Create a function in this class that returns whatever data you want to pass (e.g. an array of member data, or even simply the group id if that's enough), with the function name being the "key" from step 1 above (e.g. getData and getOtherData). The email address used to login is passed to your function.
Receiving data (receiving application)
In auth.php:
if( $this->api_server->params['extra_data'] )
{
$external_data = unserialize( base64_decode( $this->api_server->params['extra_data'] ) );
}
This is the extra data that is sent, normally as an array. For our integration, Nexus sends the customer's active package ids over, and we have a file with an array that maps that to the permission masks they should then have, and we update their group appropriately (we run a DB query after this step to set their group, override group permission masks, and so forth based on the active package ids). All of that would be custom code - you just need $external_data.