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 (Moderator: Donald Lobo) »
  • quicksearch api in REST
Pages: [1]

Author Topic: quicksearch api in REST  (Read 1059 times)

sonicthoughts

  • Ask me questions
  • ****
  • Posts: 498
  • Karma: 10
quicksearch api in REST
June 27, 2013, 03:47:38 pm
Trying to use the Contact Quicksearch It complains that I must Post.  Is quicksearch documented?
In API explorer this works:
/civicrm/ajax/rest?entity=Contact&action=quicksearch&name=shawn&debug=1&sequential=1&json=1

When I try the same thing with authentication I get:
"level": "security",
"referer": "",
"reason": "Destructive HTTP GET",
"is_error": 1,
"error_message": "SECURITY: All requests that modify the database must be http POST, not GET."

Perhaps related to:http://forum.civicrm.org/index.php?topic=26530.0

xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
Re: quicksearch api in REST
June 27, 2013, 03:54:56 pm
yeap, for security reasons, only the get* actions are whitelisted to work with GET (technically, quicksearch is a get, but the name doesn't follow the auto whitelist format so it considers it destructive)

As the message says, use post instead of get and everything should be fine

X+

PS. if you use CRM.api(), everything should work fine out of the box
-Hackathon and data journalism about the European parliament 24-26 jan. Watch out the result

sonicthoughts

  • Ask me questions
  • ****
  • Posts: 498
  • Karma: 10
Re: quicksearch api in REST
June 27, 2013, 05:39:55 pm
Cross post - I guess the other post http://forum.civicrm.org/index.php/topic,29217.0.html on authentication got off topic.  If there is no way to POST via a URL then I guess I can hack the whitelist code to include quicksearch if you tell me where to find it.

xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
Re: quicksearch api in REST
January 08, 2014, 05:14:31 am
Hi,

to close the topic: no need to risk weaken the security of your civi nor hack the code: quicksearch is now an alias of the getquick action. Use getquick instead of quicksearch and all will work fine in GET (and POST too).

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

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • quicksearch api in REST

This forum was archived on 2017-11-26.