Batching API calls

You can use batch.process to batch multiple API calls into one.

Example

// The first API call - Do a search on the search term "Hyves"
$firstCall= "ha_method=wwws.searchPublic&searchterms=Hyves&ha_fancylayout=false&ha_format=xml&ha_version=2.0";
 
// The second API call - Retrieve the users belonging to all the results from the first call based on their userid
$secondCall = "ha_method=users.get&userid=0%28userid%29&ha_fancylayout=false&ha_format=xml&ha_version=2.0";
 
 
// Execute the API call with all the required parameters
$oXML = $oGenusApis->doMethod("batch.process", array(
     "request"=>"$firstCall,$secondCall"
),$oOAuthAccessTokenLogintoken);

This example uses the OAuth authorization example and the GenusApis PHP library.

Click here to see a live example and download the source code.