Some GET methods provide optional filter parameters you can include to narrow API results based on various criteria. The following sections show how to use some filter parameters to get data on campaigns, donations, and users. This page contains the following topics:
Use one of the following URLs to open the API reference:
Test system: https://demo.360alumni.com/api/doc/
Your system: https://<<your-system>>.360alumni.com/api/doc</your-system>
The following steps walk you through using a filter parameter to get data on campaigns.
1. Click the GET /api/campaigns/ method.
Optional filter parameters include created_since and created_before. Use these parameters to narrow the campaigns returned to within a specific time frame.
2. Click Sandbox to display the form for entering values and trying the request.
For this example we'll narrow the results to those campaigns created since August 1, 2017.
A) Enter your API key in an HTTP request header.
B) Enter the value 2017-08-01 for the created_since parameter.
C) Click Try! to execute the API request.
3. The Response Body shows the JSON results.
Note the values for the createdAt field are more recent than the value input for created_since.
The following steps walk you through using filter parameters to get data on donations.
1. Click the GET /api/donations/ method. Note the following:
Optional parameters to filter the results include campaign_id, user_id, start_date, and end_date.
2. Click Sandbox to display the form for entering values and trying requests.
3. First we'll request all the donations.
A) Enter your API key in an HTTP request header.
B) Click Try! to execute the API request.
4. The Response Body contains a JSON array of Donation Objects that includes all donations. The following image shows a few of these results. Note the following:
Donation object fields correspond to the filter parameters campaign_id and user_id for GET /api/donations/ requests.
The created_at field determines the results of a GET /api/donations/ request if you use the start_date or end_date filter parameters.
5. The next request filters donations by user_id.
A) Enter 1102 for the user_id value.
B) Click Try! to execute the API request.
6. Note the results contain a few donation objects.
The following steps walk you through using filter parameters to get data on users.
1. Click the GET /api/users/ method.
2. Click Sandbox to display the form for entering values and trying requests.
3. Note there are a great number of optional parameters available to filter the results.
4. First we'll request all users that are not yet approved.
A) Enter your API key in an HTTP request header.
B) Enter the value 0 for the approved field. A 1 represents approved and a 0 represents not approved.
C) Click Try! to execute the API request.
5. The Response Body contains a JSON array of user objects where the approved field value is 0.
6. The next request filters for all approved users that are not enabled.
A) Enter the value 1 for the approved field.
B) Enter the value 0 for the enabled field. A 1 represents enabled accounts and a 0 represents accounts that are not enabled.
C) Click Try! to execute the API request.
7. Note the results contain fewer user records.
8. Click a down arrow in the Response Body to collapse the view of an object's fields.
Name
Type
Required
Description
Format
amount
number
Required
Words
campaign_id
number
Required
Words
created_at
string
Words
Words
first_name
string
Words
id
string
Words
Words
last_name
string
Words
user_id
number
Words
The following JSON Donation object is suitable for copying.
Name
Type
Required
Description
Format
ambassadors
array of ambassador objects
optional
See ambassador object below.
author
author object
optional
See the author object below.
createdAt
string
The date this campaign record was created.
.YYYY-MM-DD Year-Month-Day
details
string
The detailed description of the organisation and campaign.
end_date
string
The date the campaign ends.
.YYYY-MM-DD Year-Month-Day
goal
number
The monetary goal for the campaign,
id
number
Required
A unique ID for this campaign auto-generated by 360Alumni.
image
string
A URL to an image representing the campaign or organization.
URL
islnactive
number
The status of whether the campaign is active. 1: is active 0: is inactive
raised
number
The monetary amount raised by the campaign.
start_date
string
The date the campaign starts.
.YYYY-MM-DD Year-Month-Day
thank_you_message
string
A thank-you message that can be sent to donors.
title
string
Required
The title for the campaign.
type
string
The type of the campaign length such as short or ongoing.
updatedAt
string
The date this campaign record was modified.
.YYYY-MM-DD Year-Month-Day
Name
Type
Required
Format
user_id
number
Required
The user ID identifying an ambassador for the campaign generated by 360Alumni. See also the User Object.
first_name
string
Required
The ambassador's first name.
last_name
string
Required
The ambassador's last name.
JSON Field
(* = Required)
JSON Type (size)
Valid Values
Description
Format
Type
Format
Description
Date
YYYY-MM-DD
Year-Month-Day. Example: 2018-03-21
Learn
Learn how to use the API
API
Try the API