Module: ZohoCrm::Account
- Defined in:
- lib/zoho_crm/account.rb
Class Method Summary collapse
-
.create(account_attributes) ⇒ Object
account_attributes = {} ZohoCrm::Account.create(account_attributes).
-
.fields ⇒ Object
ZohoCrm::Account.fields.
-
.find(account_id) ⇒ Object
ZohoCrm::Account.find(id).
-
.update(account_id, account_attributes) ⇒ Object
account_attributes={} ZohoCrm::Account.update(account_id, account_attributes).
Class Method Details
.create(account_attributes) ⇒ Object
account_attributes = {} ZohoCrm::Account.create(account_attributes)
23 24 25 26 27 28 29 30 |
# File 'lib/zoho_crm/account.rb', line 23 def create(account_attributes) query = Hash( authtoken: ZohoCrm.configuration.api_token, scope: 'crmapi', xmlData: ZohoCrm::ZohoApiUtils.build_attributes('Accounts', account_attributes) ) ZohoCrm::Fetch.post(ZohoCrm::ZohoApiUtils.create_url('Accounts', 'insertRecords'), query) end |
.fields ⇒ Object
ZohoCrm::Account.fields
7 8 9 10 |
# File 'lib/zoho_crm/account.rb', line 7 def fields query = Hash(authtoken: ZohoCrm.configuration.api_token, scope: 'crmapi') ZohoCrm::Fetch.get(ZohoCrm::ZohoApiUtils.create_url('Accounts', 'getField'), query) end |
.find(account_id) ⇒ Object
ZohoCrm::Account.find(id)
14 15 16 17 18 |
# File 'lib/zoho_crm/account.rb', line 14 def find(account_id) raise "Arguments missing: account_id" if account_id.nil? query = Hash(authtoken: ZohoCrm.configuration.api_token, scope: 'crmapi', id: account_id) ZohoCrm::Fetch.get(ZohoCrm::ZohoApiUtils.create_url('Accounts', 'getRecordById'), query) end |
.update(account_id, account_attributes) ⇒ Object
account_attributes={} ZohoCrm::Account.update(account_id, account_attributes)
35 36 37 38 39 40 41 42 43 |
# File 'lib/zoho_crm/account.rb', line 35 def update(account_id, account_attributes) raise "Arguments missing: account_id" if account_id.nil? query = Hash( authtoken: ZohoCrm.configuration.api_token, scope: 'crmapi', id: account_id, xmlData: ZohoCrm::ZohoApiUtils.build_attributes('Accounts', account_attributes) ) ZohoCrm::Fetch.post(ZohoCrm::ZohoApiUtils.create_url('Accounts', 'updateRecords'), query) end |