monday_ruby 0.1.0 → 0.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 -0
- data/.rubocop.yml +1 -1
- data/CHANGELOG.md +11 -0
- data/README.md +24 -2
- data/docs/README.md +12 -0
- data/docs/SUMMARY.md +39 -0
- data/docs/client.md +15 -0
- data/docs/configuration.md +28 -0
- data/docs/getting-started.md +25 -0
- data/docs/quick-start.md +269 -0
- data/docs/resources/README.md +27 -0
- data/docs/resources/account/README.md +9 -0
- data/docs/resources/account/accounts.md +82 -0
- data/docs/resources/activity-log/README.md +9 -0
- data/docs/resources/activity-log/activity_logs.md +95 -0
- data/docs/resources/board/README.md +21 -0
- data/docs/resources/board/archive_board.md +79 -0
- data/docs/resources/board/boards.md +96 -0
- data/docs/resources/board/create_board.md +95 -0
- data/docs/resources/board/delete_board.md +79 -0
- data/docs/resources/board/delete_board_subscribers.md +87 -0
- data/docs/resources/board/duplicate_board.md +94 -0
- data/docs/resources/board/update_board.md +91 -0
- data/docs/resources/board-view/README.md +9 -0
- data/docs/resources/board-view/board_views.md +88 -0
- data/docs/resources/column/README.md +25 -0
- data/docs/resources/column/change_column_metadata.md +70 -0
- data/docs/resources/column/change_column_title.md +68 -0
- data/docs/resources/column/change_column_value.md +73 -0
- data/docs/resources/column/change_multiple_column_value.md +81 -0
- data/docs/resources/column/change_simple_column_value.md +69 -0
- data/docs/resources/column/column_values.md +115 -0
- data/docs/resources/column/columns.md +117 -0
- data/docs/resources/column/create_column.md +70 -0
- data/docs/resources/column/delete_column.md +58 -0
- data/docs/resources/item/README.md +17 -0
- data/docs/resources/item/archive_item.md +80 -0
- data/docs/resources/item/create_item.md +105 -0
- data/docs/resources/item/delete_item.md +80 -0
- data/docs/resources/item/duplicate_item.md +87 -0
- data/docs/resources/item/items.md +95 -0
- data/docs/response.md +21 -0
- data/lib/monday/client.rb +9 -8
- data/lib/monday/configuration.rb +7 -1
- data/lib/monday/version.rb +1 -1
- data/lib/monday_ruby.rb +13 -0
- data/monday_ruby.gemspec +2 -2
- metadata +43 -4
@@ -0,0 +1,117 @@
|
|
1
|
+
# #columns
|
2
|
+
|
3
|
+
Querying `columns` will return the metadata for one or a collection of columns.
|
4
|
+
|
5
|
+
### Basic usage
|
6
|
+
|
7
|
+
{% code lineNumbers="true" %}
|
8
|
+
```ruby
|
9
|
+
client = Monday::Client.new(token: <AUTH_TOKEN>)
|
10
|
+
|
11
|
+
response = client.columns
|
12
|
+
|
13
|
+
puts response.body
|
14
|
+
```
|
15
|
+
{% endcode %}
|
16
|
+
|
17
|
+
This will return the columns' ID, title and description fields by default.
|
18
|
+
|
19
|
+
The response body from the above query would be as follows:
|
20
|
+
|
21
|
+
{% code lineNumbers="true" %}
|
22
|
+
```json
|
23
|
+
{
|
24
|
+
"data": {
|
25
|
+
"boards": [
|
26
|
+
{
|
27
|
+
"columns": [
|
28
|
+
{
|
29
|
+
"id": "name",
|
30
|
+
"title": "Name",
|
31
|
+
"description": null
|
32
|
+
},
|
33
|
+
{
|
34
|
+
"id": "subitems",
|
35
|
+
"title": "Subitems",
|
36
|
+
"description": null
|
37
|
+
},
|
38
|
+
{
|
39
|
+
"id": "work_status",
|
40
|
+
"title": "Status",
|
41
|
+
"description": "New description"
|
42
|
+
},
|
43
|
+
{
|
44
|
+
"id": "keywords",
|
45
|
+
"title": "Keywords",
|
46
|
+
"description": "This is keywords column"
|
47
|
+
}
|
48
|
+
]
|
49
|
+
},
|
50
|
+
{
|
51
|
+
"columns": [
|
52
|
+
{
|
53
|
+
"id": "name",
|
54
|
+
"title": "Name",
|
55
|
+
"description": null
|
56
|
+
},
|
57
|
+
{
|
58
|
+
"id": "person",
|
59
|
+
"title": "Owner",
|
60
|
+
"description": null
|
61
|
+
},
|
62
|
+
{
|
63
|
+
"id": "status",
|
64
|
+
"title": "Status",
|
65
|
+
"description": null
|
66
|
+
},
|
67
|
+
{
|
68
|
+
"id": "date0",
|
69
|
+
"title": "Date",
|
70
|
+
"description": null
|
71
|
+
}
|
72
|
+
]
|
73
|
+
}
|
74
|
+
]
|
75
|
+
},
|
76
|
+
"account_id": 123
|
77
|
+
}
|
78
|
+
```
|
79
|
+
{% endcode %}
|
80
|
+
|
81
|
+
### Filtering columns
|
82
|
+
|
83
|
+
This method accepts various arguments to filter down the columns. You can find the complete list of arguments [here](https://developer.monday.com/api-reference/docs/columns#arguments).
|
84
|
+
|
85
|
+
You can pass these filters using the `args` option.
|
86
|
+
|
87
|
+
{% code lineNumbers="true" %}
|
88
|
+
```ruby
|
89
|
+
client = Monday::Client.new(token: <AUTH_TOKEN>)
|
90
|
+
|
91
|
+
args = {
|
92
|
+
ids: [456],
|
93
|
+
}
|
94
|
+
response = client.columns(args: args)
|
95
|
+
|
96
|
+
puts response.body
|
97
|
+
```
|
98
|
+
{% endcode %}
|
99
|
+
|
100
|
+
This will filter and return the columns that belong to board ID `456`.
|
101
|
+
|
102
|
+
### Customizing fields to retrieve
|
103
|
+
|
104
|
+
You can customize the fields to retrieve by passing in the `select` option and listing all the fields you need to retrieve as an array.
|
105
|
+
|
106
|
+
{% code lineNumbers="true" %}
|
107
|
+
```ruby
|
108
|
+
client = Monday::Client.new(token: <AUTH_TOKEN>)
|
109
|
+
|
110
|
+
select = %w[id archived width settings_str]
|
111
|
+
response = client.columns(select: select)
|
112
|
+
|
113
|
+
puts response.body
|
114
|
+
```
|
115
|
+
{% endcode %}
|
116
|
+
|
117
|
+
You can find the list of all the available fields for columns [here](https://developer.monday.com/api-reference/docs/columns#fields).
|
@@ -0,0 +1,70 @@
|
|
1
|
+
# #create\_column
|
2
|
+
|
3
|
+
The `create_column` mutation will allow you to create a column.
|
4
|
+
|
5
|
+
### Basic usage
|
6
|
+
|
7
|
+
This method accepts various arguments to create a column. You can find the complete list of arguments [here](https://developer.monday.com/api-reference/docs/columns#arguments-1).
|
8
|
+
|
9
|
+
You can pass these filters using the `args` option.
|
10
|
+
|
11
|
+
{% code lineNumbers="true" %}
|
12
|
+
```ruby
|
13
|
+
client = Monday::Client.new(token: <AUTH_TOKEN>)
|
14
|
+
|
15
|
+
args = {
|
16
|
+
board_id: 123,
|
17
|
+
title: "Work Status",
|
18
|
+
description: "This is the work status column",
|
19
|
+
column_type: status
|
20
|
+
}
|
21
|
+
response = client.create_column(args: args)
|
22
|
+
|
23
|
+
puts response.body
|
24
|
+
```
|
25
|
+
{% endcode %}
|
26
|
+
|
27
|
+
This will create a new column on the `123` board titled "Work Status" and the "This is the work status column" description with the column type as status.
|
28
|
+
|
29
|
+
This will return the columns' ID, title and description fields by default.
|
30
|
+
|
31
|
+
The response body from the above query would be as follows:
|
32
|
+
|
33
|
+
{% code lineNumbers="true" %}
|
34
|
+
```json
|
35
|
+
{
|
36
|
+
"data": {
|
37
|
+
"create_column": {
|
38
|
+
"id": "status",
|
39
|
+
"title": "Work Status",
|
40
|
+
"description": "This is the work status column"
|
41
|
+
}
|
42
|
+
},
|
43
|
+
"account_id": 123
|
44
|
+
}
|
45
|
+
```
|
46
|
+
{% endcode %}
|
47
|
+
|
48
|
+
### Customizing fields to retrieve
|
49
|
+
|
50
|
+
You can customize the fields to retrieve by passing in the `select` option and listing all the fields you need to retrieve as an array.
|
51
|
+
|
52
|
+
{% code lineNumbers="true" %}
|
53
|
+
```ruby
|
54
|
+
client = Monday::Client.new(token: <AUTH_TOKEN>)
|
55
|
+
|
56
|
+
args = {
|
57
|
+
board_id: 123,
|
58
|
+
title: "Work Status",
|
59
|
+
description: "This is the work status column",
|
60
|
+
column_type: status
|
61
|
+
}
|
62
|
+
select = %w[id archived width settings_str]
|
63
|
+
|
64
|
+
response = client.create_column(args: args, select: select)
|
65
|
+
|
66
|
+
puts response.body
|
67
|
+
```
|
68
|
+
{% endcode %}
|
69
|
+
|
70
|
+
You can find the list of all the available fields for columns [here](https://developer.monday.com/api-reference/docs/columns#fields).
|
@@ -0,0 +1,58 @@
|
|
1
|
+
# #delete\_column
|
2
|
+
|
3
|
+
The `delete_column` mutation will allow you to delete a column from a specific board.
|
4
|
+
|
5
|
+
### Basic usage
|
6
|
+
|
7
|
+
This method accepts two required arguments - `board_id` and `column_id`.
|
8
|
+
|
9
|
+
{% code lineNumbers="true" %}
|
10
|
+
```ruby
|
11
|
+
client = Monday::Client.new(token: <AUTH_TOKEN>)
|
12
|
+
|
13
|
+
board_id = 123
|
14
|
+
column_id = "keywords"
|
15
|
+
response = client.delete_column(board_id, column_id)
|
16
|
+
|
17
|
+
puts response.body
|
18
|
+
```
|
19
|
+
{% endcode %}
|
20
|
+
|
21
|
+
This will delete the `keywords` column from the board ID `123`.
|
22
|
+
|
23
|
+
This will return the deleted column's ID by default.
|
24
|
+
|
25
|
+
The response body from the above query would be as follows:
|
26
|
+
|
27
|
+
{% code lineNumbers="true" %}
|
28
|
+
```json
|
29
|
+
{
|
30
|
+
"data": {
|
31
|
+
"delete_column": {
|
32
|
+
"id": "keywords"
|
33
|
+
}
|
34
|
+
},
|
35
|
+
"account_id": 123
|
36
|
+
}
|
37
|
+
```
|
38
|
+
{% endcode %}
|
39
|
+
|
40
|
+
### Customizing fields to retrieve
|
41
|
+
|
42
|
+
You can customize the fields to retrieve by passing in the `select` option and listing all the fields you need to retrieve as an array.
|
43
|
+
|
44
|
+
{% code lineNumbers="true" %}
|
45
|
+
```ruby
|
46
|
+
client = Monday::Client.new(token: <AUTH_TOKEN>)
|
47
|
+
|
48
|
+
board_id = 123
|
49
|
+
column_id = "keywords"
|
50
|
+
select = %w[id type title]
|
51
|
+
|
52
|
+
response = client.delete_column(board_id, column_id, select: select)
|
53
|
+
|
54
|
+
puts response.body
|
55
|
+
```
|
56
|
+
{% endcode %}
|
57
|
+
|
58
|
+
You can find the list of all the available fields for columns [here](https://developer.monday.com/api-reference/docs/columns#fields).
|
@@ -0,0 +1,17 @@
|
|
1
|
+
# Item
|
2
|
+
|
3
|
+
The item API is used to access and mutate the items. It includes the following methods:
|
4
|
+
|
5
|
+
[items.md](items.md "mention")
|
6
|
+
|
7
|
+
[create\_item.md](create\_item.md "mention")
|
8
|
+
|
9
|
+
[duplicate\_item.md](duplicate\_item.md "mention")
|
10
|
+
|
11
|
+
[archive\_item.md](archive\_item.md "mention")
|
12
|
+
|
13
|
+
[delete\_item.md](delete\_item.md "mention")
|
14
|
+
|
15
|
+
{% hint style="info" %}
|
16
|
+
Visit monday.com's API documentation to know more about the [items API](https://developer.monday.com/api-reference/docs/items).
|
17
|
+
{% endhint %}
|
@@ -0,0 +1,80 @@
|
|
1
|
+
# #archive\_item
|
2
|
+
|
3
|
+
The `archive_item` mutation will allow you to archive an item.
|
4
|
+
|
5
|
+
### Basic usage
|
6
|
+
|
7
|
+
This method accepts one required argument - `item_id`.
|
8
|
+
|
9
|
+
{% code lineNumbers="true" %}
|
10
|
+
```ruby
|
11
|
+
client = Monday::Client.new(token: <AUTH_TOKEN>)
|
12
|
+
|
13
|
+
item_id = "0123"
|
14
|
+
|
15
|
+
response = client.archive_item(item_id)
|
16
|
+
|
17
|
+
puts response.body
|
18
|
+
```
|
19
|
+
{% endcode %}
|
20
|
+
|
21
|
+
This will return the archived item's ID by default.
|
22
|
+
|
23
|
+
The response body from the above query would be as follows:
|
24
|
+
|
25
|
+
{% code lineNumbers="true" %}
|
26
|
+
```json
|
27
|
+
{
|
28
|
+
"data": {
|
29
|
+
"archive_item": {
|
30
|
+
"id": "0123"
|
31
|
+
}
|
32
|
+
},
|
33
|
+
"account_id": 123
|
34
|
+
}
|
35
|
+
```
|
36
|
+
{% endcode %}
|
37
|
+
|
38
|
+
### Customizing fields to retrieve
|
39
|
+
|
40
|
+
You can customize the fields to retrieve by passing in the `select` option and listing all the fields you need to retrieve as an array.
|
41
|
+
|
42
|
+
{% code lineNumbers="true" %}
|
43
|
+
```ruby
|
44
|
+
client = Monday::Client.new(token: <AUTH_TOKEN>)
|
45
|
+
|
46
|
+
item_id = "0123"
|
47
|
+
|
48
|
+
select = %w[id state creator_id]
|
49
|
+
response = client.archive_item(item_id, select: select)
|
50
|
+
|
51
|
+
puts response.body
|
52
|
+
```
|
53
|
+
{% endcode %}
|
54
|
+
|
55
|
+
### Retrieving nested fields
|
56
|
+
|
57
|
+
Some fields have nested attributes, and you need to specify the attributes to retrieve that field; else, the API will respond with an error. For example, the field `creator` is of type `User` and expects you to pass the attributes from `User` that you want to retrieve for `creator`.
|
58
|
+
|
59
|
+
{% code lineNumbers="true" %}
|
60
|
+
```ruby
|
61
|
+
client = Monday::Client.new(token: <AUTH_TOKEN>)
|
62
|
+
|
63
|
+
item_id = "0123"
|
64
|
+
|
65
|
+
select = [
|
66
|
+
"id",
|
67
|
+
"state",
|
68
|
+
"creator_id",
|
69
|
+
{
|
70
|
+
creator: %w[id name email is_admin]
|
71
|
+
}
|
72
|
+
]
|
73
|
+
|
74
|
+
response = client.archive_item(item_id, select: select)
|
75
|
+
|
76
|
+
puts response.body
|
77
|
+
```
|
78
|
+
{% endcode %}
|
79
|
+
|
80
|
+
You can find the list of all the available fields for items [here](https://developer.monday.com/api-reference/docs/items#fields).
|
@@ -0,0 +1,105 @@
|
|
1
|
+
# #create\_item
|
2
|
+
|
3
|
+
The `create_item` mutation will allow you to create an item on a specific board.
|
4
|
+
|
5
|
+
### Basic usage
|
6
|
+
|
7
|
+
This method accepts various arguments to fetch the items. You can find the complete list of arguments [here](https://developer.monday.com/api-reference/docs/items#arguments-1).
|
8
|
+
|
9
|
+
You can pass these filters using the `args` option.
|
10
|
+
|
11
|
+
{% code lineNumbers="true" %}
|
12
|
+
```ruby
|
13
|
+
client = Monday::Client.new(token: <AUTH_TOKEN>)
|
14
|
+
|
15
|
+
args = {
|
16
|
+
board_id: 123,
|
17
|
+
item_name: "New Task",
|
18
|
+
column_values: {
|
19
|
+
status: {
|
20
|
+
label: "Working on it"
|
21
|
+
}
|
22
|
+
}
|
23
|
+
}
|
24
|
+
response = client.create_item(args: args)
|
25
|
+
|
26
|
+
puts response.body
|
27
|
+
```
|
28
|
+
{% endcode %}
|
29
|
+
|
30
|
+
This will return the items' ID, name and created\_at fields by default.
|
31
|
+
|
32
|
+
The response body from the above query would be as follows:
|
33
|
+
|
34
|
+
{% code lineNumbers="true" %}
|
35
|
+
```json
|
36
|
+
{
|
37
|
+
"data": {
|
38
|
+
"create_item": {
|
39
|
+
"id": "7890",
|
40
|
+
"name": "New Task",
|
41
|
+
"created_at": "2023-06-27T16:39:29Z"
|
42
|
+
}
|
43
|
+
},
|
44
|
+
"account_id": 123
|
45
|
+
}
|
46
|
+
```
|
47
|
+
{% endcode %}
|
48
|
+
|
49
|
+
### Customizing fields to retrieve
|
50
|
+
|
51
|
+
You can customize the fields to retrieve by passing in the `select` option and listing all the fields you need to retrieve as an array.
|
52
|
+
|
53
|
+
{% code lineNumbers="true" %}
|
54
|
+
```ruby
|
55
|
+
client = Monday::Client.new(token: <AUTH_TOKEN>)
|
56
|
+
|
57
|
+
args = {
|
58
|
+
board_id: 123,
|
59
|
+
item_name: "New Task",
|
60
|
+
column_values: {
|
61
|
+
status: {
|
62
|
+
label: "Working on it"
|
63
|
+
}
|
64
|
+
}
|
65
|
+
}
|
66
|
+
select = %w[id state creator_id]
|
67
|
+
response = client.create_item(args: args, select: select)
|
68
|
+
|
69
|
+
puts response.body
|
70
|
+
```
|
71
|
+
{% endcode %}
|
72
|
+
|
73
|
+
### Retrieving nested fields
|
74
|
+
|
75
|
+
Some fields have nested attributes, and you need to specify the attributes to retrieve that field; else, the API will respond with an error. For example, the field `creator` is of type `User` and expects you to pass the attributes from `User` that you want to retrieve for `creator`.
|
76
|
+
|
77
|
+
{% code lineNumbers="true" %}
|
78
|
+
```ruby
|
79
|
+
client = Monday::Client.new(token: <AUTH_TOKEN>)
|
80
|
+
|
81
|
+
args = {
|
82
|
+
board_id: 123,
|
83
|
+
item_name: "New Task",
|
84
|
+
column_values: {
|
85
|
+
status: {
|
86
|
+
label: "Working on it"
|
87
|
+
}
|
88
|
+
}
|
89
|
+
}
|
90
|
+
select = [
|
91
|
+
"id",
|
92
|
+
"state",
|
93
|
+
"creator_id",
|
94
|
+
{
|
95
|
+
creator: %w[id name email is_admin]
|
96
|
+
}
|
97
|
+
]
|
98
|
+
|
99
|
+
response = client.create_item(args: args, select: select)
|
100
|
+
|
101
|
+
puts response.body
|
102
|
+
```
|
103
|
+
{% endcode %}
|
104
|
+
|
105
|
+
You can find the list of all the available fields for items [here](https://developer.monday.com/api-reference/docs/items#fields).
|
@@ -0,0 +1,80 @@
|
|
1
|
+
# #delete\_item
|
2
|
+
|
3
|
+
The `delete_item` mutation will allow you to delete an item.
|
4
|
+
|
5
|
+
### Basic usage
|
6
|
+
|
7
|
+
This method accepts one required argument - `item_id`.
|
8
|
+
|
9
|
+
{% code lineNumbers="true" %}
|
10
|
+
```ruby
|
11
|
+
client = Monday::Client.new(token: <AUTH_TOKEN>)
|
12
|
+
|
13
|
+
item_id = "0123"
|
14
|
+
|
15
|
+
response = client.delete_item(item_id)
|
16
|
+
|
17
|
+
puts response.body
|
18
|
+
```
|
19
|
+
{% endcode %}
|
20
|
+
|
21
|
+
This will return the deleted item's ID by default.
|
22
|
+
|
23
|
+
The response body from the above query would be as follows:
|
24
|
+
|
25
|
+
{% code lineNumbers="true" %}
|
26
|
+
```json
|
27
|
+
{
|
28
|
+
"data": {
|
29
|
+
"delete_item": {
|
30
|
+
"id": "0123"
|
31
|
+
}
|
32
|
+
},
|
33
|
+
"account_id": 123
|
34
|
+
}
|
35
|
+
```
|
36
|
+
{% endcode %}
|
37
|
+
|
38
|
+
### Customizing fields to retrieve
|
39
|
+
|
40
|
+
You can customize the fields to retrieve by passing in the `select` option and listing all the fields you need to retrieve as an array.
|
41
|
+
|
42
|
+
{% code lineNumbers="true" %}
|
43
|
+
```ruby
|
44
|
+
client = Monday::Client.new(token: <AUTH_TOKEN>)
|
45
|
+
|
46
|
+
item_id = "0123"
|
47
|
+
|
48
|
+
select = %w[id state creator_id]
|
49
|
+
response = client.delete_item(item_id, select: select)
|
50
|
+
|
51
|
+
puts response.body
|
52
|
+
```
|
53
|
+
{% endcode %}
|
54
|
+
|
55
|
+
### Retrieving nested fields
|
56
|
+
|
57
|
+
Some fields have nested attributes, and you need to specify the attributes to retrieve that field; else, the API will respond with an error. For example, the field `creator` is of type `User` and expects you to pass the attributes from `User` that you want to retrieve for `creator`.
|
58
|
+
|
59
|
+
{% code lineNumbers="true" %}
|
60
|
+
```ruby
|
61
|
+
client = Monday::Client.new(token: <AUTH_TOKEN>)
|
62
|
+
|
63
|
+
item_id = "0123"
|
64
|
+
|
65
|
+
select = [
|
66
|
+
"id",
|
67
|
+
"state",
|
68
|
+
"creator_id",
|
69
|
+
{
|
70
|
+
creator: %w[id name email is_admin]
|
71
|
+
}
|
72
|
+
]
|
73
|
+
|
74
|
+
response = client.delete_item(item_id, select: select)
|
75
|
+
|
76
|
+
puts response.body
|
77
|
+
```
|
78
|
+
{% endcode %}
|
79
|
+
|
80
|
+
You can find the list of all the available fields for items [here](https://developer.monday.com/api-reference/docs/items#fields).
|
@@ -0,0 +1,87 @@
|
|
1
|
+
# #duplicate\_item
|
2
|
+
|
3
|
+
The `duplicate_item` mutation will allow you to duplicate an item.
|
4
|
+
|
5
|
+
### Basic usage
|
6
|
+
|
7
|
+
This method accepts three required arguments - `board_id`, `item_id` and `with_updates`.
|
8
|
+
|
9
|
+
{% code lineNumbers="true" %}
|
10
|
+
```ruby
|
11
|
+
client = Monday::Client.new(token: <AUTH_TOKEN>)
|
12
|
+
|
13
|
+
board_id = "123"
|
14
|
+
item_id = "7890"
|
15
|
+
with_updates = true
|
16
|
+
response = client.duplicate_item(board_id, item_id, with_updates)
|
17
|
+
|
18
|
+
puts response.body
|
19
|
+
```
|
20
|
+
{% endcode %}
|
21
|
+
|
22
|
+
This will return the items' ID, name and created\_at fields by default.
|
23
|
+
|
24
|
+
The response body from the above query would be as follows:
|
25
|
+
|
26
|
+
{% code lineNumbers="true" %}
|
27
|
+
```json
|
28
|
+
{
|
29
|
+
"data": {
|
30
|
+
"duplicate_item": {
|
31
|
+
"id": "0123",
|
32
|
+
"name": "New Task (copy)",
|
33
|
+
"created_at": "2023-06-27T16:45:07Z"
|
34
|
+
}
|
35
|
+
},
|
36
|
+
"account_id": 123
|
37
|
+
}
|
38
|
+
```
|
39
|
+
{% endcode %}
|
40
|
+
|
41
|
+
### Customizing fields to retrieve
|
42
|
+
|
43
|
+
You can customize the fields to retrieve by passing in the `select` option and listing all the fields you need to retrieve as an array.
|
44
|
+
|
45
|
+
{% code lineNumbers="true" %}
|
46
|
+
```ruby
|
47
|
+
client = Monday::Client.new(token: <AUTH_TOKEN>)
|
48
|
+
|
49
|
+
board_id = "123"
|
50
|
+
item_id = "7890"
|
51
|
+
with_updates = true
|
52
|
+
|
53
|
+
select = %w[id state creator_id]
|
54
|
+
response = client.duplicate_item(board_id, item_id, with_updates, select: select)
|
55
|
+
|
56
|
+
puts response.body
|
57
|
+
```
|
58
|
+
{% endcode %}
|
59
|
+
|
60
|
+
### Retrieving nested fields
|
61
|
+
|
62
|
+
Some fields have nested attributes, and you need to specify the attributes to retrieve that field; else, the API will respond with an error. For example, the field `creator` is of type `User` and expects you to pass the attributes from `User` that you want to retrieve for `creator`.
|
63
|
+
|
64
|
+
{% code lineNumbers="true" %}
|
65
|
+
```ruby
|
66
|
+
client = Monday::Client.new(token: <AUTH_TOKEN>)
|
67
|
+
|
68
|
+
board_id = "123"
|
69
|
+
item_id = "7890"
|
70
|
+
with_updates = true
|
71
|
+
|
72
|
+
select = [
|
73
|
+
"id",
|
74
|
+
"state",
|
75
|
+
"creator_id",
|
76
|
+
{
|
77
|
+
creator: %w[id name email is_admin]
|
78
|
+
}
|
79
|
+
]
|
80
|
+
|
81
|
+
response = client.duplicate_item(board_id, item_id, with_updates, select: select)
|
82
|
+
|
83
|
+
puts response.body
|
84
|
+
```
|
85
|
+
{% endcode %}
|
86
|
+
|
87
|
+
You can find the list of all the available fields for items [here](https://developer.monday.com/api-reference/docs/items#fields).
|
@@ -0,0 +1,95 @@
|
|
1
|
+
# #items
|
2
|
+
|
3
|
+
Querying `items` will return the metadata for one or a collection of columns.
|
4
|
+
|
5
|
+
### Basic usage
|
6
|
+
|
7
|
+
This method accepts various arguments to fetch the items. You can find the complete list of arguments [here](https://developer.monday.com/api-reference/docs/items#arguments).
|
8
|
+
|
9
|
+
You can pass these filters using the `args` option.
|
10
|
+
|
11
|
+
{% code lineNumbers="true" %}
|
12
|
+
```ruby
|
13
|
+
client = Monday::Client.new(token: <AUTH_TOKEN>)
|
14
|
+
|
15
|
+
args = {
|
16
|
+
ids: [1234, 5678]
|
17
|
+
}
|
18
|
+
response = client.items(args: args)
|
19
|
+
|
20
|
+
puts response.body
|
21
|
+
```
|
22
|
+
{% endcode %}
|
23
|
+
|
24
|
+
This will return the items' ID, name and created\_at fields by default.
|
25
|
+
|
26
|
+
The response body from the above query would be as follows:
|
27
|
+
|
28
|
+
{% code lineNumbers="true" %}
|
29
|
+
```json
|
30
|
+
{
|
31
|
+
"data": {
|
32
|
+
"items": [
|
33
|
+
{
|
34
|
+
"id": "1234",
|
35
|
+
"name": "Task 1",
|
36
|
+
"created_at": "2023-06-26T23:20:56Z"
|
37
|
+
},
|
38
|
+
"items": [
|
39
|
+
{
|
40
|
+
"id": "5678",
|
41
|
+
"name": "Task 2",
|
42
|
+
"created_at": "2023-06-26T23:25:50Z"
|
43
|
+
}
|
44
|
+
]
|
45
|
+
},
|
46
|
+
"account_id": 123
|
47
|
+
}
|
48
|
+
```
|
49
|
+
{% endcode %}
|
50
|
+
|
51
|
+
### Customizing fields to retrieve
|
52
|
+
|
53
|
+
You can customize the fields to retrieve by passing in the `select` option and listing all the fields you need to retrieve as an array.
|
54
|
+
|
55
|
+
{% code lineNumbers="true" %}
|
56
|
+
```ruby
|
57
|
+
client = Monday::Client.new(token: <AUTH_TOKEN>)
|
58
|
+
|
59
|
+
args = {
|
60
|
+
ids: [1234, 5678]
|
61
|
+
}
|
62
|
+
select = %w[id state creator_id]
|
63
|
+
response = client.items(args: args, select: select)
|
64
|
+
|
65
|
+
puts response.body
|
66
|
+
```
|
67
|
+
{% endcode %}
|
68
|
+
|
69
|
+
### Retrieving nested fields
|
70
|
+
|
71
|
+
Some fields have nested attributes, and you need to specify the attributes to retrieve that field; else, the API will respond with an error. For example, the field `creator` is of type `User` and expects you to pass the attributes from `User` that you want to retrieve for `creator`.
|
72
|
+
|
73
|
+
{% code lineNumbers="true" %}
|
74
|
+
```ruby
|
75
|
+
client = Monday::Client.new(token: <AUTH_TOKEN>)
|
76
|
+
|
77
|
+
args = {
|
78
|
+
ids: [1234, 5678]
|
79
|
+
}
|
80
|
+
select = [
|
81
|
+
"id",
|
82
|
+
"state",
|
83
|
+
"creator_id",
|
84
|
+
{
|
85
|
+
creator: %w[id name email is_admin]
|
86
|
+
}
|
87
|
+
]
|
88
|
+
|
89
|
+
response = client.items(args: args, select: select)
|
90
|
+
|
91
|
+
puts response.body
|
92
|
+
```
|
93
|
+
{% endcode %}
|
94
|
+
|
95
|
+
You can find the list of all the available fields for items [here](https://developer.monday.com/api-reference/docs/items#fields).
|