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) »
  • api call to get 'date added'
Pages: [1]

Author Topic: api call to get 'date added'  (Read 459 times)

pike67

  • I post occasionally
  • **
  • Posts: 55
  • Karma: 0
  • CMS version: drupal7
api call to get 'date added'
December 04, 2012, 04:31:28 am
Hi

could somewhere give a (link to an) example of an api call to get the  date a contact was added, or even better, the date a contact was added to a group ?

I need to do this for > 100 records, so a list call (contact.get or groupcontact.get) would be ideal.

thanks,
*-pike

totten

  • Administrator
  • Ask me questions
  • *****
  • Posts: 695
  • Karma: 64
Re: api call to get 'date added'
December 04, 2012, 04:50:58 pm
I'm not sure about an API call for that. In the next big release (Civi 4.3), the 'contact' API might return a field called "created_date." In most Civi versions versions, the SQL for determining the creation of a contact would be something like:

Code: [Select]
select min(modified_date) from civicrm_log where entity_type = 'civicrm_contact' and entity_id = 123;

For the date that someone was added to a group, you might look at the SQL table "civicrm_subscription_history".

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion »
  • APIs and Hooks (Moderator: Donald Lobo) »
  • api call to get 'date added'

This forum was archived on 2017-11-26.