extra-life-node
This is a clone of https://github.com/ammuench/extra-life-api
noed-extra-life is a node module to integrate with the extra-life API, and extends it to provide additional info where possible.
Installation
You can install the repo through NPM
npm i extra-life-node
;;
API
Team & Participant IDs Parameters
Every method on the module will require an individual's 'Participant ID' or a team's 'Team ID'. These can be found by going to your personal profile page or team profile page, and checking the end of the URL:
Participant ID
extra-life.org/index.cfm?fuseaction=donordrive.participant&participantID=[PARTICIPANT ID HERE]
Team ID
extra-life.org/index.cfm?fuseaction=donorDrive.team&teamID=[TEAM ID HERE]
Methods
-
getUserInfo( participantId )
- Takes
participantId
as a parameter - Returns a basic object of user info
Returned object
displayName: 'Joe Smith'fundraisingGoal: 400participantID: 506571teamName: 'My Awesome Team'eventName: 'Extra Life 2018'avatarImageURL: 'https://assets.donordrive.com/extralife/images/$avatars$/constituent_42BB6E88-C292-13D6-00FFFD8987560FD1538.jpg'createdDateUTC: '2018-06-15T19:18:15.77+0000'eventID: 539sumDonations: 250teamID: 38961isTeamCaptain: falsenumDonations: 17donateURL: 'https://www.extra-life.org/index.cfm?fuseaction=donate.participant&participantID=506571'teamURL: 'https://www.extra-life.org/index.cfm?fuseaction=donorDrive.team&teamID=38961' - Takes
-
getUserDonations( participantId, limit?, page?)
- Takes
participantId
as a parameter.limit
andpage
are optional parameters. Page size is equal to yourlimit
value. - Returns information on page and count, and an array of donations, ordered from newest to oldest
Returned object
countDonations: 73countPages: 1donations:displayName: 'Tony Stark'message: 'Great job!'participantID: 681675amount: 25donorID: '5D4DBFFF-B861-D42E-05E6F2B574189698F'avatarImageURL: '//assets.donordrive.com/clients/extralife/img/avatar-constituent-default.gif'createdDateUTC: '2018-09-04T04:54:16.953+0000' - Takes
-
getTeamInfo(teamId, fetchRoster?)
- Takes
teamId
as a parameter and an optionalfetchRoster
boolean (defaults to TRUE) - Returns a promise that contains an object with the basic team info and it's full roster (if
fetchRoster
is set to TRUE) - Roster returns as array of user objects
Returned object
fundraisingGoal: 50000eventName: 'Extra Life 2018'avatarImageURL: 'http://assets.donordrive.com/extralife/images/$event539$/avatar_team_38961.jpg'createdDateUTC: '2018-01-20T04:51:25.97+0000'eventID: 539sumDonations: 1469teamID: 38961name: 'Extra Life Nerds'numDonations: 51teamURL: 'https://www.extra-life.org/index.cfm?fuseaction=donorDrive.team&teamID=38961'members:displayName: 'Alex Muench'fundraisingGoal: 1000participantID: 320706teamName: 'Extra Life Nerds'eventName: 'Extra Life 2018'avatarImageURL: 'https://assets.donordrive.com/extralife/images/$avatars$/constituent_0C07ECD7-C293-34EB-45A3F7B77F8BA043.jpg'createdDateUTC: '2018-09-06T20:14:48.0+0000'eventID: 539sumDonations: 0teamID: 38961isTeamCaptain: falsenumDonations: 0profileURL: 'https://www.extra-life.org/index.cfm?fuseaction=donorDrive.participants&participantID=320706'URL: 'https://www.extra-life.org/index.cfm?fuseaction=donorDrive.participant&participantID=320706'} - Takes
-
getTeamRoster(teamId)
- Takes
teamId
as a parameter - Returns information on page and count and an array of team members
Returned objectcountMembers: 73countPages: 1members:displayName: 'Alex Muench'fundraisingGoal: 1000participantID: 320706teamName: 'Extra Life Nerds'eventName: 'Extra Life 2018'avatarImageURL: 'https://assets.donordrive.com/extralife/images/$avatars$/constituent_0C07ECD7-C293-34EB-45A3F7B77F8BA043.jpg'createdDateUTC: '2018-09-06T20:14:48.0+0000'eventID: 539sumDonations: 0teamID: 38961isTeamCaptain: falsenumDonations: 0profileURL: 'https://www.extra-life.org/index.cfm?fuseaction=donorDrive.participants&participantID=320706'URL: 'https://www.extra-life.org/index.cfm?fuseaction=donorDrive.participant&participantID=320706'
- Takes
-
getTeamDonations( teamId, limit, page )
- Takes
teamId
as a parameter.limit
andpage
are optional parameters. Page size is equal to yourlimit
value. - Returns information on page and count, and an array of donations given to the team, ordered from newest to oldest
- NOTE ExtraLife's API includes registrations as donations in this view. Donations of "null" are a user signing up for a team. Donations of 19 (assumedly) are users signing up as a Platinum User.
Returned object
countDonations: 73countPages: 1donations:displayName: 'Joe Smith'message: nullparticipantID: 55555amount: 19donorID: 'ASDFF-AB7F-8295-1283655555F38D6D'avatarImageURL: '//assets.donordrive.com/extralife/images/$avatars$/constituent_ASDFF-AB7F-8295-1283655555F38D6D.jpg'createdDateUTC: '2018-01-22T14:39:04.783+0000'teamID: 38961displayName: 'Joan Smith'message: nullparticipantID: 55555amount: 19donorID: 'ASDFF-AB7F-8295-1283655555F38D6D'avatarImageURL: '//assets.donordrive.com/extralife/images/$avatars$/constituent_ASDFF-AB7F-8295-1283655555F38D6D.jpg'createdDateUTC: '2018-01-20T18:15:20.607+0000'teamID: 38961displayName: 'Joey Smith'message: nullparticipantID: 55555amount: 19donorID: 'ASDFF-AB7F-8295-1283655555F38D6D'avatarImageURL: '//assets.donordrive.com/extralife/images/$avatars$/constituent_ASDFF-AB7F-8295-1283655555F38D6D.jpg'createdDateUTC: '2018-01-20T17:47:14.630+0000'teamID: 38961 - Takes