A basic request to the rally api would take the form of
https://rally.org/api/causes/QWERTY?access_token=ABCDEFGHIJKLMNOP
.
QWERTY
in this case references the cause ID that this request is trying to get information about.
?access_token=...
part is the inclusion of your unique oauth token that we can use to identify your Rally user. It must be present in all API requests. Using the access token allows you to make as many requests as you like and ensures you have permissions for the requests you are making. Keep your access token secret and never share your access token! See the
Authorization
section on obtaining this token.
This implements the OAuth2 Provider flow.
Prior to beginning this, a user should have three pieces of information
1.
client_key
2.
client_secret
3.
redirect_url
These three things should be substituted in the urls in the following steps.
Authorize a user to your app:
http://rally.org/oauth/authorize?client_id=<client key>&response_type=code&redirect_uri=<redirect_url>
<redirect_url>?code=<auth_code>&state=<optional_junk>
auth_code
above should be kept
Get access_token for user:
https://rally.org/oauth/token/?client_id=<client_key>&client_secret=<client_secret>&code=<auth_code from above>&grant_type=authorization_code&redirect_uri=<redirect_url>
{"token_type":"bearer","access_token":"YOUR ACCESS TOKEN"}
Save your access token from this response. This will be used in every API request.
The Rally API offers access to information about a user's causes and fundraisers through 4 types of requests (endpoints).
/drives/:NAME return details about a specific drive
/drives/:NAME/causes return the details of causes associated with the drive
/discover return all recent rallys for all users
/causes returns all rallys owned by the user
/causes/:ID returns details about a specific rally
/causes/:ID/recent_donor [deprecated] returns information about the last non-anonymous contribution for the rally
/causes/:ID/top_donors returns the top 100 non-anonymous donors for this rally, sorted by amount contributed
/causes/:ID/recent_fundraiser_posts [deprecated] returns the last 20 posts for this rally's fan fundraisers
/causes/:ID/fundraisers returns all fundraisers for the rally
/causes/:ID/donations returns all donations for this rally
/fundraisers returns all fundraisers owned by the user
/fundraisers/:ID returns details about a specific fundraiser
/fundraisers/:ID/top_donors returns the top 100 non-anonymous donors for this fundraiser, sorted by amount contributed
$ curl http://rally.org/api/drives/collection-vanity?access_token=ZXCVBNMLKJHGFDSAQWERTYUIOP
{ "name" : "collection-vanity",
"title" : "Support for bread cat to buy a boat",
"subtitle" : "He would really love a boat",
"description_title" : "Finally I will get a boat",
"description_body" : "We should buy him a boat",
"goal_cents" : 89900,
"hashtags" : ["breadcat", "ishouldbuyaboat"],
"featured_cause_id" : "DeAdBeeF",
"starts_at" : "01/01/2013",
"ends_at" : "10/10/2014",
"total_raised_in_cents" : 30052539
}
$ curl http://rally.org/api/drives/collection-vanity/causes?access_token=ZXCVBNMLKJHGFDSAQWERTYUIOP
[
{
"name":"An great cause",
"website_url":null,
"created_at":"2013-12-06T13:34:02.000-08:00",
"id":"2xCCaLa00T9",
"rally_url":"http://rally.org/pizzacat",
"supporter_count":0,
"cause_type":"Animal, Wildlife, Environment",
"cause_type_category":"Other",
"location":"Anytown, DE",
"location_zip":"12345",
"total_raised":0,
"donation_count":0,
"current_fundraising_goal":null,
"headline":"Help Support My Rally",
"blurb":"buy pizzas for all starving cats",
"image_url":"https://s3.aws.amazon.com/rallycall/covers/12/images/original/bg.jpg?1375997306",
"raised_toward_fundraising_goal":null
},
{
"name":"Another photo cause",
"website_url":null,
"created_at":"2013-12-06T13:34:01.000-08:00",
"id":"j600QI66Oe",
"rally_url":"http://localhost:3000/f/5JWU6YcaLsQ",
"supporter_count":0,
"cause_type":"Animal, Wildlife, Environment",
"cause_type_category":"Other",
"location":null,
"location_zip":null,
"total_raised":0,
"donation_count":0,
"current_fundraising_goal":null,
"headline":"Help Support My Rally",
"blurb":"I'm rallying for my friends to buy all starving cats unlimited pizzas",
"image_url":"https://s3.aws.amazon.com/rallycall/covers/12/images/original/bg.jpg?1375997306",
"raised_toward_fundraising_goal":null
}
]
$ curl https://rally.org/api/discover?access_token=ZXCVBNMLKJHGFDSAQWERTYUIOP
[
{
"blurb": null,
"cause_type": "Arts, Culture, Humanities",
"cause_type_category": "Other",
"created_at": "2013-08-08 14:30:26",
"current_fundraising_goal": null,
"headline": null,
"id": "7jl7Xu5aGRI",
"image_url": "https://s3.aws.amazon.com/rallycall/covers/12/images/original/bg.jpg?1375997306",
"name": "Banksy4Life",
"raised_toward_fundraising_goal": null,
"rally_url": "https://rally.org/banksy",
"supporter_count": 1,
"website_url": null,
"location": "Berlin, Germany",
"location_zip", "12345"
},
{
"blurb": null,
"cause_type": "Animal, Wildlife, Environment",
"cause_type_category": "Other",
"created_at": "2013-08-08 14:28:26",
"current_fundraising_goal": null,
"headline": null,
"id": "7jl7Xu5aGRI",
"image_url": "https://s3.aws.amazon.com/rallycall/covers/11/images/original/bg.jpg?1375997306",
"name": "Fennec Fox Breeding",
"raised_toward_fundraising_goal": null,
"rally_url": "https://rally.org/foxes",
"supporter_count": 1,
"website_url": null,
"location": "San Francisco, CA",
"location_zip": "94105"
},
]
id
: The unique identifier that references the cause
name
: The cause name as a string
created_at
: The timestamp when the cause was created (result will be sorted descending on this value).
current_fundraising_goal
: The number, in cents, of the current fundraising goal or null.
raised_toward_fundraising_goal
: The number, in cents, of the unrefunded amount raised for the current fundraising goal or null.
cause_type
: The self selected type, eg. "Education"
cause_type_category
: The self selected category, pretty sure this is always "Other"
image_url
: The url of their uploaded cover image or youtube thumbnail image from the video.
supporter_count
: The number of supporters for a cause
website_url
: A string of the cause's personal URL or an empty string, ""
rally_url
: A string of the cause's rally page
headline
: A string of the cause's headline or an empty string, ""
blurb
: A string of the cause's blurb or null
location
: The city/state (for US rallys) or city/country (for international rallies)
location_zip
: The zip code where the rally is registered
$ curl https://rally.org/api/causes?access_token=ZXCVBNMLKJHGFDSAQWERTYUIOP
[
{
"blurb": null,
"cause_type": "Arts, Culture, Humanities",
"cause_type_category": "Other",
"created_at": "2013-08-08 14:30:26",
"current_fundraising_goal": null,
"donation_count": 5,
"headline": null,
"id": "7jl7Xu5aGRI",
"image_url": "https://s3.aws.amazon.com/rallycall/covers/12/images/original/bg.jpg?1375997306",
"name": "Banksy4Life",
"raised_toward_fundraising_goal": null,
"rally_url": "https://rally.org/banksy",
"supporter_count": 1,
"total_raised": 25000,
"website_url": null,
"location": "Berlin, Germany",
"location_zip", "12345"
},
{
"blurb": null,
"cause_type": "Animal, Wildlife, Environment",
"cause_type_category": "Other",
"created_at": "2013-08-08 14:28:26",
"current_fundraising_goal": null,
"donation_count": 1,
"headline": null,
"id": "7jl7Xu5aGRI",
"image_url": "https://s3.aws.amazon.com/rallycall/covers/11/images/original/bg.jpg?1375997306",
"name": "Fennec Fox Breeding",
"raised_toward_fundraising_goal": null,
"rally_url": "https://rally.org/foxes",
"supporter_count": 1,
"total_raised": 1000,
"website_url": null,
"location": "San Francisco, CA",
"location_zip": "94105"
},
]
id
: The unique identifier that references the cause
name
: The cause name as a string
created_at
: The timestamp when the cause was created (result will be sorted descending on this value).
total_raised
: The number of the total unrefunded amount raised in cents.
donation_count
: The number of unrefunded donations made to the cause.
current_fundraising_goal
: The number, in cents, of the current fundraising goal or null.
raised_toward_fundraising_goal
: The number, in cents, of the unrefunded amount raised for the current fundraising goal or null.
cause_type
: The self selected type, eg. "Education"
cause_type_category
: The self selected category, pretty sure this is always "Other"
image_url
: The url of their uploaded cover image or youtube thumbnail image from the video.
supporter_count
: The number of supporters for a cause
website_url
: A string of the cause's personal URL or an empty string, ""
rally_url
: A string of the cause's rally page
headline
: A string of the cause's headline or an empty string, ""
blurb
: A string of the cause's blurb or null
location
: The city/state (for US rallys) or city/country (for international rallies)
location_zip
: The zip code where the rally is registered
$ curl https://rally.org/api/causes/ABCDEFGH?access_token=ZXCVBNMLKJHGFDSAQWERTYUIOP
{
"blurb": null,
"cause_type": "Animal, Wildlife, Environment",
"cause_type_category": "Other",
"created_at": "2013-08-08 14:28:26",
"current_fundraising_goal": null,
"donation_count": 1,
"headline": null,
"id": "7jl7Xu5aGRI",
"image_url": "https://s3.aws.amazon.com/rallycall/covers/11/images/original/bg.jpg?1375997306",
"name": "Fennec Fox Breeding",
"raised_toward_fundraising_goal": null,
"rally_url": "https://rally.org/foxes",
"supporter_count": 1,
"total_raised": 1000,
"website_url": null
}
$ curl https://rally.org/api/causes/ABCDEFGH/fundraisers?access_token=ZXCVBNMLKJHGFDSAQWERTYUIOP
[
{
"fundraiser": {
"current_fundraising_goal": null,
"donation_count": 13,
"created_at": "2012-07-12T11:50:56-07:00",
"total_raised": 4500,
"supporter_count": 7,
"rally_url": "https://rally.org/cuteanimalpictures/POLIKUJJ/billymays",
"id": "POLIKUJJ",
"raised_toward_fundraising_goal": null,
"cause_id": "ABCDEFGH",
"user": {
"name": "Billy Mays",
"icon_url": "https://some.url/here/pops.jpg",
"id": "nsbhdyfs"
}
}
},
{
"fundraiser": {
"current_fundraising_goal": null,
"donation_count": 0,
"created_at": "2012-08-23T16:52:26-07:00",
"total_raised": 0,
"supporter_count": 0,
"rally_url": "https://rally.org/cuteanimalpictures/YUKYUKYUK/sally",
"id": "YUKYUKYUK",
"raised_toward_fundraising_goal": null,
"cause_id": "ABCDEFGH",
"user": {
"name": "Sally Heaps",
"icon_url": "https://some.url/here/pops.jpg",
"id": "baMBaMbAm"
}
}
}
]
cause_id
: The unique id for the cause.
user
: The user object who started that fan-fundraiser.
name
: A string of the name of the user
icon_url
: A string of the url for that user's icon
id
: A unique id for that user.
$ curl https://rally.org/api/causes/POLIKUJJ/top_donors?access_token=ZXCVBNMLKJHGFDSAQWERTYUIOP
[
{
"first_name": "Billy",
"last_name": "Mays",
"id": "nsbhdyfs",
"amount": 900,
},
{
"first_name": "Sally",
"last_name": "Heaps",
"id": "nsbhdyfs",
"amount": 800,
},
{
"first_name": "Jeffery",
"last_name": "Giant",
"id": "nsbhdyfs",
"amount": 700,
}
]
$ curl https://rally.org/api/fundraisers/POLIKUJJ?access_token=ZXCVBNMLKJHGFDSAQWERTYUIOP
{
"fundraiser": {
"current_fundraising_goal": null,
"donation_count": 13,
"created_at": "2012-07-12T11:50:56-07:00",
"total_raised": 4500,
"supporter_count": 7,
"rally_url": "https://rally.org/cuteanimalpictures/POLIKUJJ/billymays",
"id": "POLIKUJJ",
"raised_toward_fundraising_goal": null,
"cause_id": "ABCDEFGH",
"user": {
"name": "Billy Mays",
"icon_url": "https://some.url/here/pops.jpg",
"id": "nsbhdyfs"
}
}
}
$ curl https://rally.org/api/fundraisers/POLIKUJJ/top_donors?access_token=ZXCVBNMLKJHGFDSAQWERTYUIOP
[
{
"first_name": "Billy",
"last_name": "Mays",
"id": "nsbhdyfs",
"amount": 900,
},
{
"first_name": "Sally",
"last_name": "Heaps",
"id": "nsbhdyfs",
"amount": 800,
},
{
"first_name": "Jeffery",
"last_name": "Giant",
"id": "nsbhdyfs",
"amount": 700,
}
]
page
parameter. Each page will return a set of 25 donations, ordered by
created_at
date.
start_date
and
end_date
may also be used. The result will include donations with
created_at
date between
start_date
and
end_date
Date should be in the format of "YYYY-MM-DD"
$ curl https://rally.org/api/causes/SSOTORP/donations?access_token=PUUOYEVIGANNOGREVEN&page=7&start_date=2013-01-01&end_date=2013-02-01
[
{
"id"=>"8GU4ICC33TL",
"private"=>false,
"first_name"=>"Sarah",
"last_name"=>"Kerrigan",
"email"=>"somebody-2@example.com",
"amount_cents"=>1000,
"currency"=>"usd",
"transaction_fee"=>57,
"payment_type"=>"cc",
"payment_method"=>"visa",
"phone_number"=>"5551234567",
"occupation"=>"Nurse",
"employer"=>"Acme Widgets",
"gender"=>"F",
"address_country"=>"US",
"address_address1"=>"123 Mar Sara street",
"address_city"=>"San Francisco",
"address_state"=>"CA",
"address_zip"=>"94110",
"refunded"=>false,
"created_at"=>"2013-03-14 11:28:33",
"birthdate"=>"1980-07-09",
"custom_field_values"=>[{"A Name"=>"whatever"}],
"fundraiser_id"=>"3MGmTYb9KQF"
},
{
"id"=>"kauwjI02gFX",
"private"=>false,
"first_name"=>"James",
"last_name"=>"Raynor",
"email"=>"somebody-3@example.com",
"amount_cents"=>1000,
"currency"=>"usd",
"transaction_fee"=>57,
"payment_type"=>"cc",
"payment_method"=>"visa",
"phone_number"=>"5928372222",
"occupation"=>"Professional gamer",
"employer"=>"Acme Widgets",
"gender"=>"M",
"address_country"=>"US",
"address_address1"=>"999 Aiur road",
"address_city"=>"San Francisco",
"address_state"=>"CA",
"address_zip"=>"94110",
"refunded"=>false,
"created_at"=>"2013-03-14 11:28:33",
"birthdate"=>"1980-07-09",
"custom_field_values"=>[],
"fundraiser_id"=>"3MGmTYb9KQF",
"cover_id"=>"aY3IEHPU1iY"
}
]
id
: The unique id for the donation.
custom_field values
: A list of custom fields and values
cover_id
: The cover which the donation is donated from
refunded
: Indicates if donation has been refunded