For our site, we needed to expose most aspects of relationship management via a Web service. The attached module uses the Services module to implement Web services for requesting, approving, deleting/declining, and searching your own relationships.

Many RPC calls take a $version argument first, to allow adjusting the API later while maintaining backwards compatibility.

We have been using it for a short while now and it is working fine. Feedback is welcome.

Comments

alex.k’s picture

Will review these in a little bit, thanks for posting :) Need to take on some 6.x issues first.
This particular issue, is it a newer attempt of #457066: Provide XML-RPC services for managing user relationships or a something different?
Thanks again.

scottgifford’s picture

:-) Sorry, it it the same, I apparently posted it but forgot to cross "post user relationship patches" off my TODO list. I'll mark the other as a dup, as this one is a bit newer and has docs attached.

alex.k’s picture

Status: Needs review » Fixed

Committed with minor changes (coder module fixes, and added 'approved' => 0 in function user_relationship_service_approve($ver, $rid) . http://drupal.org/cvs?commit=234050

I did not test this code, as there doesn't seem to be an easy way to do this without writing a client. So reviews would be appreciated.

Thanks!

scottgifford’s picture

StatusFileSize
new7.61 KB

Thanks @alex.k! Most of the services you can test from the /admin/build/services page. Search requires a structure, which the Web UI doesn't currently support. I wrote the attached Perl script for testing this functionality, which might be helpful. You can use it like this:

./drupal_ur_services_test.pl -u https://example.com/aura/services/xmlrpc -c test1.sess login test1
./drupal_ur_services_test.pl -u https://example.com/aura/services/xmlrpc -c test1.sess relsearch
./drupal_ur_services_test.pl -u https://example.com/aura/services/xmlrpc -c test1.sess relsearch rtid=1
./drupal_ur_services_test.pl -u https://example.com/aura/services/xmlrpc -c test1.sess logout

Thanks for committing this, and let me know if you have any trouble!

alex.k’s picture

Thank you!

This module has already been ported to 6.x, in #507470: Drupal 6 patch of services options for the User Relationships module so it's going to go a long way I'm sure.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.