Expose Web services for relationship management

scottgifford - May 28, 2009 - 15:26
Project:User Relationships
Version:5.x-2.9
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:closed
Description

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.

AttachmentSize
user_relationship_service.tgz1.22 KB
user_relationship_service_1.readme.txt6.75 KB

#1

alex.k - May 29, 2009 - 10:30

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.

#2

scottgifford - May 29, 2009 - 15:26

:-) 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.

#3

alex.k - July 6, 2009 - 09:29
Status:needs review» fixed

Committed with minor changes (coder module fixes, and added

<?php
'approved' => 0
?>
in
<?php
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!

#4

scottgifford - July 6, 2009 - 15:14

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!

AttachmentSize
drupal_ur_services_test.pl.txt 7.61 KB

#5

alex.k - July 6, 2009 - 20:55

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.

#6

System Message - July 20, 2009 - 21:00
Status:fixed» closed

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

 
 

Drupal is a registered trademark of Dries Buytaert.