Download & Extend

JSON-RPC Client

A simple API class that implements a JSON-RPC client. It can be used to call a JSON-RPC service on another Drupal server or many other JSON-RPC services.

As an API module, this doesn't do anything on it's own and will only be useful if you are writing a module or doing some other Drupal coding.

What works

Works with JSON-RPC version 2.0, but probably does not implement the full specification. Not tested with 1.1. Doesn't support batch calls in JSON-RPC 2.0.

Handles optional parameters, API key authentication and session IDs necessary to authenticate with a Drupal API key protected JSON-RPC service.

Requirements

Requires PHP 5.2 or later, due to use of json_decode() function.

Examples

Sample use (basic):

<?php
module_load_include
('module', 'jsonrpc_client');
$client = new JsonRpcClient(
   
'http://example.com/services/json-rpc',
   
'2.0'
);
$result = $client->call('system.connect'); //return associative array
?>

Sample use (API key plus parameter):

<?php
module_load_include
('module', 'jsonrpc_client');
$client = new JsonRpcClient(
   
'http://example.com/services/json-rpc',
   
'2.0',
   
'abb14a47862a041f76a442ac0f38f332', 'example.com'
);
$result = $client->call('my_service.baz', array('foo' => 'bar') );
?>

Development of this module supported by Myplanet Digital

Downloads

Recommended releases

Version Downloads Date Links
6.x-1.0-beta4 tar.gz (7.62 KB) | zip (8.13 KB) 2011-May-10 Notes

Other releases

Version Downloads Date Links
7.x-1.0-alpha1 tar.gz (7.64 KB) | zip (8.16 KB) 2011-Aug-07 Notes

Project Information


Maintainers for JSON-RPC Client

  • cleaver - 18 commits
    last: 41 weeks ago, first: 1 year ago
  • ddiakopoulos - 1 commit
    last: 41 weeks ago, first: 41 weeks ago

Issues for JSON-RPC Client

To avoid duplicates, please search before submitting a new issue.
All issues
Bug reports