API's are the clear future

26 February 2017

Every Funraisin platform comes with it's very own API

This alo=lows you to access your data from other 3rd party applications. Using the API you can tap directly into your data in real-time and at any time for things like storing your data in other CRM systems, or for simply displaying things like leaderboards on other websites.

Today's post is not for everyone and certainly not for the the faint hearted. Packed with detail this is awesome bedtime reading for those of us less technically inclined.

But without further adue, we wanted to give you the breakdown of Funraisin's API.

Creating a User

To connect to your API first you need to create a user and allow that user access to the API. This can be done in Funraisin > User Admin. Jump in and create a new user and make sure you tick the "API Access" checkbox and then keep these credentials handy.

Your API URL


To access your API you can use https://yourdomain.com/api/

Authentication

When connecting to your API you need to send through the email address and password of the user that you created in the step above. This can be done via simple GET variables "username" and "password", when retrieving records or POST variables when updating or creating new records.

For example https://yourdomain.com/api/?username=apiuser@yourdomain.com&password=myapipassword

Make sure you keep your username and password safe and make sure you always access your API via https and not http.

Specifying Formats and Date Ranges

When accessing each endpoint you can send a GET variable "format" to specify whether you want us to return the data in CSV of JSON format. If you don't specify the format then you we will use CSV.

Each endpoint also has additional GET variables for filtering the data date ranges. When using dates please use the form "yyyy-mm-dd".

Using "date_from" will return any record created or modified since that date. Using "date_to" will return any record created or modified prior to that date. Both "date_from" and "date_to" can be used together or on their own.

e.g. The below example will grab all donations made in 2016

https://yourdomain.com/api/donations?username=apiuser@yourdomain.com&password=apipassword&date_from=2016-01-01&date_to=2016-12-31

Paging & Limiting Results

For large datasets you can use the GET parameter "limit" to restrict the number of rows returned. Additionally, you can use the "offset" parameter to then handle paging.

e.g. https://yourdomain.com/api/donations?username=apiuser@yourdomain.com&password=apipassword&limit=1000&offset=1000

Updating and Creating New Records

Some endpoints will allow you to update or create new records by posting an array called "data" to the endpoint.

Example: POST to https://yourdomain.com/api/donations/123

data[d_email] = joeblogs@gmail.com;
data[d_phone_mobile] = 0404 123 456;

Will update donation record 123 with the above details.

Available Endpoints

There are 2 types of endpoints for accessing your data, we have static endpoints and dynamic endpoints.

Static endpoints are simply direct access to your data tables, they return every column, un-formatted by us, making it ideal for accessing data for the purposes of storing in an external CRM.

Dynamic endpoints are the exact opposite. They consist of data that has been manipulated by us to produce more meaningful information, making these ideal for the use of displaying things like leaderboards on external websites.

The following static endpoints allow you to access your data tables.

Donations

Url: https://yourdomain.com/api/donations
Formats: CSV (default) or JSON
Options: date_from, date_to
Primary key: donation_id

Column Type Null Default Comments
donation_id bigint(20) No
event_id bigint(20) No 0
team_id bigint(20) No 0
member_id bigint(20) No 0
cause_id bigint(20) No
fbuser_id varchar(150) No
fbuser_pic varchar(150) No
history_id bigint(20) No 0
page_id bigint(20) No
donation_hash varchar(255) No
donation_type varchar(20) No online
donation_frequency varchar(50) No
donation_reason varchar(100) No
donation_reason_for text No
donation_interval varchar(50) No
display_on enum('Y', 'N') No Y
d_photo varchar(150) No
d_title varchar(20) No
d_fname varchar(150) No
d_lname varchar(150) No
d_organisation varchar(255) No
d_email varchar(150) No
d_optin enum('Y', 'N') No N
d_optin_charity enum('Y', 'N') No N
d_optin_fees enum('Y', 'N') No N
d_fee double(7,2) No
d_gender enum('M', 'F') No M
d_dob date No
d_address_unit varchar(20) No
d_address_number varchar(20) No
d_address_street varchar(150) No
d_address_suburb varchar(150) No
d_address_pcode varchar(50) No
d_address_state varchar(150) No
d_address_country varchar(150) No
d_phone varchar(100) No
d_phone_home varchar(80) No
d_phone_work varchar(80) No
d_phone_mobile varchar(80) No
d_comments text No
d_display_name varchar(150) No
d_receipt varchar(50) No personal
d_anonymous enum('Y', 'N') No N
d_amount double(13,2) No 0.00
d_amount_free double(7,2) No
d_amount_sel double(7,2) No
gateway_customer_ref varchar(255) No
gateway_card_ref varchar(255) No
po_number varchar(32) No
tax_ref varchar(80) No
card_type varchar(20) No
payment_method varchar(60) No credit card
card_number varchar(20) No
card_name varchar(150) No
card_expiry varchar(20) No
cheque_name varchar(150) No
cheque_number varchar(150) No
date_paid datetime No
d_status varchar(10) No paid
d_receipt_num int(7) No 0000000
d_receipt_sent enum('Y', 'N') No N
is_mobile enum('Y', 'N') No N
is_donation enum('Y', 'N') No Y
is_profile_donation enum('Y', 'N') No N
d_refund_amount double(7,2) No
d_refund_reason text No
d_refund_date datetime No
sent_thanks enum('Y', 'N') No N
in_memory_title varchar(50) No
in_memory_fname varchar(150) No
in_memory_lname varchar(150) No
kw_address varchar(255) No
donor_lat varchar(150) No
donor_lng varchar(150) No
donor_ip varchar(150) No
utm_campaign text No
utm_source text No
utm_medium text No
utm_content text No
utm_term text No
donation_tags text No
crm_donor_id varchar(255) No
last_logged_in date No
last_updated datetime No 0000-00-00 00:00:00
date_created

