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_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.