├── .gitignore ├── .rspec ├── .travis.yml ├── Gemfile ├── README.md ├── Rakefile ├── config └── gem_secret.yml.example ├── insightly2.gemspec ├── lib ├── insightly2.rb └── insightly2 │ ├── client.rb │ ├── dsl.rb │ ├── dsl │ ├── comments.rb │ ├── contacts.rb │ ├── countries.rb │ ├── currencies.rb │ ├── custom_fields.rb │ ├── emails.rb │ ├── events.rb │ ├── file_attachments.rb │ ├── file_categories.rb │ ├── lead_sources.rb │ ├── lead_statuses.rb │ ├── leads.rb │ ├── notes.rb │ ├── opportunities.rb │ ├── opportunity_categories.rb │ ├── opportunity_state_reasons.rb │ ├── organisations.rb │ ├── pipeline_stages.rb │ ├── pipelines.rb │ ├── project_categories.rb │ ├── projects.rb │ ├── relationships.rb │ ├── tags.rb │ ├── task_categories.rb │ ├── tasks.rb │ ├── team_members.rb │ ├── teams.rb │ └── users.rb │ ├── errors.rb │ ├── errors │ ├── client_error.rb │ └── resource_not_found_error.rb │ ├── resources.rb │ ├── resources │ ├── comment.rb │ ├── contact.rb │ ├── country.rb │ ├── currency.rb │ ├── custom_field.rb │ ├── email.rb │ ├── event.rb │ ├── file_attachment.rb │ ├── file_category.rb │ ├── lead.rb │ ├── lead_source.rb │ ├── lead_status.rb │ ├── note.rb │ ├── object.rb │ ├── object │ │ ├── attributes.rb │ │ └── serializers.rb │ ├── opportunity.rb │ ├── opportunity_category.rb │ ├── opportunity_state_reason.rb │ ├── organisation.rb │ ├── pipeline.rb │ ├── pipeline_stage.rb │ ├── project.rb │ ├── project_category.rb │ ├── relationship.rb │ ├── tag.rb │ ├── task.rb │ ├── task_category.rb │ ├── team.rb │ ├── team_member.rb │ └── user.rb │ ├── utils.rb │ ├── utils │ └── url_helper.rb │ └── version.rb └── spec ├── fixtures └── vcr_cassettes │ ├── create_comment_attachment.yml │ ├── create_contact.yml │ ├── create_contact_image.yml │ ├── create_email_comment.yml │ ├── create_event.yml │ ├── create_file_category.yml │ ├── create_lead.yml │ ├── create_lead_source.yml │ ├── create_lead_status.yml │ ├── create_note.yml │ ├── create_note_comment.yml │ ├── create_note_file.yml │ ├── create_opportunity.yml │ ├── create_opportunity_category.yml │ ├── create_opportunity_image.yml │ ├── create_organisation.yml │ ├── create_organisation_image.yml │ ├── create_project.yml │ ├── create_project_category.yml │ ├── create_project_image.yml │ ├── create_task.yml │ ├── create_task_category.yml │ ├── create_task_comment.yml │ ├── create_team.yml │ ├── create_team_member.yml │ ├── delete_comment.yml │ ├── delete_contact.yml │ ├── delete_contact_image.yml │ ├── delete_email.yml │ ├── delete_event.yml │ ├── delete_file_category.yml │ ├── delete_lead.yml │ ├── delete_lead_source.yml │ ├── delete_lead_status.yml │ ├── delete_note.yml │ ├── delete_opportunity.yml │ ├── delete_opportunity_category.yml │ ├── delete_opportunity_image.yml │ ├── delete_organisation.yml │ ├── delete_organisation_image.yml │ ├── delete_project.yml │ ├── delete_project_category.yml │ ├── delete_project_image.yml │ ├── delete_task.yml │ ├── delete_task_category.yml │ ├── delete_team.yml │ ├── delete_team_member.yml │ ├── get_comment.yml │ ├── get_contact.yml │ ├── get_contact_emails.yml │ ├── get_contact_image.yml │ ├── get_contact_notes.yml │ ├── get_contact_tasks.yml │ ├── get_contacts.yml │ ├── get_countries.yml │ ├── get_currencies.yml │ ├── get_custom_field.yml │ ├── get_custom_fields.yml │ ├── get_email.yml │ ├── get_email_comments.yml │ ├── get_emails.yml │ ├── get_event.yml │ ├── get_events.yml │ ├── get_file_attachment.yml │ ├── get_file_categories.yml │ ├── get_file_category.yml │ ├── get_lead.yml │ ├── get_lead_source.yml │ ├── get_lead_sources.yml │ ├── get_lead_statuses.yml │ ├── get_leads.yml │ ├── get_note.yml │ ├── get_note_comments.yml │ ├── get_notes.yml │ ├── get_opportunities.yml │ ├── get_opportunity.yml │ ├── get_opportunity_categories.yml │ ├── get_opportunity_category.yml │ ├── get_opportunity_emails.yml │ ├── get_opportunity_image.yml │ ├── get_opportunity_notes.yml │ ├── get_opportunity_state_history.yml │ ├── get_opportunity_state_reasons.yml │ ├── get_opportunity_tasks.yml │ ├── get_organisation.yml │ ├── get_organisation_emails.yml │ ├── get_organisation_image.yml │ ├── get_organisation_notes.yml │ ├── get_organisation_tasks.yml │ ├── get_organisations.yml │ ├── get_pipeline.yml │ ├── get_pipeline_stage.yml │ ├── get_pipeline_stages.yml │ ├── get_pipelines.yml │ ├── get_project.yml │ ├── get_project_categories.yml │ ├── get_project_category.yml │ ├── get_project_emails.yml │ ├── get_project_image.yml │ ├── get_project_notes.yml │ ├── get_project_tasks.yml │ ├── get_projects.yml │ ├── get_task.yml │ ├── get_task_categories.yml │ ├── get_task_category.yml │ ├── get_task_comments.yml │ ├── get_tasks.yml │ ├── get_team.yml │ ├── get_team_member.yml │ ├── get_team_members.yml │ ├── get_teams.yml │ ├── get_user.yml │ ├── get_users.yml │ ├── update_comment.yml │ ├── update_contact.yml │ ├── update_contact_image.yml │ ├── update_event.yml │ ├── update_file_category.yml │ ├── update_lead.yml │ ├── update_lead_source.yml │ ├── update_lead_status.yml │ ├── update_note.yml │ ├── update_opportunity.yml │ ├── update_opportunity_category.yml │ ├── update_opportunity_image.yml │ ├── update_organisation.yml │ ├── update_organisation_image.yml │ ├── update_project.yml │ ├── update_project_category.yml │ ├── update_project_image.yml │ ├── update_task.yml │ ├── update_task_category.yml │ ├── update_team.yml │ ├── update_team_member.yml │ └── z_insightly_client_status_check.yml ├── insightly2 ├── client_spec.rb ├── dsl │ ├── comments_spec.rb │ ├── contacts_spec.rb │ ├── countries_spec.rb │ ├── currencies_spec.rb │ ├── custom_fields_spec.rb │ ├── emails_spec.rb │ ├── events_spec.rb │ ├── file_attachments_spec.rb │ ├── file_categories_spec.rb │ ├── lead_sources_spec.rb │ ├── lead_statuses_spec.rb │ ├── leads_spec.rb │ ├── notes_spec.rb │ ├── opportunities_spec.rb │ ├── opportunity_categories_spec.rb │ ├── opportunity_state_reasons_spec.rb │ ├── organisations_spec.rb │ ├── pipeline_stages_spec.rb │ ├── pipelines_spec.rb │ ├── project_categories_spec.rb │ ├── projects_spec.rb │ ├── task_categories_spec.rb │ ├── tasks_spec.rb │ ├── team_members_spec.rb │ ├── teams_spec.rb │ └── users_spec.rb └── resources │ ├── comment_spec.rb │ ├── contact_spec.rb │ ├── custom_field_spec.rb │ ├── email_spec.rb │ ├── event_spec.rb │ ├── file_attachment_spec.rb │ ├── file_category_spec.rb │ ├── lead_source_spec.rb │ ├── lead_spec.rb │ ├── lead_status_spec.rb │ ├── note_spec.rb │ ├── opportunity_category_spec.rb │ ├── opportunity_spec.rb │ ├── organisation_spec.rb │ ├── pipeline_spec.rb │ ├── pipeline_stage_spec.rb │ ├── project_category_spec.rb │ ├── project_spec.rb │ ├── task_category_spec.rb │ ├── task_spec.rb │ ├── team_member_spec.rb │ ├── team_spec.rb │ └── user_spec.rb ├── insightly2_spec.rb └── spec_helper.rb /.gitignore: -------------------------------------------------------------------------------- 1 | /.bundle/ 2 | /.yardoc 3 | /Gemfile.lock 4 | /_yardoc/ 5 | /coverage/ 6 | /doc/ 7 | /pkg/ 8 | /spec/reports/ 9 | /tmp/ 10 | .idea/ 11 | *.bundle 12 | *.so 13 | *.o 14 | *.a 15 | *.gem 16 | mkmf.log 17 | /config/gem_secret.yml 18 | -------------------------------------------------------------------------------- /.rspec: -------------------------------------------------------------------------------- 1 | --format documentation 2 | --color 3 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: ruby 2 | rvm: 3 | - 1.9.3-p547 4 | - 2.1.2 5 | - 2.0.0-p481 6 | -------------------------------------------------------------------------------- /Gemfile: -------------------------------------------------------------------------------- 1 | source 'https://rubygems.org' 2 | 3 | # Specify your gem's dependencies in insightly.gemspec 4 | gemspec 5 | -------------------------------------------------------------------------------- /Rakefile: -------------------------------------------------------------------------------- 1 | require 'bundler/gem_tasks' 2 | require 'rspec/core/rake_task' 3 | 4 | RSpec::Core::RakeTask.new(:spec) 5 | 6 | task default: :spec 7 | -------------------------------------------------------------------------------- /config/gem_secret.yml.example: -------------------------------------------------------------------------------- 1 | insightly_api_key: 'YOUR TESTING API KEY GOES HERE' -------------------------------------------------------------------------------- /insightly2.gemspec: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | lib = File.expand_path('../lib', __FILE__) 3 | $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) 4 | require 'insightly2/version' 5 | 6 | Gem::Specification.new do |spec| 7 | spec.name = 'insightly2' 8 | spec.version = Insightly2::VERSION 9 | spec.authors = ['Alexander Semyonov', 'Michael Kompanets', 'David Iorns'] 10 | spec.email = ['al@semyonov.us', 'michael@scienceexchange.com', 'david@scienceexchange.com'] 11 | spec.summary = 'A Ruby wrapper for the Insightly v2.1 API https://api.insight.ly/v2.1/Help' 12 | spec.homepage = 'https://github.com/insightly/ruby' 13 | 14 | spec.files = `git ls-files -z`.split("\x0") 15 | spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) } 16 | spec.test_files = spec.files.grep(%r{^(test|spec|features)/}) 17 | spec.require_paths = ['lib'] 18 | 19 | spec.required_ruby_version = '>= 2.0.0' 20 | 21 | spec.add_dependency 'faraday' 22 | spec.add_dependency 'activesupport' 23 | 24 | spec.add_development_dependency 'bundler', '~> 1.6' 25 | spec.add_development_dependency 'rake', '~> 10.0' 26 | spec.add_development_dependency 'rspec', '~> 3.0.0' 27 | spec.add_development_dependency 'webmock', '~> 1.18.0' 28 | spec.add_development_dependency 'vcr' 29 | end 30 | -------------------------------------------------------------------------------- /lib/insightly2.rb: -------------------------------------------------------------------------------- 1 | require 'insightly2/version' 2 | 3 | module Insightly2 4 | autoload :Client, 'insightly2/client' 5 | autoload :DSL, 'insightly2/dsl' 6 | autoload :Resources, 'insightly2/resources' 7 | autoload :Errors, 'insightly2/errors' 8 | autoload :Utils, 'insightly2/utils' 9 | 10 | class << self 11 | # @return [String] 12 | attr_accessor :api_key 13 | attr_accessor :logger 14 | end 15 | 16 | module_function 17 | 18 | # @return [Insightly2::Client] 19 | def client 20 | if @client && @client.api_key != self.api_key 21 | @client = Client.new(Insightly2.api_key) #force new client in case api_key has changed 22 | else 23 | @client ||= Client.new(Insightly2.api_key) 24 | end 25 | end 26 | end 27 | -------------------------------------------------------------------------------- /lib/insightly2/dsl.rb: -------------------------------------------------------------------------------- 1 | require 'insightly2' 2 | 3 | module Insightly2 4 | module DSL 5 | end 6 | end 7 | 8 | require 'insightly2/dsl/comments' 9 | require 'insightly2/dsl/contacts' 10 | require 'insightly2/dsl/countries' 11 | require 'insightly2/dsl/currencies' 12 | require 'insightly2/dsl/custom_fields' 13 | require 'insightly2/dsl/emails' 14 | require 'insightly2/dsl/events' 15 | require 'insightly2/dsl/file_attachments' 16 | require 'insightly2/dsl/file_categories' 17 | require 'insightly2/dsl/leads' 18 | require 'insightly2/dsl/lead_sources' 19 | require 'insightly2/dsl/lead_statuses' 20 | require 'insightly2/dsl/notes' 21 | require 'insightly2/dsl/opportunities' 22 | require 'insightly2/dsl/opportunity_categories' 23 | require 'insightly2/dsl/opportunity_state_reasons' 24 | require 'insightly2/dsl/organisations' 25 | require 'insightly2/dsl/pipeline_stages' 26 | require 'insightly2/dsl/pipelines' 27 | require 'insightly2/dsl/project_categories' 28 | require 'insightly2/dsl/projects' 29 | require 'insightly2/dsl/relationships' 30 | require 'insightly2/dsl/tags' 31 | require 'insightly2/dsl/task_categories' 32 | require 'insightly2/dsl/tasks' 33 | require 'insightly2/dsl/team_members' 34 | require 'insightly2/dsl/teams' 35 | require 'insightly2/dsl/users' 36 | require 'insightly2/utils' 37 | 38 | module Insightly2 39 | module DSL 40 | include Comments 41 | include Contacts 42 | include Countries 43 | include Currencies 44 | include CustomFields 45 | include Emails 46 | include Events 47 | include FileAttachments 48 | include FileCategories 49 | include Leads 50 | include LeadSources 51 | include LeadStatuses 52 | include Notes 53 | include Opportunities 54 | include OpportunityCategories 55 | include OpportunityStateReasons 56 | include Organisations 57 | include PipelineStages 58 | include Pipelines 59 | include ProjectCategories 60 | include Projects 61 | include Relationships 62 | include Tags 63 | include TaskCategories 64 | include Tasks 65 | include TeamMembers 66 | include Teams 67 | include Users 68 | include Utils 69 | end 70 | end 71 | 72 | -------------------------------------------------------------------------------- /lib/insightly2/dsl/comments.rb: -------------------------------------------------------------------------------- 1 | require 'insightly2/dsl' 2 | 3 | module Insightly2 4 | module DSL::Comments 5 | # GET /v2.1/Comments/{id} 6 | # Get a comment. 7 | # @param [String, Fixnum] id A comment's ID. 8 | # @raise [ArgumentError] If the method arguments are blank. 9 | # @return [Insightly2::Resources::Comment, nil]. 10 | def get_comment(id: nil) 11 | raise ArgumentError, "ID cannot be blank" if id.blank? 12 | Resources::Comment.parse(request(:get, "Comments/#{id}")) 13 | end 14 | 15 | # POST /v2.1/Comments?c_id={c_id}&filename={filename} 16 | # Adds a file attachment to a comment. 17 | # @param [String, Fixnum] id A comment's ID. 18 | # @param [String] filename The name of the attachment. 19 | # @raise [ArgumentError] If the method arguments are blank. 20 | # @return [Faraday::Response]. 21 | def create_comment_attachment(id: nil, filename: nil) 22 | raise ArgumentError, "ID cannot be blank" if id.blank? 23 | raise ArgumentError, "Filename cannot be blank" if filename.blank? 24 | request(:post, "Comments/?c_id=#{id}&filename=#{filename}") 25 | end 26 | 27 | # PUT /v2.1/Comments 28 | # Updates a comment. 29 | # @param [Hash] comment The comment to update. 30 | # @raise [ArgumentError] If the method arguments are blank. 31 | # @return [Insightly2::Resources::Comment, nil]. 32 | def update_comment(comment: nil) 33 | raise ArgumentError, "Comment cannot be blank" if comment.blank? 34 | Resources::Comment.parse(request(:put, "Comments", comment)) 35 | end 36 | 37 | # DELETE /v2.1/Comments/{id} 38 | # Deletes a comment. 39 | # @param [String, Fixnum] id A comment's ID. 40 | # @raise [ArgumentError] If the method arguments are blank. 41 | # @return [Faraday::Response]. 42 | def delete_comment(id: nil) 43 | raise ArgumentError, "ID cannot be blank" if id.blank? 44 | request(:delete, "Comments/#{id}") 45 | end 46 | end 47 | end 48 | -------------------------------------------------------------------------------- /lib/insightly2/dsl/countries.rb: -------------------------------------------------------------------------------- 1 | require 'insightly2/dsl' 2 | 3 | module Insightly2 4 | module DSL::Countries 5 | # GET /v2.1/Countries 6 | # Get a list of countries. 7 | # @return [Array, nil]. 8 | def get_countries 9 | Resources::Country.parse(request(:get, "Countries")) 10 | end 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /lib/insightly2/dsl/currencies.rb: -------------------------------------------------------------------------------- 1 | require 'insightly2/dsl' 2 | 3 | module Insightly2 4 | module DSL::Currencies 5 | # GET /v2.1/Currencies 6 | # Get a list of currencies. 7 | # @return [Array, nil]. 8 | def get_currencies 9 | Resources::Currency.parse(request(:get, "Currencies")) 10 | end 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /lib/insightly2/dsl/custom_fields.rb: -------------------------------------------------------------------------------- 1 | require 'insightly2/dsl' 2 | 3 | module Insightly2 4 | module DSL::CustomFields 5 | # GET /v2.1/CustomFields/{id} 6 | # Get a custom field. 7 | # @param [String, Fixnum] id A CustomField's ID. 8 | # @raise [ArgumentError] If the method arguments are blank. 9 | # @return [Insightly2::Resources::CustomField, nil]. 10 | def get_custom_field(id: nil) 11 | raise ArgumentError, "ID cannot be blank" if id.blank? 12 | Resources::CustomField.parse(request(:get, "CustomFields/#{id}")) 13 | end 14 | 15 | # GET /v2.1/CustomFields 16 | # Get a list of custom fields. 17 | # @return [Array, nil]. 18 | def get_custom_fields 19 | Resources::CustomField.parse(request(:get, "CustomFields")) 20 | end 21 | end 22 | end 23 | -------------------------------------------------------------------------------- /lib/insightly2/dsl/events.rb: -------------------------------------------------------------------------------- 1 | require 'insightly2/dsl' 2 | 3 | module Insightly2 4 | module DSL::Events 5 | # GET /v2.1/Events/{id} 6 | # Get an event. 7 | # @param [String, Fixnum] id An event's ID. 8 | # @raise [ArgumentError] If the method arguments are blank. 9 | # @return [Insightly2::Resources::Event, nil]. 10 | def get_event(id: nil) 11 | raise ArgumentError, "ID cannot be blank" if id.blank? 12 | Resources::Event.parse(request(:get, "Events/#{id}")) 13 | end 14 | 15 | # GET /v2.1/Events 16 | # Get a list of events. 17 | # @return [Insightly2::Resources::Event, nil] 18 | def get_events 19 | Resources::Event.parse(request(:get, "Events")) 20 | end 21 | 22 | # POST /v2.1/Events 23 | # Create an event. 24 | # @param [Hash] event The event to create. 25 | # @raise [ArgumentError] If the method arguments are blank. 26 | # @return [Insightly2::Resources::Event, nil] 27 | def create_event(event: nil) 28 | raise ArgumentError, "Event cannot be blank" if event.blank? 29 | Resources::Event.parse(request(:post, "Events", event)) 30 | end 31 | 32 | # PUT /v2.1/Events 33 | # Update an event. 34 | # @param [Hash] event The event to update. 35 | # @raise [ArgumentError] If the method arguments are blank. 36 | # @return [Insightly2::Resources::Event, nil] 37 | def update_event(event: nil) 38 | raise ArgumentError, "Event cannot be blank" if event.blank? 39 | Resources::Event.parse(request(:put, "Events", event)) 40 | end 41 | 42 | # DELETE /v2.1/Events/{id} 43 | # Delete an event. 44 | # @param [String, Fixnum] id An event's ID. 45 | # @raise [ArgumentError] If the method arguments are blank. 46 | # @return [Faraday::Response]. 47 | def delete_event(id: nil) 48 | raise ArgumentError, "ID cannot be blank" if id.blank? 49 | request(:delete, "Events/#{id}") 50 | end 51 | end 52 | end 53 | -------------------------------------------------------------------------------- /lib/insightly2/dsl/file_attachments.rb: -------------------------------------------------------------------------------- 1 | require 'insightly2/dsl' 2 | 3 | module Insightly2 4 | module DSL::FileAttachments 5 | # GET /v2.1/FileAttachments/{id} 6 | # @param [String, Fixnum] id A file attachment's ID. 7 | # @raise [ArgumentError] If the method arguments are blank. 8 | # @return [Faraday::Response]. 9 | def get_file_attachment(id: nil) 10 | raise ArgumentError, "ID cannot be blank" if id.blank? 11 | request(:get, "FileAttachments/#{id}") 12 | end 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /lib/insightly2/dsl/file_categories.rb: -------------------------------------------------------------------------------- 1 | require 'insightly2/dsl' 2 | 3 | module Insightly2 4 | module DSL::FileCategories 5 | # GET /v2.1/FileCategories/{id} 6 | # Get a file category. 7 | # @param [String, Fixnum] id: A file category's ID. 8 | # @raise [ArgumentError] If the method arguments are blank. 9 | # @return [Insightly2::Resources::FileCategory, nil]. 10 | def get_file_category(id: nil) 11 | raise ArgumentError, "ID cannot be blank" if id.blank? 12 | Resources::FileCategory.parse(request(:get, "FileCategories/#{id}")) 13 | end 14 | 15 | # GET /v2.1/FileCategories 16 | # Get a list of file categories. 17 | # @return [Array, nil]. 18 | def get_file_categories 19 | Resources::FileCategory.parse(request(:get, "FileCategories")) 20 | end 21 | 22 | # POST /v2.1/FileCategories 23 | # Create a file category. 24 | # @param [Hash] category: File Category attributes. 25 | # @raise [ArgumentError] If the method arguments are blank. 26 | # @return [Insightly2::Resources::FileCategory, nil]. 27 | def create_file_category(category: nil) 28 | raise ArgumentError, "Category cannot be blank" if category.blank? 29 | Resources::FileCategory.parse(request(:post, "FileCategories", category)) 30 | end 31 | 32 | # PUT /v2.1/FileCategories 33 | # Update a file category. 34 | # @param [Hash] category: File Category attributes. 35 | # @raise [ArgumentError] If the method arguments are blank. 36 | # @return [Insightly2::Resources::FileCategory]. 37 | def update_file_category(category: nil) 38 | raise ArgumentError, "Category cannot be blank" if category.blank? 39 | Resources::FileCategory.parse(request(:put, "FileCategories", category)) 40 | end 41 | 42 | # DELETE /v2.1/FileCategories/{id} 43 | # Delete a file category. 44 | # @param [String, Fixnum] id: A file category's ID. 45 | # @raise [ArgumentError] If the method arguments are blank. 46 | # @return [Faraday::Response]. 47 | def delete_file_category(id: nil) 48 | raise ArgumentError, "ID cannot be blank" if id.blank? 49 | request(:delete, "FileCategories/#{id}") 50 | end 51 | end 52 | end 53 | -------------------------------------------------------------------------------- /lib/insightly2/dsl/lead_sources.rb: -------------------------------------------------------------------------------- 1 | require 'insightly2/dsl' 2 | 3 | module Insightly2 4 | module DSL::LeadSources 5 | # GET /v2.1/LeadSources 6 | # Get a list of lead sources. 7 | # @return [Array, nil]. 8 | def get_lead_sources 9 | Resources::LeadSource.parse(request(:get, "LeadSources")) 10 | end 11 | 12 | # POST /v2.1/LeadSources 13 | # Create a lead source. 14 | # @param [Hash] lead_source: The lead source to create. 15 | # @raise [ArgumentError] If the method arguments are blank. 16 | # @return [Insightly2::Resources::LeadSource, nil]. 17 | def create_lead_source(lead_source: nil) 18 | raise ArgumentError, "lead source cannot be blank" if lead_source.blank? 19 | Resources::LeadSource.parse(request(:post, "LeadSources", lead_source)) 20 | end 21 | 22 | # PUT /v2.1/LeadSources 23 | # Update a lead source. 24 | # @param [Hash] lead_source: The lead source to update. 25 | # @raise [ArgumentError] If the method arguments are blank. 26 | # @return [Insightly2::Resources::LeadSource, nil] 27 | def update_lead_source(lead_source: nil) 28 | raise ArgumentError, "lead source cannot be blank" if lead_source.blank? 29 | Resources::LeadSource.parse(request(:put, "LeadSources", lead_source)) 30 | end 31 | 32 | # DELETE /v2.1/LeadSources/{id} 33 | # Delete a lead source. 34 | # @param [String, Fixnum] id A lead source's ID. 35 | # @raise [ArgumentError] If the method arguments are blank. 36 | # @return [Faraday::Response]. 37 | def delete_lead_source(id: nil) 38 | raise ArgumentError, "ID cannot be blank" if id.blank? 39 | request(:delete, "LeadSources/#{id}") 40 | end 41 | end 42 | end 43 | -------------------------------------------------------------------------------- /lib/insightly2/dsl/lead_statuses.rb: -------------------------------------------------------------------------------- 1 | require 'insightly2/dsl' 2 | 3 | module Insightly2 4 | module DSL::LeadStatuses 5 | # GET /v2.1/LeadStatuses?includeConverted={includeConverted} 6 | # Get a list of lead statuses. 7 | # @return [Array, nil]. 8 | def get_lead_statuses(includeConverted: 'false') 9 | url = Utils::UrlHelper.build_url(path: "LeadStatuses", params: { includeConverted: includeConverted }) 10 | Resources::LeadStatus.parse(request(:get, url)) 11 | end 12 | 13 | # POST /v2.1/LeadStatuses 14 | # Create a lead status. 15 | # @param [Hash] lead_status: The lead status to create. 16 | # @raise [ArgumentError] If the method arguments are blank. 17 | # @return [Insightly2::Resources::LeadStatus, nil]. 18 | def create_lead_status(lead_status: nil) 19 | raise ArgumentError, "lead status cannot be blank" if lead_status.blank? 20 | Resources::LeadStatus.parse(request(:post, "LeadStatuses", lead_status)) 21 | end 22 | 23 | # PUT /v2.1/LeadStatuses 24 | # Update a lead status. 25 | # @param [Hash] lead_status: The lead status to update. 26 | # @raise [ArgumentError] If the method arguments are blank. 27 | # @return [Insightly2::Resources::LeadStatus, nil] 28 | def update_lead_status(lead_status: nil) 29 | raise ArgumentError, "lead status cannot be blank" if lead_status.blank? 30 | Resources::LeadStatus.parse(request(:put, "LeadStatuses", lead_status)) 31 | end 32 | 33 | # DELETE /v2.1/LeadStatuses/{id} 34 | # Delete a lead status. 35 | # @param [String, Fixnum] id A lead status's ID. 36 | # @raise [ArgumentError] If the method arguments are blank. 37 | # @return [Faraday::Response]. 38 | def delete_lead_status(id: nil) 39 | raise ArgumentError, "ID cannot be blank" if id.blank? 40 | request(:delete, "LeadStatuses/#{id}") 41 | end 42 | end 43 | end 44 | -------------------------------------------------------------------------------- /lib/insightly2/dsl/opportunity_state_reasons.rb: -------------------------------------------------------------------------------- 1 | require 'insightly2/dsl' 2 | 3 | module Insightly2 4 | module DSL::OpportunityStateReasons 5 | # GET /v2.1/OpportunityStateReasons 6 | # Get a list of opportunity state reasons. 7 | # @return [Array, nil] 8 | def get_opportunity_state_reasons 9 | Resources::OpportunityStateReason.parse(request(:get, 'OpportunityStateReasons')) 10 | end 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /lib/insightly2/dsl/pipeline_stages.rb: -------------------------------------------------------------------------------- 1 | require 'insightly2/dsl' 2 | 3 | module Insightly2 4 | module DSL::PipelineStages 5 | # GET /v2.1/PipelineStages/{id} 6 | # Get a pipeline stage. 7 | # @param [String, Fixnum] id A pipeline stage's ID. 8 | # @raise [ArgumentError] If the method arguments are blank. 9 | # @return [Insightly2::Resources::PipelineStage, nil]. 10 | def get_pipeline_stage(id: nil) 11 | raise ArgumentError, "ID cannot be blank" if id.blank? 12 | Resources::PipelineStage.parse(request(:get, "PipelineStages/#{id}")) 13 | end 14 | 15 | # GET /v2.1/PipelineStages 16 | # Get a list of pipeline stages. 17 | # @return [Array, nil] 18 | def get_pipeline_stages 19 | Resources::PipelineStage.parse(request(:get, "PipelineStages")) 20 | end 21 | end 22 | end 23 | -------------------------------------------------------------------------------- /lib/insightly2/dsl/pipelines.rb: -------------------------------------------------------------------------------- 1 | require 'insightly2/dsl' 2 | 3 | module Insightly2 4 | module DSL::Pipelines 5 | # GET /v2.1/Pipelines/{id} 6 | # Get a pipeline. 7 | # @param [String, Fixnum] id A pipeline's ID. 8 | # @raise [ArgumentError] If the method arguments are blank. 9 | # @return [Insightly2::Resources::Pipeline, nil]. 10 | def get_pipeline(id: nil) 11 | raise ArgumentError, "ID cannot be blank" if id.blank? 12 | Resources::Pipeline.parse(request(:get, "Pipelines/#{id}")) 13 | end 14 | 15 | # GET /v2.1/Pipelines 16 | # Get a list of pipelines. 17 | # @return [Insightly2::Resources::Pipeline, nil]. 18 | def get_pipelines 19 | Resources::Pipeline.parse(request(:get, "Pipelines")) 20 | end 21 | end 22 | end 23 | -------------------------------------------------------------------------------- /lib/insightly2/dsl/relationships.rb: -------------------------------------------------------------------------------- 1 | require 'insightly2/dsl' 2 | 3 | module Insightly2 4 | module DSL::Relationships 5 | # GET /v2.1/Relationships 6 | # Get a list of relationships. 7 | # @return [Array, nil]. 8 | def get_relationships 9 | Resources::Relationship.parse(request(:get, "Relationships")) 10 | end 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /lib/insightly2/dsl/tags.rb: -------------------------------------------------------------------------------- 1 | require 'insightly2/dsl' 2 | 3 | module Insightly2 4 | module DSL::Tags 5 | # GET /v2.1/Tags/{id} 6 | # Get a tag. 7 | # @param [String, Fixnum] id A Tag's ID. 8 | # @raise [ArgumentError] If the method arguments are blank. 9 | # @return [Insightly2::Resources::Tag, nil]. 10 | def get_tag(id: nil) 11 | raise ArgumentError, "ID cannot be blank" if id.blank? 12 | Resources::Tag.parse(request(:get, "Tags/#{id}")) 13 | end 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /lib/insightly2/dsl/task_categories.rb: -------------------------------------------------------------------------------- 1 | require 'insightly2/dsl' 2 | 3 | module Insightly2 4 | module DSL::TaskCategories 5 | # GET /v2.1/TaskCategories/{id} 6 | # Get a task category. 7 | # @param [String, Fixnum] id A task category's ID. 8 | # @raise [ArgumentError] If the method arguments are blank. 9 | # @return [Insightly2::Resources::TaskCategory, nil]. 10 | def get_task_category(id: nil) 11 | raise ArgumentError, "ID cannot be blank" if id.blank? 12 | Resources::TaskCategory.parse(request(:get, "TaskCategories/#{id}")) 13 | end 14 | 15 | # GET /v2.1/TaskCategories 16 | # Get a list of task categories. 17 | # @return [Insightly2::Resources::TaskCategory, nil]. 18 | def get_task_categories 19 | Resources::TaskCategory.parse(request(:get, "TaskCategories")) 20 | end 21 | 22 | # POST /v2.1/TaskCategories 23 | # Creates a task category. 24 | # @param [Hash] category The task category to create. 25 | # @raise [ArgumentError] If the method arguments are blank. 26 | # @return [Insightly2::Resources::TaskCategory, nil]. 27 | def create_task_category(category: nil) 28 | raise ArgumentError, "Category cannot be blank" if category.blank? 29 | Resources::TaskCategory.parse(request(:post, "TaskCategories", category)) 30 | end 31 | 32 | # PUT /v2.1/TaskCategories 33 | # Updates a task category. 34 | # @param [Hash] category The task category to update. 35 | # @raise [ArgumentError] If the method arguments are blank. 36 | # @return [Insightly2::Resources::TaskCategory, nil]. 37 | def update_task_category(category: nil) 38 | raise ArgumentError, "Category cannot be blank" if category.blank? 39 | Resources::TaskCategory.parse(request(:put, "TaskCategories", category)) 40 | end 41 | 42 | # DELETE /v2.1/TaskCategories/{id} 43 | # Delete a task category. 44 | # @param [String, Fixnum] id A task category's ID. 45 | # @raise [ArgumentError] If the method arguments are blank. 46 | # @return [Faraday::Response]. 47 | def delete_task_category(id: nil) 48 | raise ArgumentError, "ID cannot be blank" if id.blank? 49 | request(:delete, "TaskCategories/#{id}") 50 | end 51 | end 52 | end 53 | -------------------------------------------------------------------------------- /lib/insightly2/dsl/teams.rb: -------------------------------------------------------------------------------- 1 | require 'insightly2/dsl' 2 | 3 | module Insightly2 4 | # https://api.insight.ly/v2.1/Help/ApiController/Teams 5 | module DSL::Teams 6 | # GET /v2.1/Teams/{id} 7 | # Get a team. 8 | # @param [String, Fixnum] id A team's ID. 9 | # @raise [ArgumentError] If the method arguments are blank. 10 | # @return [Insightly2::Resources::Team]. 11 | def get_team(id: nil) 12 | raise ArgumentError, "ID cannot be blank" if id.blank? 13 | Resources::Team.parse(request(:get, "Teams/#{id}")) 14 | end 15 | 16 | # GET /v2.1/Teams 17 | # Get teams. 18 | # @return [Array, nil]. 19 | def get_teams 20 | Resources::Team.parse(request(:get, "Teams")) 21 | end 22 | 23 | # POST /v2.1/Teams 24 | # Create a team. 25 | # @param [Hash] team The team we're creating. 26 | # @raise [ArgumentError] If the method arguments are blank. 27 | # @return [Insightly2::Resources::Team, nil]. 28 | def create_team(team: nil) 29 | raise ArgumentError, "Team cannot be blank" if team.blank? 30 | Resources::Team.parse(request(:post, "Teams", team)) 31 | end 32 | 33 | # PUT /v2.1/Teams 34 | # Update a team.. 35 | # @param [Hash] team The team we're updating. 36 | # @raise [ArgumentError] If the method arguments are blank. 37 | # @return [Insightly2::Resources::Team, nil]. 38 | def update_team(team: nil) 39 | raise ArgumentError, "Team cannot be blank" if team.blank? 40 | Resources::Team.parse(request(:put, 'Teams', team)) 41 | end 42 | 43 | # DELETE /v2.1/Teams/{id} 44 | # Delete a team. 45 | # @param [String, Fixnum] id A Team's ID. 46 | # @raise [ArgumentError] If the method arguments are blank. 47 | # @return [Faraday::Response]. 48 | def delete_team(id: nil) 49 | raise ArgumentError, "ID cannot be blank" if id.blank? 50 | request(:delete, "Teams/#{id}") 51 | end 52 | end 53 | end 54 | -------------------------------------------------------------------------------- /lib/insightly2/dsl/users.rb: -------------------------------------------------------------------------------- 1 | require 'insightly2/dsl' 2 | 3 | module Insightly2 4 | module DSL::Users 5 | # GET /v2.1/Users/{id} 6 | # Get a user. 7 | # @param [String, Fixnum] id A user's ID. 8 | # @raise [ArgumentError] If the method arguments are blank. 9 | # @return [Insightly2::Resources::User, nil]. 10 | def get_user(id: nil) 11 | raise ArgumentError, "ID cannot be blank" if id.blank? 12 | Resources::User.parse(request(:get, "Users/#{id}")) 13 | end 14 | 15 | # GET /v2.1/Users 16 | # Get a list of users. 17 | # @return [Array, nil] 18 | def get_users 19 | Resources::User.parse(request(:get, "Users")) 20 | end 21 | end 22 | end 23 | -------------------------------------------------------------------------------- /lib/insightly2/errors.rb: -------------------------------------------------------------------------------- 1 | require 'insightly2' 2 | 3 | module Insightly2 4 | module Errors 5 | end 6 | end 7 | 8 | require 'insightly2/errors/resource_not_found_error' 9 | require 'insightly2/errors/client_error' 10 | 11 | -------------------------------------------------------------------------------- /lib/insightly2/errors/client_error.rb: -------------------------------------------------------------------------------- 1 | module Insightly2 2 | module Errors 3 | class ClientError < StandardError 4 | attr_reader :response 5 | def initialize(response: nil) 6 | @response = response 7 | end 8 | end 9 | end 10 | end -------------------------------------------------------------------------------- /lib/insightly2/errors/resource_not_found_error.rb: -------------------------------------------------------------------------------- 1 | require 'insightly2/errors/client_error' 2 | 3 | module Insightly2 4 | module Errors 5 | class ResourceNotFoundError < ClientError 6 | end 7 | end 8 | end -------------------------------------------------------------------------------- /lib/insightly2/resources.rb: -------------------------------------------------------------------------------- 1 | require 'insightly2' 2 | 3 | module Insightly2 4 | module Resources 5 | end 6 | end 7 | 8 | require 'insightly2/resources/object' 9 | require 'insightly2/resources/comment' 10 | require 'insightly2/resources/contact' 11 | require 'insightly2/resources/custom_field' 12 | require 'insightly2/resources/country' 13 | require 'insightly2/resources/currency' 14 | require 'insightly2/resources/email' 15 | require 'insightly2/resources/event' 16 | require 'insightly2/resources/file_attachment' 17 | require 'insightly2/resources/file_category' 18 | require 'insightly2/resources/lead' 19 | require 'insightly2/resources/lead_source' 20 | require 'insightly2/resources/lead_status' 21 | require 'insightly2/resources/note' 22 | require 'insightly2/resources/opportunity_category' 23 | require 'insightly2/resources/opportunity' 24 | require 'insightly2/resources/opportunity_state_reason' 25 | require 'insightly2/resources/organisation' 26 | require 'insightly2/resources/pipeline' 27 | require 'insightly2/resources/pipeline_stage' 28 | require 'insightly2/resources/project' 29 | require 'insightly2/resources/project_category' 30 | require 'insightly2/resources/relationship' 31 | require 'insightly2/resources/tag' 32 | require 'insightly2/resources/task_category' 33 | require 'insightly2/resources/task' 34 | require 'insightly2/resources/team_member' 35 | require 'insightly2/resources/team' 36 | require 'insightly2/resources/user' 37 | 38 | -------------------------------------------------------------------------------- /lib/insightly2/resources/comment.rb: -------------------------------------------------------------------------------- 1 | require 'insightly2/resources/object' 2 | require 'insightly2/resources/file_attachment' 3 | 4 | module Insightly2 5 | module Resources 6 | class Comment < Insightly2::Resources::Object 7 | # has_many :file_attachments, FileAttachment 8 | end 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /lib/insightly2/resources/contact.rb: -------------------------------------------------------------------------------- 1 | require 'insightly2/resources/object' 2 | 3 | module Insightly2 4 | module Resources 5 | class Contact < Insightly2::Resources::Object 6 | end 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /lib/insightly2/resources/country.rb: -------------------------------------------------------------------------------- 1 | require 'insightly2/resources/object' 2 | 3 | module Insightly2 4 | module Resources 5 | class Country < Insightly2::Resources::Object 6 | end 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /lib/insightly2/resources/currency.rb: -------------------------------------------------------------------------------- 1 | require 'insightly2/resources/object' 2 | 3 | module Insightly2 4 | module Resources 5 | class Currency < Insightly2::Resources::Object 6 | end 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /lib/insightly2/resources/custom_field.rb: -------------------------------------------------------------------------------- 1 | require 'insightly2/resources/object' 2 | 3 | module Insightly2 4 | module Resources 5 | class CustomField < Insightly2::Resources::Object 6 | end 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /lib/insightly2/resources/email.rb: -------------------------------------------------------------------------------- 1 | require 'insightly2/resources/object' 2 | 3 | module Insightly2 4 | module Resources 5 | class Email < Insightly2::Resources::Object 6 | end 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /lib/insightly2/resources/event.rb: -------------------------------------------------------------------------------- 1 | require 'insightly2/resources/object' 2 | 3 | module Insightly2 4 | module Resources 5 | class Event < Insightly2::Resources::Object 6 | end 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /lib/insightly2/resources/file_attachment.rb: -------------------------------------------------------------------------------- 1 | require 'insightly2/resources/object' 2 | 3 | module Insightly2 4 | module Resources 5 | class FileAttachment < Insightly2::Resources::Object 6 | end 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /lib/insightly2/resources/file_category.rb: -------------------------------------------------------------------------------- 1 | require 'insightly2/resources/object' 2 | 3 | module Insightly2 4 | module Resources 5 | class FileCategory < Insightly2::Resources::Object 6 | end 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /lib/insightly2/resources/lead.rb: -------------------------------------------------------------------------------- 1 | require 'insightly2/resources/object' 2 | 3 | module Insightly2 4 | module Resources 5 | class Lead < Insightly2::Resources::Object 6 | end 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /lib/insightly2/resources/lead_source.rb: -------------------------------------------------------------------------------- 1 | require 'insightly2/resources/object' 2 | 3 | module Insightly2 4 | module Resources 5 | class LeadSource < Insightly2::Resources::Object 6 | end 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /lib/insightly2/resources/lead_status.rb: -------------------------------------------------------------------------------- 1 | require 'insightly2/resources/object' 2 | 3 | module Insightly2 4 | module Resources 5 | class LeadStatus < Insightly2::Resources::Object 6 | end 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /lib/insightly2/resources/note.rb: -------------------------------------------------------------------------------- 1 | require 'insightly2/resources/object' 2 | 3 | module Insightly2 4 | module Resources 5 | class Note < Insightly2::Resources::Object 6 | end 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /lib/insightly2/resources/object.rb: -------------------------------------------------------------------------------- 1 | require 'delegate' 2 | require 'json' 3 | require 'time' 4 | 5 | module Insightly2 6 | module Resources 7 | class Object < SimpleDelegator 8 | require 'insightly2/resources/object/serializers' 9 | require 'insightly2/resources/object/attributes' 10 | 11 | include Serializers 12 | include Attributes 13 | 14 | # Define common attributes, applicable to different resources 15 | attribute :date_created_utc, Time 16 | attribute :date_updated_utc, Time 17 | 18 | def inspect 19 | "#<#{self.class.name}:#{'0x00%x' % (object_id << 1)} #{inspect_attributes}>" 20 | end 21 | 22 | private 23 | 24 | def inspect_attributes 25 | attributes.map { |key, value| "@#{key}=#{value.inspect}" }.join(' ') 26 | end 27 | end 28 | end 29 | end 30 | -------------------------------------------------------------------------------- /lib/insightly2/resources/object/attributes.rb: -------------------------------------------------------------------------------- 1 | module Insightly2::Resources::Object::Attributes 2 | module ClassMethods 3 | def attributes 4 | @attributes ||= 5 | begin 6 | if superclass.respond_to?(:attributes) 7 | superclass.attributes.dup 8 | else 9 | Hash.new { |hash, key| hash[key] = ::Object } 10 | end 11 | end 12 | end 13 | 14 | # @return [Module] module holding all attribute accessors 15 | def attributes_module 16 | @attributes_module ||= const_set(:AttributeMethods, Module.new) 17 | end 18 | 19 | def define_attribute_accessor(name, type = nil) 20 | type ||= attributes[name.to_sym] || Object 21 | attributes_module.send(:define_method, name) do 22 | deserialize_attribute(name, type) 23 | end 24 | end 25 | 26 | def attribute(name, type = String) 27 | attributes[name] = type 28 | define_attribute_accessor(name, type) 29 | end 30 | 31 | alias_method :has_many, :attribute 32 | end 33 | 34 | def self.included(base) 35 | base.extend(ClassMethods) 36 | super 37 | end 38 | 39 | def attributes 40 | {}.tap do |result| 41 | __getobj__.keys.each do |key| 42 | attribute = key.to_s.downcase 43 | result[attribute] = public_send(attribute) 44 | end 45 | end 46 | end 47 | 48 | def method_missing(name, *args, &block) 49 | attribute = name.to_s.upcase 50 | if __getobj__.key?(name.to_s.upcase) || __getobj__.key?(name.to_s.camelcase) 51 | self.class.define_attribute_accessor(name) 52 | deserialize_attribute(name, self.class.attributes[name.to_sym]) 53 | else 54 | super 55 | end 56 | end 57 | 58 | private 59 | 60 | def respond_to_missing?(name, include_all = false) 61 | __getobj__.key?(name.to_s.upcase) || __getobj__.key?(name.to_s.camelcase) || super(name, include_all) 62 | end 63 | 64 | # @param [String, Symbol] name 65 | # @param [Class, #to_s] type 66 | def deserialize_attribute(name, type) 67 | raw = __getobj__[name.to_s.upcase] || __getobj__[name.to_s.camelcase] 68 | self.class.serializer_for(type).deserialize(raw) 69 | end 70 | end 71 | -------------------------------------------------------------------------------- /lib/insightly2/resources/opportunity.rb: -------------------------------------------------------------------------------- 1 | require 'insightly2/resources/object' 2 | 3 | module Insightly2 4 | module Resources 5 | class Opportunity < Insightly2::Resources::Object 6 | end 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /lib/insightly2/resources/opportunity_category.rb: -------------------------------------------------------------------------------- 1 | require 'insightly2/resources/object' 2 | 3 | module Insightly2 4 | module Resources 5 | class OpportunityCategory < Insightly2::Resources::Object 6 | end 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /lib/insightly2/resources/opportunity_state_reason.rb: -------------------------------------------------------------------------------- 1 | require 'insightly2/resources/object' 2 | 3 | module Insightly2 4 | module Resources 5 | class OpportunityStateReason < Insightly2::Resources::Object 6 | end 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /lib/insightly2/resources/organisation.rb: -------------------------------------------------------------------------------- 1 | require 'insightly2/resources/object' 2 | 3 | module Insightly2 4 | module Resources 5 | class Organisation < Insightly2::Resources::Object 6 | end 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /lib/insightly2/resources/pipeline.rb: -------------------------------------------------------------------------------- 1 | require 'insightly2/resources/object' 2 | 3 | module Insightly2 4 | module Resources 5 | class Pipeline < Insightly2::Resources::Object 6 | end 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /lib/insightly2/resources/pipeline_stage.rb: -------------------------------------------------------------------------------- 1 | require 'insightly2/resources/object' 2 | 3 | module Insightly2 4 | module Resources 5 | class PipelineStage < Insightly2::Resources::Object 6 | end 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /lib/insightly2/resources/project.rb: -------------------------------------------------------------------------------- 1 | require 'insightly2/resources/object' 2 | 3 | module Insightly2 4 | module Resources 5 | class Project < Insightly2::Resources::Object 6 | end 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /lib/insightly2/resources/project_category.rb: -------------------------------------------------------------------------------- 1 | require 'insightly2/resources/object' 2 | 3 | module Insightly2 4 | module Resources 5 | class ProjectCategory < Insightly2::Resources::Object 6 | end 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /lib/insightly2/resources/relationship.rb: -------------------------------------------------------------------------------- 1 | require 'insightly2/resources/object' 2 | 3 | module Insightly2 4 | module Resources 5 | class Relationship < Insightly2::Resources::Object 6 | end 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /lib/insightly2/resources/tag.rb: -------------------------------------------------------------------------------- 1 | require 'insightly2/resources/object' 2 | 3 | module Insightly2 4 | module Resources 5 | class Tag < Insightly2::Resources::Object 6 | end 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /lib/insightly2/resources/task.rb: -------------------------------------------------------------------------------- 1 | require 'insightly2/resources/object' 2 | 3 | module Insightly2 4 | module Resources 5 | class Task < Insightly2::Resources::Object 6 | end 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /lib/insightly2/resources/task_category.rb: -------------------------------------------------------------------------------- 1 | require 'insightly2/resources/object' 2 | 3 | module Insightly2 4 | module Resources 5 | class TaskCategory < Insightly2::Resources::Object 6 | end 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /lib/insightly2/resources/team.rb: -------------------------------------------------------------------------------- 1 | require 'insightly2/resources/object' 2 | 3 | module Insightly2 4 | module Resources 5 | class Team < Insightly2::Resources::Object 6 | end 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /lib/insightly2/resources/team_member.rb: -------------------------------------------------------------------------------- 1 | require 'insightly2/resources/object' 2 | 3 | module Insightly2 4 | module Resources 5 | class TeamMember < Insightly2::Resources::Object 6 | end 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /lib/insightly2/resources/user.rb: -------------------------------------------------------------------------------- 1 | require 'insightly2/resources/object' 2 | 3 | module Insightly2 4 | module Resources 5 | class User < Insightly2::Resources::Object 6 | end 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /lib/insightly2/utils.rb: -------------------------------------------------------------------------------- 1 | require 'insightly2' 2 | 3 | module Insightly2 4 | module Utils 5 | end 6 | end 7 | 8 | require 'insightly2/utils/url_helper' -------------------------------------------------------------------------------- /lib/insightly2/utils/url_helper.rb: -------------------------------------------------------------------------------- 1 | module Insightly2 2 | module Utils 3 | class UrlHelper 4 | # Build a URL with a querystring containing optional params if supplied. 5 | # @param [UrlHelper] path The name of the resource path as per the URL e.g. contacts. 6 | # @param [Hash] params A hash of params we're turning into a querystring. 7 | # @return [UrlHelper] The URL of the resource with required params. 8 | def self.build_url(path: nil, params: nil) 9 | params.delete_if {|k,v| v.blank?} 10 | params = params.to_query 11 | query = path 12 | query << ("?" + params) unless params.blank? 13 | query 14 | end 15 | end 16 | end 17 | end -------------------------------------------------------------------------------- /lib/insightly2/version.rb: -------------------------------------------------------------------------------- 1 | module Insightly2 2 | VERSION = '0.2.0' 3 | end 4 | -------------------------------------------------------------------------------- /spec/fixtures/vcr_cassettes/create_comment_attachment.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://:@api.insight.ly/v2.1/Comments/?c_id=3469515&filename=1.jpg 6 | body: 7 | encoding: UTF-8 8 | string: '' 9 | headers: 10 | User-Agent: 11 | - Faraday v0.9.0 12 | Accept: 13 | - application/json 14 | Content-Type: 15 | - application/json 16 | Accept-Encoding: 17 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 18 | response: 19 | status: 20 | code: 201 21 | message: Created 22 | headers: 23 | Cache-Control: 24 | - no-cache 25 | Pragma: 26 | - no-cache 27 | Expires: 28 | - "-1" 29 | Server: 30 | - Microsoft-IIS/7.5 31 | Date: 32 | - Sat, 04 Oct 2014 16:38:16 GMT 33 | Content-Length: 34 | - '0' 35 | Set-Cookie: 36 | - snaptid=sac1prdc01ut04; path=/ 37 | body: 38 | encoding: UTF-8 39 | string: '' 40 | http_version: 41 | recorded_at: Sat, 04 Oct 2014 16:38:09 GMT 42 | recorded_with: VCR 2.9.0 43 | -------------------------------------------------------------------------------- /spec/fixtures/vcr_cassettes/create_contact.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://:@api.insight.ly/v2.1/Contacts 6 | body: 7 | encoding: UTF-8 8 | string: '{"first_name":"Shark","last_name":"Nado"}' 9 | headers: 10 | User-Agent: 11 | - Faraday v0.9.0 12 | Accept: 13 | - application/json 14 | Content-Type: 15 | - application/json 16 | Accept-Encoding: 17 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 18 | response: 19 | status: 20 | code: 201 21 | message: Created 22 | headers: 23 | Cache-Control: 24 | - no-cache 25 | Pragma: 26 | - no-cache 27 | Content-Type: 28 | - application/json; charset=utf-8 29 | Expires: 30 | - "-1" 31 | Location: 32 | - https://api.insight.ly/v2.1/Contacts/80192679 33 | Server: 34 | - Microsoft-IIS/7.5 35 | Date: 36 | - Sat, 04 Oct 2014 18:24:31 GMT 37 | Content-Length: 38 | - '470' 39 | Set-Cookie: 40 | - snaptid=sac1prdc01ut04; path=/ 41 | body: 42 | encoding: UTF-8 43 | string: '{"CONTACT_ID":80192679,"SALUTATION":null,"FIRST_NAME":"Shark","LAST_NAME":"Nado","BACKGROUND":null,"IMAGE_URL":"http://s3.amazonaws.com/insightly.userfiles/339351/","DEFAULT_LINKED_ORGANISATION":null,"DATE_CREATED_UTC":"2014-10-04 44 | 18:24:32","DATE_UPDATED_UTC":"2014-10-04 18:24:32","VISIBLE_TO":"EVERYONE","VISIBLE_TEAM_ID":null,"VISIBLE_USER_IDS":null,"CUSTOMFIELDS":[],"ADDRESSES":[],"CONTACTINFOS":[],"DATES":[],"TAGS":[],"LINKS":[],"CONTACTLINKS":[],"EMAILLINKS":[]}' 45 | http_version: 46 | recorded_at: Sat, 04 Oct 2014 18:24:25 GMT 47 | recorded_with: VCR 2.9.0 48 | -------------------------------------------------------------------------------- /spec/fixtures/vcr_cassettes/create_contact_image.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://:@api.insight.ly/v2.1/Contacts/70653019/Image/1.jpg 6 | body: 7 | encoding: UTF-8 8 | string: '' 9 | headers: 10 | User-Agent: 11 | - Faraday v0.9.0 12 | Accept: 13 | - application/json 14 | Content-Type: 15 | - application/json 16 | Accept-Encoding: 17 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 18 | response: 19 | status: 20 | code: 417 21 | message: Expectation Failed 22 | headers: 23 | Cache-Control: 24 | - no-cache 25 | Pragma: 26 | - no-cache 27 | Expires: 28 | - "-1" 29 | Server: 30 | - Microsoft-IIS/7.5 31 | Date: 32 | - Sat, 04 Oct 2014 18:27:50 GMT 33 | Content-Length: 34 | - '0' 35 | Set-Cookie: 36 | - snaptid=sac1prdc01ut04; path=/ 37 | body: 38 | encoding: UTF-8 39 | string: '' 40 | http_version: 41 | recorded_at: Sat, 04 Oct 2014 18:27:43 GMT 42 | recorded_with: VCR 2.9.0 43 | -------------------------------------------------------------------------------- /spec/fixtures/vcr_cassettes/create_email_comment.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://:@api.insight.ly/v2.1/Emails/17683283/Comments 6 | body: 7 | encoding: UTF-8 8 | string: '{"title":"Sharknado"}' 9 | headers: 10 | User-Agent: 11 | - Faraday v0.9.0 12 | Accept: 13 | - application/json 14 | Content-Type: 15 | - application/json 16 | Accept-Encoding: 17 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 18 | response: 19 | status: 20 | code: 201 21 | message: Created 22 | headers: 23 | Cache-Control: 24 | - no-cache 25 | Pragma: 26 | - no-cache 27 | Content-Type: 28 | - application/json; charset=utf-8 29 | Expires: 30 | - "-1" 31 | Location: 32 | - https://api.insight.ly/v2.1/Comments/3469728 33 | Server: 34 | - Microsoft-IIS/7.5 35 | Date: 36 | - Sat, 04 Oct 2014 22:31:56 GMT 37 | Content-Length: 38 | - '163' 39 | Set-Cookie: 40 | - snaptid=sac1prdc01ut03; path=/ 41 | body: 42 | encoding: UTF-8 43 | string: '{"COMMENT_ID":3469728,"BODY":null,"OWNER_USER_ID":607181,"DATE_CREATED_UTC":"2014-10-04 44 | 22:31:55","DATE_UPDATED_UTC":"2014-10-04 22:31:55","FILE_ATTACHMENTS":null}' 45 | http_version: 46 | recorded_at: Sat, 04 Oct 2014 22:31:48 GMT 47 | recorded_with: VCR 2.9.0 48 | -------------------------------------------------------------------------------- /spec/fixtures/vcr_cassettes/create_note_comment.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://:@api.insight.ly/v2.1/Notes/15377334/Comments 6 | body: 7 | encoding: UTF-8 8 | string: '{"title":"Look out!"}' 9 | headers: 10 | User-Agent: 11 | - Faraday v0.9.0 12 | Accept: 13 | - application/json 14 | Content-Type: 15 | - application/json 16 | Accept-Encoding: 17 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 18 | response: 19 | status: 20 | code: 201 21 | message: Created 22 | headers: 23 | Cache-Control: 24 | - no-cache 25 | Pragma: 26 | - no-cache 27 | Content-Type: 28 | - application/json; charset=utf-8 29 | Expires: 30 | - "-1" 31 | Location: 32 | - https://api.insight.ly/v2.1/Comments/3469739 33 | Server: 34 | - Microsoft-IIS/7.5 35 | Date: 36 | - Sat, 04 Oct 2014 23:30:09 GMT 37 | Content-Length: 38 | - '163' 39 | Set-Cookie: 40 | - snaptid=sac1prdc01ut04; path=/ 41 | body: 42 | encoding: UTF-8 43 | string: '{"COMMENT_ID":3469739,"BODY":null,"OWNER_USER_ID":607181,"DATE_CREATED_UTC":"2014-10-04 44 | 23:30:10","DATE_UPDATED_UTC":"2014-10-04 23:30:10","FILE_ATTACHMENTS":null}' 45 | http_version: 46 | recorded_at: Sat, 04 Oct 2014 23:30:03 GMT 47 | recorded_with: VCR 2.9.0 48 | -------------------------------------------------------------------------------- /spec/fixtures/vcr_cassettes/create_note_file.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://:@api.insight.ly/v2.1/Notes?c_id=15377334&filename=1.jpg 6 | body: 7 | encoding: UTF-8 8 | string: '' 9 | headers: 10 | User-Agent: 11 | - Faraday v0.9.0 12 | Accept: 13 | - application/json 14 | Content-Type: 15 | - application/json 16 | Accept-Encoding: 17 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 18 | response: 19 | status: 20 | code: 201 21 | message: Created 22 | headers: 23 | Cache-Control: 24 | - no-cache 25 | Pragma: 26 | - no-cache 27 | Expires: 28 | - "-1" 29 | Server: 30 | - Microsoft-IIS/7.5 31 | Date: 32 | - Sat, 04 Oct 2014 23:31:49 GMT 33 | Content-Length: 34 | - '0' 35 | Set-Cookie: 36 | - snaptid=sac1prdc01ut03; path=/ 37 | body: 38 | encoding: UTF-8 39 | string: '' 40 | http_version: 41 | recorded_at: Sat, 04 Oct 2014 23:31:43 GMT 42 | recorded_with: VCR 2.9.0 43 | -------------------------------------------------------------------------------- /spec/fixtures/vcr_cassettes/create_opportunity_image.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://:@api.insight.ly/v2.1/Opportunities/4070112/Image/1.jpg 6 | body: 7 | encoding: UTF-8 8 | string: '' 9 | headers: 10 | User-Agent: 11 | - Faraday v0.9.0 12 | Accept: 13 | - application/json 14 | Content-Type: 15 | - application/json 16 | Accept-Encoding: 17 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 18 | response: 19 | status: 20 | code: 417 21 | message: Expectation Failed 22 | headers: 23 | Cache-Control: 24 | - no-cache 25 | Pragma: 26 | - no-cache 27 | Expires: 28 | - "-1" 29 | Server: 30 | - Microsoft-IIS/7.5 31 | Date: 32 | - Sun, 05 Oct 2014 00:55:00 GMT 33 | Content-Length: 34 | - '0' 35 | Set-Cookie: 36 | - snaptid=sac1prdc01ut05; path=/ 37 | body: 38 | encoding: UTF-8 39 | string: '' 40 | http_version: 41 | recorded_at: Sun, 05 Oct 2014 00:54:53 GMT 42 | recorded_with: VCR 2.9.0 43 | -------------------------------------------------------------------------------- /spec/fixtures/vcr_cassettes/create_organisation_image.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://:@api.insight.ly/v2.1/Organisations/39831139/Image/1.jpg 6 | body: 7 | encoding: UTF-8 8 | string: '' 9 | headers: 10 | User-Agent: 11 | - Faraday v0.9.0 12 | Accept: 13 | - application/json 14 | Content-Type: 15 | - application/json 16 | Accept-Encoding: 17 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 18 | response: 19 | status: 20 | code: 417 21 | message: Expectation Failed 22 | headers: 23 | Cache-Control: 24 | - no-cache 25 | Pragma: 26 | - no-cache 27 | Expires: 28 | - "-1" 29 | Server: 30 | - Microsoft-IIS/7.5 31 | Date: 32 | - Sun, 05 Oct 2014 07:01:34 GMT 33 | Content-Length: 34 | - '0' 35 | Set-Cookie: 36 | - snaptid=sac1prdc01ut03; path=/ 37 | body: 38 | encoding: UTF-8 39 | string: '' 40 | http_version: 41 | recorded_at: Sun, 05 Oct 2014 07:01:26 GMT 42 | recorded_with: VCR 2.9.0 43 | -------------------------------------------------------------------------------- /spec/fixtures/vcr_cassettes/create_project_image.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://:@api.insight.ly/v2.1/Projects/1657941/Image/1.jpg 6 | body: 7 | encoding: UTF-8 8 | string: '' 9 | headers: 10 | User-Agent: 11 | - Faraday v0.9.0 12 | Accept: 13 | - application/json 14 | Content-Type: 15 | - application/json 16 | Accept-Encoding: 17 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 18 | response: 19 | status: 20 | code: 417 21 | message: Expectation Failed 22 | headers: 23 | Cache-Control: 24 | - no-cache 25 | Pragma: 26 | - no-cache 27 | Expires: 28 | - "-1" 29 | Server: 30 | - Microsoft-IIS/7.5 31 | Date: 32 | - Sun, 05 Oct 2014 17:06:09 GMT 33 | Content-Length: 34 | - '0' 35 | Set-Cookie: 36 | - snaptid=sac1prdc01ut06; path=/ 37 | body: 38 | encoding: UTF-8 39 | string: '' 40 | http_version: 41 | recorded_at: Sun, 05 Oct 2014 17:06:02 GMT 42 | recorded_with: VCR 2.9.0 43 | -------------------------------------------------------------------------------- /spec/fixtures/vcr_cassettes/create_task_comment.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://:@api.insight.ly/v2.1/Tasks/14694323/Comments 6 | body: 7 | encoding: UTF-8 8 | string: '{"title":"Sharknado"}' 9 | headers: 10 | User-Agent: 11 | - Faraday v0.9.0 12 | Accept: 13 | - application/json 14 | Content-Type: 15 | - application/json 16 | Accept-Encoding: 17 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 18 | response: 19 | status: 20 | code: 201 21 | message: Created 22 | headers: 23 | Cache-Control: 24 | - no-cache 25 | Pragma: 26 | - no-cache 27 | Content-Type: 28 | - application/json; charset=utf-8 29 | Expires: 30 | - "-1" 31 | Location: 32 | - https://api.insight.ly/v2.1/Comments/3470213 33 | Server: 34 | - Microsoft-IIS/7.5 35 | Date: 36 | - Sun, 05 Oct 2014 17:27:18 GMT 37 | Content-Length: 38 | - '163' 39 | Set-Cookie: 40 | - snaptid=sac1prdc01ut06; path=/ 41 | body: 42 | encoding: UTF-8 43 | string: '{"COMMENT_ID":3470213,"BODY":null,"OWNER_USER_ID":607181,"DATE_CREATED_UTC":"2014-10-05 44 | 17:27:18","DATE_UPDATED_UTC":"2014-10-05 17:27:18","FILE_ATTACHMENTS":null}' 45 | http_version: 46 | recorded_at: Sun, 05 Oct 2014 17:27:10 GMT 47 | recorded_with: VCR 2.9.0 48 | -------------------------------------------------------------------------------- /spec/fixtures/vcr_cassettes/delete_comment.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: delete 5 | uri: https://:@api.insight.ly/v2.1/Comments/3469515 6 | body: 7 | encoding: UTF-8 8 | string: '' 9 | headers: 10 | User-Agent: 11 | - Faraday v0.9.0 12 | Accept: 13 | - application/json 14 | Content-Type: 15 | - application/json 16 | Accept-Encoding: 17 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 18 | response: 19 | status: 20 | code: 202 21 | message: Accepted 22 | headers: 23 | Cache-Control: 24 | - no-cache 25 | Pragma: 26 | - no-cache 27 | Expires: 28 | - "-1" 29 | Server: 30 | - Microsoft-IIS/7.5 31 | Date: 32 | - Sat, 04 Oct 2014 16:53:18 GMT 33 | Content-Length: 34 | - '0' 35 | Set-Cookie: 36 | - snaptid=sac1prdc01ut05; path=/ 37 | body: 38 | encoding: UTF-8 39 | string: '' 40 | http_version: 41 | recorded_at: Sat, 04 Oct 2014 16:53:11 GMT 42 | recorded_with: VCR 2.9.0 43 | -------------------------------------------------------------------------------- /spec/fixtures/vcr_cassettes/delete_contact.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: delete 5 | uri: https://:@api.insight.ly/v2.1/Contacts/70653019 6 | body: 7 | encoding: UTF-8 8 | string: '' 9 | headers: 10 | User-Agent: 11 | - Faraday v0.9.0 12 | Accept: 13 | - application/json 14 | Content-Type: 15 | - application/json 16 | Accept-Encoding: 17 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 18 | response: 19 | status: 20 | code: 202 21 | message: Accepted 22 | headers: 23 | Cache-Control: 24 | - no-cache 25 | Pragma: 26 | - no-cache 27 | Expires: 28 | - "-1" 29 | Server: 30 | - Microsoft-IIS/7.5 31 | Date: 32 | - Sat, 04 Oct 2014 18:47:59 GMT 33 | Content-Length: 34 | - '0' 35 | Set-Cookie: 36 | - snaptid=sac1prdc01ut06; path=/ 37 | body: 38 | encoding: UTF-8 39 | string: '' 40 | http_version: 41 | recorded_at: Sat, 04 Oct 2014 18:47:52 GMT 42 | recorded_with: VCR 2.9.0 43 | -------------------------------------------------------------------------------- /spec/fixtures/vcr_cassettes/delete_contact_image.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: delete 5 | uri: https://:@api.insight.ly/v2.1/Contacts/70653019/Image 6 | body: 7 | encoding: UTF-8 8 | string: '' 9 | headers: 10 | User-Agent: 11 | - Faraday v0.9.0 12 | Accept: 13 | - application/json 14 | Content-Type: 15 | - application/json 16 | Accept-Encoding: 17 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 18 | response: 19 | status: 20 | code: 202 21 | message: Accepted 22 | headers: 23 | Cache-Control: 24 | - no-cache 25 | Pragma: 26 | - no-cache 27 | Expires: 28 | - "-1" 29 | Server: 30 | - Microsoft-IIS/7.5 31 | Date: 32 | - Sat, 04 Oct 2014 18:46:22 GMT 33 | Content-Length: 34 | - '0' 35 | Set-Cookie: 36 | - snaptid=sac1prdc01ut05; path=/ 37 | body: 38 | encoding: UTF-8 39 | string: '' 40 | http_version: 41 | recorded_at: Sat, 04 Oct 2014 18:46:14 GMT 42 | recorded_with: VCR 2.9.0 43 | -------------------------------------------------------------------------------- /spec/fixtures/vcr_cassettes/delete_email.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: delete 5 | uri: https://:@api.insight.ly/v2.1/Emails/17683283 6 | body: 7 | encoding: UTF-8 8 | string: '' 9 | headers: 10 | User-Agent: 11 | - Faraday v0.9.0 12 | Accept: 13 | - application/json 14 | Content-Type: 15 | - application/json 16 | Accept-Encoding: 17 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 18 | response: 19 | status: 20 | code: 202 21 | message: Accepted 22 | headers: 23 | Cache-Control: 24 | - no-cache 25 | Pragma: 26 | - no-cache 27 | Expires: 28 | - "-1" 29 | Server: 30 | - Microsoft-IIS/7.5 31 | Date: 32 | - Sat, 04 Oct 2014 22:32:59 GMT 33 | Content-Length: 34 | - '0' 35 | Set-Cookie: 36 | - snaptid=sac1prdc01ut04; path=/ 37 | body: 38 | encoding: UTF-8 39 | string: '' 40 | http_version: 41 | recorded_at: Sat, 04 Oct 2014 22:32:52 GMT 42 | recorded_with: VCR 2.9.0 43 | -------------------------------------------------------------------------------- /spec/fixtures/vcr_cassettes/delete_event.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: delete 5 | uri: https://:@api.insight.ly/v2.1/Events/2402366 6 | body: 7 | encoding: UTF-8 8 | string: '' 9 | headers: 10 | User-Agent: 11 | - Faraday v0.9.0 12 | Accept: 13 | - application/json 14 | Content-Type: 15 | - application/json 16 | Accept-Encoding: 17 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 18 | response: 19 | status: 20 | code: 202 21 | message: Accepted 22 | headers: 23 | Cache-Control: 24 | - no-cache 25 | Pragma: 26 | - no-cache 27 | Expires: 28 | - "-1" 29 | Server: 30 | - Microsoft-IIS/7.5 31 | Date: 32 | - Sat, 04 Oct 2014 22:47:01 GMT 33 | Content-Length: 34 | - '0' 35 | Set-Cookie: 36 | - snaptid=sac1prdc01ut03; path=/ 37 | body: 38 | encoding: UTF-8 39 | string: '' 40 | http_version: 41 | recorded_at: Sat, 04 Oct 2014 22:46:53 GMT 42 | recorded_with: VCR 2.9.0 43 | -------------------------------------------------------------------------------- /spec/fixtures/vcr_cassettes/delete_file_category.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: delete 5 | uri: https://:@api.insight.ly/v2.1/FileCategories/1947439 6 | body: 7 | encoding: UTF-8 8 | string: '' 9 | headers: 10 | User-Agent: 11 | - Faraday v0.9.0 12 | Accept: 13 | - application/json 14 | Content-Type: 15 | - application/json 16 | Accept-Encoding: 17 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 18 | response: 19 | status: 20 | code: 202 21 | message: Accepted 22 | headers: 23 | Cache-Control: 24 | - no-cache 25 | Pragma: 26 | - no-cache 27 | Expires: 28 | - "-1" 29 | Server: 30 | - Microsoft-IIS/7.5 31 | Date: 32 | - Sat, 04 Oct 2014 23:12:28 GMT 33 | Content-Length: 34 | - '0' 35 | Set-Cookie: 36 | - snaptid=sac1prdc01ut04; path=/ 37 | body: 38 | encoding: UTF-8 39 | string: '' 40 | http_version: 41 | recorded_at: Sat, 04 Oct 2014 23:12:20 GMT 42 | recorded_with: VCR 2.9.0 43 | -------------------------------------------------------------------------------- /spec/fixtures/vcr_cassettes/delete_lead.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: delete 5 | uri: https://:@api.insight.ly/v2.1/Leads/7246484 6 | body: 7 | encoding: UTF-8 8 | string: '' 9 | headers: 10 | User-Agent: 11 | - Faraday v0.9.2 12 | Accept: 13 | - application/json 14 | Content-Type: 15 | - application/json 16 | Accept-Encoding: 17 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 18 | response: 19 | status: 20 | code: 202 21 | message: Accepted 22 | headers: 23 | Cache-Control: 24 | - no-cache 25 | Pragma: 26 | - no-cache 27 | Expires: 28 | - "-1" 29 | Server: 30 | - Microsoft-IIS/7.5 31 | X-Powered-By: 32 | - ASP.NET 33 | Date: 34 | - Mon, 29 Feb 2016 10:10:47 GMT 35 | Content-Length: 36 | - '0' 37 | Set-Cookie: 38 | - snaptid=sac1prdc01ut05; path=/; HttpOnly; Secure 39 | body: 40 | encoding: UTF-8 41 | string: '' 42 | http_version: 43 | recorded_at: Mon, 29 Feb 2016 10:10:59 GMT 44 | recorded_with: VCR 3.0.1 45 | -------------------------------------------------------------------------------- /spec/fixtures/vcr_cassettes/delete_note.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: delete 5 | uri: https://:@api.insight.ly/v2.1/Notes/15377334 6 | body: 7 | encoding: UTF-8 8 | string: '' 9 | headers: 10 | User-Agent: 11 | - Faraday v0.9.0 12 | Accept: 13 | - application/json 14 | Content-Type: 15 | - application/json 16 | Accept-Encoding: 17 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 18 | response: 19 | status: 20 | code: 202 21 | message: Accepted 22 | headers: 23 | Cache-Control: 24 | - no-cache 25 | Pragma: 26 | - no-cache 27 | Expires: 28 | - "-1" 29 | Server: 30 | - Microsoft-IIS/7.5 31 | Date: 32 | - Sat, 04 Oct 2014 23:34:26 GMT 33 | Content-Length: 34 | - '0' 35 | Set-Cookie: 36 | - snaptid=sac1prdc01ut03; path=/ 37 | body: 38 | encoding: UTF-8 39 | string: '' 40 | http_version: 41 | recorded_at: Sat, 04 Oct 2014 23:34:19 GMT 42 | recorded_with: VCR 2.9.0 43 | -------------------------------------------------------------------------------- /spec/fixtures/vcr_cassettes/delete_opportunity.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: delete 5 | uri: https://:@api.insight.ly/v2.1/Opportunities/4070112 6 | body: 7 | encoding: UTF-8 8 | string: '' 9 | headers: 10 | User-Agent: 11 | - Faraday v0.9.0 12 | Accept: 13 | - application/json 14 | Content-Type: 15 | - application/json 16 | Accept-Encoding: 17 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 18 | response: 19 | status: 20 | code: 202 21 | message: Accepted 22 | headers: 23 | Cache-Control: 24 | - no-cache 25 | Pragma: 26 | - no-cache 27 | Expires: 28 | - "-1" 29 | Server: 30 | - Microsoft-IIS/7.5 31 | Date: 32 | - Sun, 05 Oct 2014 01:14:05 GMT 33 | Content-Length: 34 | - '0' 35 | Set-Cookie: 36 | - snaptid=sac1prdc01ut03; path=/ 37 | body: 38 | encoding: UTF-8 39 | string: '' 40 | http_version: 41 | recorded_at: Sun, 05 Oct 2014 01:13:58 GMT 42 | recorded_with: VCR 2.9.0 43 | -------------------------------------------------------------------------------- /spec/fixtures/vcr_cassettes/delete_opportunity_category.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: delete 5 | uri: https://:@api.insight.ly/v2.1/OpportunityCategories/2175382 6 | body: 7 | encoding: UTF-8 8 | string: '' 9 | headers: 10 | User-Agent: 11 | - Faraday v0.9.0 12 | Accept: 13 | - application/json 14 | Content-Type: 15 | - application/json 16 | Accept-Encoding: 17 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 18 | response: 19 | status: 20 | code: 202 21 | message: Accepted 22 | headers: 23 | Cache-Control: 24 | - no-cache 25 | Pragma: 26 | - no-cache 27 | Expires: 28 | - "-1" 29 | Server: 30 | - Microsoft-IIS/7.5 31 | Date: 32 | - Sun, 05 Oct 2014 02:24:06 GMT 33 | Content-Length: 34 | - '0' 35 | Set-Cookie: 36 | - snaptid=sac1prdc01ut05; path=/ 37 | body: 38 | encoding: UTF-8 39 | string: '' 40 | http_version: 41 | recorded_at: Sun, 05 Oct 2014 02:23:59 GMT 42 | recorded_with: VCR 2.9.0 43 | -------------------------------------------------------------------------------- /spec/fixtures/vcr_cassettes/delete_opportunity_image.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: delete 5 | uri: https://:@api.insight.ly/v2.1/Opportunities/4070112/Image 6 | body: 7 | encoding: UTF-8 8 | string: '' 9 | headers: 10 | User-Agent: 11 | - Faraday v0.9.0 12 | Accept: 13 | - application/json 14 | Content-Type: 15 | - application/json 16 | Accept-Encoding: 17 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 18 | response: 19 | status: 20 | code: 202 21 | message: Accepted 22 | headers: 23 | Cache-Control: 24 | - no-cache 25 | Pragma: 26 | - no-cache 27 | Expires: 28 | - "-1" 29 | Server: 30 | - Microsoft-IIS/7.5 31 | Date: 32 | - Sun, 05 Oct 2014 01:09:41 GMT 33 | Content-Length: 34 | - '0' 35 | Set-Cookie: 36 | - snaptid=sac1prdc01ut04; path=/ 37 | body: 38 | encoding: UTF-8 39 | string: '' 40 | http_version: 41 | recorded_at: Sun, 05 Oct 2014 01:09:34 GMT 42 | recorded_with: VCR 2.9.0 43 | -------------------------------------------------------------------------------- /spec/fixtures/vcr_cassettes/delete_organisation.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: delete 5 | uri: https://:@api.insight.ly/v2.1/Organisations/39831139 6 | body: 7 | encoding: UTF-8 8 | string: '' 9 | headers: 10 | User-Agent: 11 | - Faraday v0.9.0 12 | Accept: 13 | - application/json 14 | Content-Type: 15 | - application/json 16 | Accept-Encoding: 17 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 18 | response: 19 | status: 20 | code: 202 21 | message: Accepted 22 | headers: 23 | Cache-Control: 24 | - no-cache 25 | Pragma: 26 | - no-cache 27 | Expires: 28 | - "-1" 29 | Server: 30 | - Microsoft-IIS/7.5 31 | Date: 32 | - Sun, 05 Oct 2014 07:02:47 GMT 33 | Content-Length: 34 | - '0' 35 | Set-Cookie: 36 | - snaptid=sac1prdc01ut04; path=/ 37 | body: 38 | encoding: UTF-8 39 | string: '' 40 | http_version: 41 | recorded_at: Sun, 05 Oct 2014 07:02:41 GMT 42 | recorded_with: VCR 2.9.0 43 | -------------------------------------------------------------------------------- /spec/fixtures/vcr_cassettes/delete_organisation_image.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: delete 5 | uri: https://:@api.insight.ly/v2.1/Organisations/39831139/Image 6 | body: 7 | encoding: UTF-8 8 | string: '' 9 | headers: 10 | User-Agent: 11 | - Faraday v0.9.0 12 | Accept: 13 | - application/json 14 | Content-Type: 15 | - application/json 16 | Accept-Encoding: 17 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 18 | response: 19 | status: 20 | code: 202 21 | message: Accepted 22 | headers: 23 | Cache-Control: 24 | - no-cache 25 | Pragma: 26 | - no-cache 27 | Expires: 28 | - "-1" 29 | Server: 30 | - Microsoft-IIS/7.5 31 | Date: 32 | - Sun, 05 Oct 2014 07:02:06 GMT 33 | Content-Length: 34 | - '0' 35 | Set-Cookie: 36 | - snaptid=sac1prdc01ut06; path=/ 37 | body: 38 | encoding: UTF-8 39 | string: '' 40 | http_version: 41 | recorded_at: Sun, 05 Oct 2014 07:01:59 GMT 42 | recorded_with: VCR 2.9.0 43 | -------------------------------------------------------------------------------- /spec/fixtures/vcr_cassettes/delete_project.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: delete 5 | uri: https://:@api.insight.ly/v2.1/Projects/1657941 6 | body: 7 | encoding: UTF-8 8 | string: '' 9 | headers: 10 | User-Agent: 11 | - Faraday v0.9.0 12 | Accept: 13 | - application/json 14 | Content-Type: 15 | - application/json 16 | Accept-Encoding: 17 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 18 | response: 19 | status: 20 | code: 202 21 | message: Accepted 22 | headers: 23 | Cache-Control: 24 | - no-cache 25 | Pragma: 26 | - no-cache 27 | Expires: 28 | - "-1" 29 | Server: 30 | - Microsoft-IIS/7.5 31 | Date: 32 | - Sun, 05 Oct 2014 17:11:32 GMT 33 | Content-Length: 34 | - '0' 35 | Set-Cookie: 36 | - snaptid=sac1prdc01ut05; path=/ 37 | body: 38 | encoding: UTF-8 39 | string: '' 40 | http_version: 41 | recorded_at: Sun, 05 Oct 2014 17:11:25 GMT 42 | recorded_with: VCR 2.9.0 43 | -------------------------------------------------------------------------------- /spec/fixtures/vcr_cassettes/delete_project_category.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: delete 5 | uri: https://:@api.insight.ly/v2.1/ProjectCategories/1947441 6 | body: 7 | encoding: UTF-8 8 | string: '' 9 | headers: 10 | User-Agent: 11 | - Faraday v0.9.0 12 | Accept: 13 | - application/json 14 | Content-Type: 15 | - application/json 16 | Accept-Encoding: 17 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 18 | response: 19 | status: 20 | code: 202 21 | message: Accepted 22 | headers: 23 | Cache-Control: 24 | - no-cache 25 | Pragma: 26 | - no-cache 27 | Expires: 28 | - "-1" 29 | Server: 30 | - Microsoft-IIS/7.5 31 | Date: 32 | - Sun, 05 Oct 2014 16:49:58 GMT 33 | Content-Length: 34 | - '0' 35 | Set-Cookie: 36 | - snaptid=sac1prdc01ut04; path=/ 37 | body: 38 | encoding: UTF-8 39 | string: '' 40 | http_version: 41 | recorded_at: Sun, 05 Oct 2014 16:49:50 GMT 42 | recorded_with: VCR 2.9.0 43 | -------------------------------------------------------------------------------- /spec/fixtures/vcr_cassettes/delete_project_image.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: delete 5 | uri: https://:@api.insight.ly/v2.1/Projects/1657941/Image 6 | body: 7 | encoding: UTF-8 8 | string: '' 9 | headers: 10 | User-Agent: 11 | - Faraday v0.9.0 12 | Accept: 13 | - application/json 14 | Content-Type: 15 | - application/json 16 | Accept-Encoding: 17 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 18 | response: 19 | status: 20 | code: 202 21 | message: Accepted 22 | headers: 23 | Cache-Control: 24 | - no-cache 25 | Pragma: 26 | - no-cache 27 | Expires: 28 | - "-1" 29 | Server: 30 | - Microsoft-IIS/7.5 31 | Date: 32 | - Sun, 05 Oct 2014 17:10:50 GMT 33 | Content-Length: 34 | - '0' 35 | Set-Cookie: 36 | - snaptid=sac1prdc01ut04; path=/ 37 | body: 38 | encoding: UTF-8 39 | string: '' 40 | http_version: 41 | recorded_at: Sun, 05 Oct 2014 17:10:43 GMT 42 | recorded_with: VCR 2.9.0 43 | -------------------------------------------------------------------------------- /spec/fixtures/vcr_cassettes/delete_task.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: delete 5 | uri: https://:@api.insight.ly/v2.1/Tasks/14694323 6 | body: 7 | encoding: UTF-8 8 | string: '' 9 | headers: 10 | User-Agent: 11 | - Faraday v0.9.0 12 | Accept: 13 | - application/json 14 | Content-Type: 15 | - application/json 16 | Accept-Encoding: 17 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 18 | response: 19 | status: 20 | code: 202 21 | message: Accepted 22 | headers: 23 | Cache-Control: 24 | - no-cache 25 | Pragma: 26 | - no-cache 27 | Expires: 28 | - "-1" 29 | Server: 30 | - Microsoft-IIS/7.5 31 | Date: 32 | - Sun, 05 Oct 2014 17:29:01 GMT 33 | Content-Length: 34 | - '0' 35 | Set-Cookie: 36 | - snaptid=sac1prdc01ut04; path=/ 37 | body: 38 | encoding: UTF-8 39 | string: '' 40 | http_version: 41 | recorded_at: Sun, 05 Oct 2014 17:28:54 GMT 42 | recorded_with: VCR 2.9.0 43 | -------------------------------------------------------------------------------- /spec/fixtures/vcr_cassettes/delete_task_category.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: delete 5 | uri: https://:@api.insight.ly/v2.1/TaskCategories/1947437 6 | body: 7 | encoding: UTF-8 8 | string: '' 9 | headers: 10 | User-Agent: 11 | - Faraday v0.9.0 12 | Accept: 13 | - application/json 14 | Content-Type: 15 | - application/json 16 | Accept-Encoding: 17 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 18 | response: 19 | status: 20 | code: 202 21 | message: Accepted 22 | headers: 23 | Cache-Control: 24 | - no-cache 25 | Pragma: 26 | - no-cache 27 | Expires: 28 | - "-1" 29 | Server: 30 | - Microsoft-IIS/7.5 31 | Date: 32 | - Sun, 05 Oct 2014 17:19:07 GMT 33 | Content-Length: 34 | - '0' 35 | Set-Cookie: 36 | - snaptid=sac1prdc01ut04; path=/ 37 | body: 38 | encoding: UTF-8 39 | string: '' 40 | http_version: 41 | recorded_at: Sun, 05 Oct 2014 17:18:59 GMT 42 | recorded_with: VCR 2.9.0 43 | -------------------------------------------------------------------------------- /spec/fixtures/vcr_cassettes/delete_team.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: delete 5 | uri: https://:@api.insight.ly/v2.1/Teams/2063767 6 | body: 7 | encoding: UTF-8 8 | string: '' 9 | headers: 10 | User-Agent: 11 | - Faraday v0.9.0 12 | Accept: 13 | - application/json 14 | Content-Type: 15 | - application/json 16 | Accept-Encoding: 17 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 18 | response: 19 | status: 20 | code: 202 21 | message: Accepted 22 | headers: 23 | Cache-Control: 24 | - no-cache 25 | Pragma: 26 | - no-cache 27 | Expires: 28 | - "-1" 29 | Server: 30 | - Microsoft-IIS/7.5 31 | Date: 32 | - Sun, 05 Oct 2014 17:48:16 GMT 33 | Content-Length: 34 | - '0' 35 | Set-Cookie: 36 | - snaptid=sac1prdc01ut03; path=/ 37 | body: 38 | encoding: UTF-8 39 | string: '' 40 | http_version: 41 | recorded_at: Sun, 05 Oct 2014 17:48:09 GMT 42 | recorded_with: VCR 2.9.0 43 | -------------------------------------------------------------------------------- /spec/fixtures/vcr_cassettes/delete_team_member.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: delete 5 | uri: https://:@api.insight.ly/v2.1/TeamMembers/5016224 6 | body: 7 | encoding: UTF-8 8 | string: '' 9 | headers: 10 | User-Agent: 11 | - Faraday v0.9.0 12 | Accept: 13 | - application/json 14 | Content-Type: 15 | - application/json 16 | Accept-Encoding: 17 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 18 | response: 19 | status: 20 | code: 202 21 | message: Accepted 22 | headers: 23 | Cache-Control: 24 | - no-cache 25 | Pragma: 26 | - no-cache 27 | Expires: 28 | - "-1" 29 | Server: 30 | - Microsoft-IIS/7.5 31 | Date: 32 | - Sun, 05 Oct 2014 17:38:30 GMT 33 | Content-Length: 34 | - '0' 35 | Set-Cookie: 36 | - snaptid=sac1prdc01ut06; path=/ 37 | body: 38 | encoding: UTF-8 39 | string: '' 40 | http_version: 41 | recorded_at: Sun, 05 Oct 2014 17:38:23 GMT 42 | recorded_with: VCR 2.9.0 43 | -------------------------------------------------------------------------------- /spec/fixtures/vcr_cassettes/get_comment.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: get 5 | uri: https://:@api.insight.ly/v2.1/Comments/3469515 6 | body: 7 | encoding: UTF-8 8 | string: '' 9 | headers: 10 | User-Agent: 11 | - Faraday v0.9.0 12 | Accept: 13 | - application/json 14 | Content-Type: 15 | - application/json 16 | Accept-Encoding: 17 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 18 | response: 19 | status: 20 | code: 200 21 | message: OK 22 | headers: 23 | Cache-Control: 24 | - no-cache 25 | Pragma: 26 | - no-cache 27 | Content-Type: 28 | - application/json; charset=utf-8 29 | Expires: 30 | - "-1" 31 | Vary: 32 | - Accept-Encoding 33 | Server: 34 | - Microsoft-IIS/7.5 35 | Date: 36 | - Sat, 04 Oct 2014 16:30:31 GMT 37 | Content-Length: 38 | - '273' 39 | Set-Cookie: 40 | - snaptid=sac1prdc01ut03; path=/ 41 | body: 42 | encoding: UTF-8 43 | string: '{"COMMENT_ID":3469515,"BODY":"\r\n

Test comment.

\r\n","OWNER_USER_ID":607181,"DATE_CREATED_UTC":"2014-10-04 44 | 16:28:34","DATE_UPDATED_UTC":"2014-10-04 16:28:34","FILE_ATTACHMENTS":[]}' 45 | http_version: 46 | recorded_at: Sat, 04 Oct 2014 16:30:25 GMT 47 | recorded_with: VCR 2.9.0 48 | -------------------------------------------------------------------------------- /spec/fixtures/vcr_cassettes/get_contact.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: get 5 | uri: https://:@api.insight.ly/v2.1/Contacts/70653019 6 | body: 7 | encoding: UTF-8 8 | string: '' 9 | headers: 10 | User-Agent: 11 | - Faraday v0.9.0 12 | Accept: 13 | - application/json 14 | Content-Type: 15 | - application/json 16 | Accept-Encoding: 17 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 18 | response: 19 | status: 20 | code: 200 21 | message: OK 22 | headers: 23 | Cache-Control: 24 | - no-cache 25 | Pragma: 26 | - no-cache 27 | Content-Type: 28 | - application/json; charset=utf-8 29 | Expires: 30 | - "-1" 31 | Vary: 32 | - Accept-Encoding 33 | Server: 34 | - Microsoft-IIS/7.5 35 | Date: 36 | - Sat, 04 Oct 2014 17:38:29 GMT 37 | Content-Length: 38 | - '709' 39 | Set-Cookie: 40 | - snaptid=sac1prdc01ut04; path=/ 41 | body: 42 | encoding: UTF-8 43 | string: '{"CONTACT_ID":70653019,"SALUTATION":null,"FIRST_NAME":"John","LAST_NAME":"Smith","BACKGROUND":null,"IMAGE_URL":"http://s3.amazonaws.com/insightly.userfiles/339351/","DEFAULT_LINKED_ORGANISATION":35343491,"DATE_CREATED_UTC":"2014-07-31 44 | 16:41:51","DATE_UPDATED_UTC":"2014-10-04 17:37:41","VISIBLE_TO":"EVERYONE","VISIBLE_TEAM_ID":null,"VISIBLE_USER_IDS":null,"CUSTOMFIELDS":[],"ADDRESSES":[],"CONTACTINFOS":[{"CONTACT_INFO_ID":130210198,"TYPE":"EMAIL","SUBTYPE":null,"LABEL":"WORK","DETAIL":"test-researcher123123@test.com"},{"CONTACT_INFO_ID":145027804,"TYPE":"PHONE","SUBTYPE":null,"LABEL":"WORK","DETAIL":"12345678"}],"DATES":[],"TAGS":[{"TAG_NAME":"Requester"}],"LINKS":[{"LINK_ID":45984180,"CONTACT_ID":70653019,"OPPORTUNITY_ID":null,"ORGANISATION_ID":35343491,"PROJECT_ID":null,"SECOND_PROJECT_ID":null,"SECOND_OPPORTUNITY_ID":null,"ROLE":null,"DETAILS":null},{"LINK_ID":45984227,"CONTACT_ID":70653019,"OPPORTUNITY_ID":4070119,"ORGANISATION_ID":null,"PROJECT_ID":null,"SECOND_PROJECT_ID":null,"SECOND_OPPORTUNITY_ID":null,"ROLE":null,"DETAILS":null}],"CONTACTLINKS":[],"EMAILLINKS":[]}' 45 | http_version: 46 | recorded_at: Sat, 04 Oct 2014 17:38:23 GMT 47 | recorded_with: VCR 2.9.0 48 | -------------------------------------------------------------------------------- /spec/fixtures/vcr_cassettes/get_contact_emails.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: get 5 | uri: https://:@api.insight.ly/v2.1/Contacts/70653019/Emails 6 | body: 7 | encoding: UTF-8 8 | string: '' 9 | headers: 10 | User-Agent: 11 | - Faraday v0.9.0 12 | Accept: 13 | - application/json 14 | Content-Type: 15 | - application/json 16 | Accept-Encoding: 17 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 18 | response: 19 | status: 20 | code: 200 21 | message: OK 22 | headers: 23 | Cache-Control: 24 | - no-cache 25 | Pragma: 26 | - no-cache 27 | Content-Type: 28 | - application/json; charset=utf-8 29 | Expires: 30 | - "-1" 31 | Vary: 32 | - Accept-Encoding 33 | Server: 34 | - Microsoft-IIS/7.5 35 | Date: 36 | - Sat, 04 Oct 2014 17:43:39 GMT 37 | Content-Length: 38 | - '463' 39 | Set-Cookie: 40 | - snaptid=sac1prdc01ut04; path=/ 41 | body: 42 | encoding: UTF-8 43 | string: '[{"EMAIL_ID":17683283,"GMAIL_MESSAGE_ID":null,"EMAIL_DATE_UTC":null,"EMAIL_FROM":"apps@scienceexchange.com","EMAIL_TO":"","EMAIL_CC":"","SUBJECT":"Test","BODY":"Test","FORMAT":"HTML","SIZE":1891,"OWNER_USER_ID":607181,"DATE_CREATED_UTC":"2014-10-04 44 | 17:42:13","VISIBLE_TO":"EVERYONE","VISIBLE_TEAM_ID":null,"VISIBLE_USER_IDS":null,"FILE_ATTACHMENTS":[],"EMAILLINKS":[{"EMAIL_LINK_ID":61049665,"EMAIL_ID":17683283,"CONTACT_ID":70653019,"ORGANISATION_ID":null,"OPPORTUNITY_ID":null,"PROJECT_ID":null}]}]' 45 | http_version: 46 | recorded_at: Sat, 04 Oct 2014 17:43:32 GMT 47 | recorded_with: VCR 2.9.0 48 | -------------------------------------------------------------------------------- /spec/fixtures/vcr_cassettes/get_contact_image.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: get 5 | uri: https://:@api.insight.ly/v2.1/Contacts/70653019/Image 6 | body: 7 | encoding: UTF-8 8 | string: '' 9 | headers: 10 | User-Agent: 11 | - Faraday v0.9.0 12 | Accept: 13 | - application/json 14 | Content-Type: 15 | - application/json 16 | Accept-Encoding: 17 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 18 | response: 19 | status: 20 | code: 400 21 | message: A server exception was thrown. 22 | headers: 23 | Cache-Control: 24 | - no-cache 25 | Pragma: 26 | - no-cache 27 | Content-Length: 28 | - '76' 29 | Content-Type: 30 | - text/plain; charset=utf-8 31 | Expires: 32 | - "-1" 33 | Server: 34 | - Microsoft-IIS/7.5 35 | Date: 36 | - Sat, 04 Oct 2014 17:52:24 GMT 37 | Set-Cookie: 38 | - snaptid=sac1prdc01ut05; path=/ 39 | body: 40 | encoding: UTF-8 41 | string: Could not find file 'C:\inetpub\Insightly2WebAPIv21\Content\images\user.png'. 42 | http_version: 43 | recorded_at: Sat, 04 Oct 2014 17:52:17 GMT 44 | recorded_with: VCR 2.9.0 45 | -------------------------------------------------------------------------------- /spec/fixtures/vcr_cassettes/get_contact_notes.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: get 5 | uri: https://:@api.insight.ly/v2.1/Contacts/70653019/Notes 6 | body: 7 | encoding: UTF-8 8 | string: '' 9 | headers: 10 | User-Agent: 11 | - Faraday v0.9.0 12 | Accept: 13 | - application/json 14 | Content-Type: 15 | - application/json 16 | Accept-Encoding: 17 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 18 | response: 19 | status: 20 | code: 200 21 | message: OK 22 | headers: 23 | Cache-Control: 24 | - no-cache 25 | Pragma: 26 | - no-cache 27 | Content-Type: 28 | - application/json; charset=utf-8 29 | Expires: 30 | - "-1" 31 | Vary: 32 | - Accept-Encoding 33 | Server: 34 | - Microsoft-IIS/7.5 35 | Date: 36 | - Sat, 04 Oct 2014 17:47:06 GMT 37 | Content-Length: 38 | - '461' 39 | Set-Cookie: 40 | - snaptid=sac1prdc01ut04; path=/ 41 | body: 42 | encoding: UTF-8 43 | string: '[{"NOTE_ID":15376130,"TITLE":"John is so cool","BODY":"\r\n

He''s 44 | just an all around champ.

\r\n","LINK_SUBJECT_ID":70653019,"LINK_SUBJECT_TYPE":"Contact","OWNER_USER_ID":607181,"DATE_CREATED_UTC":"2014-10-04 45 | 17:37:58","DATE_UPDATED_UTC":"2014-10-04 17:37:58","VISIBLE_TO":"EVERYONE","VISIBLE_TEAM_ID":null,"VISIBLE_USER_IDS":null,"FILE_ATTACHMENTS":null,"NOTELINKS":[{"NOTE_LINK_ID":16814487,"NOTE_ID":15376130,"CONTACT_ID":70653019,"ORGANISATION_ID":null,"OPPORTUNITY_ID":null,"PROJECT_ID":null}]}]' 46 | http_version: 47 | recorded_at: Sat, 04 Oct 2014 17:46:58 GMT 48 | recorded_with: VCR 2.9.0 49 | -------------------------------------------------------------------------------- /spec/fixtures/vcr_cassettes/get_contact_tasks.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: get 5 | uri: https://:@api.insight.ly/v2.1/Contacts/70653019/Tasks 6 | body: 7 | encoding: UTF-8 8 | string: '' 9 | headers: 10 | User-Agent: 11 | - Faraday v0.9.0 12 | Accept: 13 | - application/json 14 | Content-Type: 15 | - application/json 16 | Accept-Encoding: 17 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 18 | response: 19 | status: 20 | code: 200 21 | message: OK 22 | headers: 23 | Cache-Control: 24 | - no-cache 25 | Pragma: 26 | - no-cache 27 | Content-Type: 28 | - application/json; charset=utf-8 29 | Expires: 30 | - "-1" 31 | Vary: 32 | - Accept-Encoding 33 | Server: 34 | - Microsoft-IIS/7.5 35 | Date: 36 | - Sat, 04 Oct 2014 17:49:23 GMT 37 | Content-Length: 38 | - '505' 39 | Set-Cookie: 40 | - snaptid=sac1prdc01ut05; path=/ 41 | body: 42 | encoding: UTF-8 43 | string: '[{"TASK_ID":16594757,"Title":"Give John a high five.","CATEGORY_ID":null,"DUE_DATE":null,"COMPLETED_DATE_UTC":null,"PUBLICLY_VISIBLE":true,"COMPLETED":false,"PROJECT_ID":null,"DETAILS":"","STATUS":"NOT 44 | STARTED","PRIORITY":2,"PERCENT_COMPLETE":0,"START_DATE":null,"ASSIGNED_BY_USER_ID":null,"PARENT_TASK_ID":null,"OWNER_VISIBLE":false,"RESPONSIBLE_USER_ID":607181,"OWNER_USER_ID":607181,"DATE_CREATED_UTC":"2014-10-04 45 | 17:38:12","DATE_UPDATED_UTC":"2014-10-04 17:38:12","TASKLINKS":[{"TASK_LINK_ID":15745525,"TASK_ID":16594757,"CONTACT_ID":70653019,"ORGANISATION_ID":null,"OPPORTUNITY_ID":null,"PROJECT_ID":null}]}]' 46 | http_version: 47 | recorded_at: Sat, 04 Oct 2014 17:49:16 GMT 48 | recorded_with: VCR 2.9.0 49 | -------------------------------------------------------------------------------- /spec/fixtures/vcr_cassettes/get_custom_field.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: get 5 | uri: https://:@api.insight.ly/v2.1/CustomFields/CONTACT_FIELD_1 6 | body: 7 | encoding: UTF-8 8 | string: '' 9 | headers: 10 | User-Agent: 11 | - Faraday v0.9.0 12 | Accept: 13 | - application/json 14 | Content-Type: 15 | - application/json 16 | Accept-Encoding: 17 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 18 | response: 19 | status: 20 | code: 200 21 | message: OK 22 | headers: 23 | Cache-Control: 24 | - no-cache 25 | Pragma: 26 | - no-cache 27 | Content-Type: 28 | - application/json; charset=utf-8 29 | Expires: 30 | - "-1" 31 | Vary: 32 | - Accept-Encoding 33 | Server: 34 | - Microsoft-IIS/7.5 35 | Date: 36 | - Sat, 04 Oct 2014 22:16:37 GMT 37 | Content-Length: 38 | - '264' 39 | Set-Cookie: 40 | - snaptid=sac1prdc01ut04; path=/ 41 | body: 42 | encoding: UTF-8 43 | string: '{"CUSTOM_FIELD_ID":"CONTACT_FIELD_1","ORDER_ID":1,"FIELD_FOR":"CONTACT","FIELD_NAME":"Boomerang","FIELD_TYPE":"TEXT","FIELD_HELP_TEXT":null,"DEFAULT_VALUE":null,"GROUP_ID":null,"CUSTOM_FIELD_OPTIONS":[]}' 44 | http_version: 45 | recorded_at: Sat, 04 Oct 2014 22:16:30 GMT 46 | recorded_with: VCR 2.9.0 47 | -------------------------------------------------------------------------------- /spec/fixtures/vcr_cassettes/get_custom_fields.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: get 5 | uri: https://:@api.insight.ly/v2.1/CustomFields 6 | body: 7 | encoding: UTF-8 8 | string: '' 9 | headers: 10 | User-Agent: 11 | - Faraday v0.9.0 12 | Accept: 13 | - application/json 14 | Content-Type: 15 | - application/json 16 | Accept-Encoding: 17 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 18 | response: 19 | status: 20 | code: 200 21 | message: OK 22 | headers: 23 | Cache-Control: 24 | - no-cache 25 | Pragma: 26 | - no-cache 27 | Content-Type: 28 | - application/json; charset=utf-8 29 | Expires: 30 | - "-1" 31 | Vary: 32 | - Accept-Encoding 33 | Server: 34 | - Microsoft-IIS/7.5 35 | Date: 36 | - Sat, 04 Oct 2014 22:15:19 GMT 37 | Content-Length: 38 | - '292' 39 | Set-Cookie: 40 | - snaptid=sac1prdc01ut04; path=/ 41 | body: 42 | encoding: UTF-8 43 | string: '[{"CUSTOM_FIELD_ID":"CONTACT_FIELD_1","ORDER_ID":1,"FIELD_FOR":"CONTACT","FIELD_NAME":"Boomerang","FIELD_TYPE":"TEXT","FIELD_HELP_TEXT":null,"DEFAULT_VALUE":null,"GROUP_ID":null,"CUSTOM_FIELD_OPTIONS":[]},{"CUSTOM_FIELD_ID":"CONTACT_FIELD_2","ORDER_ID":2,"FIELD_FOR":"CONTACT","FIELD_NAME":"Fandango","FIELD_TYPE":"TEXT","FIELD_HELP_TEXT":null,"DEFAULT_VALUE":null,"GROUP_ID":null,"CUSTOM_FIELD_OPTIONS":[]}]' 44 | http_version: 45 | recorded_at: Sat, 04 Oct 2014 22:15:12 GMT 46 | recorded_with: VCR 2.9.0 47 | -------------------------------------------------------------------------------- /spec/fixtures/vcr_cassettes/get_email.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: get 5 | uri: https://:@api.insight.ly/v2.1/Emails/17683283 6 | body: 7 | encoding: UTF-8 8 | string: '' 9 | headers: 10 | User-Agent: 11 | - Faraday v0.9.0 12 | Accept: 13 | - application/json 14 | Content-Type: 15 | - application/json 16 | Accept-Encoding: 17 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 18 | response: 19 | status: 20 | code: 200 21 | message: OK 22 | headers: 23 | Cache-Control: 24 | - no-cache 25 | Pragma: 26 | - no-cache 27 | Content-Type: 28 | - application/json; charset=utf-8 29 | Expires: 30 | - "-1" 31 | Vary: 32 | - Accept-Encoding 33 | Server: 34 | - Microsoft-IIS/7.5 35 | Date: 36 | - Sat, 04 Oct 2014 22:23:44 GMT 37 | Content-Length: 38 | - '513' 39 | Set-Cookie: 40 | - snaptid=sac1prdc01ut03; path=/ 41 | body: 42 | encoding: UTF-8 43 | string: '{"EMAIL_ID":17683283,"GMAIL_MESSAGE_ID":null,"EMAIL_DATE_UTC":null,"EMAIL_FROM":"apps@scienceexchange.com","EMAIL_TO":"","EMAIL_CC":"","SUBJECT":"Test","BODY":"\r\n
Test
\r\n","FORMAT":"HTML","SIZE":1891,"OWNER_USER_ID":607181,"DATE_CREATED_UTC":"2014-10-04 45 | 17:42:13","VISIBLE_TO":"EVERYONE","VISIBLE_TEAM_ID":null,"VISIBLE_USER_IDS":null,"FILE_ATTACHMENTS":[],"EMAILLINKS":[{"EMAIL_LINK_ID":61049652,"EMAIL_ID":17683283,"CONTACT_ID":70408796,"ORGANISATION_ID":null,"OPPORTUNITY_ID":null,"PROJECT_ID":null},{"EMAIL_LINK_ID":61054002,"EMAIL_ID":17683283,"CONTACT_ID":70653013,"ORGANISATION_ID":null,"OPPORTUNITY_ID":null,"PROJECT_ID":null}]}' 46 | http_version: 47 | recorded_at: Sat, 04 Oct 2014 22:23:37 GMT 48 | recorded_with: VCR 2.9.0 49 | -------------------------------------------------------------------------------- /spec/fixtures/vcr_cassettes/get_email_comments.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: get 5 | uri: https://:@api.insight.ly/v2.1/Emails/17683283/Comments 6 | body: 7 | encoding: UTF-8 8 | string: '' 9 | headers: 10 | User-Agent: 11 | - Faraday v0.9.0 12 | Accept: 13 | - application/json 14 | Content-Type: 15 | - application/json 16 | Accept-Encoding: 17 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 18 | response: 19 | status: 20 | code: 200 21 | message: OK 22 | headers: 23 | Cache-Control: 24 | - no-cache 25 | Pragma: 26 | - no-cache 27 | Content-Type: 28 | - application/json; charset=utf-8 29 | Expires: 30 | - "-1" 31 | Vary: 32 | - Accept-Encoding 33 | Server: 34 | - Microsoft-IIS/7.5 35 | Date: 36 | - Sat, 04 Oct 2014 22:26:36 GMT 37 | Content-Length: 38 | - '418' 39 | Set-Cookie: 40 | - snaptid=sac1prdc01ut06; path=/ 41 | body: 42 | encoding: UTF-8 43 | string: '[{"COMMENT_ID":3469725,"BODY":"\r\n

Hi tiger.

\r\n","OWNER_USER_ID":607181,"DATE_CREATED_UTC":"2014-10-04 44 | 22:20:03","DATE_UPDATED_UTC":"2014-10-04 22:20:03","FILE_ATTACHMENTS":[]},{"COMMENT_ID":3469726,"BODY":"\r\n

Kea.

\r\n","OWNER_USER_ID":607181,"DATE_CREATED_UTC":"2014-10-04 45 | 22:20:30","DATE_UPDATED_UTC":"2014-10-04 22:20:30","FILE_ATTACHMENTS":[{"FILE_ID":33105189,"FILE_NAME":"kea.jpg","CONTENT_TYPE":"image/jpeg","FILE_SIZE":234671,"FILE_CATEGORY_ID":null,"OWNER_USER_ID":607181,"DATE_CREATED_UTC":"2014-10-04 46 | 22:20:31","DATE_UPDATED_UTC":"2014-10-04 22:20:31","URL":"/fileattachments/33105189"}]}]' 47 | http_version: 48 | recorded_at: Sat, 04 Oct 2014 22:26:28 GMT 49 | recorded_with: VCR 2.9.0 50 | -------------------------------------------------------------------------------- /spec/fixtures/vcr_cassettes/get_emails.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: get 5 | uri: https://:@api.insight.ly/v2.1/Emails 6 | body: 7 | encoding: UTF-8 8 | string: '' 9 | headers: 10 | User-Agent: 11 | - Faraday v0.9.0 12 | Accept: 13 | - application/json 14 | Content-Type: 15 | - application/json 16 | Accept-Encoding: 17 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 18 | response: 19 | status: 20 | code: 200 21 | message: OK 22 | headers: 23 | Cache-Control: 24 | - no-cache 25 | Pragma: 26 | - no-cache 27 | Content-Type: 28 | - application/json; charset=utf-8 29 | Expires: 30 | - "-1" 31 | Vary: 32 | - Accept-Encoding 33 | Server: 34 | - Microsoft-IIS/7.5 35 | Date: 36 | - Sat, 04 Oct 2014 22:24:47 GMT 37 | Content-Length: 38 | - '483' 39 | Set-Cookie: 40 | - snaptid=sac1prdc01ut03; path=/ 41 | body: 42 | encoding: UTF-8 43 | string: '[{"EMAIL_ID":17683283,"GMAIL_MESSAGE_ID":null,"EMAIL_DATE_UTC":null,"EMAIL_FROM":"apps@scienceexchange.com","EMAIL_TO":"","EMAIL_CC":"","SUBJECT":"Test","BODY":"Test","FORMAT":"HTML","SIZE":1891,"OWNER_USER_ID":607181,"DATE_CREATED_UTC":"2014-10-04 44 | 17:42:13","VISIBLE_TO":"EVERYONE","VISIBLE_TEAM_ID":null,"VISIBLE_USER_IDS":null,"FILE_ATTACHMENTS":[],"EMAILLINKS":[{"EMAIL_LINK_ID":61049652,"EMAIL_ID":17683283,"CONTACT_ID":70408796,"ORGANISATION_ID":null,"OPPORTUNITY_ID":null,"PROJECT_ID":null},{"EMAIL_LINK_ID":61054002,"EMAIL_ID":17683283,"CONTACT_ID":70653013,"ORGANISATION_ID":null,"OPPORTUNITY_ID":null,"PROJECT_ID":null}]}]' 45 | http_version: 46 | recorded_at: Sat, 04 Oct 2014 22:24:39 GMT 47 | recorded_with: VCR 2.9.0 48 | -------------------------------------------------------------------------------- /spec/fixtures/vcr_cassettes/get_event.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: get 5 | uri: https://:@api.insight.ly/v2.1/Events/2402366 6 | body: 7 | encoding: UTF-8 8 | string: '' 9 | headers: 10 | User-Agent: 11 | - Faraday v0.9.0 12 | Accept: 13 | - application/json 14 | Content-Type: 15 | - application/json 16 | Accept-Encoding: 17 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 18 | response: 19 | status: 20 | code: 200 21 | message: OK 22 | headers: 23 | Cache-Control: 24 | - no-cache 25 | Pragma: 26 | - no-cache 27 | Content-Type: 28 | - application/json; charset=utf-8 29 | Expires: 30 | - "-1" 31 | Vary: 32 | - Accept-Encoding 33 | Server: 34 | - Microsoft-IIS/7.5 35 | Date: 36 | - Sat, 04 Oct 2014 22:38:21 GMT 37 | Content-Length: 38 | - '446' 39 | Set-Cookie: 40 | - snaptid=sac1prdc01ut05; path=/ 41 | body: 42 | encoding: UTF-8 43 | string: '{"EVENT_ID":2402366,"TITLE":"A tornado of sharks","LOCATION":null,"DETAILS":null,"START_DATE_UTC":"2014-10-04 44 | 23:00:00","END_DATE_UTC":"2014-10-05 00:00:00","ALL_DAY":false,"PUBLICLY_VISIBLE":true,"REMINDER_DATE_UTC":null,"REMINDER_SENT":false,"EVENTLINKS":[{"EVENT_LINK_ID":755567,"EVENT_ID":2402366,"CONTACT_ID":80192679,"ORGANISATION_ID":null,"OPPORTUNITY_ID":null,"PROJECT_ID":null}],"OWNER_USER_ID":607181,"DATE_CREATED_UTC":"2014-10-04 45 | 22:36:09","DATE_UPDATED_UTC":"2014-10-04 22:36:09"}' 46 | http_version: 47 | recorded_at: Sat, 04 Oct 2014 22:38:13 GMT 48 | recorded_with: VCR 2.9.0 49 | -------------------------------------------------------------------------------- /spec/fixtures/vcr_cassettes/get_events.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: get 5 | uri: https://:@api.insight.ly/v2.1/Events 6 | body: 7 | encoding: UTF-8 8 | string: '' 9 | headers: 10 | User-Agent: 11 | - Faraday v0.9.0 12 | Accept: 13 | - application/json 14 | Content-Type: 15 | - application/json 16 | Accept-Encoding: 17 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 18 | response: 19 | status: 20 | code: 200 21 | message: OK 22 | headers: 23 | Cache-Control: 24 | - no-cache 25 | Pragma: 26 | - no-cache 27 | Content-Type: 28 | - application/json; charset=utf-8 29 | Expires: 30 | - "-1" 31 | Vary: 32 | - Accept-Encoding 33 | Server: 34 | - Microsoft-IIS/7.5 35 | Date: 36 | - Sat, 04 Oct 2014 22:39:02 GMT 37 | Content-Length: 38 | - '447' 39 | Set-Cookie: 40 | - snaptid=sac1prdc01ut04; path=/ 41 | body: 42 | encoding: UTF-8 43 | string: '[{"EVENT_ID":2402366,"TITLE":"A tornado of sharks","LOCATION":null,"DETAILS":null,"START_DATE_UTC":"2014-10-04 44 | 23:00:00","END_DATE_UTC":"2014-10-05 00:00:00","ALL_DAY":false,"PUBLICLY_VISIBLE":true,"REMINDER_DATE_UTC":null,"REMINDER_SENT":false,"EVENTLINKS":[{"EVENT_LINK_ID":755567,"EVENT_ID":2402366,"CONTACT_ID":80192679,"ORGANISATION_ID":null,"OPPORTUNITY_ID":null,"PROJECT_ID":null}],"OWNER_USER_ID":607181,"DATE_CREATED_UTC":"2014-10-04 45 | 22:36:09","DATE_UPDATED_UTC":"2014-10-04 22:36:09"}]' 46 | http_version: 47 | recorded_at: Sat, 04 Oct 2014 22:38:55 GMT 48 | recorded_with: VCR 2.9.0 49 | -------------------------------------------------------------------------------- /spec/fixtures/vcr_cassettes/get_file_categories.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: get 5 | uri: https://:@api.insight.ly/v2.1/FileCategories 6 | body: 7 | encoding: UTF-8 8 | string: '' 9 | headers: 10 | User-Agent: 11 | - Faraday v0.9.0 12 | Accept: 13 | - application/json 14 | Content-Type: 15 | - application/json 16 | Accept-Encoding: 17 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 18 | response: 19 | status: 20 | code: 200 21 | message: OK 22 | headers: 23 | Cache-Control: 24 | - no-cache 25 | Pragma: 26 | - no-cache 27 | Content-Type: 28 | - application/json; charset=utf-8 29 | Expires: 30 | - "-1" 31 | Vary: 32 | - Accept-Encoding 33 | Server: 34 | - Microsoft-IIS/7.5 35 | Date: 36 | - Sat, 04 Oct 2014 23:05:18 GMT 37 | Content-Length: 38 | - '235' 39 | Set-Cookie: 40 | - snaptid=sac1prdc01ut03; path=/ 41 | body: 42 | encoding: UTF-8 43 | string: '[{"CATEGORY_ID":1947439,"CATEGORY_NAME":"Follow-up","ACTIVE":true,"BACKGROUND_COLOR":"2f9a84"},{"CATEGORY_ID":1947441,"CATEGORY_NAME":"Email","ACTIVE":true,"BACKGROUND_COLOR":"9a482f"}]' 44 | http_version: 45 | recorded_at: Sat, 04 Oct 2014 23:05:11 GMT 46 | recorded_with: VCR 2.9.0 47 | -------------------------------------------------------------------------------- /spec/fixtures/vcr_cassettes/get_file_category.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: get 5 | uri: https://:@api.insight.ly/v2.1/FileCategories/1947439 6 | body: 7 | encoding: UTF-8 8 | string: '' 9 | headers: 10 | User-Agent: 11 | - Faraday v0.9.0 12 | Accept: 13 | - application/json 14 | Content-Type: 15 | - application/json 16 | Accept-Encoding: 17 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 18 | response: 19 | status: 20 | code: 200 21 | message: OK 22 | headers: 23 | Cache-Control: 24 | - no-cache 25 | Pragma: 26 | - no-cache 27 | Content-Type: 28 | - application/json; charset=utf-8 29 | Expires: 30 | - "-1" 31 | Vary: 32 | - Accept-Encoding 33 | Server: 34 | - Microsoft-IIS/7.5 35 | Date: 36 | - Sat, 04 Oct 2014 23:06:24 GMT 37 | Content-Length: 38 | - '210' 39 | Set-Cookie: 40 | - snaptid=sac1prdc01ut03; path=/ 41 | body: 42 | encoding: UTF-8 43 | string: '{"CATEGORY_ID":1947439,"CATEGORY_NAME":"Follow-up","ACTIVE":true,"BACKGROUND_COLOR":"2f9a84"}' 44 | http_version: 45 | recorded_at: Sat, 04 Oct 2014 23:06:17 GMT 46 | recorded_with: VCR 2.9.0 47 | -------------------------------------------------------------------------------- /spec/fixtures/vcr_cassettes/get_lead.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: get 5 | uri: https://:@api.insight.ly/v2.1/Leads/7246484 6 | body: 7 | encoding: UTF-8 8 | string: '' 9 | headers: 10 | User-Agent: 11 | - Faraday v0.9.2 12 | Accept: 13 | - application/json 14 | Content-Type: 15 | - application/json 16 | Accept-Encoding: 17 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 18 | response: 19 | status: 20 | code: 200 21 | message: OK 22 | headers: 23 | Cache-Control: 24 | - no-cache 25 | Pragma: 26 | - no-cache 27 | Content-Type: 28 | - application/json; charset=utf-8 29 | Expires: 30 | - "-1" 31 | Vary: 32 | - Accept-Encoding 33 | Server: 34 | - Microsoft-IIS/7.5 35 | X-Powered-By: 36 | - ASP.NET 37 | Date: 38 | - Mon, 29 Feb 2016 10:08:41 GMT 39 | Content-Length: 40 | - '687' 41 | Set-Cookie: 42 | - snaptid=sac1prdc01ut05; path=/; HttpOnly; Secure 43 | body: 44 | encoding: ASCII-8BIT 45 | string: '{"LEAD_ID":7246484,"SALUTATION":null,"TITLE":null,"FIRST_NAME":null,"LAST_NAME":"Test","ORGANIZATION_NAME":"Test 46 | Org","PHONE_NUMBER":null,"MOBILE_PHONE_NUMBER":null,"FAX_NUMBER":null,"EMAIL_ADDRESS":null,"WEBSITE_URL":null,"OWNER_USER_ID":1067519,"DATE_CREATED_UTC":"2016-02-29 47 | 10:03:52","DATE_UPDATED_UTC":"2016-02-29 10:03:52","CONVERTED":false,"CONVERTED_DATE_UTC":null,"CONVERTED_CONTACT_ID":null,"CONVERTED_ORGANIZATION_ID":null,"CONVERTED_OPPORTUNITY_ID":null,"VISIBLE_TO":"EVERYONE","RESPONSIBLE_USER_ID":1067519,"INDUSTRY":null,"LEAD_STATUS_ID":841784,"LEAD_SOURCE_ID":841088,"VISIBLE_TEAM_ID":null,"EMPLOYEE_COUNT":null,"LEAD_RATING":null,"LEAD_DESCRIPTION":null,"VISIBLE_USER_IDS":null,"CUSTOMFIELDS":[],"ADDRESS_STREET":null,"ADDRESS_CITY":null,"ADDRESS_STATE":null,"ADDRESS_POSTCODE":null,"ADDRESS_COUNTRY":"South 48 | Africa","TAGS":[],"EMAIL_LINKS":[],"EVENT_LINKS":[],"TASK_LINKS":[],"NOTE_LINKS":[],"FILE_ATTACHMENTS":[],"IMAGE_URL":"http://s3.amazonaws.com/insightly.userfiles/626712/"}' 49 | http_version: 50 | recorded_at: Mon, 29 Feb 2016 10:08:52 GMT 51 | recorded_with: VCR 3.0.1 52 | -------------------------------------------------------------------------------- /spec/fixtures/vcr_cassettes/get_lead_source.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: get 5 | uri: https://:@api.insight.ly/v2.1/Leads/830626 6 | body: 7 | encoding: UTF-8 8 | string: '' 9 | headers: 10 | User-Agent: 11 | - Faraday v0.9.2 12 | Accept: 13 | - application/json 14 | Content-Type: 15 | - application/json 16 | Accept-Encoding: 17 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 18 | response: 19 | status: 20 | code: 404 21 | message: Lead Not Found 22 | headers: 23 | Cache-Control: 24 | - no-cache 25 | Pragma: 26 | - no-cache 27 | Content-Length: 28 | - '24' 29 | Content-Type: 30 | - text/plain; charset=utf-8 31 | Expires: 32 | - "-1" 33 | Server: 34 | - Microsoft-IIS/7.5 35 | X-Powered-By: 36 | - ASP.NET 37 | Date: 38 | - Fri, 26 Feb 2016 13:45:53 GMT 39 | Set-Cookie: 40 | - snaptid=sac1prdc01ut03; path=/; HttpOnly; Secure 41 | body: 42 | encoding: UTF-8 43 | string: No Lead with ID = 830626 44 | http_version: 45 | recorded_at: Fri, 26 Feb 2016 13:45:47 GMT 46 | recorded_with: VCR 3.0.1 47 | -------------------------------------------------------------------------------- /spec/fixtures/vcr_cassettes/get_lead_sources.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: get 5 | uri: https://:@api.insight.ly/v2.1/LeadSources 6 | body: 7 | encoding: UTF-8 8 | string: '' 9 | headers: 10 | User-Agent: 11 | - Faraday v0.9.2 12 | Accept: 13 | - application/json 14 | Content-Type: 15 | - application/json 16 | Accept-Encoding: 17 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 18 | response: 19 | status: 20 | code: 200 21 | message: OK 22 | headers: 23 | Cache-Control: 24 | - no-cache 25 | Pragma: 26 | - no-cache 27 | Content-Type: 28 | - application/json; charset=utf-8 29 | Expires: 30 | - "-1" 31 | Vary: 32 | - Accept-Encoding 33 | Server: 34 | - Microsoft-IIS/7.5 35 | X-Powered-By: 36 | - ASP.NET 37 | Date: 38 | - Fri, 26 Feb 2016 13:54:15 GMT 39 | Content-Length: 40 | - '315' 41 | Set-Cookie: 42 | - snaptid=sac1prdc01ut05; path=/; HttpOnly; Secure 43 | body: 44 | encoding: ASCII-8BIT 45 | string: '[{"FIELD_ORDER":0,"LEAD_SOURCE":"Partner Application","DEFAULT_VALUE":true,"LEAD_SOURCE_ID":841088},{"FIELD_ORDER":1,"LEAD_SOURCE":"Web","DEFAULT_VALUE":false,"LEAD_SOURCE_ID":830626},{"FIELD_ORDER":2,"LEAD_SOURCE":"Phone 46 | Enquiry","DEFAULT_VALUE":false,"LEAD_SOURCE_ID":830627},{"FIELD_ORDER":3,"LEAD_SOURCE":"Partner 47 | Referral","DEFAULT_VALUE":false,"LEAD_SOURCE_ID":830628},{"FIELD_ORDER":4,"LEAD_SOURCE":"Purchased 48 | List","DEFAULT_VALUE":false,"LEAD_SOURCE_ID":830629},{"FIELD_ORDER":5,"LEAD_SOURCE":"Other","DEFAULT_VALUE":false,"LEAD_SOURCE_ID":830630}]' 49 | http_version: 50 | recorded_at: Fri, 26 Feb 2016 13:54:10 GMT 51 | recorded_with: VCR 3.0.1 52 | -------------------------------------------------------------------------------- /spec/fixtures/vcr_cassettes/get_lead_statuses.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: get 5 | uri: https://:@api.insight.ly/v2.1/LeadStatuses?includeConverted=false 6 | body: 7 | encoding: UTF-8 8 | string: '' 9 | headers: 10 | User-Agent: 11 | - Faraday v0.9.2 12 | Accept: 13 | - application/json 14 | Content-Type: 15 | - application/json 16 | Accept-Encoding: 17 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 18 | response: 19 | status: 20 | code: 200 21 | message: OK 22 | headers: 23 | Cache-Control: 24 | - no-cache 25 | Pragma: 26 | - no-cache 27 | Content-Type: 28 | - application/json; charset=utf-8 29 | Expires: 30 | - "-1" 31 | Vary: 32 | - Accept-Encoding 33 | Server: 34 | - Microsoft-IIS/7.5 35 | X-Powered-By: 36 | - ASP.NET 37 | Date: 38 | - Fri, 26 Feb 2016 13:58:01 GMT 39 | Content-Length: 40 | - '277' 41 | Set-Cookie: 42 | - snaptid=sac1prdc01ut04; path=/; HttpOnly; Secure 43 | body: 44 | encoding: ASCII-8BIT 45 | string: '[{"LEAD_STATUS_ID":823514,"LEAD_STATUS":"NotContacted","DEFAULT_STATUS":true,"STATUS_TYPE":0,"FIELD_ORDER":1},{"LEAD_STATUS_ID":823515,"LEAD_STATUS":"AttemptedContact","DEFAULT_STATUS":false,"STATUS_TYPE":0,"FIELD_ORDER":2},{"LEAD_STATUS_ID":823516,"LEAD_STATUS":"Contacted","DEFAULT_STATUS":false,"STATUS_TYPE":0,"FIELD_ORDER":3},{"LEAD_STATUS_ID":823517,"LEAD_STATUS":"Disqualified","DEFAULT_STATUS":false,"STATUS_TYPE":1,"FIELD_ORDER":4}]' 46 | http_version: 47 | recorded_at: Fri, 26 Feb 2016 13:57:57 GMT 48 | recorded_with: VCR 3.0.1 49 | -------------------------------------------------------------------------------- /spec/fixtures/vcr_cassettes/get_leads.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: get 5 | uri: https://:@api.insight.ly/v2.1/Leads?includeConverted=false 6 | body: 7 | encoding: UTF-8 8 | string: '' 9 | headers: 10 | User-Agent: 11 | - Faraday v0.9.2 12 | Accept: 13 | - application/json 14 | Content-Type: 15 | - application/json 16 | Accept-Encoding: 17 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 18 | response: 19 | status: 20 | code: 200 21 | message: OK 22 | headers: 23 | Cache-Control: 24 | - no-cache 25 | Pragma: 26 | - no-cache 27 | Content-Type: 28 | - application/json; charset=utf-8 29 | Expires: 30 | - "-1" 31 | Vary: 32 | - Accept-Encoding 33 | Server: 34 | - Microsoft-IIS/7.5 35 | X-Powered-By: 36 | - ASP.NET 37 | Date: 38 | - Mon, 29 Feb 2016 10:04:02 GMT 39 | Content-Length: 40 | - '690' 41 | Set-Cookie: 42 | - snaptid=sac1prdc01ut04; path=/; HttpOnly; Secure 43 | body: 44 | encoding: ASCII-8BIT 45 | string: '[{"LEAD_ID":7246484,"SALUTATION":null,"TITLE":null,"FIRST_NAME":null,"LAST_NAME":"Test","ORGANIZATION_NAME":"Test 46 | Org","PHONE_NUMBER":null,"MOBILE_PHONE_NUMBER":null,"FAX_NUMBER":null,"EMAIL_ADDRESS":null,"WEBSITE_URL":null,"OWNER_USER_ID":1067519,"DATE_CREATED_UTC":"2016-02-29 47 | 10:03:52","DATE_UPDATED_UTC":"2016-02-29 10:03:52","CONVERTED":false,"CONVERTED_DATE_UTC":null,"CONVERTED_CONTACT_ID":null,"CONVERTED_ORGANIZATION_ID":null,"CONVERTED_OPPORTUNITY_ID":null,"VISIBLE_TO":"EVERYONE","RESPONSIBLE_USER_ID":1067519,"INDUSTRY":null,"LEAD_STATUS_ID":841784,"LEAD_SOURCE_ID":841088,"VISIBLE_TEAM_ID":null,"EMPLOYEE_COUNT":null,"LEAD_RATING":null,"LEAD_DESCRIPTION":null,"VISIBLE_USER_IDS":null,"CUSTOMFIELDS":[],"ADDRESS_STREET":null,"ADDRESS_CITY":null,"ADDRESS_STATE":null,"ADDRESS_POSTCODE":null,"ADDRESS_COUNTRY":"South 48 | Africa","TAGS":[],"EMAIL_LINKS":[],"EVENT_LINKS":[],"TASK_LINKS":[],"NOTE_LINKS":[],"FILE_ATTACHMENTS":[],"IMAGE_URL":"http://s3.amazonaws.com/insightly.userfiles/626712/"}]' 49 | http_version: 50 | recorded_at: Mon, 29 Feb 2016 10:04:14 GMT 51 | recorded_with: VCR 3.0.1 52 | -------------------------------------------------------------------------------- /spec/fixtures/vcr_cassettes/get_note.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: get 5 | uri: https://:@api.insight.ly/v2.1/Notes/15377334 6 | body: 7 | encoding: UTF-8 8 | string: '' 9 | headers: 10 | User-Agent: 11 | - Faraday v0.9.0 12 | Accept: 13 | - application/json 14 | Content-Type: 15 | - application/json 16 | Accept-Encoding: 17 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 18 | response: 19 | status: 20 | code: 200 21 | message: OK 22 | headers: 23 | Cache-Control: 24 | - no-cache 25 | Pragma: 26 | - no-cache 27 | Content-Type: 28 | - application/json; charset=utf-8 29 | Expires: 30 | - "-1" 31 | Vary: 32 | - Accept-Encoding 33 | Server: 34 | - Microsoft-IIS/7.5 35 | Date: 36 | - Sat, 04 Oct 2014 23:17:09 GMT 37 | Content-Length: 38 | - '469' 39 | Set-Cookie: 40 | - snaptid=sac1prdc01ut03; path=/ 41 | body: 42 | encoding: UTF-8 43 | string: '{"NOTE_ID":15377334,"TITLE":"Don''t mess with the nado","BODY":"\r\n

It''s 44 | indeed not advisable to mess with the nado.

\r\n","LINK_SUBJECT_ID":80192679,"LINK_SUBJECT_TYPE":"Contact","OWNER_USER_ID":607181,"DATE_CREATED_UTC":"2014-10-04 45 | 23:15:39","DATE_UPDATED_UTC":"2014-10-04 23:15:39","VISIBLE_TO":"EVERYONE","VISIBLE_TEAM_ID":null,"VISIBLE_USER_IDS":null,"FILE_ATTACHMENTS":[],"NOTELINKS":[{"NOTE_LINK_ID":16815716,"NOTE_ID":15377334,"CONTACT_ID":80192679,"ORGANISATION_ID":null,"OPPORTUNITY_ID":null,"PROJECT_ID":null}]}' 46 | http_version: 47 | recorded_at: Sat, 04 Oct 2014 23:17:02 GMT 48 | recorded_with: VCR 2.9.0 49 | -------------------------------------------------------------------------------- /spec/fixtures/vcr_cassettes/get_note_comments.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: get 5 | uri: https://:@api.insight.ly/v2.1/Notes/15377334/Comments 6 | body: 7 | encoding: UTF-8 8 | string: '' 9 | headers: 10 | User-Agent: 11 | - Faraday v0.9.0 12 | Accept: 13 | - application/json 14 | Content-Type: 15 | - application/json 16 | Accept-Encoding: 17 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 18 | response: 19 | status: 20 | code: 200 21 | message: OK 22 | headers: 23 | Cache-Control: 24 | - no-cache 25 | Pragma: 26 | - no-cache 27 | Content-Type: 28 | - application/json; charset=utf-8 29 | Expires: 30 | - "-1" 31 | Vary: 32 | - Accept-Encoding 33 | Server: 34 | - Microsoft-IIS/7.5 35 | Date: 36 | - Sat, 04 Oct 2014 23:20:19 GMT 37 | Content-Length: 38 | - '390' 39 | Set-Cookie: 40 | - snaptid=sac1prdc01ut05; path=/ 41 | body: 42 | encoding: UTF-8 43 | string: '[{"COMMENT_ID":3469737,"BODY":"\r\n

Moa says hi.

\r\n","OWNER_USER_ID":607181,"DATE_CREATED_UTC":"2014-10-04 44 | 23:15:57","DATE_UPDATED_UTC":"2014-10-04 23:15:57","FILE_ATTACHMENTS":[{"FILE_ID":33105809,"FILE_NAME":"moa.png","CONTENT_TYPE":"image/png","FILE_SIZE":180571,"FILE_CATEGORY_ID":null,"OWNER_USER_ID":607181,"DATE_CREATED_UTC":"2014-10-04 45 | 23:15:58","DATE_UPDATED_UTC":"2014-10-04 23:15:58","URL":"/fileattachments/33105809"}]}]' 46 | http_version: 47 | recorded_at: Sat, 04 Oct 2014 23:20:11 GMT 48 | recorded_with: VCR 2.9.0 49 | -------------------------------------------------------------------------------- /spec/fixtures/vcr_cassettes/get_opportunity_categories.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: get 5 | uri: https://:@api.insight.ly/v2.1/OpportunityCategories 6 | body: 7 | encoding: UTF-8 8 | string: '' 9 | headers: 10 | User-Agent: 11 | - Faraday v0.9.0 12 | Accept: 13 | - application/json 14 | Content-Type: 15 | - application/json 16 | Accept-Encoding: 17 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 18 | response: 19 | status: 20 | code: 200 21 | message: OK 22 | headers: 23 | Cache-Control: 24 | - no-cache 25 | Pragma: 26 | - no-cache 27 | Content-Type: 28 | - application/json; charset=utf-8 29 | Expires: 30 | - "-1" 31 | Vary: 32 | - Accept-Encoding 33 | Server: 34 | - Microsoft-IIS/7.5 35 | Date: 36 | - Sun, 05 Oct 2014 02:20:08 GMT 37 | Content-Length: 38 | - '240' 39 | Set-Cookie: 40 | - snaptid=sac1prdc01ut03; path=/ 41 | body: 42 | encoding: UTF-8 43 | string: '[{"CATEGORY_ID":1947441,"CATEGORY_NAME":"Email","ACTIVE":true,"BACKGROUND_COLOR":"9a482f"},{"CATEGORY_ID":2175382,"CATEGORY_NAME":"Follow-up","ACTIVE":true,"BACKGROUND_COLOR":"2f9a84"}]' 44 | http_version: 45 | recorded_at: Sun, 05 Oct 2014 02:20:01 GMT 46 | recorded_with: VCR 2.9.0 47 | -------------------------------------------------------------------------------- /spec/fixtures/vcr_cassettes/get_opportunity_category.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: get 5 | uri: https://:@api.insight.ly/v2.1/OpportunityCategories/2175382 6 | body: 7 | encoding: UTF-8 8 | string: '' 9 | headers: 10 | User-Agent: 11 | - Faraday v0.9.0 12 | Accept: 13 | - application/json 14 | Content-Type: 15 | - application/json 16 | Accept-Encoding: 17 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 18 | response: 19 | status: 20 | code: 200 21 | message: OK 22 | headers: 23 | Cache-Control: 24 | - no-cache 25 | Pragma: 26 | - no-cache 27 | Content-Type: 28 | - application/json; charset=utf-8 29 | Expires: 30 | - "-1" 31 | Vary: 32 | - Accept-Encoding 33 | Server: 34 | - Microsoft-IIS/7.5 35 | Date: 36 | - Sun, 05 Oct 2014 02:19:21 GMT 37 | Content-Length: 38 | - '210' 39 | Set-Cookie: 40 | - snaptid=sac1prdc01ut04; path=/ 41 | body: 42 | encoding: UTF-8 43 | string: '{"CATEGORY_ID":2175382,"CATEGORY_NAME":"Follow-up","ACTIVE":true,"BACKGROUND_COLOR":"2f9a84"}' 44 | http_version: 45 | recorded_at: Sun, 05 Oct 2014 02:19:13 GMT 46 | recorded_with: VCR 2.9.0 47 | -------------------------------------------------------------------------------- /spec/fixtures/vcr_cassettes/get_opportunity_emails.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: get 5 | uri: https://:@api.insight.ly/v2.1/Opportunities/4070112/Emails 6 | body: 7 | encoding: UTF-8 8 | string: '' 9 | headers: 10 | User-Agent: 11 | - Faraday v0.9.0 12 | Accept: 13 | - application/json 14 | Content-Type: 15 | - application/json 16 | Accept-Encoding: 17 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 18 | response: 19 | status: 20 | code: 200 21 | message: OK 22 | headers: 23 | Cache-Control: 24 | - no-cache 25 | Pragma: 26 | - no-cache 27 | Content-Type: 28 | - application/json; charset=utf-8 29 | Expires: 30 | - "-1" 31 | Vary: 32 | - Accept-Encoding 33 | Server: 34 | - Microsoft-IIS/7.5 35 | Date: 36 | - Sun, 05 Oct 2014 00:00:58 GMT 37 | Content-Length: 38 | - '495' 39 | Set-Cookie: 40 | - snaptid=sac1prdc01ut06; path=/ 41 | body: 42 | encoding: UTF-8 43 | string: '[{"EMAIL_ID":17684953,"GMAIL_MESSAGE_ID":null,"EMAIL_DATE_UTC":null,"EMAIL_FROM":"apps@scienceexchange.com","EMAIL_TO":"","EMAIL_CC":"","SUBJECT":"A 44 | less than interesting email","BODY":"Told you","FORMAT":"HTML","SIZE":2075,"OWNER_USER_ID":607181,"DATE_CREATED_UTC":"2014-10-04 45 | 23:55:52","VISIBLE_TO":"EVERYONE","VISIBLE_TEAM_ID":null,"VISIBLE_USER_IDS":null,"FILE_ATTACHMENTS":[],"EMAILLINKS":[{"EMAIL_LINK_ID":61055125,"EMAIL_ID":17684953,"CONTACT_ID":null,"ORGANISATION_ID":null,"OPPORTUNITY_ID":4070112,"PROJECT_ID":null}]}]' 46 | http_version: 47 | recorded_at: Sun, 05 Oct 2014 00:00:51 GMT 48 | recorded_with: VCR 2.9.0 49 | -------------------------------------------------------------------------------- /spec/fixtures/vcr_cassettes/get_opportunity_image.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: get 5 | uri: https://:@api.insight.ly/v2.1/Opportunities/4070112/Image 6 | body: 7 | encoding: UTF-8 8 | string: '' 9 | headers: 10 | User-Agent: 11 | - Faraday v0.9.0 12 | Accept: 13 | - application/json 14 | Content-Type: 15 | - application/json 16 | Accept-Encoding: 17 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 18 | response: 19 | status: 20 | code: 400 21 | message: A server exception was thrown. 22 | headers: 23 | Cache-Control: 24 | - no-cache 25 | Pragma: 26 | - no-cache 27 | Content-Length: 28 | - '88' 29 | Content-Type: 30 | - text/plain; charset=utf-8 31 | Expires: 32 | - "-1" 33 | Server: 34 | - Microsoft-IIS/7.5 35 | Date: 36 | - Sun, 05 Oct 2014 00:24:06 GMT 37 | Set-Cookie: 38 | - snaptid=sac1prdc01ut03; path=/ 39 | body: 40 | encoding: UTF-8 41 | string: Could not find file 'C:\inetpub\Insightly2WebAPIv21\Content\images\opportunity-icon.png'. 42 | http_version: 43 | recorded_at: Sun, 05 Oct 2014 00:23:59 GMT 44 | recorded_with: VCR 2.9.0 45 | -------------------------------------------------------------------------------- /spec/fixtures/vcr_cassettes/get_opportunity_notes.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: get 5 | uri: https://:@api.insight.ly/v2.1/Opportunities/4070112/Notes 6 | body: 7 | encoding: UTF-8 8 | string: '' 9 | headers: 10 | User-Agent: 11 | - Faraday v0.9.0 12 | Accept: 13 | - application/json 14 | Content-Type: 15 | - application/json 16 | Accept-Encoding: 17 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 18 | response: 19 | status: 20 | code: 200 21 | message: OK 22 | headers: 23 | Cache-Control: 24 | - no-cache 25 | Pragma: 26 | - no-cache 27 | Content-Type: 28 | - application/json; charset=utf-8 29 | Expires: 30 | - "-1" 31 | Vary: 32 | - Accept-Encoding 33 | Server: 34 | - Microsoft-IIS/7.5 35 | Date: 36 | - Sun, 05 Oct 2014 00:14:23 GMT 37 | Content-Length: 38 | - '447' 39 | Set-Cookie: 40 | - snaptid=sac1prdc01ut06; path=/ 41 | body: 42 | encoding: UTF-8 43 | string: '[{"NOTE_ID":15377449,"TITLE":"Notey","BODY":"\r\n

Note note. I love 44 | note.

\r\n","LINK_SUBJECT_ID":4070112,"LINK_SUBJECT_TYPE":"Opportunity","OWNER_USER_ID":607181,"DATE_CREATED_UTC":"2014-10-04 45 | 23:57:23","DATE_UPDATED_UTC":"2014-10-04 23:57:23","VISIBLE_TO":"EVERYONE","VISIBLE_TEAM_ID":null,"VISIBLE_USER_IDS":null,"FILE_ATTACHMENTS":[],"NOTELINKS":[{"NOTE_LINK_ID":16815831,"NOTE_ID":15377449,"CONTACT_ID":null,"ORGANISATION_ID":null,"OPPORTUNITY_ID":4070112,"PROJECT_ID":null}]}]' 46 | http_version: 47 | recorded_at: Sun, 05 Oct 2014 00:14:17 GMT 48 | recorded_with: VCR 2.9.0 49 | -------------------------------------------------------------------------------- /spec/fixtures/vcr_cassettes/get_opportunity_state_reasons.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: get 5 | uri: https://:@api.insight.ly/v2.1/OpportunityStateReasons 6 | body: 7 | encoding: UTF-8 8 | string: '' 9 | headers: 10 | User-Agent: 11 | - Faraday v0.9.0 12 | Accept: 13 | - application/json 14 | Content-Type: 15 | - application/json 16 | Accept-Encoding: 17 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 18 | response: 19 | status: 20 | code: 200 21 | message: OK 22 | headers: 23 | Cache-Control: 24 | - no-cache 25 | Pragma: 26 | - no-cache 27 | Content-Type: 28 | - application/json; charset=utf-8 29 | Expires: 30 | - "-1" 31 | Vary: 32 | - Accept-Encoding 33 | Server: 34 | - Microsoft-IIS/7.5 35 | Date: 36 | - Sun, 05 Oct 2014 06:14:54 GMT 37 | Content-Length: 38 | - '248' 39 | Set-Cookie: 40 | - snaptid=sac1prdc01ut03; path=/ 41 | body: 42 | encoding: UTF-8 43 | string: '[{"OPPORTUNITY_ID":0,"DATE_CHANGED_UTC":"0001-01-01 00:00:00","FOR_OPPORTUNITY_STATE":"Open","STATE_REASON_ID":121098,"STATE_REASON":"The 44 | quest for the grail"}]' 45 | http_version: 46 | recorded_at: Sun, 05 Oct 2014 06:14:46 GMT 47 | recorded_with: VCR 2.9.0 48 | -------------------------------------------------------------------------------- /spec/fixtures/vcr_cassettes/get_opportunity_tasks.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: get 5 | uri: https://:@api.insight.ly/v2.1/Opportunities/4070112/Tasks 6 | body: 7 | encoding: UTF-8 8 | string: '' 9 | headers: 10 | User-Agent: 11 | - Faraday v0.9.0 12 | Accept: 13 | - application/json 14 | Content-Type: 15 | - application/json 16 | Accept-Encoding: 17 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 18 | response: 19 | status: 20 | code: 200 21 | message: OK 22 | headers: 23 | Cache-Control: 24 | - no-cache 25 | Pragma: 26 | - no-cache 27 | Content-Type: 28 | - application/json; charset=utf-8 29 | Expires: 30 | - "-1" 31 | Vary: 32 | - Accept-Encoding 33 | Server: 34 | - Microsoft-IIS/7.5 35 | Date: 36 | - Sun, 05 Oct 2014 00:40:29 GMT 37 | Content-Length: 38 | - '539' 39 | Set-Cookie: 40 | - snaptid=sac1prdc01ut06; path=/ 41 | body: 42 | encoding: UTF-8 43 | string: '[{"TASK_ID":14694327,"Title":"Project Posted - Call or email requester","CATEGORY_ID":1947439,"DUE_DATE":"2014-04-23 44 | 00:00:00","COMPLETED_DATE_UTC":null,"PUBLICLY_VISIBLE":true,"COMPLETED":false,"PROJECT_ID":null,"DETAILS":"Project 45 | Posted - Call or email requester","STATUS":"NOT STARTED","PRIORITY":null,"PERCENT_COMPLETE":0,"START_DATE":null,"ASSIGNED_BY_USER_ID":null,"PARENT_TASK_ID":null,"OWNER_VISIBLE":false,"RESPONSIBLE_USER_ID":607181,"OWNER_USER_ID":607181,"DATE_CREATED_UTC":"2014-07-31 46 | 16:43:50","DATE_UPDATED_UTC":"2014-07-31 16:43:50","TASKLINKS":[{"TASK_LINK_ID":13912969,"TASK_ID":14694327,"CONTACT_ID":null,"ORGANISATION_ID":null,"OPPORTUNITY_ID":4070112,"PROJECT_ID":null}]}]' 47 | http_version: 48 | recorded_at: Sun, 05 Oct 2014 00:40:22 GMT 49 | recorded_with: VCR 2.9.0 50 | -------------------------------------------------------------------------------- /spec/fixtures/vcr_cassettes/get_organisation_emails.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: get 5 | uri: https://:@api.insight.ly/v2.1/Organisations/39831139/Emails 6 | body: 7 | encoding: UTF-8 8 | string: '' 9 | headers: 10 | User-Agent: 11 | - Faraday v0.9.0 12 | Accept: 13 | - application/json 14 | Content-Type: 15 | - application/json 16 | Accept-Encoding: 17 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 18 | response: 19 | status: 20 | code: 200 21 | message: OK 22 | headers: 23 | Cache-Control: 24 | - no-cache 25 | Pragma: 26 | - no-cache 27 | Content-Type: 28 | - application/json; charset=utf-8 29 | Expires: 30 | - "-1" 31 | Vary: 32 | - Accept-Encoding 33 | Server: 34 | - Microsoft-IIS/7.5 35 | Date: 36 | - Sun, 05 Oct 2014 07:01:30 GMT 37 | Content-Length: 38 | - '495' 39 | Set-Cookie: 40 | - snaptid=sac1prdc01ut06; path=/ 41 | body: 42 | encoding: UTF-8 43 | string: '[{"EMAIL_ID":17684953,"GMAIL_MESSAGE_ID":null,"EMAIL_DATE_UTC":null,"EMAIL_FROM":"apps@scienceexchange.com","EMAIL_TO":"","EMAIL_CC":"","SUBJECT":"A 44 | less than interesting email","BODY":"Told you","FORMAT":"HTML","SIZE":2075,"OWNER_USER_ID":607181,"DATE_CREATED_UTC":"2014-10-04 45 | 23:55:52","VISIBLE_TO":"EVERYONE","VISIBLE_TEAM_ID":null,"VISIBLE_USER_IDS":null,"FILE_ATTACHMENTS":[],"EMAILLINKS":[{"EMAIL_LINK_ID":61058077,"EMAIL_ID":17684953,"CONTACT_ID":null,"ORGANISATION_ID":39831139,"OPPORTUNITY_ID":null,"PROJECT_ID":null}]}]' 46 | http_version: 47 | recorded_at: Sun, 05 Oct 2014 07:01:22 GMT 48 | recorded_with: VCR 2.9.0 49 | -------------------------------------------------------------------------------- /spec/fixtures/vcr_cassettes/get_organisation_image.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: get 5 | uri: https://:@api.insight.ly/v2.1/Organisations/39831139/Image 6 | body: 7 | encoding: UTF-8 8 | string: '' 9 | headers: 10 | User-Agent: 11 | - Faraday v0.9.0 12 | Accept: 13 | - application/json 14 | Content-Type: 15 | - application/json 16 | Accept-Encoding: 17 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 18 | response: 19 | status: 20 | code: 400 21 | message: Bad Request 22 | headers: 23 | Cache-Control: 24 | - no-cache 25 | Pragma: 26 | - no-cache 27 | Expires: 28 | - "-1" 29 | Server: 30 | - Microsoft-IIS/7.5 31 | Date: 32 | - Sun, 05 Oct 2014 07:01:30 GMT 33 | Content-Length: 34 | - '0' 35 | Set-Cookie: 36 | - snaptid=sac1prdc01ut06; path=/ 37 | body: 38 | encoding: UTF-8 39 | string: '' 40 | http_version: 41 | recorded_at: Sun, 05 Oct 2014 07:01:23 GMT 42 | recorded_with: VCR 2.9.0 43 | -------------------------------------------------------------------------------- /spec/fixtures/vcr_cassettes/get_organisation_notes.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: get 5 | uri: https://:@api.insight.ly/v2.1/Organisations/39831139/Notes 6 | body: 7 | encoding: UTF-8 8 | string: '' 9 | headers: 10 | User-Agent: 11 | - Faraday v0.9.0 12 | Accept: 13 | - application/json 14 | Content-Type: 15 | - application/json 16 | Accept-Encoding: 17 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 18 | response: 19 | status: 20 | code: 200 21 | message: OK 22 | headers: 23 | Cache-Control: 24 | - no-cache 25 | Pragma: 26 | - no-cache 27 | Content-Type: 28 | - application/json; charset=utf-8 29 | Expires: 30 | - "-1" 31 | Vary: 32 | - Accept-Encoding 33 | Server: 34 | - Microsoft-IIS/7.5 35 | Date: 36 | - Sun, 05 Oct 2014 07:01:31 GMT 37 | Content-Length: 38 | - '427' 39 | Set-Cookie: 40 | - snaptid=sac1prdc01ut04; path=/ 41 | body: 42 | encoding: UTF-8 43 | string: '[{"NOTE_ID":15377947,"TITLE":"Notey","BODY":null,"LINK_SUBJECT_ID":39831139,"LINK_SUBJECT_TYPE":"Organisation","OWNER_USER_ID":607181,"DATE_CREATED_UTC":"2014-10-05 44 | 06:58:47","DATE_UPDATED_UTC":"2014-10-05 06:58:47","VISIBLE_TO":"EVERYONE","VISIBLE_TEAM_ID":null,"VISIBLE_USER_IDS":null,"FILE_ATTACHMENTS":[],"NOTELINKS":[{"NOTE_LINK_ID":16816332,"NOTE_ID":15377947,"CONTACT_ID":null,"ORGANISATION_ID":39831139,"OPPORTUNITY_ID":null,"PROJECT_ID":null}]}]' 45 | http_version: 46 | recorded_at: Sun, 05 Oct 2014 07:01:24 GMT 47 | recorded_with: VCR 2.9.0 48 | -------------------------------------------------------------------------------- /spec/fixtures/vcr_cassettes/get_organisation_tasks.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: get 5 | uri: https://:@api.insight.ly/v2.1/Organisations/39831139/Tasks 6 | body: 7 | encoding: UTF-8 8 | string: '' 9 | headers: 10 | User-Agent: 11 | - Faraday v0.9.0 12 | Accept: 13 | - application/json 14 | Content-Type: 15 | - application/json 16 | Accept-Encoding: 17 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 18 | response: 19 | status: 20 | code: 200 21 | message: OK 22 | headers: 23 | Cache-Control: 24 | - no-cache 25 | Pragma: 26 | - no-cache 27 | Content-Type: 28 | - application/json; charset=utf-8 29 | Expires: 30 | - "-1" 31 | Vary: 32 | - Accept-Encoding 33 | Server: 34 | - Microsoft-IIS/7.5 35 | Date: 36 | - Sun, 05 Oct 2014 07:01:32 GMT 37 | Content-Length: 38 | - '491' 39 | Set-Cookie: 40 | - snaptid=sac1prdc01ut03; path=/ 41 | body: 42 | encoding: UTF-8 43 | string: '[{"TASK_ID":16597921,"Title":"Task","CATEGORY_ID":null,"DUE_DATE":null,"COMPLETED_DATE_UTC":null,"PUBLICLY_VISIBLE":true,"COMPLETED":false,"PROJECT_ID":null,"DETAILS":"","STATUS":"NOT 44 | STARTED","PRIORITY":2,"PERCENT_COMPLETE":0,"START_DATE":null,"ASSIGNED_BY_USER_ID":null,"PARENT_TASK_ID":null,"OWNER_VISIBLE":false,"RESPONSIBLE_USER_ID":607181,"OWNER_USER_ID":607181,"DATE_CREATED_UTC":"2014-10-05 45 | 06:58:54","DATE_UPDATED_UTC":"2014-10-05 06:58:54","TASKLINKS":[{"TASK_LINK_ID":15748581,"TASK_ID":16597921,"CONTACT_ID":null,"ORGANISATION_ID":39831139,"OPPORTUNITY_ID":null,"PROJECT_ID":null}]}]' 46 | http_version: 47 | recorded_at: Sun, 05 Oct 2014 07:01:24 GMT 48 | recorded_with: VCR 2.9.0 49 | -------------------------------------------------------------------------------- /spec/fixtures/vcr_cassettes/get_pipeline.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: get 5 | uri: https://:@api.insight.ly/v2.1/Pipelines/124170 6 | body: 7 | encoding: UTF-8 8 | string: '' 9 | headers: 10 | User-Agent: 11 | - Faraday v0.9.0 12 | Accept: 13 | - application/json 14 | Content-Type: 15 | - application/json 16 | Accept-Encoding: 17 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 18 | response: 19 | status: 20 | code: 200 21 | message: OK 22 | headers: 23 | Cache-Control: 24 | - no-cache 25 | Pragma: 26 | - no-cache 27 | Content-Type: 28 | - application/json; charset=utf-8 29 | Expires: 30 | - "-1" 31 | Vary: 32 | - Accept-Encoding 33 | Server: 34 | - Microsoft-IIS/7.5 35 | Date: 36 | - Sun, 05 Oct 2014 16:42:19 GMT 37 | Content-Length: 38 | - '228' 39 | Set-Cookie: 40 | - snaptid=sac1prdc01ut05; path=/ 41 | body: 42 | encoding: UTF-8 43 | string: '{"PIPELINE_ID":124170,"PIPELINE_NAME":"Awesome!","FOR_OPPORTUNITIES":true,"FOR_PROJECTS":false,"OWNER_USER_ID":607181}' 44 | http_version: 45 | recorded_at: Sun, 05 Oct 2014 16:42:12 GMT 46 | recorded_with: VCR 2.9.0 47 | -------------------------------------------------------------------------------- /spec/fixtures/vcr_cassettes/get_pipeline_stage.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: get 5 | uri: https://:@api.insight.ly/v2.1/PipelineStages/377384 6 | body: 7 | encoding: UTF-8 8 | string: '' 9 | headers: 10 | User-Agent: 11 | - Faraday v0.9.0 12 | Accept: 13 | - application/json 14 | Content-Type: 15 | - application/json 16 | Accept-Encoding: 17 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 18 | response: 19 | status: 20 | code: 200 21 | message: OK 22 | headers: 23 | Cache-Control: 24 | - no-cache 25 | Pragma: 26 | - no-cache 27 | Content-Type: 28 | - application/json; charset=utf-8 29 | Expires: 30 | - "-1" 31 | Vary: 32 | - Accept-Encoding 33 | Server: 34 | - Microsoft-IIS/7.5 35 | Date: 36 | - Sun, 05 Oct 2014 16:35:56 GMT 37 | Content-Length: 38 | - '215' 39 | Set-Cookie: 40 | - snaptid=sac1prdc01ut06; path=/ 41 | body: 42 | encoding: UTF-8 43 | string: '{"PIPELINE_ID":124170,"STAGE_ID":377384,"STAGE_NAME":"Awaiting quotes","STAGE_ORDER":1,"OWNER_USER_ID":607181}' 44 | http_version: 45 | recorded_at: Sun, 05 Oct 2014 16:35:48 GMT 46 | recorded_with: VCR 2.9.0 47 | -------------------------------------------------------------------------------- /spec/fixtures/vcr_cassettes/get_pipeline_stages.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: get 5 | uri: https://:@api.insight.ly/v2.1/PipelineStages 6 | body: 7 | encoding: UTF-8 8 | string: '' 9 | headers: 10 | User-Agent: 11 | - Faraday v0.9.0 12 | Accept: 13 | - application/json 14 | Content-Type: 15 | - application/json 16 | Accept-Encoding: 17 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 18 | response: 19 | status: 20 | code: 200 21 | message: OK 22 | headers: 23 | Cache-Control: 24 | - no-cache 25 | Pragma: 26 | - no-cache 27 | Content-Type: 28 | - application/json; charset=utf-8 29 | Expires: 30 | - "-1" 31 | Vary: 32 | - Accept-Encoding 33 | Server: 34 | - Microsoft-IIS/7.5 35 | Date: 36 | - Sun, 05 Oct 2014 16:31:17 GMT 37 | Content-Length: 38 | - '301' 39 | Set-Cookie: 40 | - snaptid=sac1prdc01ut03; path=/ 41 | body: 42 | encoding: UTF-8 43 | string: '[{"PIPELINE_ID":124170,"STAGE_ID":377384,"STAGE_NAME":"Awaiting quotes","STAGE_ORDER":1,"OWNER_USER_ID":607181},{"PIPELINE_ID":124170,"STAGE_ID":377385,"STAGE_NAME":"Pending 44 | decision","STAGE_ORDER":2,"OWNER_USER_ID":607181},{"PIPELINE_ID":124170,"STAGE_ID":377386,"STAGE_NAME":"Active","STAGE_ORDER":3,"OWNER_USER_ID":607181},{"PIPELINE_ID":124170,"STAGE_ID":377388,"STAGE_NAME":"Lab 45 | Completed","STAGE_ORDER":4,"OWNER_USER_ID":607181},{"PIPELINE_ID":124170,"STAGE_ID":377390,"STAGE_NAME":"Researcher 46 | Completed","STAGE_ORDER":5,"OWNER_USER_ID":607181}]' 47 | http_version: 48 | recorded_at: Sun, 05 Oct 2014 16:31:08 GMT 49 | recorded_with: VCR 2.9.0 50 | -------------------------------------------------------------------------------- /spec/fixtures/vcr_cassettes/get_pipelines.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: get 5 | uri: https://:@api.insight.ly/v2.1/Pipelines 6 | body: 7 | encoding: UTF-8 8 | string: '' 9 | headers: 10 | User-Agent: 11 | - Faraday v0.9.0 12 | Accept: 13 | - application/json 14 | Content-Type: 15 | - application/json 16 | Accept-Encoding: 17 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 18 | response: 19 | status: 20 | code: 200 21 | message: OK 22 | headers: 23 | Cache-Control: 24 | - no-cache 25 | Pragma: 26 | - no-cache 27 | Content-Type: 28 | - application/json; charset=utf-8 29 | Expires: 30 | - "-1" 31 | Vary: 32 | - Accept-Encoding 33 | Server: 34 | - Microsoft-IIS/7.5 35 | Date: 36 | - Sun, 05 Oct 2014 16:41:25 GMT 37 | Content-Length: 38 | - '231' 39 | Set-Cookie: 40 | - snaptid=sac1prdc01ut04; path=/ 41 | body: 42 | encoding: UTF-8 43 | string: '[{"PIPELINE_ID":124170,"PIPELINE_NAME":"Awesome!","FOR_OPPORTUNITIES":true,"FOR_PROJECTS":false,"OWNER_USER_ID":607181}]' 44 | http_version: 45 | recorded_at: Sun, 05 Oct 2014 16:41:17 GMT 46 | recorded_with: VCR 2.9.0 47 | -------------------------------------------------------------------------------- /spec/fixtures/vcr_cassettes/get_project_categories.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: get 5 | uri: https://:@api.insight.ly/v2.1/ProjectCategories 6 | body: 7 | encoding: UTF-8 8 | string: '' 9 | headers: 10 | User-Agent: 11 | - Faraday v0.9.0 12 | Accept: 13 | - application/json 14 | Content-Type: 15 | - application/json 16 | Accept-Encoding: 17 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 18 | response: 19 | status: 20 | code: 200 21 | message: OK 22 | headers: 23 | Cache-Control: 24 | - no-cache 25 | Pragma: 26 | - no-cache 27 | Content-Type: 28 | - application/json; charset=utf-8 29 | Expires: 30 | - "-1" 31 | Vary: 32 | - Accept-Encoding 33 | Server: 34 | - Microsoft-IIS/7.5 35 | Date: 36 | - Sun, 05 Oct 2014 16:45:25 GMT 37 | Content-Length: 38 | - '209' 39 | Set-Cookie: 40 | - snaptid=sac1prdc01ut05; path=/ 41 | body: 42 | encoding: UTF-8 43 | string: '[{"CATEGORY_ID":1947441,"CATEGORY_NAME":"Email","ACTIVE":true,"BACKGROUND_COLOR":"9a482f"}]' 44 | http_version: 45 | recorded_at: Sun, 05 Oct 2014 16:45:18 GMT 46 | recorded_with: VCR 2.9.0 47 | -------------------------------------------------------------------------------- /spec/fixtures/vcr_cassettes/get_project_category.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: get 5 | uri: https://:@api.insight.ly/v2.1/ProjectCategories/1947441 6 | body: 7 | encoding: UTF-8 8 | string: '' 9 | headers: 10 | User-Agent: 11 | - Faraday v0.9.0 12 | Accept: 13 | - application/json 14 | Content-Type: 15 | - application/json 16 | Accept-Encoding: 17 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 18 | response: 19 | status: 20 | code: 200 21 | message: OK 22 | headers: 23 | Cache-Control: 24 | - no-cache 25 | Pragma: 26 | - no-cache 27 | Content-Type: 28 | - application/json; charset=utf-8 29 | Expires: 30 | - "-1" 31 | Vary: 32 | - Accept-Encoding 33 | Server: 34 | - Microsoft-IIS/7.5 35 | Date: 36 | - Sun, 05 Oct 2014 16:46:18 GMT 37 | Content-Length: 38 | - '206' 39 | Set-Cookie: 40 | - snaptid=sac1prdc01ut03; path=/ 41 | body: 42 | encoding: UTF-8 43 | string: '{"CATEGORY_ID":1947441,"CATEGORY_NAME":"Email","ACTIVE":true,"BACKGROUND_COLOR":"9a482f"}' 44 | http_version: 45 | recorded_at: Sun, 05 Oct 2014 16:46:10 GMT 46 | recorded_with: VCR 2.9.0 47 | -------------------------------------------------------------------------------- /spec/fixtures/vcr_cassettes/get_project_emails.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: get 5 | uri: https://:@api.insight.ly/v2.1/Projects/1657941/Emails 6 | body: 7 | encoding: UTF-8 8 | string: '' 9 | headers: 10 | User-Agent: 11 | - Faraday v0.9.0 12 | Accept: 13 | - application/json 14 | Content-Type: 15 | - application/json 16 | Accept-Encoding: 17 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 18 | response: 19 | status: 20 | code: 200 21 | message: OK 22 | headers: 23 | Cache-Control: 24 | - no-cache 25 | Pragma: 26 | - no-cache 27 | Content-Type: 28 | - application/json; charset=utf-8 29 | Expires: 30 | - "-1" 31 | Vary: 32 | - Accept-Encoding 33 | Server: 34 | - Microsoft-IIS/7.5 35 | Date: 36 | - Sun, 05 Oct 2014 16:57:48 GMT 37 | Content-Length: 38 | - '490' 39 | Set-Cookie: 40 | - snaptid=sac1prdc01ut06; path=/ 41 | body: 42 | encoding: UTF-8 43 | string: '[{"EMAIL_ID":17684953,"GMAIL_MESSAGE_ID":null,"EMAIL_DATE_UTC":null,"EMAIL_FROM":"apps@scienceexchange.com","EMAIL_TO":"","EMAIL_CC":"","SUBJECT":"A 44 | less than interesting email","BODY":"Told you","FORMAT":"HTML","SIZE":2075,"OWNER_USER_ID":607181,"DATE_CREATED_UTC":"2014-10-04 45 | 23:55:52","VISIBLE_TO":"EVERYONE","VISIBLE_TEAM_ID":null,"VISIBLE_USER_IDS":null,"FILE_ATTACHMENTS":[],"EMAILLINKS":[{"EMAIL_LINK_ID":61065705,"EMAIL_ID":17684953,"CONTACT_ID":null,"ORGANISATION_ID":null,"OPPORTUNITY_ID":null,"PROJECT_ID":1657941}]}]' 46 | http_version: 47 | recorded_at: Sun, 05 Oct 2014 16:57:41 GMT 48 | recorded_with: VCR 2.9.0 49 | -------------------------------------------------------------------------------- /spec/fixtures/vcr_cassettes/get_project_image.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: get 5 | uri: https://:@api.insight.ly/v2.1/Projects/1657941/Image 6 | body: 7 | encoding: UTF-8 8 | string: '' 9 | headers: 10 | User-Agent: 11 | - Faraday v0.9.0 12 | Accept: 13 | - application/json 14 | Content-Type: 15 | - application/json 16 | Accept-Encoding: 17 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 18 | response: 19 | status: 20 | code: 400 21 | message: A server exception was thrown. 22 | headers: 23 | Cache-Control: 24 | - no-cache 25 | Pragma: 26 | - no-cache 27 | Content-Length: 28 | - '84' 29 | Content-Type: 30 | - text/plain; charset=utf-8 31 | Expires: 32 | - "-1" 33 | Server: 34 | - Microsoft-IIS/7.5 35 | Date: 36 | - Sun, 05 Oct 2014 17:00:11 GMT 37 | Set-Cookie: 38 | - snaptid=sac1prdc01ut05; path=/ 39 | body: 40 | encoding: UTF-8 41 | string: Could not find file 'C:\inetpub\Insightly2WebAPIv21\Content\images\project-icon.png'. 42 | http_version: 43 | recorded_at: Sun, 05 Oct 2014 17:00:03 GMT 44 | recorded_with: VCR 2.9.0 45 | -------------------------------------------------------------------------------- /spec/fixtures/vcr_cassettes/get_project_notes.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: get 5 | uri: https://:@api.insight.ly/v2.1/Projects/1657941/Notes 6 | body: 7 | encoding: UTF-8 8 | string: '' 9 | headers: 10 | User-Agent: 11 | - Faraday v0.9.0 12 | Accept: 13 | - application/json 14 | Content-Type: 15 | - application/json 16 | Accept-Encoding: 17 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 18 | response: 19 | status: 20 | code: 200 21 | message: OK 22 | headers: 23 | Cache-Control: 24 | - no-cache 25 | Pragma: 26 | - no-cache 27 | Content-Type: 28 | - application/json; charset=utf-8 29 | Expires: 30 | - "-1" 31 | Vary: 32 | - Accept-Encoding 33 | Server: 34 | - Microsoft-IIS/7.5 35 | Date: 36 | - Sun, 05 Oct 2014 17:00:56 GMT 37 | Content-Length: 38 | - '421' 39 | Set-Cookie: 40 | - snaptid=sac1prdc01ut05; path=/ 41 | body: 42 | encoding: UTF-8 43 | string: '[{"NOTE_ID":15379217,"TITLE":"I love lamp","BODY":null,"LINK_SUBJECT_ID":1657941,"LINK_SUBJECT_TYPE":"Project","OWNER_USER_ID":607181,"DATE_CREATED_UTC":"2014-10-05 44 | 16:54:43","DATE_UPDATED_UTC":"2014-10-05 16:54:43","VISIBLE_TO":"EVERYONE","VISIBLE_TEAM_ID":null,"VISIBLE_USER_IDS":null,"FILE_ATTACHMENTS":[],"NOTELINKS":[{"NOTE_LINK_ID":16817612,"NOTE_ID":15379217,"CONTACT_ID":null,"ORGANISATION_ID":null,"OPPORTUNITY_ID":null,"PROJECT_ID":1657941}]}]' 45 | http_version: 46 | recorded_at: Sun, 05 Oct 2014 17:00:49 GMT 47 | recorded_with: VCR 2.9.0 48 | -------------------------------------------------------------------------------- /spec/fixtures/vcr_cassettes/get_project_tasks.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: get 5 | uri: https://:@api.insight.ly/v2.1/Projects/1657941/Tasks 6 | body: 7 | encoding: UTF-8 8 | string: '' 9 | headers: 10 | User-Agent: 11 | - Faraday v0.9.0 12 | Accept: 13 | - application/json 14 | Content-Type: 15 | - application/json 16 | Accept-Encoding: 17 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 18 | response: 19 | status: 20 | code: 200 21 | message: OK 22 | headers: 23 | Cache-Control: 24 | - no-cache 25 | Pragma: 26 | - no-cache 27 | Content-Type: 28 | - application/json; charset=utf-8 29 | Expires: 30 | - "-1" 31 | Vary: 32 | - Accept-Encoding 33 | Server: 34 | - Microsoft-IIS/7.5 35 | Date: 36 | - Sun, 05 Oct 2014 17:01:54 GMT 37 | Content-Length: 38 | - '494' 39 | Set-Cookie: 40 | - snaptid=sac1prdc01ut06; path=/ 41 | body: 42 | encoding: UTF-8 43 | string: '[{"TASK_ID":16599929,"Title":"Cpt Task","CATEGORY_ID":null,"DUE_DATE":null,"COMPLETED_DATE_UTC":null,"PUBLICLY_VISIBLE":true,"COMPLETED":false,"PROJECT_ID":1657941,"DETAILS":"","STATUS":"NOT 44 | STARTED","PRIORITY":2,"PERCENT_COMPLETE":0,"START_DATE":null,"ASSIGNED_BY_USER_ID":null,"PARENT_TASK_ID":null,"OWNER_VISIBLE":false,"RESPONSIBLE_USER_ID":607181,"OWNER_USER_ID":607181,"DATE_CREATED_UTC":"2014-10-05 45 | 16:55:20","DATE_UPDATED_UTC":"2014-10-05 16:55:20","TASKLINKS":[{"TASK_LINK_ID":15750321,"TASK_ID":16599929,"CONTACT_ID":null,"ORGANISATION_ID":null,"OPPORTUNITY_ID":null,"PROJECT_ID":1657941}]}]' 46 | http_version: 47 | recorded_at: Sun, 05 Oct 2014 17:01:46 GMT 48 | recorded_with: VCR 2.9.0 49 | -------------------------------------------------------------------------------- /spec/fixtures/vcr_cassettes/get_task.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: get 5 | uri: https://:@api.insight.ly/v2.1/Tasks/14694323 6 | body: 7 | encoding: UTF-8 8 | string: '' 9 | headers: 10 | User-Agent: 11 | - Faraday v0.9.0 12 | Accept: 13 | - application/json 14 | Content-Type: 15 | - application/json 16 | Accept-Encoding: 17 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 18 | response: 19 | status: 20 | code: 200 21 | message: OK 22 | headers: 23 | Cache-Control: 24 | - no-cache 25 | Pragma: 26 | - no-cache 27 | Content-Type: 28 | - application/json; charset=utf-8 29 | Expires: 30 | - "-1" 31 | Vary: 32 | - Accept-Encoding 33 | Server: 34 | - Microsoft-IIS/7.5 35 | Date: 36 | - Sun, 05 Oct 2014 17:22:28 GMT 37 | Content-Length: 38 | - '540' 39 | Set-Cookie: 40 | - snaptid=sac1prdc01ut06; path=/ 41 | body: 42 | encoding: UTF-8 43 | string: '{"TASK_ID":14694323,"Title":"Project Posted - Call or email requester","CATEGORY_ID":1947439,"DUE_DATE":"2013-11-18 44 | 00:00:00","COMPLETED_DATE_UTC":null,"PUBLICLY_VISIBLE":true,"COMPLETED":false,"PROJECT_ID":null,"DETAILS":"Project 45 | Posted - Call or email requester","STATUS":"NOT STARTED","PRIORITY":null,"PERCENT_COMPLETE":0,"START_DATE":null,"ASSIGNED_BY_USER_ID":null,"PARENT_TASK_ID":null,"OWNER_VISIBLE":false,"RESPONSIBLE_USER_ID":607181,"OWNER_USER_ID":607181,"DATE_CREATED_UTC":"2014-07-31 46 | 16:43:47","DATE_UPDATED_UTC":"2014-07-31 16:43:47","TASKLINKS":[{"TASK_LINK_ID":13912965,"TASK_ID":14694323,"CONTACT_ID":null,"ORGANISATION_ID":null,"OPPORTUNITY_ID":4070111,"PROJECT_ID":null}]}' 47 | http_version: 48 | recorded_at: Sun, 05 Oct 2014 17:22:21 GMT 49 | recorded_with: VCR 2.9.0 50 | -------------------------------------------------------------------------------- /spec/fixtures/vcr_cassettes/get_task_categories.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: get 5 | uri: https://:@api.insight.ly/v2.1/TaskCategories 6 | body: 7 | encoding: UTF-8 8 | string: '' 9 | headers: 10 | User-Agent: 11 | - Faraday v0.9.0 12 | Accept: 13 | - application/json 14 | Content-Type: 15 | - application/json 16 | Accept-Encoding: 17 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 18 | response: 19 | status: 20 | code: 200 21 | message: OK 22 | headers: 23 | Cache-Control: 24 | - no-cache 25 | Pragma: 26 | - no-cache 27 | Content-Type: 28 | - application/json; charset=utf-8 29 | Expires: 30 | - "-1" 31 | Vary: 32 | - Accept-Encoding 33 | Server: 34 | - Microsoft-IIS/7.5 35 | Date: 36 | - Sun, 05 Oct 2014 17:15:21 GMT 37 | Content-Length: 38 | - '254' 39 | Set-Cookie: 40 | - snaptid=sac1prdc01ut03; path=/ 41 | body: 42 | encoding: UTF-8 43 | string: '[{"CATEGORY_ID":1947437,"CATEGORY_NAME":"Meeting","ACTIVE":true,"BACKGROUND_COLOR":"9f4681"},{"CATEGORY_ID":1947438,"CATEGORY_NAME":"Phone 44 | call","ACTIVE":true,"BACKGROUND_COLOR":"4e469f"},{"CATEGORY_ID":1947440,"CATEGORY_NAME":"To-do","ACTIVE":true,"BACKGROUND_COLOR":"9a7f2f"}]' 45 | http_version: 46 | recorded_at: Sun, 05 Oct 2014 17:15:13 GMT 47 | recorded_with: VCR 2.9.0 48 | -------------------------------------------------------------------------------- /spec/fixtures/vcr_cassettes/get_task_category.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: get 5 | uri: https://:@api.insight.ly/v2.1/TaskCategories/1947437 6 | body: 7 | encoding: UTF-8 8 | string: '' 9 | headers: 10 | User-Agent: 11 | - Faraday v0.9.0 12 | Accept: 13 | - application/json 14 | Content-Type: 15 | - application/json 16 | Accept-Encoding: 17 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 18 | response: 19 | status: 20 | code: 200 21 | message: OK 22 | headers: 23 | Cache-Control: 24 | - no-cache 25 | Pragma: 26 | - no-cache 27 | Content-Type: 28 | - application/json; charset=utf-8 29 | Expires: 30 | - "-1" 31 | Vary: 32 | - Accept-Encoding 33 | Server: 34 | - Microsoft-IIS/7.5 35 | Date: 36 | - Sun, 05 Oct 2014 17:16:00 GMT 37 | Content-Length: 38 | - '209' 39 | Set-Cookie: 40 | - snaptid=sac1prdc01ut06; path=/ 41 | body: 42 | encoding: UTF-8 43 | string: '{"CATEGORY_ID":1947437,"CATEGORY_NAME":"Meeting","ACTIVE":true,"BACKGROUND_COLOR":"9f4681"}' 44 | http_version: 45 | recorded_at: Sun, 05 Oct 2014 17:15:52 GMT 46 | recorded_with: VCR 2.9.0 47 | -------------------------------------------------------------------------------- /spec/fixtures/vcr_cassettes/get_task_comments.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: get 5 | uri: https://:@api.insight.ly/v2.1/Tasks/14694323/Comments 6 | body: 7 | encoding: UTF-8 8 | string: '' 9 | headers: 10 | User-Agent: 11 | - Faraday v0.9.0 12 | Accept: 13 | - application/json 14 | Content-Type: 15 | - application/json 16 | Accept-Encoding: 17 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 18 | response: 19 | status: 20 | code: 200 21 | message: OK 22 | headers: 23 | Cache-Control: 24 | - no-cache 25 | Pragma: 26 | - no-cache 27 | Content-Type: 28 | - application/json; charset=utf-8 29 | Expires: 30 | - "-1" 31 | Vary: 32 | - Accept-Encoding 33 | Server: 34 | - Microsoft-IIS/7.5 35 | Date: 36 | - Sun, 05 Oct 2014 17:24:32 GMT 37 | Content-Length: 38 | - '268' 39 | Set-Cookie: 40 | - snaptid=sac1prdc01ut03; path=/ 41 | body: 42 | encoding: UTF-8 43 | string: '[{"COMMENT_ID":3470211,"BODY":"\r\n

Yay

\r\n","OWNER_USER_ID":607181,"DATE_CREATED_UTC":"2014-10-05 44 | 17:24:01","DATE_UPDATED_UTC":"2014-10-05 17:24:01","FILE_ATTACHMENTS":[]}]' 45 | http_version: 46 | recorded_at: Sun, 05 Oct 2014 17:24:25 GMT 47 | recorded_with: VCR 2.9.0 48 | -------------------------------------------------------------------------------- /spec/fixtures/vcr_cassettes/get_team.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: get 5 | uri: https://:@api.insight.ly/v2.1/Teams/2063767 6 | body: 7 | encoding: UTF-8 8 | string: '' 9 | headers: 10 | User-Agent: 11 | - Faraday v0.9.0 12 | Accept: 13 | - application/json 14 | Content-Type: 15 | - application/json 16 | Accept-Encoding: 17 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 18 | response: 19 | status: 20 | code: 200 21 | message: OK 22 | headers: 23 | Cache-Control: 24 | - no-cache 25 | Pragma: 26 | - no-cache 27 | Content-Type: 28 | - application/json; charset=utf-8 29 | Expires: 30 | - "-1" 31 | Vary: 32 | - Accept-Encoding 33 | Server: 34 | - Microsoft-IIS/7.5 35 | Date: 36 | - Sun, 05 Oct 2014 17:43:31 GMT 37 | Content-Length: 38 | - '250' 39 | Set-Cookie: 40 | - snaptid=sac1prdc01ut06; path=/ 41 | body: 42 | encoding: UTF-8 43 | string: '{"TEAM_ID":2063767,"TEAM_NAME":"Team Cobra","ANONYMOUS_TEAM":false,"DATE_CREATED_UTC":"2014-10-05 44 | 17:31:29","DATE_UPDATED_UTC":"2014-10-05 17:31:29","TEAMMEMBERS":[]}' 45 | http_version: 46 | recorded_at: Sun, 05 Oct 2014 17:43:23 GMT 47 | recorded_with: VCR 2.9.0 48 | -------------------------------------------------------------------------------- /spec/fixtures/vcr_cassettes/get_team_member.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: get 5 | uri: https://:@api.insight.ly/v2.1/TeamMembers/5016224 6 | body: 7 | encoding: UTF-8 8 | string: '' 9 | headers: 10 | User-Agent: 11 | - Faraday v0.9.0 12 | Accept: 13 | - application/json 14 | Content-Type: 15 | - application/json 16 | Accept-Encoding: 17 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 18 | response: 19 | status: 20 | code: 200 21 | message: OK 22 | headers: 23 | Cache-Control: 24 | - no-cache 25 | Pragma: 26 | - no-cache 27 | Content-Type: 28 | - application/json; charset=utf-8 29 | Expires: 30 | - "-1" 31 | Vary: 32 | - Accept-Encoding 33 | Server: 34 | - Microsoft-IIS/7.5 35 | Date: 36 | - Sun, 05 Oct 2014 17:35:15 GMT 37 | Content-Length: 38 | - '194' 39 | Set-Cookie: 40 | - snaptid=sac1prdc01ut06; path=/ 41 | body: 42 | encoding: UTF-8 43 | string: '{"PERMISSION_ID":5016224,"TEAM_ID":2063767,"MEMBER_USER_ID":607181,"MEMBER_TEAM_ID":null}' 44 | http_version: 45 | recorded_at: Sun, 05 Oct 2014 17:35:08 GMT 46 | recorded_with: VCR 2.9.0 47 | -------------------------------------------------------------------------------- /spec/fixtures/vcr_cassettes/get_team_members.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: get 5 | uri: https://:@api.insight.ly/v2.1/TeamMembers/?teamid=2063767 6 | body: 7 | encoding: UTF-8 8 | string: '' 9 | headers: 10 | User-Agent: 11 | - Faraday v0.9.0 12 | Accept: 13 | - application/json 14 | Content-Type: 15 | - application/json 16 | Accept-Encoding: 17 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 18 | response: 19 | status: 20 | code: 200 21 | message: OK 22 | headers: 23 | Cache-Control: 24 | - no-cache 25 | Pragma: 26 | - no-cache 27 | Content-Type: 28 | - application/json; charset=utf-8 29 | Expires: 30 | - "-1" 31 | Vary: 32 | - Accept-Encoding 33 | Server: 34 | - Microsoft-IIS/7.5 35 | Date: 36 | - Sun, 05 Oct 2014 17:33:19 GMT 37 | Content-Length: 38 | - '197' 39 | Set-Cookie: 40 | - snaptid=sac1prdc01ut06; path=/ 41 | body: 42 | encoding: UTF-8 43 | string: '[{"PERMISSION_ID":5016224,"TEAM_ID":2063767,"MEMBER_USER_ID":607181,"MEMBER_TEAM_ID":null}]' 44 | http_version: 45 | recorded_at: Sun, 05 Oct 2014 17:33:12 GMT 46 | recorded_with: VCR 2.9.0 47 | -------------------------------------------------------------------------------- /spec/fixtures/vcr_cassettes/get_teams.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: get 5 | uri: https://:@api.insight.ly/v2.1/Teams 6 | body: 7 | encoding: UTF-8 8 | string: '' 9 | headers: 10 | User-Agent: 11 | - Faraday v0.9.0 12 | Accept: 13 | - application/json 14 | Content-Type: 15 | - application/json 16 | Accept-Encoding: 17 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 18 | response: 19 | status: 20 | code: 200 21 | message: OK 22 | headers: 23 | Cache-Control: 24 | - no-cache 25 | Pragma: 26 | - no-cache 27 | Content-Type: 28 | - application/json; charset=utf-8 29 | Expires: 30 | - "-1" 31 | Vary: 32 | - Accept-Encoding 33 | Server: 34 | - Microsoft-IIS/7.5 35 | Date: 36 | - Sun, 05 Oct 2014 17:43:31 GMT 37 | Content-Length: 38 | - '253' 39 | Set-Cookie: 40 | - snaptid=sac1prdc01ut03; path=/ 41 | body: 42 | encoding: UTF-8 43 | string: '[{"TEAM_ID":2063767,"TEAM_NAME":"Team Cobra","ANONYMOUS_TEAM":false,"DATE_CREATED_UTC":"2014-10-05 44 | 17:31:29","DATE_UPDATED_UTC":"2014-10-05 17:31:29","TEAMMEMBERS":[]}]' 45 | http_version: 46 | recorded_at: Sun, 05 Oct 2014 17:43:23 GMT 47 | recorded_with: VCR 2.9.0 48 | -------------------------------------------------------------------------------- /spec/fixtures/vcr_cassettes/get_user.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: get 5 | uri: https://:@api.insight.ly/v2.1/Users/607181 6 | body: 7 | encoding: UTF-8 8 | string: '' 9 | headers: 10 | User-Agent: 11 | - Faraday v0.9.0 12 | Accept: 13 | - application/json 14 | Content-Type: 15 | - application/json 16 | Accept-Encoding: 17 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 18 | response: 19 | status: 20 | code: 200 21 | message: OK 22 | headers: 23 | Cache-Control: 24 | - no-cache 25 | Pragma: 26 | - no-cache 27 | Content-Type: 28 | - application/json; charset=utf-8 29 | Expires: 30 | - "-1" 31 | Vary: 32 | - Accept-Encoding 33 | Server: 34 | - Microsoft-IIS/7.5 35 | Date: 36 | - Sun, 05 Oct 2014 17:51:34 GMT 37 | Content-Length: 38 | - '481' 39 | Set-Cookie: 40 | - snaptid=sac1prdc01ut05; path=/ 41 | body: 42 | encoding: UTF-8 43 | string: '{"USER_ID":607181,"CONTACT_ID":70408796,"FIRST_NAME":"Science","LAST_NAME":"Exchange","TIMEZONE_ID":"Central 44 | Standard Time","EMAIL_ADDRESS":"apps@scienceexchange.com","EMAIL_DROPBOX_IDENTIFIER":"5MMXB7","ADMINISTRATOR":true,"ACCOUNT_OWNER":false,"ACTIVE":true,"DATE_CREATED_UTC":"2014-07-30 45 | 02:57:06","DATE_UPDATED_UTC":"2014-07-31 17:15:51","USER_CURRENCY":"USD","CONTACT_DISPLAY":"FirstLast","CONTACT_ORDER":"FirstLast","TASK_WEEK_START":2,"INSTANCE_ID":339351}' 46 | http_version: 47 | recorded_at: Sun, 05 Oct 2014 17:51:26 GMT 48 | recorded_with: VCR 2.9.0 49 | -------------------------------------------------------------------------------- /spec/fixtures/vcr_cassettes/get_users.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: get 5 | uri: https://:@api.insight.ly/v2.1/Users 6 | body: 7 | encoding: UTF-8 8 | string: '' 9 | headers: 10 | User-Agent: 11 | - Faraday v0.9.0 12 | Accept: 13 | - application/json 14 | Content-Type: 15 | - application/json 16 | Accept-Encoding: 17 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 18 | response: 19 | status: 20 | code: 200 21 | message: OK 22 | headers: 23 | Cache-Control: 24 | - no-cache 25 | Pragma: 26 | - no-cache 27 | Content-Type: 28 | - application/json; charset=utf-8 29 | Expires: 30 | - "-1" 31 | Vary: 32 | - Accept-Encoding 33 | Server: 34 | - Microsoft-IIS/7.5 35 | Date: 36 | - Sun, 05 Oct 2014 17:50:24 GMT 37 | Content-Length: 38 | - '483' 39 | Set-Cookie: 40 | - snaptid=sac1prdc01ut06; path=/ 41 | body: 42 | encoding: UTF-8 43 | string: '[{"USER_ID":607181,"CONTACT_ID":70408796,"FIRST_NAME":"Science","LAST_NAME":"Exchange","TIMEZONE_ID":"Central 44 | Standard Time","EMAIL_ADDRESS":"apps@scienceexchange.com","EMAIL_DROPBOX_IDENTIFIER":"5MMXB7","ADMINISTRATOR":true,"ACCOUNT_OWNER":false,"ACTIVE":true,"DATE_CREATED_UTC":"2014-07-30 45 | 02:57:06","DATE_UPDATED_UTC":"2014-07-31 17:15:51","USER_CURRENCY":"USD","CONTACT_DISPLAY":"FirstLast","CONTACT_ORDER":"FirstLast","TASK_WEEK_START":2,"INSTANCE_ID":339351}]' 46 | http_version: 47 | recorded_at: Sun, 05 Oct 2014 17:50:17 GMT 48 | recorded_with: VCR 2.9.0 49 | -------------------------------------------------------------------------------- /spec/fixtures/vcr_cassettes/update_contact_image.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: put 5 | uri: https://:@api.insight.ly/v2.1/Contacts/70653019/Image/1.jpg 6 | body: 7 | encoding: UTF-8 8 | string: '' 9 | headers: 10 | User-Agent: 11 | - Faraday v0.9.0 12 | Accept: 13 | - application/json 14 | Content-Type: 15 | - application/json 16 | Accept-Encoding: 17 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 18 | response: 19 | status: 20 | code: 417 21 | message: Expectation Failed 22 | headers: 23 | Cache-Control: 24 | - no-cache 25 | Pragma: 26 | - no-cache 27 | Expires: 28 | - "-1" 29 | Server: 30 | - Microsoft-IIS/7.5 31 | Date: 32 | - Sat, 04 Oct 2014 18:40:13 GMT 33 | Content-Length: 34 | - '0' 35 | Set-Cookie: 36 | - snaptid=sac1prdc01ut06; path=/ 37 | body: 38 | encoding: UTF-8 39 | string: '' 40 | http_version: 41 | recorded_at: Sat, 04 Oct 2014 18:40:06 GMT 42 | recorded_with: VCR 2.9.0 43 | -------------------------------------------------------------------------------- /spec/fixtures/vcr_cassettes/update_opportunity_image.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: put 5 | uri: https://:@api.insight.ly/v2.1/Opportunities/4070112/Image/1.jpg 6 | body: 7 | encoding: UTF-8 8 | string: '' 9 | headers: 10 | User-Agent: 11 | - Faraday v0.9.0 12 | Accept: 13 | - application/json 14 | Content-Type: 15 | - application/json 16 | Accept-Encoding: 17 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 18 | response: 19 | status: 20 | code: 417 21 | message: Expectation Failed 22 | headers: 23 | Cache-Control: 24 | - no-cache 25 | Pragma: 26 | - no-cache 27 | Expires: 28 | - "-1" 29 | Server: 30 | - Microsoft-IIS/7.5 31 | Date: 32 | - Sun, 05 Oct 2014 01:05:44 GMT 33 | Content-Length: 34 | - '0' 35 | Set-Cookie: 36 | - snaptid=sac1prdc01ut05; path=/ 37 | body: 38 | encoding: UTF-8 39 | string: '' 40 | http_version: 41 | recorded_at: Sun, 05 Oct 2014 01:05:37 GMT 42 | recorded_with: VCR 2.9.0 43 | -------------------------------------------------------------------------------- /spec/fixtures/vcr_cassettes/update_organisation_image.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: put 5 | uri: https://:@api.insight.ly/v2.1/Organisations/39831139/Image/1.jpg 6 | body: 7 | encoding: UTF-8 8 | string: '' 9 | headers: 10 | User-Agent: 11 | - Faraday v0.9.0 12 | Accept: 13 | - application/json 14 | Content-Type: 15 | - application/json 16 | Accept-Encoding: 17 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 18 | response: 19 | status: 20 | code: 417 21 | message: Expectation Failed 22 | headers: 23 | Cache-Control: 24 | - no-cache 25 | Pragma: 26 | - no-cache 27 | Expires: 28 | - "-1" 29 | Server: 30 | - Microsoft-IIS/7.5 31 | Date: 32 | - Sun, 05 Oct 2014 07:01:35 GMT 33 | Content-Length: 34 | - '0' 35 | Set-Cookie: 36 | - snaptid=sac1prdc01ut03; path=/ 37 | body: 38 | encoding: UTF-8 39 | string: '' 40 | http_version: 41 | recorded_at: Sun, 05 Oct 2014 07:01:28 GMT 42 | recorded_with: VCR 2.9.0 43 | -------------------------------------------------------------------------------- /spec/fixtures/vcr_cassettes/update_project_image.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: put 5 | uri: https://:@api.insight.ly/v2.1/Projects/1657941/Image/1.jpg 6 | body: 7 | encoding: UTF-8 8 | string: '' 9 | headers: 10 | User-Agent: 11 | - Faraday v0.9.0 12 | Accept: 13 | - application/json 14 | Content-Type: 15 | - application/json 16 | Accept-Encoding: 17 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 18 | response: 19 | status: 20 | code: 417 21 | message: Expectation Failed 22 | headers: 23 | Cache-Control: 24 | - no-cache 25 | Pragma: 26 | - no-cache 27 | Expires: 28 | - "-1" 29 | Server: 30 | - Microsoft-IIS/7.5 31 | Date: 32 | - Sun, 05 Oct 2014 17:09:55 GMT 33 | Content-Length: 34 | - '0' 35 | Set-Cookie: 36 | - snaptid=sac1prdc01ut05; path=/ 37 | body: 38 | encoding: UTF-8 39 | string: '' 40 | http_version: 41 | recorded_at: Sun, 05 Oct 2014 17:09:48 GMT 42 | recorded_with: VCR 2.9.0 43 | -------------------------------------------------------------------------------- /spec/fixtures/vcr_cassettes/z_insightly_client_status_check.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: get 5 | uri: https://:@api.insight.ly/v2.1/Users 6 | body: 7 | encoding: UTF-8 8 | string: '' 9 | headers: 10 | User-Agent: 11 | - Faraday v0.9.0 12 | Accept: 13 | - application/json 14 | Content-Type: 15 | - application/json 16 | Accept-Encoding: 17 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 18 | response: 19 | status: 20 | code: 200 21 | message: OK 22 | headers: 23 | Cache-Control: 24 | - no-cache 25 | Pragma: 26 | - no-cache 27 | Content-Type: 28 | - application/json; charset=utf-8 29 | Expires: 30 | - "-1" 31 | Vary: 32 | - Accept-Encoding 33 | Server: 34 | - Microsoft-IIS/7.5 35 | Date: 36 | - Sun, 05 Oct 2014 18:54:33 GMT 37 | Content-Length: 38 | - '483' 39 | Set-Cookie: 40 | - snaptid=sac1prdc01ut03; path=/ 41 | body: 42 | encoding: UTF-8 43 | string: '[{"USER_ID":607181,"CONTACT_ID":70408796,"FIRST_NAME":"Science","LAST_NAME":"Exchange","TIMEZONE_ID":"Central 44 | Standard Time","EMAIL_ADDRESS":"apps@scienceexchange.com","EMAIL_DROPBOX_IDENTIFIER":"5MMXB7","ADMINISTRATOR":true,"ACCOUNT_OWNER":false,"ACTIVE":true,"DATE_CREATED_UTC":"2014-07-30 45 | 02:57:06","DATE_UPDATED_UTC":"2014-07-31 17:15:51","USER_CURRENCY":"USD","CONTACT_DISPLAY":"FirstLast","CONTACT_ORDER":"FirstLast","TASK_WEEK_START":2,"INSTANCE_ID":339351}]' 46 | http_version: 47 | recorded_at: Sun, 05 Oct 2014 18:54:26 GMT 48 | recorded_with: VCR 2.9.0 49 | -------------------------------------------------------------------------------- /spec/insightly2/client_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe Insightly2::Client do 4 | subject(:client) { Insightly2::Client.new } 5 | 6 | it 'makes request to api.insight.ly' do 7 | VCR.use_cassette('z_insightly_client_status_check') do 8 | response = client.request(:get, 'Users') 9 | expect(response.status).to eq(200) 10 | end 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /spec/insightly2/dsl/comments_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe Insightly2::DSL::Comments do 4 | let(:comment_id) { 3469515 } 5 | 6 | # GET /v2.1/Comments/{id} 7 | describe '#get_comment' do 8 | it 'returns a comment' do 9 | VCR.use_cassette('get_comment') do 10 | expect(Insightly2.client.get_comment(id: comment_id)).to be_a(Comment) 11 | end 12 | end 13 | end 14 | 15 | # POST /v2.1/Comments?c_id={c_id}&filename={filename} 16 | describe '#create_comment_attachment' do 17 | it 'returns a response with code 201' do 18 | VCR.use_cassette('create_comment_attachment') do 19 | response = Insightly2.client.create_comment_attachment(id: comment_id, filename: '1.jpg') 20 | expect(response.status).to eq(201) 21 | end 22 | end 23 | end 24 | 25 | # PUT /v2.1/Comments 26 | describe '#update_comment' do 27 | it 'updates a comment' do 28 | VCR.use_cassette('update_comment') do 29 | comment = Insightly2.client.get_comment(id: comment_id) 30 | response = Insightly2.client.update_comment(comment: comment) 31 | expect(response).to be_a(Comment) 32 | end 33 | end 34 | end 35 | 36 | # DELETE /v2.1/Comments/{id} 37 | describe '#delete_comment' do 38 | it 'returns a response with code 202' do 39 | VCR.use_cassette('delete_comment') do 40 | response = Insightly2.client.delete_comment(id: comment_id) 41 | expect(response.status).to eq(202) 42 | end 43 | end 44 | end 45 | end 46 | -------------------------------------------------------------------------------- /spec/insightly2/dsl/countries_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe Insightly2::DSL::Countries do 4 | # GET /v2.1/Countries 5 | describe '#get_countries' do 6 | it 'returns an array of countries' do 7 | VCR.use_cassette('get_countries') do 8 | countries = Insightly2.client.get_countries 9 | expect(countries).to be_a(Array) 10 | expect(countries.first).to be_a(Country) 11 | end 12 | end 13 | end 14 | end -------------------------------------------------------------------------------- /spec/insightly2/dsl/currencies_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe Insightly2::DSL::Countries do 4 | # GET /v2.1/Currencies 5 | describe '#get_currencies' do 6 | it 'returns an array of currencies' do 7 | VCR.use_cassette('get_currencies') do 8 | currencies = Insightly2.client.get_currencies 9 | expect(currencies).to be_a(Array) 10 | expect(currencies.first).to be_a(Currency) 11 | end 12 | end 13 | end 14 | end -------------------------------------------------------------------------------- /spec/insightly2/dsl/custom_fields_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe Insightly2::DSL::CustomFields do 4 | let(:custom_field_id) { 'CONTACT_FIELD_1' } 5 | 6 | # GET /v2.1/CustomFields/{id} 7 | describe '#get_custom_field' do 8 | it 'returns a custom field' do 9 | VCR.use_cassette('get_custom_field') do 10 | expect(Insightly2.client.get_custom_field(id: custom_field_id)).to be_a(CustomField) 11 | end 12 | end 13 | end 14 | 15 | # GET /v2.1/CustomFields 16 | describe '#get_custom_fields' do 17 | it 'returns an array of custom fields' do 18 | VCR.use_cassette('get_custom_fields') do 19 | custom_fields = Insightly2.client.get_custom_fields 20 | expect(custom_fields).to be_a(Array) 21 | expect(custom_fields.first).to be_a(CustomField) 22 | end 23 | end 24 | end 25 | end -------------------------------------------------------------------------------- /spec/insightly2/dsl/emails_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe Insightly2::DSL::Emails do 4 | let(:email_id) { 17683283 } 5 | 6 | # GET /v2.1/Emails/{id} 7 | describe '#get_email' do 8 | it 'returns an email' do 9 | VCR.use_cassette('get_email') do 10 | expect(Insightly2.client.get_email(id: email_id)).to be_a(Email) 11 | end 12 | end 13 | end 14 | 15 | # GET /v2.1/Emails?ids={ids}&tag={tag} 16 | describe '#get_emails' do 17 | it 'returns an array of emails' do 18 | VCR.use_cassette('get_emails') do 19 | emails = Insightly2.client.get_emails 20 | expect(emails).to be_a(Array) 21 | expect(emails.first).to be_a(Email) 22 | end 23 | end 24 | end 25 | 26 | # GET /v2.1/Emails/{c_id}/Comments 27 | describe '#get_email_comments' do 28 | it 'returns an array of comments' do 29 | VCR.use_cassette('get_email_comments') do 30 | comments = Insightly2.client.get_email_comments(id: email_id) 31 | expect(comments).to be_a(Array) 32 | expect(comments.first).to be_a(Comment) 33 | end 34 | end 35 | end 36 | 37 | # POST /v2.1/Emails/{c_id}/Comments 38 | describe '#create_email_comment' do 39 | it 'returns a response with code 201' do 40 | VCR.use_cassette('create_email_comment') do 41 | response = Insightly2.client.create_email_comment(id: email_id, comment: {title: 'Sharknado'}) 42 | expect(response.status).to eq(201) 43 | end 44 | end 45 | end 46 | 47 | # DELETE /v2.1/Emails/{id} 48 | describe '#delete_email' do 49 | it 'returns a response with code 202' do 50 | VCR.use_cassette('delete_email') do 51 | response = Insightly2.client.delete_email(id: email_id) 52 | expect(response.status).to eq(202) 53 | end 54 | end 55 | end 56 | end -------------------------------------------------------------------------------- /spec/insightly2/dsl/events_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe Insightly2::DSL::Events do 4 | let(:event_id) { 2402366 } 5 | 6 | # GET /v2.1/Events/{id} 7 | describe '#get_event' do 8 | it 'returns an event' do 9 | VCR.use_cassette('get_event') do 10 | expect(Insightly2.client.get_event(id: event_id)).to be_a(Event) 11 | end 12 | end 13 | end 14 | 15 | # GET /v2.1/Events 16 | describe '#get_events' do 17 | it 'returns an array of events' do 18 | VCR.use_cassette('get_events') do 19 | events = Insightly2.client.get_events 20 | expect(events).to be_a(Array) 21 | expect(events.first).to be_a(Event) 22 | end 23 | end 24 | end 25 | 26 | # POST /v2.1/Events 27 | describe '#create_event' do 28 | it 'creates and returns event' do 29 | VCR.use_cassette('create_event') do 30 | event = Insightly2.client.get_event(id: event_id) 31 | expect(Insightly2.client.create_event(event: event)).to be_a(Event) 32 | end 33 | end 34 | end 35 | 36 | # PUT /v2.1/Events 37 | describe '#update_event' do 38 | it 'updates and returns event' do 39 | VCR.use_cassette('update_event') do 40 | event = Insightly2.client.get_event(id: event_id) 41 | expect(Insightly2.client.update_event(event: event)).to be_a(Event) 42 | end 43 | end 44 | end 45 | 46 | # DELETE /v2.1/Events/{id} 47 | describe '#delete_event' do 48 | it 'returns a response with code 202' do 49 | VCR.use_cassette('delete_event') do 50 | response = Insightly2.client.delete_event(id: event_id) 51 | expect(response.status).to eq(202) 52 | end 53 | end 54 | end 55 | end -------------------------------------------------------------------------------- /spec/insightly2/dsl/file_attachments_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe Insightly2::DSL::FileAttachments do 4 | let(:file_attachment_id) { 33105536 } 5 | 6 | # GET /v2.1/FileAttachments/{id} 7 | describe '#get_file_attachment' do 8 | it 'returns a response with code 200' do 9 | VCR.use_cassette('get_file_attachment') do 10 | response = Insightly2.client.get_file_attachment(id: file_attachment_id) 11 | expect(response.status).to eq(200) 12 | end 13 | end 14 | end 15 | end -------------------------------------------------------------------------------- /spec/insightly2/dsl/file_categories_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe Insightly2::DSL::FileCategories do 4 | let(:file_category_id) { 1947439 } 5 | 6 | # GET /v2.1/FileCategories/{id} 7 | describe '#get_file_category' do 8 | it 'returns a file category' do 9 | VCR.use_cassette('get_file_category') do 10 | expect(Insightly2.client.get_file_category(id: file_category_id)).to be_a(FileCategory) 11 | end 12 | end 13 | end 14 | 15 | # GET /v2.1/FileCategories 16 | describe '#get_file_categories' do 17 | it 'returns an array of file_categories' do 18 | VCR.use_cassette('get_file_categories') do 19 | file_categories = Insightly2.client.get_file_categories 20 | expect(file_categories).to be_a(Array) 21 | expect(file_categories.first).to be_a(FileCategory) 22 | end 23 | end 24 | end 25 | 26 | # POST /v2.1/FileCategories 27 | describe '#create_file_category' do 28 | it 'creates and returns a file category' do 29 | VCR.use_cassette('create_file_category') do 30 | file_category = Insightly2.client.get_file_category(id: file_category_id) 31 | expect(Insightly2.client.create_file_category(category: file_category)).to be_a(FileCategory) 32 | end 33 | end 34 | end 35 | 36 | # PUT /v2.1/FileCategories 37 | describe '#update_file_category' do 38 | it 'updates and returns a file category' do 39 | VCR.use_cassette('update_file_category') do 40 | file_category = Insightly2.client.get_file_category(id: file_category_id) 41 | expect(Insightly2.client.update_file_category(category: file_category)).to be_a(FileCategory) 42 | end 43 | end 44 | end 45 | 46 | # DELETE /v2.1/FileCategories/{id} 47 | describe '#delete_file_category' do 48 | it 'returns a response with code 202' do 49 | VCR.use_cassette('delete_file_category') do 50 | response = Insightly2.client.delete_file_category(id: file_category_id) 51 | expect(response.status).to eq(202) 52 | end 53 | end 54 | end 55 | end -------------------------------------------------------------------------------- /spec/insightly2/dsl/lead_sources_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe Insightly2::DSL::LeadSources do 4 | # GET /v2.1/LeadSources 5 | describe '#get_lead_sources' do 6 | it 'returns an array of lead sources' do 7 | VCR.use_cassette('get_lead_sources') do 8 | lead_sources = Insightly2.client.get_lead_sources 9 | expect(lead_sources).to be_a(Array) 10 | expect(lead_sources.first).to be_a(LeadSource) 11 | end 12 | end 13 | end 14 | 15 | # POST /v2.1/LeadSources 16 | describe '#create_lead_source' do 17 | it 'creates and returns a lead source' do 18 | VCR.use_cassette('create_lead_source') do 19 | lead_source = Insightly2.client.get_lead_sources.first 20 | expect(Insightly2.client.create_lead_source(lead_source: lead_source)).to be_a(LeadSource) 21 | end 22 | end 23 | end 24 | 25 | # PUT /v2.1/LeadSources 26 | describe '#update_lead_source' do 27 | it 'updates and returns a lead source' do 28 | VCR.use_cassette('update_lead_source') do 29 | lead_source = Insightly2.client.get_lead_sources.last 30 | expect(Insightly2.client.update_lead_source(lead_source: lead_source)).to be_a(LeadSource) 31 | end 32 | end 33 | end 34 | 35 | # DELETE /v2.1/LeadSources/{id} 36 | describe '#delete_lead_source' do 37 | it 'returns a response with code 202' do 38 | VCR.use_cassette('delete_lead_source') do 39 | lead_source = Insightly2.client.get_lead_sources.last 40 | response = Insightly2.client.delete_lead_source(id: lead_source.lead_source_id) 41 | expect(response.status).to eq(202) 42 | end 43 | end 44 | end 45 | end 46 | -------------------------------------------------------------------------------- /spec/insightly2/dsl/lead_statuses_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe Insightly2::DSL::LeadStatuses do 4 | # GET /v2.1/LeadStatuses 5 | describe '#get_lead_status' do 6 | it 'returns an array of lead statuses' do 7 | VCR.use_cassette('get_lead_statuses') do 8 | lead_statuses = Insightly2.client.get_lead_statuses 9 | expect(lead_statuses).to be_a(Array) 10 | expect(lead_statuses.first).to be_a(LeadStatus) 11 | end 12 | end 13 | end 14 | 15 | # POST /v2.1/LeadStatuses 16 | describe '#create_lead_status' do 17 | it 'creates and returns a lead status' do 18 | VCR.use_cassette('create_lead_status') do 19 | lead_status = Insightly2.client.get_lead_statuses.first 20 | expect(Insightly2.client.create_lead_status(lead_status: lead_status)).to be_a(LeadStatus) 21 | end 22 | end 23 | end 24 | 25 | # PUT /v2.1/LeadStatuses 26 | describe '#update_lead_status' do 27 | it 'updates and returns a lead status' do 28 | VCR.use_cassette('update_lead_status') do 29 | lead_status = Insightly2.client.get_lead_statuses.first 30 | expect(Insightly2.client.update_lead_status(lead_status: lead_status)).to be_a(LeadStatus) 31 | end 32 | end 33 | end 34 | 35 | # DELETE /v2.1/LeadStatuses/{id} 36 | describe '#delete_lead_status' do 37 | it 'returns a response with code 202' do 38 | VCR.use_cassette('delete_lead_status') do 39 | lead_status = Insightly2.client.get_lead_statuses.first 40 | response = Insightly2.client.delete_lead_status(id: lead_status.lead_status_id) 41 | expect(response.status).to eq(202) 42 | end 43 | end 44 | end 45 | end 46 | -------------------------------------------------------------------------------- /spec/insightly2/dsl/leads_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe Insightly2::DSL::Leads do 4 | let(:lead_id) { 7246484 } 5 | 6 | # GET /v2.1/Leads/{id} 7 | describe '#get_lead' do 8 | it 'returns a lead' do 9 | VCR.use_cassette('get_lead') do 10 | expect(Insightly2.client.get_lead(id: lead_id)).to be_a(Lead) 11 | end 12 | end 13 | end 14 | 15 | # POST /v2.1/Leads 16 | describe '#create_lead' do 17 | it 'creates and returns a lead' do 18 | VCR.use_cassette('create_lead') do 19 | lead = Insightly2.client.get_lead(id: lead_id) 20 | expect(Insightly2.client.create_lead(lead: lead)).to be_a(Lead) 21 | end 22 | end 23 | end 24 | 25 | # PUT /v2.1/Leads 26 | describe '#update_lead' do 27 | it 'updates and returns a lead' do 28 | VCR.use_cassette('update_lead') do 29 | lead = Insightly2.client.get_lead(id: lead_id) 30 | expect(Insightly2.client.update_lead(lead: lead)).to be_a(Lead) 31 | end 32 | end 33 | end 34 | 35 | # DELETE /v2.1/Lead/{id} 36 | describe '#delete_lead' do 37 | it 'returns a response with code 202' do 38 | VCR.use_cassette('delete_lead') do 39 | response = Insightly2.client.delete_lead(id: lead_id) 40 | expect(response.status).to eq(202) 41 | end 42 | end 43 | end 44 | 45 | # GET /v2.1/Leads 46 | describe '#get_leads' do 47 | it 'returns an array of leads' do 48 | VCR.use_cassette('get_leads') do 49 | leads = Insightly2.client.get_leads 50 | expect(leads).to be_a(Array) 51 | expect(leads.first).to be_a(Lead) 52 | end 53 | end 54 | end 55 | end 56 | -------------------------------------------------------------------------------- /spec/insightly2/dsl/opportunity_state_reasons_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe Insightly2::DSL::Opportunities do 4 | # GET /v2.1/OpportunityStateReasons 5 | describe '#get_opportunity_state_reasons' do 6 | it 'returns an array of opportunity_state_reasons' do 7 | VCR.use_cassette('get_opportunity_state_reasons') do 8 | opportunity_state_reasons = Insightly2.client.get_opportunity_state_reasons 9 | expect(opportunity_state_reasons).to be_a(Array) 10 | expect(opportunity_state_reasons.first).to be_a(OpportunityStateReason) 11 | end 12 | end 13 | end 14 | end -------------------------------------------------------------------------------- /spec/insightly2/dsl/pipeline_stages_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe Insightly2::DSL::PipelineStages do 4 | let(:pipeline_stage_id) { 377384 } 5 | 6 | # GET /v2.1/PipelineStages/{id} 7 | describe '#get_pipeline_stage' do 8 | it 'returns a pipeline stage' do 9 | VCR.use_cassette('get_pipeline_stage') do 10 | expect(Insightly2.client.get_pipeline_stage(id: pipeline_stage_id)).to be_a(PipelineStage) 11 | end 12 | end 13 | end 14 | 15 | # GET /v2.1/PipelineStages 16 | describe '#get_pipeline_stages' do 17 | it 'returns an array of pipeline_stages' do 18 | VCR.use_cassette('get_pipeline_stages') do 19 | pipeline_stages = Insightly2.client.get_pipeline_stages 20 | expect(pipeline_stages).to be_a(Array) 21 | expect(pipeline_stages.first).to be_a(PipelineStage) 22 | end 23 | end 24 | end 25 | end -------------------------------------------------------------------------------- /spec/insightly2/dsl/pipelines_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe Insightly2::DSL::Pipelines do 4 | let(:pipeline_id) { 124170 } 5 | 6 | # GET /v2.1/Pipelines/{id} 7 | describe '#get_pipeline' do 8 | it 'returns a pipeline' do 9 | VCR.use_cassette('get_pipeline') do 10 | expect(Insightly2.client.get_pipeline(id: pipeline_id)).to be_a(Pipeline) 11 | end 12 | end 13 | end 14 | 15 | # GET /v2.1/Pipelines 16 | describe '#get_pipelines' do 17 | it 'returns an array of pipelines' do 18 | VCR.use_cassette('get_pipelines') do 19 | pipelines = Insightly2.client.get_pipelines 20 | expect(pipelines).to be_a(Array) 21 | expect(pipelines.first).to be_a(Pipeline) 22 | end 23 | end 24 | end 25 | end -------------------------------------------------------------------------------- /spec/insightly2/dsl/project_categories_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe Insightly2::DSL::ProjectCategories do 4 | let(:project_category_id) { 1947441 } 5 | 6 | # GET /v2.1/ProjectCategories/{id} 7 | describe '#get_project_category' do 8 | it 'returns an project_category' do 9 | VCR.use_cassette('get_project_category') do 10 | expect(Insightly2.client.get_project_category(id: project_category_id)).to be_a(ProjectCategory) 11 | end 12 | end 13 | end 14 | 15 | # GET /v2.1/ProjectCategories 16 | describe '#get_project_categories' do 17 | it 'returns an array of project_categories' do 18 | VCR.use_cassette('get_project_categories') do 19 | project_categories = Insightly2.client.get_project_categories 20 | expect(project_categories).to be_a(Array) 21 | expect(project_categories.first).to be_a(ProjectCategory) 22 | end 23 | end 24 | end 25 | 26 | # POST /v2.1/ProjectCategories 27 | describe '#create_project_category' do 28 | it 'creates and returns a project_category' do 29 | VCR.use_cassette('create_project_category') do 30 | project_category = Insightly2.client.get_project_category(id: project_category_id) 31 | expect(Insightly2.client.create_project_category(category: project_category)).to be_a(ProjectCategory) 32 | end 33 | end 34 | end 35 | 36 | # PUT /v2.1/ProjectCategories 37 | describe '#update_project_category' do 38 | it 'updates and returns a project_category' do 39 | VCR.use_cassette('update_project_category') do 40 | project_category = Insightly2.client.get_project_category(id: project_category_id) 41 | expect(Insightly2.client.update_project_category(category: project_category)).to be_a(ProjectCategory) 42 | end 43 | end 44 | end 45 | 46 | # DELETE /v2.1/ProjectCategories/{id} 47 | describe '#delete_project_category' do 48 | it 'returns a response with code 202' do 49 | VCR.use_cassette('delete_project_category') do 50 | response = Insightly2.client.delete_project_category(id: project_category_id) 51 | expect(response.status).to eq(202) 52 | end 53 | end 54 | end 55 | end -------------------------------------------------------------------------------- /spec/insightly2/dsl/task_categories_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe Insightly2::DSL::TaskCategories do 4 | let(:task_category_id) { 1947437 } 5 | 6 | # GET /v2.1/TaskCategories/{id} 7 | describe '#get_task_category' do 8 | it 'returns a task category' do 9 | VCR.use_cassette('get_task_category') do 10 | expect(Insightly2.client.get_task_category(id: task_category_id)).to be_a(TaskCategory) 11 | end 12 | end 13 | end 14 | 15 | # GET /v2.1/TaskCategories 16 | describe '#get_task_categories' do 17 | it 'returns an array of task_categories' do 18 | VCR.use_cassette('get_task_categories') do 19 | task_categories = Insightly2.client.get_task_categories 20 | expect(task_categories).to be_a(Array) 21 | expect(task_categories.first).to be_a(TaskCategory) 22 | end 23 | end 24 | end 25 | 26 | # POST /v2.1/TaskCategories 27 | describe '#create_task_category' do 28 | it 'creates and returns task_category' do 29 | VCR.use_cassette('create_task_category') do 30 | task_category = Insightly2.client.get_task_category(id: task_category_id) 31 | expect(Insightly2.client.create_task_category(category: task_category)).to be_a(TaskCategory) 32 | end 33 | end 34 | end 35 | 36 | # PUT /v2.1/TaskCategories 37 | describe '#update_task_category' do 38 | it 'updates and returns task_category' do 39 | VCR.use_cassette('update_task_category') do 40 | task_category = Insightly2.client.get_task_category(id: task_category_id) 41 | expect(Insightly2.client.update_task_category(category: task_category)).to be_a(TaskCategory) 42 | end 43 | end 44 | end 45 | 46 | # DELETE /v2.1/TaskCategories/{id} 47 | describe '#delete_task_category' do 48 | it 'returns a response with code 202' do 49 | VCR.use_cassette('delete_task_category') do 50 | response = Insightly2.client.delete_task_category(id: task_category_id) 51 | expect(response.status).to eq(202) 52 | end 53 | end 54 | end 55 | end -------------------------------------------------------------------------------- /spec/insightly2/dsl/team_members_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe Insightly2::DSL::TeamMembers do 4 | let(:team_member_id) { 5016224 } 5 | let(:team_id) { 2063767 } 6 | 7 | # GET /v2.1/TeamMembers/{id} 8 | describe '#get_team_member' do 9 | it 'returns a team member' do 10 | VCR.use_cassette('get_team_member') do 11 | expect(Insightly2.client.get_team_member(id: team_member_id)).to be_a(TeamMember) 12 | end 13 | end 14 | end 15 | 16 | # GET /v2.1/TeamMembers?teamid={teamid} 17 | describe '#get_team_members' do 18 | it 'returns an array of team_members' do 19 | VCR.use_cassette('get_team_members') do 20 | team_members = Insightly2.client.get_team_members(team_id: team_id) 21 | expect(team_members).to be_a(Array) 22 | expect(team_members.first).to be_a(TeamMember) 23 | end 24 | end 25 | end 26 | 27 | # POST /v2.1/TeamMembers 28 | describe '#create_team_member' do 29 | it 'creates and returns a team_member' do 30 | VCR.use_cassette('create_team_member') do 31 | team_member = Insightly2.client.get_team_member(id: team_member_id) 32 | expect(Insightly2.client.create_team_member(team_member: team_member)).to be_a(TeamMember) 33 | end 34 | end 35 | end 36 | 37 | # PUT /v2.1/TeamMembers 38 | describe '#update_team_member' do 39 | it 'updates and returns a team_member' do 40 | VCR.use_cassette('update_team_member') do 41 | team_member = Insightly2.client.get_team_member(id: team_member_id) 42 | expect(Insightly2.client.update_team_member(team_member: team_member)).to be_a(TeamMember) 43 | end 44 | end 45 | end 46 | 47 | # DELETE /v2.1/TeamMembers/{id} 48 | describe '#delete_team_member' do 49 | it 'returns a response with code 202' do 50 | VCR.use_cassette('delete_team_member') do 51 | response = Insightly2.client.delete_team_member(id: team_member_id) 52 | expect(response.status).to eq(202) 53 | end 54 | end 55 | end 56 | end -------------------------------------------------------------------------------- /spec/insightly2/dsl/teams_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe Insightly2::DSL::Teams do 4 | let(:team_id) { 2063767 } 5 | 6 | # GET /v2.1/Teams/{id} 7 | describe '#get_team' do 8 | it 'returns a team' do 9 | VCR.use_cassette('get_team') do 10 | expect(Insightly2.client.get_team(id: team_id)).to be_a(Team) 11 | end 12 | end 13 | end 14 | 15 | # GET /v2.1/Teams 16 | describe '#get_teams' do 17 | it 'returns an array of teams' do 18 | VCR.use_cassette('get_teams') do 19 | teams = Insightly2.client.get_teams 20 | expect(teams).to be_a(Array) 21 | expect(teams.first).to be_a(Team) 22 | end 23 | end 24 | end 25 | 26 | # POST /v2.1/Teams 27 | describe '#create_team' do 28 | it 'creates and returns a team' do 29 | VCR.use_cassette('create_team') do 30 | team = Insightly2.client.get_team(id: team_id) 31 | expect(Insightly2.client.create_team(team: team)).to be_a(Team) 32 | end 33 | end 34 | end 35 | 36 | # PUT /v2.1/Teams 37 | describe '#update_team' do 38 | it 'updates and returns a team' do 39 | VCR.use_cassette('update_team') do 40 | team = Insightly2.client.get_team(id: team_id) 41 | expect(Insightly2.client.update_team(team: team)).to be_a(Team) 42 | end 43 | end 44 | end 45 | 46 | # DELETE /v2.1/Teams/{id} 47 | describe '#delete_team' do 48 | it 'returns a response with code 202' do 49 | VCR.use_cassette('delete_team') do 50 | response = Insightly2.client.delete_team(id: team_id) 51 | expect(response.status).to eq(202) 52 | end 53 | end 54 | end 55 | end -------------------------------------------------------------------------------- /spec/insightly2/dsl/users_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe Insightly2::DSL::Users do 4 | let(:user_id) { 607181 } 5 | 6 | # GET /v2.1/Users/{id} 7 | describe '#get_user' do 8 | it 'returns a user' do 9 | VCR.use_cassette('get_user') do 10 | expect(Insightly2.client.get_user(id: user_id)).to be_a(User) 11 | end 12 | end 13 | end 14 | 15 | # GET /v2.1/Users 16 | describe '#get_users' do 17 | it 'returns an array of users' do 18 | VCR.use_cassette('get_users') do 19 | users = Insightly2.client.get_users 20 | expect(users).to be_a(Array) 21 | expect(users.first).to be_a(User) 22 | end 23 | end 24 | end 25 | end 26 | -------------------------------------------------------------------------------- /spec/insightly2/resources/comment_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe Insightly2::Resources::Comment do 4 | subject(:comment) do 5 | VCR.use_cassette('get_comment') do 6 | Insightly2.client.get_comment(id: 3469515) 7 | end 8 | end 9 | 10 | describe 'instance' do 11 | it 'is decorated with Comment object' do 12 | expect(subject).to be_a(described_class) 13 | end 14 | 15 | %w(comment_id body owner_user_id file_attachments).each do |method| 16 | it "responds to #{method}" do 17 | expect(subject).to respond_to(method) 18 | end 19 | end 20 | end 21 | end 22 | -------------------------------------------------------------------------------- /spec/insightly2/resources/contact_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe Insightly2::Resources::Contact do 4 | subject(:contact) do 5 | VCR.use_cassette('get_contact') do 6 | Insightly2.client.get_contact(id: 70653019) 7 | end 8 | end 9 | 10 | describe 'instance' do 11 | it 'is decorated with Contact object' do 12 | expect(subject).to be_a(described_class) 13 | end 14 | 15 | %w(contact_id salutation first_name last_name background image_url default_linked_organisation 16 | visible_to visible_team_id visible_user_ids addresses contactinfos dates tags links contactlinks emaillinks).each do |method| 17 | it "responds to #{method}" do 18 | expect(subject).to respond_to(method) 19 | end 20 | end 21 | end 22 | end 23 | -------------------------------------------------------------------------------- /spec/insightly2/resources/custom_field_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe Insightly2::Resources::CustomField do 4 | subject(:custom_field) do 5 | VCR.use_cassette('get_custom_field') do 6 | Insightly2.client.get_custom_field(id: 'CONTACT_FIELD_1') 7 | end 8 | end 9 | 10 | describe 'instance' do 11 | it 'is decorated with CustomField object' do 12 | expect(subject).to be_a(described_class) 13 | end 14 | 15 | %w(custom_field_id order_id field_for field_name field_type field_help_text 16 | default_value group_id custom_field_options).each do |method| 17 | it "responds to #{method}" do 18 | expect(subject).to respond_to(method) 19 | end 20 | end 21 | end 22 | end -------------------------------------------------------------------------------- /spec/insightly2/resources/email_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe Insightly2::Resources::Email do 4 | subject(:email) do 5 | VCR.use_cassette('get_email') do 6 | Insightly2.client.get_email(id: 17683283) 7 | end 8 | end 9 | 10 | describe 'instance' do 11 | it 'is decorated with Email object' do 12 | expect(subject).to be_a(described_class) 13 | end 14 | 15 | %w(email_id gmail_message_id email_date_utc email_from email_to email_cc subject body format size 16 | owner_user_id date_created_utc visible_to visible_team_id visible_user_ids 17 | file_attachments emaillinks).each do |method| 18 | it "responds to #{method}" do 19 | expect(subject).to respond_to(method) 20 | end 21 | end 22 | end 23 | end 24 | -------------------------------------------------------------------------------- /spec/insightly2/resources/event_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe Insightly2::Resources::Event do 4 | subject(:event) do 5 | VCR.use_cassette('get_event') do 6 | Insightly2.client.get_event(id: 2402366) 7 | end 8 | end 9 | 10 | describe 'instance' do 11 | it 'is decorated with Event object' do 12 | expect(subject).to be_a(described_class) 13 | end 14 | 15 | %w(event_id title location details start_date_utc end_date_utc all_day publicly_visible 16 | reminder_date_utc reminder_sent eventlinks owner_user_id date_created_utc 17 | date_updated_utc).each do |method| 18 | it "responds to #{method}" do 19 | expect(subject).to respond_to(method) 20 | end 21 | end 22 | end 23 | end 24 | -------------------------------------------------------------------------------- /spec/insightly2/resources/file_attachment_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe Insightly2::Resources::FileAttachment do 4 | # TODO - I don't believe it's possible to get a file attachment 5 | # in a parseable format directly from the file attachment end point. 6 | # You have to extract it from another resources array of file attachment 7 | # hashes. The deserializer can currently only accept a response object 8 | # so it's not possible to pass a hash and get back a resource object 9 | # which is what we want to do in this test. 10 | 11 | # subject(:file_attachment) do 12 | # VCR.use_cassette('get_email_comments') do 13 | # comments = Insightly2.client.get_email_comments(id: 17683283) 14 | # comment = comments.last 15 | # file_attachment = comment['FILE_ATTACHMENTS'].last 16 | # FileAttachment.parse(file_attachment) 17 | # end 18 | # end 19 | 20 | # describe 'instance' do 21 | # it 'is decorated with FileAttachment object' do 22 | # expect(subject).to be_a(described_class) 23 | # end 24 | # 25 | # %w(file_attachment_id).each do |method| 26 | # it "responds to #{method}" do 27 | # expect(subject).to respond_to(method) 28 | # end 29 | # end 30 | # end 31 | end -------------------------------------------------------------------------------- /spec/insightly2/resources/file_category_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe Insightly2::Resources::FileCategory do 4 | subject(:file_category) do 5 | VCR.use_cassette('get_file_category') do 6 | Insightly2.client.get_file_category(id: 1947439) 7 | end 8 | end 9 | 10 | describe 'instance' do 11 | it 'is decorated with FileCategory object' do 12 | expect(subject).to be_a(described_class) 13 | end 14 | 15 | %w(category_id category_name active background_color).each do |method| 16 | it "responds to #{method}" do 17 | expect(subject).to respond_to(method) 18 | end 19 | end 20 | end 21 | end -------------------------------------------------------------------------------- /spec/insightly2/resources/lead_source_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe Insightly2::Resources::LeadSource do 4 | subject(:lead_source) do 5 | VCR.use_cassette('get_lead_sources') do 6 | Insightly2.client.get_lead_sources.first 7 | end 8 | end 9 | 10 | describe 'instance' do 11 | it 'is decorated with LeadSource object' do 12 | expect(subject).to be_a(described_class) 13 | end 14 | 15 | %w(lead_source_id lead_source default_value field_order).each do |method| 16 | it "responds to #{method}" do 17 | expect(subject).to respond_to(method) 18 | end 19 | end 20 | end 21 | end 22 | -------------------------------------------------------------------------------- /spec/insightly2/resources/lead_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe Insightly2::Resources::Lead do 4 | subject(:lead) do 5 | VCR.use_cassette('get_lead') do 6 | Insightly2.client.get_lead(id: 7246484) 7 | end 8 | end 9 | 10 | describe 'instance' do 11 | it 'is decorated with Lead object' do 12 | expect(subject).to be_a(described_class) 13 | end 14 | 15 | %w(lead_id salutation title first_name last_name organization_name phone_number mobile_phone_number fax_number 16 | email_address website_url owner_user_id date_created_utc date_updated_utc 17 | converted converted_date_utc converted_contact_id converted_organization_id converted_opportunity_id visible_to 18 | responsible_user_id industry lead_status_id lead_source_id visible_team_id employee_count lead_rating lead_description 19 | visible_user_ids customfields address_street address_city address_state address_postcode address_country 20 | tags email_links event_links task_links note_links file_attachments image_url).each do |method| 21 | it "responds to #{method}" do 22 | expect(subject).to respond_to(method) 23 | end 24 | end 25 | end 26 | end 27 | -------------------------------------------------------------------------------- /spec/insightly2/resources/lead_status_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe Insightly2::Resources::LeadStatus do 4 | subject(:lead_status) do 5 | VCR.use_cassette('get_lead_statuses') do 6 | Insightly2.client.get_lead_statuses.first 7 | end 8 | end 9 | 10 | describe 'instance' do 11 | it 'is decorated with LeadStatus object' do 12 | expect(subject).to be_a(described_class) 13 | end 14 | 15 | %w(lead_status_id lead_status default_status status_type field_order).each do |method| 16 | it "responds to #{method}" do 17 | expect(subject).to respond_to(method) 18 | end 19 | end 20 | end 21 | end 22 | -------------------------------------------------------------------------------- /spec/insightly2/resources/note_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe Insightly2::Resources::Note do 4 | subject(:note) do 5 | VCR.use_cassette('get_note') do 6 | Insightly2.client.get_note(id: 15377334) 7 | end 8 | end 9 | 10 | describe 'instance' do 11 | it 'is decorated with Note object' do 12 | expect(subject).to be_a(described_class) 13 | end 14 | 15 | %w(note_id title body link_subject_id link_subject_type owner_user_id date_created_utc 16 | date_updated_utc visible_to visible_team_id visible_user_ids file_attachments 17 | notelinks).each do |method| 18 | it "responds to #{method}" do 19 | expect(subject).to respond_to(method) 20 | end 21 | end 22 | end 23 | end 24 | -------------------------------------------------------------------------------- /spec/insightly2/resources/opportunity_category_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe Insightly2::Resources::OpportunityCategory do 4 | subject(:opportunity_category) do 5 | VCR.use_cassette('get_opportunity_category') do 6 | Insightly2.client.get_opportunity_category(id: 2175382) 7 | end 8 | end 9 | 10 | describe 'instance' do 11 | it 'is decorated with OpportunityCategory object' do 12 | expect(subject).to be_a(described_class) 13 | end 14 | 15 | %w(category_id category_name active background_color).each do |method| 16 | it "responds to #{method}" do 17 | expect(subject).to respond_to(method) 18 | end 19 | end 20 | end 21 | end -------------------------------------------------------------------------------- /spec/insightly2/resources/opportunity_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe Insightly2::Resources::Opportunity do 4 | subject(:opportunity) do 5 | VCR.use_cassette('get_opportunity') do 6 | Insightly2.client.get_opportunity(id: 4070112) 7 | end 8 | end 9 | 10 | describe 'instance' do 11 | it 'is decorated with Opportunity object' do 12 | expect(subject).to be_a(described_class) 13 | end 14 | 15 | %w(opportunity_id opportunity_name opportunity_details probability bid_currency bid_amount 16 | bid_type bid_duration forecast_close_date category_id pipeline_id stage_id opportunity_state 17 | image_url responsible_user_id owner_user_id date_created_utc date_updated_utc visible_to 18 | visible_team_id visible_user_ids customfields tags links emaillinks).each do |method| 19 | it "responds to #{method}" do 20 | expect(subject).to respond_to(method) 21 | end 22 | end 23 | end 24 | end 25 | -------------------------------------------------------------------------------- /spec/insightly2/resources/organisation_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe Insightly2::Resources::Organisation do 4 | subject(:organisation) do 5 | VCR.use_cassette('get_organisation') do 6 | Insightly2.client.get_organisation(id: 39831139) 7 | end 8 | end 9 | 10 | describe 'instance' do 11 | it 'is decorated with Organisation object' do 12 | expect(subject).to be_a(described_class) 13 | end 14 | 15 | %w(organisation_id organisation_name background image_url owner_user_id date_created_utc 16 | date_updated_utc visible_to visible_team_id visible_user_ids customfields addresses 17 | contactinfos dates tags links organisationlinks emaillinks).each do |method| 18 | it "responds to #{method}" do 19 | expect(subject).to respond_to(method) 20 | end 21 | end 22 | end 23 | end 24 | -------------------------------------------------------------------------------- /spec/insightly2/resources/pipeline_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe Insightly2::Resources::Pipeline do 4 | subject(:pipeline) do 5 | VCR.use_cassette('get_pipeline') do 6 | Insightly2.client.get_pipeline(id: 124170) 7 | end 8 | end 9 | 10 | describe 'instance' do 11 | it 'is decorated with Pipeline object' do 12 | expect(subject).to be_a(described_class) 13 | end 14 | 15 | %w(pipeline_id pipeline_name for_opportunities for_projects owner_user_id).each do |method| 16 | it "responds to #{method}" do 17 | expect(subject).to respond_to(method) 18 | end 19 | end 20 | end 21 | end -------------------------------------------------------------------------------- /spec/insightly2/resources/pipeline_stage_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe Insightly2::Resources::PipelineStage do 4 | subject(:pipeline_stage) do 5 | VCR.use_cassette('get_pipeline_stage') do 6 | Insightly2.client.get_pipeline_stage(id: 377384) 7 | end 8 | end 9 | 10 | describe 'instance' do 11 | it 'is decorated with PipelineStage object' do 12 | expect(subject).to be_a(described_class) 13 | end 14 | 15 | %w(pipeline_id stage_id stage_name stage_order owner_user_id).each do |method| 16 | it "responds to #{method}" do 17 | expect(subject).to respond_to(method) 18 | end 19 | end 20 | end 21 | end -------------------------------------------------------------------------------- /spec/insightly2/resources/project_category_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe Insightly2::Resources::ProjectCategory do 4 | subject(:project_category) do 5 | VCR.use_cassette('get_project_category') do 6 | Insightly2.client.get_project_category(id: 1947441) 7 | end 8 | end 9 | 10 | describe 'instance' do 11 | it 'is decorated with ProjectCategory object' do 12 | expect(subject).to be_a(described_class) 13 | end 14 | 15 | %w(category_id category_name active background_color).each do |method| 16 | it "responds to #{method}" do 17 | expect(subject).to respond_to(method) 18 | end 19 | end 20 | end 21 | end -------------------------------------------------------------------------------- /spec/insightly2/resources/project_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe Insightly2::Resources::Project do 4 | subject(:project) do 5 | VCR.use_cassette('get_project') do 6 | Insightly2.client.get_project(id: 1657941) 7 | end 8 | end 9 | 10 | describe 'instance' do 11 | it 'is decorated with Project object' do 12 | expect(subject).to be_a(described_class) 13 | end 14 | 15 | %w(project_id project_name status project_details opportunity_id started_date completed_date 16 | image_url responsible_user_id owner_user_id date_created_utc date_updated_utc category_id 17 | pipeline_id stage_id visible_to visible_team_id visible_user_ids customfields tags links 18 | emaillinks).each do |method| 19 | it "responds to #{method}" do 20 | expect(subject).to respond_to(method) 21 | end 22 | end 23 | end 24 | end 25 | -------------------------------------------------------------------------------- /spec/insightly2/resources/task_category_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe Insightly2::Resources::TaskCategory do 4 | subject(:task_category) do 5 | VCR.use_cassette('get_task_category') do 6 | Insightly2.client.get_task_category(id: 1947437) 7 | end 8 | end 9 | 10 | describe 'instance' do 11 | it 'is decorated with TaskCategory object' do 12 | expect(subject).to be_a(described_class) 13 | end 14 | 15 | %w(category_id category_name active background_color).each do |method| 16 | it "responds to #{method}" do 17 | expect(subject).to respond_to(method) 18 | end 19 | end 20 | end 21 | end -------------------------------------------------------------------------------- /spec/insightly2/resources/task_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe Insightly2::Resources::Task do 4 | subject(:task) do 5 | VCR.use_cassette('get_task') do 6 | Insightly2.client.get_task(id: 14694323) 7 | end 8 | end 9 | 10 | describe 'instance' do 11 | it 'is decorated with Task object' do 12 | expect(subject).to be_a(described_class) 13 | end 14 | 15 | # TODO - title should be included here but there's a bug in the API response. 16 | # Title is not uppercase unlike every other JSON attribute. 17 | %w(task_id category_id due_date completed_date_utc publicly_visible completed 18 | project_id details status priority percent_complete start_date assigned_by_user_id 19 | parent_task_id owner_visible responsible_user_id owner_user_id date_created_utc 20 | date_updated_utc tasklinks).each do |method| 21 | it "responds to #{method}" do 22 | expect(subject).to respond_to(method) 23 | end 24 | end 25 | end 26 | end 27 | -------------------------------------------------------------------------------- /spec/insightly2/resources/team_member_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe Insightly2::Resources::TeamMember do 4 | subject(:team_member) do 5 | VCR.use_cassette('get_team_member') do 6 | Insightly2.client.get_team_member(id: 5016224) 7 | end 8 | end 9 | 10 | describe 'instance' do 11 | it 'is decorated with TeamMember object' do 12 | expect(subject).to be_a(described_class) 13 | end 14 | 15 | %w(permission_id team_id member_user_id member_team_id).each do |method| 16 | it "responds to #{method}" do 17 | expect(subject).to respond_to(method) 18 | end 19 | end 20 | end 21 | end -------------------------------------------------------------------------------- /spec/insightly2/resources/team_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe Insightly2::Resources::Team do 4 | subject(:team) do 5 | VCR.use_cassette('get_team') do 6 | Insightly2.client.get_team(id: 2063767) 7 | end 8 | end 9 | 10 | describe 'instance' do 11 | it 'is decorated with Team object' do 12 | expect(subject).to be_a(described_class) 13 | end 14 | 15 | %w(team_id team_name anonymous_team date_created_utc date_updated_utc teammembers).each do |method| 16 | it "responds to #{method}" do 17 | expect(subject).to respond_to(method) 18 | end 19 | end 20 | end 21 | end 22 | -------------------------------------------------------------------------------- /spec/insightly2/resources/user_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe Insightly2::Resources::User do 4 | subject(:user) do 5 | VCR.use_cassette('get_user') do 6 | Insightly2.client.get_user(id: 607181) 7 | end 8 | end 9 | 10 | describe 'instance' do 11 | it 'is decorated with User object' do 12 | expect(subject).to be_a(described_class) 13 | end 14 | 15 | %w(user_id contact_id first_name last_name timezone_id email_address email_dropbox_identifier 16 | administrator account_owner active date_created_utc date_updated_utc user_currency contact_display 17 | contact_order task_week_start instance_id).each do |method| 18 | it "responds to #{method}" do 19 | expect(subject).to respond_to(method) 20 | end 21 | end 22 | end 23 | end 24 | -------------------------------------------------------------------------------- /spec/insightly2_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe Insightly2 do 4 | it 'has a version number' do 5 | expect(Insightly2::VERSION).not_to be nil 6 | end 7 | 8 | it 'provides way to set API key' do 9 | expect(Insightly2).to respond_to(:api_key) 10 | end 11 | 12 | it 'provides shortcut for instantiating Client' do 13 | expect(Insightly2.client).to be_a(Insightly2::Client) 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /spec/spec_helper.rb: -------------------------------------------------------------------------------- 1 | require 'webmock/rspec' 2 | require 'insightly2' 3 | require 'vcr' 4 | include Insightly2::Resources 5 | 6 | APP_ROOT = File.expand_path(File.join(File.dirname(__FILE__), '..')) 7 | cnf = YAML::load_file(File.join(APP_ROOT, 'config/gem_secret.yml')) 8 | insightly_api_key = cnf['insightly_api_key'] 9 | 10 | VCR.configure do |c| 11 | c.cassette_library_dir = 'spec/fixtures/vcr_cassettes' 12 | c.hook_into :webmock 13 | c.filter_sensitive_data('') { insightly_api_key } 14 | end 15 | 16 | RSpec.configure do |config| 17 | config.before do 18 | Insightly2.api_key = insightly_api_key 19 | end 20 | end 21 | --------------------------------------------------------------------------------