Get all donations

To access your donation data you can use the below methods.

GET https://yourdomain.com/api/donations

Get a single donation

If you want to get a specific donation record you can specify the id of the donation in the url

GET https://yourdomain.com/api/donations/

Create a new donation

To create a new donation record you can send a POST request with the fields sent via the $_POST["data"] array.

POST https://yourdomain.com/api/donations

This will produce a result of Success or Failure.

Update a donation

To update an existing donation you can send a POST request specifying the donation_id in the url, with any field that you want updated sent via the $_POST["data"] array.

POST https://yourdomain.com/api/donations/

This will product a result of Success or Failure.

Recurring Donations

Url: https://yourdomain.com/api/recurringdonations
Formats: CSV (default) or JSON
Options: date_from, date_to
Primary key: id
Read only

Column Type Null Default Comments
id bigint(20) No
donation_id bigint(20) No
d_amount double(7,2) No
po_number varchar(150) No
tax_ref varchar(255) No
crm_donation_id varchar(255) No
date_created datetime No

Get all donations

To access your donation data you can use the below methods.

GET https://yourdomain.com/api/recurringdonations

Get a single donation

If you want to get a specific donation record you can specify the id of the donation in the url

GET https://yourdomain.com/api/recurringdonations/

Participants

Url: https://yourdomain.com/api/participants/
Formats: CSV (default) or JSON
Options: date_from, date_to
Primary key: member_id

To access your fundraisers / participants you can use the below methods. Note that this data will NOT contain any information relating to their event, it will only give you the main contact details for each participant such as names, email, phone numbers, address data etc. To get information relating to their event, use the below method Participants Events.

Column Type Null Default Comments
member_id bigint(20) No
member_hash varchar(255) No
related_member_id bigint(20) No
m_rego_number varchar(150) No
fbuser_id varchar(150) No
fbuser_pic varchar(255) No
m_status_type varchar(100) No
m_title varchar(50) No
m_fname varchar(150) No
m_lname varchar(150) No
m_maiden varchar(100) No
m_email varchar(150) No
m_username varchar(50) No
m_pass varchar(32) No
m_dob date No 0000-00-00
m_gender enum('M', 'F') No M
m_address_unit varchar(20) No
m_address_number varchar(20) No
m_address_street varchar(255) No
m_address_2 varchar(255) No
m_address_suburb varchar(255) No
m_address_pcode varchar(20) No
m_address_state varchar(20) No
m_address_country varchar(150) No
postal_is_same enum('Y', 'N') No N
m_postal_street varchar(255) No
m_postal_suburb varchar(255) No
m_postal_pcode varchar(20) No
m_postal_state varchar(20) No
m_phone_home varchar(80) No
m_phone_work varchar(80) No
m_phone_mobile varchar(80) No
m_emergency_contact varchar(150) No
m_emergency_contact_alt varchar(150) No
m_emergency_contact_type varchar(150) No
m_emergency_phone varchar(150) No
m_medical_conditions varchar(10) No
m_medical_conditions_text text No
m_business_contact_name varchar(150) No
m_business_contact_number varchar(150) No
m_medication varchar(10) No
m_medication_details text No
m_hospitalised varchar(10) No
m_hospitalised_details text No
m_addition_care text No
m_twitter varchar(150) No
m_pinterest varchar(150) No
participated_prior enum('Y', 'N') No N
m_photo varchar(255) No
m_coverphoto_personal varchar(255) No
m_background varchar(255) No
m_insupport varchar(150) No
m_confirmation_sent enum('Y', 'N') No N
m_reminder_sent enum('Y', 'N') No N
m_donation_sent enum('Y', 'N') No N
m_goal_sent enum('Y', 'N') No N
m_alert_donation enum('Y', 'N') No Y
m_alert_goal enum('Y', 'N') No Y
m_agreed_waiver enum('Y', 'N') No N
m_name_alt varchar(155) No
m_gallery_title varchar(150) No
m_gallery_copy text No
m_ranking_overall_on enum('Y', 'N') No Y
m_ranking_team_on enum('Y', 'N') No Y
agree_site_terms enum('Y', 'N') No N
participated_before varchar(255) No
agree_to_pay enum('Y', 'N') No Y
agree_over_18 enum('Y', 'N') No N
agree_to_fundraise enum('Y', 'N') No N
m_company varchar(150) No
m_company_matchgiving enum('Y', 'N') No N
m_position varchar(150) No
referal varchar(150) No
is_mobile enum('Y', 'N') No N
optin enum('Y', 'N') No N
m_optin enum('Y', 'N') No Y
crm_member_id varchar(255) No
ecrm_customer_id varchar(255) No
gateway_customer_ref varchar(255) No
gateway_card_ref varchar(255) No
m_status int(1) No 0
last_logged_in datetime No
last_updated datetime No 0000-00-00 00:00:00
date_created

