{"id":18728798,"url":"https://github.com/rubyonworld/capsule_crm","last_synced_at":"2025-11-12T05:30:20.092Z","repository":{"id":60308267,"uuid":"542155388","full_name":"RubyOnWorld/capsule_crm","owner":"RubyOnWorld","description":"You need to configure CapsuleCRM with your API Token and subdomain before you can make any requests to it. If you are using rails then you can put this into your config/initializers folder.","archived":false,"fork":false,"pushed_at":"2022-09-27T16:43:22.000Z","size":451,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-12-28T14:26:40.551Z","etag":null,"topics":["api","capsule","configure","crm","ruby","subdomain","token"],"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/RubyOnWorld.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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}},"created_at":"2022-09-27T15:23:52.000Z","updated_at":"2022-09-27T18:14:51.000Z","dependencies_parsed_at":"2022-09-27T22:40:21.997Z","dependency_job_id":null,"html_url":"https://github.com/RubyOnWorld/capsule_crm","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/RubyOnWorld%2Fcapsule_crm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RubyOnWorld%2Fcapsule_crm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RubyOnWorld%2Fcapsule_crm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RubyOnWorld%2Fcapsule_crm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RubyOnWorld","download_url":"https://codeload.github.com/RubyOnWorld/capsule_crm/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239599040,"owners_count":19665911,"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","capsule","configure","crm","ruby","subdomain","token"],"created_at":"2024-11-07T14:24:24.376Z","updated_at":"2025-11-12T05:30:20.017Z","avatar_url":"https://github.com/RubyOnWorld.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build\nStatus](https://travis-ci.org/mattbeedle/capsule_crm.png)](https://travis-ci.org/mattbeedle/capsule_crm)\n[![Code\nClimate](https://codeclimate.com/github/mattbeedle/capsule_crm.png)](https://codeclimate.com/github/mattbeedle/capsule_crm)\n[![Gem\nVersion](https://badge.fury.io/rb/capsule_crm.png)](http://badge.fury.io/rb/capsule_crm)\n[![Coverage\nStatus](https://coveralls.io/repos/mattbeedle/capsule_crm/badge.png?branch=master)](https://coveralls.io/r/mattbeedle/capsule_crm)\n[![Dependency\nStatus](https://gemnasium.com/mattbeedle/capsule_crm.png)](https://gemnasium.com/mattbeedle/capsule_crm)\n[![Stories in\nReady](http://badge.waffle.io/mattbeedle/capsule_crm.png)](http://waffle.io/mattbeedle/capsule_crm)\n[![Gitter\nchat](https://badges.gitter.im/mattbeedle/capsule_crm.png)](https://gitter.im/mattbeedle/capsule_crm)\n[![tip for next\ncommit](https://tip4commit.com/projects/1022.svg)](https://tip4commit.com/github/mattbeedle/capsule_crm)\n\n# CapsuleCRM\n\nCapsuleCRM provides an ActiveModel compliant interface to the\n[capsulecrm.com](http://capsulecrm.com) API\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n    gem 'capsule_crm'\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install capsule_crm\n\n## Getting Started\n\nYou need to configure CapsuleCRM with your API Token and subdomain before you\ncan make any requests to it. If you are using rails then you can put this into\nyour config/initializers folder.\n```ruby\nCapsuleCRM.configure do |config|\n  config.api_token       = 'API Token here'\n  config.subdomain       = 'your capsule crm company subdomain here'\n\n  # Optional\n  config.logger          = your_logger # default is Logger.new(STDOUT)\n  config.perform_logging = true # default is false\nend\n```\n\n## Usage\n\n### Parties\n```ruby\n# List Parties\nCapsuleCRM::Party.all\n\n# With query parameters\nCapsuleCRM::Party.all(\n  q: 'search term here', email: 'email to search for here',\n  lastmodified: 6.weeks.ago, tag: 'tag to search for here',\n  start: 10, limit: 55\n)\n\n# Find one\n# When the party is an organization this returns a CapsuleCRM::Organization\n# otherise it returns a CapsuleCRM::Person\nparty = CapsuleCRM::Party.find(ID)\n```\n\n### People\n```ruby\n# Find a person\nperson = CapsuleCRM::Person.find(ID)\n\n# List People\nCapsuleCRM::Person.all\n\n# Initialize a new person\nperson = CapsuleCRM::Person.new(first_name: 'Matt', last_name: 'Beedle')\n\n# Validate a person\nperson.valid?\n\n# Save a person\nperson.save\n\n# Update a person\nperson.update_attributes first_name: 'John'\n\n# Create a Person\nperson = CapsuleCRM::Person.create(first_name: 'Matt', last_name: 'Beedle')\n\n# Get organization associated with a person\nperson.organization\n\n# Delete a person\nperson.destroy\n\n# List opportunities\nperson.opportunities\n\n# List tags\nperson.tags\n\n# Add a tag\nperson.add_tag 'a test tag'\n\n# View history\nperson.histories\n\n# Build a new history item\nhistory_item = person.histories.build note: 'a note'\n\n# Create a new history item\nhistory_item = person.histories.create note: 'a note'\n```\n\n### Organizations\n```ruby\n# Find an organization\norganization = CapsuleCRM::Organization.find(ID)\n\n# List Organizations\nCapsuleCRM::Organization.all\n\n# Initialize a new organization\norg = CapsuleCRM::Organization.new(name: 'Vegan.io')\n\n# Validate an organization\norg.valid?\n\n# Save an organization\norg.save\n\n# Update an organization\norg.update_attributes name: 'Apple Inc'\n\n# Create an organization\norg = CapsuleCRM::Organization.create(name: 'Vegan.io')\n\n# Get people for an organization\norg.people\n\n# Delete an organization\norg.destroy\n\n# List opportunities\norg.opportunities\n\n# List tags\norg.tags\n\n# Add a tag\norg.add_tag 'a test tag'\n\n# View history\norg.histories\n\n# Build a new history item\nhistory = org.histories.build note: 'some note text'\n\n# Create a new history item\nhistory = org.histories.create note: 'some note text'\n```\n\n### Contacts\n\nPeople and organizations may both have contacts. Contacts consist of emails,\nphones, websites and addresses.\n\n```ruby\nperson.contacts\n# =\u003e CapsuleCRM::Contacts\n\n# Assign an array of CapsuleCRM::Email objects\nperson.contacts.emails =\n  [CapsuleCRM::Email.new(email_address: 'test@test.com', type: 'Work')]\n\n# Assign an array of email attributes\nperson.contacts.emails = [{ email_address: 'test@test.com', type: 'Work' }]\n\n# Add a new email\nperson.contacts.emails \u003c\u003c CapsuleCRM::Email.new(email_address: 'test@test.com')\n\n# person.emails delegates to person.contacts.emails so the above code may be\n# shortened to:\n\nperson.emails =\n  [CapsuleCRM::Email.new(email_address: 'test@test.com', type: 'Work')]\n\n# Assign an array of email attributes\nperson.emails = [{ email_address: 'test@test.com', type: 'Work' }]\n\nperson.emails \u003c\u003c CapsuleCRM::Email.new(email_address: 'test@test.com')\n\n# The above syntax is exactly the same for addresses, websites and phones.\n```\n\n### Tracks\n```ruby\n# Find a track\nTrack = CapsuleCRM::Track.find(ID)\n\n# List tracks\ntracks = CapsuleCRM::Track.all\n```\n\n### Opportunities\n```ruby\n# Find an opportunity\nopportunity = CapsuleCRM::Opportunity.find(ID)\n\n# List all opportunities\nopportunities = CapsuleCRM::Opportunity.all\n\n# Build a new opportunity\nopportunity = CapsuleCRM::Opportunity.new(\n  name: 'my first opportunity',\n  party: CapsuleCRM::Party.find(1)\n  milestone: CapsuleCRM::Milestone.find(10)\n  track: CapsuleCRM::Track.all.first\n)\n\n# Save the opportunity\nopportunity.save\nopportunity.save!\n\n# List tags\nopportunity.tags\n\n# Add a tag\nopportunity.add_tag 'tag here'\n\n# View history\nopportunity.histories\n\n# Build a new history item\nhistory = opportunity.histories.build note: 'some note text'\n\n# Create a new history item\nhistory_item = opportunity.histories.create note: 'some text here'\n```\n\n### Cases\n```ruby\n# Find a case\nkase = CapsuleCRM::Case.find(ID)\n\n# List Cases\nkase = CapsuleCRM::Case.all\n\n# Update a Case\nkase.update_attributes status: 'CLOSED'\n\n# Delete a Case\nkase.destroy\n\n# List tags\nkase.tags\n\n# Add a tag\nkase.add_tag 'A test tag'\n\n# View history\nkase.histories\n\n# Build a new history\nhistory = kase.histories.build note: 'note text here'\n\n# Create a new history item\nhistory_item = kase.histories.create note: 'another note'\n```\n\n### History\n```ruby\n# Find a history item\nhistory_item = CapsuleCRM::History.find(ID)\n\n# Get the party\nhistory_item.party\n\n# Get the case\nhistory_item.case\n\n# Get the opportunity\nhistory_item.opportunity\n\n# Update a history item\nhistory_item.update_attributes note: 'some new note text'\n\n# Delete a history item\nhistory_item.destroy\n```\n\n### Tasks\n```ruby\n# List open tasks\ntasks = CapsuleCRM::Task.all\n\n# Query open tasks\ntasks = CapsuleCRM::Task.all(\n  category: 'category name', user: 'username', start: 6, limit: 25\n)\n\n# Add a task\nCapsuleCRM::Task.create(\n  description: 'task description', due_date: Date.tomorrow\n)\n\n# Update task\ntask.update_attributes description: 'a new improved task description'\n\n# Delete a task\ntask.destroy\n\n# Complete a task\ntask.complete\n\n# Reopen a task\ntask.reopen\n\n# List available task categories\nCapsuleCRM::Task.categories\n```\n\n### Users\n```ruby\n# List all users\nCapsuleCRM::User.all\n\n# Find a user by username\nuser = CapsuleCRM::User.find_by_username('username here')\n```\n\n### Countries\n```ruby\n# List all countries\nCapsuleCRM::Country.all\n```\n\n### Currencies\n```ruby\n# List all currencies\nCapsuleCRM::Currency.all\n```\n\n## Supported Rubies\n\n2.0.x, 2.1.x\n\n## Versioning\n\nThis project follows [semver](http://semver.org/spec/v2.0.0.html) so there will\nbe no breaking changes in minor/patch version changes.\n\n## Feedback\n\nPlease use github issues to give feedback. If you have a bug to report then an\naccompanying failing test would be great. Extra points for a full pull request\nwith fix.\n\n## Contributing\n\n1. Fork it\n2. Create your feature branch (`git checkout -b my-new-feature`)\n3. Commit your changes (`git commit -am 'Add some feature'`)\n4. Push to the branch (`git push origin my-new-feature`)\n5. Create new Pull Request\n\n## Contributers\n\nMany thanks to the following contributers:\n\n- [@srbaker](https://github.com/srbaker)\n- [@clod81](https://github.com/clod81)\n- [@danthompson](https://github.com/danthompson)\n- [@ryanbooker](https://github.com/ryanbooker)\n- [@ghiculescu](https://github.com/ghiculescu)\n- [@whitecl](https://github.com/whitecl)\n- [@jonathansimmons](https://github.com/jonathansimmons)\n\n## Alternatives\n\n- [placebo](https://github.com/adrianpike/placebo)\n- [capsulecrm](https://github.com/ahmedrb/capsulecrm) - most active fork seems\n  to be [here](https://github.com/theodi/capsulecrm)\n\n## Donations\n\nCapsuleCRM gem is completely free and open source.\nHowever, if you would like to tip me for the hours I put in, you would of course\nbe very welcome to send Bitcoins to 1EcMFGtrw97qA3VXnQwM2Me5ruEkapCVio\n\n## License\n\nCopyright (c) 2013-2014 Matthew Beedle\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frubyonworld%2Fcapsule_crm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frubyonworld%2Fcapsule_crm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frubyonworld%2Fcapsule_crm/lists"}