No change
TrainerDay public API To use the API, you will need the application credentials provided to you by TrainerDay.
All API requests require a valid OAuth token that identifies the application and the user account under which the application is accessing data.
All calls to the oAuth2 API TrainerDay require an "access token" that identifies the user and application making the call.
To get an access token, you need to register an application. A registered application will be assigned a client ID and client secret.
You must never reveal your secret using it for authorization.
To get application credentials, fill out the form HERE
Each application is assigned a client_id and client_secret and scopes. Your application can then request authorization for a user. Once a user has granted authorization, you will receive access token and a refresh token for each user. The access token is used by your application to make requests until it expires and the refresh token is used to get an un updated access token.
The access token must be valid.
Requests must be made over an HTTPS connection and include an authorization header "Bearer {your access token}"
Authorization: Bearer eyJhbGciOiJIUz...
Make GET request to authorize endpoint with following parameters.
The user will be redirected to the TrainerDay authentication process.
After authorizing and providing scopes, the request will be redirected back to the redirect_uri passed with the authorization code as a URL request parameter.
Example: http://test.com/callback?code=123
Params:
Once you have the authorization code, you must make another request to obtain an access token. The authorization code is only valid for approximately 30 seconds.
Body:
Response, JSON
{
"access_token": "aph6jiiwsvgyt9j4fohayegypbo65f8fpjodpdckuiqho0p4wf",
"expires_in": 3600,
"token_type": "Bearer",
"scope": "calendar:read",
"refresh_token": "g1b4cph2kjnwojzofajvqsfzb2oltjthtermizvlnzsaqjl2o9"
}
Body:
Response, JSON
{
"access_token": "aph6jiiwsvgyt9j4fohayegypbo65f8fpjodpdckuiqho0p4wf",
"expires_in": 3600,
"token_type": "Bearer",
"scope": "calendar:read",
"refresh_token": "g1b4cph2kjnwojzofajvqsfzb2oltjthtermizvlnzsaqjl2o9"
}
Body: