Answers.Body: <p>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:</p>
  
  <p>issue a post request with</p>
  
  <pre><code>{ :entity=&gt; 'Email',
     :id=&gt; *EMAILID*,
     :email=&gt; 'NEWADDRES@gmail.com',
     :action =&gt; 'create'
  }
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-02-22T15:27:18.563Z
Answers.LastActivityDate: 2017-02-22T15:55:42.370Z
Answers.LastEditDate: 2017-02-22T15:55:42.370Z
Answers.UserDisplayName: ruud
Body: <p>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.</p>
  
  <p>Civicrm only accepts post requests to do a database change. If I put in the post parameter hash something like</p>
  
  <pre><code>{ :contact_type =&gt; 'Individual',
  :id =&gt; 14330,
  :job_title =&gt; 'workaholic',
  'email[0][email]' =&gt; 'testaccount@gmail.com',
  :entity =&gt; 'Contact' }))
  </code></pre>
  
  <p>the corresponding record is changed (job title is changed) and the email address is <em>added</em>. But not replaced. Do I miss some required parameter to make this work?          </p>
  
  <p>thanks in advance</p>
  
Tags: <webform-civicrm>
Title: change email addres with http request
ThreadText: # change email addres with http request
  
  (Asked by: username_0 on 2017-02-21)
  
  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
  
  **Tags:** webform-civicrm
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2017-02-22. Score: 0 | Accepted answer
  
  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'
  }
  
  
  ---
  
  