1

using the rest API, I am able to change 'normal' fields with a single occurence. But I can't figure out what I should do to change the first email addressl.

Civicrm only accepts post requests to do a database change. If I put in the post parameter hash something like

{ :contact_type => 'Individual',
:id => 14330,
:job_title => 'workaholic',
'email[0][email]' => 'testaccount@gmail.com',
:entity => 'Contact' }))

the corresponding record is changed (job title is changed) and the email address is added. But not replaced. Do I miss some required parameter to make this work?

thanks in advance

0

This can best be done through the Email object. Find the collection of Email objects having contact_id 14330. Take the first object and use its id to change it:

issue a post request with

{ :entity=> 'Email',
   :id=> *EMAILID*,
   :email=> 'NEWADDRES@gmail.com',
   :action => 'create'
}
| improve this answer | |

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.