Sha256: 575b0fcc910e5e4b9e0d9b5fc5b574a97e139e6b924e594d4a6b70a52d97ca9a

Contents?: true

Size: 992 Bytes

Versions: 32

Compression:

Stored size: 992 Bytes

Contents

module Actions

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

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

  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})
    options.merge!(:body => parameters)
    response = self.class.post(base_api_endpoint('CRM/Actions'), options)
    JSON.parse(response.body)
  end

end

Version data entries

32 entries across 32 versions & 1 rubygems

Version Path
tessitura_rest-0.3.15 lib/tessitura_rest/crm/actions.rb
tessitura_rest-0.3.14 lib/tessitura_rest/crm/actions.rb
tessitura_rest-0.3.13 lib/tessitura_rest/crm/actions.rb
tessitura_rest-0.3.12 lib/tessitura_rest/crm/actions.rb
tessitura_rest-0.3.11 lib/tessitura_rest/crm/actions.rb
tessitura_rest-0.3.10 lib/tessitura_rest/crm/actions.rb
tessitura_rest-0.3.9 lib/tessitura_rest/crm/actions.rb
tessitura_rest-0.3.8 lib/tessitura_rest/crm/actions.rb
tessitura_rest-0.3.7 lib/tessitura_rest/crm/actions.rb
tessitura_rest-0.3.6 lib/tessitura_rest/crm/actions.rb
tessitura_rest-0.3.5 lib/tessitura_rest/crm/actions.rb
tessitura_rest-0.3.4 lib/tessitura_rest/crm/actions.rb
tessitura_rest-0.3.3 lib/tessitura_rest/crm/actions.rb
tessitura_rest-0.3.2 lib/tessitura_rest/crm/actions.rb
tessitura_rest-0.3.1 lib/tessitura_rest/crm/actions.rb
tessitura_rest-0.3.0 lib/tessitura_rest/crm/actions.rb
tessitura_rest-0.2.8 lib/tessitura_rest/crm/actions.rb
tessitura_rest-0.2.7 lib/tessitura_rest/crm/actions.rb
tessitura_rest-0.2.6 lib/tessitura_rest/crm/actions.rb
tessitura_rest-0.2.5 lib/tessitura_rest/crm/actions.rb