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) »
  • Add shared Address via API
Pages: [1]

Author Topic: Add shared Address via API  (Read 1046 times)

CatorgHans

  • I post frequently
  • ***
  • Posts: 157
  • Karma: 5
  • CiviCRM version: 4.4
  • CMS version: drupal
Add shared Address via API
December 27, 2010, 05:30:41 am
How can I add a shared address via API?

If I do a civicrm_location_get on a shared address I get a field which shows that the field is a shared address ([use_shared_address] => 1).

How can I know what is the source of that address. Does it have anything to do with "[master_id] => nn" ?
I want to show data that belongs to the source contact of the shared address.

And how would I add a shared address to a contact? Which fields need to be added to civicrm_location_add ?


Kiran Jagtap

  • Ask me questions
  • ****
  • Posts: 533
  • Karma: 51
Re: Add shared Address via API
December 27, 2010, 10:51:05 pm
currently we don't have support for shared address feature with api.

IMO you need some custom coding to get it done.

logically you need to retrieve all address fields from shared contact address and copy
to main contact address and pass to location add api with 'master_id' point to main address id and 'use_shared_address' = 1

kiran
You Are Designed To Choose... Defined By Choice.

CatorgHans

  • I post frequently
  • ***
  • Posts: 157
  • Karma: 5
  • CiviCRM version: 4.4
  • CMS version: drupal
Re: Add shared Address via API
January 03, 2011, 07:37:58 am
ah,

It seems I can not get the master_id address via the api.

civicrm_location_get should also work with a addressID, emailID etc..

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion »
  • APIs and Hooks (Moderator: Donald Lobo) »
  • Add shared Address via API

This forum was archived on 2017-11-26.