The Affiliate Integration controller allows you to link your events and races to Athlinks events and courses.
- Event Search
- REST Pattern: integration/affiliate/event/search/{name}?key=
- Description: Search for an Athlinks Event by name.
- Example: integration/affiliate/event/search/race%20director
- Returns: An array of master events with next and last event information.
{ "events": [ { "master": { "id": 196526, "name": "The Race Director Push" }, "last": { "id": 621563, "date": "3/1/2017" }, "next": { "id": 621564, "date": "3/1/2018" } }, ... ] }
- Event Info
- REST Pattern: integration/affiliate/event/info/{athinksEventId}?key=
- Description: Query for additional information about an Athlinks event by ID.
- Example: integration/affiliate/event/info/621563
- Returns: Returns an array of master events with next and last event information.
{ "name": "The 2017 Race Director Push", "date": "3/1/2017", "courses": [ { "id": 955128, "name": "5K Run", "distance": 5000, "units": "meter" }, { "id": 955129, "name": "10K Run", "distance": 10000, "units": "meter" } ] }
- Event Link
- REST Pattern [Post Only]: integration/affiliate/event/link?key=
- Description: Link your event to an existing Athlinks event, or create a new Athlinks event on-the-fly.
- Example: Accepts a payload with 3rd party data and an optional Athlinks event ID.
{ "ThirdPartyEventId": "010-2017", "AthlinksEventId": 621563, "LinkTypeId": 1003, "Name": "2017 Race Director Push", "StartDateTimeString": "201703010700", "Description": "Happens every year, rain or shine.", "City": "Louisville", "State": "CO", "Country": "US" }
- Field Definitions & Usage:
Field Name Possible Values ThirdPartyEventId A string that uniquely represents the event in your system. AthlinksEventId 1 - 999999 | null
Indicates to which Athlinks event this race's event is linked, for updates.LinkTypeId 1000 (Registration) | 1003 (Timer) Name The name of the event. StartDateTimeString A string representing the event start date/time in the format YYYYMMDDhhmm Description A description of the event. City The city in or near which the event is taking place. State The state or region in which the event is taking place.
Use the 2- or 3-digit locale code for the state as defined by ISO-3166Country The country in which the event is taking place.
Use the 2-digit locale code for the country as defined by ISO 3166-1 alpha-2 - Returns: A 200 OK response, where "id" is the linked Athlinks event ID.
{ "response_code": "0", "id": 621563 }
- Race/Course Link
- REST Pattern [Post Only]: integration/affiliate/race/link?key=
- Description: For a given Athlinks event, link your race to an existing Athlinks course, or create a new Athlinks course on-the-fly.
This endpoint accepts a payload with 3rd party data and an optional Athlinks course ID. - Example: For a simple race with no splits:
{ "ThirdPartyEventId": "010-2017", "ThirdPartyRaceId": "010-2017-10K", "AthlinksEventId": 621563, "AthlinksCourseId": 955129, "RaceName": "10K Bruiser", "RaceType": "running", "RaceSubType": "running", "RaceDistance": 10000, "RaceDistanceUnit": "meters", "RaceIntervals": [{ "IsFull": true, "IntervalRaceType": "run", "IntervalType": "course", "DistanceInMeters": 10000, "PaceDisplayUnit": "mi/hr", "DisplayOrder": 1 }], "ForceUpdate": true }
- Example: For a race with multiple splits:
{ "ThirdPartyEventId": "010-2017", "ThirdPartyRaceId": "010-2017-15K", "AthlinksEventId": 621563, "AthlinksCourseId": 955130, "RaceName": "15K Relay", "RaceType": "running", "RaceSubType": "running", "RaceDistance": 15000, "RaceDistanceUnit": "meters", "RaceIntervals": [{ "IsLeg": true, "IntervalRaceType": "run", "IntervalType": "split", "DistanceInMeters": 8000, "PaceDisplayUnit": "mi/hr", "DisplayOrder": 1 }, { "IsLeg": true, "IntervalRaceType": "run", "IntervalType": "split", "DistanceInMeters": 5000, "PaceDisplayUnit": "mi/hr", "DisplayOrder": 2 }, { "IsLeg": true, "IntervalRaceType": "run", "IntervalType": "split", "DistanceInMeters": 2000, "PaceDisplayUnit": "mi/hr", "DisplayOrder": 3 }] }
- Example: For a multisport race with transitions:
{ "ThirdPartyEventId": "005-2017", "ThirdPartyRaceId": "005-2017-TRI", "AthlinksEventId": 621563, "AthlinksCourseId": 955131, "RaceName": "Triathlon Relay", "RaceType": "multisport", "RaceSubType": "triathlon & multisport", "RaceDistance": 51500, "RaceDistanceUnit": "meters", "RaceIntervals": [{ "IsLeg": true, "IntervalRaceType": "swim", "IntervalType": "split", "DistanceInMeters": 1500, "PaceDisplayUnit": "min/100m", "DisplayOrder": 1 }, { "IsLeg": true, "IntervalRaceType": "other", "PaceDisplayUnit": "none", "DisplayOrder": 2 }, { "IsLeg": true, "IntervalRaceType": "bike", "IntervalType": "split", "DistanceInMeters": 40000, "PaceDisplayUnit": "mi/hr", "DisplayOrder": 3 }, { "IsLeg": true, "IntervalRaceType": "other", "PaceDisplayUnit": "none", "DisplayOrder": 4 }, { "IsLeg": true, "IntervalRaceType": "run", "IntervalType": "split", "DistanceInMeters": 10000, "PaceDisplayUnit": "min/mi", "DisplayOrder": 5 }] }
- Field Definitions & Usage:
Field Name Possible Values ThirdPartyEventId A string that uniquely represents the event in your system. ThirdPartyRaceId A string that uniquely represents the race in your system. AthlinksEventId 1 - 999999
Indicates to which Athlinks event this race's event is linked.AthlinksCourseId 1 - 999999 | null
Indicates to which Athlinks course this race is linked, for updates.RaceType running | biking | swimming | multisport | obstacle | other | untimed RaceSubType RaceType Possible Values running running | trail running | fun run | race walking biking cycling | mountain biking | cyclocross | criterium swimming swimming multisport traithlon & multisport | off-road triathlon | duathlon | off-road duathlon | paddle triathlon | aquathlon obstacle obstacle other wheelchair | canoe/kayak | paddleboarding | inline skating | ski - cross country | adventure racing | orienteering | roller skiing RaceDistance 0 - 999999
The total combined distance of all intervals, ie. the entire course.RaceDistanceUnit miles | kilometers | meters | feet | yards RaceIntervals Field Name Possible Values IsFull true | false
Indicates that the interval is the full course.
If including Legs, omit the full course interval.IsLeg true | false
Indicates that the interval is for a leg of the course.
If IsLeg is true, IsFull should be false (and vice versa).IntervalRaceType run | bike | swim | obstacle | multisport | other
For a Transition, use "other".IntervalType course | split | other
If IsLeg is true, IntervalType should be "split".DistanceInMeters 0 - 999999 PaceDisplayUnit mi/hr | min/mi | km/hr | min/km | min/100yd | min/100m | m/s | yd/s | ft/s | none
For a Transition, use "none".DisplayOrder 1-99
Indicates the order in which the interval should be displayed at www.Athlinks.comForceUpdate true | false
Allows forceful updating of existing Athlinks course information. - Returns: A 200 OK response, where "id" is the linked Athlinks course ID.
{ "response_code": "0", "id": 955129 }
- Note: At this time, the event will be visible at www.athlinks.com/Events/621563/Courses/955129
- Assign Master
- REST Pattern [Post Only]: integration/affiliate/master/assign?key=
- Description: Assigns your event to a master event and makes the event searchable in www.athlinks.com as well as the Event Search endpoint above.
- Example: Accepts a payload with 3rd party data and an optional Athlinks event ID.
{ "ThirdPartyEventId": "010-2017", "AthlinksEventId": 621563, "AthlinksMasterEventId": 196526, "Name": null, "ForceUpdate": true }
- Field Definitions & Usage:
Field Name Possible Values ThirdPartyEventId A string that uniquely represents the event in your system. AthlinksEventId 1 - 999999 AthlinksMasterEventId 1 - 999999 | null
Indicates to which master event you would like to link your Athlinks event. If used, the Name value should be null.Name The name of the master event to link to. Use if the AthlinksMasterEventId value is unknown. ForceUpdate true | false
Allows forceful updating of existing Athlinks event information. - Returns: A 200 OK response.
{ "response_code": "0", "data": { "athlinksEventId": 621563, "athlinksMasterEventId": 196526, "thirdPartyEventId": "010-2017" } }