CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion »
  • APIs and Hooks (Moderator: Donald Lobo) »
  • Contacts Create/Update Action, with id not updating email address
Pages: [1]

Author Topic: Contacts Create/Update Action, with id not updating email address  (Read 916 times)

Mohit Thakral

  • I’m new here
  • *
  • Posts: 12
  • Karma: 1
  • CiviCRM version: 3.4.5+
  • CMS version: Drupal 6.24
  • MySQL version: 7.2
  • PHP version: 5
Contacts Create/Update Action, with id not updating email address
April 29, 2012, 08:54:43 pm
I am trying to update a contact in server using version 3 of API using the following REST/JSON API

 http://ubuntu-mt.reisys.com/drupal-7.12/sites/all/modules/civicrm/extern/rest.php?json=1&version=3&entity=Contact&action=create&key=b11c194dcae54c3d33bdcb56e6a2befb&api_key=da39a3ee5e6b4b0d3255bfef95601890&id=85&id=85&contact_type=Individual&first_name=BhootNath&last_name=Sharma&contact_is_deleted=0&email=bhootNath@gmai.com

So, the entity is Contact and action is create with Id and it is not updating the mail address of the contact. I tries using update action as well. But that also was of no use.

Please help me here. I am using drupal 7.12 and civicrm 4.1.1 with version 3 of API

Thanks & Regards
Mohit Thakral
Mohit Thakral
www.targetintegration.com

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: Contacts Create/Update Action, with id not updating email address
April 30, 2012, 03:31:48 am
Can you try your API parameters on your API Explorer page: civicrm/api/explorer Then you can see the return values.
CiviHosting and CiviOnline -- The CiviCRM hosting experts, since 2007

See here for the official: What to do if you think you've found a bug.

xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
Re: Contacts Create/Update Action, with id not updating email address
April 30, 2012, 03:42:36 am
Hi,

that's expected that it doesn't update email (or address or phone). On create/update, we tend to work on only one entity (get on the other hand can fetch loads of related tables). To create an email for instance, you need to specify the location type.

You can chain the api to create/update the email (if it's an update, you probably already have the mail id).

Is this clear?
-Hackathon and data journalism about the European parliament 24-26 jan. Watch out the result

Mohit Thakral

  • I’m new here
  • *
  • Posts: 12
  • Karma: 1
  • CiviCRM version: 3.4.5+
  • CMS version: Drupal 6.24
  • MySQL version: 7.2
  • PHP version: 5
Re: Contacts Create/Update Action, with id not updating email address
April 30, 2012, 09:30:22 am
Thanks a lot for response Xavier. I think chaining might be the way to go. But can you give me an example of chaining in REST/JSON.

over here
http://wiki.civicrm.org/confluence/display/CRMDOC41/CiviCRM+Public+APIs

example is only showing php calls.


Regards
Mohit Thakral
Mohit Thakral
www.targetintegration.com

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion »
  • APIs and Hooks (Moderator: Donald Lobo) »
  • Contacts Create/Update Action, with id not updating email address

This forum was archived on 2017-11-26.