Class: HighLevel::Resources::Objects

Inherits:
Base
  • Object
show all
Defined in:
lib/high_level/resources/objects.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_object_schema(body:, **_opts) ⇒ Object

Create Custom Object

Allows you to create a custom object schema. To understand objects and records, please have a look at the documentation here : doc.clickup.com/8631005/d/h/87cpx-277156/93bf0c2e23177b0



107
108
109
110
111
112
113
114
# File 'lib/high_level/resources/objects.rb', line 107

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

#create_object_record(schema_key:, body:, **_opts) ⇒ Object

Create Record

Create a Custom Object Record. Supported Objects business and custom objects. Documentation Link - doc.clickup.com/8631005/d/h/87cpx-277156/93bf0c2e23177b0/87cpx-376296



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

def create_object_record(schema_key:, body:, **_opts)
  request(
    method: :post,
    path: "/objects/#{schema_key}/records",
    security: ["bearer"],
    body: body
  )
end

#delete_object_record(schema_key:, id:, **_opts) ⇒ Object

Delete Record

Delete Record By Id . Supported Objects are business and custom objects.



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

def delete_object_record(schema_key:, id:, **_opts)
  request(
    method: :delete,
    path: "/objects/#{schema_key}/records/#{id}",
    security: ["bearer"]
  )
end

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

Get all objects for a location

Get all objects for a location. Supported Objects are contact, opportunity, business and custom objects.To understand objects and records, please have a look at the documentation here : doc.clickup.com/8631005/d/h/87cpx-277156/93bf0c2e23177b0



95
96
97
98
99
100
101
102
# File 'lib/high_level/resources/objects.rb', line 95

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

#get_object_schema_by_key(key:, location_id: nil, fetch_properties: nil, **_opts) ⇒ Object

Get Object Schema by key / id

Retrieve Object Schema by key or ID. This will return the schema of the custom object, including all its fields and properties. Supported objects include contact, opportunity, business and custom objects.To understand objects and records, please have a look the documentation here : doc.clickup.com/8631005/d/h/87cpx-277156/93bf0c2e23177b0



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

def get_object_schema_by_key(key:, location_id: nil, fetch_properties: nil, **_opts)
  request(
    method: :get,
    path: "/objects/#{key}",
    security: ["bearer"],
    params: { "locationId" => location_id, "fetchProperties" => fetch_properties }.compact
  )
end

#get_record_by_id(schema_key:, id:, **_opts) ⇒ Object

Get Record By Id

Allows you to get a Standard Object like business and custom object record by Id



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

def get_record_by_id(schema_key:, id:, **_opts)
  request(
    method: :get,
    path: "/objects/#{schema_key}/records/#{id}",
    security: ["bearer"]
  )
end

#search_object_records(schema_key:, body:, **_opts) ⇒ Object

Search Object Records

Supported Objects are custom objects and standard objects like “business”. Documentation Link - doc.clickup.com/8631005/d/h/87cpx-277156/93bf0c2e23177b0/87cpx-379336



83
84
85
86
87
88
89
90
# File 'lib/high_level/resources/objects.rb', line 83

def search_object_records(schema_key:, body:, **_opts)
  request(
    method: :post,
    path: "/objects/#{schema_key}/records/search",
    security: ["bearer"],
    body: body
  )
end

#update_custom_object(key:, body:, **_opts) ⇒ Object

Update Object Schema By Key / Id

Update Custom Object Schema or standard object’s like contact, opportunity, business searchable fields. To understand objects and records, please have a look at the documentation here : doc.clickup.com/8631005/d/h/87cpx-277156/93bf0c2e23177b0



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

def update_custom_object(key:, body:, **_opts)
  request(
    method: :put,
    path: "/objects/#{key}",
    security: ["bearer"],
    body: body
  )
end

#update_object_record(schema_key:, id:, body:, location_id: nil, **_opts) ⇒ Object

Update Record

Update a Custom Object Record by Id. Supported Objects are business and custom objects. Documentation Link - doc.clickup.com/8631005/d/h/87cpx-277156/93bf0c2e23177b0/87cpx-376296



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

def update_object_record(schema_key:, id:, body:, location_id: nil, **_opts)
  request(
    method: :put,
    path: "/objects/#{schema_key}/records/#{id}",
    security: ["bearer"],
    params: { "locationId" => location_id }.compact,
    body: body
  )
end