{"id":19798387,"url":"https://github.com/hamdle/php-api","last_synced_at":"2026-06-14T10:33:23.302Z","repository":{"id":116864470,"uuid":"229515690","full_name":"hamdle/php-api","owner":"hamdle","description":"API framework for workout app","archived":false,"fork":false,"pushed_at":"2022-04-22T16:28:39.000Z","size":252,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-28T16:41:17.985Z","etag":null,"topics":["api","php"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hamdle.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-12-22T04:00:34.000Z","updated_at":"2022-05-10T22:38:21.000Z","dependencies_parsed_at":null,"dependency_job_id":"d4f9303a-7c6b-4e47-8990-2bf48d106054","html_url":"https://github.com/hamdle/php-api","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/hamdle/php-api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hamdle%2Fphp-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hamdle%2Fphp-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hamdle%2Fphp-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hamdle%2Fphp-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hamdle","download_url":"https://codeload.github.com/hamdle/php-api/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hamdle%2Fphp-api/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34318523,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-14T02:00:07.365Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","php"],"created_at":"2024-11-12T07:29:10.856Z","updated_at":"2026-06-14T10:33:23.282Z","avatar_url":"https://github.com/hamdle.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Workout API\n\nThe Workout API is designed to track workouts that I've been doing for the past few years. There's an accompanying web application that manages all of the user facing interactions --- user login and exercise tracking during workouts --- that works in collaboration with the API. The API has been designed to model the workout data that is required to log and track my exercies. \n\n# Nginx setup\n\nTo route the API through the URI, like `workout.dev/api`, place the following in the nginx config.\n\n```\nlocation /api {\n    try_files $uri $uri/ /api/index.php?query_string;\n}\n```\n\n# API\n\nThis API communicates in JSON and attepts to respond in a RESTful way.\n\n### Status codes\n\nCode | Message\n---- | -------\n200  | GET, PUT, or PATCH Success\n201  | POST Success\n204  | DELETE Success\n400  | Bad request\n401  | Unauthorized\n403  | Forbidden\n404  | Not found\n422  | Unprocessable Entity\n500  | Internal Server Error\n\n### POST /login\n\nAuthenticate a user login request by returning a success or failure code.\n\n#### Request\n\n```\n{\n    'user': 'admin@localhost.com',\n    'password': 'password123'\n}\n```\n\n#### Response\n\nSuccess code: 201\n\nForm validation failure: 422\n\nFailure code: 401\n\n### GET /auth\n\nVerify that a cookie is valid and matches the user creds.\n\n#### Request\n\nNo extra data needed. In browsers, the cookie will be send automatically.\n\n#### Response\n\nSuccess code: 200\n\nFailure code: 401\n\n\n### GET /exercises\n\nReturn a list of all exercises and their default values.\n\n#### Request\n\nNo extra data needed.\n\n#### Response\n\nSuccess code: 200\n\nBody: a list of exercises\n\n```\n[\n    {\"id\":\"1\",\"title\":\"Warm Up\",\"default_sets\":\"1\",\"default_reps\":\"1\",\"wait_time\":\"0\",\"category\":\"warm\"},\n    {\"id\":\"2\",\"title\":\"Pull Ups\",\"default_sets\":\"2\",\"default_reps\":\"5\",\"wait_time\":\"60\",\"category\":\"pull\"},\n    ...\n]\n```\n\n### GET /version\n\nReturn the current version of the API. Good for a quick ping to make sure everything is okay.\n\n#### Request\n\nNo extra data needed.\n\n#### Response\n\nSuccess code: 200\n\nBody: the current version of the API \n\n```\n{'version': \"1.0\"}\n```\n\n### POST /workouts/new\n\nAdd a new workout that a user has completed.\n\n#### Request\n\n```\n{\n    'start': null,\n    'end': null,\n    'notes': null,\n    'feel': null,\n    'exercises': [\n        {\n            'exercise_type_id': null,\n            'sets': null,\n            'reps': [\n                {\n                    'amount': null\n                },\n                {\n                    'amount': null\n                },\n            ],\n            'feedback': null\n        },\n        {\n            'exercise_type_id': null,\n            'sets': null,\n            'reps': [\n                {\n                    'amount': null\n                },\n                {\n                    'amount': null\n                },\n            ],\n            'feedback': null\n        },\n        ...\n    ]\n}\n```\n\n#### Response\n\nSuccess code: 201\n\nForm validation failure: 422\n\nFailure code: 400\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhamdle%2Fphp-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhamdle%2Fphp-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhamdle%2Fphp-api/lists"}