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) »
  • Discussion (deprecated) »
  • Alpha and Beta Release Testing »
  • 3.0 Release Testing »
  • REST - trouble specifying return fields and input param
Pages: [1]

Author Topic: REST - trouble specifying return fields and input param  (Read 1838 times)

JoeMurray

  • Administrator
  • Ask me questions
  • *****
  • Posts: 578
  • Karma: 24
    • JMA Consulting
  • CiviCRM version: 4.4 and 4.5 (as of Nov 2014)
  • CMS version: Drupal, WordPress, Joomla
  • MySQL version: MySQL 5.5, 5.6, MariaDB 10.0 (as of Nov 2014)
REST - trouble specifying return fields and input param
August 07, 2009, 07:05:32 am
If I try
civicrm/ajax/rest?fnName=civicrm/contact/search&contactId=2&json=1
I get one contact returned, all fields.

If I try
civicrm/ajax/rest?fnName=civicrm/contact/search&return[sort_name]=1&contactId=2&json=1
I get all contacts, sort_name and contactId returned.

Seems like the input and output params should not cancel each other.
Co-author of Using CiviCRM https://www.packtpub.com/using-civicrm/book

Kurund Jalmi

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4169
  • Karma: 128
    • CiviCRM
  • CiviCRM version: 4.x, future
  • CMS version: Drupal 7, Joomla 3.x
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: REST - trouble specifying return fields and input param
August 07, 2009, 07:58:55 am
Quote
civicrm/ajax/rest?fnName=civicrm/contact/search&contactId=2&json=1

You should pass civicrm/ajax/rest?fnName=civicrm/contact/search&contact_id=2&json=1

Kurund
Found this reply helpful? Support CiviCRM

JoeMurray

  • Administrator
  • Ask me questions
  • *****
  • Posts: 578
  • Karma: 24
    • JMA Consulting
  • CiviCRM version: 4.4 and 4.5 (as of Nov 2014)
  • CMS version: Drupal, WordPress, Joomla
  • MySQL version: MySQL 5.5, 5.6, MariaDB 10.0 (as of Nov 2014)
Re: REST - trouble specifying return fields and input param
August 07, 2009, 10:35:52 am
Thanks, Kurund. I've updated example on http://wiki.civicrm.org/confluence/display/CRM/REST+interface to reflect correct param name.
Co-author of Using CiviCRM https://www.packtpub.com/using-civicrm/book

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Discussion (deprecated) »
  • Alpha and Beta Release Testing »
  • 3.0 Release Testing »
  • REST - trouble specifying return fields and input param

This forum was archived on 2017-11-26.