Teams

POST teams.{format}

Authentication
Yes PRIVATE API Token
URI Parameters
keyword Targets the keyword the teams will be added under
shortcode Targets the shortcode – if not specified will default to 71777 (optional)
teams An array of teams to be added or updated
teams[name] Name of the team to be added, if it already exists under the selected keyword API will update instead of create
teams[alt_id] Alternate ID for the team (optional)
teams[category_id] Category ID for the team (optional)
teams[cta] Call To Action text for the team (optional)
teams[goal] Goal amount, must be a positive number, will default to 100 if not set (optional)
team Can be used in lieu of teams array to pass a singleton team, same sub-parameters apply
Response Parameters
teams
error Error message if unsuccessful
status Status code, 200 on success, 400 on error
teams Array of teams that were created or updated if successful

Request Example

WINDOWS USERS – Please see note at the end

This endpoint will create or update an array of teams, and will return ar array of team names, IDs, and “status” (either “updated”, or “created”). The default action is to create but if a team with the same name is found under the same keyword then the API will update the 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 ' {"keyword":"[valid 71777 keyword]","teams":[{"name":"team1name","goal":"team1goalamount"},{"name":"team2name","category_id":"team2category_id"}]}' "https://fundraise.givesmart.com/api/v2/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?