Class: HighLevel::Resources::Locations

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

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

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

Instance Method Details

#create_custom_field(location_id:, body:, **_opts) ⇒ Object

Create Custom Field



168
169
170
171
172
173
174
175
# File 'lib/high_level/resources/locations.rb', line 168

def create_custom_field(location_id:, body:, **_opts)
  request(
    method: :post,
    path: "/locations/#{location_id}/customFields",
    security: ["bearer"],
    body: body
  )
end

#create_custom_value(location_id:, body:, **_opts) ⇒ Object

Create Custom Value



225
226
227
228
229
230
231
232
# File 'lib/high_level/resources/locations.rb', line 225

def create_custom_value(location_id:, body:, **_opts)
  request(
    method: :post,
    path: "/locations/#{location_id}/customValues",
    security: ["bearer"],
    body: body
  )
end

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

Create Sub-Account (Formerly Location)

<div>

  <p>Create a new Sub-Account (Formerly Location) based on the data provided</p>
  <div>
    <span style= "display: inline-block;
                width: 25px; height: 25px;
                background-color: yellow;
                color: black;
                font-weight: bold;
                font-size: 24px;
                text-align: center;
                line-height: 22px;
                border: 2px solid black;
                border-radius: 10%;
                margin-right: 10px;">
                !
      </span>
      <span>
        <strong>
          This feature is only available on Agency Pro ($497) plan.
        </strong>
      </span>
  </div>
</div>


318
319
320
321
322
323
324
325
# File 'lib/high_level/resources/locations.rb', line 318

def create_location(body:, **_opts)
  request(
    method: :post,
    path: "/locations/",
    security: ["Agency-Access"],
    body: body
  )
end

#create_recurring_task(location_id:, body:, **_opts) ⇒ Object

Create Recurring Task



148
149
150
151
152
153
154
155
# File 'lib/high_level/resources/locations.rb', line 148

def create_recurring_task(location_id:, body:, **_opts)
  request(
    method: :post,
    path: "/locations/#{location_id}/recurring-tasks",
    security: ["bearer"],
    body: body
  )
end

#create_tag(location_id:, body:, **_opts) ⇒ Object

Create Tag

Create tag



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

def create_tag(location_id:, body:, **_opts)
  request(
    method: :post,
    path: "/locations/#{location_id}/tags",
    security: ["bearer"],
    body: body
  )
end

#delete_an_email_sms_template(location_id:, id:, **_opts) ⇒ Object

DELETE an email/sms template



284
285
286
287
288
289
290
# File 'lib/high_level/resources/locations.rb', line 284

def delete_an_email_sms_template(location_id:, id:, **_opts)
  request(
    method: :delete,
    path: "/locations/#{location_id}/templates/#{id}",
    security: ["bearer"]
  )
end

#delete_custom_field(location_id:, id:, **_opts) ⇒ Object

Delete Custom Field



197
198
199
200
201
202
203
# File 'lib/high_level/resources/locations.rb', line 197

def delete_custom_field(location_id:, id:, **_opts)
  request(
    method: :delete,
    path: "/locations/#{location_id}/customFields/#{id}",
    security: ["bearer"]
  )
end

#delete_custom_value(location_id:, id:, **_opts) ⇒ Object

Delete Custom Value



254
255
256
257
258
259
260
# File 'lib/high_level/resources/locations.rb', line 254

def delete_custom_value(location_id:, id:, **_opts)
  request(
    method: :delete,
    path: "/locations/#{location_id}/customValues/#{id}",
    security: ["bearer"]
  )
end

#delete_location(location_id:, delete_twilio_account: nil, **_opts) ⇒ Object

Delete Sub-Account (Formerly Location)

Delete a Sub-Account (Formerly Location) from the Agency



47
48
49
50
51
52
53
54
# File 'lib/high_level/resources/locations.rb', line 47

def delete_location(location_id:, delete_twilio_account: nil, **_opts)
  request(
    method: :delete,
    path: "/locations/#{location_id}",
    security: ["Agency-Access"],
    params: { "deleteTwilioAccount" =>  }.compact
  )
end

#delete_recurring_task(id:, location_id:, **_opts) ⇒ Object

Delete Recurring Task



139
140
141
142
143
144
145
# File 'lib/high_level/resources/locations.rb', line 139

def delete_recurring_task(id:, location_id:, **_opts)
  request(
    method: :delete,
    path: "/locations/#{location_id}/recurring-tasks/#{id}",
    security: ["bearer"]
  )
end

#delete_tag(location_id:, tag_id:, **_opts) ⇒ Object

Delete tag



99
100
101
102
103
104
105
# File 'lib/high_level/resources/locations.rb', line 99

def delete_tag(location_id:, tag_id:, **_opts)
  request(
    method: :delete,
    path: "/locations/#{location_id}/tags/#{tag_id}",
    security: ["bearer"]
  )
end

#get_all_or_email_sms_templates(location_id:, deleted: nil, skip: nil, limit: nil, type: nil, origin_id: nil, **_opts) ⇒ Object

GET all or email/sms templates



274
275
276
277
278
279
280
281
# File 'lib/high_level/resources/locations.rb', line 274

def get_all_or_email_sms_templates(location_id:, deleted: nil, skip: nil, limit: nil, type: nil, origin_id: nil, **_opts)
  request(
    method: :get,
    path: "/locations/#{location_id}/templates",
    security: ["bearer"],
    params: { "deleted" => deleted, "skip" => skip, "limit" => limit, "type" => type, "originId" => origin_id }.compact
  )
end

#get_custom_field(location_id:, id:, **_opts) ⇒ Object

Get Custom Field



178
179
180
181
182
183
184
# File 'lib/high_level/resources/locations.rb', line 178

def get_custom_field(location_id:, id:, **_opts)
  request(
    method: :get,
    path: "/locations/#{location_id}/customFields/#{id}",
    security: ["bearer"]
  )
end

#get_custom_fields(location_id:, model: nil, **_opts) ⇒ Object

Get Custom Fields



158
159
160
161
162
163
164
165
# File 'lib/high_level/resources/locations.rb', line 158

def get_custom_fields(location_id:, model: nil, **_opts)
  request(
    method: :get,
    path: "/locations/#{location_id}/customFields",
    security: ["bearer"],
    params: { "model" => model }.compact
  )
end

#get_custom_value(location_id:, id:, **_opts) ⇒ Object

Get Custom Value



235
236
237
238
239
240
241
# File 'lib/high_level/resources/locations.rb', line 235

def get_custom_value(location_id:, id:, **_opts)
  request(
    method: :get,
    path: "/locations/#{location_id}/customValues/#{id}",
    security: ["bearer"]
  )
end

#get_custom_values(location_id:, **_opts) ⇒ Object

Get Custom Values



216
217
218
219
220
221
222
# File 'lib/high_level/resources/locations.rb', line 216

def get_custom_values(location_id:, **_opts)
  request(
    method: :get,
    path: "/locations/#{location_id}/customValues",
    security: ["bearer"]
  )
end

#get_location(location_id:, **_opts) ⇒ Object

Get Sub-Account (Formerly Location)

Get details of a Sub-Account (Formerly Location) by passing the sub-account id



24
25
26
27
28
29
30
# File 'lib/high_level/resources/locations.rb', line 24

def get_location(location_id:, **_opts)
  request(
    method: :get,
    path: "/locations/#{location_id}",
    security: %w[Location-Access Agency-Access]
  )
end

#get_location_tags(location_id:, **_opts) ⇒ Object

Get Tags

Get Sub-Account (Formerly Location) Tags



59
60
61
62
63
64
65
# File 'lib/high_level/resources/locations.rb', line 59

def get_location_tags(location_id:, **_opts)
  request(
    method: :get,
    path: "/locations/#{location_id}/tags",
    security: ["bearer"]
  )
end

#get_recurring_task_by_id(id:, location_id:, **_opts) ⇒ Object

Get Recurring Task By Id



120
121
122
123
124
125
126
# File 'lib/high_level/resources/locations.rb', line 120

def get_recurring_task_by_id(id:, location_id:, **_opts)
  request(
    method: :get,
    path: "/locations/#{location_id}/recurring-tasks/#{id}",
    security: ["bearer"]
  )
end

#get_tag_by_id(location_id:, tag_id:, **_opts) ⇒ Object

Get tag by id



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

def get_tag_by_id(location_id:, tag_id:, **_opts)
  request(
    method: :get,
    path: "/locations/#{location_id}/tags/#{tag_id}",
    security: ["bearer"]
  )
end

#get_timezones(**_opts) ⇒ Object

Fetch Timezones

Fetch the available timezones



265
266
267
268
269
270
271
# File 'lib/high_level/resources/locations.rb', line 265

def get_timezones(**_opts)
  request(
    method: :get,
    path: "/locations/#{location_id}/timezones",
    security: %w[bearer Location-Access]
  )
end

#put_location(location_id:, body:, **_opts) ⇒ Object

Put Sub-Account (Formerly Location)

Update a Sub-Account (Formerly Location) based on the data provided



35
36
37
38
39
40
41
42
# File 'lib/high_level/resources/locations.rb', line 35

def put_location(location_id:, body:, **_opts)
  request(
    method: :put,
    path: "/locations/#{location_id}",
    security: ["Agency-Access"],
    body: body
  )
end

#search_locations(company_id: nil, skip: nil, limit: nil, order: nil, email: nil, **_opts) ⇒ Object

Search

Search Sub-Account (Formerly Location)



12
13
14
15
16
17
18
19
# File 'lib/high_level/resources/locations.rb', line 12

def search_locations(company_id: nil, skip: nil, limit: nil, order: nil, email: nil, **_opts)
  request(
    method: :get,
    path: "/locations/search",
    security: %w[Agency-Access Location-Access],
    params: { "companyId" => company_id, "skip" => skip, "limit" => limit, "order" => order, "email" => email }.compact
  )
end

#task_search(location_id:, body:, **_opts) ⇒ Object

Task Search Filter

Task Search



110
111
112
113
114
115
116
117
# File 'lib/high_level/resources/locations.rb', line 110

def task_search(location_id:, body:, **_opts)
  request(
    method: :post,
    path: "/locations/#{location_id}/tasks/search",
    security: ["bearer"],
    body: body
  )
end

#update_custom_field(location_id:, id:, body:, **_opts) ⇒ Object

Update Custom Field



187
188
189
190
191
192
193
194
# File 'lib/high_level/resources/locations.rb', line 187

def update_custom_field(location_id:, id:, body:, **_opts)
  request(
    method: :put,
    path: "/locations/#{location_id}/customFields/#{id}",
    security: ["bearer"],
    body: body
  )
end

#update_custom_value(location_id:, id:, body:, **_opts) ⇒ Object

Update Custom Value



244
245
246
247
248
249
250
251
# File 'lib/high_level/resources/locations.rb', line 244

def update_custom_value(location_id:, id:, body:, **_opts)
  request(
    method: :put,
    path: "/locations/#{location_id}/customValues/#{id}",
    security: ["bearer"],
    body: body
  )
end

#update_recurring_task(id:, location_id:, body:, **_opts) ⇒ Object

Update Recurring Task



129
130
131
132
133
134
135
136
# File 'lib/high_level/resources/locations.rb', line 129

def update_recurring_task(id:, location_id:, body:, **_opts)
  request(
    method: :put,
    path: "/locations/#{location_id}/recurring-tasks/#{id}",
    security: ["bearer"],
    body: body
  )
end

#update_tag(location_id:, tag_id:, body:, **_opts) ⇒ Object

Update tag



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

def update_tag(location_id:, tag_id:, body:, **_opts)
  request(
    method: :put,
    path: "/locations/#{location_id}/tags/#{tag_id}",
    security: ["bearer"],
    body: body
  )
end

#upload_file_custom_fields(location_id:, body:, **_opts) ⇒ Object

Uploads File to customFields



206
207
208
209
210
211
212
213
# File 'lib/high_level/resources/locations.rb', line 206

def upload_file_custom_fields(location_id:, body:, **_opts)
  request(
    method: :post,
    path: "/locations/#{location_id}/customFields/upload",
    security: ["bearer"],
    body: body
  )
end