Module: Phones

Included in:
TessituraRest
Defined in:
lib/tessitura_rest/crm/phones.rb

Instance Method Summary collapse

Instance Method Details

#create_primary_phone(id, phone, options = {}) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/tessitura_rest/crm/phones.rb', line 3

def create_primary_phone(id, phone, options={})
  parameters =
  {
  	'Constituent': {
  		'Id': id
  	},
  	'PhoneNumber': phone,
  	'PhoneType': {
  		'Description': 'Phone 1',
  		'Id': 1,
  		'Inactive': false
  	}
  }
  options.merge!(basic_auth: @auth, headers: @headers)
  options.merge!(:body => parameters)
  response = self.class.post(base_api_endpoint('CRM/Phones'), options)
  JSON.parse(response.body)
end

#create_secondary_phone(id, phone, options = {}) ⇒ Object



22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/tessitura_rest/crm/phones.rb', line 22

def create_secondary_phone(id, phone, options={})
  parameters =
  {
    'Constituent': {
      'Id': id
    },
    'PhoneNumber': phone,
    'PhoneType': {
      'Description': 'Phone 2',
      'Id': 2,
      'Inactive': false
    }
  }
  options.merge!(basic_auth: @auth, headers: @headers)
  options.merge!(:body => parameters)
  response = self.class.post(base_api_endpoint('CRM/Phones'), options)
  JSON.parse(response.body)
end