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) »
  • civicrm_contact_add: what's the proper format for country ?
Pages: [1]

Author Topic: civicrm_contact_add: what's the proper format for country ?  (Read 1788 times)

xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
civicrm_contact_add: what's the proper format for country ?
February 27, 2009, 02:46:01 pm
Hi,

What is the proper parameter value (or name) for the country ? Is this supposed to be the name, the iso, the id ? I have a name (eg. Belgium), but it doesn't import. How should I convert or ...

Code: [Select]
    $params = array(
                    'household_name'    => $name,
                    'contact_type'  => 'Household',
                    'contact_source' => 'europarl',
                    'country' => $country
                    );
    $contact =&civicrm_contact_add( $params );


If one of you has an advise on how to work with the api, the params is a bit a hit or miss. Is there a way to test ?

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

xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
Re: civicrm_contact_add: what's the proper format for country ?
February 27, 2009, 03:19:39 pm
Code: [Select]
    $params = array(
                    'household_name'    => $name,
                    'contact_type'  => 'Household',
                    'contact_source' => 'my code',
                    'location' => array( 1 => array( 'location_type_id' => 1,
                                                is_primary => 1,
                                                'address' => array( 'country' => $country ) ) )
               );
-Hackathon and data journalism about the European parliament 24-26 jan. Watch out the result

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion »
  • APIs and Hooks (Moderator: Donald Lobo) »
  • civicrm_contact_add: what's the proper format for country ?

This forum was archived on 2017-11-26.