module Actions

Public Instance Methods

create_action(action_type, constituent_id, issue_id, notes = '', options={}) click to toggle source
# 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={}) click to toggle source
# 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={}) click to toggle source
# 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