Infopark WebCRM Connector
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.2.2 is tested and supported. It is not planned to ever support Active Resource 5.
Installation
Add infopark_crm_connector
to your gemfile
:
gem 'infopark_crm_connector'
Install the gem with Bundler:
bundle install
Configuration
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.
Example Usage
This Ruby SDK provides the WebCRM's domain models Account, Activity, Contact, Event, 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.
Contact
# 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
Activity
# 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"]}
Contributing
We no longer accept contributions for this repo. Please consider upgrading to Infopark WebCRM SDK which is a client for API v2.
Build and install gem
bundle exec rake gem #build
bundle exec rake install #build and install
Documentation
bundle exec rake yard
open doc/index.html
Changelog
Version 1.3.0 - 2017-07-15
- Removed support for ActiveResource 3.x. ActiveResource 4.x is supported only.
- CRM Connector is deprecated in favor of WebCRM SDK (API v2)
Version 1.2.0 - 2014-03-26
- Added support for ActiveResource 4.0.
- Remove support for Ruby 1.8.
Version 1.1.0 - 2013-10-21
- Remove support for ActiveResource 3.0.
- Added
Attachment.upload_permission
,Attachment.download_url
and the activity comment propertyattachments
. See API documentation
Version 1.0.1 - 2013-03-20
- 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.
Version 1.0.0 - 2012-09-14
- 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.
Version 0.9.2 - 2012-03-19
- Security improvement for
Contact.authenticate
,Contact.password_set
andcontact.password_request
Version 0.9.1 - 2012-02-28
- Removed
Diary
. Please useActivity
instead. - Added
Mailing
- Added
appointment_*
andtask_*
fields toActivity
- Added
role_names
field toContact
- Added
tags
field toActivity
,Account
andContact
Version 0.9 - 2012-01-27
Initial Release of Infopark CRM Connector
Changes from OMC Connector to 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.
Changed configuration
live_server_groups_callback
- replacescontact_roles_callback
New classes
CustomType
Role
System
New methods
Account.search
Activity.search
Contact.search
Event.search
EventContact.search
contact.live_server_groups
- replacescontact.roles
Removed classes
AccountCollection
InquiryKind
- useCustomType
InquiryLink
Inquiry
- useActivity
Location
- usecontact
andaccount
propertiesMailing
RegistrationInquiry
Session
Removed methods
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
License
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.