This documentation relates to CiviCRM version 3.2. It's not maintained anymore.
Current version of documentation.

AJAX Interface

Skip to end of metadata
Go to start of metadata

This page refers to outdated version of CiviCRM. Check current version of documentation.


Documentation Search


CiviCRM 3.2 Documentation

Support and Participation

Developer Resources


CiviCRM book!

Make sure to check out Understanding CiviCRM as well! You can also support this project by ordering a hard copy.

A javascript method is provided to call the API on the server. This is JSON based and the syntax is:

For instance if you want to add a tag to a contact:

This is a thin wrapper around a call to http://example.org/civicrm/ajax/rest

For instance the call to search all the organisations tagged with the tag id 40 that contain "test" in their name is (and return their names and countries):

http://example.org/civicrm/ajax/rest/civicrm/ajax/rest?fnName=civicrm/contact/search&json=1&contact_type=Organization&rowCount=25&return\[country\]&tag=40&sort_name=test

See another example on how to use it to add or remove tags:

http://civicrm.org/node/483

or creating an autocomplete field

http://civicrm.org/node/528

Labels
  • None

Creative Commons License
Except where otherwise noted, content on this site is licensed under a Creative Commons Attribution-Share Alike 3.0 United States Licence.