Call this API method to set up the giveaway for an event. To edit an existing giveaway option, include the giveaway_option_id field with the giveaway option information. Any existing giveaway option not in the request will be deleted. The order that the giveaway options appear here will be the order they are displayed to users. The response includes the giveaway options ids in the order defined. If there are no giveaway options provided, giveaways will be disabled.
For JSON requests, the request should look like the example below.
{ "giveaway": "Text of give-away shown to user. E.g. \"T-Shirt\"", "giveaway_cutoff_date": "2014-12-31", "giveaway_options": [ { "giveaway_option_id": 12345, "giveaway_option_text": "None", "additional_cost_in_cents": -200 }, { "giveaway_option_id": 12346, "giveaway_option_text": "Small", "additional_cost_in_cents": 0 }, { "giveaway_option_id": 12347, "giveaway_option_text": "Medium", "additional_cost_in_cents": 0 }, { "giveaway_option_id": 12348, "giveaway_option_text": "Large", "additional_cost_in_cents": 0 }, { "giveaway_option_id": 12349, "giveaway_option_text": "XLarge", "additional_cost_in_cents": 500 } ] }
For XML requests, the request should look like the example below.
<giveaway_settings> <giveaway>Text of give-away shown to user. E.g. "T-Shirt"</giveaway> <giveaway_cutoff_date>2014-12-31</giveaway_cutoff_date> <giveaway_options> <giveaway_option> <giveaway_option_id>12345</giveaway_option_id> <giveaway_option_text>None</giveaway_option_text> <additional_cost_in_cents>-200</additional_cost_in_cents> </giveaway_option> <giveaway_option> <giveaway_option_id>12346</giveaway_option_id> <giveaway_option_text>Small</giveaway_option_text> <additional_cost_in_cents>0</additional_cost_in_cents> </giveaway_option> <giveaway_option> <giveaway_option_id>12347</giveaway_option_id> <giveaway_option_text>Medium</giveaway_option_text> <additional_cost_in_cents>0</additional_cost_in_cents> </giveaway_option> <giveaway_option> <giveaway_option_id>12348</giveaway_option_id> <giveaway_option_text>Large</giveaway_option_text> <additional_cost_in_cents>0</additional_cost_in_cents> </giveaway_option> <giveaway_option> <giveaway_option_id>12349</giveaway_option_id> <giveaway_option_text>XLarge</giveaway_option_text> <additional_cost_in_cents>500</additional_cost_in_cents> </giveaway_option> </giveaway_options> </giveaway_settings>
Parameter | HTTP Method | Default | Description | Datatype |
---|---|---|---|---|
api_key |
GET | API Key | string |
|
api_secret |
GET | API Secret | string |
|
tmp_key |
GET | Temporary API Key from login API call. This should NOT be used in combination with API Key. | string |
|
tmp_secret |
GET | Temporary API Secret from login API call. This should NOT be used in combination with API Secret. | string |
|
rsu_api_key |
GET | API v2 key. If used, you must send the API secret in an HTTP header named X-RSU-API-SECRET. | string |
|
sp_api_key |
GET | Super partner API key. If used, you must send the API secret in an HTTP header named X-RSU-API-SECRET. | string |
|
X-RSU-API-SECRET |
HTTP Header | API v2 or super partner secret. | string |
|
format |
GET | xml | Format of response. The default if not sent is `xml`, but `json` is preferred. | format |
Parameter | HTTP Method | Default | Description | Datatype |
---|---|---|---|---|
race_id Required |
POST | ID of race. | uint |
|
event_id Required |
POST | ID of event. | uint |
|
request_format |
POST | xml | Format of request. The default if not sent is `xml`, but `json` is preferred. | format |
request Required |
POST | Request in proper format. | string |
{ "openapi": "3.0.3", "info": { "title": "Set Up Event Giveaway", "description": "Set up event giveaways.", "version": "1.0.0", "contact": { "name": "RunSignup API Support", "url": "https://runsignup.com/API", "email": "info@runsignup.com" } }, "servers": [ { "url": "https://runsignup.com/API", "description": "Production API Server" } ], "tags": [ { "name": "Race Registration Setup", "description": "APIs related to Race Registration Setup" } ], "components": { "schemas": { "Error": { "type": "object", "properties": { "error": { "type": "string", "description": "Error message" } }, "required": [ "error" ] }, "BadRequestError": { "allOf": [ { "$ref": "#/components/schemas/Error" }, { "description": "Error indicating invalid request parameters or structure" } ] }, "UnauthorizedError": { "allOf": [ { "$ref": "#/components/schemas/Error" }, { "description": "Error indicating authentication failure" } ] }, "ForbiddenError": { "allOf": [ { "$ref": "#/components/schemas/Error" }, { "description": "Error indicating the authenticated user lacks required permissions" } ] }, "NotFoundError": { "allOf": [ { "$ref": "#/components/schemas/Error" }, { "description": "Error indicating the requested resource does not exist" } ] }, "ServerError": { "allOf": [ { "$ref": "#/components/schemas/Error" }, { "description": "Error indicating an unexpected server-side issue" } ] } }, "securitySchemes": { "apiKey": { "type": "apiKey", "in": "query", "name": "api_key", "description": "RunSignup API Key" }, "apiSecret": { "type": "apiKey", "in": "query", "name": "api_secret", "description": "RunSignup API Secret" } } }, "paths": { "/race/:race_id/giveaways": { "post": { "tags": [ "Race Registration Setup" ], "summary": "Set Up Event Giveaway", "description": "Set up event giveaways.", "operationId": "race_:race_id_giveaways", "parameters": [ { "name": "api_key", "in": "query", "description": "API Key", "required": false, "schema": { "type": "string" } }, { "name": "api_secret", "in": "query", "description": "API Secret", "required": false, "schema": { "type": "string" } }, { "name": "tmp_key", "in": "query", "description": "Temporary API Key from login API call. This should NOT be used in combination with API Key.", "required": false, "schema": { "type": "string" } }, { "name": "tmp_secret", "in": "query", "description": "Temporary API Secret from login API call. This should NOT be used in combination with API Secret.", "required": false, "schema": { "type": "string" } }, { "name": "rsu_api_key", "in": "query", "description": "API v2 key. If used, you must send the API secret in an HTTP header named X-RSU-API-SECRET.", "required": false, "schema": { "type": "string" } }, { "name": "sp_api_key", "in": "query", "description": "Super partner API key. If used, you must send the API secret in an HTTP header named X-RSU-API-SECRET.", "required": false, "schema": { "type": "string" } }, { "name": "X-RSU-API-SECRET", "in": "header", "description": "API v2 or super partner secret.", "required": false, "schema": { "type": "string" } }, { "name": "format", "in": "query", "description": "Format of response. The default if not sent is `xml`, but `json` is preferred.", "required": false, "schema": { "type": "string", "enum": [ "xml", "json", "csv" ], "default": "xml" } }, { "name": "race_id", "in": "query", "description": "ID of race.", "required": true, "schema": { "type": "integer" } }, { "name": "event_id", "in": "query", "description": "ID of event.", "required": true, "schema": { "type": "integer" } }, { "name": "request_format", "in": "query", "description": "Format of request. The default if not sent is `xml`, but `json` is preferred.", "required": false, "schema": { "type": "string", "enum": [ "xml", "json", "csv" ], "default": "xml" } }, { "name": "request", "in": "query", "description": "Request in proper format.", "required": true, "schema": { "type": "string" } } ], "security": [ { "apiKey": [] }, { "apiSecret": [] } ], "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "type": "object" } } } }, "400": { "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BadRequestError" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UnauthorizedError" } } } }, "403": { "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ForbiddenError" } } } }, "404": { "description": "Not Found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/NotFoundError" } } } }, "500": { "description": "Internal Server Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ServerError" } } } } }, "x-permissions": [ "affiliates", "partners", "race_directors", "timers" ] } } } }