Module: ZohoCrm::Account

Defined in:
lib/zoho_crm/account.rb

Class Method Summary collapse

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()
  query =
  Hash(
    authtoken: ZohoCrm.configuration.api_token, scope: 'crmapi',
    xmlData: ZohoCrm::ZohoApiUtils.build_attributes('Accounts', )
  )
  ZohoCrm::Fetch.post(ZohoCrm::ZohoApiUtils.create_url('Accounts', 'insertRecords'), query)
end

.fieldsObject

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()
  raise "Arguments missing: account_id" if .nil?
  query = Hash(authtoken: ZohoCrm.configuration.api_token, scope: 'crmapi', 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(, )
  raise "Arguments missing: account_id" if .nil?
  query =
  Hash(
    authtoken: ZohoCrm.configuration.api_token, scope: 'crmapi', id: ,
    xmlData: ZohoCrm::ZohoApiUtils.build_attributes('Accounts', )
  )
  ZohoCrm::Fetch.post(ZohoCrm::ZohoApiUtils.create_url('Accounts', 'updateRecords'), query)
end