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.

CharityEngine Public APIs

Public Web API & 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="//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.

var data = {
"ClientId": 123,
"OptInListIds": [1,2,3],
"Contact": {
"PersonInfo": { "FirstName": "John", "LastName": "Smith" },
"EmailAddress": "JohnSmith@gmail.com"
}};

$.ajax({
type: "POST",
url: "https://webapi.charityengine.net/v/1/Rest/Public/CE/Campaigns/ListOptIn",
data: JSON.stringify(data),
success: function(response){console.log(JSON.stringify(response));},
contentType: "application/json",
dataType: "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" 
  }
}
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

var data = {
"ClientId": 1,
"OptInListIds": [27052],
"Contact": {
"PersonInfo": { "FirstName": "Patrick", "LastName": "Burke" },
"EmailAddress": "patrick.burke@bisglobal.com"
}};

$.ajax({
type: "POST",
url: "https://webapi.charityengine.net/v/1/Rest/Public/CE/Campaigns/ListOptIn",
data: JSON.stringify(data),
success: function(response){console.log(JSON.stringify(response));},
error: function(err) {console.log(JSON.stringify(err));},
contentType: "application/json",
dataType: "json"
});

CharityEngine in context API & Examples

Documentation | Version History

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

Step 1 – Paste the Current Page Visitor sample code

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 end point.

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

$.ajax({
type:"GET",
url: "https://webapi.charityengine.net/v/1/Rest/CEContext/CE/WebPage/Visitor",
success: function(response){console.log(JSON.stringify(response));}
});