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

Events happening in the community are now at Drupal community events on www.drupal.org.
pranjit's picture

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.

Comments

APIKey just another parameter

bmcmurray's picture

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

B.McMurray

When i use the API key as

pranjit's picture

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

Services

Group organizers

Group categories

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: