3

I basically have the same questions as described in these topics https://forum.civicrm.org/index.php?topic=22774.0 https://forum.civicrm.org/index.php?topic=24121.0

I would like to know which parameter to use in an api call url to get the last modified date in the list of returned fields

and

which parameter to add to an api call url so that it only returns the contacts that where created/modified since a specific date (or if this isn't possible: the parameter for all contacts created since a specific date, and the parameter to get all contacts modified since a specific date).

Thanks!

1 Answer 1

3

You can use modified_date in Contact.get eg:

Return the date:

$result = civicrm_api3('Contact', 'get', array(
  'sequential' => 1,
  'return' => array("modified_date"),
));

Search for Contacts modified after a date:

$result = civicrm_api3('Contact', 'get', array(
  'sequential' => 1,
  'modified_date' => array('>' => "2017-04-12"),
));

The API explorer is useful for exploring things like this.

1
  • 'The API explorer is useful for exploring things like this.' +1 Commented Apr 13, 2017 at 13:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.