0.0
No commit activity in last 3 years
No release in over 3 years
Implements basic functionality needed to create and find records in SuiteCRM.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 4.8, >= 4.8.2
~> 13.0, >= 13.0.6
~> 3.10
~> 6.0
~> 3.13

Runtime

~> 1.5, >= 1.5.1
~> 2.5, >= 2.5.1
~> 2.2, >= 2.2.3
~> 3.3, >= 3.3.1
~> 2.2
 Project Readme

SuiteCRM::Ruby

Ruby client for SuiteCRM's V8 API

Installation

Add this line to your application's Gemfile:

gem 'suitecrm-ruby'

And then execute:

$ bundle install

Or install it yourself as:

$ gem install suitecrm-ruby

Usage

Configuration

Prior to using the API client, you will need to create a new API user as documented here.

SuiteCRM.configure do |config|
  config.api_url = "http://[ip]/suite/Api/V8"
  config.token_url = "http://[ip]/suite/Api/access_token"
  config.client_id = "[client id]"
  config.client_secret = "[client secret]"
end

Modules

Get all module records

SuiteCRM::Modules.get("Contacts")

Get a single module record

SuiteCRM::Module.get("Contacts", "51f7baeb-fe82-d3c1-5ef9-60c0de2c67cf")

Create a new module record

SuiteCRM::Module.create(
  data: {
    type: "FP_events",
    attributes: {
      name: "Meeting"
    }
  }
)

Update a single module record

SuiteCRM::Module.update({
  data: {
    type: "Contacts",
    id: "79a08232-6e62-dbaf-af6d-60f7146d1e87",
    attributes: {
      first_name: "Jordan",
      last_name: "Peterson"
    }
  }
})

Delete a single module record

SuiteCRM::Module.delete("Contacts", "79a08232-6e62-dbaf-af6d-60f7146d1e87")

Relationships

Get all relationships of type for a module

SuiteCRM::Relationship.get(
  "Contacts", "669d86ed-e5a3-7605-0d68-60c22f69743a", "fp_events_contacts"
)

Create a new relationship of type for a module

SuiteCRM::Relationship.create(
  "Contacts",
  "669d86ed-e5a3-7605-0d68-60c22f69743a",
  {
    data: {
      type: "FP_events",
      id: "66ef1d43-06a9-5c09-0853-60f0707fad32"
    }
  }
)

Delete a single module relationship

SuiteCRM::Relationship.delete(
  "Contacts",
  "669d86ed-e5a3-7605-0d68-60c22f69743a",
  "fp_events_contacts",
  "66ef1d43-06a9-5c09-0853-60f0707fad32"
)

Meta

Obtain a list of available modules

SuiteCRM::Meta.get

Testing

Export environment variables

$ export API_URL="http://1.1.1.1/suite/Api/V8"
$ export TOKEN_URL="http://1.1.1.1/suite/Api/access_token"
$ export CLIENT_ID="41fdff46..."
$ export CLIENT_SECRET="VjB_S2PICeQ..."

In developement, run the app using

$ rspec

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/dinosimone/suitecrm-ruby.

Author

Dino Simone (dino@simone.is) | dinosimone.com