Module: Actions

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

Instance Method Summary collapse

Instance Method Details

#create_action(action_type, constituent_id, issue_id, notes = '', options = {}) ⇒ Object



15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/tessitura_rest/crm/actions.rb', line 15

def create_action(action_type, constituent_id, issue_id, notes = '', options={})
  parameters =
  {
    'ActionType': {
      'Id': action_type
    },
    'Issue': {
      'Id': issue_id
    },
    'Constituent': {
      'Id': constituent_id
    },
    'Notes': notes,
    'Resolved': true,
  }
  options.merge!(basic_auth: @auth, headers: @headers)
  options.merge!(:body => parameters)
  response = self.class.post(base_api_endpoint('CRM/Actions'), options)
  JSON.parse(response.body)
end

#get_action(id, options = {}) ⇒ Object



3
4
5
6
7
# File 'lib/tessitura_rest/crm/actions.rb', line 3

def get_action(id, options={})
  options.merge!(basic_auth: @auth, headers: @headers)
  response = self.class.get(base_api_endpoint("CRM/Actions/#{id}"), options)
  JSON.parse(response.body)
end

#get_actions(constituent_id, issue_id, options = {}) ⇒ Object



9
10
11
12
13
# File 'lib/tessitura_rest/crm/actions.rb', line 9

def get_actions(constituent_id, issue_id, options={})
  options.merge!(basic_auth: @auth, headers: @headers)
  response = self.class.get(base_api_endpoint("CRM/Actions?constituentId=#{constituent_id}&issueId=#{issue_id}"), options)
  JSON.parse(response.body)
end