REST API Now In EE4 Core

Events REST API

Events REST API

It’s official, now that the WordPress REST API (WP-API) has been rolled into WordPress core, we’ve added our own REST API  into the Event Espresso 4 (EE4) core plugin.

Since we already have the READ endpoints available in a plugin version of the EE4 REST API, on January 4th, 2016 we released an update (version 4.8.29) with the READ REST API endpoints in EE4 core.

However, we still have more work to do to get the WRITE endpoints done. Once the WRITE endpoints are completed, developer’s will have the ability to directly interface with your event website using the REST API to make updates directly to the database, such as checking-in attendees, creating/updating events, tickets, and attendees.

What Is An API?

In layman’s terms, an API or Application Programming Interface is an agreed set of standardized ways that a particular piece of software can be used; the rules defined for its interaction with the wider world, which govern how other pieces of software can talk to a program and how it will respond.

A few good examples of APIs in action would be:

  1. Anytime an app uses Google Maps to display its location information.
  2. A mobile or desktop twitter client.
  3. A game/service that integrates Facebook features such as login, messaging, etc.

In these instances, and all others like them, the APIs “expose” certain internal functions of the primary applications (Google Maps, Twitter, etc) so that outside developers can use them in their own applications or websites. In these examples, app developers have been given the ability to tap into the powerful features (and/or content) of major web services so that they can build on top of them and/or integrate key content and features into their own products, in clearly defined ways. This allows open collaboration to walk hand in hand with security.

What Is A REST API?

REST or REpresentational State Transfer is an architectural style of building APIs; not a code language or description of its function. A REST API is designed to provide a lightweight form of communication (less bandwidth) between a producer (ex: Twitter) and a consumer (ex: Twitter client), making it a reliable solution for high volume web services like Facebook, Google Apps, Twitter, WordPress, and now Event Espresso.

In this case, you are the producer of content (event information and event data), and the applications you build can consume or use that data through the Event Espresso 4 REST API.

This Will Affect Everyone Who Works With Event Espresso

The EE4 REST API is a simple but powerful way to interact with Event Espresso. Even though the EE4 REST API is not readily visible to users, over time user’s will experience the benefits of more interactive Event Espresso websites. Once we roll out the WRITE endpoints Mobile, desktop and web applications can get data from Event Espresso and do anything you can do via the admin panel. It’s like the admin panel, minus the user interface (UI).

The availability of the EE4 REST API as a core feature also means less time spent by developers creating something similar, and more time spent creating features and custom applications.

How Will The EE4 REST API Be Used?

The Event Espresso 4 (EE4) REST API in Core is intended to allow client-side applications, and apps on different servers, to be able to interact with the WordPress Plugin Event Espresso. It is included in Event Espresso since version 4.8.29, and is built on the WP REST API included in WordPress since version 4.4.

The EE4 REST API can, and will be used in a multitude of different ways, such as:

  • Custom mobile apps
  • Custom admin interfaces
  • Integrating your events with other application platforms
  • Provide interoperability with many different programming languages
  • and much more!

By providing an agreed, standardized programmatic interface between Event Espresso and the outside world, Event Espresso opens itself up to every other application and development environment on earth.

Information for Developers

Now that the REST API is in Event Espresso 4 Core, you can start developing great integration’s for your customers. All you need to get started is review the documentation and start building something GREAT!

Also you should stay tuned to our developer-specific blog at developer.eventespresso.com so you’ll know about any important changes regarding backwards compatibility or other developments.

And if you do build something great with the EE4 REST API, consider listing it on our 3rd party addons page.

Reporting Issues

If you have an REST API feature request, or bug to report, please let us know on our github repo.

Building a WordPress Plugin? Use the EE4 Database Models Instead

If you are building a WordPress plugin that will use Event Espresso 4 data server-side (in the PHP code), generally you do not need to use the API, and can instead use Event Espresso 4’s database models, config, and other modules directly. Check out developer.eventespresso.com for tutorials on how to use many of these systems.

