{"_id":"572c304373c5671700a7abef","category":{"_id":"572c301e7c8eff0e00aaa174","project":"571f5e8cd8667f0e00a3c498","version":"571f5e8cd8667f0e00a3c49b","__v":0,"sync":{"url":"","isSync":false},"reference":false,"createdAt":"2016-05-06T05:48:14.616Z","from_sync":false,"order":8,"slug":"fundraising-page-json-api","title":"FundraisingPage JSON-API"},"project":"571f5e8cd8667f0e00a3c498","version":{"_id":"571f5e8cd8667f0e00a3c49b","hasDoc":true,"__v":12,"hasReference":true,"project":"571f5e8cd8667f0e00a3c498","createdAt":"2016-04-26T12:26:52.312Z","releaseDate":"2016-04-26T12:26:52.312Z","categories":["571f5e8cd8667f0e00a3c49c","571f73cfcb4baa0e00d13a80","571f7451cb4baa0e00d13a88","571f7d2720695f3400f38797","571f7fb0ac2a080e0014c661","571f884be54f2d0e003ebb0a","572200c9ecb38d0e00d80ebd","572c301e7c8eff0e00aaa174","57df91b2c6348d0e0020c452","57e104db9ff1e21900a721ab","57fd04caeaa77f19008b8202","5899c7113514ce0f0014da84"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1.0"},"__v":27,"parentDoc":null,"user":"5720ba18c669e80e00c35051","updates":[],"next":{"pages":[],"description":""},"createdAt":"2016-05-06T05:48:51.417Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":0,"body":"You can retrieve the public fundraising page data as JSON via a given url. Thus you are able to render the fundraising pages very flexible at your own. For example you can read the JSON data by using JavaScript and create HTML according to the retrieved JSON data.\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"JSON url\"\n}\n[/block]\nYou can find the JSON url at the fundraising page add on configuration at „Settings“. Please select a fundraising page tool first. The JSON url of the choosen fundraising page tool is shown at „JSON address“. Here you can define some filters and sortings to finally get the JSON url at the end of the page.\n\nThe url looks like this:\n[https://secure.fundraisingbox.com/pages_list/abc.json?count=12&show_expired=0](#) \n\n**These are the available search parameter to filter the list of fundraising pages:** \n[block:parameters]\n{\n  \"data\": {\n    \"0-0\": \"received_percentage_min\",\n    \"1-0\": \"status\",\n    \"2-0\": \"show_expired\",\n    \"3-0\": \"count\",\n    \"4-0\": \"sort\",\n    \"6-0\": \"has_image\",\n    \"7-0\": \"title\",\n    \"8-0\": \"description\",\n    \"9-0\": \"fundraiser_name\",\n    \"10-0\": \"search\",\n    \"h-0\": \"Search parameter\",\n    \"h-1\": \"Description\",\n    \"h-2\": \"Details\",\n    \"3-1\": \"Number of results\",\n    \"3-2\": \"A number greater than 0\",\n    \"4-1\": \"Sorting\",\n    \"4-2\": \"Default: randomized order\\nreceived_percentage: Show pages with the highest received percentage first\\nreceived: Show pages with the highest received amount first\\nmanually: Show pages according to the domains-parameter.\",\n    \"6-1\": \"Show pages with images only\",\n    \"6-2\": \"Default: Show all pages\\n1: show only pages with an image\",\n    \"2-1\": \"Show expired pages\",\n    \"2-2\": \"Default: Do not show expired pages\\n1: also show expired pages\",\n    \"0-1\": \"Minimum percentage of reached goal\",\n    \"0-2\": \"A number greater than 0.\",\n    \"1-1\": \"Status of a page\",\n    \"1-2\": \"preferred: only show preferred pages\",\n    \"5-0\": \"domains\",\n    \"5-1\": \"A comma separated list of domains\",\n    \"5-2\": \"Only in combination with sort=manually\",\n    \"7-1\": \"Page title\",\n    \"8-1\": \"Page description\",\n    \"9-1\": \"Public name of the fundraiser\",\n    \"10-1\": \"Performs a search in title, description and fundraiser_name\",\n    \"7-2\": \"Case insensitivity search\",\n    \"8-2\": \"Case insensitivity search\",\n    \"9-2\": \"Case insensitivity search\",\n    \"10-2\": \"Case insensitivity search\"\n  },\n  \"cols\": 3,\n  \"rows\": 11\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"JSON data\"\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"[\\n\\t{\\n  \\t\\\"domain\\\": \\\"xyz\\\",\\n    \\\"title\\\": \\\"Running for world peace\\\",\\n    \\\"fundraiser_name\\\": \\\"John Doo\\\",\\n    \\\"description\\\": \\\"Dear friends, I will run for world peace.\\\",\\n    \\\"donation_message\\\": \\\"Thank you for your support\\\",\\n    \\\"has_image\\\": true,\\n    \\\"image_url\\\": \\\"https://secure.fundraisingbox.com/pages/getImage/type/page/domain/xyz/123.jpg\\\",\\n    \\\"link\\\": \\\"https://www.example.com/my-fundraising-pages?cfd=xyz\\\",\\n    \\\"json_link\\\": \\\"https://secure.fundraisingbox.com/pages_render/abc/xyz.json\\\",\\n    \\\"payment_link\\\": \\\"https://www.example.com/my-fundraising-pages?cfs=p&cfd=xyz#cff\\\",\\n    \\\"expires_at\\\": \\\"2016-06-25\\\",\\n    \\\"days_left\\\": 36,\\n    \\\"project_name\\\": \\\"\\\",\\n    \\\"category\\\": \\\"creative\\\",\\n    \\\"status\\\": \\\"preferred\\\",\\n    \\\"goal\\\": 1000,\\n    \\\"received\\\": 230,\\n    \\\"received_percentage\\\": 23,\\n    \\\"donation_count\\\": 2,\\n    \\\"donations\\\": [ \\n      {\\n        \\\"date\\\": \\\"2016-04-04 10:33:43\\\",\\n        \\\"amount\\\": 30,\\n        \\\"public_name\\\": \\\"Tim\\\",\\n        \\\"public_message\\\": \\\"Good job, dude!\\\"\\n      },\\n      {\\n        \\\"date\\\": \\\"2016-05-01 20:11:42\\\",\\n        \\\"amount\\\": 200,\\n        \\\"public_name\\\": \\\"Your mum\\\",\\n        \\\"public_message\\\": \\\"Go for it, Johnny!\\\"\\n      }\\n    ]\\n  },\\n  {\\n    ...\\n  }\\n]\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]\nIn the list of fundraising pages every single page has it's own json_link. With this link you can retrieve the data from this page only.\n[block:api-header]\n{\n  \"title\": \"HTML + JavaScript Example\"\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"<!DOCTYPE html>\\n<html>\\n\\t<head>\\n\\t\\t<title>JSON Search Example</title>\\n\\t\\t<script type=\\\"text/javascript\\\" src=\\\"/jquery.min.js\\\"></script>\\n\\t</head>\\n\\t<body>\\n\\t\\t<form id=\\\"searchForm\\\">\\n\\t\\t\\t<label for=\\\"search\\\">Search</label>\\n\\t\\t\\t<input type=\\\"text\\\" id=\\\"search\\\" />\\n\\t\\t</form>\\n\\t\\t<button id=\\\"searchButton\\\">Start search</button>\\n\\t\\t\\n\\t\\t<div id=\\\"results\\\"></div>\\n\\t\\t\\n\\t\\t<script type=\\\"text/javascript\\\">\\n\\t\\t\\t$(\\\"#searchButton\\\").unbind(\\\"click\\\").on(\\\"click\\\", function() {\\n\\t\\t\\t\\t$(\\\"#results\\\").html(\\\"Searching...\\\");\\n\\t\\t\\t\\t$.getJSON(\\n\\t\\t\\t\\t\\t\\\"https://secure.fundraisingbox.com/pages_list/xxx-Hash-xxx.json\\\",\\n\\t\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\t\\tcount: 12,\\n\\t\\t\\t\\t\\t\\tsearch: $(\\\"#search\\\").val()\\n\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t).done(function(data) {\\n\\t\\t\\t\\t\\tvar results = \\\"\\\";\\n\\t\\t\\t\\t\\tif(data.length > 0)\\n\\t\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\t\\t$.each(data, function(index, page) {\\n\\t\\t\\t\\t\\t\\t\\tresults += \\\"<a href='\\\"+page.link+\\\"'>\\\"+page.title+\\\"</a><br />\\\";\\n\\t\\t\\t\\t\\t\\t});\\n\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t\\telse\\n\\t\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\t\\tresults = \\\"<i>No matches</i>\\\";\\n\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t\\t$(\\\"#results\\\").html(results);\\n\\t\\t\\t\\t});\\n\\t\\t\\t});\\n\\t\\t</script>\\t\\n\\t</body>\\n</html>\\n\",\n      \"language\": \"html\"\n    }\n  ]\n}\n[/block]","excerpt":"Retrieve fundraising page data as JSON","slug":"fundraising-page-json-api","type":"basic","title":"FundraisingPage JSON-API"}

FundraisingPage JSON-API

Retrieve fundraising page data as JSON

You can retrieve the public fundraising page data as JSON via a given url. Thus you are able to render the fundraising pages very flexible at your own. For example you can read the JSON data by using JavaScript and create HTML according to the retrieved JSON data. [block:api-header] { "type": "basic", "title": "JSON url" } [/block] You can find the JSON url at the fundraising page add on configuration at „Settings“. Please select a fundraising page tool first. The JSON url of the choosen fundraising page tool is shown at „JSON address“. Here you can define some filters and sortings to finally get the JSON url at the end of the page. The url looks like this: [https://secure.fundraisingbox.com/pages_list/abc.json?count=12&show_expired=0](#) **These are the available search parameter to filter the list of fundraising pages:** [block:parameters] { "data": { "0-0": "received_percentage_min", "1-0": "status", "2-0": "show_expired", "3-0": "count", "4-0": "sort", "6-0": "has_image", "7-0": "title", "8-0": "description", "9-0": "fundraiser_name", "10-0": "search", "h-0": "Search parameter", "h-1": "Description", "h-2": "Details", "3-1": "Number of results", "3-2": "A number greater than 0", "4-1": "Sorting", "4-2": "Default: randomized order\nreceived_percentage: Show pages with the highest received percentage first\nreceived: Show pages with the highest received amount first\nmanually: Show pages according to the domains-parameter.", "6-1": "Show pages with images only", "6-2": "Default: Show all pages\n1: show only pages with an image", "2-1": "Show expired pages", "2-2": "Default: Do not show expired pages\n1: also show expired pages", "0-1": "Minimum percentage of reached goal", "0-2": "A number greater than 0.", "1-1": "Status of a page", "1-2": "preferred: only show preferred pages", "5-0": "domains", "5-1": "A comma separated list of domains", "5-2": "Only in combination with sort=manually", "7-1": "Page title", "8-1": "Page description", "9-1": "Public name of the fundraiser", "10-1": "Performs a search in title, description and fundraiser_name", "7-2": "Case insensitivity search", "8-2": "Case insensitivity search", "9-2": "Case insensitivity search", "10-2": "Case insensitivity search" }, "cols": 3, "rows": 11 } [/block] [block:api-header] { "type": "basic", "title": "JSON data" } [/block] [block:code] { "codes": [ { "code": "[\n\t{\n \t\"domain\": \"xyz\",\n \"title\": \"Running for world peace\",\n \"fundraiser_name\": \"John Doo\",\n \"description\": \"Dear friends, I will run for world peace.\",\n \"donation_message\": \"Thank you for your support\",\n \"has_image\": true,\n \"image_url\": \"https://secure.fundraisingbox.com/pages/getImage/type/page/domain/xyz/123.jpg\",\n \"link\": \"https://www.example.com/my-fundraising-pages?cfd=xyz\",\n \"json_link\": \"https://secure.fundraisingbox.com/pages_render/abc/xyz.json\",\n \"payment_link\": \"https://www.example.com/my-fundraising-pages?cfs=p&cfd=xyz#cff\",\n \"expires_at\": \"2016-06-25\",\n \"days_left\": 36,\n \"project_name\": \"\",\n \"category\": \"creative\",\n \"status\": \"preferred\",\n \"goal\": 1000,\n \"received\": 230,\n \"received_percentage\": 23,\n \"donation_count\": 2,\n \"donations\": [ \n {\n \"date\": \"2016-04-04 10:33:43\",\n \"amount\": 30,\n \"public_name\": \"Tim\",\n \"public_message\": \"Good job, dude!\"\n },\n {\n \"date\": \"2016-05-01 20:11:42\",\n \"amount\": 200,\n \"public_name\": \"Your mum\",\n \"public_message\": \"Go for it, Johnny!\"\n }\n ]\n },\n {\n ...\n }\n]", "language": "json" } ] } [/block] In the list of fundraising pages every single page has it's own json_link. With this link you can retrieve the data from this page only. [block:api-header] { "title": "HTML + JavaScript Example" } [/block] [block:code] { "codes": [ { "code": "<!DOCTYPE html>\n<html>\n\t<head>\n\t\t<title>JSON Search Example</title>\n\t\t<script type=\"text/javascript\" src=\"/jquery.min.js\"></script>\n\t</head>\n\t<body>\n\t\t<form id=\"searchForm\">\n\t\t\t<label for=\"search\">Search</label>\n\t\t\t<input type=\"text\" id=\"search\" />\n\t\t</form>\n\t\t<button id=\"searchButton\">Start search</button>\n\t\t\n\t\t<div id=\"results\"></div>\n\t\t\n\t\t<script type=\"text/javascript\">\n\t\t\t$(\"#searchButton\").unbind(\"click\").on(\"click\", function() {\n\t\t\t\t$(\"#results\").html(\"Searching...\");\n\t\t\t\t$.getJSON(\n\t\t\t\t\t\"https://secure.fundraisingbox.com/pages_list/xxx-Hash-xxx.json\",\n\t\t\t\t\t{\n\t\t\t\t\t\tcount: 12,\n\t\t\t\t\t\tsearch: $(\"#search\").val()\n\t\t\t\t\t}\n\t\t\t\t).done(function(data) {\n\t\t\t\t\tvar results = \"\";\n\t\t\t\t\tif(data.length > 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t$.each(data, function(index, page) {\n\t\t\t\t\t\t\tresults += \"<a href='\"+page.link+\"'>\"+page.title+\"</a><br />\";\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tresults = \"<i>No matches</i>\";\n\t\t\t\t\t}\n\t\t\t\t\t$(\"#results\").html(results);\n\t\t\t\t});\n\t\t\t});\n\t\t</script>\t\n\t</body>\n</html>\n", "language": "html" } ] } [/block]