3

What is the recommended version of API to use at this point in time? I am about to do a major rewrite of an extension to manage small groups and I want to future proof it.

Are there any advantages/disadvantages to using API4?

Thanks!

4

Coleman sent the following to the dev list 3 weeks ago. The line I have emphasised below seems particularly relevant to your question.

As you probably know, CiviCRM api v4 has been quietly being developed over in an extension. The nice thing about being in an extension is that we can commit code without going through the core PR process and iterate rapidly, but the downside is that it doesn't get as much attention or visibility.

But that's about to change. I intend for CiviCRM 5.5 to ship with the Api4 extension bundled in the tarball. At first it will be disabled by default, but at some point that too will change.

It has a test suite that is being run on a nightly basis here: https://test.civicrm.org/view/All/job/CiviCRM-Ext-Matrix/ (soon I want api4 tests running with every core PR).

I've now developed my first extension using api4, and I'm happy enough with it to start recommending that other developers give it a try. IMO if you are starting off writing a new extension and want to ensure longevity for that project, api4 is a good choice (even though we currently have no plans to deprecate api3, someday it may happen).

So I suggest you download the api4 extension and play around with the new, angular-based api explorer to have a look at what it can do (the explorer is not 100% feature-complete but it's still fun to play with). Enjoy :)

Advantages: intended to be lots!
Disadvantages: it's new.

  • I will certainly have a play with it :-) – ErikH - CiviCooP Aug 8 '18 at 16:07
3

As long as the Developer Guide (https://docs.civicrm.org/dev/en/latest/api/) only mentions API3 I would recommned using that one.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.