Infopark WebCRM Connector is the official Ruby SDK for Infopark WebCRM API v1. It basically wraps the WebCRM web services API using Active Resource.
API v1 is the old API. For API v2 please refer to the Infopark WebCRM SDK. It is highly recommended to upgrade to WebCRM SDK.
Currently, the latest version of Active Resource 4 with Ruby 2.4.4 is tested and supported. It is not planned to ever support Active Resource 5.
Add infopark_crm_connector to your gemfile:
gem 'infopark_crm_connector'
Install the gem with Bundler:
bundle install
require 'infopark_crm_connector'
Infopark::Crm.configure do |configuration|
configuration.url = "https://webcrm.server/url"
configuration.login = "webcrm_user"
configuration.api_key = "api_key_of_webcrm_user"
end
See {Infopark::Crm.configure} for a complete list of configuration keys.
This Ruby SDK provides the WebCRM's domain models {Infopark::Crm::Account Account}, {Infopark::Crm::Activity Activity}, {Infopark::Crm::Contact Contact}, {Infopark::Crm::Event Event}, {Infopark::Crm::Mailing Mailing}, among others. All domain models are subclasses of {Infopark::Crm::Core::Resource} which itself inherits from {ActiveResource::Base} and provides methods such as find(id), create(hash), update(hash), search(params) and others.
# Retrieve the contact identified by the login 'root'
contact = Infopark::Crm::Contact.search(:params => {:login => 'root'}).first
# Change this contact's mail address
contact.update_attribute(:email, '[email protected]')
# Send a new password request mail to the contact's address
contact.password_request
# Create a new activity kind
Infopark::Crm::CustomType.create(:name => 'support-case', :kind => 'Activity',
:states => ['created'])
# Create a new activity
activity = Infopark::Crm::Activity.new(:kind => 'support-case')
# Set properties of this activity
activity.title = 'Sprechen Sie Deutsch?'
# Switch to a different request locale
Infopark::Crm.configure {|c| c.locale = 'de'}
# Post the activity (which is going to fail)
activity.save
# => false
# Get to know what's missing
activity.errors.to_hash
# => {:state=>["ist kein gültiger Wert"]}
We no longer accept contributions for this repo. Please consider upgrading to Infopark WebCRM SDK which is a client for API v2.
bundle exec rake gem #build
bundle exec rake install #build and install
bundle exec rake yard
open doc/index.html
- Removed support for ActiveResource 3.x. ActiveResource 4.x is supported only.
- CRM Connector is deprecated in favor of WebCRM SDK (API v2)
- Added support for ActiveResource 4.0.
- Remove support for Ruby 1.8.
- Remove support for ActiveResource 3.0.
- Added
Attachment.upload_permission,Attachment.download_urland the activity comment propertyattachments. See API documentation
- Added continuous integration of travis-ci.org (see travis-ci.org/infopark/crm_connector)
- Bugfix: Default attributes are inherited to subclasses (fixes Issue #1)
- Bugfix: Infopark CRM Connector in combination with ActiveResource 3.0 used XML. Now it uses JSON.
- Enabled support for
event.custom_attributes - Removed deprecated functions
EventContact.find_byandEventContact.find_by_event_id_and_contact_id. Please useEventContact.searchinstead. - Removed
configuration.debug. - Renamed
Infopark::Crm::AuthenticationFailedtoInfopark::Crm::Errors::AuthenticationFailed. - Merged
Infopark::Crm::Core::BaseandInfopark::Crm::ResourceintoInfopark::Crm::Core:Resource. - Removed all
Infopark::Crm::Default::*classes.
- Security improvement for
Contact.authenticate,Contact.password_setandcontact.password_request
- Removed
Diary. Please useActivityinstead. - Added
Mailing - Added
appointment_*andtask_*fields toActivity - Added
role_namesfield toContact - Added
tagsfield toActivity,AccountandContact
Initial Release of Infopark CRM Connector
- Namespace changed from
OmcConector::toInfopark::Crm:: - Attribute names may have changed. For new attributes please refer to the Web Services API documentation.
- Works only with Infopark WebCRM.
live_server_groups_callback- replacescontact_roles_callback
CustomTypeRoleSystem
Account.searchActivity.searchContact.searchEvent.searchEventContact.searchcontact.live_server_groups- replacescontact.roles
AccountCollectionInquiryKind- useCustomTypeInquiryLinkInquiry- useActivityLocation- usecontactandaccountpropertiesMailingRegistrationInquirySession
account.contacts- useContact.search(:params => {:acount_id => acount_id})Account.find_by_name- useAccount.searchaccount.inquiries- useActivity.search(:params => {:account_id => account_id})account.locationscontact.account_activities- useActivity.search(:query => {:account_id => account_id})contact.activities- useActivity.search(:params => {:contact_id => contact_id})contact.create_activitycontact.create_diarycontact.create_location_with_account_associationcontact.create_locationcontact.create_registration_requestcontact.event_participationcontact.find_activityContact.find_by_email- useContact.search(:params => {:email => email})Contact.find_by_login- useContact.search(:params => {:login => login})Contact.languagescontact.locationContact.lookup_uptionscontact.move_locationcontact.roles- usecontact.live_server_groupscontact.serialized_attributes- usecontact.attributescontact.subscriptionsContact.titlescontact.update_locationcontact.update_subscriptionscontact.validate_login- useContact.search(:params => {:login => login})event.attend(!)event.contacts- useEventContact.search(:event_id => event_id)Event.find_by_nameevent.inquire(!)event.refuse(!)event.register(!)event_contact.attend- useevent_contact.status = 'attended'event_contact.inquire- useevent_contact.status = 'unregistered'event_contact.refuse- useevent_contact.status = 'refused'event_contact.register- useevent_contact.status = 'registered'event_contact.update_detailsinquiry.create_diaryinquiry.create_linkinquiry.diariesinquiry.links
Copyright (c) 2009 - 2013 Infopark AG (http://www.infopark.com)
This software can be used and modified under the LGPLv3. Please refer to http://www.gnu.org/licenses/lgpl-3.0.html for the license text.
