{"id":18785716,"url":"https://github.com/dbackowski/api-example","last_synced_at":"2025-12-21T22:30:16.820Z","repository":{"id":139747419,"uuid":"485392366","full_name":"dbackowski/api-example","owner":"dbackowski","description":null,"archived":false,"fork":false,"pushed_at":"2022-05-05T18:59:07.000Z","size":22,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-12-29T12:41:05.040Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/dbackowski.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":"2022-04-25T13:54:08.000Z","updated_at":"2022-04-25T13:54:45.000Z","dependencies_parsed_at":"2023-04-21T17:30:40.045Z","dependency_job_id":null,"html_url":"https://github.com/dbackowski/api-example","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/dbackowski%2Fapi-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dbackowski%2Fapi-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dbackowski%2Fapi-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dbackowski%2Fapi-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dbackowski","download_url":"https://codeload.github.com/dbackowski/api-example/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239702053,"owners_count":19683031,"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-11-07T20:49:30.409Z","updated_at":"2025-12-21T22:30:16.754Z","avatar_url":"https://github.com/dbackowski.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"Simple example of rails application for API.\n\nRun in the console:\n\n```\nrails s\n```\n\nNext you can play with it using curl command, examples:\n\n### Tokens endpoint\n\n- with valid params\n\n```\ncurl -d '{\"first_name\":\"John\", \"last_name\":\"Doe\"}' -H \"Content-Type: application/json\" -H \"Authorization: Bearer XXX\" -X POST http://localhost:3000/tokens.json | jq\n```\n\n```\n{\n  \"first_name\": \"John\",\n  \"last_name\": \"Doe\"\n}\n```\n\n- with invalid params\n\n```\ncurl -d '{\"last_name\":\"Doe\"}' -H \"Content-Type: application/json\" -H \"Authorization: Bearer XXX\" -X POST http://localhost:3000/tokens.json | jq\n```\n\n```\n[\n  \"First name can't be blank\"\n]\n```\n\n- with missing authorization header\n\n```\ncurl -v -d '{\"first_name\":\"John\", \"last_name\":\"Doe\"}' -H \"Content-Type: application/json\" -X POST http://localhost:3000/tokens.json | jq\n```\n\n```\n\u003e POST /tokens.json HTTP/1.1\n\u003e Host: localhost:3000\n\u003e User-Agent: curl/7.79.1\n\u003e Accept: */*\n\u003e Content-Type: application/json\n\u003e Content-Length: 40\n\u003e\n} [40 bytes data]\n* Mark bundle as not supporting multiuse\n\u003c HTTP/1.1 403 Forbidden\n\u003c X-Frame-Options: SAMEORIGIN\n\u003c X-XSS-Protection: 0\n\u003c X-Content-Type-Options: nosniff\n\u003c X-Download-Options: noopen\n\u003c X-Permitted-Cross-Domain-Policies: none\n\u003c Referrer-Policy: strict-origin-when-cross-origin\n\u003c Content-Type: application/json\n\u003c Cache-Control: no-cache\n\u003c X-Request-Id: 5b4f0986-de9c-473d-a1da-a2210a8ad1aa\n\u003c X-Runtime: 0.004600\n\u003c Server-Timing: start_processing.action_controller;dur=0.070068359375, process_action.action_controller;dur=0.21484375\n\u003c Transfer-Encoding: chunked\n```\n\n```\ncurl -d '{\"first_name\":\"John\", \"last_name\":\"Doe\"}' -H \"Content-Type: application/json\" -H \"Authorization: Bearer XXX\" -X POST http://localhost:3000/tokens.json | jq\n```\n### Transactions endpoint\n\n- with valid params\n\n```\ncurl -d '{\"token\":\"tok_123\", \"currency\": \"USD\", \"amount\": 1000}' -H \"Content-Type: application/json\" -H \"Authorization: Bearer XXX\" -X POST http://localhost:3000/transactions.json | jq\n```\n\n```\n{\n  \"token\": \"tok_123\",\n  \"currency\": \"USD\",\n  \"amount\": 1000\n}\n```\n\n- with invalid params\n\n```\ncurl -d '{\"token\":\"tok_123\", \"currency\": \"USD\"}' -H \"Content-Type: application/json\" -H \"Authorization: Bearer XXX\" -X POST http://localhost:3000/transactions.json | jq\n```\n\n```\n[\n  \"Amount can't be blank\"\n]\n```\n\n- with missing authorization header\n\n```\ncurl -v -d '{\"first_name\":\"John\", \"last_name\":\"Doe\"}' -H \"Content-Type: application/json\" -X POST http://localhost:3000/transactions.json | jq\n```\n\n```\n\u003e POST /transactions.json HTTP/1.1\n\u003e Host: localhost:3000\n\u003e User-Agent: curl/7.79.1\n\u003e Accept: */*\n\u003e Content-Type: application/json\n\u003e Content-Length: 40\n\u003e\n} [40 bytes data]\n* Mark bundle as not supporting multiuse\n\u003c HTTP/1.1 403 Forbidden\n\u003c X-Frame-Options: SAMEORIGIN\n\u003c X-XSS-Protection: 0\n\u003c X-Content-Type-Options: nosniff\n\u003c X-Download-Options: noopen\n\u003c X-Permitted-Cross-Domain-Policies: none\n\u003c Referrer-Policy: strict-origin-when-cross-origin\n\u003c Content-Type: application/json\n\u003c Cache-Control: no-cache\n\u003c X-Request-Id: 6ce77971-64d1-4c16-b2b4-90ea59074151\n\u003c X-Runtime: 0.003793\n\u003c Server-Timing: start_processing.action_controller;dur=0.112060546875, process_action.action_controller;dur=0.19873046875\n\u003c Transfer-Encoding: chunked\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdbackowski%2Fapi-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdbackowski%2Fapi-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdbackowski%2Fapi-example/lists"}