{"__v":8,"_id":"53a47666447c0ba24d1a85d1","api":{"auth":"never","params":[],"results":{"codes":[]},"settings":"","try":true,"url":""},"body":"Watsi has a read-only API for retrieving information about patients and donors. We will attempt to follow [jsonapi](http://jsonapi.org/) standards.\n[block:callout]\n{\n  \"type\": \"danger\",\n  \"title\": \"Unstable API\",\n  \"body\": \"While we are doing our best to keep these API endpoints stable, v1.0 has not been frozen. It is possible the APIs will change.\"\n}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"warning\",\n  \"body\": \"Currently, our API endpoints are not set up with CORS and cannot be accessed from browser-side JavaScript. You will have to proxy the request through a server.\",\n  \"title\": \"Accessing via AJAX\"\n}\n[/block]","category":"53a47666447c0ba24d1a85cf","comments":[],"createdAt":"2014-06-20T17:59:02.732Z","excerpt":"","githubsync":"","hidden":false,"isReference":false,"is_link":false,"link_external":false,"link_url":"","order":0,"project":"53a47666447c0ba24d1a85cb","slug":"getting-started","sync_unique":"","tags":[],"title":"Getting Started","type":"basic","updates":[],"user":"53a47639447c0ba24d1a85ca","version":"53a47666447c0ba24d1a85ce","childrenPages":[]}

Getting Started


