Sha256: 5872bbd9a39129d4210a7c10347e9774754ce34ee0e20edf42ce3db1634c7f45

Contents?: true

Size: 1.01 KB

Versions: 75

Compression:

Stored size: 1.01 KB

Contents

module Actions

  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

  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

  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

end

Version data entries

75 entries across 75 versions & 1 rubygems

Version Path
tessitura_rest-1.1.6 lib/tessitura_rest/crm/actions.rb
tessitura_rest-1.1.5 lib/tessitura_rest/crm/actions.rb
tessitura_rest-1.1.4 lib/tessitura_rest/crm/actions.rb
tessitura_rest-1.1.3 lib/tessitura_rest/crm/actions.rb
tessitura_rest-1.1.2 lib/tessitura_rest/crm/actions.rb
tessitura_rest-1.1.1 lib/tessitura_rest/crm/actions.rb
tessitura_rest-1.1.0 lib/tessitura_rest/crm/actions.rb
tessitura_rest-1.0.0 lib/tessitura_rest/crm/actions.rb
tessitura_rest-0.9.1.3 lib/tessitura_rest/crm/actions.rb
tessitura_rest-0.9.1.2 lib/tessitura_rest/crm/actions.rb
tessitura_rest-0.9.1.1 lib/tessitura_rest/crm/actions.rb
tessitura_rest-0.9.1 lib/tessitura_rest/crm/actions.rb
tessitura_rest-0.9.0 lib/tessitura_rest/crm/actions.rb
tessitura_rest-0.8.9 lib/tessitura_rest/crm/actions.rb
tessitura_rest-0.8.8 lib/tessitura_rest/crm/actions.rb
tessitura_rest-0.8.7 lib/tessitura_rest/crm/actions.rb
tessitura_rest-0.8.6.9 lib/tessitura_rest/crm/actions.rb
tessitura_rest-0.8.6.8 lib/tessitura_rest/crm/actions.rb
tessitura_rest-0.8.6.7 lib/tessitura_rest/crm/actions.rb
tessitura_rest-0.8.6.6 lib/tessitura_rest/crm/actions.rb