Ruby client for CiviCRM REST interface
Switch branches/tags
Nothing to show
Clone or download
Latest commit 1274987 Sep 19, 2018

README.md

CiviCRM Client

Installation

$ gem install civicrm

Getting started

# Required config
CiviCrm.api_base = "https://www.example.org/path/to/civi/codebase/"
CiviCrm.site_key = "YOUR_SITE_KEY"

# Authenticate with username/password
CiviCrm.authenticate("username", "password")

# OR, authenticate with API key
CiviCrm.api_key = "..."

CiviCrm Objects

# Get list of contacts
CiviCrm::Contact.all

# Create contact
CiviCrm::Contact.create(contact_type: "Organization", organization_name: "test")

# Find and delete
CiviCrm::Contact.find(1).delete

Testing

$ bundle exec rspec spec

Useful links

Acknowledgements

Created by Iskander Haziev. Maintained by EFF.