WorkOutch Application Programming Interface

Authentication

The WorkOutch API authenticated requests require an access token. These tokens are unique to a user. Access tokens will be visible into the current page if user is logged in.

WorkOutch Database Entities Access

In order to provide the possibility for integration of exercises and workouts to other workout applications WorkOutch provides 2 types of GET requests to the server.

Get Exercise

WorkOutch API allows extracting information about exercises uploaded by its users. To get the information you need, please, use the request below.

Get Request

https://workoutch.com/api/getexercise/{ACCESS_TOKEN}/{EXERCISE_ID}

In case of approved request (valid Access token and exercise ID), you will receive the following result:

Valid Request

{
    "RequestResult": {
        "AccessToken": "8f44ea81cf0a499411118c7c757dc9f6",
        "RequestCode": 1,
        "SuccessMessage": "Valid Exercise Request",
        "Exercise": {
            "Id": 567,
            "Name": "Test Name",
            "Description": "Test Description",
            "MuscleGroups": [{
                "MuscleGroupId": 5,
                "MuscleGroupName": "Trapezius"
            }],
            "Categories": [{
                "CategoryId": 3,
                "CategoryName": "Balance"
            }],
            "Intensity": {
                "IntensityId": 1,
                "IntensityName": "Low"
            },
            "YouTubeUrl": null,
            "Images": [{
                "ImageId": 1,
                "ImageUrl": "https://workoutch.com/Content/UploadImages/ce64aff615d09e1fae826afd83eb8421.jpg"
            }],
            "Rating": 0,
            "WorkOutchUrl": "https://workoutch.com/exercises/current/567",
            "OwnerName": "John Doe"
        }
    }
}

In case of invalid Access token, you will receive the following result:

Invalid Request - Invalid Access Token

{
	"RequestResult": {
		"RequestCode": -1,
		"ErrorMessage": "Invalid Access Token"
	}
}

In case of valid Access token and invalid exercise ID, you will receive the following result:

Invalid Request - Invalid Exercise Id

{
	"RequestResult": {
		"AccessToken": "75c5ee29b0ff78cc741f6afd00f4ac63",
		"RequestCode": 0,
		"ErrorMessage": "Invalid Exercise Id"
	}
}

Get Workout

WorkOutch API allows extracting information about workouts uploaded by its users. To get the information you need, please, use the request below.

Get Request

https://workoutch.com/api/getworkout/{ACCESS_TOKEN}/{WORKOUT_ID}

In case of approved request (valid Access token and workout ID), you will receive the following result:

Valid Request

{
    "RequestResult": {
        "AccessToken": "8f44ea81cf0a499411118c7c757dc9f6",
        "RequestCode": 1,
        "SuccessMessage": "Valid Workout Request",
        "Workout": {
            "Id": 1004,
            "Name": "Test Workout",
            "Description": "Test Description",
            "PrepareWorkout": {
                "NumberOfExercises": 1,
                "PrepareDescription": "Test Prepare Description",
                "Exercises": [{
                    "ExerciseId": 2025,
                    "ExerciseName": "Exercise 1",
                    "ExerciseExecution": "Reps",
                    "RepsNumber": 20,
                    "ExecutionDuration": {
                        "Ticks": 0,
                        "Days": 0,
                        "Hours": 0,
                        "Milliseconds": 0,
                        "Minutes": 0,
                        "Seconds": 0,
                        "TotalDays": 0,
                        "TotalHours": 0,
                        "TotalMilliseconds": 0,
                        "TotalMinutes": 0,
                        "TotalSeconds": 0
                    }
                }]
            },
            "CooldownWorkout": {
                "NumberOfExercises": 0,
                "CooldownDescription": "Test Cooldown Description",
                "Exercises": []
            },
            "WorkoutType": "SetWorkout",
            "CircuitWorkout": null,
            "SetWorkout": {
                "NumberOfExercises": 2,
                "RestBetweenExercises": {
                    "Hours": 0,
                    "Minutes": 4,
                    "Seconds": 0,
                    "Milliseconds": 0,
                    "Ticks": 2400000000,
                    "Days": 0,
                    "TotalDays": 0.0027777777777777775,
                    "TotalHours": 0.066666666666666666,
                    "TotalMilliseconds": 240000,
                    "TotalMinutes": 4,
                    "TotalSeconds": 240
                },
                "RestBetweenSets": {
                    "Hours": 0,
                    "Minutes": 2,
                    "Seconds": 0,
                    "Milliseconds": 0,
                    "Ticks": 1200000000,
                    "Days": 0,
                    "TotalDays": 0.0013888888888888887,
                    "TotalHours": 0.033333333333333333,
                    "TotalMilliseconds": 120000,
                    "TotalMinutes": 2,
                    "TotalSeconds": 120
                },
                "Exercises": [{
                    "NumberOfSets": 6,
                    "Exercise": {
                        "ExerciseId": 2027,
                        "ExerciseName": "Exercise A",
                        "ExerciseExecution": "Interval",
                        "RepsNumber": 0,
                        "ExecutionDuration": {
                            "Hours": 0,
                            "Minutes": 0,
                            "Seconds": 30,
                            "Milliseconds": 0,
                            "Ticks": 300000000,
                            "Days": 0,
                            "TotalDays": 0.00034722222222222218,
                            "TotalHours": 0.0083333333333333332,
                            "TotalMilliseconds": 30000,
                            "TotalMinutes": 0.5,
                            "TotalSeconds": 30
                        }
                    }
                }, {
                    "NumberOfSets": 8,
                    "Exercise": {
                        "ExerciseId": 2026,
                        "ExerciseName": "Exercise B",
                        "ExerciseExecution": "Reps",
                        "RepsNumber": 8,
                        "ExecutionDuration": {
                            "Hours": 0,
                            "Minutes": 0,
                            "Seconds": 0,
                            "Milliseconds": 0,
                            "Ticks": 0,
                            "Days": 0,
                            "TotalDays": 0,
                            "TotalHours": 0,
                            "TotalMilliseconds": 0,
                            "TotalMinutes": 0,
                            "TotalSeconds": 0
                        }
                    }
                }]
            },
            "TimeWorkout": null,
            "Rating": 0,
            "WorkOutchUrl": "https://workoutch.com/workouts/current/1004",
            "OwnerName": "John Doe"
        }
    }
}

In case of invalid Access token, you will receive the following result:

Invalid Request - Invalid Access Token

{
	"RequestResult": {
		"RequestCode": -1,
		"ErrorMessage": "Invalid Access Token"
	}
}

In case of valid Access token and invalid workout ID, you will receive the following result:

Invalid Request - Invalid Workout Id

{
	"RequestResult": {
		"AccessToken": "75c5ee29b0ff78cc741f6afd00f4ac63",
		"RequestCode": 0,
		"ErrorMessage": "Invalid Workout Id"
	}
}