How to pass API key to xmlrpc server for node.load function from client for pulling data from the server ?

public
group: Services
baruah - Thu, 2008-06-19 13:04

I am trying to pull node from the remote site that contains service module(xmlrpc server), if i dont use the API key then i can extract the node using the following code from client drupal installation.

$node = xmlrpc('http://remotesitename/services/xmlrpc', 'node.load', 12, array());

But if i want to use the API key then how can i extract/pull node from the remote site so that only valid users can avail the service of service module.

Thanks in advance.

APIKey just another parameter

bmcmurray@drupal.org's picture
bmcmurray@drupal.org - Thu, 2008-06-19 14:13

The API Key, when enabled, is just another parameter that you must pass to the method. So in your case it would be something like this:

$apiKey = "awf1231112";
$node = xmlrpc('http://remotesitename/services/xmlrpc', 'node.load', $apiKey, 12, array());

B.McMurray


When i use the API key as

baruah - Fri, 2008-06-20 13:45

When i use the API key as below,

$apikey="94e0c01d19e59dc46ea9a01521c0562f";
$node = xmlrpc('http://remotesitename/services/xmlrpc', 'node.load', $apiKey, 12, array());

the following error message is displaying

stdClass Object ( [is_error] => 1 [code] => -32602 [message] => Server error. Wrong number of method parameters. )

I have also pass parameter domain_time_stamp, then the same error message will show.

Baruah