Sha256: f1c8f898a2a9656c8ee1228beac00417985fe8de57582d800c5df8b08737604d

Contents?: true

Size: 946 Bytes

Versions: 49

Compression:

Stored size: 946 Bytes

Contents

module Phones

  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

  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

end

Version data entries

49 entries across 49 versions & 1 rubygems

Version Path
tessitura_rest-0.8.5.1 lib/tessitura_rest/crm/phones.rb
tessitura_rest-0.8.5 lib/tessitura_rest/crm/phones.rb
tessitura_rest-0.8.4 lib/tessitura_rest/crm/phones.rb
tessitura_rest-0.8.3 lib/tessitura_rest/crm/phones.rb
tessitura_rest-0.8.2 lib/tessitura_rest/crm/phones.rb
tessitura_rest-0.8.1 lib/tessitura_rest/crm/phones.rb
tessitura_rest-0.8 lib/tessitura_rest/crm/phones.rb
tessitura_rest-0.7.9 lib/tessitura_rest/crm/phones.rb
tessitura_rest-0.7.8 lib/tessitura_rest/crm/phones.rb
tessitura_rest-0.7.7 lib/tessitura_rest/crm/phones.rb
tessitura_rest-0.7.6 lib/tessitura_rest/crm/phones.rb
tessitura_rest-0.7.5 lib/tessitura_rest/crm/phones.rb
tessitura_rest-0.7.4 lib/tessitura_rest/crm/phones.rb
tessitura_rest-0.7.3 lib/tessitura_rest/crm/phones.rb
tessitura_rest-0.7.2 lib/tessitura_rest/crm/phones.rb
tessitura_rest-0.7.1 lib/tessitura_rest/crm/phones.rb
tessitura_rest-0.7.0 lib/tessitura_rest/crm/phones.rb
tessitura_rest-0.6.9 lib/tessitura_rest/crm/phones.rb
tessitura_rest-0.6.8 lib/tessitura_rest/crm/phones.rb
tessitura_rest-0.6.7 lib/tessitura_rest/crm/phones.rb