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,501 @@
|
|
|
1
|
+
# Manage Groups
|
|
2
|
+
|
|
3
|
+
Learn how to create, update, organize, and delete groups on your monday.com boards.
|
|
4
|
+
|
|
5
|
+
## What are Groups?
|
|
6
|
+
|
|
7
|
+
Groups are sections within boards that organize related items together. They act like categories or folders, helping you structure your board's content logically. For example, a project board might have groups like "To Do", "In Progress", and "Done".
|
|
8
|
+
|
|
9
|
+
## Query Groups
|
|
10
|
+
|
|
11
|
+
Retrieve groups from one or more boards:
|
|
12
|
+
|
|
13
|
+
```ruby
|
|
14
|
+
require "monday_ruby"
|
|
15
|
+
|
|
16
|
+
Monday.configure do |config|
|
|
17
|
+
config.token = ENV["MONDAY_TOKEN"]
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
client = Monday::Client.new
|
|
21
|
+
|
|
22
|
+
response = client.group.query(
|
|
23
|
+
args: { ids: [123] },
|
|
24
|
+
select: ["id", "title", "color"]
|
|
25
|
+
)
|
|
26
|
+
|
|
27
|
+
if response.success?
|
|
28
|
+
boards = response.body.dig("data", "boards")
|
|
29
|
+
boards.each do |board|
|
|
30
|
+
puts "Board groups:"
|
|
31
|
+
board["groups"].each do |group|
|
|
32
|
+
puts " • #{group['title']} (#{group['id']})"
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
**Output:**
|
|
39
|
+
```
|
|
40
|
+
Board groups:
|
|
41
|
+
• To Do (group_mkx1yn2n)
|
|
42
|
+
• In Progress (group_abc123)
|
|
43
|
+
• Done (group_xyz789)
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
### Query Multiple Boards
|
|
47
|
+
|
|
48
|
+
Get groups from several boards at once:
|
|
49
|
+
|
|
50
|
+
```ruby
|
|
51
|
+
response = client.group.query(
|
|
52
|
+
args: { ids: [123, 456, 789] },
|
|
53
|
+
select: ["id", "title", "position"]
|
|
54
|
+
)
|
|
55
|
+
|
|
56
|
+
boards = response.body.dig("data", "boards")
|
|
57
|
+
boards.each do |board|
|
|
58
|
+
board["groups"].each do |group|
|
|
59
|
+
puts "Board #{board['id']}: #{group['title']} (position: #{group['position']})"
|
|
60
|
+
end
|
|
61
|
+
end
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
### Include Group Details
|
|
65
|
+
|
|
66
|
+
Retrieve additional group information:
|
|
67
|
+
|
|
68
|
+
```ruby
|
|
69
|
+
response = client.group.query(
|
|
70
|
+
args: { ids: [123] },
|
|
71
|
+
select: [
|
|
72
|
+
"id",
|
|
73
|
+
"title",
|
|
74
|
+
"color",
|
|
75
|
+
"position",
|
|
76
|
+
"archived",
|
|
77
|
+
{
|
|
78
|
+
items: ["id", "name"] # Get items in each group
|
|
79
|
+
}
|
|
80
|
+
]
|
|
81
|
+
)
|
|
82
|
+
|
|
83
|
+
boards = response.body.dig("data", "boards")
|
|
84
|
+
boards.each do |board|
|
|
85
|
+
board["groups"].each do |group|
|
|
86
|
+
puts "\nGroup: #{group['title']}"
|
|
87
|
+
puts " Color: #{group['color']}"
|
|
88
|
+
puts " Position: #{group['position']}"
|
|
89
|
+
puts " Archived: #{group['archived']}"
|
|
90
|
+
puts " Items: #{group['items'].length}"
|
|
91
|
+
end
|
|
92
|
+
end
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
## Create Groups
|
|
96
|
+
|
|
97
|
+
Add new groups to organize your board:
|
|
98
|
+
|
|
99
|
+
### Basic Group Creation
|
|
100
|
+
|
|
101
|
+
```ruby
|
|
102
|
+
response = client.group.create(
|
|
103
|
+
args: {
|
|
104
|
+
board_id: 123,
|
|
105
|
+
group_name: "Returned Orders"
|
|
106
|
+
}
|
|
107
|
+
)
|
|
108
|
+
|
|
109
|
+
if response.success?
|
|
110
|
+
group = response.body.dig("data", "create_group")
|
|
111
|
+
puts "✓ Created group: #{group['title']}"
|
|
112
|
+
puts " ID: #{group['id']}"
|
|
113
|
+
end
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
**Output:**
|
|
117
|
+
```
|
|
118
|
+
✓ Created group: Returned Orders
|
|
119
|
+
ID: group_mkx1yn2n
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
### Create at Specific Position
|
|
123
|
+
|
|
124
|
+
Add group at the top of the board:
|
|
125
|
+
|
|
126
|
+
```ruby
|
|
127
|
+
response = client.group.create(
|
|
128
|
+
args: {
|
|
129
|
+
board_id: 123,
|
|
130
|
+
group_name: "Urgent Items",
|
|
131
|
+
position: "0" # Position at top
|
|
132
|
+
}
|
|
133
|
+
)
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
Add group after another group:
|
|
137
|
+
|
|
138
|
+
```ruby
|
|
139
|
+
response = client.group.create(
|
|
140
|
+
args: {
|
|
141
|
+
board_id: 123,
|
|
142
|
+
group_name: "Review",
|
|
143
|
+
position: "group_mkx1yn2n", # Insert after this group
|
|
144
|
+
position_relative_method: :after_at
|
|
145
|
+
}
|
|
146
|
+
)
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
### Create Multiple Groups
|
|
150
|
+
|
|
151
|
+
Batch create several groups:
|
|
152
|
+
|
|
153
|
+
```ruby
|
|
154
|
+
group_names = ["Planning", "Design", "Development", "Testing", "Deployment"]
|
|
155
|
+
|
|
156
|
+
group_names.each do |name|
|
|
157
|
+
response = client.group.create(
|
|
158
|
+
args: {
|
|
159
|
+
board_id: 123,
|
|
160
|
+
group_name: name
|
|
161
|
+
}
|
|
162
|
+
)
|
|
163
|
+
|
|
164
|
+
if response.success?
|
|
165
|
+
group = response.body.dig("data", "create_group")
|
|
166
|
+
puts "✓ Created: #{group['title']}"
|
|
167
|
+
else
|
|
168
|
+
puts "✗ Failed to create: #{name}"
|
|
169
|
+
end
|
|
170
|
+
end
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
**Output:**
|
|
174
|
+
```
|
|
175
|
+
✓ Created: Planning
|
|
176
|
+
✓ Created: Design
|
|
177
|
+
✓ Created: Development
|
|
178
|
+
✓ Created: Testing
|
|
179
|
+
✓ Created: Deployment
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
## Update Groups
|
|
183
|
+
|
|
184
|
+
Modify group properties after creation:
|
|
185
|
+
|
|
186
|
+
### Rename Group
|
|
187
|
+
|
|
188
|
+
```ruby
|
|
189
|
+
response = client.group.update(
|
|
190
|
+
args: {
|
|
191
|
+
board_id: 123,
|
|
192
|
+
group_id: "group_mkx1yn2n",
|
|
193
|
+
group_attribute: :title,
|
|
194
|
+
new_value: "Completed Returns"
|
|
195
|
+
}
|
|
196
|
+
)
|
|
197
|
+
|
|
198
|
+
if response.success?
|
|
199
|
+
puts "✓ Group renamed successfully"
|
|
200
|
+
end
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
### Change Group Color
|
|
204
|
+
|
|
205
|
+
```ruby
|
|
206
|
+
response = client.group.update(
|
|
207
|
+
args: {
|
|
208
|
+
board_id: 123,
|
|
209
|
+
group_id: "group_mkx1yn2n",
|
|
210
|
+
group_attribute: :color,
|
|
211
|
+
new_value: "#00c875" # Green color
|
|
212
|
+
}
|
|
213
|
+
)
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
**Common colors:**
|
|
217
|
+
- `#e2445c` - Red
|
|
218
|
+
- `#fdab3d` - Orange
|
|
219
|
+
- `#ffcb00` - Yellow
|
|
220
|
+
- `#00c875` - Green
|
|
221
|
+
- `#0086c0` - Blue
|
|
222
|
+
- `#a25ddc` - Purple
|
|
223
|
+
|
|
224
|
+
### Reposition Group
|
|
225
|
+
|
|
226
|
+
Move group to different position:
|
|
227
|
+
|
|
228
|
+
```ruby
|
|
229
|
+
response = client.group.update(
|
|
230
|
+
args: {
|
|
231
|
+
board_id: 123,
|
|
232
|
+
group_id: "group_mkx1yn2n",
|
|
233
|
+
group_attribute: :position,
|
|
234
|
+
new_value: "0" # Move to top
|
|
235
|
+
}
|
|
236
|
+
)
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
## Duplicate Groups
|
|
240
|
+
|
|
241
|
+
Copy a group with all its items:
|
|
242
|
+
|
|
243
|
+
### Basic Duplication
|
|
244
|
+
|
|
245
|
+
```ruby
|
|
246
|
+
response = client.group.duplicate(
|
|
247
|
+
args: {
|
|
248
|
+
board_id: 123,
|
|
249
|
+
group_id: "group_mkx1yn2n"
|
|
250
|
+
}
|
|
251
|
+
)
|
|
252
|
+
|
|
253
|
+
if response.success?
|
|
254
|
+
duplicated = response.body.dig("data", "duplicate_group")
|
|
255
|
+
puts "✓ Duplicated group: #{duplicated['title']}"
|
|
256
|
+
puts " New ID: #{duplicated['id']}"
|
|
257
|
+
end
|
|
258
|
+
```
|
|
259
|
+
|
|
260
|
+
### Duplicate with Custom Name
|
|
261
|
+
|
|
262
|
+
```ruby
|
|
263
|
+
response = client.group.duplicate(
|
|
264
|
+
args: {
|
|
265
|
+
board_id: 123,
|
|
266
|
+
group_id: "group_mkx1yn2n",
|
|
267
|
+
group_title: "Archive - Q4 2024"
|
|
268
|
+
}
|
|
269
|
+
)
|
|
270
|
+
```
|
|
271
|
+
|
|
272
|
+
### Duplicate to Top
|
|
273
|
+
|
|
274
|
+
Add duplicated group at the top of the board:
|
|
275
|
+
|
|
276
|
+
```ruby
|
|
277
|
+
response = client.group.duplicate(
|
|
278
|
+
args: {
|
|
279
|
+
board_id: 123,
|
|
280
|
+
group_id: "group_mkx1yn2n",
|
|
281
|
+
group_title: "Copy of Returns",
|
|
282
|
+
add_to_top: true
|
|
283
|
+
}
|
|
284
|
+
)
|
|
285
|
+
```
|
|
286
|
+
|
|
287
|
+
## Archive Groups
|
|
288
|
+
|
|
289
|
+
Archive groups to hide them without deleting:
|
|
290
|
+
|
|
291
|
+
```ruby
|
|
292
|
+
response = client.group.archive(
|
|
293
|
+
args: {
|
|
294
|
+
board_id: 123,
|
|
295
|
+
group_id: "group_mkx1yn2n"
|
|
296
|
+
}
|
|
297
|
+
)
|
|
298
|
+
|
|
299
|
+
if response.success?
|
|
300
|
+
puts "✓ Group archived successfully"
|
|
301
|
+
end
|
|
302
|
+
```
|
|
303
|
+
|
|
304
|
+
::: tip <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"><circle cx="12" cy="12" r="10"></circle><line x1="12" y1="16" x2="12" y2="12"></line><line x1="12" y1="8" x2="12.01" y2="8"></line></svg>Archive vs Delete</span>
|
|
305
|
+
Archiving preserves the group and its items for future reference. Deleted groups and their items are permanently removed. Always archive unless you're certain the data isn't needed.
|
|
306
|
+
:::
|
|
307
|
+
|
|
308
|
+
### Archive Multiple Groups
|
|
309
|
+
|
|
310
|
+
Batch archive completed groups:
|
|
311
|
+
|
|
312
|
+
```ruby
|
|
313
|
+
completed_group_ids = ["group_abc123", "group_xyz789", "group_mkx1yn2n"]
|
|
314
|
+
|
|
315
|
+
completed_group_ids.each do |group_id|
|
|
316
|
+
response = client.group.archive(
|
|
317
|
+
args: {
|
|
318
|
+
board_id: 123,
|
|
319
|
+
group_id: group_id
|
|
320
|
+
}
|
|
321
|
+
)
|
|
322
|
+
|
|
323
|
+
if response.success?
|
|
324
|
+
puts "✓ Archived group: #{group_id}"
|
|
325
|
+
end
|
|
326
|
+
end
|
|
327
|
+
```
|
|
328
|
+
|
|
329
|
+
## Delete Groups
|
|
330
|
+
|
|
331
|
+
Permanently remove groups and their items:
|
|
332
|
+
|
|
333
|
+
```ruby
|
|
334
|
+
response = client.group.delete(
|
|
335
|
+
args: {
|
|
336
|
+
board_id: 123,
|
|
337
|
+
group_id: "group_mkx1yn2n"
|
|
338
|
+
}
|
|
339
|
+
)
|
|
340
|
+
|
|
341
|
+
if response.success?
|
|
342
|
+
deleted = response.body.dig("data", "delete_group")
|
|
343
|
+
puts "✓ Deleted group: #{deleted['id']}"
|
|
344
|
+
end
|
|
345
|
+
```
|
|
346
|
+
|
|
347
|
+
::: 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>
|
|
348
|
+
Deleting a group removes all items within it. This cannot be undone. Consider archiving instead to preserve historical data.
|
|
349
|
+
:::
|
|
350
|
+
|
|
351
|
+
### Safe Delete with Confirmation
|
|
352
|
+
|
|
353
|
+
```ruby
|
|
354
|
+
def delete_group_safe(client, board_id, group_id, group_name)
|
|
355
|
+
puts "⚠️ WARNING: You are about to delete '#{group_name}'"
|
|
356
|
+
puts " All items in this group will be permanently removed."
|
|
357
|
+
print " Type 'DELETE' to confirm: "
|
|
358
|
+
|
|
359
|
+
confirmation = gets.chomp
|
|
360
|
+
|
|
361
|
+
if confirmation == "DELETE"
|
|
362
|
+
response = client.group.delete(
|
|
363
|
+
args: {
|
|
364
|
+
board_id: board_id,
|
|
365
|
+
group_id: group_id
|
|
366
|
+
}
|
|
367
|
+
)
|
|
368
|
+
|
|
369
|
+
if response.success?
|
|
370
|
+
puts "✓ Group deleted"
|
|
371
|
+
else
|
|
372
|
+
puts "✗ Failed to delete group"
|
|
373
|
+
end
|
|
374
|
+
else
|
|
375
|
+
puts "Deletion cancelled"
|
|
376
|
+
end
|
|
377
|
+
end
|
|
378
|
+
|
|
379
|
+
# Usage
|
|
380
|
+
delete_group_safe(client, 123, "group_mkx1yn2n", "Old Projects")
|
|
381
|
+
```
|
|
382
|
+
|
|
383
|
+
## Error Handling
|
|
384
|
+
|
|
385
|
+
Handle common errors when managing groups:
|
|
386
|
+
|
|
387
|
+
```ruby
|
|
388
|
+
def create_group_safe(client, board_id, group_name)
|
|
389
|
+
response = client.group.create(
|
|
390
|
+
args: {
|
|
391
|
+
board_id: board_id,
|
|
392
|
+
group_name: group_name
|
|
393
|
+
}
|
|
394
|
+
)
|
|
395
|
+
|
|
396
|
+
if response.success?
|
|
397
|
+
group = response.body.dig("data", "create_group")
|
|
398
|
+
puts "✓ Created: #{group['title']} (#{group['id']})"
|
|
399
|
+
group['id']
|
|
400
|
+
else
|
|
401
|
+
puts "✗ Failed to create group"
|
|
402
|
+
nil
|
|
403
|
+
end
|
|
404
|
+
rescue Monday::ResourceNotFoundError
|
|
405
|
+
puts "✗ Board not found: #{board_id}"
|
|
406
|
+
nil
|
|
407
|
+
rescue Monday::AuthorizationError
|
|
408
|
+
puts "✗ No permission to create groups on this board"
|
|
409
|
+
nil
|
|
410
|
+
rescue Monday::Error => e
|
|
411
|
+
puts "✗ Error: #{e.message}"
|
|
412
|
+
nil
|
|
413
|
+
end
|
|
414
|
+
|
|
415
|
+
# Usage
|
|
416
|
+
group_id = create_group_safe(client, 123, "New Group")
|
|
417
|
+
```
|
|
418
|
+
|
|
419
|
+
## Complete Example
|
|
420
|
+
|
|
421
|
+
Full workflow for managing groups:
|
|
422
|
+
|
|
423
|
+
```ruby
|
|
424
|
+
require "monday_ruby"
|
|
425
|
+
require "dotenv/load"
|
|
426
|
+
|
|
427
|
+
Monday.configure do |config|
|
|
428
|
+
config.token = ENV["MONDAY_TOKEN"]
|
|
429
|
+
end
|
|
430
|
+
|
|
431
|
+
client = Monday::Client.new
|
|
432
|
+
board_id = 123
|
|
433
|
+
|
|
434
|
+
# 1. Query existing groups
|
|
435
|
+
puts "=== Current Groups ==="
|
|
436
|
+
response = client.group.query(
|
|
437
|
+
args: { ids: [board_id] },
|
|
438
|
+
select: ["id", "title", "color"]
|
|
439
|
+
)
|
|
440
|
+
|
|
441
|
+
groups = response.body.dig("data", "boards", 0, "groups")
|
|
442
|
+
groups.each do |group|
|
|
443
|
+
puts "• #{group['title']} (#{group['id']})"
|
|
444
|
+
end
|
|
445
|
+
|
|
446
|
+
# 2. Create new group
|
|
447
|
+
puts "\n=== Creating New Group ==="
|
|
448
|
+
response = client.group.create(
|
|
449
|
+
args: {
|
|
450
|
+
board_id: board_id,
|
|
451
|
+
group_name: "Q1 2024 Projects"
|
|
452
|
+
}
|
|
453
|
+
)
|
|
454
|
+
|
|
455
|
+
new_group = response.body.dig("data", "create_group")
|
|
456
|
+
puts "✓ Created: #{new_group['title']} (#{new_group['id']})"
|
|
457
|
+
|
|
458
|
+
# 3. Update group
|
|
459
|
+
puts "\n=== Updating Group ==="
|
|
460
|
+
response = client.group.update(
|
|
461
|
+
args: {
|
|
462
|
+
board_id: board_id,
|
|
463
|
+
group_id: new_group['id'],
|
|
464
|
+
group_attribute: :color,
|
|
465
|
+
new_value: "#00c875"
|
|
466
|
+
}
|
|
467
|
+
)
|
|
468
|
+
puts "✓ Updated group color"
|
|
469
|
+
|
|
470
|
+
# 4. Duplicate group
|
|
471
|
+
puts "\n=== Duplicating Group ==="
|
|
472
|
+
response = client.group.duplicate(
|
|
473
|
+
args: {
|
|
474
|
+
board_id: board_id,
|
|
475
|
+
group_id: new_group['id'],
|
|
476
|
+
group_title: "Q2 2024 Projects"
|
|
477
|
+
}
|
|
478
|
+
)
|
|
479
|
+
|
|
480
|
+
duplicated = response.body.dig("data", "duplicate_group")
|
|
481
|
+
puts "✓ Duplicated: #{duplicated['title']} (#{duplicated['id']})"
|
|
482
|
+
|
|
483
|
+
# 5. Archive original group
|
|
484
|
+
puts "\n=== Archiving Group ==="
|
|
485
|
+
response = client.group.archive(
|
|
486
|
+
args: {
|
|
487
|
+
board_id: board_id,
|
|
488
|
+
group_id: new_group['id']
|
|
489
|
+
}
|
|
490
|
+
)
|
|
491
|
+
puts "✓ Archived group: #{new_group['id']}"
|
|
492
|
+
|
|
493
|
+
puts "\n=== Complete ==="
|
|
494
|
+
```
|
|
495
|
+
|
|
496
|
+
## Next Steps
|
|
497
|
+
|
|
498
|
+
- [Work with items in groups](/guides/groups/items)
|
|
499
|
+
- [Create items in groups](/guides/items/create)
|
|
500
|
+
- [Query group items](/guides/items/query)
|
|
501
|
+
- [Manage boards](/guides/boards/query)
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
# Installation & Setup
|
|
2
|
+
|
|
3
|
+
Install the `monday_ruby` gem and configure your development environment.
|
|
4
|
+
|
|
5
|
+
## Requirements
|
|
6
|
+
|
|
7
|
+
- Ruby 2.7 or higher
|
|
8
|
+
- A monday.com account
|
|
9
|
+
- A monday.com API token
|
|
10
|
+
|
|
11
|
+
Check your Ruby version:
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
ruby -v
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Install the Gem
|
|
18
|
+
|
|
19
|
+
### Using Bundler (Recommended)
|
|
20
|
+
|
|
21
|
+
Add to your `Gemfile`:
|
|
22
|
+
|
|
23
|
+
```ruby
|
|
24
|
+
gem 'monday_ruby'
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Install:
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
bundle install
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
### Using RubyGems
|
|
34
|
+
|
|
35
|
+
Install directly:
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
gem install monday_ruby
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
Verify installation:
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
gem list monday_ruby
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
You should see `monday_ruby` with the version number.
|
|
48
|
+
|
|
49
|
+
## Get Your API Token
|
|
50
|
+
|
|
51
|
+
1. Log in to your monday.com account
|
|
52
|
+
2. Click your profile picture in the top-right corner
|
|
53
|
+
3. Select **Administration**
|
|
54
|
+
4. Go to the **Connections** section
|
|
55
|
+
5. Select **Personal API token** in the sidebar
|
|
56
|
+
6. Copy your token
|
|
57
|
+
|
|
58
|
+
## Configure the Client
|
|
59
|
+
|
|
60
|
+
### Option 1: Environment Variables (Recommended)
|
|
61
|
+
|
|
62
|
+
Create a `.env` file in your project root:
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
MONDAY_TOKEN=your_token_here
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
Load it in your application:
|
|
69
|
+
|
|
70
|
+
```ruby
|
|
71
|
+
require "monday_ruby"
|
|
72
|
+
require "dotenv/load"
|
|
73
|
+
|
|
74
|
+
Monday.configure do |config|
|
|
75
|
+
config.token = ENV["MONDAY_TOKEN"]
|
|
76
|
+
end
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
Install the dotenv gem:
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
gem install dotenv
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
Or add to your `Gemfile`:
|
|
86
|
+
|
|
87
|
+
```ruby
|
|
88
|
+
gem 'dotenv'
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
### Option 2: Direct Configuration
|
|
92
|
+
|
|
93
|
+
Configure globally:
|
|
94
|
+
|
|
95
|
+
```ruby
|
|
96
|
+
require "monday_ruby"
|
|
97
|
+
|
|
98
|
+
Monday.configure do |config|
|
|
99
|
+
config.token = "your_token_here"
|
|
100
|
+
end
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
::: 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"><rect x="3" y="11" width="18" height="11" rx="2" ry="2"></rect><path d="M7 11V7a5 5 0 0 1 10 0v4"></path></svg>Security</span>
|
|
104
|
+
Never commit API tokens to version control. Always use environment variables or secure credential storage.
|
|
105
|
+
:::
|
|
106
|
+
|
|
107
|
+
### Option 3: Per-Client Configuration
|
|
108
|
+
|
|
109
|
+
Pass token when creating the client:
|
|
110
|
+
|
|
111
|
+
```ruby
|
|
112
|
+
client = Monday::Client.new(token: "your_token_here")
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
## Verify Setup
|
|
116
|
+
|
|
117
|
+
Test your configuration:
|
|
118
|
+
|
|
119
|
+
```ruby
|
|
120
|
+
require "monday_ruby"
|
|
121
|
+
|
|
122
|
+
Monday.configure do |config|
|
|
123
|
+
config.token = ENV["MONDAY_TOKEN"]
|
|
124
|
+
end
|
|
125
|
+
|
|
126
|
+
client = Monday::Client.new
|
|
127
|
+
response = client.boards
|
|
128
|
+
|
|
129
|
+
if response.success?
|
|
130
|
+
puts "Connected successfully!"
|
|
131
|
+
puts "Found #{response.body.dig('data', 'boards').length} boards"
|
|
132
|
+
else
|
|
133
|
+
puts "Connection failed: #{response.code}"
|
|
134
|
+
end
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
Run this script. If you see "Connected successfully!", you're ready to go.
|
|
138
|
+
|
|
139
|
+
## Configuration Options
|
|
140
|
+
|
|
141
|
+
### API Version
|
|
142
|
+
|
|
143
|
+
Specify the monday.com API version:
|
|
144
|
+
|
|
145
|
+
```ruby
|
|
146
|
+
Monday.configure do |config|
|
|
147
|
+
config.token = ENV["MONDAY_TOKEN"]
|
|
148
|
+
config.version = "2024-10"
|
|
149
|
+
end
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
Default version: `2024-01`
|
|
153
|
+
|
|
154
|
+
### API Host
|
|
155
|
+
|
|
156
|
+
Override the API endpoint (rarely needed):
|
|
157
|
+
|
|
158
|
+
```ruby
|
|
159
|
+
Monday.configure do |config|
|
|
160
|
+
config.token = ENV["MONDAY_TOKEN"]
|
|
161
|
+
config.host = "https://api.monday.com/v2"
|
|
162
|
+
end
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
## Next Steps
|
|
166
|
+
|
|
167
|
+
- [Authenticate and make your first request →](/guides/first-request)
|
|
168
|
+
- [Learn about configuration options →](/reference/configuration)
|
|
169
|
+
- [Explore error handling →](/guides/advanced/errors)
|