Changes between Version 10 and Version 11 of CiviCRM HowTo Use Rest API


Ignore:
Timestamp:
08/28/13 15:47:26 (11 years ago)
Author:
Richard Bramley
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • CiviCRM HowTo Use Rest API

    v10 v11  
    2727== Using the REST API
    2828
     29=== Authentication
     30
     31There is some talk in the documentation about having to log in and then use a session ID to access the REST API.  However, more recent documentation says to just post the username and password with every request.
     32
     33=== Options
     34
     35Documentation is a bit sketchy about options.  Here are a few things that appear to be true.
     36
     37* The default maximum number of entities returned is 25
     38* The default maximum can be increased by including {{{&option.limit=nnn}}} in the URL.  The parameter {{{rowCount}}} also works (case sensitive).  ''See [[http://issues.civicrm.org/jira/browse/CRM-8514?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel|here]]''.
     39* An starting offset can be provided by including {{{&option.offset=nnn}}} in the URL. The parameter {{{offset}}} on its own also works. ''ibid''.
     40* Sorting uses {{{&option.sort=fffff}}} where fffff is the name of a field returned in the JSON. The parameter {{{sort}}} can also be used.
     41* The data returned can be restricted using the parameter {{{&return=f1,f2...etc}}}, where fn is a field returned in the JSON.
     42
    2943An example: http://lcbru.xuhl-tr.nhs.uk/civicrm/ajax/rest?fnName=civicrm/contact/get&json=1&key={SITE_KEY}&name={USERNAME}&pass={PASSWORD}
    3044
    31