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 »
  • APIs and Hooks (Moderator: Donald Lobo) »
  • Proposal to be able to chain APIs calls
Pages: [1]

Author Topic: Proposal to be able to chain APIs calls  (Read 751 times)

xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
Proposal to be able to chain APIs calls
September 20, 2010, 11:44:04 pm
Hi,

Was thinking both of a system to make the rest interface more reactive (avoid a lot of http requests) and provide a simple tool to populate the db for the unit test.

What about having a
[{
api:"civicrm_tag_create",
param:{name:"tag name", description:"bla blabla"}
return:tag
},{
api:"civicrm_contact_create",
param:{contact_type:"Individual"...}
return:contact
},{
api:"civicrm_entitytag_create",
param:{tag_id:return.tag.tag_id, contact_id:return.contact.contact_id}
return:result
}]

Ie, with adding a simple tool to get the result, assign it to a return.xxx attribute, and being able to reuse it on a next step, we got something that will probably cover most of the cases.


Added bonus: if it works for initializing the tests, should work as well to do quick an dirty imports.

What do you think? Shall I add it on the Bristol codesprint thread ?

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

Erik Hommel

  • Forum Godess / God
  • I live on this forum
  • *****
  • Posts: 1773
  • Karma: 59
    • EE-atWork
  • CiviCRM version: all sorts
  • CMS version: Drupal
  • MySQL version: Ubuntu's latest LTS version
  • PHP version: Ubuntu's latest LTS version
Re: Proposal to be able to chain APIs calls
September 20, 2010, 11:49:26 pm
I think it is a great idea, put it on the list :-)
Erik
Consultant/project manager at EEatWork and CiviCooP (http://www.civicoop.org/)

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion »
  • APIs and Hooks (Moderator: Donald Lobo) »
  • Proposal to be able to chain APIs calls

This forum was archived on 2017-11-26.