Watsi has a read-only API for retrieving information about patients and donors. We will attempt to follow [jsonapi](http://jsonapi.org/) standards. [block:callout] { "type": "danger", "title": "Unstable API", "body": "While we are doing our best to keep these API endpoints stable, v1.0 has not been frozen. It is possible the APIs will change." } [/block] [block:callout] { "type": "warning", "body": "Currently, our API endpoints are not set up with CORS and cannot be accessed from browser-side JavaScript. You will have to proxy the request through a server.", "title": "Accessing via AJAX" } [/block]
Watsi has a read-only API for retrieving information about patients and donors. We will attempt to follow [jsonapi](http://jsonapi.org/) standards. [block:callout] { "type": "danger", "title": "Unstable API", "body": "While we are doing our best to keep these API endpoints stable, v1.0 has not been frozen. It is possible the APIs will change." } [/block] [block:callout] { "type": "warning", "body": "Currently, our API endpoints are not set up with CORS and cannot be accessed from browser-side JavaScript. You will have to proxy the request through a server.", "title": "Accessing via AJAX" } [/block]
{"__v":3,"_id":"5424f7ecae542a1a7d7c5f76","api":{"auth":"never","params":[],"results":{"codes":[{"language":"json","code":"{}","name":"Success"},{"language":"json","code":"{}","name":"Failure"}]},"settings":"","try":true,"url":""},"body":"If you're using the Watsi API for something cool, please let us know!","category":"53a47666447c0ba24d1a85cf","createdAt":"2014-09-26T05:21:48.955Z","excerpt":"","githubsync":"","hidden":false,"isReference":false,"is_link":false,"link_external":false,"link_url":"","order":1,"project":"53a47666447c0ba24d1a85cb","slug":"using-the-watsi-api","sync_unique":"","title":"Using the Watsi API?","type":"basic","updates":[],"user":"5250b3ad5ac09b3564000005","version":"53a47666447c0ba24d1a85ce","childrenPages":[]}

Using the Watsi API?


If you're using the Watsi API for something cool, please let us know!
If you're using the Watsi API for something cool, please let us know!
{"__v":20,"_id":"5424ef78ae542a1a7d7c5f6a","api":{"auth":"never","basic_auth":false,"examples":{"codes":[]},"params":[],"results":{"codes":[{"name":"Success","code":"{\n  \"profiles\": [\n    {\n    \"token\": \"dfed290e4ee7\",\n    \"name\": \"Kioko\",\n    \"header\": \"Kioko is a father of three from Kenya who needs $1,500 to treat his infected bone.\",\n    \"age_years\": 38,\n    \"age_months\": null,\n    \"partner_name\": \"African Mission Healthcare Foundation\",\n    \"country\": \"Kenya\",\n    \"url\": \"https://watsi.org/profile/dfed290e4ee7-kioko\",\n    \"photo_url\": \"https://d3w52z135jkm97.cloudfront.net/uploads/profile/photo/7897/profile_638x479_cee62d53-3273-4238-8d02-1a98e4787aa5.JPG\",\n    \"percent_funded\": 0,\n    \"target_amount\": 150000,\n    \"amount_remaining\": 150000,\n    \"amount_raised\": 0,\n    \"number_of_donors\": 0\n    },\n    //...more profiles...\n  ]\n}","language":"json"},{"language":"json","code":"{\n  \"message\": \"Sorry, that resource cannot be found\"\n}"}]},"settings":"","try":true,"url":"/fund-treatments.json"},"body":"Calling `/fund-treatments.json` will return a list of all currently fundable patients on Watsi.\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"key\",\n    \"h-1\": \"description\",\n    \"0-0\": \"`profiles`\",\n    \"0-1\": \"This will be an array of all fundable profiles on Watsi.\",\n    \"1-0\": \"\",\n    \"1-1\": \"\"\n  },\n  \"cols\": 2,\n  \"rows\": 1\n}\n[/block]\nEach profile will have the following keys:\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Key\",\n    \"h-1\": \"Value (Example)\",\n    \"h-2\": \"Description\",\n    \"0-0\": \"token\",\n    \"0-1\": \"**String** (\\\"69a1b67ff206\\\")\",\n    \"0-2\": \"The token of the profile (use the `/profile/:token` endpoint to get additional details)\",\n    \"1-0\": \"name\",\n    \"1-1\": \"**String** (\\\"Julie\\\")\",\n    \"1-2\": \"The first name of the patient\",\n    \"3-0\": \"age_years\",\n    \"3-1\": \"**Integer** (13)\",\n    \"3-2\": \"The age of the patient, in years. If the patient is younger than 2, may be blank.\",\n    \"6-0\": \"country\",\n    \"6-1\": \"**String** (\\\"Nepal\\\")\",\n    \"7-0\": \"url\",\n    \"7-1\": \"**String**\",\n    \"6-2\": \"The country the medical procedure will be taking place in\",\n    \"7-2\": \"The Watsi URL for this profile; normally in the format of `/profile/[token]-[name]`\",\n    \"8-0\": \"photo_url\",\n    \"8-1\": \"**String**\",\n    \"8-2\": \"An image of the patient. This image is guaranteed to have a 4:3 width:height ratio; currently, the image returned is always 638x479.\",\n    \"9-0\": \"percent_funded\",\n    \"9-1\": \"**Float** (0.19)\",\n    \"9-2\": \"A float between 0 and 1 representing the percent that the patient has been funded.\",\n    \"10-0\": \"target_amount\",\n    \"10-1\": \"**Float** (600)\",\n    \"10-2\": \"The cost of the medical procedure that the patient is fundraising for.\",\n    \"11-0\": \"amount_remaining\",\n    \"11-1\": \"**Float** (324.5)\",\n    \"11-2\": \"How much of the cost that has not yet been funded by donors.\",\n    \"12-0\": \"amount_raised\",\n    \"12-1\": \"**Float** (275.5)\",\n    \"12-2\": \"How much of the cost has already been raised.\",\n    \"13-0\": \"number_of_donors\",\n    \"13-1\": \"**Integer** (6)\",\n    \"13-2\": \"The number of donors who have already contributed to this patient's medical procedure.\",\n    \"4-0\": \"age_months\",\n    \"4-1\": \"**Integer** (2)\",\n    \"4-2\": \"How many months the patient has lived past the `age_years` parameter; for example, if `age_years` is 1 and `age_months` is 6, the patient is 1 year, 6 months, or 18 months, old. If the patients is older than 2 years old, may be blank.\",\n    \"2-0\": \"header\",\n    \"2-1\": \"**String**\",\n    \"2-2\": \"A short, descriptive sentence about the patient.\",\n    \"5-0\": \"partner_name\",\n    \"5-1\": \"**String**\",\n    \"5-2\": \"The name of the Watsi medical partner performing the medical procedure\"\n  },\n  \"cols\": 3,\n  \"rows\": 14\n}\n[/block]\nHere's some examples on how to request the data:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"require 'open-uri'\\nrequire 'json' \\npatients = JSON.parse(open(\\\"https://watsi.org/fund-treatments.json\\\").read)\",\n      \"language\": \"ruby\"\n    },\n    {\n      \"code\": \"# You'll need to install requests\\nimport requests\\nr = requests.get('https://watsi.org/fund-treatments.json')\\npatients = r.json()\",\n      \"language\": \"python\"\n    },\n    {\n      \"code\": \"var request = require('request');\\nrequest.get('https://watsi.org/fund-treatments.json', {\\n  json: true\\n}, function(err, res, patients) {\\n  console.log(\\\"Patients!\\\", patients);\\n});\",\n      \"language\": \"javascript\",\n      \"name\": \"Node\"\n    }\n  ]\n}\n[/block]","category":"5424ef12ae542a1a7d7c5f66","createdAt":"2014-09-26T04:45:44.790Z","excerpt":"","githubsync":"","hidden":false,"isReference":false,"is_link":false,"link_external":false,"link_url":"","order":0,"project":"53a47666447c0ba24d1a85cb","slug":"fund-treatmentsjson","sync_unique":"","title":"/fund-treatments.json","type":"get","updates":[],"user":"5250b3ad5ac09b3564000005","version":"53a47666447c0ba24d1a85ce","childrenPages":[]}

get/fund-treatments.json


Calling `/fund-treatments.json` will return a list of all currently fundable patients on Watsi. [block:parameters] { "data": { "h-0": "key", "h-1": "description", "0-0": "`profiles`", "0-1": "This will be an array of all fundable profiles on Watsi.", "1-0": "", "1-1": "" }, "cols": 2, "rows": 1 } [/block] Each profile will have the following keys: [block:parameters] { "data": { "h-0": "Key", "h-1": "Value (Example)", "h-2": "Description", "0-0": "token", "0-1": "**String** (\"69a1b67ff206\")", "0-2": "The token of the profile (use the `/profile/:token` endpoint to get additional details)", "1-0": "name", "1-1": "**String** (\"Julie\")", "1-2": "The first name of the patient", "3-0": "age_years", "3-1": "**Integer** (13)", "3-2": "The age of the patient, in years. If the patient is younger than 2, may be blank.", "6-0": "country", "6-1": "**String** (\"Nepal\")", "7-0": "url", "7-1": "**String**", "6-2": "The country the medical procedure will be taking place in", "7-2": "The Watsi URL for this profile; normally in the format of `/profile/[token]-[name]`", "8-0": "photo_url", "8-1": "**String**", "8-2": "An image of the patient. This image is guaranteed to have a 4:3 width:height ratio; currently, the image returned is always 638x479.", "9-0": "percent_funded", "9-1": "**Float** (0.19)", "9-2": "A float between 0 and 1 representing the percent that the patient has been funded.", "10-0": "target_amount", "10-1": "**Float** (600)", "10-2": "The cost of the medical procedure that the patient is fundraising for.", "11-0": "amount_remaining", "11-1": "**Float** (324.5)", "11-2": "How much of the cost that has not yet been funded by donors.", "12-0": "amount_raised", "12-1": "**Float** (275.5)", "12-2": "How much of the cost has already been raised.", "13-0": "number_of_donors", "13-1": "**Integer** (6)", "13-2": "The number of donors who have already contributed to this patient's medical procedure.", "4-0": "age_months", "4-1": "**Integer** (2)", "4-2": "How many months the patient has lived past the `age_years` parameter; for example, if `age_years` is 1 and `age_months` is 6, the patient is 1 year, 6 months, or 18 months, old. If the patients is older than 2 years old, may be blank.", "2-0": "header", "2-1": "**String**", "2-2": "A short, descriptive sentence about the patient.", "5-0": "partner_name", "5-1": "**String**", "5-2": "The name of the Watsi medical partner performing the medical procedure" }, "cols": 3, "rows": 14 } [/block] Here's some examples on how to request the data: [block:code] { "codes": [ { "code": "require 'open-uri'\nrequire 'json' \npatients = JSON.parse(open(\"https://watsi.org/fund-treatments.json\").read)", "language": "ruby" }, { "code": "# You'll need to install requests\nimport requests\nr = requests.get('https://watsi.org/fund-treatments.json')\npatients = r.json()", "language": "python" }, { "code": "var request = require('request');\nrequest.get('https://watsi.org/fund-treatments.json', {\n json: true\n}, function(err, res, patients) {\n console.log(\"Patients!\", patients);\n});", "language": "javascript", "name": "Node" } ] } [/block]

Definition

{{ api_url }}{{ page_api_url }}

Result Format



Calling `/fund-treatments.json` will return a list of all currently fundable patients on Watsi. [block:parameters] { "data": { "h-0": "key", "h-1": "description", "0-0": "`profiles`", "0-1": "This will be an array of all fundable profiles on Watsi.", "1-0": "", "1-1": "" }, "cols": 2, "rows": 1 } [/block] Each profile will have the following keys: [block:parameters] { "data": { "h-0": "Key", "h-1": "Value (Example)", "h-2": "Description", "0-0": "token", "0-1": "**String** (\"69a1b67ff206\")", "0-2": "The token of the profile (use the `/profile/:token` endpoint to get additional details)", "1-0": "name", "1-1": "**String** (\"Julie\")", "1-2": "The first name of the patient", "3-0": "age_years", "3-1": "**Integer** (13)", "3-2": "The age of the patient, in years. If the patient is younger than 2, may be blank.", "6-0": "country", "6-1": "**String** (\"Nepal\")", "7-0": "url", "7-1": "**String**", "6-2": "The country the medical procedure will be taking place in", "7-2": "The Watsi URL for this profile; normally in the format of `/profile/[token]-[name]`", "8-0": "photo_url", "8-1": "**String**", "8-2": "An image of the patient. This image is guaranteed to have a 4:3 width:height ratio; currently, the image returned is always 638x479.", "9-0": "percent_funded", "9-1": "**Float** (0.19)", "9-2": "A float between 0 and 1 representing the percent that the patient has been funded.", "10-0": "target_amount", "10-1": "**Float** (600)", "10-2": "The cost of the medical procedure that the patient is fundraising for.", "11-0": "amount_remaining", "11-1": "**Float** (324.5)", "11-2": "How much of the cost that has not yet been funded by donors.", "12-0": "amount_raised", "12-1": "**Float** (275.5)", "12-2": "How much of the cost has already been raised.", "13-0": "number_of_donors", "13-1": "**Integer** (6)", "13-2": "The number of donors who have already contributed to this patient's medical procedure.", "4-0": "age_months", "4-1": "**Integer** (2)", "4-2": "How many months the patient has lived past the `age_years` parameter; for example, if `age_years` is 1 and `age_months` is 6, the patient is 1 year, 6 months, or 18 months, old. If the patients is older than 2 years old, may be blank.", "2-0": "header", "2-1": "**String**", "2-2": "A short, descriptive sentence about the patient.", "5-0": "partner_name", "5-1": "**String**", "5-2": "The name of the Watsi medical partner performing the medical procedure" }, "cols": 3, "rows": 14 } [/block] Here's some examples on how to request the data: [block:code] { "codes": [ { "code": "require 'open-uri'\nrequire 'json' \npatients = JSON.parse(open(\"https://watsi.org/fund-treatments.json\").read)", "language": "ruby" }, { "code": "# You'll need to install requests\nimport requests\nr = requests.get('https://watsi.org/fund-treatments.json')\npatients = r.json()", "language": "python" }, { "code": "var request = require('request');\nrequest.get('https://watsi.org/fund-treatments.json', {\n json: true\n}, function(err, res, patients) {\n console.log(\"Patients!\", patients);\n});", "language": "javascript", "name": "Node" } ] } [/block]
{"__v":1,"_id":"5708c1c955a4690e005de45c","api":{"auth":"never","examples":{"codes":[]},"params":[{"_id":"5708c1d952d0461700802fef","default":"ecf7569b0ff6","desc":"The 12-character token used to identify the profile","name":"token","ref":"","required":true,"type":"string"}],"results":{"codes":[{"name":"Success","code":"{\n  \"token\": \"b652543e342a\",\n  \"name\": \"Maria\",\n  \"header\": \"Maria is a mother from Guatemala who needs $977 for surgery to prevent complications during her pregnancy.\",\n  \"description\": \"\\\"I am scared about what could happen,” shares Maria. “But I am glad I have support.\\\" 36-year-old Maria lives in a rural region of Guatemala, and delights in caring for her seven children. Maria is currently expecting another baby.\\r\\n\\r\\n“For three months Maria has not had regular menstruation, and 15 days ago she started to have hemorrhaging,” explains our medical partner, Wuqu’ Kawoq (WK). “Our medical team suspects she has an ectopic pregnancy based on the results of some preliminary lab tests.”\\r\\n\\r\\nIn an ectopic pregnancy, the fertilized egg remains in a woman’s fallopian tube instead of moving to the uterus to develop as it should. This means the fertilized egg will not survive, and that the mother is at serious risk for internal damage: for instance, the fallopian tube can rupture, causing dangerous bleeding. “Ectopic pregnancies are fatal to the mother if not treated,” explains WK.\\r\\n\\r\\nFortunately, treatment is available for Maria. A surgical technique known as laparoscopy can be used to examine Maria’s pelvic organs through a small incision in her abdomen. Doctors will then use a small camera to locate and remove the fertilized egg from her fallopian tube.\\r\\n\\r\\nThis operation costs more than Maria and her husband, a day laborer, can afford—especially with seven children to support. But we can help. $977 will fund the surgery that Maria needs, as well as the lab tests and medication that will ensure she remains healthy after the operation.\\r\\n\\r\\n“This procedure will save Maria’s life,” says WK, “allowing her to be with her husband and seven children, and have a long and healthy life.”\",\n  \"age_years\": 36,\n  \"age_months\": null,\n  \"partner_name\": \"Wuqu’ Kawoq\",\n  \"country\": \"Guatemala\",\n  \"url\": \"https://watsi.org/profile/b652543e342a-maria\",\n  \"photo_url\": \"https://d3w52z135jkm97.cloudfront.net/uploads/profile/photo/7851/profile_638x479_58acf5c2-d814-4405-86d0-5ed609c1b508.jpg\",\n  \"percent_funded\": 0.82906857727738,\n  \"target_amount\": 97700,\n  \"amount_remaining\": 16700,\n  \"amount_raised\": 81000,\n  \"number_of_donors\": 12,\n  \"public_donor_tokens\": [\n    \"f6711fd6aa45\",\n    \"3tmFOoSVQvcV\",\n    \"5bcd4bd8b8ff\",\n    \"EtPgLHNV4HA7\",\n    \"4a7a13a68770\",\n    \"igv6rAJicoCx\",\n    \"043b7f2ca4db\",\n    \"51101642bc0b\",\n    \"y6amh6FThkNn\"\n  ]\n}","language":"json"},{"language":"json","code":"{\n  \"message\": \"Sorry, that resource cannot be found\"\n}"}]},"settings":"","url":"/profile/:token.json"},"body":"Fetch details about a patient with this endpoint. For convenience, you can fetch details about any patient by appending `.json` to any profile page, e.g. `https://watsi.org/profile/f9552c237720-mu-lar.json`.\n\nThis will return a single JSON object, with details about the patient. The response will have the following keys:\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Key\",\n    \"h-1\": \"Value (Example)\",\n    \"h-2\": \"Description\",\n    \"0-0\": \"token\",\n    \"0-1\": \"**String** (\\\"69a1b67ff206\\\")\",\n    \"0-2\": \"The token of the profile\",\n    \"1-0\": \"name\",\n    \"1-1\": \"**String** (\\\"Julie\\\")\",\n    \"1-2\": \"The first name of the patient\",\n    \"4-0\": \"age_years\",\n    \"4-1\": \"**Integer** (13)\",\n    \"4-2\": \"The age of the patient, in years. If the patient is younger than 2, may be blank.\",\n    \"7-0\": \"country\",\n    \"7-1\": \"**String** (\\\"Nepal\\\")\",\n    \"8-0\": \"url\",\n    \"8-1\": \"**String**\",\n    \"7-2\": \"The country the medical procedure will be taking place in\",\n    \"8-2\": \"The Watsi URL for this profile; normally in the format of `/profile/[token]-[name]`\",\n    \"9-0\": \"photo_url\",\n    \"9-1\": \"**String**\",\n    \"9-2\": \"An image of the patient. This image is guaranteed to have a 4:3 width:height ratio; currently, the image returned is always 638x479.\",\n    \"10-0\": \"percent_funded\",\n    \"10-1\": \"**Float** (0.19)\",\n    \"10-2\": \"A float between 0 and 1 representing the percent that the patient has been funded.\",\n    \"11-0\": \"target_amount\",\n    \"11-1\": \"**Float** (600)\",\n    \"11-2\": \"The cost of the medical procedure that the patient is fundraising for.\",\n    \"12-0\": \"amount_remaining\",\n    \"12-1\": \"**Float** (324.5)\",\n    \"12-2\": \"How much of the cost that has not yet been funded by donors.\",\n    \"13-0\": \"amount_raised\",\n    \"13-1\": \"**Float** (275.5)\",\n    \"13-2\": \"How much of the cost has already been raised.\",\n    \"14-0\": \"number_of_donors\",\n    \"14-1\": \"**Integer** (6)\",\n    \"14-2\": \"The number of donors who have already contributed to this patient's medical procedure.\",\n    \"5-0\": \"age_months\",\n    \"5-1\": \"**Integer** (2)\",\n    \"5-2\": \"How many months the patient has lived past the `age_years` parameter; for example, if `age_years` is 1 and `age_months` is 6, the patient is 1 year, 6 months, or 18 months, old. If the patients is older than 2 years old, may be blank.\",\n    \"2-0\": \"header\",\n    \"2-1\": \"**String**\",\n    \"2-2\": \"A short, descriptive sentence about the patient.\",\n    \"6-0\": \"partner_name\",\n    \"6-1\": \"**String**\",\n    \"6-2\": \"The name of the Watsi medical partner performing the medical procedure\",\n    \"3-0\": \"description\",\n    \"3-1\": \"**String**\",\n    \"3-2\": \"A longer description of the patient, their medical condition, the procedure they need, their livelihood, and other details about the patient.\",\n    \"15-0\": \"public_donor_tokens\",\n    \"15-1\": \"**Array[String]**\",\n    \"15-2\": \"An array of donors who have donated to this profile. Fetch more details about a donor with the `/donor/:token.json` endpoint.\"\n  },\n  \"cols\": 3,\n  \"rows\": 16\n}\n[/block]\nHere's some examples on how to request the data:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"require 'open-uri'\\nrequire 'json'\\npatients = JSON.parse(open(\\\"https://watsi.org/profile/ecf7569b0ff6.json\\\").read)\",\n      \"language\": \"ruby\"\n    },\n    {\n      \"code\": \"# You'll need to install requests\\nimport requests\\nr = requests.get('https://watsi.org/profile/f9552c237720.json')\\npatients = r.json()\",\n      \"language\": \"python\"\n    },\n    {\n      \"code\": \"var request = require('request');\\nrequest.get('https://watsi.org/profile/f9552c237720.json', {\\n  json: true\\n}, function(err, res, patient) {\\n  console.log(\\\"Patients!\\\", patient);\\n});\",\n      \"language\": \"javascript\",\n      \"name\": \"Node\"\n    }\n  ]\n}\n[/block]","category":"5424ef12ae542a1a7d7c5f66","createdAt":"2016-04-09T08:48:09.033Z","excerpt":"","githubsync":"","hidden":false,"isReference":false,"link_external":false,"link_url":"","order":999,"project":"53a47666447c0ba24d1a85cb","slug":"fund-treatmentsjsonn","sync_unique":"","title":"/profile/:token.json","type":"get","updates":[],"user":"53a47639447c0ba24d1a85ca","version":"53a47666447c0ba24d1a85ce","childrenPages":[]}

get/profile/:token.json


token:
required
stringecf7569b0ff6
The 12-character token used to identify the profile
Fetch details about a patient with this endpoint. For convenience, you can fetch details about any patient by appending `.json` to any profile page, e.g. `https://watsi.org/profile/f9552c237720-mu-lar.json`. This will return a single JSON object, with details about the patient. The response will have the following keys: [block:parameters] { "data": { "h-0": "Key", "h-1": "Value (Example)", "h-2": "Description", "0-0": "token", "0-1": "**String** (\"69a1b67ff206\")", "0-2": "The token of the profile", "1-0": "name", "1-1": "**String** (\"Julie\")", "1-2": "The first name of the patient", "4-0": "age_years", "4-1": "**Integer** (13)", "4-2": "The age of the patient, in years. If the patient is younger than 2, may be blank.", "7-0": "country", "7-1": "**String** (\"Nepal\")", "8-0": "url", "8-1": "**String**", "7-2": "The country the medical procedure will be taking place in", "8-2": "The Watsi URL for this profile; normally in the format of `/profile/[token]-[name]`", "9-0": "photo_url", "9-1": "**String**", "9-2": "An image of the patient. This image is guaranteed to have a 4:3 width:height ratio; currently, the image returned is always 638x479.", "10-0": "percent_funded", "10-1": "**Float** (0.19)", "10-2": "A float between 0 and 1 representing the percent that the patient has been funded.", "11-0": "target_amount", "11-1": "**Float** (600)", "11-2": "The cost of the medical procedure that the patient is fundraising for.", "12-0": "amount_remaining", "12-1": "**Float** (324.5)", "12-2": "How much of the cost that has not yet been funded by donors.", "13-0": "amount_raised", "13-1": "**Float** (275.5)", "13-2": "How much of the cost has already been raised.", "14-0": "number_of_donors", "14-1": "**Integer** (6)", "14-2": "The number of donors who have already contributed to this patient's medical procedure.", "5-0": "age_months", "5-1": "**Integer** (2)", "5-2": "How many months the patient has lived past the `age_years` parameter; for example, if `age_years` is 1 and `age_months` is 6, the patient is 1 year, 6 months, or 18 months, old. If the patients is older than 2 years old, may be blank.", "2-0": "header", "2-1": "**String**", "2-2": "A short, descriptive sentence about the patient.", "6-0": "partner_name", "6-1": "**String**", "6-2": "The name of the Watsi medical partner performing the medical procedure", "3-0": "description", "3-1": "**String**", "3-2": "A longer description of the patient, their medical condition, the procedure they need, their livelihood, and other details about the patient.", "15-0": "public_donor_tokens", "15-1": "**Array[String]**", "15-2": "An array of donors who have donated to this profile. Fetch more details about a donor with the `/donor/:token.json` endpoint." }, "cols": 3, "rows": 16 } [/block] Here's some examples on how to request the data: [block:code] { "codes": [ { "code": "require 'open-uri'\nrequire 'json'\npatients = JSON.parse(open(\"https://watsi.org/profile/ecf7569b0ff6.json\").read)", "language": "ruby" }, { "code": "# You'll need to install requests\nimport requests\nr = requests.get('https://watsi.org/profile/f9552c237720.json')\npatients = r.json()", "language": "python" }, { "code": "var request = require('request');\nrequest.get('https://watsi.org/profile/f9552c237720.json', {\n json: true\n}, function(err, res, patient) {\n console.log(\"Patients!\", patient);\n});", "language": "javascript", "name": "Node" } ] } [/block]

Definition

{{ api_url }}{{ page_api_url }}

Result Format



Fetch details about a patient with this endpoint. For convenience, you can fetch details about any patient by appending `.json` to any profile page, e.g. `https://watsi.org/profile/f9552c237720-mu-lar.json`. This will return a single JSON object, with details about the patient. The response will have the following keys: [block:parameters] { "data": { "h-0": "Key", "h-1": "Value (Example)", "h-2": "Description", "0-0": "token", "0-1": "**String** (\"69a1b67ff206\")", "0-2": "The token of the profile", "1-0": "name", "1-1": "**String** (\"Julie\")", "1-2": "The first name of the patient", "4-0": "age_years", "4-1": "**Integer** (13)", "4-2": "The age of the patient, in years. If the patient is younger than 2, may be blank.", "7-0": "country", "7-1": "**String** (\"Nepal\")", "8-0": "url", "8-1": "**String**", "7-2": "The country the medical procedure will be taking place in", "8-2": "The Watsi URL for this profile; normally in the format of `/profile/[token]-[name]`", "9-0": "photo_url", "9-1": "**String**", "9-2": "An image of the patient. This image is guaranteed to have a 4:3 width:height ratio; currently, the image returned is always 638x479.", "10-0": "percent_funded", "10-1": "**Float** (0.19)", "10-2": "A float between 0 and 1 representing the percent that the patient has been funded.", "11-0": "target_amount", "11-1": "**Float** (600)", "11-2": "The cost of the medical procedure that the patient is fundraising for.", "12-0": "amount_remaining", "12-1": "**Float** (324.5)", "12-2": "How much of the cost that has not yet been funded by donors.", "13-0": "amount_raised", "13-1": "**Float** (275.5)", "13-2": "How much of the cost has already been raised.", "14-0": "number_of_donors", "14-1": "**Integer** (6)", "14-2": "The number of donors who have already contributed to this patient's medical procedure.", "5-0": "age_months", "5-1": "**Integer** (2)", "5-2": "How many months the patient has lived past the `age_years` parameter; for example, if `age_years` is 1 and `age_months` is 6, the patient is 1 year, 6 months, or 18 months, old. If the patients is older than 2 years old, may be blank.", "2-0": "header", "2-1": "**String**", "2-2": "A short, descriptive sentence about the patient.", "6-0": "partner_name", "6-1": "**String**", "6-2": "The name of the Watsi medical partner performing the medical procedure", "3-0": "description", "3-1": "**String**", "3-2": "A longer description of the patient, their medical condition, the procedure they need, their livelihood, and other details about the patient.", "15-0": "public_donor_tokens", "15-1": "**Array[String]**", "15-2": "An array of donors who have donated to this profile. Fetch more details about a donor with the `/donor/:token.json` endpoint." }, "cols": 3, "rows": 16 } [/block] Here's some examples on how to request the data: [block:code] { "codes": [ { "code": "require 'open-uri'\nrequire 'json'\npatients = JSON.parse(open(\"https://watsi.org/profile/ecf7569b0ff6.json\").read)", "language": "ruby" }, { "code": "# You'll need to install requests\nimport requests\nr = requests.get('https://watsi.org/profile/f9552c237720.json')\npatients = r.json()", "language": "python" }, { "code": "var request = require('request');\nrequest.get('https://watsi.org/profile/f9552c237720.json', {\n json: true\n}, function(err, res, patient) {\n console.log(\"Patients!\", patient);\n});", "language": "javascript", "name": "Node" } ] } [/block]
{"__v":0,"_id":"5708c41013a3340e004e714d","api":{"auth":"never","examples":{"codes":[]},"params":[{"_id":"5708c1d952d0461700802fef","ref":"","required":true,"desc":"The 12-character token used to identify the donor","default":"dca14b959cad","type":"string","name":"token"}],"results":{"codes":[{"name":"Success","code":"{\n  \"token\": \"5bcd4bd8b8ff\",\n  \"name\": \"Amy Rovin\",\n  \"url\": \"https://watsi.org/donor/5bcd4bd8b8ff\",\n  \"avatar_url\": \"https://d3w52z135jkm97.cloudfront.net/uploads/donor/photo/6302/profile_132x132_12366216_923566664397222_8377879371515636590_n.jpg\",\n  \"joined_at\": \"March 11th, 2014\",\n  \"is_uf_member\": false,\n  \"birthday\": null,\n  \"country\": null,\n  \"bio\": null,\n  \"homepage_url\": null,\n  \"story\": \"Amy joined Watsi on March 11th, 2014. 7 other people also joined Watsi on that day! Amy's most recent donation supported <a href='http://watsi.org/profile/b652543e342a-maria'>Maria</a>, a mother from Guatemala, for surgery to prevent complications during her pregnancy.\",\n  \"countries_funded\": [\n    \"Guatemala\",\n    \"Burma\",\n    \"Haiti\"\n  ],\n  \"profile_tokens\": [\n    \"b652543e342a\",\n    \"2c27f8cf97e1\",\n    \"ed3b18ef0c06\"\n  ]\n}","language":"json"},{"language":"json","code":"{\n  \"message\": \"Sorry, that resource cannot be found\"\n}"}]},"settings":"","url":"/donor/:token.json"},"body":"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`.\n\nThis will return a single JSON object, with details about the donor. The response will have the following keys:\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Key\",\n    \"h-1\": \"Value (Example)\",\n    \"h-2\": \"Description\",\n    \"0-0\": \"token\",\n    \"0-1\": \"**String** (\\\"dca14b959cad\\\")\",\n    \"0-2\": \"The token of the donor\",\n    \"1-0\": \"name\",\n    \"1-1\": \"**String** (\\\"Peter Kutrumbos\\\")\",\n    \"1-2\": \"The name of the donor\",\n    \"5-0\": \"is_uf_member\",\n    \"5-1\": \"**Boolean** (true)\",\n    \"6-0\": \"birthday\",\n    \"6-1\": \"**String**\",\n    \"5-2\": \"Whether this donor is part of Watsi's [Universal Fund](https://watsi.org/universal-fund)\",\n    \"6-2\": \"The donor's birthday, if available, in the format \\\"March 11th\\\"\",\n    \"7-0\": \"country\",\n    \"7-1\": \"**String**\",\n    \"7-2\": \"The country the donor resides, if available.\",\n    \"8-0\": \"bio\",\n    \"8-1\": \"**String**\",\n    \"8-2\": \"The biography as provided by the donor, if available.\",\n    \"9-0\": \"homepage_url\",\n    \"9-1\": \"**String**\",\n    \"9-2\": \"The donor's homepage, if available.\",\n    \"10-0\": \"story\",\n    \"10-1\": \"**String**\",\n    \"10-2\": \"The story of the donor on Watsi, as available on their donor profile\",\n    \"11-0\": \"countries_funded\",\n    \"11-1\": \"**Array[String]**\",\n    \"11-2\": \"An array of the countries where medical procedure this donor has funded has taken place\",\n    \"2-0\": \"url\",\n    \"2-1\": \"**String**\",\n    \"2-2\": \"The URL for this donor's profile; normally in the format of `/donor/[token]`\",\n    \"4-0\": \"joined_at\",\n    \"4-1\": \"**String**\",\n    \"4-2\": \"The date this donor joined Watsi, in the format \\\"August 22nd, 2014\\\"\",\n    \"12-0\": \"profile_tokens\",\n    \"12-1\": \"**Array[String]**\",\n    \"12-2\": \"An array of patient profiles who this donor has funded. Fetch more details about a profile with the `/profile/:token.json` endpoint.\",\n    \"3-0\": \"avatar_url\",\n    \"3-1\": \"**String**\",\n    \"3-2\": \"The URL for the donor's avatar photo, if available.\"\n  },\n  \"cols\": 3,\n  \"rows\": 13\n}\n[/block]\nHere's some examples on how to request the data:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"require 'open-uri'\\nrequire 'json'\\ndonor = JSON.parse(open(\\\"https://watsi.org/donor/dca14b959cad.json\\\").read)\",\n      \"language\": \"ruby\"\n    },\n    {\n      \"code\": \"# You'll need to install requests\\nimport requests\\nr = requests.get('https://watsi.org/donor/dca14b959cad.json')\\ndonor = r.json()\",\n      \"language\": \"python\"\n    },\n    {\n      \"code\": \"var request = require('request');\\nrequest.get('https://watsi.org/donor/dca14b959cad.json', {\\n  json: true\\n}, function(err, res, donor) {\\n  console.log(\\\"Donor:\\\", donor);\\n});\",\n      \"language\": \"javascript\",\n      \"name\": \"Node\"\n    }\n  ]\n}\n[/block]","category":"5424ef12ae542a1a7d7c5f66","createdAt":"2016-04-09T08:57:52.623Z","excerpt":"","githubsync":"","hidden":false,"isReference":false,"link_external":false,"link_url":"","order":999,"project":"53a47666447c0ba24d1a85cb","slug":"donortokenjson","sync_unique":"","title":"/donor/:token.json","type":"get","updates":[],"user":"53a47639447c0ba24d1a85ca","version":"53a47666447c0ba24d1a85ce","childrenPages":[]}

get/donor/:token.json


token:
required
stringdca14b959cad
The 12-character token used to identify the donor
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: [block:parameters] { "data": { "h-0": "Key", "h-1": "Value (Example)", "h-2": "Description", "0-0": "token", "0-1": "**String** (\"dca14b959cad\")", "0-2": "The token of the donor", "1-0": "name", "1-1": "**String** (\"Peter Kutrumbos\")", "1-2": "The name of the donor", "5-0": "is_uf_member", "5-1": "**Boolean** (true)", "6-0": "birthday", "6-1": "**String**", "5-2": "Whether this donor is part of Watsi's [Universal Fund](https://watsi.org/universal-fund)", "6-2": "The donor's birthday, if available, in the format \"March 11th\"", "7-0": "country", "7-1": "**String**", "7-2": "The country the donor resides, if available.", "8-0": "bio", "8-1": "**String**", "8-2": "The biography as provided by the donor, if available.", "9-0": "homepage_url", "9-1": "**String**", "9-2": "The donor's homepage, if available.", "10-0": "story", "10-1": "**String**", "10-2": "The story of the donor on Watsi, as available on their donor profile", "11-0": "countries_funded", "11-1": "**Array[String]**", "11-2": "An array of the countries where medical procedure this donor has funded has taken place", "2-0": "url", "2-1": "**String**", "2-2": "The URL for this donor's profile; normally in the format of `/donor/[token]`", "4-0": "joined_at", "4-1": "**String**", "4-2": "The date this donor joined Watsi, in the format \"August 22nd, 2014\"", "12-0": "profile_tokens", "12-1": "**Array[String]**", "12-2": "An array of patient profiles who this donor has funded. Fetch more details about a profile with the `/profile/:token.json` endpoint.", "3-0": "avatar_url", "3-1": "**String**", "3-2": "The URL for the donor's avatar photo, if available." }, "cols": 3, "rows": 13 } [/block] Here's some examples on how to request the data: [block:code] { "codes": [ { "code": "require 'open-uri'\nrequire 'json'\ndonor = JSON.parse(open(\"https://watsi.org/donor/dca14b959cad.json\").read)", "language": "ruby" }, { "code": "# You'll need to install requests\nimport requests\nr = requests.get('https://watsi.org/donor/dca14b959cad.json')\ndonor = r.json()", "language": "python" }, { "code": "var request = require('request');\nrequest.get('https://watsi.org/donor/dca14b959cad.json', {\n json: true\n}, function(err, res, donor) {\n console.log(\"Donor:\", donor);\n});", "language": "javascript", "name": "Node" } ] } [/block]

Definition

{{ api_url }}{{ page_api_url }}

Result Format



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: [block:parameters] { "data": { "h-0": "Key", "h-1": "Value (Example)", "h-2": "Description", "0-0": "token", "0-1": "**String** (\"dca14b959cad\")", "0-2": "The token of the donor", "1-0": "name", "1-1": "**String** (\"Peter Kutrumbos\")", "1-2": "The name of the donor", "5-0": "is_uf_member", "5-1": "**Boolean** (true)", "6-0": "birthday", "6-1": "**String**", "5-2": "Whether this donor is part of Watsi's [Universal Fund](https://watsi.org/universal-fund)", "6-2": "The donor's birthday, if available, in the format \"March 11th\"", "7-0": "country", "7-1": "**String**", "7-2": "The country the donor resides, if available.", "8-0": "bio", "8-1": "**String**", "8-2": "The biography as provided by the donor, if available.", "9-0": "homepage_url", "9-1": "**String**", "9-2": "The donor's homepage, if available.", "10-0": "story", "10-1": "**String**", "10-2": "The story of the donor on Watsi, as available on their donor profile", "11-0": "countries_funded", "11-1": "**Array[String]**", "11-2": "An array of the countries where medical procedure this donor has funded has taken place", "2-0": "url", "2-1": "**String**", "2-2": "The URL for this donor's profile; normally in the format of `/donor/[token]`", "4-0": "joined_at", "4-1": "**String**", "4-2": "The date this donor joined Watsi, in the format \"August 22nd, 2014\"", "12-0": "profile_tokens", "12-1": "**Array[String]**", "12-2": "An array of patient profiles who this donor has funded. Fetch more details about a profile with the `/profile/:token.json` endpoint.", "3-0": "avatar_url", "3-1": "**String**", "3-2": "The URL for the donor's avatar photo, if available." }, "cols": 3, "rows": 13 } [/block] Here's some examples on how to request the data: [block:code] { "codes": [ { "code": "require 'open-uri'\nrequire 'json'\ndonor = JSON.parse(open(\"https://watsi.org/donor/dca14b959cad.json\").read)", "language": "ruby" }, { "code": "# You'll need to install requests\nimport requests\nr = requests.get('https://watsi.org/donor/dca14b959cad.json')\ndonor = r.json()", "language": "python" }, { "code": "var request = require('request');\nrequest.get('https://watsi.org/donor/dca14b959cad.json', {\n json: true\n}, function(err, res, donor) {\n console.log(\"Donor:\", donor);\n});", "language": "javascript", "name": "Node" } ] } [/block]
{"__v":1,"_id":"5424fb9bae542a1a7d7c5f7f","api":{"params":[],"results":{"codes":[{"language":"json","code":"{}","name":"Success"},{"language":"json","code":"{}","name":"Failure"}]},"try":true,"url":"","auth":"never"},"body":"Our API is currently really simple, but we are curious what kind of API would be useful. If you are interested in building something on top of Watsi, we'd love to talk more. Get in touch at [connect@watsi.org](mailto:connect@watsi.org)!","category":"5424fb48ae542a1a7d7c5f7e","createdAt":"2014-09-26T05:37:31.326Z","excerpt":"","is_link":false,"link_url":"","order":0,"project":"53a47666447c0ba24d1a85cb","slug":"next-steps","sync_unique":"","title":"Next Steps","type":"basic","updates":[],"user":"5250b3ad5ac09b3564000005","version":"53a47666447c0ba24d1a85ce","childrenPages":[]}

Next Steps


Our API is currently really simple, but we are curious what kind of API would be useful. If you are interested in building something on top of Watsi, we'd love to talk more. Get in touch at [connect@watsi.org](mailto:connect@watsi.org)!
Our API is currently really simple, but we are curious what kind of API would be useful. If you are interested in building something on top of Watsi, we'd love to talk more. Get in touch at [connect@watsi.org](mailto:connect@watsi.org)!