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 »
  • APIs and Hooks (Moderator: Donald Lobo) »
  • membership api requests
Pages: [1]

Author Topic: membership api requests  (Read 672 times)

lcdweb

  • Forum Godess / God
  • I live on this forum
  • *****
  • Posts: 1620
  • Karma: 116
    • www.lcdservices.biz
  • CiviCRM version: many versions...
  • CMS version: Joomla/Drupal
  • MySQL version: 5.1+
  • PHP version: 5.2+
membership api requests
February 02, 2011, 06:55:57 am
i was doing work with membership and needed to retrieve the membership records for a contact, and identify the owner's contact id (the contact received membership via relationship inheritance; i needed to determine the owner contact).

it was quite cumbersome to do this with the api. actually -- i couldn't do it with the api. i needed to tap into BAO methods. basically the _get api would retrieve the owner's membership id, but not their contact id. and there's no way with the api to pass the membership id parameter and retrieve member details (I would think _get would have supported that). so i had to use BAO functions to get the contact id from the membership id, and then return to the api to get those contact details.

anyway -- i think the _get api should include the contact id of the owner. if the api team concurs, i'll work on a patch.
support CiviCRM through 'make it happen' initiatives!
http://civicrm.org/mih

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: membership api requests
February 02, 2011, 01:59:54 pm
Hi Brian,

You need to work on this against the new v3 api - the new api uses a modified BAO query (I haven't checked it out at all yet - Piotr just committed it)

I thought the owner's contact ID was part of the record in the membership table? is that field stripped out?
Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

lcdweb

  • Forum Godess / God
  • I live on this forum
  • *****
  • Posts: 1620
  • Karma: 116
    • www.lcdservices.biz
  • CiviCRM version: many versions...
  • CMS version: Joomla/Drupal
  • MySQL version: 5.1+
  • PHP version: 5.2+
Re: membership api requests
February 02, 2011, 02:07:18 pm
the owner's membership id is part of the tbl, but not their contact id. which is why its a bit of a pain.
i will look to modify off the v3 api
support CiviCRM through 'make it happen' initiatives!
http://civicrm.org/mih

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: membership api requests
February 02, 2011, 02:08:30 pm
Now I get you.

v3 membership hasn't be v3 complianted yet.... there's a wiki page on how to do that
Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: membership api requests
February 02, 2011, 02:20:05 pm
Brian, note we have changed the membershipcontact to membership in v3 api  - api name should match BAO name should match table name
Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion »
  • APIs and Hooks (Moderator: Donald Lobo) »
  • membership api requests

This forum was archived on 2017-11-26.