Details
-
Type: Improvement
-
Status: Done/Fixed
-
Priority: Major
-
Resolution: Fixed/Completed
-
Affects Version/s: 2.1
-
Fix Version/s: 2.2.0
-
Component/s: CiviCRM API
-
Labels:None
Description
Hi,
Two changes to make it easier:
1) Now you don't need a key. As soon as you are authenticated, you can run (example)
http://example.com/sites/all/modules/civicrm/extern/rest.php?q=civicrm/contact/search
or with more param (only the individuals, and return the name, mail and country)
http://example.com/sites/all/modules/civicrm/extern/rest.php?q=civicrm/contact/search&contactType=Individual&return[email]=1&return[sort_name]=1&return[country]=1
on every case you can have it as a json format:
http://example.com/sites/all/modules/civicrm/extern/rest.php?q=civicrm/contact/search&json=1
2) Now the authentication returns the session ID
http://example.com/sites/all/modules/civicrm/extern/rest.php?q=civicrm/login&user=xx&pwd=yy
returns a PHPSESSID that you can uses as a get param on the other queries