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) »
  • How to get contact prefix from API
Pages: [1]

Author Topic: How to get contact prefix from API  (Read 1741 times)

ruid

  • I post occasionally
  • **
  • Posts: 46
  • Karma: 4
How to get contact prefix from API
June 04, 2009, 11:13:55 pm
I tried to use
Code: [Select]
$params = array(
                   'contact_id'=>$contact_id)

and use
Code: [Select]
$params = array(
                   'contact_id'=>$contact_id,
                   'return.prefix' => 1)

in civicrm_contact_get($params) function, but can't get contact prefix in both method.

Did search on document but no luck? Please help.

Kiran Jagtap

  • Ask me questions
  • ****
  • Posts: 533
  • Karma: 51
Re: How to get contact prefix from API
June 05, 2009, 12:04:38 am
hi

you might want to check this

Code: [Select]
require_once 'api/v2/Contact.php';
$params = array( 'contact_id'  => $contact_id,
                 'return.individual_prefix' => 1 );
       
$contact = civicrm_contact_get( $params );

HTH

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

ruid

  • I post occasionally
  • **
  • Posts: 46
  • Karma: 4
Re: How to get contact prefix from API
June 08, 2009, 04:42:03 pm
Cool. Thanks very much.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion »
  • APIs and Hooks (Moderator: Donald Lobo) »
  • How to get contact prefix from API

This forum was archived on 2017-11-26.