{"id":20410968,"url":"https://github.com/omkz/rails-both-web-api-example","last_synced_at":"2026-05-10T05:02:09.583Z","repository":{"id":143504741,"uuid":"72406144","full_name":"omkz/rails-both-web-api-example","owner":"omkz","description":"Building a RESTful API with Rails 5 for web and mobile application","archived":false,"fork":false,"pushed_at":"2017-01-27T19:36:53.000Z","size":35,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-05T03:15:50.374Z","etag":null,"topics":["api","rails","restful","restful-api","ruby","rubyonrails"],"latest_commit_sha":null,"homepage":"","language":"Ruby","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/omkz.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":"2016-10-31T05:51:47.000Z","updated_at":"2018-10-05T02:15:17.000Z","dependencies_parsed_at":null,"dependency_job_id":"99af3b03-74c0-4a87-858a-168d768bb586","html_url":"https://github.com/omkz/rails-both-web-api-example","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/omkz/rails-both-web-api-example","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/omkz%2Frails-both-web-api-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/omkz%2Frails-both-web-api-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/omkz%2Frails-both-web-api-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/omkz%2Frails-both-web-api-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/omkz","download_url":"https://codeload.github.com/omkz/rails-both-web-api-example/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/omkz%2Frails-both-web-api-example/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271405572,"owners_count":24753799,"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","status":"online","status_checked_at":"2025-08-20T02:00:09.606Z","response_time":69,"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","rails","restful","restful-api","ruby","rubyonrails"],"created_at":"2024-11-15T05:49:11.343Z","updated_at":"2026-05-10T05:02:09.483Z","avatar_url":"https://github.com/omkz.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# how to use this app\n\n#### migrate the database:\n\n`\n➜ rails db:migrate\n`\n\n#### create Base64 encoded string of this user’s username and password. Open up your rails console and type in the following (see db/seeds.rb, I have inserted data into the database there)\n\n`\nirb(main):001:0\u003e Base64.encode64(\"omz@gmail.com:rahasia\")\n`\n\nreturn:\n\n=\u003e \"b216QGdtYWlsLmNvbTpyYWhhc2lh\\n\"\n\n#### run our initial request to get a valid token with cURL:\n\n`\n➜ curl http://localhost:3000/token -H 'Authorization: Basic b216QGdtYWlsLmNvbTpyYWhhc2lh\\n'                                   ` \n\nthe output:\n\n{\"token\":\"6980f982ab9fef7171999600187427fd\"}% \n\n#### submit request with token and get data:\n\n`\n➜ curl http://localhost:3000/api/v1/posts/1 -H 'Authorization: Token token=6980f982ab9fef7171999600187427fd'\n` \n\nthe output:\n\n{\"id\":1,\"title\":\"First Post\",\"body\":\"An Airplane\",\"created_at\":\"2017-01-27T18:47:56.923Z\",\"comments\":[]}%       \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fomkz%2Frails-both-web-api-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fomkz%2Frails-both-web-api-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fomkz%2Frails-both-web-api-example/lists"}