{"id":16059376,"url":"https://github.com/maful/versafleet-ruby","last_synced_at":"2025-03-17T21:31:22.041Z","repository":{"id":46338138,"uuid":"405796202","full_name":"maful/versafleet-ruby","owner":"maful","description":"Ruby bindings for the VersaFleet API","archived":false,"fork":false,"pushed_at":"2023-03-16T16:00:18.000Z","size":64,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-16T14:56:26.448Z","etag":null,"topics":["api","faraday","hacktoberfest","ruby","rubygems"],"latest_commit_sha":null,"homepage":"","language":"Ruby","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/maful.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","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":"2021-09-13T01:30:58.000Z","updated_at":"2021-10-30T08:48:22.000Z","dependencies_parsed_at":"2024-10-10T22:45:47.318Z","dependency_job_id":null,"html_url":"https://github.com/maful/versafleet-ruby","commit_stats":{"total_commits":16,"total_committers":2,"mean_commits":8.0,"dds":0.0625,"last_synced_commit":"29c257aa0639e05337450a067e255a1049380d3f"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maful%2Fversafleet-ruby","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maful%2Fversafleet-ruby/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maful%2Fversafleet-ruby/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maful%2Fversafleet-ruby/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/maful","download_url":"https://codeload.github.com/maful/versafleet-ruby/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243885990,"owners_count":20363649,"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":["api","faraday","hacktoberfest","ruby","rubygems"],"created_at":"2024-10-09T04:00:49.401Z","updated_at":"2025-03-17T21:31:21.721Z","avatar_url":"https://github.com/maful.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# VersaFleet API\n\nYou'll need a VersaFleet account to use the API, if you don't have one visit the [VersaFleet](https://versafleet.co) website for more information.\n\n[![Build status](https://github.com/maful/versafleet-ruby/actions/workflows/test.yml/badge.svg?branch=main)](https://github.com/maful/versafleet-ruby/actions/workflows/test.yml) [![Gem Version](https://badge.fury.io/rb/versafleet.svg)](https://badge.fury.io/rb/versafleet)\n\n\u003e [Libur.run](https://github.com/maful/libur.run) - Empower Your HR with Next-Gen Open Source Self-Serve Platform\n\n## Installation\n\nAdd `versafleet` to your application's Gemfile:\n\n```bash\nbundle add versafleet\n\n# OR in the Gemfile\ngem \"versafleet\"\n```\n\n## Usage\n\nTo access the API, you'll need to create a `Versafleet::Client` and pass in your API Key and Secret Key. See [How to obtain API keys](https://versafleet.docs.apiary.io/#introduction/to-obtain-api-keys-(please-keep-them-safe!))\n\nNeed more details? See [VersaFleet API Documentation](https://rubydoc.info/gems/versafleet) to see how it works internally.\n\n```ruby\nclient = Versafleet::Client.new(client_id: ENV[\"CLIENT_ID\"], client_secret: ENV[\"CLIENT_SECRET\"])\n```\n\nThe client then gives you access to each of resources.\n\n## Resources\n\n### Jobs\n\n```ruby\n# list jobs with per page is 20\nclient.jobs.list(per_page: 20)\n# view the a job details\nclient.jobs.retrieve(job_id: \"id\")\n# create a job\nclient.jobs.create(job: {})\n# update job\nclient.jobs.update(job_id: \"id\", job: {})\n# cancel the job\nclient.jobs.cancel(job_id: \"id\")\n# list tasks of job\nclient.jobs.list_tasks(job_id: \"id\")\n```\n\n### Tasks\n\n```ruby\n# list all tasks\nclient.tasks.list\n# list all tasks by state\nclient.tasks.list_by_state(state: state)\n# get the task details\nclient.tasks.retrieve(task_id: task_id)\n# get the task by tracking id\nclient.tasks.retrieve_by_tracking_id(tracking_id: tracking_id)\n# update the task\nclient.tasks.update(task_id: task_id, task_attributes: {})\n# add a task to job\nclient.tasks.create(task_attributes: {})\n# assign task to driver\nclient.tasks.assign(task_id: task_id, task: {driver_id: driver_id, vehicle_id: vehicle_id, remarks: \"Notes\"})\n# assign multiple tasks to driver\nclient.tasks.assign_multiple(task: {ids: [], driver_id: driver_id, vehicle_id: vehicle_id, remarks: \"Notes\"})\n# unassign task\nclient.tasks.unassign(task_id: task_id)\n# unassign multiple tasks\nclient.tasks.unassign_multiple(task: {ids: []})\n# cancel the task\nclient.tasks.cancel(task_id: task_id)\n# complete the task\nclient.tasks.complete(task_id: task_id)\n# incomplete the task\nclient.tasks.incomplete(task_id: task_id)\n# set state to the task\nclient.tasks.set_state(task_id: task_id, to_state: to_state)\n# archive the task\nclient.tasks.archive(task_id: task_id)\n# unarchive the task\nclient.tasks.unarchive(task_id: task_id)\n# allocate task to transporter\nclient.tasks.allocate(task_id: task_id, sub_account_id: sub_account_id)\n# get the task completion histories\nclient.tasks.completion_histories(task_id: task_id)\n# get the base task completion histories\nclient.tasks.base_completion_histories(task_id: task_id)\n```\n\n### Drivers\n\n```ruby\n# list drivers\nclient.drivers.list\n# get a driver details\nclient.drivers.retrieve(driver_id: driver_id)\n# create driver\nclient.drivers.create(driver: {name: \"Yolo\", dob: \"1990-09-09\"})\n# update driver\nclient.drivers.update(driver_id: driver_id, driver: {name: \"Yolo update\"})\n```\n\n### Vehicles\n\n```ruby\n# list vehicles\nclient.vehicles.list\n# get a vehicle details\nclient.vehicles.retrieve(vehicle_id: vehicle_id)\n# create vehicle\nclient.vehicles.create(vehicle: {plate_number: \"SK1212\", model: \"Honda\", speed: 50})\n# update vehicle\nclient.vehicles.update(vehicle_id: vehicle_id, vehicle: {model: \"Mercedes\", speed: 70})\n```\n\n### Runsheets\n\n```ruby\n# list runsheets by driver\nclient.runsheets.drivers_tasks(driver_id: driver_id)\n# filter runsheets by date\nclient.runsheets.drivers_tasks(driver_id: driver_id, date: \"2021-10-14\")\n# filter by date and state of the tasks\nclient.runsheets.drivers_tasks(driver_id: driver_id, date: \"2021-10-14\", state: \"successful\")\n```\n\n### Customers\n\n```ruby\n# list customers\nclient.customers.list\n# get a customer details\nclient.customers.retrieve(customer_id: customer_id)\n# create customer\nclient.customers.create(customer: {name: \"John Doe\", email: \"well@example.com\"})\n# update customer\nclient.customers.update(customer_id: customer_id, customer: {name: \"Bourne\"})\n```\n\n### Account\n\n```ruby\n# get account details\nclient.account.retrieve(account_id: account_id)\n# create an account\nclient.account.create(customer_id: customer_id, account: {name: \"Johhny\", email: \"john@example.com\"})\n# update account\nclient.account.update(account_id: account_id, account: {name: \"Bobby\"})\n# delete an account\nclient.account.delete(account_id: account_id)\n```\n\n## TO DO\n\n- [x] Add API Documentation ([#2](https://github.com/maful/versafleet-ruby/pull/2))\n- [ ] Add Docker support\n- [ ] Support to All VersaFleet API endpoints.\n\t- [x] Add Jobs V2 API\n\t- [x] Add Tasks API\n\t- [ ] Non-Authenticated Tracking API\n\t- [x] Add Runsheets API ([#5](https://github.com/maful/versafleet-ruby/pull/5))\n\t- [x] Add Drivers API ([#1](https://github.com/maful/versafleet-ruby/pull/1))\n\t- [x] Add Vehicles API ([#4](https://github.com/maful/versafleet-ruby/pull/4))\n\t- [x] Add Customers API ([#6](https://github.com/maful/versafleet-ruby/pull/6))\n\t- [x] Add Account API ([#8](https://github.com/maful/versafleet-ruby/pull/8))\n\n## 🙏 Contributing\n\nThis project uses Standard for formatting Ruby code. Please make sure to run standardrb before submitting pull requests. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/maful/versafleet-ruby/blob/master/CODE_OF_CONDUCT.md).\n\n## Code of Conduct\n\nEveryone interacting in the VersaFleet project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/maful/versafleet-ruby/blob/master/CODE_OF_CONDUCT.md).\n\n## License\n\nThe gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaful%2Fversafleet-ruby","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmaful%2Fversafleet-ruby","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaful%2Fversafleet-ruby/lists"}