Learn about our newest features and enhancements!
Public Web API


Interesting in server to server integration with CharityEngine? Visit our Integration API Overview here.

Public Web API Overview

The Public API framework is a set of Web Endpoints that are created for web designers and front-end developers to harness the power of the CharityEngine platform to create amazing user experiences. These endpoints are available in both REST and SOAP protocols with JSON or XML content types to provide simple and flexible integrations in the language of your choice. These endpoints do not require credentials for integration and many will automatically identify users based on their context while visiting a CharityEngine web application.

Example usages are adding payment widgets to third-party websites or social media pages, creating sign-up widgets to acquire prospect information, or customizing the user-experience by identifying visitors and personalizing what they see on web landing pages.

If you would like to leverage our Public Web APIs, contact our Partner Sales team today or contact our customer care team if you are already a CharityEngine customer.

***PLEASE NOTE - When using dynamic, pre-processing languages like PHP, ColdFusion & ASP, you will need to ensure calls to our WebAPI are made outside of the dynamic code, after the page has been rendered.  If this is not possible, then our Integration API might be better suited for your needs. ***

Public Web API & Examples

Examples | Documentation | Version History

Step 1: Include the CharityEngine Javascript API

The CharityEngine Javascript API is the Campaign Tracking Javascript that is used for Web2CRM and automatically installed on our apps. If you are using a third-party website to run any CharityEngine web api scripts, please include the CharityEngine Javascript API.

CharityEngine Javascript API


<script language="JavaScript" src="https://webapi.charityengine.net/api.js" async="" defer="defer"></script>

Step 2: Paste the List Signup sample code

Because the production web API is designed using open standards with both Rest and Soap support it can easily be used in any website or application.

JAVASCRIPT

HTTP JSON

Host: https://webapi.charityengine.net/v/1/Rest/ListSignUp Content-Type: application/json { "ClientId": 123, "OptInListIds": [1,2,3], "Contact": { "PersonInfo": { "FirstName": "John", "LastName": "Smith" }, "EmailAddress": "JohnSmith@gmail.com" } }
HTTP XML
   Host: https://webapi.charityengine.net/v/1/Rest/Public/CE/Campaigns/ListOptIn
   Content-Type: application/xml

   <listsignupparameters>
   <clientid>123</clientid>
   <optinlistids>
   <value>1</value>
   <value>2</value>
   <value>3</value>
   </optinlistids>
   <contact>
   <personinfo>
   <firstname>John</firstname>
   <lastname>Smith</lastname>
   </personinfo>
   <emailaddress>JohnSmith@gmail.com</emailaddress>
   </contact>
   </listsignupparameters>

Step 3: Insert your unique client key

In order for any CharityEngine API scripts to run on a third party website, we need a unique client key {DOMAIN} assigned in the client’s account, this {DOMAIN} should be passed in the URL to access the web API.

v/1/Rest/Public/{Domain}/Events/{id}

Once you have a CharityEngine API account provisioned, you can access the APIs by using the production Web API end point.

Step 4: See the output for List Signup sample code

   CE_API.SetApiKey('CE');

   CE_API.ListOptIn('1,2,3', 'JohnSmith@gmail.com', 'John', 'Smith',
	              function (result) {

                    if (result != null && result.Successful)
                        console.log('success');
                    else
                        console.log('fail');

                },
                function (result) { console.log('fail: ' + result.Error.Message) },
                function () { console.log('error'); });

CharityEngine in Context API & Examples

Examples | Documentation | Version History

A set of APIs that can be used within CharityEngine applications (e.g. PeerToPeer, CMS, Advocacy, etc.) to retrieve information based on the current context.

Step 1 – Paste the Current Page Visitor sample code

Javascript – Current Page Visitor
   var data = {
   "ClientId": 123,
   "OptInListIds": [1,2,3],
   "Contact": {
   "PersonInfo": { "FirstName": "John", "LastName": "Smith" },
   "EmailAddress": "JohnSmith@gmail.com"
   }};
   $.ajax({
   type:"GET",
   url: "https://webapi.charityengine.net/v/1/Rest/CEContext/CE/WebPage/Visitor",
   success: function(response){console.log(JSON.stringify(response));}
   });

Step 2: Insert your unique client key

In order for any CharityEngine API scripts to run on a third-party website, we need a unique client key {DOMAIN} assigned in the client’s account, this {DOMAIN} should be passed in the URL to access the web API.

v/1/Rest/Public/{Domain}/Events/{id}

Once you have a CharityEngine API account provisioned, you can access the APIs by using the production Web API endpoint.

Step 3 – See the output for Current Page Visitor sample code

Javascript – Current Page Visitor
   CE_API.SetApiKey('CE');

   CE_API.ListOptIn('1,2,3', 'JohnSmith@gmail.com', 'John', 'Smith',
	              function (result) {

                    if (result != null && result.Successful)
                        console.log('success');
                    else
                        console.log('fail');

                },
                function (result) { console.log('fail: ' + result.Error.Message) },
                function () { console.log('error'); });


Powered by Powered By CharityEngine