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) »
  • Is there an API for displaying members of a group?
Pages: [1]

Author Topic: Is there an API for displaying members of a group?  (Read 1363 times)

slaterino

  • Guest
Is there an API for displaying members of a group?
July 16, 2009, 10:34:54 am
I can't seem to work out how to generate a list of members for a group. I was thinking it would be possible with civicrm_group_contact_get. However, this requires a contact_id and since I don't want an individual entry, I want all of the entries, this won't be possible. At the moment I am using civicrm_group_get to produce a list of all publicly viewable groups. I then want to put a count of the number of members in each group next to it. Also, this count will be a link, and when it is clicked on the user will be taken to a list of the members. I've had a look through the API's but can't seem to find another one that access the civicrm_group_contact table and therefore will be able to give me the information I'm after.

Does anyone know which one I would use for this?

emilyf

  • Ask me questions
  • ****
  • Posts: 696
  • Karma: 54
  • CiviCRM version: 2.x - 4.x
  • CMS version: Drupal 5, 6, 7
Re: Is there an API for displaying members of a group?
July 16, 2009, 11:05:50 am
is this what you want?

http://wiki.civicrm.org/confluence/display/CRMDOC/Group+APIs#GroupAPIs-civicrmgroupget%28%24params%29

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Is there an API for displaying members of a group?
July 16, 2009, 11:07:58 am
use civicrm_contact_search. check:

http://svn.civicrm.org/civicrm/branches/v2.2/tests/api/v2/ContactSearch.test

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

slaterino

  • Guest
Re: Is there an API for displaying members of a group?
July 16, 2009, 12:13:53 pm
Lobo, that's perfect! Thanks very much!

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion »
  • APIs and Hooks (Moderator: Donald Lobo) »
  • Is there an API for displaying members of a group?

This forum was archived on 2017-11-26.