[READ-ONLY] Mirror of https://github.com/glacials/splits-io. a speedrunning data store and analysis engine splits.io
splits-io docs api.md
79 kB · 1,169 lines
Markdown

# API v4 The Splits.io API supports retrieving runs, runners, games, and categories, as well as uploading, disowning, and deleting runs and managing races. ## Authentication & authorization ### Simple auth (run uploads only) If the only thing you need to do on behalf of users is upload runs, you can do so anonymously then send the user to the "claim URI" in the response's `uris.claim_uri` field. Sending a logged-in user here will cause the run to be claimed to their account. Sending a logged-out user here will save the secret to browser local storage and prompt the user to sign in to claim the run. They may do so immediately or at any later time. The user must open the claim URI in their web browser for it to become theirs. If you need to upload runs without this user intervention or want to do more with auth than uploading runs, use the OAuth option. ### OAuth (general purpose) Splits.io supports the standard OAuth2 flow. You can request permission from the user to upload runs to their account or perform other actions on their behalf. If they accept, you will receive an OAuth token which you can include in your API requests in order to perform actions as that user. The following instructions go into naive-case details about implementing this OAuth support in your application. If you want to learn more about OAuth or need general OAuth troubleshooting help, you can [research OAuth2 online][oauth2-simplified]. Especially if your application is a website, it's likely that the language you're using has well-established libraries that handle much of the below OAuth flow for you. Look into those solutions first to take the gruntwork out. In all cases, you'll need to first go to your Splits.io account's [settings page][1] and create an application, then refer to the relevant section below. *Note: Once you have an OAuth token, you can use a request like this to retrieve information about it:* ```http GET https://splits.io/oauth/token/info?access_token=YOUR_TOKEN ``` [oauth2-simplified]: https://aaronparecki.com/…