Details
-
Type: Improvement
-
Status: Open
-
Priority: Trivial
-
Resolution: Unresolved
-
Affects Version/s: 4.5.4
-
Fix Version/s: Unscheduled
-
Component/s: CiviCRM API
-
Labels:
-
Versioning Impact:Patch (backwards-compatible bug fixes)
-
Documentation Required?:Developer Doc
Description
Using 'options.match', you can update an existing contact based on its id, as described on: http://wiki.civicrm.org/confluence/display/CRMDOC/API+changes#APIchanges-4.4.0:%27create%27and%27replace%27actionsaccept%27options.match%27or%27options.match-mandatory%27
For example:
$result = civicrm_api('contact', 'create', array(
'version' => 3,
'contact_type' => 'Individual',
'first_name' => 'Newfirstname',
'external_identifier' => '1234',
'options' => array(
'match' => 'external_identifier',
),
));
It would be nice if the same could be done for entity deletions, e.g.:
$result = civicrm_api('contact', 'delete', array(
'version' => 3,
'external_identifier' => '1234',
'options' => array(
'match' => 'external_identifier',
),
));