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,95 @@
|
|
1
|
+
# #activity\_logs
|
2
|
+
|
3
|
+
Querying `activity_logs` will return a collection of activity logs from a specific board.
|
4
|
+
|
5
|
+
### Basic usage
|
6
|
+
|
7
|
+
This method accepts one required argument - `board_ids`, an array of board IDs.
|
8
|
+
|
9
|
+
{% code lineNumbers="true" %}
|
10
|
+
```ruby
|
11
|
+
client = Monday::Client.new(token: <AUTH_TOKEN>)
|
12
|
+
|
13
|
+
board_ids = [123, 456]
|
14
|
+
response = client.activity_logs(board_ids)
|
15
|
+
|
16
|
+
puts response.body
|
17
|
+
```
|
18
|
+
{% endcode %}
|
19
|
+
|
20
|
+
This will return the activity logs' ID, event and data fields by default.
|
21
|
+
|
22
|
+
The response body from the above query would be as follows:
|
23
|
+
|
24
|
+
{% code lineNumbers="true" %}
|
25
|
+
```json
|
26
|
+
{
|
27
|
+
"data": {
|
28
|
+
"boards": [
|
29
|
+
{
|
30
|
+
"activity_logs": [
|
31
|
+
{
|
32
|
+
"id": "123-abc",
|
33
|
+
"event": "create_column",
|
34
|
+
"data": "{\"board_id\":123,\"column_id\":\"date0\",\"column_title\":\"Date\",\"column_type\":\"date\"}"
|
35
|
+
},
|
36
|
+
{
|
37
|
+
"id": "456-def",
|
38
|
+
"event": "create_column",
|
39
|
+
"data": "{\"board_id\":123,\"column_id\":\"status\",\"column_title\":\"Status\",\"column_type\":\"color\"}"
|
40
|
+
},
|
41
|
+
{
|
42
|
+
"id": "789-ghi",
|
43
|
+
"event": "create_column",
|
44
|
+
"data": "{\"board_id\":123,\"column_id\":\"name\",\"column_title\":\"Name\",\"column_type\":\"name\"}"
|
45
|
+
}
|
46
|
+
]
|
47
|
+
}
|
48
|
+
]
|
49
|
+
},
|
50
|
+
"account_id": 123
|
51
|
+
}
|
52
|
+
```
|
53
|
+
{% endcode %}
|
54
|
+
|
55
|
+
### Filtering activity logs
|
56
|
+
|
57
|
+
This method accepts various arguments to filter down the activity logs. You can find the complete list of arguments [here](https://developer.monday.com/api-reference/docs/activity-logs#arguments).
|
58
|
+
|
59
|
+
You can pass these filters using the `args` option.
|
60
|
+
|
61
|
+
{% code lineNumbers="true" %}
|
62
|
+
```ruby
|
63
|
+
client = Monday::Client.new(token: <AUTH_TOKEN>)
|
64
|
+
|
65
|
+
board_ids = [123, 456]
|
66
|
+
args = {
|
67
|
+
from: "2023-01-01T00:00:00Z",
|
68
|
+
to: "2023-06-01T00:00:00Z"
|
69
|
+
}
|
70
|
+
response = client.activity_logs(board_ids, args: args)
|
71
|
+
|
72
|
+
puts response.body
|
73
|
+
```
|
74
|
+
{% endcode %}
|
75
|
+
|
76
|
+
This will filter and return the logs from Jan 1, 2023, to Jun 1, 2023.
|
77
|
+
|
78
|
+
### Customizing fields to retrieve
|
79
|
+
|
80
|
+
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.
|
81
|
+
|
82
|
+
{% code lineNumbers="true" %}
|
83
|
+
```ruby
|
84
|
+
client = Monday::Client.new(token: <AUTH_TOKEN>)
|
85
|
+
|
86
|
+
board_ids = [123, 456]
|
87
|
+
|
88
|
+
select = %w[id event data entity user_id]
|
89
|
+
response = client.activity_logs(board_ids, select: select)
|
90
|
+
|
91
|
+
puts response.body
|
92
|
+
```
|
93
|
+
{% endcode %}
|
94
|
+
|
95
|
+
You can find the list of all the available fields for activity logs [here](https://developer.monday.com/api-reference/docs/activity-logs#fields).
|
@@ -0,0 +1,21 @@
|
|
1
|
+
# Board
|
2
|
+
|
3
|
+
The boards API is used to access and mutate the board data. It includes the following methods:
|
4
|
+
|
5
|
+
[boards.md](boards.md "mention")
|
6
|
+
|
7
|
+
[create\_board.md](create\_board.md "mention")
|
8
|
+
|
9
|
+
[duplicate\_board.md](duplicate\_board.md "mention")
|
10
|
+
|
11
|
+
[update\_board.md](update\_board.md "mention")
|
12
|
+
|
13
|
+
[archive\_board.md](archive\_board.md "mention")
|
14
|
+
|
15
|
+
[delete\_board.md](delete\_board.md "mention")
|
16
|
+
|
17
|
+
[delete\_board\_subscribers.md](delete\_board\_subscribers.md "mention")
|
18
|
+
|
19
|
+
{% hint style="info" %}
|
20
|
+
Visit monday.com's API documentation to know more about the [boards API](https://developer.monday.com/api-reference/docs/boards).
|
21
|
+
{% endhint %}
|
@@ -0,0 +1,79 @@
|
|
1
|
+
# #archive\_board
|
2
|
+
|
3
|
+
The `archive_board` mutation will allow you to archive a board.
|
4
|
+
|
5
|
+
### Basic usage
|
6
|
+
|
7
|
+
This method accepts one required argument - `board_id`.
|
8
|
+
|
9
|
+
{% code lineNumbers="true" %}
|
10
|
+
```ruby
|
11
|
+
client = Monday::Client.new(token: <AUTH_TOKEN>)
|
12
|
+
|
13
|
+
board_id = 789
|
14
|
+
response = client.archive_board(board_id)
|
15
|
+
|
16
|
+
puts response.body
|
17
|
+
```
|
18
|
+
{% endcode %}
|
19
|
+
|
20
|
+
This will archive the `789` board.
|
21
|
+
|
22
|
+
This will return the board's ID 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
|
+
"archive_board": {
|
31
|
+
"id": "789"
|
32
|
+
}
|
33
|
+
},
|
34
|
+
"account_id": 123
|
35
|
+
}
|
36
|
+
```
|
37
|
+
{% endcode %}
|
38
|
+
|
39
|
+
### Customizing fields to retrieve
|
40
|
+
|
41
|
+
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.
|
42
|
+
|
43
|
+
{% code lineNumbers="true" %}
|
44
|
+
```ruby
|
45
|
+
client = Monday::Client.new(token: <AUTH_TOKEN>)
|
46
|
+
|
47
|
+
board_id = 789
|
48
|
+
select = %w[id name description items_count permissions]
|
49
|
+
|
50
|
+
response = client.archive_board(board_id, select: select)
|
51
|
+
|
52
|
+
puts response.body
|
53
|
+
```
|
54
|
+
{% endcode %}
|
55
|
+
|
56
|
+
### Retrieving nested fields
|
57
|
+
|
58
|
+
Some fields have nested attributes, and you need to specify the attributes to retrieve that field; else, the API will respond with an error.
|
59
|
+
|
60
|
+
{% code lineNumbers="true" %}
|
61
|
+
```ruby
|
62
|
+
client = Monday::Client.new(token: <AUTH_TOKEN>)
|
63
|
+
|
64
|
+
board_id = 789
|
65
|
+
select = [
|
66
|
+
"id",
|
67
|
+
"name",
|
68
|
+
{
|
69
|
+
creator: %w[id name email is_admin]
|
70
|
+
}
|
71
|
+
]
|
72
|
+
|
73
|
+
response = client.archive_board(board_id, select: select)
|
74
|
+
|
75
|
+
puts response.body
|
76
|
+
```
|
77
|
+
{% endcode %}
|
78
|
+
|
79
|
+
You can find the list of all the available fields for boards [here](https://developer.monday.com/api-reference/docs/board-view-queries#fields).
|
@@ -0,0 +1,96 @@
|
|
1
|
+
# #boards
|
2
|
+
|
3
|
+
Querying `boards` will return the metadata for one or a collection of boards.
|
4
|
+
|
5
|
+
### Basic usage
|
6
|
+
|
7
|
+
{% code lineNumbers="true" %}
|
8
|
+
```ruby
|
9
|
+
client = Monday::Client.new(token: <AUTH_TOKEN>)
|
10
|
+
|
11
|
+
response = client.boards
|
12
|
+
|
13
|
+
puts response.body
|
14
|
+
```
|
15
|
+
{% endcode %}
|
16
|
+
|
17
|
+
This will return the boards' ID, name 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
|
+
"id": "4691485686",
|
28
|
+
"name": "Your first board",
|
29
|
+
"description": "Add your board's description here"
|
30
|
+
}
|
31
|
+
]
|
32
|
+
},
|
33
|
+
"account_id": 123
|
34
|
+
}
|
35
|
+
```
|
36
|
+
{% endcode %}
|
37
|
+
|
38
|
+
### Filtering board
|
39
|
+
|
40
|
+
This method accepts various arguments to filter down the boards. You can find the complete list of arguments [here](https://developer.monday.com/api-reference/docs/boards#arguments).
|
41
|
+
|
42
|
+
You can pass these filters using the `args` option.
|
43
|
+
|
44
|
+
{% code lineNumbers="true" %}
|
45
|
+
```ruby
|
46
|
+
client = Monday::Client.new(token: <AUTH_TOKEN>)
|
47
|
+
|
48
|
+
args = {
|
49
|
+
board_kind: "private",
|
50
|
+
}
|
51
|
+
response = client.boards(args: args)
|
52
|
+
|
53
|
+
puts response.body
|
54
|
+
```
|
55
|
+
{% endcode %}
|
56
|
+
|
57
|
+
This will filter and return the boards that are private on the account.
|
58
|
+
|
59
|
+
### Customizing fields to retrieve
|
60
|
+
|
61
|
+
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.
|
62
|
+
|
63
|
+
{% code lineNumbers="true" %}
|
64
|
+
```ruby
|
65
|
+
client = Monday::Client.new(token: <AUTH_TOKEN>)
|
66
|
+
|
67
|
+
select = %w[id name description items_count permissions]
|
68
|
+
response = client.boards(select: select)
|
69
|
+
|
70
|
+
puts response.body
|
71
|
+
```
|
72
|
+
{% endcode %}
|
73
|
+
|
74
|
+
### Retrieving nested fields
|
75
|
+
|
76
|
+
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`.
|
77
|
+
|
78
|
+
{% code lineNumbers="true" %}
|
79
|
+
```ruby
|
80
|
+
client = Monday::Client.new(token: <AUTH_TOKEN>)
|
81
|
+
|
82
|
+
select = [
|
83
|
+
"id",
|
84
|
+
"name",
|
85
|
+
{
|
86
|
+
creator: %w[id name email is_admin]
|
87
|
+
}
|
88
|
+
]
|
89
|
+
|
90
|
+
response = client.boards(select: select)
|
91
|
+
|
92
|
+
puts response.body
|
93
|
+
```
|
94
|
+
{% endcode %}
|
95
|
+
|
96
|
+
You can find the list of all the available fields for boards [here](https://developer.monday.com/api-reference/docs/board-view-queries#fields).
|
@@ -0,0 +1,95 @@
|
|
1
|
+
# #create\_board
|
2
|
+
|
3
|
+
The `create_board` mutation will allow you to create a new board.
|
4
|
+
|
5
|
+
### Basic usage
|
6
|
+
|
7
|
+
This method accepts various arguments to create a board. You can find the complete list of arguments [here](https://developer.monday.com/api-reference/docs/boards#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_name: "New test board",
|
17
|
+
board_kind: "public",
|
18
|
+
description: "The description for the board"
|
19
|
+
}
|
20
|
+
response = client.create_board(args: args)
|
21
|
+
|
22
|
+
puts response.body
|
23
|
+
```
|
24
|
+
{% endcode %}
|
25
|
+
|
26
|
+
This will create a private board with the name "New test board" and description "The description for the board" on the account.
|
27
|
+
|
28
|
+
This will return the boards' ID, name and description fields by default.
|
29
|
+
|
30
|
+
The response body from the above query would be as follows:
|
31
|
+
|
32
|
+
{% code lineNumbers="true" %}
|
33
|
+
```json
|
34
|
+
{
|
35
|
+
"data": {
|
36
|
+
"create_board": {
|
37
|
+
"id": "456",
|
38
|
+
"name": "New test board",
|
39
|
+
"description": "The description for the board"
|
40
|
+
}
|
41
|
+
},
|
42
|
+
"account_id": 123
|
43
|
+
}
|
44
|
+
```
|
45
|
+
{% endcode %}
|
46
|
+
|
47
|
+
### Customizing fields to retrieve
|
48
|
+
|
49
|
+
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.
|
50
|
+
|
51
|
+
{% code lineNumbers="true" %}
|
52
|
+
```ruby
|
53
|
+
client = Monday::Client.new(token: <AUTH_TOKEN>)
|
54
|
+
|
55
|
+
args = {
|
56
|
+
board_name: "New test board",
|
57
|
+
board_kind: "public",
|
58
|
+
description: "The description for the board"
|
59
|
+
}
|
60
|
+
select = %w[id name description items_count permissions]
|
61
|
+
|
62
|
+
response = client.create_board(args: args, select: select)
|
63
|
+
|
64
|
+
puts response.body
|
65
|
+
```
|
66
|
+
{% endcode %}
|
67
|
+
|
68
|
+
### Retrieving nested fields
|
69
|
+
|
70
|
+
Some fields have nested attributes, and you need to specify the attributes to retrieve that field; else, the API will respond with an error.
|
71
|
+
|
72
|
+
{% code lineNumbers="true" %}
|
73
|
+
```ruby
|
74
|
+
client = Monday::Client.new(token: <AUTH_TOKEN>)
|
75
|
+
|
76
|
+
args = {
|
77
|
+
board_name: "New test board",
|
78
|
+
board_kind: "public",
|
79
|
+
description: "The description for the board"
|
80
|
+
}
|
81
|
+
select = [
|
82
|
+
"id",
|
83
|
+
"name",
|
84
|
+
{
|
85
|
+
creator: %w[id name email is_admin]
|
86
|
+
}
|
87
|
+
]
|
88
|
+
|
89
|
+
response = client.create_board(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 boards [here](https://developer.monday.com/api-reference/docs/board-view-queries#fields).
|
@@ -0,0 +1,79 @@
|
|
1
|
+
# #delete\_board
|
2
|
+
|
3
|
+
The `delete_board` mutation will allow you to delete a board.
|
4
|
+
|
5
|
+
### Basic usage
|
6
|
+
|
7
|
+
This method accepts one required argument - `board_id`.
|
8
|
+
|
9
|
+
{% code lineNumbers="true" %}
|
10
|
+
```ruby
|
11
|
+
client = Monday::Client.new(token: <AUTH_TOKEN>)
|
12
|
+
|
13
|
+
board_id = 789
|
14
|
+
response = client.delete_board(board_id)
|
15
|
+
|
16
|
+
puts response.body
|
17
|
+
```
|
18
|
+
{% endcode %}
|
19
|
+
|
20
|
+
This will delete the `789` board.
|
21
|
+
|
22
|
+
This will return the board's ID 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
|
+
"delete_board": {
|
31
|
+
"id": "789"
|
32
|
+
}
|
33
|
+
},
|
34
|
+
"account_id": 123
|
35
|
+
}
|
36
|
+
```
|
37
|
+
{% endcode %}
|
38
|
+
|
39
|
+
### Customizing fields to retrieve
|
40
|
+
|
41
|
+
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.
|
42
|
+
|
43
|
+
{% code lineNumbers="true" %}
|
44
|
+
```ruby
|
45
|
+
client = Monday::Client.new(token: <AUTH_TOKEN>)
|
46
|
+
|
47
|
+
board_id = 789
|
48
|
+
select = %w[id name description items_count permissions]
|
49
|
+
|
50
|
+
response = client.delete_board(board_id, select: select)
|
51
|
+
|
52
|
+
puts response.body
|
53
|
+
```
|
54
|
+
{% endcode %}
|
55
|
+
|
56
|
+
### Retrieving nested fields
|
57
|
+
|
58
|
+
Some fields have nested attributes, and you need to specify the attributes to retrieve that field; else, the API will respond with an error.
|
59
|
+
|
60
|
+
{% code lineNumbers="true" %}
|
61
|
+
```ruby
|
62
|
+
client = Monday::Client.new(token: <AUTH_TOKEN>)
|
63
|
+
|
64
|
+
board_id = 789
|
65
|
+
select = [
|
66
|
+
"id",
|
67
|
+
"name",
|
68
|
+
{
|
69
|
+
creator: %w[id name email is_admin]
|
70
|
+
}
|
71
|
+
]
|
72
|
+
|
73
|
+
response = client.delete_board(board_id, select: select)
|
74
|
+
|
75
|
+
puts response.body
|
76
|
+
```
|
77
|
+
{% endcode %}
|
78
|
+
|
79
|
+
You can find the list of all the available fields for boards [here](https://developer.monday.com/api-reference/docs/board-view-queries#fields).
|
@@ -0,0 +1,87 @@
|
|
1
|
+
# #delete\_board\_subscribers
|
2
|
+
|
3
|
+
The `delete_board_subscribers` mutation will allow you to delete subscribers from a board.
|
4
|
+
|
5
|
+
### Basic usage
|
6
|
+
|
7
|
+
This method accepts two required parameters - `board_id` and `user_ids`.
|
8
|
+
|
9
|
+
{% code lineNumbers="true" %}
|
10
|
+
```ruby
|
11
|
+
client = Monday::Client.new(token: <AUTH_TOKEN>)
|
12
|
+
|
13
|
+
board_id = 789
|
14
|
+
user_ids = [123, 456]
|
15
|
+
response = client.delete_board_subscribers(board_id, user_ids)
|
16
|
+
|
17
|
+
puts response.body
|
18
|
+
```
|
19
|
+
{% endcode %}
|
20
|
+
|
21
|
+
This will delete `123` and `456` subscribers from the `789` board.
|
22
|
+
|
23
|
+
This will return the deleted subscriber'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_subscribers_from_board": [
|
32
|
+
{
|
33
|
+
"id": 123
|
34
|
+
},
|
35
|
+
{
|
36
|
+
"id": 456
|
37
|
+
}
|
38
|
+
]
|
39
|
+
},
|
40
|
+
"account_id": 123
|
41
|
+
}
|
42
|
+
```
|
43
|
+
{% endcode %}
|
44
|
+
|
45
|
+
### Customizing fields to retrieve
|
46
|
+
|
47
|
+
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.
|
48
|
+
|
49
|
+
{% code lineNumbers="true" %}
|
50
|
+
```ruby
|
51
|
+
client = Monday::Client.new(token: <AUTH_TOKEN>)
|
52
|
+
|
53
|
+
board_id = 789
|
54
|
+
user_ids = [123, 456]
|
55
|
+
select = %w[id name is_guest is_admin]
|
56
|
+
|
57
|
+
response = client.delete_board_subscribers(board_id, user_ids, select: select)
|
58
|
+
|
59
|
+
puts response.body
|
60
|
+
```
|
61
|
+
{% endcode %}
|
62
|
+
|
63
|
+
### Retrieving nested fields
|
64
|
+
|
65
|
+
Some fields have nested attributes, and you need to specify the attributes to retrieve that field; else, the API will respond with an error.
|
66
|
+
|
67
|
+
{% code lineNumbers="true" %}
|
68
|
+
```ruby
|
69
|
+
client = Monday::Client.new(token: <AUTH_TOKEN>)
|
70
|
+
|
71
|
+
board_id = 789
|
72
|
+
user_ids = [123, 456]
|
73
|
+
select = [
|
74
|
+
"id",
|
75
|
+
"name",
|
76
|
+
{
|
77
|
+
account: %w[id slug tier]
|
78
|
+
}
|
79
|
+
]
|
80
|
+
|
81
|
+
response = client.delete_board_subscribers(board_id, user_ids, select: select)
|
82
|
+
|
83
|
+
puts response.body
|
84
|
+
```
|
85
|
+
{% endcode %}
|
86
|
+
|
87
|
+
You can find the list of all the available fields for boards [here](https://developer.monday.com/api-reference/docs/board-view-queries#fields).
|
@@ -0,0 +1,94 @@
|
|
1
|
+
# #duplicate\_board
|
2
|
+
|
3
|
+
The `duplicate_board` mutation will allow you to duplicate a board with all its items and groups to a workspace or folder of your choice.
|
4
|
+
|
5
|
+
### Basic usage
|
6
|
+
|
7
|
+
This method accepts various arguments to duplicate a board. You can find the complete list of arguments [here](https://developer.monday.com/api-reference/docs/boards#arguments-2).
|
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: 456,
|
17
|
+
duplicate_type: "duplicate_board_with_structure"
|
18
|
+
}
|
19
|
+
response = client.duplicate_board(args: args)
|
20
|
+
|
21
|
+
puts response.body
|
22
|
+
```
|
23
|
+
{% endcode %}
|
24
|
+
|
25
|
+
This will duplicate the board `456`.
|
26
|
+
|
27
|
+
This will return the boards' ID, name and description fields by default.
|
28
|
+
|
29
|
+
The response body from the above query would be as follows:
|
30
|
+
|
31
|
+
{% code lineNumbers="true" %}
|
32
|
+
```json
|
33
|
+
{
|
34
|
+
"data": {
|
35
|
+
"duplicate_board": {
|
36
|
+
"board": {
|
37
|
+
"id": "789",
|
38
|
+
"name": "Duplicate of New test board",
|
39
|
+
"description": "The description for the board"
|
40
|
+
}
|
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: 456,
|
58
|
+
duplicate_type: "duplicate_board_with_structure"
|
59
|
+
}
|
60
|
+
select = %w[id name description items_count permissions]
|
61
|
+
|
62
|
+
response = client.duplicate_board(args: args, select: select)
|
63
|
+
|
64
|
+
puts response.body
|
65
|
+
```
|
66
|
+
{% endcode %}
|
67
|
+
|
68
|
+
### Retrieving nested fields
|
69
|
+
|
70
|
+
Some fields have nested attributes, and you need to specify the attributes to retrieve that field; else, the API will respond with an error.
|
71
|
+
|
72
|
+
{% code lineNumbers="true" %}
|
73
|
+
```ruby
|
74
|
+
client = Monday::Client.new(token: <AUTH_TOKEN>)
|
75
|
+
|
76
|
+
args = {
|
77
|
+
board_id: 456,
|
78
|
+
duplicate_type: "duplicate_board_with_structure"
|
79
|
+
}
|
80
|
+
select = [
|
81
|
+
"id",
|
82
|
+
"name",
|
83
|
+
{
|
84
|
+
creator: %w[id name email is_admin]
|
85
|
+
}
|
86
|
+
]
|
87
|
+
|
88
|
+
response = client.duplicate_board(args: args, select: select)
|
89
|
+
|
90
|
+
puts response.body
|
91
|
+
```
|
92
|
+
{% endcode %}
|
93
|
+
|
94
|
+
You can find the list of all the available fields for boards [here](https://developer.monday.com/api-reference/docs/board-view-queries#fields).
|