We hope you enjoy using the Event Espresso 4 modern REST API, let us know what you think.

Related Articles

One thought on “REST API Now In EE4 Core

Share a Reply or Comment

Your email address will not be published.

Need help with Event Espresso? Create a support post in our support forums

Event Espresso
[gravityform id=116 title=false description=false]
<script type="text/javascript">var gform;gform||(document.addEventListener("gform_main_scripts_loaded",function(){gform.scriptsLoaded=!0}),window.addEventListener("DOMContentLoaded",function(){gform.domLoaded=!0}),gform={domLoaded:!1,scriptsLoaded:!1,initializeOnLoaded:function(o){gform.domLoaded&&gform.scriptsLoaded?o():!gform.domLoaded&&gform.scriptsLoaded?window.addEventListener("DOMContentLoaded",o):document.addEventListener("gform_main_scripts_loaded",o)},hooks:{action:{},filter:{}},addAction:function(o,n,r,t){gform.addHook("action",o,n,r,t)},addFilter:function(o,n,r,t){gform.addHook("filter",o,n,r,t)},doAction:function(o){gform.doHook("action",o,arguments)},applyFilters:function(o){return gform.doHook("filter",o,arguments)},removeAction:function(o,n){gform.removeHook("action",o,n)},removeFilter:function(o,n,r){gform.removeHook("filter",o,n,r)},addHook:function(o,n,r,t,i){null==gform.hooks[o][n]&&(gform.hooks[o][n]=[]);var e=gform.hooks[o][n];null==i&&(i=n+"_"+e.length),gform.hooks[o][n].push({tag:i,callable:r,priority:t=null==t?10:t})},doHook:function(n,o,r){var t;if(r=Array.prototype.slice.call(r,1),null!=gform.hooks[n][o]&&((o=gform.hooks[n][o]).sort(function(o,n){return o.priority-n.priority}),o.forEach(function(o){"function"!=typeof(t=o.callable)&&(t=window[t]),"action"==n?t.apply(null,r):r[0]=t.apply(null,r)})),"filter"==n)return r[0]},removeHook:function(o,n,t,i){var r;null!=gform.hooks[o][n]&&(r=(r=gform.hooks[o][n]).filter(function(o,n,r){return!!(null!=i&&i!=o.tag||null!=t&&t!=o.priority)}),gform.hooks[o][n]=r)}});</script> <div class='gf_browser_unknown gform_wrapper gform_legacy_markup_wrapper' id='gform_wrapper_116' ><form method='post' enctype='multipart/form-data' id='gform_116' action='/2016/01/rest-api-now-in-ee4-core/' novalidate> <div class='gform_body gform-body'><ul id='gform_fields_116' class='gform_fields top_label form_sublabel_below description_below'><li id="field_116_5" class="gfield gfield_contains_required field_sublabel_hidden_label field_description_below gfield_visibility_visible" ><label class='gfield_label gfield_label_before_complex' >What is your first name?<span class="gfield_required"><span class="gfield_required gfield_required_asterisk">*</span></span></label><div class='ginput_complex ginput_container no_prefix has_first_name no_middle_name no_last_name no_suffix gf_name_has_1 ginput_container_name' id='input_116_5'> <span id='input_116_5_3_container' class='name_first' > <input type='text' name='input_5.3' id='input_116_5_3' value='' aria-required='true' placeholder='First name' /> <label for='input_116_5_3' class='hidden_sub_label screen-reader-text'>First name</label> </span> </div></li><li id="field_116_1" class="gfield gfield_contains_required field_sublabel_below field_description_below gfield_visibility_visible" ><label class='gfield_label' for='input_116_1' >What is your email address so we can follow up with you?<span class="gfield_required"><span class="gfield_required gfield_required_asterisk">*</span></span></label><div class='ginput_container ginput_container_text'><input name='input_1' id='input_116_1' type='text' value='' class='medium' placeholder='hello@example.com' aria-required="true" aria-invalid="false" /> </div></li><li id="field_116_2" class="gfield gfield_contains_required field_sublabel_below field_description_below gfield_visibility_visible" ><label class='gfield_label' for='input_116_2' >Tell us about your concerns below<span class="gfield_required"><span class="gfield_required gfield_required_asterisk">*</span></span></label><div class='ginput_container ginput_container_textarea'><textarea name='input_2' id='input_116_2' class='textarea medium' placeholder='What kind of events are you planning?' aria-required="true" aria-invalid="false" rows='10' cols='50'></textarea></div></li><li id="field_116_6" class="gfield field_sublabel_below field_description_below gfield_visibility_visible" ><label class='gfield_label gfield_label_before_complex' >GDPR Agreement</label><div class='ginput_container ginput_container_checkbox'><ul class='gfield_checkbox' id='input_116_6'><li class='gchoice gchoice_116_6_1'> <input class='gfield-choice-input' name='input_6.1' type='checkbox' value='I consent to have this website store my submitted information so they can respond to my inquiry.' id='choice_116_6_1' /> <label for='choice_116_6_1' id='label_116_6_1'>I consent to have this website store my submitted information so they can respond to my inquiry.</label> </li></ul></div></li><li id="field_116_3" class="gfield gform_hidden field_sublabel_below field_description_below gfield_visibility_visible" ><div class='ginput_container ginput_container_text'><input name='input_3' id='input_116_3' type='hidden' class='gform_hidden' aria-invalid="false" value='' /></div></li><li id="field_116_4" class="gfield gform_hidden field_sublabel_below field_description_below gfield_visibility_visible" ><div class='ginput_container ginput_container_text'><input name='input_4' id='input_116_4' type='hidden' class='gform_hidden' aria-invalid="false" value='https://eventespresso.com/2016/01/rest-api-now-in-ee4-core/' /></div></li><li id="field_116_7" class="gfield gform_validation_container field_sublabel_below field_description_below gfield_visibility_visible" ><label class='gfield_label' for='input_116_7' >Email</label><div class='ginput_container'><input name='input_7' id='input_116_7' type='text' value='' autocomplete='new-password'/></div><div class='gfield_description' id='gfield_description_116_7'>This field is for validation purposes and should be left unchanged.</div></li></ul></div> <div class='gform_footer top_label'> <input type='submit' id='gform_submit_button_116' class='gform_button button' value='Send my message' onclick='if(window["gf_submitting_116"]){return false;} if( !jQuery("#gform_116")[0].checkValidity || jQuery("#gform_116")[0].checkValidity()){window["gf_submitting_116"]=true;} ' onkeypress='if( event.keyCode == 13 ){ if(window["gf_submitting_116"]){return false;} if( !jQuery("#gform_116")[0].checkValidity || jQuery("#gform_116")[0].checkValidity()){window["gf_submitting_116"]=true;} jQuery("#gform_116").trigger("submit",[true]); }' /> <input type='hidden' class='gform_hidden' name='is_submit_116' value='1' /> <input type='hidden' class='gform_hidden' name='gform_submit' value='116' /> <input type='hidden' class='gform_hidden' name='gform_unique_id' value='' /> <input type='hidden' class='gform_hidden' name='state_116' value='WyJbXSIsIjBiNjdjZjkyMDUzOWUxOWY5Y2NiZjIwMzM4YjA1Mjk4Il0=' /> <input type='hidden' class='gform_hidden' name='gform_target_page_number_116' id='gform_target_page_number_116' value='0' /> <input type='hidden' class='gform_hidden' name='gform_source_page_number_116' id='gform_source_page_number_116' value='1' /> <input type='hidden' name='gform_field_values' value='' /> </div> <p style="display: none !important;"><label>&#916;<textarea name="ak_hp_textarea" cols="45" rows="8" maxlength="100"></textarea></label><input type="hidden" id="ak_js_2" name="ak_js" value="234"/><script>document.getElementById( "ak_js_2" ).setAttribute( "value", ( new Date() ).getTime() );</script></p></form> </div>