Class: HighLevel::Resources::Opportunities

Inherits:
Base
  • Object
show all
Defined in:
lib/high_level/resources/opportunities.rb

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from HighLevel::Resources::Base

Instance Method Details

#add_followers_opportunity(id:, body:, **_opts) ⇒ Object

Add Followers



100
101
102
103
104
105
106
107
# File 'lib/high_level/resources/opportunities.rb', line 100

def add_followers_opportunity(id:, body:, **_opts)
  request(
    method: :post,
    path: "/opportunities/#{id}/followers",
    security: ["bearer"],
    body: body
  )
end

#create_opportunity(body:, **_opts) ⇒ Object

Create Opportunity



123
124
125
126
127
128
129
130
# File 'lib/high_level/resources/opportunities.rb', line 123

def create_opportunity(body:, **_opts)
  request(
    method: :post,
    path: "/opportunities/",
    security: ["bearer"],
    body: body
  )
end

#delete_opportunity(id:, **_opts) ⇒ Object

Delete Opportunity



71
72
73
74
75
76
77
# File 'lib/high_level/resources/opportunities.rb', line 71

def delete_opportunity(id:, **_opts)
  request(
    method: :delete,
    path: "/opportunities/#{id}",
    security: ["bearer"]
  )
end

#get_lost_reason(location_id: nil, name: nil, deleted: nil, query: nil, skip: nil, limit: nil, get_count: nil, **_opts) ⇒ Object

Get lost reason



10
11
12
13
14
15
16
17
# File 'lib/high_level/resources/opportunities.rb', line 10

def get_lost_reason(location_id: nil, name: nil, deleted: nil, query: nil, skip: nil, limit: nil, get_count: nil, **_opts)
  request(
    method: :get,
    path: "/opportunities/lost-reason",
    security: ["bearer"],
    params: { "locationId" => location_id, "name" => name, "deleted" => deleted, "query" => query, "skip" => skip, "limit" => limit, "getCount" => get_count }.compact
  )
end

#get_opportunity(id:, **_opts) ⇒ Object

Get Opportunity



52
53
54
55
56
57
58
# File 'lib/high_level/resources/opportunities.rb', line 52

def get_opportunity(id:, **_opts)
  request(
    method: :get,
    path: "/opportunities/#{id}",
    security: ["bearer"]
  )
end

#get_pipelines(location_id: nil, **_opts) ⇒ Object

Get Pipelines



42
43
44
45
46
47
48
49
# File 'lib/high_level/resources/opportunities.rb', line 42

def get_pipelines(location_id: nil, **_opts)
  request(
    method: :get,
    path: "/opportunities/pipelines",
    security: ["bearer"],
    params: { "locationId" => location_id }.compact
  )
end

#remove_followers_opportunity(id:, body:, is_remove_all_followers: nil, **_opts) ⇒ Object

Remove Followers

Allows removal of one or all followers from an opportunity.



112
113
114
115
116
117
118
119
120
# File 'lib/high_level/resources/opportunities.rb', line 112

def remove_followers_opportunity(id:, body:, is_remove_all_followers: nil, **_opts)
  request(
    method: :delete,
    path: "/opportunities/#{id}/followers",
    security: ["bearer"],
    params: { "isRemoveAllFollowers" => is_remove_all_followers }.compact,
    body: body
  )
end

#search_opportunities_advanced(body:, **_opts) ⇒ Object

Search Opportunities

Search Opportunities based on combinations of advanced filters. Documentation Link - doc.clickup.com/8631005/d/h/87cpx-424216/7bf11bc9b94f80f



32
33
34
35
36
37
38
39
# File 'lib/high_level/resources/opportunities.rb', line 32

def search_opportunities_advanced(body:, **_opts)
  request(
    method: :post,
    path: "/opportunities/search",
    security: ["bearer"],
    body: body
  )
end

#search_opportunity(q: nil, location_id: nil, pipeline_id: nil, pipeline_stage_id: nil, contact_id: nil, status: nil, assigned_to: nil, campaign_id: nil, id: nil, order: nil, end_date: nil, start_after: nil, start_after_id: nil, date: nil, country: nil, page: nil, limit: nil, get_tasks: nil, get_notes: nil, get_calendar_events: nil, **_opts) ⇒ Object

Search Opportunity



20
21
22
23
24
25
26
27
# File 'lib/high_level/resources/opportunities.rb', line 20

def search_opportunity(q: nil, location_id: nil, pipeline_id: nil, pipeline_stage_id: nil, contact_id: nil, status: nil, assigned_to: nil, campaign_id: nil, id: nil, order: nil, end_date: nil, start_after: nil, start_after_id: nil, date: nil, country: nil, page: nil, limit: nil, get_tasks: nil, get_notes: nil, get_calendar_events: nil, **_opts)
  request(
    method: :get,
    path: "/opportunities/search",
    security: ["bearer"],
    params: { "q" => q, "location_id" => location_id, "pipeline_id" => pipeline_id, "pipeline_stage_id" => pipeline_stage_id, "contact_id" => contact_id, "status" => status, "assigned_to" => assigned_to, "campaignId" => campaign_id, "id" => id, "order" => order, "endDate" => end_date, "startAfter" => start_after, "startAfterId" => start_after_id, "date" => date, "country" => country, "page" => page, "limit" => limit, "getTasks" => get_tasks, "getNotes" => get_notes, "getCalendarEvents" => get_calendar_events }.compact
  )
end

#update_opportunity(id:, body:, **_opts) ⇒ Object

Update Opportunity



61
62
63
64
65
66
67
68
# File 'lib/high_level/resources/opportunities.rb', line 61

def update_opportunity(id:, body:, **_opts)
  request(
    method: :put,
    path: "/opportunities/#{id}",
    security: ["bearer"],
    body: body
  )
end

#update_opportunity_status(id:, body:, **_opts) ⇒ Object

Update Opportunity Status



80
81
82
83
84
85
86
87
# File 'lib/high_level/resources/opportunities.rb', line 80

def update_opportunity_status(id:, body:, **_opts)
  request(
    method: :put,
    path: "/opportunities/#{id}/status",
    security: ["bearer"],
    body: body
  )
end

#upsert_opportunity(body:, **_opts) ⇒ Object

Upsert Opportunity



90
91
92
93
94
95
96
97
# File 'lib/high_level/resources/opportunities.rb', line 90

def upsert_opportunity(body:, **_opts)
  request(
    method: :post,
    path: "/opportunities/upsert",
    security: ["bearer"],
    body: body
  )
end