Last active
August 29, 2015 13:56
-
-
Save soloman1124/8996619 to your computer and use it in GitHub Desktop.
GOALs output
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // url path: http://<host>/dashboard/goals/donating or http://<host>/dashboard/goals/volunteering | |
| // method: POST | |
| // payload format | |
| { | |
| "target": 1000, | |
| "from": "2014-02-07T11:57:25.000+11:00", | |
| "to": "2014-02-27T11:57:25.000+11:00", | |
| "causes" : [ | |
| { | |
| "id": 1 | |
| } | |
| ] | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // when create while existing active goal is available | |
| { | |
| "errors":{ | |
| "base":[ | |
| "Cannot not create a new goal while there is a existing active goal" | |
| ] | |
| } | |
| } | |
| // when update on an inactive goal while existing active goal available | |
| { | |
| "errors":{ | |
| "base":[ | |
| "Cannot update on an inactive goal while an active goal is available" | |
| ] | |
| } | |
| } | |
| // when there is missing required attributes | |
| { | |
| "errors":{ | |
| "from":[ | |
| "can't be blank" | |
| ], | |
| "to":[ | |
| "can't be blank" | |
| ] | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // url path: http://<host>/dashboard/goals | |
| { "donating" : [ { "active" : true, | |
| "causes" : [ { "id" : 1, | |
| "name" : "love" | |
| } ], | |
| "created_at" : "2014-02-14T15:45:40.000+11:00", | |
| "current_value" : { "cents" : 0, | |
| "currency" : { "iso_code" : "AUD", | |
| "name" : "Australian Dollar", | |
| "symbol" : "$" | |
| } | |
| }, | |
| "from" : "2014-02-11T15:45:36.000+11:00", | |
| "id" : 3, | |
| "progress" : 0.0, | |
| "target" : { "cents" : 10000, | |
| "currency" : { "iso_code" : "AUD", | |
| "name" : "Australian Dollar", | |
| "symbol" : "$" | |
| } | |
| }, | |
| "to" : "2014-05-25T14:45:36.000+10:00" | |
| } ], | |
| "fundraising" : [ { "amount" : { "cents" : 0, | |
| "currency" : { "iso_code" : "AUD", | |
| "name" : "Australian Dollar", | |
| "symbol" : "$" | |
| } | |
| }, | |
| "campaign" : { "name" : "Everyday Hero", | |
| "uid" : "au-0" | |
| }, | |
| "charity" : { "name" : "Help Talaya Appeal", | |
| "uid" : "au-1141" | |
| }, | |
| "dropdown_target" : "#tester", | |
| "duplicate_url" : "http://give.supporter.dev/au/get-started", | |
| "edit_url" : "http://give.supporter.dev/au/tester/edit", | |
| "expires_at" : "2014-02-07T11:57:25.000+11:00", | |
| "id" : 205250, | |
| "image_url" : { "large" : "http://supporter.dev/assets/pages/images/large/missing.gif", | |
| "medium" : "http://supporter.dev/assets/pages/images/medium/missing.gif", | |
| "small" : "http://supporter.dev/assets/pages/images/small/missing.gif", | |
| "tiny" : "http://supporter.dev/assets/pages/images/tiny/missing.gif" | |
| }, | |
| "name" : "Tester", | |
| "slug" : "tester", | |
| "state" : "active", | |
| "target" : { "cents" : 70000, | |
| "currency" : { "iso_code" : "AUD", | |
| "name" : "Australian Dollar", | |
| "symbol" : "$" | |
| } | |
| }, | |
| "uid" : 205250, | |
| "url" : "http://give.supporter.dev/au/tester" | |
| }, | |
| { "amount" : { "cents" : 0, | |
| "currency" : { "iso_code" : "AUD", | |
| "name" : "Australian Dollar", | |
| "symbol" : "$" | |
| } | |
| }, | |
| "campaign" : { "name" : "Everyday Hero", | |
| "uid" : "au-0" | |
| }, | |
| "charity" : { "name" : "Charity Charity", | |
| "uid" : "au-1" | |
| }, | |
| "dropdown_target" : "#tester-a-2", | |
| "duplicate_url" : "http://give.supporter.dev/au/get-started", | |
| "edit_url" : "http://give.supporter.dev/au/tester-a-2/edit", | |
| "expires_at" : "2014-06-21T15:35:34.000+10:00", | |
| "id" : 205251, | |
| "image_url" : { "large" : "http://supporter.dev/assets/pages/images/large/missing.gif", | |
| "medium" : "http://supporter.dev/assets/pages/images/medium/missing.gif", | |
| "small" : "http://supporter.dev/assets/pages/images/small/missing.gif", | |
| "tiny" : "http://supporter.dev/assets/pages/images/tiny/missing.gif" | |
| }, | |
| "name" : "Tester A 2", | |
| "slug" : "tester-a-2", | |
| "state" : "active", | |
| "target" : { "cents" : 70000, | |
| "currency" : { "iso_code" : "AUD", | |
| "name" : "Australian Dollar", | |
| "symbol" : "$" | |
| } | |
| }, | |
| "uid" : 205251, | |
| "url" : "http://give.supporter.dev/au/tester-a-2" | |
| }, | |
| { "amount" : { "cents" : 0, | |
| "currency" : { "iso_code" : "GBP", | |
| "name" : "British Pound", | |
| "symbol" : "£" | |
| } | |
| }, | |
| "campaign" : { "name" : "Everyday Hero", | |
| "uid" : "gb-0" | |
| }, | |
| "charity" : { "name" : "HAD", | |
| "uid" : "gb-157" | |
| }, | |
| "dropdown_target" : "#tester-a", | |
| "duplicate_url" : "http://give.supporter.dev/uk/get-started", | |
| "edit_url" : "http://give.supporter.dev/uk/tester-a/edit", | |
| "expires_at" : "2014-03-10T14:48:14.000+11:00", | |
| "id" : 205252, | |
| "image_url" : { "large" : "http://supporter.dev/assets/pages/images/large/missing.gif", | |
| "medium" : "http://supporter.dev/assets/pages/images/medium/missing.gif", | |
| "small" : "http://supporter.dev/assets/pages/images/small/missing.gif", | |
| "tiny" : "http://supporter.dev/assets/pages/images/tiny/missing.gif" | |
| }, | |
| "name" : "Tester A", | |
| "slug" : "tester-a", | |
| "state" : "active", | |
| "target" : { "cents" : 50000, | |
| "currency" : { "iso_code" : "GBP", | |
| "name" : "British Pound", | |
| "symbol" : "£" | |
| } | |
| }, | |
| "uid" : 205252, | |
| "url" : "http://give.supporter.dev/uk/tester-a" | |
| } | |
| ], | |
| "volunteering" : [ { "active" : true, | |
| "causes" : [ { "id" : 1, | |
| "name" : "love" | |
| } ], | |
| "created_at" : "2014-02-14T15:49:44.000+11:00", | |
| "current_value" : 0, | |
| "from" : "2014-02-11T15:49:42.000+11:00", | |
| "id" : 4, | |
| "progress" : 0.0, | |
| "target" : 166, | |
| "to" : "2014-05-25T14:49:42.000+10:00" | |
| } ] | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // url path: http://<host>/dashboard/goals/donating/<goal_id> or http://<host>/dashboard/goals/volunteering/<goal_id> | |
| // method: PUT | |
| // payload format | |
| { | |
| "target": 1000, | |
| "from": "2014-02-07T11:57:25.000+11:00", | |
| "to": "2014-02-27T11:57:25.000+11:00", | |
| "causes" : [ | |
| { | |
| "id": 1 | |
| } | |
| ] | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment