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-0.5.5 lib/tessitura_rest/crm/actions.rb
tessitura_rest-0.5.4 lib/tessitura_rest/crm/actions.rb
tessitura_rest-0.5.3 lib/tessitura_rest/crm/actions.rb
tessitura_rest-0.5.1 lib/tessitura_rest/crm/actions.rb
tessitura_rest-0.5.0.1 lib/tessitura_rest/crm/actions.rb
tessitura_rest-0.5.0 lib/tessitura_rest/crm/actions.rb
tessitura_rest-0.4.8 lib/tessitura_rest/crm/actions.rb
tessitura_rest-0.4.7 lib/tessitura_rest/crm/actions.rb
tessitura_rest-0.4.6 lib/tessitura_rest/crm/actions.rb
tessitura_rest-0.4.5 lib/tessitura_rest/crm/actions.rb
tessitura_rest-0.4.4 lib/tessitura_rest/crm/actions.rb
tessitura_rest-0.4.3 lib/tessitura_rest/crm/actions.rb
tessitura_rest-0.4.2 lib/tessitura_rest/crm/actions.rb
tessitura_rest-0.4.1 lib/tessitura_rest/crm/actions.rb
tessitura_rest-0.4.0 lib/tessitura_rest/crm/actions.rb