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) »
  • Phone not returned if specified in return parameter
Pages: [1]

Author Topic: Phone not returned if specified in return parameter  (Read 590 times)

capo

  • I post occasionally
  • **
  • Posts: 108
  • Karma: 5
Phone not returned if specified in return parameter
August 28, 2013, 06:39:43 am
Hello,

I'm using the API explorer to try a simple Contact / Get call. If I query the entire detail of the contacts, I can obtain it without problems:

Code: [Select]
/civicrm/ajax/rest?entity=Contact&action=get&debug=1&sequential=1&json=1
I obtain a lot of information about the contacts (phone, email, name, address, etc).

But I want to specify the returned fields, because I want to obtain the value of a custom field (in particular, custom_2). So, I added the return parameter to the API call:

Code: [Select]
/civicrm/ajax/rest?entity=Contact&action=get&debug=1&sequential=1&json=1&return=custom_2,email,phone
The problem is that if I add the return parameter, phone is not returned. Note that I added custom_2,email,phone to the field list. I can specify every field I want in the return field list but the phone. It's being ignored!

I know that I can obtain it if I perform a second API call but I would like to know if I am doing something wrong.

Can you, please, go to your API explorer, try this call:

Code: [Select]
/civicrm/ajax/rest?entity=Contact&action=get&debug=1&sequential=1&json=1&return=phone,email
... and tell me if phone is one of the returned fields?

Thanks!

I'm using:
* CiviCRM 4.3.5 over Drupal 7

Erik Hommel

  • Forum Godess / God
  • I live on this forum
  • *****
  • Posts: 1773
  • Karma: 59
    • EE-atWork
  • CiviCRM version: all sorts
  • CMS version: Drupal
  • MySQL version: Ubuntu's latest LTS version
  • PHP version: Ubuntu's latest LTS version
Re: Phone not returned if specified in return parameter
September 02, 2013, 02:00:12 am
I do not get the phone either, sounds like a bug to me. Can you please report it on the issue tracker?
http://issues.civicrm.org/
Consultant/project manager at EEatWork and CiviCooP (http://www.civicoop.org/)

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion »
  • APIs and Hooks (Moderator: Donald Lobo) »
  • Phone not returned if specified in return parameter

This forum was archived on 2017-11-26.