Have a question about CiviCRM? Get it answered quickly at the new CiviCRM Stack Exchange Q+A siteThis forum was archived on 25 November 2017. Learn more.How to get involved.What to do if you think you've found a bug.
Do you think you'll be able to share the new api you created before the code freeze end of the month ?
Just to be sure we understand each other: with my patches, you replace &key=<bla> by &PHPSESSID=<bla> and it works in a machine to machine, no need to bother about session.The ultimate goal is to be able to have a permanent key, that you can put on any query and it just works.
You will need to write another authenticate function and call that when you are sending in a "pass-phrase" unique to each user and do the work there. (i.e. find the userID / contactID and set that in the session)ajax requests definitely would not want to reauthenticate and send in hash key etc
So I'm back to asking: Lobo, what would it take to get a field in the database to store some kind of secret-key for the REST interface to use?
?q=civicrm/command&key=SOME_SECRET_KEY
and then the code does a db lookup to find the contactID that matches the KEY and ensure there is a userID before doing the operation?
Doing it at the contact level to begin with allows us to have more options down the road. its not a bit change (from a db/code perspective), and can accomodate xaviers case very easily (i.e. the admin sets the key for only one specific contact). I think since this key is so special, we can keep the interface separate from the contact edit screen
With that in place, we could get the various front-ends (standalone, Drupal module, Joomla! module, XML / JSON feeds) to use a common REST interface for interacting with the back-end of the system. Then we fully document that REST API, keep it pretty stable across minor revisions, and voila, CiviCRM the platform is born.
example.org/rest/entity/action
What's the point of the intermediate key->contact->user instead of key->user