Create or Edit Race

Create a simple race. The race must have a name, URL string, city, and country/state. The URL string is a custom string that will be used in the URL for the race. An error code of 216 will be returned in the error details if this is not unique. You must specify at least one event for the race. Refer to the Datatypes for details on the date format and possible values for event_type.

The partner_id field can be used to indicate the partner for the race. If used, this MUST match the partner id associated with the signature. You can only set the partner when creating a race. Setting the partner for an update will be ignored. Alternatively, you can set a partner_token field to set the partner when creating a race.

You need to specify the timezone the race is in with the timezone field. A list of acceptable timezones can be found at http://php.net/manual/en/timezones.php. If not specified on a new race, 'America/New_York' is used. The event start and end times are in the timezone of the race.

Editing a Race

To edit a race, send the entire race configuration as you would like it to appear, including events. In general, any fields not included will be set to null (meaning, they will be removed). Any existing events not included will be removed.

Race ID as a race_id url parameter is required. When editing races, you should NOT send in the url_string field (it will not be changed).

The contact email can be edited via the API, but is not retrievable unless your API key is authorized.

You should include the event_id field for any events you wish to update. If you want to add an event, you should leave the event_id field empty. If you only send new events, a race renewal will be assumed. The events of a renewed race must be after any other events for the race and there must not be any current events. If you wish to create past events, set allow_past_event_creation to T and send events with the event_id field empty. To edit past events, you must set allow_past_event_creation to T and race_event_days_id. If race_event_days_id is empty, the most recent events are assumed. Event start_time and end_time fields are expected to be dates in the format YYYY-MM-DD hh:mm:ss.

New Race Examples

Below is an example JSON request.

{
	"name": "Race Name",
	"partner_id": null,
	"partner_token": null,
	"url_string": "MyRaceUrl",
	"draft_race": "F",
	"address": {
		"street": "300 Mill St.",
		"city": "Moorestown",
		"state": "NJ",
		"country_code": "US",
		"zipcode": "08057"
	},
	"contact_email": "example@example.com",
	"timezone": "America/New_York",
	"events": [
		{
			"name": "8K",
			"start_time": "2014-06-07 08:30:00",
			"event_type": "running_race",
			"distance": 8,
			"distance_units": "K",
			"age_calc_base_date": null
		},
		{
			"name": "Half Marathon",
			"start_time": "2014-06-07 08:30:00",
			"event_type": "running_race",
			"distance": 26.2,
			"distance_units": "M",
			"age_calc_base_date": "2014-12-31"
		}
	]
}

Below is an example XML request.

<?xml version="1.0" encoding="utf-8" ?>
<request>
	<name>Race Name</name>
	<partner_id></partner_id>
	<partner_token></partner_token>
	<url_string>MyRaceUrl</url_string>
	<draft_race>F</draft_race>
	<address>
		<street>300 Mill St.</street>
		<city>Moorestown</city>
		<state>NJ</state>
		<country_code>US</country_code>
		<zipcode>08057</zipcode>
	</address>
	<contact_email>example@example.com</contact_email>
	<timezone>America/New_York</timezone>
	<events>
		<event>
			<name>8K</name>
			<start_time>2014-06-07 08:30:00</start_time>
			<event_type>running_race</event_type>
			<distance>8</distance>
			<distance_units>K</distance_units>
			<age_calc_base_date></age_calc_base_date>
		</event>
		<event>
			<name>Half Marathon</name>
			<start_time>2014-06-07 08:30:00</start_time>
			<event_type>running_race</event_type>
			<distance>26.2</distance>
			<distance_units>M</distance_units>
			<age_calc_base_date>2014-12-31</age_calc_base_date>
		</event>
	</events>
</request>

Edit Race Examples

Below is an example JSON request.

{
	"name": "Race Name",
	"partner_id": null,
	"draft_race": "F",
	"address": {
		"street": "300 Mill St.",
		"city": "Moorestown",
		"state": "NJ",
		"country_code": "US",
		"zipcode": "08057"
	},
	"timezone": "America/New_York",
	"allow_past_event_creation": "F",
	"race_event_days_id": null,
	"events": [
		{
			"event_id": 123,
			"name": "8K",
			"start_time": "2014-06-07 08:30:00",
			"event_type": "running_race",
			"distance": 8,
			"distance_units": "K",
			"age_calc_base_date": null
		},
		{
			"event_id": 124,
			"name": "Half Marathon",
			"start_time": "2014-06-07 08:30:00",
			"event_type": "running_race",
			"distance": 26.2,
			"distance_units": "M",
			"age_calc_base_date": "2014-12-31"
		}
	]
}

Below is an example XML request.

<?xml version="1.0" encoding="utf-8" ?>
<request>
	<name>Race Name</name>
	<partner_id></partner_id>
	<draft_race>F</draft_race>
	<address>
		<street>300 Mill St.</street>
		<city>Moorestown</city>
		<state>NJ</state>
		<country_code>US</country_code>
		<zipcode>08057</zipcode>
	</address>
	<timezone>America/New_York</timezone>
	<allow_past_event_creation>F</allow_past_event_creation>,
	<race_event_days_id></race_event_days_id>
	<events>
		<event>
			<event_id>123</event_id>
			<name>8K</name>
			<start_time>2014-06-07 08:30:00</start_time>
			<event_type>running_race</event_type>
			<distance>8</distance>
			<distance_units>K</distance_units>
			<age_calc_base_date></age_calc_base_date>
		</event>
		<event>
			<event_id>124</event_id>
			<name>Half Marathon</name>
			<start_time>2014-06-07 08:30:00</start_time>
			<event_type>running_race</event_type>
			<distance>26.2</distance>
			<distance_units>M</distance_units>
			<age_calc_base_date>2014-12-31</age_calc_base_date>
		</event>
	</events>
</request>

URL

https://runsignup.com/rest/race

HTTP Method

POST

Standard Parameters

Parameter HTTP Method Default Description Datatype
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
format GET xml Format of response. format
protected_api_signature
Required
GET Signature to use a protected API. More information… string

Parameters

Parameter HTTP Method Default Description Datatype
request_format POST xml Format of request. format
race_id POST Id of race, if editing. uint
request
Required
POST Request in proper format. string

Customer Spotlight