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) »
  • RESTful API - with custom fields
Pages: [1]

Author Topic: RESTful API - with custom fields  (Read 903 times)

Bela Patkai

  • I’m new here
  • *
  • Posts: 5
  • Karma: 0
  • CiviCRM version: 3.4
  • CMS version: Drupal6
  • MySQL version: 5.1.x
  • PHP version: 5.2.x
RESTful API - with custom fields
September 22, 2011, 05:00:05 am
I managed to access the Contact info and search for Organizations with the RESTful API. However, I added many custom fields to Organizations, and I can't find in the documentation how to access those. Can anybody help please?

Bela Patkai

  • I’m new here
  • *
  • Posts: 5
  • Karma: 0
  • CiviCRM version: 3.4
  • CMS version: Drupal6
  • MySQL version: 5.1.x
  • PHP version: 5.2.x
Re: RESTful API - with custom fields
September 22, 2011, 05:10:03 am
I tried to add &custom_40[]=xxxxx to the URI, but that was just a desperate attempt. I assume I need to do a separate query to the custom fields and merge the response on the Drupal side, but haven't found out how to query custom field values yet.

xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
Re: RESTful API - with custom fields
September 22, 2011, 10:22:55 am
What url are you trying?

return=sort_name,email,custom_xx,custom_yy will work (for a contact get)

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

Bela Patkai

  • I’m new here
  • *
  • Posts: 5
  • Karma: 0
  • CiviCRM version: 3.4
  • CMS version: Drupal6
  • MySQL version: 5.1.x
  • PHP version: 5.2.x
Re: RESTful API - with custom fields
September 22, 2011, 11:22:54 am
It worked with  &custom_40=xxxxx - without the []

Also, some of the errors I got were due to the empty return value of the API call.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion »
  • APIs and Hooks (Moderator: Donald Lobo) »
  • RESTful API - with custom fields

This forum was archived on 2017-11-26.