Add Peer Fundraisers To Teams

POST add_peer_fundraisers_toteams.{format}

Authentication
Yes PRIVATE API Token
URI Parameters
teams Array of teams to add peer fundraisers to
team A singleton team
teams[id] Id of the team to be targeted
teams[fundraisers] Array of fundraisers to add to the team
teams[fundraiser] Singleton fundraiser
fundraisers[user_email] Valid email for the peer fundraiser
fundraisers[as_captain] Set to “true” if the peer fundraiser should be a team captain
Response Parameters
teams
message “Success” message if successful
error Error message if unsuccessful
status Status code, 200 on success, 400 on error

Request Example

WINDOWS USERS – Please see note at the end

This endpoint will add an array of fundraisers as members of a specified team. The default action is to create but if a fundraiser with the same email is found under then the API will associate the existing record instead.

curl -v -D - -H 'Authorization: Token token="[private_api_token_here]"' -H "Accept: application/json" -H "Content-type: application/json" -X POST -d ' {"teams":[{"id":"team1id","fundraiser":{"user_email":"[email protected]"}},{"id":"team2id", "fundraisers":[{"user_email":"[email protected]","as_captain":"true"},{"user_email":"[email protected]"}]}]}' "https://fundraise.givesmart.com/api/v2/teams/add_peer_fundraisers_to_teams"

By default these commands will not work on the Windows command prompt as it does not escape double quotes properly. Windows users can use Cygwin to have a Unix-like command prompt, or they can structure the calls to escape the quotes like so:

curl -H "Authorization: Token token=\"[private_api_token_here]\"" -H "Accept: application/json" -H "Content-type: application/json" -X GET -d " {\"status\":\"collected,pending\",\"transaction_type\":\"sale,credit\",\"amount_min\":\"50.00\"}" https://fundraise.givesmart.com/api/v2/reports/transactions.json?

and

curl -H "Authorization: Token token=\"[private_api_token_here]\"" -H "Accept: application/json" -H "Content-type: application/json" -X GET -d " {\"id\":\"[report_id_here]\"}" https://fundraise.givesmart.com/api/v2/reports/results.json?