{"_id":"564b7e1be323d01700a51348","version":{"_id":"55773a5ba042551900b002ce","project":"55773a5ba042551900b002cb","__v":18,"createdAt":"2015-06-09T19:11:23.764Z","releaseDate":"2015-06-09T19:11:23.764Z","categories":["55773a5ca042551900b002cf","55773a6ce6063e0d00481380","55773ab007e7110d001043ec","55773abaa042551900b002d5","55773ac207e7110d001043ed","55773acb07e7110d001043ee","55773ad3a042551900b002d6","55773adce6063e0d00481383","55773ae4a042551900b002d7","55773af307e7110d001043ef","55773af907e7110d001043f0","55773b0407e7110d001043f1","563a4f7ad25e8919005f3f39","563a4fcaa19edf0d00972321","564a70dc4cd0521700523edf","564b797bcc472d0d00da9435","564b855b766d4923004e1fd1","59cd4b81935249001c77c48e"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"Motherboard","version_clean":"1.0.0","version":"1"},"user":"546d17e2eb9cfd1400dd4529","editedParams2":true,"parentDoc":null,"category":{"_id":"55773ac207e7110d001043ed","version":"55773a5ba042551900b002ce","__v":31,"pages":["55776bbce6063e0d00481401","564b7a4e1ed5c823003eb64b","564b7c0fdda79a19000f2653","564b7c2385e4e92b00fb4f8a","564b7c2edda79a19000f2656","564b7c394f06ef2b006b08a5","564b7c6b85e4e92b00fb4f8c","564b7c791ed5c823003eb64f","564b7c83cc472d0d00da943d","564b7c8f766d4923004e1fbc","564b7ca385e4e92b00fb4f8f","564b7cb21ed5c823003eb654","564b7ccb766d4923004e1fbf","564b7cdf766d4923004e1fc1","564b7ceecc472d0d00da9440","564b7d014f06ef2b006b08a8","564b7d201ed5c823003eb656","564b7d2ee323d01700a51340","564b7d3b1ed5c823003eb658","564b7d4be323d01700a51344","564b7d5ee323d01700a51346","564b7d73cc472d0d00da9442","564b7d8adda79a19000f265a","564b7e0b85e4e92b00fb4f92","564b7e1be323d01700a51348","564b7e2b1ed5c823003eb65a","564b7e3f766d4923004e1fc4","564b7e4fdda79a19000f265c","564b7e5a766d4923004e1fc6","56eb12a90e62750e0060d027","56f184bf3af4942b00bb3c33"],"project":"55773a5ba042551900b002cb","sync":{"url":"","isSync":false},"reference":true,"createdAt":"2015-06-09T19:13:06.237Z","from_sync":false,"order":3,"slug":"events-api","title":"Events API"},"editedParams":true,"__v":2,"project":"55773a5ba042551900b002cb","updates":[],"next":{"pages":[],"description":""},"createdAt":"2015-11-17T19:20:59.657Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"examples":{"codes":[]},"method":"post","results":{"codes":[{"status":200,"name":"","code":"{\n   \"code\":200,\n   \"status\":\"success\",\n   \"data\":{\n      \"athlete_id\":40887,\n      \"athlete_title\":\"Gwen Jorgensen\",\n      \"athlete_slug\":\"gwen_jorgensen\",\n      \"athlete_first\":\"Gwen\",\n      \"athlete_last\":\"Jorgensen\",\n      \"athlete_country_id\":293,\n      \"athlete_gender\":\"female\",\n      \"athlete_yob\":\"1986\",\n      \"validated\":false,\n      \"athlete_profile_image\":\"http:\\/\\/www.triathlon.org\\/images\\/athlete_thumbs\\/Gwen_Jorgensen2.jpg\",\n      \"athlete_noc\":\"USA\",\n      \"athlete_country_name\":\"United States\",\n      \"athlete_country_isoa2\":\"US\",\n      \"athlete_listing\":\"http:\\/\\/www.triathlon.org\\/athletes\\/profile\\/40887\\/gwen_jorgensen\",\n      \"athlete_flag\":\"https:\\/\\/f9ca11ef49c28681fc01-0acbf57e00c47a50e70a1acb89e86c89.ssl.cf1.rackcdn.com\\/images\\/icons\\/us.png\",\n      \"athlete_api_listing\":\"https:\\/\\/api.triathlon.org\\/v1\\/v1\\/athletes\\/40887\",\n      \"athlete_categories\":[\n         42\n      ],\n      \"splits\":[\n         \"00:19:25\",\n         \"00:00:28\",\n         \"01:03:06\",\n         \"00:00:26\",\n         \"00:33:35\"\n      ],\n      \"result_id\":476317,\n      \"position\":1,\n      \"total_time\":\"01:56:59\",\n      \"start_num\":2\n   }\n}","language":"json"}]},"settings":"","auth":"required","params":[{"_id":"5658c62f8752730d0076242d","ref":"","in":"path","required":true,"desc":"The unique id of the event to be edited","default":"","type":"int","name":"event_id"},{"_id":"5658c62f8752730d0076242c","ref":"","in":"path","required":true,"desc":"The unique id of the program to be edited","default":"","type":"int","name":"prog_id"},{"_id":"56f2cddd4a8dae0e009ab2b5","ref":"","in":"body","required":true,"desc":"A result object containing the result data for a program","default":"","type":"object","name":"results"}],"url":"/events/:event_id/programs/:prog_id/results"},"isReference":true,"order":26,"body":"The **Create Program Result** method creates a program result provided by the `results` object. You may pass a single result object or an array of objects to create multiple results. A basic result object is returned or an array of basic results objects where multiple results are sent. \n\nThe body of a request for a single result should be of the following form. The `splits` array should contain the split data in the form of the results [headers](https://developers.triathlon.org/docs/program-results#split-headers). In the future in addition to `splits` a `timing` object will contain all split data recorded by the timer.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n   \\\"athlete_id\\\":12345,\\n   \\\"position\\\":1,\\n   \\\"total_time\\\":\\\"01:56:59\\\",\\n   \\\"splits\\\":[\\n      \\\"00:19:25\\\",\\n      \\\"00:00:28\\\",\\n      \\\"01:03:06\\\",\\n      \\\"00:00:26\\\",\\n      \\\"00:33:35\\\"\\n   ]\\n}\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]\nThe method validates that the `athlete_id` is valid and an existing program entry exists for the athlete else a validation error will be thrown. All validation checks are handled before any results are processed.","excerpt":"","slug":"create-program-result","type":"endpoint","title":"Create Program Result"}

postCreate Program Result


Definition

{{ api_url }}{{ page_api_url }}

Parameters

Path Params

event_id:
required
integer
The unique id of the event to be edited
prog_id:
required
integer
The unique id of the program to be edited

Body Params

results:
required
object
A result object containing the result data for a program

Result Format


Documentation

The **Create Program Result** method creates a program result provided by the `results` object. You may pass a single result object or an array of objects to create multiple results. A basic result object is returned or an array of basic results objects where multiple results are sent. The body of a request for a single result should be of the following form. The `splits` array should contain the split data in the form of the results [headers](https://developers.triathlon.org/docs/program-results#split-headers). In the future in addition to `splits` a `timing` object will contain all split data recorded by the timer. [block:code] { "codes": [ { "code": "{\n \"athlete_id\":12345,\n \"position\":1,\n \"total_time\":\"01:56:59\",\n \"splits\":[\n \"00:19:25\",\n \"00:00:28\",\n \"01:03:06\",\n \"00:00:26\",\n \"00:33:35\"\n ]\n}", "language": "json" } ] } [/block] The method validates that the `athlete_id` is valid and an existing program entry exists for the athlete else a validation error will be thrown. All validation checks are handled before any results are processed.

User Information

Try It Out

post
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}