been all through handbooks and lots of code for flex, flash, python, etc.. but can anyone post simple example of remote node save/load using PHP - i.e. one drupal site talking to another.
i have 5.x-1.x-dev
and currently have this:
$domain = 'blogm';
$key = 'dcb265af5b6fceba6aa6704fd99754a8';
$sessid = '8f4bc4f1f5c0f213ef78911d18f0f873';
$timestamp = (string) time();
$nonce = user_password();
$hash = hash_hmac('sha256', $timestamp .';'.$domain .';'. $nonce .';'.'node.load', $key);
$xmlrpc_result = xmlrpc('http://blogs/services/xmlrpc', 'node.load', $hash, $domain, $timestamp, $nonce, 309470);
if ($xmlrpc_result === FALSE) {
print '
' . print_r(xmlrpc_error(), TRUE) . '';
}
else {
print '' . print_r($xmlrpc_result, TRUE) . '';
}
i have api enabled, sessid disabled
most examples in hbook suggest i need to use sessid and also i need to enable a bunch of user_services perms - but.. none of these exist. Also, for sessid examples they run user.get method; which also doesn't exist.
btw.. my result from above is:
stdClass Object
(
[is_error] => 1
[code] => 1
[message] => Access denied.
)
i am sure i am just missing something small.. no idea why this example isn't in handbook??
Comments
Comment #1
liquidcms commentedok, stumbling around and this seems to work:
this copies node 309473 from blogm site to blogs site.
this works for my simple test of copying over a simple (page) node; but is fialing for node types with noderef fields with error: This post can't be referenced. tracking that down next.
Comment #2
skyredwang