{"id":15747420,"url":"https://github.com/iamnotstatic/pat-test","last_synced_at":"2026-01-11T09:40:00.678Z","repository":{"id":110450678,"uuid":"297734014","full_name":"iamnotstatic/pat-test","owner":"iamnotstatic","description":null,"archived":false,"fork":false,"pushed_at":"2020-09-23T12:24:32.000Z","size":3463,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-06T10:53:16.903Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/iamnotstatic.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2020-09-22T18:15:17.000Z","updated_at":"2020-09-23T12:24:34.000Z","dependencies_parsed_at":null,"dependency_job_id":"0f4cd4ca-a35e-45e7-aca8-bf9256fd892f","html_url":"https://github.com/iamnotstatic/pat-test","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iamnotstatic%2Fpat-test","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iamnotstatic%2Fpat-test/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iamnotstatic%2Fpat-test/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iamnotstatic%2Fpat-test/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/iamnotstatic","download_url":"https://codeload.github.com/iamnotstatic/pat-test/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246426553,"owners_count":20775394,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":[],"created_at":"2024-10-04T05:20:17.050Z","updated_at":"2026-01-11T09:40:00.671Z","avatar_url":"https://github.com/iamnotstatic.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# API Documentation\n\n\u003ca href=\"#\"\u003e\u003cimg src=\"https://github.com/laravel/framework/workflows/tests/badge.svg\" alt=\"Build Status\"\u003e\u003c/a\u003e\n\u003ca href=\"https://github.com/iamnotstatic/pat-test/blob/master/reports/index.html\"\u003e![coverage](https://img.shields.io/badge/coverage-75%25-yellowgreen)\u003c/a\u003e\n\n\nThis API uses `POST` and `GET` request to communicate and HTTP [response codes](https://en.wikipedia.org/wiki/List_of_HTTP_status_codes) to indenticate status and errors. All responses come in standard JSON. All requests must include a `content-type` of `application/json` and the body must be valid JSON.\n\n## Package for API Authentication\n\nLaravel Passport for API authentication https://github.com/laravel/passport\n\n## Documentation URL\n\nhttps://patricia-test-example.herokuapp.com/api/documentation\n\n## APP URL\n\nhttps://patricia-test-example.herokuapp.com\n\n## Response Codes\n\n### Response Codes\n\n```\n200: Success\n400: Bad request\n401: Unauthorized\n404: Cannot be found\n405: Method not allowed\n422: Unprocessable Entity\n50X: Server Error\n```\n\n### Error Codes Details\n\n```\n100: Bad Request\n110: Unauthorized\n120: User Authenticaion Invalid\n130: Parameter Error\n140: Item Missing\n150: Conflict\n160: Server Error\n```\n\n## Register\n\n**You send:** Your Registration datail.\n**You get:** An `API-Token` with wich you can make further actions.\n\n**Request:**\n\n```json\nPOST /api/v1/register HTTP/1.1\nAccept: application/json\nContent-Type: application/json\n\n{\n    \"name\": \"foo\",\n    \"email\": \"example\",\n    \"password\": \"1234567\",\n    \"password_confirmation\": \"1234567\"\n}\n```\n\n**Successful Response:**\n\n```json\nHTTP/1.1 201 Created\nServer: My RESTful API\nContent-Type: application/json\n\n{\n    \"data\": {\n        \"status\": true,\n        \"message\": \"Account created successfully!\",\n        \"token\": \"eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdWQiOiIzIiwianRpIjoiOWZmMzVjNzA3ZGI5NGJmMmIyNzQ5MzczMWM1Yjg3MzRlOTBmN2RhN\",\n        \"token_type\": \"Bearer\"\n    }\n}\n```\n\n**Failed Response:**\n\n```json\nHTTP/1.1 400 Bad Request\nServer: RESTful API\nContent-Type: application/json\n\n{\n    \"message\": \"Validation errors\",\n    \"errors\": {\n        \"email\": [\n            \"The email has already been taken.\"\n        ]\n    },\n    \"status\": false\n}\n```\n\n## Login\n\n**You send:** Your login credentials.\n**You get:** An `API-Token` with wich you can make further actions.\n\n**Request:**\n\n```json\nPOST /api/v1/login HTTP/1.1\nAccept: application/json\nContent-Type: application/json\n\n{\n    \"username\": \"foo\",\n    \"password\": \"1234567\"\n}\n```\n\n**Successful Response:**\n\n```json\nHTTP/1.1 200 OK\nServer: My RESTful API\nContent-Type: application/json\n\n{\n    \"data\": {\n        \"status\": true,\n        \"token\": \"eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdWQiOiIzIiwianRpIjoiMzAxY2VlMGM2ODk4NWE3ZDY5NzZiMzMxM2ZhZDI1ZDk2ODFiMzg0MWVmODc0MzExNDkzZjMyMDZhMDNiMzI0Z\",\n        \"token_type\": \"Bearer\"\n    }\n}\n```\n\n**Failed Response:**\n\n```json\nHTTP/1.1 401 Unauthorized\nServer: RESTful API\nContent-Type: application/json\n\n{\n    \"error\": \"Invalid Credentials\",\n    \"status\": false\n}\n```\n\n## Get User Details\n\n**You send:** Your Pass the Authorization Token as Header to authenticate.\n**You get:** User details.\n\n**Request:**\n\n```json\nPOST /api/v1/user/data HTTP/1.1\nAccept: application/json\nContent-Type: application/json\n\n```\n\n**Successful Response:**\n\n```json\nHTTP/1.1 200 OK\nServer: RESTful API\nContent-Type: application/json\n\n{\n    \"user\": {\n        \"id\": 11,\n        \"name\": \"example\",\n        \"email\": \"example@gmail.com\",\n        \"last_logged_in\": \"2020-09-22 19:16:11\",\n        \"created_at\": \"2020-09-22T17:55:47.000000Z\",\n        \"updated_at\": \"2020-09-22T19:16:11.000000Z\"\n    },\n    \"success\": true\n}\n```\n\n**Failed Response:**\n\n```json\nHTTP/1.1 401 Unauthorized\nServer: RESTful API\nContent-Type: application/json\n\nUnauthorized.\n```\n\n## Logout\n\n**You send:** Your Pass the Authorization Token as Header to authenticate.\n**You get:** Logout Message.\n\n**Request:**\n\n```json\nPOST /api/v1/logout HTTP/1.1\nAccept: application/json\nContent-Type: application/json\n\n```\n\n**Successful Response:**\n\n```json\nHTTP/1.1 200 OK\nServer: RESTful API\nContent-Type: application/json\n\n{\n    \"message\": \"Successfully logged out\",\n    \"succes\": true\n}\n```\n\n**Failed Response:**\n\n```json\nHTTP/1.1 401 Unauthorized\nServer: RESTful API\nContent-Type: application/json\n\nUnauthorized.\n```\n\n## To run the Test\n\n### Register\n\n```php\nvendor/bin/phpunit --filter=testNewUserRegistration\n```\n\n### Login\n\n```php\nvendor/bin/phpunit --filter=testUserLogin\n```\n\n### Get User Data\n\n```php\nvendor/bin/phpunit --filter=testGetUserData\n```\n\n### Log User Out\n\n```php\nvendor/bin/phpunit --filter=testLogUserOut\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiamnotstatic%2Fpat-test","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fiamnotstatic%2Fpat-test","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiamnotstatic%2Fpat-test/lists"}