Upcoming Events
San Francisco CiviCRM Meetup - February 8th, 2012
February 8th, 2012
Come meet others from the Bay Area who are interested in, using or developing (more...)
UK usergroup - London meetup
February 8th, 2012
Come and meet others from the UK that are using CiviCRM or are interested in (more...)
Chicago CiviCRM Meetup
February 17th, 2012
Please join other CiviCRM users, administrators, and developers in the Chicago (more...)
London user and administrator training
February 23rd, 2012
A comprehensive two day hands on training course covering the configuration, (more...)
CiviCRM Seminar - London
February 23rd, 2012
NfP Services free seminar
CiviCRM London sprint Feb 2012
February 27th, 2012
Following the CiviCRM training here in London, we will have a CiviCRM code (more...)
Philadelphia - CiviCRM Meetup for Q1 2012
March 13th, 2012
UK South West - CiviCRM Meetup
March 20th, 2012
Come meet others from the Area who are interested in, using or developing for (more...)
[Bristol, UK] user and administrator training
March 21st, 2012
A comprehensive hands on training course covering the configuration, (more...)
San Francisco user and administrator training
March 29th, 2012
A comprehensive two day hands on training course covering the configuration, (more...)
CiviCRM Usability, Test and Code Sprint - San Francisco (March 2012)
March 29th, 2012
This usability, code and test sprint is targeted at CiviCRM users and (more...)
CiviCon 2012 San Francisco Bay Area - April 2nd 2012
April 2nd, 2012
CiviCon is THE annual event bringing together the people who use, develop, (more...)
CiviCRM Documentation, Test and Code Sprint - after CiviCon San Francisco (April 2012)
April 4th, 2012
This sprint is targeted at CiviCRM users and developers who want to work on (more...)
REST API PHP Library
- Not Just a Contact Database
-
These optional components give you more power to connect and engage your supporters.

civiCASE
Case management for clients and constituents.

civiCONTRIBUTE
Online fundraising and donor management.

civiEVENT
Online event registration and participant tracking.

civiMEMBER
Online signup and membership management.

civiMAIL
Personalized email blasts and newsletters.

civiREPORT
Report generation and template management.
The American Friends Service Committee, where I work, needs to sync some information between our CMS (which isn’t Drupal or Joomla for various reasons) and CiviCRM. The vendor we’re working with is writing custom additions to the CMS to handle our needs, and part of that process is creating a PHP library to connect to the REST API of CiviCRM. When we asked, the vendor was very willing to open source that library.
The initial version will cover the API parts that we need to access. Once that is complete, I plan to add in the other API functions. This dovetails with a patch that I wrote, that is included in 2.1, that gave the REST interface access to all functions in the API.
As someone who has a professional interest in making sure the REST API thrives and gets attention from the development team, I really want to find ways to make this useful to others. If anyone has thoughts about a library for the REST API, please feel free to speak up.
Aaron Crosman
American Friends Service Committee







Comments
Use case
Hi,
Is there a doc about the rest api and or some example code ?
Would the rest api covers this (non too far away from something I'd need):
from a (non drupal/joomla CMS) displays the list of organisations in the group "members", and display them
The goal would be to retrieve as well images and other custom tags associated with my members. Would it works ?
In that case, I'd love to hear more about your REST API !
X+
Docs and Code
I don't have sample code that I can post easily at the moment, but I can try to get something together in a few days. There are some oddities about working with the API that do require some attention to detail (session cookie has to be maintained by the client application, something I'll probably take up with the dev team after I get the library fully on its feet).
As for documentation, as of 2.1 the REST API supports all the functions of the main API, so all the documentation applies (http://wiki.civicrm.org/confluence/display/CRMDOC/CiviCRM+Public+APIs).
To call the API with a browser just use:
http://www.example.org/path/to/civi/codebase/civicrm/extern/rest.php?q=civicrm/login&name=user&pass=passwordThat generates the key, that you will need to feed into all other commands:
http://www.example.org/path/to/civi/codebase/civicrm/extern/rest.php?q=civicrm/contact/search&key=hash_key_given_after_login_commandSorry it took so long to answer.