Get all participants

GET https://yourdomain.com/api/participants

Get a single participant

GET https://yourdomain.com/api/participants/

Create a new participant

POST https://yourdomain.com/api/participants

Update a participant

POST https://yourdomain.com/api/participants/

Participants Events

Url: https://yourdomain.com/api/participantsevents
Formats: CSV (default) or JSON
Options: date_from, date_to, member_id, event_id
Primary key: history_id

The participants events endpoint produces information relating to each participant's event that they are taking part in, whether it be an online event, offline event of a diy event. Information such as their fundraising target, payment information is held in this table.

Column Type Null Default Comments
history_id bigint(20) No
member_id bigint(20) No 0
event_id bigint(20) No 0
team_id bigint(20) No 0
group_id bigint(20) No
table_id bigint(20) No
history_type enum('online', 'offline', 'diy') No online
member_type varchar(150) No
bib_number varchar(20) No
seat_number int(4) No
is_active enum('Y', 'N') No N
is_archived enum('Y', 'N') No N
is_fundraising enum('Y', 'N') No Y
is_team enum('Y', 'N') No N
done_personaldetails enum('Y', 'N') No N
done_eventoptions enum('Y', 'N') No N
done_fundraising enum('Y', 'N') No N
done_teamdetails enum('Y', 'N') No N
conf_key varchar(80) No
entry_code varchar(20) No
promo_id bigint(20) No
paypal_token varchar(150) No
ticket varchar(32) No
number_tickets int(4) No
number_tables int(4) No
team_access enum('Y', 'N') No N
m_display_reason enum('Y', 'N') No N
m_target double(9,0) No 0
m_target_distance double(8,0) No
m_comments text No
m_reason text No
m_page_title varchar(255) No
m_coverphoto varchar(255) No
m_donation_amount double(7,2) No 0.00
m_donation_amount_sel varchar(20) No
m_donation_amount_free varchar(20) No
m_donation_po varchar(50) No
m_donation_fee double(8,2) No
m_donation_fee_optin enum('Y', 'N') No N
is_paid enum('Y', 'N') No N
is_complete enum('Y', 'N') No N
date_completed datetime No
total_paid double(7,2) No 0.00
total_paid_entry double(7,2) No
total_paid_ticket double(7,2) No 0.00
total_paid_paypal double(7,2) No 0.00
total_paid_card double(7,2) No 0.00
total_paid_extra double(7,2) No 0.00
total_paid_merchandise double(7,2) No
total_paid_donation double(7,2) No
total_paid_fees double(7,2) No
m_receipt_sent enum('Y', 'N') No N
m_confirmation_sent enum('Y', 'N') No N
payment_method varchar(50) No credit card
payment_source enum('online', 'offline') No online
po_number varchar(150) No
tax_ref varchar(150) No
card_type varchar(20) No
card_number varchar(20) No
card_expiry varchar(20) No
card_name varchar(150) No
date_paid datetime No
bsb_number varchar(20) No
account_number varchar(50) No
cheque_name varchar(150) No
money_order_number varchar(50) No
sort_order bigint(20) No 0
activity_lat varchar(150) No
activity_lng varchar(150) No
card_token varchar(150) No
customer_token varchar(150) No
utm_campaign text No
utm_source text No
utm_medium text No
utm_content text No
utm_term text No
m_thanks_message text No
m_thanks_video varchar(255) No
m_thanks_image varchar(255) No
in_memory_name varchar(150) No
crm_history_id varchar(255) No
last_updated datetime No
date_created datetime No 0000-00-00 00:00:00

Get all events

Use this to return ALL participant events

ttps://yourdomain.com/api/participantsevents

Get a specific record

To return a specific record you can send through the history_id

GET https://yourdomain.com/api/participantsevents/

Get a specific participant's events

