{"action":"created","comment":{"url":"https://api.github.com/repos/workato/connector_sdk/pulls/comments/140716382","pull_request_review_id":64826719,"id":140716382,"diff_hunk":"@@ -0,0 +1,157 @@\n+{\n+  title: 'Base',\n+\n+  connection: {\n+    fields: [\n+      {\n+        name: 'api_key',\n+        control_type: 'password',\n+        optional: false,\n+        label: 'Personal Access Token'\n+      }\n+    ],\n+\n+    authorization: {\n+      type: \"api_key\",\n+\n+      credentials: lambda do |connection|\n+        headers(\"Authorization\": \"Bearer \" +connection[\"api_key\"])\n+      end\n+    }\n+  },\n+\n+\n+  object_definitions: {\n+    lead: {\n+      fields: ->(){\n+        [\n+          {name: 'id', type: :integer, label: 'Lead ID', control_type: :number},\n+          {name: 'creator_id', type: :integer, label: 'Created By ID', control_type: :number},\n+          {name: 'owner_id', type: :integer, label: 'Owner ID', control_type: :number},\n+          {name: 'first_name', type: :string, label: 'First Name', control_type: :text},\n+          {name: 'last_name', type: :string, label: 'Last Name', control_type: :text},\n+          {name: 'organization_name', type: :string, label: 'Organization Name', control_type: :text},\n+          {name: 'status', type: :string, control_type: :text},\n+          {name: 'source_id', type: :integer, control_type: :text},\n+          {name: 'title', type: :string, control_type: :text},\n+          {name: 'description', type: :string, control_type: :text},\n+          {name: 'industry', type: :string, control_type: :text},\n+          {name: 'website', type: :string, control_type: :url},\n+          {name: 'email', type: :string, control_type: :email},\n+          {name: 'phone', type: :string, control_type: :phone},\n+          {name: 'mobile', type: :string, control_type: :phone},\n+          {name: 'fax', type: :string, control_type: :phone},\n+          {name: 'twitter', type: :string, control_type: :text},\n+          {name: 'facebook', type: :string, control_type: :text},\n+          {name: 'linkedin', type: :string, control_type: :text},\n+          {name: 'skype', type: :string, control_type: :text},\n+          {name: 'address', type: :object, properties: [\n+             {name: 'line1', type: :string, control_type: :text},\n+             {name: 'city', type: :string, control_type: :text},\n+             {name: 'postal_code', type: :string, control_type: :text},\n+             {name: 'state', type: :string, control_type: :text},\n+             {name: 'country', type: :string, control_type: :text}\n+          ]},\n+          {name: 'tags', type: :array, of: :string},\n+          {name: 'custom_fields', type: :object, properties: [\n+             {name: 'known_via', type: :string, control_type: :text}\n+          ]},\n+          {name: 'created_at', type: :date_time, control_type: :timestamp},\n+          {name: 'updated_at', type: :date_time, control_type: :timestamp}\n+        ]\n+      }\n+    },\n+\n+  },\n+\n+  test: ->(connection) {\n+    get(\"https://api.getbase.com/v2/users/self\")\n+  },\n+\n+  actions: {\n+    search_leads: {\n+      description: 'Search <span class=\"provider\">Leads</span> in <span class=\"provider\">BASE</span>',\n+      subtitle: 'Search leads in BASE',\n+      help: 'Selection of mutliple search fields will fetch results based on AND condition',\n+      input_fields: ->(object_definitions) {\n+        [\n+          {name: 'ids', type: :string, control_type: :text, label: \"Id's\",\n+           hint: 'Comma-separated list of lead IDs to be returned in a request.'},\n+          {name: 'creator_id', type: :integer, control_type: :number, label: 'Created By(User ID)',\n+           hint: 'Returns all leads created by that user.'},\n+          {name: 'owner_id', type: :integer, control_type: :number, label: 'Owner ID', hint: 'User ID. Returns all leads owned by that user.'},\n+          {name: 'source_id', type: :integer, control_type: :number, hint: \"Id of the Source.\"},\n+          {name: 'first_name', type: :string, control_type: :text, label: 'First Name'},\n+          {name: 'last_name', type: :string, control_type: :text, label: 'Last Name'},\n+          {name: 'organization_name', type: :string, control_type: :text, label: 'Organization Name'},\n+          {name: 'status', type: :string, control_type: :text, label: 'Status of the lead'},\n+          {name: 'email', type: :string, control_type: :email, label: 'Email'},\n+          {name: 'phone', type: :string, control_type: :phone, label: 'Phone'},\n+          {name: 'mobile', type: :string, control_type: :phone, label: 'Mobile'},\n+          {name: 'address[city]', type: :string, control_type: :text, label: 'City Name'},\n+          {name: 'address[postal_code]', type: :string, control_type: :text, label: 'Zip/Postal Code'},\n+          {name: 'address[state]', type: :string, control_type: :text, label: 'State/region name'},\n+          {name: 'address[country]', type: :string, control_type: :text, label: 'Country name'}\n+        ]\n+      },\n+      execute: ->(connection, input) {\n+        params = input.map do |key, value|\n+          \"#{key}=#{value}\"\n+        end.join('&')\n+        leads_result = get(\"https://api.getbase.com/v2/leads?\"+params)['items']\n+\n+        leads = leads_result.map do |lead|","path":"api_key_auth/base.rb","position":null,"original_position":103,"commit_id":"854414732ad60fbd2d28b87a89d63b4e5467ce7c","original_commit_id":"e2c7076ff7de6a668b521d4642f3c340067c6af5","user":{"login":"svchandra","id":22195459,"avatar_url":"https://avatars2.githubusercontent.com/u/22195459?v=4","gravatar_id":"","url":"https://api.github.com/users/svchandra","html_url":"https://github.com/svchandra","followers_url":"https://api.github.com/users/svchandra/followers","following_url":"https://api.github.com/users/svchandra/following{/other_user}","gists_url":"https://api.github.com/users/svchandra/gists{/gist_id}","starred_url":"https://api.github.com/users/svchandra/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/svchandra/subscriptions","organizations_url":"https://api.github.com/users/svchandra/orgs","repos_url":"https://api.github.com/users/svchandra/repos","events_url":"https://api.github.com/users/svchandra/events{/privacy}","received_events_url":"https://api.github.com/users/svchandra/received_events","type":"User","site_admin":false},"body":"Done.","created_at":"2017-09-25T08:36:47Z","updated_at":"2017-09-25T08:36:47Z","html_url":"https://github.com/workato/connector_sdk/pull/91#discussion_r140716382","pull_request_url":"https://api.github.com/repos/workato/connector_sdk/pulls/91","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/workato/connector_sdk/pulls/comments/140716382"},"html":{"href":"https://github.com/workato/connector_sdk/pull/91#discussion_r140716382"},"pull_request":{"href":"https://api.github.com/repos/workato/connector_sdk/pulls/91"}},"in_reply_to_id":139887055},"pull_request":{"url":"https://api.github.com/repos/workato/connector_sdk/pulls/91","id":141576057,"html_url":"https://github.com/workato/connector_sdk/pull/91","diff_url":"https://github.com/workato/connector_sdk/pull/91.diff","patch_url":"https://github.com/workato/connector_sdk/pull/91.patch","issue_url":"https://api.github.com/repos/workato/connector_sdk/issues/91","number":91,"state":"open","locked":false,"title":"Base CRM Adapter ","user":{"login":"svchandra","id":22195459,"avatar_url":"https://avatars2.githubusercontent.com/u/22195459?v=4","gravatar_id":"","url":"https://api.github.com/users/svchandra","html_url":"https://github.com/svchandra","followers_url":"https://api.github.com/users/svchandra/followers","following_url":"https://api.github.com/users/svchandra/following{/other_user}","gists_url":"https://api.github.com/users/svchandra/gists{/gist_id}","starred_url":"https://api.github.com/users/svchandra/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/svchandra/subscriptions","organizations_url":"https://api.github.com/users/svchandra/orgs","repos_url":"https://api.github.com/users/svchandra/repos","events_url":"https://api.github.com/users/svchandra/events{/privacy}","received_events_url":"https://api.github.com/users/svchandra/received_events","type":"User","site_admin":false},"body":"Submitted for Review.","created_at":"2017-09-18T11:14:22Z","updated_at":"2017-09-25T08:36:47Z","closed_at":null,"merged_at":null,"merge_commit_sha":"78524ed03423116b0dfce582a716099ee794363a","assignee":{"login":"svchandra","id":22195459,"avatar_url":"https://avatars2.githubusercontent.com/u/22195459?v=4","gravatar_id":"","url":"https://api.github.com/users/svchandra","html_url":"https://github.com/svchandra","followers_url":"https://api.github.com/users/svchandra/followers","following_url":"https://api.github.com/users/svchandra/following{/other_user}","gists_url":"https://api.github.com/users/svchandra/gists{/gist_id}","starred_url":"https://api.github.com/users/svchandra/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/svchandra/subscriptions","organizations_url":"https://api.github.com/users/svchandra/orgs","repos_url":"https://api.github.com/users/svchandra/repos","events_url":"https://api.github.com/users/svchandra/events{/privacy}","received_events_url":"https://api.github.com/users/svchandra/received_events","type":"User","site_admin":false},"assignees":[{"login":"svchandra","id":22195459,"avatar_url":"https://avatars2.githubusercontent.com/u/22195459?v=4","gravatar_id":"","url":"https://api.github.com/users/svchandra","html_url":"https://github.com/svchandra","followers_url":"https://api.github.com/users/svchandra/followers","following_url":"https://api.github.com/users/svchandra/following{/other_user}","gists_url":"https://api.github.com/users/svchandra/gists{/gist_id}","starred_url":"https://api.github.com/users/svchandra/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/svchandra/subscriptions","organizations_url":"https://api.github.com/users/svchandra/orgs","repos_url":"https://api.github.com/users/svchandra/repos","events_url":"https://api.github.com/users/svchandra/events{/privacy}","received_events_url":"https://api.github.com/users/svchandra/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/workato/connector_sdk/pulls/91/commits","review_comments_url":"https://api.github.com/repos/workato/connector_sdk/pulls/91/comments","review_comment_url":"https://api.github.com/repos/workato/connector_sdk/pulls/comments{/number}","comments_url":"https://api.github.com/repos/workato/connector_sdk/issues/91/comments","statuses_url":"https://api.github.com/repos/workato/connector_sdk/statuses/854414732ad60fbd2d28b87a89d63b4e5467ce7c","head":{"label":"workato:svchandra-patch-3","ref":"svchandra-patch-3","sha":"854414732ad60fbd2d28b87a89d63b4e5467ce7c","user":{"login":"workato","id":5629924,"avatar_url":"https://avatars3.githubusercontent.com/u/5629924?v=4","gravatar_id":"","url":"https://api.github.com/users/workato","html_url":"https://github.com/workato","followers_url":"https://api.github.com/users/workato/followers","following_url":"https://api.github.com/users/workato/following{/other_user}","gists_url":"https://api.github.com/users/workato/gists{/gist_id}","starred_url":"https://api.github.com/users/workato/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/workato/subscriptions","organizations_url":"https://api.github.com/users/workato/orgs","repos_url":"https://api.github.com/users/workato/repos","events_url":"https://api.github.com/users/workato/events{/privacy}","received_events_url":"https://api.github.com/users/workato/received_events","type":"Organization","site_admin":false},"repo":{"id":54221993,"name":"connector_sdk","full_name":"workato/connector_sdk","owner":{"login":"workato","id":5629924,"avatar_url":"https://avatars3.githubusercontent.com/u/5629924?v=4","gravatar_id":"","url":"https://api.github.com/users/workato","html_url":"https://github.com/workato","followers_url":"https://api.github.com/users/workato/followers","following_url":"https://api.github.com/users/workato/following{/other_user}","gists_url":"https://api.github.com/users/workato/gists{/gist_id}","starred_url":"https://api.github.com/users/workato/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/workato/subscriptions","organizations_url":"https://api.github.com/users/workato/orgs","repos_url":"https://api.github.com/users/workato/repos","events_url":"https://api.github.com/users/workato/events{/privacy}","received_events_url":"https://api.github.com/users/workato/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/workato/connector_sdk","description":"Connector SDK samples and documentation","fork":false,"url":"https://api.github.com/repos/workato/connector_sdk","forks_url":"https://api.github.com/repos/workato/connector_sdk/forks","keys_url":"https://api.github.com/repos/workato/connector_sdk/keys{/key_id}","collaborators_url":"https://api.github.com/repos/workato/connector_sdk/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/workato/connector_sdk/teams","hooks_url":"https://api.github.com/repos/workato/connector_sdk/hooks","issue_events_url":"https://api.github.com/repos/workato/connector_sdk/issues/events{/number}","events_url":"https://api.github.com/repos/workato/connector_sdk/events","assignees_url":"https://api.github.com/repos/workato/connector_sdk/assignees{/user}","branches_url":"https://api.github.com/repos/workato/connector_sdk/branches{/branch}","tags_url":"https://api.github.com/repos/workato/connector_sdk/tags","blobs_url":"https://api.github.com/repos/workato/connector_sdk/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/workato/connector_sdk/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/workato/connector_sdk/git/refs{/sha}","trees_url":"https://api.github.com/repos/workato/connector_sdk/git/trees{/sha}","statuses_url":"https://api.github.com/repos/workato/connector_sdk/statuses/{sha}","languages_url":"https://api.github.com/repos/workato/connector_sdk/languages","stargazers_url":"https://api.github.com/repos/workato/connector_sdk/stargazers","contributors_url":"https://api.github.com/repos/workato/connector_sdk/contributors","subscribers_url":"https://api.github.com/repos/workato/connector_sdk/subscribers","subscription_url":"https://api.github.com/repos/workato/connector_sdk/subscription","commits_url":"https://api.github.com/repos/workato/connector_sdk/commits{/sha}","git_commits_url":"https://api.github.com/repos/workato/connector_sdk/git/commits{/sha}","comments_url":"https://api.github.com/repos/workato/connector_sdk/comments{/number}","issue_comment_url":"https://api.github.com/repos/workato/connector_sdk/issues/comments{/number}","contents_url":"https://api.github.com/repos/workato/connector_sdk/contents/{+path}","compare_url":"https://api.github.com/repos/workato/connector_sdk/compare/{base}...{head}","merges_url":"https://api.github.com/repos/workato/connector_sdk/merges","archive_url":"https://api.github.com/repos/workato/connector_sdk/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/workato/connector_sdk/downloads","issues_url":"https://api.github.com/repos/workato/connector_sdk/issues{/number}","pulls_url":"https://api.github.com/repos/workato/connector_sdk/pulls{/number}","milestones_url":"https://api.github.com/repos/workato/connector_sdk/milestones{/number}","notifications_url":"https://api.github.com/repos/workato/connector_sdk/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/workato/connector_sdk/labels{/name}","releases_url":"https://api.github.com/repos/workato/connector_sdk/releases{/id}","deployments_url":"https://api.github.com/repos/workato/connector_sdk/deployments","created_at":"2016-03-18T18:08:56Z","updated_at":"2017-05-11T11:40:27Z","pushed_at":"2017-09-25T08:20:08Z","git_url":"git://github.com/workato/connector_sdk.git","ssh_url":"git@github.com:workato/connector_sdk.git","clone_url":"https://github.com/workato/connector_sdk.git","svn_url":"https://github.com/workato/connector_sdk","homepage":"","size":1539,"stargazers_count":10,"watchers_count":10,"language":"Ruby","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":27,"mirror_url":null,"open_issues_count":28,"forks":27,"open_issues":28,"watchers":10,"default_branch":"master"}},"base":{"label":"workato:master","ref":"master","sha":"aba4967ad517e0f8f9d3bd0eca01dd392c1e6fce","user":{"login":"workato","id":5629924,"avatar_url":"https://avatars3.githubusercontent.com/u/5629924?v=4","gravatar_id":"","url":"https://api.github.com/users/workato","html_url":"https://github.com/workato","followers_url":"https://api.github.com/users/workato/followers","following_url":"https://api.github.com/users/workato/following{/other_user}","gists_url":"https://api.github.com/users/workato/gists{/gist_id}","starred_url":"https://api.github.com/users/workato/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/workato/subscriptions","organizations_url":"https://api.github.com/users/workato/orgs","repos_url":"https://api.github.com/users/workato/repos","events_url":"https://api.github.com/users/workato/events{/privacy}","received_events_url":"https://api.github.com/users/workato/received_events","type":"Organization","site_admin":false},"repo":{"id":54221993,"name":"connector_sdk","full_name":"workato/connector_sdk","owner":{"login":"workato","id":5629924,"avatar_url":"https://avatars3.githubusercontent.com/u/5629924?v=4","gravatar_id":"","url":"https://api.github.com/users/workato","html_url":"https://github.com/workato","followers_url":"https://api.github.com/users/workato/followers","following_url":"https://api.github.com/users/workato/following{/other_user}","gists_url":"https://api.github.com/users/workato/gists{/gist_id}","starred_url":"https://api.github.com/users/workato/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/workato/subscriptions","organizations_url":"https://api.github.com/users/workato/orgs","repos_url":"https://api.github.com/users/workato/repos","events_url":"https://api.github.com/users/workato/events{/privacy}","received_events_url":"https://api.github.com/users/workato/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/workato/connector_sdk","description":"Connector SDK samples and documentation","fork":false,"url":"https://api.github.com/repos/workato/connector_sdk","forks_url":"https://api.github.com/repos/workato/connector_sdk/forks","keys_url":"https://api.github.com/repos/workato/connector_sdk/keys{/key_id}","collaborators_url":"https://api.github.com/repos/workato/connector_sdk/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/workato/connector_sdk/teams","hooks_url":"https://api.github.com/repos/workato/connector_sdk/hooks","issue_events_url":"https://api.github.com/repos/workato/connector_sdk/issues/events{/number}","events_url":"https://api.github.com/repos/workato/connector_sdk/events","assignees_url":"https://api.github.com/repos/workato/connector_sdk/assignees{/user}","branches_url":"https://api.github.com/repos/workato/connector_sdk/branches{/branch}","tags_url":"https://api.github.com/repos/workato/connector_sdk/tags","blobs_url":"https://api.github.com/repos/workato/connector_sdk/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/workato/connector_sdk/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/workato/connector_sdk/git/refs{/sha}","trees_url":"https://api.github.com/repos/workato/connector_sdk/git/trees{/sha}","statuses_url":"https://api.github.com/repos/workato/connector_sdk/statuses/{sha}","languages_url":"https://api.github.com/repos/workato/connector_sdk/languages","stargazers_url":"https://api.github.com/repos/workato/connector_sdk/stargazers","contributors_url":"https://api.github.com/repos/workato/connector_sdk/contributors","subscribers_url":"https://api.github.com/repos/workato/connector_sdk/subscribers","subscription_url":"https://api.github.com/repos/workato/connector_sdk/subscription","commits_url":"https://api.github.com/repos/workato/connector_sdk/commits{/sha}","git_commits_url":"https://api.github.com/repos/workato/connector_sdk/git/commits{/sha}","comments_url":"https://api.github.com/repos/workato/connector_sdk/comments{/number}","issue_comment_url":"https://api.github.com/repos/workato/connector_sdk/issues/comments{/number}","contents_url":"https://api.github.com/repos/workato/connector_sdk/contents/{+path}","compare_url":"https://api.github.com/repos/workato/connector_sdk/compare/{base}...{head}","merges_url":"https://api.github.com/repos/workato/connector_sdk/merges","archive_url":"https://api.github.com/repos/workato/connector_sdk/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/workato/connector_sdk/downloads","issues_url":"https://api.github.com/repos/workato/connector_sdk/issues{/number}","pulls_url":"https://api.github.com/repos/workato/connector_sdk/pulls{/number}","milestones_url":"https://api.github.com/repos/workato/connector_sdk/milestones{/number}","notifications_url":"https://api.github.com/repos/workato/connector_sdk/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/workato/connector_sdk/labels{/name}","releases_url":"https://api.github.com/repos/workato/connector_sdk/releases{/id}","deployments_url":"https://api.github.com/repos/workato/connector_sdk/deployments","created_at":"2016-03-18T18:08:56Z","updated_at":"2017-05-11T11:40:27Z","pushed_at":"2017-09-25T08:20:08Z","git_url":"git://github.com/workato/connector_sdk.git","ssh_url":"git@github.com:workato/connector_sdk.git","clone_url":"https://github.com/workato/connector_sdk.git","svn_url":"https://github.com/workato/connector_sdk","homepage":"","size":1539,"stargazers_count":10,"watchers_count":10,"language":"Ruby","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":27,"mirror_url":null,"open_issues_count":28,"forks":27,"open_issues":28,"watchers":10,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/workato/connector_sdk/pulls/91"},"html":{"href":"https://github.com/workato/connector_sdk/pull/91"},"issue":{"href":"https://api.github.com/repos/workato/connector_sdk/issues/91"},"comments":{"href":"https://api.github.com/repos/workato/connector_sdk/issues/91/comments"},"review_comments":{"href":"https://api.github.com/repos/workato/connector_sdk/pulls/91/comments"},"review_comment":{"href":"https://api.github.com/repos/workato/connector_sdk/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/workato/connector_sdk/pulls/91/commits"},"statuses":{"href":"https://api.github.com/repos/workato/connector_sdk/statuses/854414732ad60fbd2d28b87a89d63b4e5467ce7c"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"svchandra"}}