Ruby client for SuiteCRM's V8 API
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
Prior to using the API client, you will need to create a new API user as documented here.
SuiteCRM.configuredo |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]"endSuiteCRM::Modules.get("Contacts")SuiteCRM::Module.get("Contacts","51f7baeb-fe82-d3c1-5ef9-60c0de2c67cf")SuiteCRM::Module.create(data: {type: "FP_events",attributes: {name: "Meeting"}})SuiteCRM::Module.update({data: {type: "Contacts",id: "79a08232-6e62-dbaf-af6d-60f7146d1e87",attributes: {first_name: "Jordan",last_name: "Peterson"}}})SuiteCRM::Module.delete("Contacts","79a08232-6e62-dbaf-af6d-60f7146d1e87")SuiteCRM::Relationship.get("Contacts","669d86ed-e5a3-7605-0d68-60c22f69743a","fp_events_contacts")SuiteCRM::Relationship.create("Contacts","669d86ed-e5a3-7605-0d68-60c22f69743a",{data: {type: "FP_events",id: "66ef1d43-06a9-5c09-0853-60f0707fad32"}})SuiteCRM::Relationship.delete("Contacts","669d86ed-e5a3-7605-0d68-60c22f69743a","fp_events_contacts","66ef1d43-06a9-5c09-0853-60f0707fad32")SuiteCRM::Meta.getExport 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
Bug reports and pull requests are welcome on GitHub at https://github.com/dinosimone/suitecrm-ruby.
Dino Simone (dino@simone.is) | dinosimone.com