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) »
  • Get actual value in API result
Pages: [1]

Author Topic: Get actual value in API result  (Read 400 times)

Siv

  • I post occasionally
  • **
  • Posts: 94
  • Karma: -17
  • CiviCRM version: 4.6.2
  • CMS version: Drupal 7.44
  • MySQL version: 5.5.24
  • PHP version: 5.3.13
Get actual value in API result
December 19, 2016, 02:31:22 am
When am getting some entity using API, it's returning id reference only not the actual value.

eg:
Code: [Select]
    $result = civicrm_api3('Address', 'get', array(
      'sequential' => 1,
      'conatct_id' => 10
    ));
Output:
    {
       "is_error":0,
       "version":3,
       "count":1,
       "id":6601,
       "values":[{
          "id":"6601",
          "contact_id":"1",
          "location_type_id":"1",
          "is_primary":"1",
          "is_billing":"0",
          "street_address":"#275, xyz",
          "city":"abcd",
          "state_province_id":"9300",
          "postal_code":"560082",
          "country_id":"1101",
          "geo_code_1":"12.7930129",
          "geo_code_2":"77.5051501",
          "manual_geo_code":"0"
       }]
    }

In this example, state_province_id,country_id is returned. Is it possible to get state name and country name in the result?

Thanks in advance

Coleman Watts

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 2346
  • Karma: 183
  • CiviCRM version: The Bleeding Edge
  • CMS version: Various
Re: Get actual value in API result
December 19, 2016, 06:15:42 am
I've got an answer for you, but could you please post this question at http://civicrm.stackexchange.com/ so it will get more visibility?
I'll post the answer to your question there.
Try asking your question on the new CiviCRM help site.

Siv

  • I post occasionally
  • **
  • Posts: 94
  • Karma: -17
  • CiviCRM version: 4.6.2
  • CMS version: Drupal 7.44
  • MySQL version: 5.5.24
  • PHP version: 5.3.13
Re: Get actual value in API result
December 19, 2016, 08:27:35 pm
Thanks for your reply, same posted to stackexchange - http://civicrm.stackexchange.com/questions/16332/get-actual-value-in-api-result

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion »
  • APIs and Hooks (Moderator: Donald Lobo) »
  • Get actual value in API result

This forum was archived on 2017-11-26.