Blog

Developers

Eric Tompkins
May 3, 2017

Integrate BranchCMS With Other Services Using the Request Object

Websites today rarely live in isolation. Often they are either integrating other services like a Facebook feed or Disqus comments, or they are pushing content to other services like a Customer Relation Manager (CRM). With BranchCMS you can easily send data to other websites or services using the Request Object.

As an example, let's say that you have a form on your website where you collect information about a prospect and you want to send that information to your CRM. BranchCMS forms have a feature called a Post Process Script that allows you to use template coding to either manipulate form data or use the Request Object to send data to another website. 

In this example the form has three fields:

  • First Name (with a field key of firstName)
  • Last Name (with a field key of lastName)
  • Email (with a field key of email)

You could then edit the form and add the following code to the Post Process Script to send the form data to the CRM.

{% set request = _core.request.getObject('http://www.mycrm.com/api') %}
{% do request.setParam('first_name', form.fields.firstName.value) %}
{% do request.setParam('last_name', form.fields.lastName.value) %}
{% do request.setParam('email', form.fields.email.value) %}
{% do request.post() %}

Other uses

The Request Object fits very well with forms to send data to another web service, but you can use them in any other template. Another use could be to load data from another website through their API to display on your website. 

No plugins needed

Because the Request Object is built into BranchCMS you don't need a plugin to integrate other websites with your own. Our goal with BranchCMS is for it to be a powerful platform for custom websites. The Request Object is just one way that we're achieving that goal.

 

Sign up for our newsletter to receive invaluable information about BranchCMS, web design & development.