Infopark WebCRM Connector is the official Ruby SDK for Infopark WebCRM. It basically wraps the WebCRM web services API using Active Resource. Currently, Active Resource 3.1 and 3.2 in combination with Ruby 1.8.7, 1.9.x and 2.0.0 are tested and supported.
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, if it is working
Infopark::Crm::Contact.first.last_name
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, 'root@example.com')
# 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"]}
The source code is freely available at (https://github.com/infopark/crm_connector). Pull requests are welcome.
git clone git@github.com:infopark/crm_connector.git
cd crm_connector/
bundle
Configure test/config.json
with an empty WebCRM tenant (see test/config_template.json
)
Run tests with the current version of Active Resource:
bundle exec rake test
Run tests with all supported versions of Active Resource:
bundle exec rake appraisal:install
bundle exec rake appraisal
bundle exec rake gem #build
bundle exec rake install #build and install
bundle exec rake yard
open doc/index.html
- Remove support for ActiveResource 3.0.
- Added
Attachment.upload_permission
,Attachment.download_url
and 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_by
andEventContact.find_by_event_id_and_contact_id
. Please useEventContact.search
instead. - Removed
configuration.debug
. - Renamed
Infopark::Crm::AuthenticationFailed
toInfopark::Crm::Errors::AuthenticationFailed
. - Merged
Infopark::Crm::Core::Base
andInfopark::Crm::Resource
intoInfopark::Crm::Core:Resource
. - Removed all
Infopark::Crm::Default::*
classes.
- Security improvement for
Contact.authenticate
,Contact.password_set
andcontact.password_request
- Removed
Diary
. Please useActivity
instead. - Added
Mailing
- Added
appointment_*
andtask_*
fields toActivity
- Added
role_names
field toContact
- Added
tags
field toActivity
,Account
andContact
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
CustomType
Role
System
Account.search
Activity.search
Contact.search
Event.search
EventContact.search
contact.live_server_groups
- replacescontact.roles
AccountCollection
InquiryKind
- useCustomType
InquiryLink
Inquiry
- useActivity
Location
- usecontact
andaccount
propertiesMailing
RegistrationInquiry
Session
account.contacts
- useContact.search(:params => {:acount_id => acount_id})
Account.find_by_name
- useAccount.search
account.inquiries
- useActivity.search(:params => {:account_id => account_id})
account.locations
contact.account_activities
- useActivity.search(:query => {:account_id => account_id})
contact.activities
- useActivity.search(:params => {:contact_id => contact_id})
contact.create_activity
contact.create_diary
contact.create_location_with_account_association
contact.create_location
contact.create_registration_request
contact.event_participation
contact.find_activity
Contact.find_by_email
- useContact.search(:params => {:email => email})
Contact.find_by_login
- useContact.search(:params => {:login => login})
Contact.languages
contact.location
Contact.lookup_uptions
contact.move_location
contact.roles
- usecontact.live_server_groups
contact.serialized_attributes
- usecontact.attributes
contact.subscriptions
Contact.titles
contact.update_location
contact.update_subscriptions
contact.validate_login
- useContact.search(:params => {:login => login})
event.attend(!)
event.contacts
- useEventContact.search(:event_id => event_id)
Event.find_by_name
event.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_details
inquiry.create_diary
inquiry.create_link
inquiry.diaries
inquiry.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.