To get any events for a specific person you can send through the optional "member_id" in the querystring.

GET ttps://yourdomain.com/api/participantsevents?member_id=1234

Get all entries for a specific event

To retrieve a list of entries for a specific event you can send through the optional "event_id" in the querystring

GET https://yourdomain.com/api/participantsevents?event_id=123

Participants Products

Url: https://yourdomain.com/api/participantsproducts/
Formats: CSV (default) or JSON
Options: date_from, date_to

The participants products endpoint produces information relating to each participant's products purchased during an event registration, if applicable.

This table is read only.

Column Type Null Default Comments
id bigint(20) No
option_type varchar(100) No
event_id bigint(20) No 0
member_id bigint(20) No 0
history_id bigint(20) No 0
product_id bigint(20) No
shop_product_id bigint(20) No
option_id bigint(20) No 0
option_num int(2) No 0
option_textfield text No
option_cost double(7,2) No 0.00
date_created datetime No 0000-00-00 00:00:00

Get all records

To retrieve all participant's products use

GET ttps://yourdomain.com/api/participantsproducts

Get a specific participant's records

To retrieve product information during a specific registration you can send through the history_id of the registration (from the participants events table)

GET ttps://yourdomain.com/api/participantsproducts/

Teams

Url: https://yourdomain.com/api/teams
Formats: CSV (default) or JSON
Options: date_from, date_to
Primary key: team_id

Column Type Null Default Comments
team_id bigint(20) No
event_id bigint(20) No 0
history_id bigint(20) No 0
captain_id bigint(20) No 0
bib_number varchar(20) No
t_name varchar(150) No
t_url varchar(150) No
t_target double(9,0) No 0
is_featured enum('Y', 'N') No N
t_comments text No
t_page_title varchar(255) No
t_company_name varchar(150) No
t_company_website varchar(255) No
t_industry varchar(150) No
t_industry_other varchar(150) No
t_photo varchar(255) No
t_coverphoto varchar(255) No
t_background varchar(150) No
t_alert_donation enum('Y', 'N') No Y
t_alert_member enum('Y', 'N') No Y
t_alert_goal enum('Y', 'N') No Y
t_goal_sent enum('Y', 'N') No N
t_gallery_title varchar(150) No
t_gallery_copy text No
t_thanks_message text No
t_rank_position int(11) No 0
t_rank_aveposition int(11) No 0
t_rank_category varchar(10) No
t_ranking_overall_on enum('Y', 'N') No Y
t_ranking_average_on enum('Y', 'N') No Y
t_donations_total double(8,2) No 0.00
t_members_total int(4) No 0
t_representing varchar(150) No
related_teams text No
t_public enum('Y', 'N') No Y
crm_team_id varchar(255) No
t_status int(1) No 1
last_updated datetime No 0000-00-00 00:00:00
date_created datetime No 0000-00-00 00:00:00

Get all teams

To access your team data you can use the below methods.

GET https://yourdomain.com/api/teams

Get a single team

If you want to get a specific team record you can specify the team_id of the team in the url

GET https://yourdomain.com/api/teams/

Create a new team

To create a new team record you can send a POST request with the fields sent via the $_POST["data"] array.

POST https://yourdomain.com/api/teams

This will produce a result of Success or Failure.

Update a team

To update an existing team you can send a POST request specifying the team_id in the url, with any field that you want updated sent via the $_POST["data"] array.

POST https://yourdomain.com/api/teams/

This will product a result of Success or Failure.

Events

Url: https://yourdomain.com/api/events
Formats: CSV (default) or JSON
Options: date_from, date_to
Primary key: event_id

Column Type Null Default Comments
event_id bigint(20) No
created_member_id bigint(20) No
page_id bigint(20) No
event_key varchar(255) No
event_code varchar(20) No
is_locked enum('Y', 'N') No N
has_page enum('Y', 'N') No N
event_name varchar(150) No
event_type enum('online', 'offline', 'diy') No online
event_category varchar(150) No
allow_entries enum('Y', 'N') No Y
entry_type varchar(80) No
entry_limit varchar(20) No
use_entry_code enum('Y', 'N') No N
entry_code varchar(50) No
event_fee double(7,2) No 0.00
event_fee_description text No
event_ticket_price double(7,2) No
event_tickets int(5) No
event_tickets_max int(4) No
event_tickets_min int(3) No 1
event_allow_tables enum('Y', 'N') No N
event_tables int(4) No
event_table_price double(7,2) No
event_seats_per_table int(4) No
event_fundraising enum('Y', 'N') No N
event_domain varchar(255) No
st_prefix_donation varchar(50) No DON
st_prefix_registration varchar(50) No REG
st_prefix_ticket varchar(50) No TKT
st_prefix_shop varchar(80) No SHP
event_closed enum('Y', 'N')

Join newsletter