monday_ruby 1.1.0 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.env +1 -1
- data/.rubocop.yml +2 -1
- data/CHANGELOG.md +14 -0
- data/CONTRIBUTING.md +104 -0
- data/README.md +146 -142
- data/docs/.vitepress/config.mjs +255 -0
- data/docs/.vitepress/theme/index.js +4 -0
- data/docs/.vitepress/theme/style.css +43 -0
- data/docs/README.md +80 -0
- data/docs/explanation/architecture.md +507 -0
- data/docs/explanation/best-practices/errors.md +478 -0
- data/docs/explanation/best-practices/performance.md +1084 -0
- data/docs/explanation/best-practices/rate-limiting.md +630 -0
- data/docs/explanation/best-practices/testing.md +820 -0
- data/docs/explanation/column-values.md +857 -0
- data/docs/explanation/design.md +795 -0
- data/docs/explanation/graphql.md +356 -0
- data/docs/explanation/migration/v1.md +808 -0
- data/docs/explanation/pagination.md +447 -0
- data/docs/guides/advanced/batch.md +1274 -0
- data/docs/guides/advanced/complex-queries.md +1114 -0
- data/docs/guides/advanced/errors.md +818 -0
- data/docs/guides/advanced/pagination.md +934 -0
- data/docs/guides/advanced/rate-limiting.md +981 -0
- data/docs/guides/authentication.md +286 -0
- data/docs/guides/boards/create.md +386 -0
- data/docs/guides/boards/delete.md +405 -0
- data/docs/guides/boards/duplicate.md +511 -0
- data/docs/guides/boards/query.md +530 -0
- data/docs/guides/boards/update.md +453 -0
- data/docs/guides/columns/create.md +452 -0
- data/docs/guides/columns/metadata.md +492 -0
- data/docs/guides/columns/query.md +455 -0
- data/docs/guides/columns/update-multiple.md +459 -0
- data/docs/guides/columns/update-values.md +509 -0
- data/docs/guides/files/add-to-column.md +40 -0
- data/docs/guides/files/add-to-update.md +37 -0
- data/docs/guides/files/clear-column.md +33 -0
- data/docs/guides/first-request.md +285 -0
- data/docs/guides/folders/manage.md +750 -0
- data/docs/guides/groups/items.md +626 -0
- data/docs/guides/groups/manage.md +501 -0
- data/docs/guides/installation.md +169 -0
- data/docs/guides/items/create.md +493 -0
- data/docs/guides/items/delete.md +514 -0
- data/docs/guides/items/query.md +605 -0
- data/docs/guides/items/subitems.md +483 -0
- data/docs/guides/items/update.md +699 -0
- data/docs/guides/updates/manage.md +619 -0
- data/docs/guides/use-cases/dashboard.md +1421 -0
- data/docs/guides/use-cases/import.md +1962 -0
- data/docs/guides/use-cases/task-management.md +1381 -0
- data/docs/guides/workspaces/manage.md +502 -0
- data/docs/index.md +69 -0
- data/docs/package-lock.json +2468 -0
- data/docs/package.json +13 -0
- data/docs/reference/client.md +540 -0
- data/docs/reference/configuration.md +586 -0
- data/docs/reference/errors.md +693 -0
- data/docs/reference/resources/account.md +208 -0
- data/docs/reference/resources/activity-log.md +369 -0
- data/docs/reference/resources/board-view.md +359 -0
- data/docs/reference/resources/board.md +393 -0
- data/docs/reference/resources/column.md +543 -0
- data/docs/reference/resources/file.md +236 -0
- data/docs/reference/resources/folder.md +386 -0
- data/docs/reference/resources/group.md +507 -0
- data/docs/reference/resources/item.md +348 -0
- data/docs/reference/resources/subitem.md +267 -0
- data/docs/reference/resources/update.md +259 -0
- data/docs/reference/resources/workspace.md +213 -0
- data/docs/reference/response.md +560 -0
- data/docs/tutorial/first-integration.md +713 -0
- data/lib/monday/client.rb +24 -0
- data/lib/monday/configuration.rb +5 -0
- data/lib/monday/request.rb +15 -0
- data/lib/monday/resources/base.rb +4 -0
- data/lib/monday/resources/file.rb +56 -0
- data/lib/monday/util.rb +1 -0
- data/lib/monday/version.rb +1 -1
- metadata +87 -4
|
@@ -0,0 +1,452 @@
|
|
|
1
|
+
# Create Columns
|
|
2
|
+
|
|
3
|
+
Add new columns to your monday.com boards to track different types of information.
|
|
4
|
+
|
|
5
|
+
## Basic Column Creation
|
|
6
|
+
|
|
7
|
+
Create a simple text column:
|
|
8
|
+
|
|
9
|
+
```ruby
|
|
10
|
+
require "monday_ruby"
|
|
11
|
+
|
|
12
|
+
Monday.configure do |config|
|
|
13
|
+
config.token = ENV["MONDAY_TOKEN"]
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
client = Monday::Client.new
|
|
17
|
+
|
|
18
|
+
response = client.column.create(
|
|
19
|
+
args: {
|
|
20
|
+
board_id: 1234567890,
|
|
21
|
+
title: "Notes",
|
|
22
|
+
column_type: :text
|
|
23
|
+
}
|
|
24
|
+
)
|
|
25
|
+
|
|
26
|
+
if response.success?
|
|
27
|
+
column = response.body.dig("data", "create_column")
|
|
28
|
+
puts "✓ Created column: #{column['title']}"
|
|
29
|
+
puts " ID: #{column['id']}"
|
|
30
|
+
else
|
|
31
|
+
puts "✗ Failed to create column"
|
|
32
|
+
end
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
**Output:**
|
|
36
|
+
```
|
|
37
|
+
✓ Created column: Notes
|
|
38
|
+
ID: text_1
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## Column Types
|
|
42
|
+
|
|
43
|
+
monday.com supports many column types:
|
|
44
|
+
|
|
45
|
+
### Text Column
|
|
46
|
+
|
|
47
|
+
```ruby
|
|
48
|
+
response = client.column.create(
|
|
49
|
+
args: {
|
|
50
|
+
board_id: 1234567890,
|
|
51
|
+
title: "Description",
|
|
52
|
+
column_type: :text
|
|
53
|
+
}
|
|
54
|
+
)
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
### Status Column
|
|
58
|
+
|
|
59
|
+
```ruby
|
|
60
|
+
response = client.column.create(
|
|
61
|
+
args: {
|
|
62
|
+
board_id: 1234567890,
|
|
63
|
+
title: "Status",
|
|
64
|
+
column_type: :color # Status columns use type 'color'
|
|
65
|
+
}
|
|
66
|
+
)
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
### Date Column
|
|
70
|
+
|
|
71
|
+
```ruby
|
|
72
|
+
response = client.column.create(
|
|
73
|
+
args: {
|
|
74
|
+
board_id: 1234567890,
|
|
75
|
+
title: "Due Date",
|
|
76
|
+
column_type: :date
|
|
77
|
+
}
|
|
78
|
+
)
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
### People Column
|
|
82
|
+
|
|
83
|
+
```ruby
|
|
84
|
+
response = client.column.create(
|
|
85
|
+
args: {
|
|
86
|
+
board_id: 1234567890,
|
|
87
|
+
title: "Assignee",
|
|
88
|
+
column_type: :people
|
|
89
|
+
}
|
|
90
|
+
)
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
### Numbers Column
|
|
94
|
+
|
|
95
|
+
```ruby
|
|
96
|
+
response = client.column.create(
|
|
97
|
+
args: {
|
|
98
|
+
board_id: 1234567890,
|
|
99
|
+
title: "Budget",
|
|
100
|
+
column_type: :numbers
|
|
101
|
+
}
|
|
102
|
+
)
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
### Timeline Column
|
|
106
|
+
|
|
107
|
+
```ruby
|
|
108
|
+
response = client.column.create(
|
|
109
|
+
args: {
|
|
110
|
+
board_id: 1234567890,
|
|
111
|
+
title: "Project Timeline",
|
|
112
|
+
column_type: :timeline
|
|
113
|
+
}
|
|
114
|
+
)
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
## Available Column Types
|
|
118
|
+
|
|
119
|
+
| Type | Description | monday.com Name |
|
|
120
|
+
|------|-------------|-----------------|
|
|
121
|
+
| `:text` | Short text | Text |
|
|
122
|
+
| `:long_text` | Long text with formatting | Long Text |
|
|
123
|
+
| `:color` | Status with labels | Status |
|
|
124
|
+
| `:date` | Date and time | Date |
|
|
125
|
+
| `:people` | Person or team | People |
|
|
126
|
+
| `:numbers` | Numeric values | Numbers |
|
|
127
|
+
| `:timeline` | Date range | Timeline |
|
|
128
|
+
| `:dropdown` | Dropdown selection | Dropdown |
|
|
129
|
+
| `:email` | Email address | Email |
|
|
130
|
+
| `:phone` | Phone number | Phone |
|
|
131
|
+
| `:link` | URL | Link |
|
|
132
|
+
| `:checkbox` | Checkbox | Checkbox |
|
|
133
|
+
| `:rating` | Star rating | Rating |
|
|
134
|
+
| `:hour` | Time tracking | Hour |
|
|
135
|
+
| `:week` | Week selector | Week |
|
|
136
|
+
| `:country` | Country selector | Country |
|
|
137
|
+
| `:file` | File attachment | Files |
|
|
138
|
+
| `:location` | Geographic location | Location |
|
|
139
|
+
| `:tag` | Tags | Tags |
|
|
140
|
+
|
|
141
|
+
## Create with Description
|
|
142
|
+
|
|
143
|
+
Add a description to help users understand the column:
|
|
144
|
+
|
|
145
|
+
```ruby
|
|
146
|
+
response = client.column.create(
|
|
147
|
+
args: {
|
|
148
|
+
board_id: 1234567890,
|
|
149
|
+
title: "Priority",
|
|
150
|
+
column_type: :color,
|
|
151
|
+
description: "Task priority level (High, Medium, Low)"
|
|
152
|
+
}
|
|
153
|
+
)
|
|
154
|
+
|
|
155
|
+
if response.success?
|
|
156
|
+
column = response.body.dig("data", "create_column")
|
|
157
|
+
puts "Created: #{column['title']}"
|
|
158
|
+
puts "Description: #{column['description']}"
|
|
159
|
+
end
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
## Create with Default Values
|
|
163
|
+
|
|
164
|
+
Set default values for status columns:
|
|
165
|
+
|
|
166
|
+
```ruby
|
|
167
|
+
require "json"
|
|
168
|
+
|
|
169
|
+
# Define status labels
|
|
170
|
+
defaults = JSON.generate({
|
|
171
|
+
labels: {
|
|
172
|
+
"0": "Not Started",
|
|
173
|
+
"1": "In Progress",
|
|
174
|
+
"2": "Done"
|
|
175
|
+
}
|
|
176
|
+
})
|
|
177
|
+
|
|
178
|
+
response = client.column.create(
|
|
179
|
+
args: {
|
|
180
|
+
board_id: 1234567890,
|
|
181
|
+
title: "Status",
|
|
182
|
+
column_type: :color,
|
|
183
|
+
defaults: defaults
|
|
184
|
+
}
|
|
185
|
+
)
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
## Customize Response Fields
|
|
189
|
+
|
|
190
|
+
Get additional column information:
|
|
191
|
+
|
|
192
|
+
```ruby
|
|
193
|
+
response = client.column.create(
|
|
194
|
+
args: {
|
|
195
|
+
board_id: 1234567890,
|
|
196
|
+
title: "Priority",
|
|
197
|
+
column_type: :color
|
|
198
|
+
},
|
|
199
|
+
select: [
|
|
200
|
+
"id",
|
|
201
|
+
"title",
|
|
202
|
+
"description",
|
|
203
|
+
"type",
|
|
204
|
+
"width",
|
|
205
|
+
"settings_str"
|
|
206
|
+
]
|
|
207
|
+
)
|
|
208
|
+
|
|
209
|
+
if response.success?
|
|
210
|
+
column = response.body.dig("data", "create_column")
|
|
211
|
+
|
|
212
|
+
puts "Column Details:"
|
|
213
|
+
puts " ID: #{column['id']}"
|
|
214
|
+
puts " Title: #{column['title']}"
|
|
215
|
+
puts " Type: #{column['type']}"
|
|
216
|
+
puts " Width: #{column['width']}"
|
|
217
|
+
end
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
## Create Multiple Columns
|
|
221
|
+
|
|
222
|
+
Set up a board structure with multiple columns:
|
|
223
|
+
|
|
224
|
+
```ruby
|
|
225
|
+
board_id = 1234567890
|
|
226
|
+
|
|
227
|
+
columns_to_create = [
|
|
228
|
+
{ title: "Task Name", column_type: :text },
|
|
229
|
+
{ title: "Status", column_type: :color },
|
|
230
|
+
{ title: "Owner", column_type: :people },
|
|
231
|
+
{ title: "Due Date", column_type: :date },
|
|
232
|
+
{ title: "Priority", column_type: :color },
|
|
233
|
+
{ title: "Budget", column_type: :numbers }
|
|
234
|
+
]
|
|
235
|
+
|
|
236
|
+
created_columns = []
|
|
237
|
+
|
|
238
|
+
columns_to_create.each do |col_config|
|
|
239
|
+
response = client.column.create(
|
|
240
|
+
args: {
|
|
241
|
+
board_id: board_id,
|
|
242
|
+
**col_config
|
|
243
|
+
}
|
|
244
|
+
)
|
|
245
|
+
|
|
246
|
+
if response.success?
|
|
247
|
+
column = response.body.dig("data", "create_column")
|
|
248
|
+
created_columns << column
|
|
249
|
+
puts "✓ Created: #{column['title']} (#{column['type']})"
|
|
250
|
+
else
|
|
251
|
+
puts "✗ Failed to create: #{col_config[:title]}"
|
|
252
|
+
end
|
|
253
|
+
|
|
254
|
+
sleep(0.3) # Rate limiting
|
|
255
|
+
end
|
|
256
|
+
|
|
257
|
+
puts "\n✓ Created #{created_columns.length} columns"
|
|
258
|
+
```
|
|
259
|
+
|
|
260
|
+
**Output:**
|
|
261
|
+
```
|
|
262
|
+
✓ Created: Task Name (text)
|
|
263
|
+
✓ Created: Status (color)
|
|
264
|
+
✓ Created: Owner (people)
|
|
265
|
+
✓ Created: Due Date (date)
|
|
266
|
+
✓ Created: Priority (color)
|
|
267
|
+
✓ Created: Budget (numbers)
|
|
268
|
+
|
|
269
|
+
✓ Created 6 columns
|
|
270
|
+
```
|
|
271
|
+
|
|
272
|
+
## Error Handling
|
|
273
|
+
|
|
274
|
+
Handle common column creation errors:
|
|
275
|
+
|
|
276
|
+
```ruby
|
|
277
|
+
def create_column_safe(client, board_id, title, column_type)
|
|
278
|
+
response = client.column.create(
|
|
279
|
+
args: {
|
|
280
|
+
board_id: board_id,
|
|
281
|
+
title: title,
|
|
282
|
+
column_type: column_type
|
|
283
|
+
}
|
|
284
|
+
)
|
|
285
|
+
|
|
286
|
+
if response.success?
|
|
287
|
+
column = response.body.dig("data", "create_column")
|
|
288
|
+
puts "✓ Created: #{column['title']} (ID: #{column['id']})"
|
|
289
|
+
column['id']
|
|
290
|
+
else
|
|
291
|
+
puts "✗ Failed to create column: #{title}"
|
|
292
|
+
puts " Status: #{response.status}"
|
|
293
|
+
|
|
294
|
+
if response.body["errors"]
|
|
295
|
+
response.body["errors"].each do |error|
|
|
296
|
+
puts " Error: #{error['message']}"
|
|
297
|
+
end
|
|
298
|
+
end
|
|
299
|
+
|
|
300
|
+
nil
|
|
301
|
+
end
|
|
302
|
+
rescue Monday::AuthorizationError
|
|
303
|
+
puts "✗ Invalid API token"
|
|
304
|
+
nil
|
|
305
|
+
rescue Monday::InvalidRequestError => e
|
|
306
|
+
puts "✗ Invalid board ID: #{e.message}"
|
|
307
|
+
nil
|
|
308
|
+
rescue Monday::Error => e
|
|
309
|
+
puts "✗ API error: #{e.message}"
|
|
310
|
+
nil
|
|
311
|
+
end
|
|
312
|
+
|
|
313
|
+
# Usage
|
|
314
|
+
column_id = create_column_safe(client, 1234567890, "Status", :color)
|
|
315
|
+
```
|
|
316
|
+
|
|
317
|
+
## Validate Column Title
|
|
318
|
+
|
|
319
|
+
Check for valid column titles:
|
|
320
|
+
|
|
321
|
+
```ruby
|
|
322
|
+
def valid_column_title?(title)
|
|
323
|
+
return false if title.nil? || title.empty?
|
|
324
|
+
return false if title.length > 255
|
|
325
|
+
|
|
326
|
+
true
|
|
327
|
+
end
|
|
328
|
+
|
|
329
|
+
title = "Priority Level"
|
|
330
|
+
|
|
331
|
+
if valid_column_title?(title)
|
|
332
|
+
response = client.column.create(
|
|
333
|
+
args: {
|
|
334
|
+
board_id: 1234567890,
|
|
335
|
+
title: title,
|
|
336
|
+
column_type: :color
|
|
337
|
+
}
|
|
338
|
+
)
|
|
339
|
+
else
|
|
340
|
+
puts "Invalid column title"
|
|
341
|
+
end
|
|
342
|
+
```
|
|
343
|
+
|
|
344
|
+
## Complete Example
|
|
345
|
+
|
|
346
|
+
Create a full project board structure:
|
|
347
|
+
|
|
348
|
+
```ruby
|
|
349
|
+
require "monday_ruby"
|
|
350
|
+
require "dotenv/load"
|
|
351
|
+
|
|
352
|
+
Monday.configure do |config|
|
|
353
|
+
config.token = ENV["MONDAY_TOKEN"]
|
|
354
|
+
end
|
|
355
|
+
|
|
356
|
+
client = Monday::Client.new
|
|
357
|
+
|
|
358
|
+
board_id = 1234567890
|
|
359
|
+
|
|
360
|
+
# Define board structure
|
|
361
|
+
board_structure = [
|
|
362
|
+
{
|
|
363
|
+
title: "Status",
|
|
364
|
+
column_type: :color,
|
|
365
|
+
description: "Current status of the task"
|
|
366
|
+
},
|
|
367
|
+
{
|
|
368
|
+
title: "Owner",
|
|
369
|
+
column_type: :people,
|
|
370
|
+
description: "Person responsible for this task"
|
|
371
|
+
},
|
|
372
|
+
{
|
|
373
|
+
title: "Priority",
|
|
374
|
+
column_type: :color,
|
|
375
|
+
description: "Task priority (High, Medium, Low)"
|
|
376
|
+
},
|
|
377
|
+
{
|
|
378
|
+
title: "Due Date",
|
|
379
|
+
column_type: :date,
|
|
380
|
+
description: "When this task is due"
|
|
381
|
+
},
|
|
382
|
+
{
|
|
383
|
+
title: "Budget",
|
|
384
|
+
column_type: :numbers,
|
|
385
|
+
description: "Estimated budget for this task"
|
|
386
|
+
},
|
|
387
|
+
{
|
|
388
|
+
title: "Notes",
|
|
389
|
+
column_type: :long_text,
|
|
390
|
+
description: "Additional notes and comments"
|
|
391
|
+
}
|
|
392
|
+
]
|
|
393
|
+
|
|
394
|
+
puts "\n📋 Creating Board Structure\n#{'=' * 50}\n"
|
|
395
|
+
|
|
396
|
+
created_columns = []
|
|
397
|
+
|
|
398
|
+
board_structure.each do |col_config|
|
|
399
|
+
response = client.column.create(
|
|
400
|
+
args: {
|
|
401
|
+
board_id: board_id,
|
|
402
|
+
**col_config
|
|
403
|
+
},
|
|
404
|
+
select: ["id", "title", "type", "description"]
|
|
405
|
+
)
|
|
406
|
+
|
|
407
|
+
if response.success?
|
|
408
|
+
column = response.body.dig("data", "create_column")
|
|
409
|
+
created_columns << column
|
|
410
|
+
|
|
411
|
+
puts "✓ #{column['title']}"
|
|
412
|
+
puts " Type: #{column['type']}"
|
|
413
|
+
puts " ID: #{column['id']}"
|
|
414
|
+
puts " Description: #{column['description']}\n\n"
|
|
415
|
+
else
|
|
416
|
+
puts "✗ Failed to create: #{col_config[:title]}"
|
|
417
|
+
end
|
|
418
|
+
|
|
419
|
+
sleep(0.3)
|
|
420
|
+
end
|
|
421
|
+
|
|
422
|
+
puts "#{'=' * 50}"
|
|
423
|
+
puts "✓ Created #{created_columns.length} columns"
|
|
424
|
+
puts "#{'=' * 50}"
|
|
425
|
+
```
|
|
426
|
+
|
|
427
|
+
## Delete a Column
|
|
428
|
+
|
|
429
|
+
Remove a column from a board:
|
|
430
|
+
|
|
431
|
+
```ruby
|
|
432
|
+
response = client.column.delete(
|
|
433
|
+
1234567890, # board_id
|
|
434
|
+
"text_1" # column_id
|
|
435
|
+
)
|
|
436
|
+
|
|
437
|
+
if response.success?
|
|
438
|
+
column = response.body.dig("data", "delete_column")
|
|
439
|
+
puts "✓ Deleted column ID: #{column['id']}"
|
|
440
|
+
end
|
|
441
|
+
```
|
|
442
|
+
|
|
443
|
+
::: warning <span style="display: inline-flex; align-items: center; gap: 6px;"><svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z"></path><line x1="12" y1="9" x2="12" y2="13"></line><line x1="12" y1="17" x2="12.01" y2="17"></line></svg>Permanent Deletion</span>
|
|
444
|
+
Deleting a column removes it and all its data from every item on the board. This cannot be undone.
|
|
445
|
+
:::
|
|
446
|
+
|
|
447
|
+
## Next Steps
|
|
448
|
+
|
|
449
|
+
- [Update column values](/guides/columns/update-values)
|
|
450
|
+
- [Update multiple values](/guides/columns/update-multiple)
|
|
451
|
+
- [Query column values](/guides/columns/query)
|
|
452
|
+
- [Change column metadata](/guides/columns/metadata)
|