NAV
shell php javascript

Introduction

Welcome to the Spincast API documentation.

We have language bindings in Shell, PHP, and JavaScript! You can view code examples in the dark area to the right, and you can switch the programming language of the examples with the tabs in the top right.

Authentication

Authorization header example:

Copy to Clipboard
curl "api_endpoint_here" \ --header "Authorization: Bearer qwertyuiopasdfghjkl"

Make sure to replace qwertyuiopasdfghjkl with your API key.

Spincast uses API keys to allow access to the API. An API key can be obtained by registering for an account and creating a key.

Spincast expects the API key to be included in all API requests to the server in an Authorization header as a Bearer token:

Authorization: Bearer qwertyuiopasdfghjkl

User

Get Current User

Copy to Clipboard
curl --location --request GET 'https://api.spincast.io/api/v1/users' \ --header 'Authorization: Bearer 36|Krc1ED0YfBamYWmyH2aoueoxdCNzjVc4IEgfaiOy'

The above command returns JSON structured like this:

Copy to Clipboard
{ "data": [ { "type": "users", "id": "1", "attributes": { "name": "John Doe", "email": "johnDown@sometld.com", "created_at": "2021-12-30 22:30:40", "updated_at": "2021-12-30 22:50:36" }, "links": { "self": "https://api.spincast.io/api/v1/users/1" } } ] }

Retrieve the current user (identified by API Key).

HTTP Request

GET https://api.spincast.io/api/v1/users

Workout

Get Workouts

Copy to Clipboard
curl --location --request GET 'https://api.spincast.io/api/v1/workouts' \ --header 'Accept: application/vnd.api+json' \ --header 'Content-Type: application/vnd.api+json' \ --header 'Authorization: Bearer 36|Krc1ED0YfBamYWmyH2aoueoxdCNzjVc4IEgfaiOy'

The above command returns JSON structured like this:

Copy to Clipboard
{ "data": [ { "type": "workouts", "id": "181", "attributes": { "createdAt": "2021-12-17T05:40:41.000000Z", "updatedAt": "2021-12-17T05:40:41.000000Z", "pelotonId": "e43bfda89ab541ae97821f295a8b1903" }, "links": { "self": "https://api.spincast.io/api/v1/workouts/181" } }, { "type": "workouts", "id": "182", "attributes": { "createdAt": "2021-12-17T05:40:41.000000Z", "updatedAt": "2021-12-17T05:40:41.000000Z", "pelotonId": "5c01724c4cca4bbf90bc2e0815360855" }, "links": { "self": "https://api.spincast.io/api/v1/workouts/182" } } ] }

Retrieve all the workouts for the current user (identified by API Key).

HTTP Request

GET http://api.spincast.io/api/v1/workouts

Queue Workout

Copy to Clipboard
curl --location --request POST 'https://api.spincast.io/queue/181' \ --header 'Accept: application/vnd.api+json' \ --header 'Content-Type: application/vnd.api+json' \ --header 'Authorization: Bearer 36|Krc1ED0YfBamYWmyH2aoueoxdCNzjVc4IEgfaiOy'

The above command returns JSON structured like this:

Copy to Clipboard

Requeue a workout to be sent to Zapier.

Parameter Required Description
id true workout identifier

HTTP Request

POST https://api.spincast.io/queue/{workout.id}