Class: HighLevel::Resources::Links

Inherits:
Base
  • Object
show all
Defined in:
lib/high_level/resources/links.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 Link



65
66
67
68
69
70
71
72
# File 'lib/high_level/resources/links.rb', line 65

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

Delete Link



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

def delete_link(link_id:, **_opts)
  request(
    method: :delete,
    path: "/links/#{link_id}",
    security: ["bearer"]
  )
end

Get Link by ID

Get a single link by its ID



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

def get_link_by_id(link_id:, location_id: nil, authorization: nil, **_opts)
  request(
    method: :get,
    path: "/links/id/#{link_id}",
    security: ["bearer"],
    params: { "locationId" => location_id }.compact,
    headers: { "Authorization" => authorization }.compact
  )
end

Get Links



55
56
57
58
59
60
61
62
# File 'lib/high_level/resources/links.rb', line 55

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

Search Trigger Links

Get list of links by searching



44
45
46
47
48
49
50
51
52
# File 'lib/high_level/resources/links.rb', line 44

def search_trigger_links(location_id: nil, query: nil, skip: nil, limit: nil, authorization: nil, **_opts)
  request(
    method: :get,
    path: "/links/search",
    security: ["bearer"],
    params: { "locationId" => location_id, "query" => query, "skip" => skip, "limit" => limit }.compact,
    headers: { "Authorization" => authorization }.compact
  )
end

Update Link



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

def update_link(link_id:, body:, **_opts)
  request(
    method: :put,
    path: "/links/#{link_id}",
    security: ["bearer"],
    body: body
  )
end