CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • Drupal and Remote CiviCRM integration
Pages: [1]

Author Topic: Drupal and Remote CiviCRM integration  (Read 814 times)

hunter

  • I’m new here
  • *
  • Posts: 1
  • Karma: 0
  • CiviCRM version: 3.1.4
  • CMS version: 6.19
  • MySQL version: 5.1.39
  • PHP version: 5.2.10
Drupal and Remote CiviCRM integration
February 09, 2011, 07:53:27 am
Hi,

I donate some of my free time to building a website for a non-profit in my area.  They are a chapter of a parent organization who uses Drupal/CiviCRM, the chapter is on the same setup as well, which makes it easier moving forward.  The Goal is to remove the Chapters CiviCRM and delegate all of these transactions to the parent org's CiviCRM. 

The challenge is that the Chapter orgs site depends on Roles designated by membership levels that are paid for.  I'm trying to come up with a custom module that will tap the remote org's REST API upon each successful login and get their member status (Current, Grace, et al).  If they have lapsed, my module will then update their permissions on the Chapter site as appropriate. 

After extensive googling and reading posts on this forum, I have not found anyone who is using the REST api to get the membership status of an account (in this case an email address).  In the documentation I see a section about generically retrieving data.

Can I use a this same mechanism to call [ civicrm/member/search ] or [ contact/view/membership ] the same as is done with a contact contact [ civicrm/contact/get ]?

I have no idea about the model that CiviCRM employs so I don't know if the REST API is smart enough to translate those URL's between rendering to the browser, xml, etc...  So I'm very green with working with Civi, but I'm no newb with Drupal.  Can anyone shed some light on an approach to get a members object from their email address via REST API?

Thanks!

Hunter

PS: What's up with the  "Sorry, you are not allowed to post external links."  I had to remove the full URL, which makes my post difficult to describe. 

xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
Re: Drupal and Remote CiviCRM integration
February 09, 2011, 10:02:27 am
Hi,

Yes, you can pretty much query everything you want through the API.

Check the chapter on the book:

http://en.flossmanuals.net/CiviCRM/DevelopAPI

As for the code, check under api/v2/MembershipContact.php*

civicrm_membership_contact_get should be what you are looking for, and as any api function, you can call it from the REST api indeed.

X+
-Hackathon and data journalism about the European parliament 24-26 jan. Watch out the result

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • Drupal and Remote CiviCRM integration

This forum was archived on 2017-11-26.