get https://watsi.org/donor/:token.json
Fetch details about a donor with this endpoint. For convenience, you can fetch details about any donor by appending .json
to any donor profile, e.g. https://watsi.org/donor/dca14b959cad.json
.
This will return a single JSON object, with details about the donor. The response will have the following keys:
Key | Value (Example) | Description |
---|---|---|
token | String ("dca14b959cad") | The token of the donor |
name | String ("Peter Kutrumbos") | The name of the donor |
url | String | The URL for this donor's profile; normally in the format of /donor/[token] |
avatar_url | String | The URL for the donor's avatar photo, if available. |
joined_at | String | The date this donor joined Watsi, in the format "August 22nd, 2014" |
is_monthly_donor | Boolean (true) | Whether this donor is a monthly donor |
birthday | String | The donor's birthday, if available, in the format "March 11th" |
country | String | The country the donor resides, if available. |
bio | String | The biography as provided by the donor, if available. |
homepage_url | String | The donor's homepage, if available. |
story | String | The story of the donor on Watsi, as available on their donor profile |
countries_funded | Array[String] | An array of the countries where medical procedure this donor has funded has taken place |
profile_tokens | Array[String] | An array of patient profiles who this donor has funded. Fetch more details about a profile with the /profile/:token.json endpoint. |
Here's some examples on how to request the data:
require 'open-uri'
require 'json'
donor = JSON.parse(open("https://watsi.org/donor/dca14b959cad.json").read)
# You'll need to install requests
import requests
r = requests.get('https://watsi.org/donor/dca14b959cad.json')
donor = r.json()
var request = require('request');
request.get('https://watsi.org/donor/dca14b959cad.json', {
json: true
}, function(err, res, donor) {
console.log("Donor:", donor);
});