1

I'm testing the API in order to update some addressee informations (eg. the street_number) using the API Explore page. In any test:

CRM.api3('Address', 'replace', {
  "id": 204,
  "street_number": 556
}).done(function(result) {
  // do something
});

or

CRM.api3('Address', 'replace', {
  "contact_id": 202,
  "location_type_id": "Casa",
  "street_number_suffix": 556
}).done(function(result) {
  // do something
});

I obtain the following result:

{

    "is_error": 1,
    "error_message": "Mandatory key(s) missing from params array: values"
}

How can I set the key?

4

@Zeno when you have create option you don't have to look for replace

please use create key word to create new or to update the record if record exist

$result = civicrm_api3('Address', 'create', array(
  'sequential' => 1,
  'contact_id' => 202,
  'location_type_id' => "Work",
  'street_address' => "test",
  'street_number_suffix' => 506,
));

Please try the above - This will work

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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