line
stmt
bran
cond
sub
pod
time
code
1
package Net::Async::Slack::Commands;
2
3
2
2
355792
use strict;
2
4
2
88
4
2
2
10
use warnings;
2
4
2
182
5
6
our $VERSION = '0.015'; # VERSION
7
our $AUTHORITY = 'cpan:TEAM'; # AUTHORITY
8
9
2
2
1291
use utf8;
2
609
2
13
10
11
=encoding utf8
12
13
=head1 NAME
14
15
Net::Async::Slack::Commands - supported API methods for L
16
17
=head1 DESCRIPTION
18
19
These are available on the top-level L instance, and are autogenerated
20
from the API specification.
21
22
=cut
23
24
2
2
1127
use Future::AsyncAwait;
2
28582
2
13
25
2
2
1179
use JSON::MaybeUTF8 qw(:v1);
2
28807
2
81396
26
27
=head2 admin_apps_approve
28
29
Approve an app for installation on a workspace.
30
31
L
32
33
Takes the following named parameters:
34
35
=over 4
36
37
=item * C - The id of the app to approve. (string, optional)
38
39
=item * C - The id of the request to approve. (string, optional)
40
41
=item * C - (string, optional)
42
43
=back
44
45
Resolves to a structure representing the response.
46
47
=cut
48
49
0
0
1
async sub admin_apps_approve {
50
0
my ($self, %args) = @_;
51
0
my $uri = $self->endpoint(
52
'admin_apps_approve',
53
);
54
my $content = encode_json_utf8({
55
0
%args{grep { exists $args{$_} } qw(app_id request_id team_id)}
0
56
});
57
0
my ($res) = await $self->http_post(
58
$uri,
59
$content,
60
content_type => 'application/json; charset=utf-8',
61
);
62
0
0
die $res unless $res->{ok};
63
0
return $res;
64
}
65
66
67
=head2 admin_apps_approved_list
68
69
List approved apps for an org or workspace.
70
71
L
72
73
Takes the following named parameters:
74
75
=over 4
76
77
=item * C - The maximum number of items to return. Must be between 1 - 1000 both inclusive. (integer, optional)
78
79
=item * C - Set `cursor` to `next_cursor` returned by the previous call to list items in the next page (string, optional)
80
81
=item * C - (string, optional)
82
83
=item * C - (string, optional)
84
85
=back
86
87
Resolves to a structure representing the response.
88
89
=cut
90
91
0
0
1
async sub admin_apps_approved_list {
92
0
my ($self, %args) = @_;
93
my $uri = $self->endpoint(
94
'admin_apps_approved_list',
95
0
%args{grep { exists $args{$_} } qw(limit cursor team_id enterprise_id)}
0
96
);
97
0
my ($res) = await $self->http_get(
98
$uri,
99
);
100
0
0
die $res unless $res->{ok};
101
0
return $res;
102
}
103
104
105
=head2 admin_apps_requests_list
106
107
List app requests for a team/workspace.
108
109
L
110
111
Takes the following named parameters:
112
113
=over 4
114
115
=item * C - The maximum number of items to return. Must be between 1 - 1000 both inclusive. (integer, optional)
116
117
=item * C - Set `cursor` to `next_cursor` returned by the previous call to list items in the next page (string, optional)
118
119
=item * C - (string, optional)
120
121
=back
122
123
Resolves to a structure representing the response.
124
125
=cut
126
127
0
0
1
async sub admin_apps_requests_list {
128
0
my ($self, %args) = @_;
129
my $uri = $self->endpoint(
130
'admin_apps_requests_list',
131
0
%args{grep { exists $args{$_} } qw(limit cursor team_id)}
0
132
);
133
0
my ($res) = await $self->http_get(
134
$uri,
135
);
136
0
0
die $res unless $res->{ok};
137
0
return $res;
138
}
139
140
141
=head2 admin_apps_restrict
142
143
Restrict an app for installation on a workspace.
144
145
L
146
147
Takes the following named parameters:
148
149
=over 4
150
151
=item * C - The id of the app to restrict. (string, optional)
152
153
=item * C - The id of the request to restrict. (string, optional)
154
155
=item * C - (string, optional)
156
157
=back
158
159
Resolves to a structure representing the response.
160
161
=cut
162
163
0
0
1
async sub admin_apps_restrict {
164
0
my ($self, %args) = @_;
165
0
my $uri = $self->endpoint(
166
'admin_apps_restrict',
167
);
168
my $content = encode_json_utf8({
169
0
%args{grep { exists $args{$_} } qw(app_id request_id team_id)}
0
170
});
171
0
my ($res) = await $self->http_post(
172
$uri,
173
$content,
174
content_type => 'application/json; charset=utf-8',
175
);
176
0
0
die $res unless $res->{ok};
177
0
return $res;
178
}
179
180
181
=head2 admin_apps_restricted_list
182
183
List restricted apps for an org or workspace.
184
185
L
186
187
Takes the following named parameters:
188
189
=over 4
190
191
=item * C - The maximum number of items to return. Must be between 1 - 1000 both inclusive. (integer, optional)
192
193
=item * C - Set `cursor` to `next_cursor` returned by the previous call to list items in the next page (string, optional)
194
195
=item * C - (string, optional)
196
197
=item * C - (string, optional)
198
199
=back
200
201
Resolves to a structure representing the response.
202
203
=cut
204
205
0
0
1
async sub admin_apps_restricted_list {
206
0
my ($self, %args) = @_;
207
my $uri = $self->endpoint(
208
'admin_apps_restricted_list',
209
0
%args{grep { exists $args{$_} } qw(limit cursor team_id enterprise_id)}
0
210
);
211
0
my ($res) = await $self->http_get(
212
$uri,
213
);
214
0
0
die $res unless $res->{ok};
215
0
return $res;
216
}
217
218
219
=head2 admin_conversations_archive
220
221
Archive a public or private channel.
222
223
L
224
225
Takes the following named parameters:
226
227
=over 4
228
229
=item * C - The channel to archive. (string, required)
230
231
=back
232
233
Resolves to a structure representing the response.
234
235
=cut
236
237
0
0
1
async sub admin_conversations_archive {
238
0
my ($self, %args) = @_;
239
0
my $uri = $self->endpoint(
240
'admin_conversations_archive',
241
);
242
my $content = encode_json_utf8({
243
0
%args{grep { exists $args{$_} } qw(channel_id)}
0
244
});
245
0
my ($res) = await $self->http_post(
246
$uri,
247
$content,
248
content_type => 'application/json; charset=utf-8',
249
);
250
0
0
die $res unless $res->{ok};
251
0
return $res;
252
}
253
254
255
=head2 admin_conversations_convert_to_private
256
257
Convert a public channel to a private channel.
258
259
L
260
261
Takes the following named parameters:
262
263
=over 4
264
265
=item * C - The channel to convert to private. (string, required)
266
267
=back
268
269
Resolves to a structure representing the response.
270
271
=cut
272
273
0
0
1
async sub admin_conversations_convert_to_private {
274
0
my ($self, %args) = @_;
275
0
my $uri = $self->endpoint(
276
'admin_conversations_convert_to_private',
277
);
278
my $content = encode_json_utf8({
279
0
%args{grep { exists $args{$_} } qw(channel_id)}
0
280
});
281
0
my ($res) = await $self->http_post(
282
$uri,
283
$content,
284
content_type => 'application/json; charset=utf-8',
285
);
286
0
0
die $res unless $res->{ok};
287
0
return $res;
288
}
289
290
291
=head2 admin_conversations_create
292
293
Create a public or private channel-based conversation.
294
295
L
296
297
Takes the following named parameters:
298
299
=over 4
300
301
=item * C - Name of the public or private channel to create. (string, required)
302
303
=item * C - Description of the public or private channel to create. (string, optional)
304
305
=item * C - When `true`, creates a private channel instead of a public channel (boolean, required)
306
307
=item * C - When `true`, the channel will be available org-wide. Note: if the channel is not `org_wide=true`, you must specify a `team_id` for this channel (boolean, optional)
308
309
=item * C - The workspace to create the channel in. Note: this argument is required unless you set `org_wide=true`. (string, optional)
310
311
=back
312
313
Resolves to a structure representing the response.
314
315
=cut
316
317
0
0
1
async sub admin_conversations_create {
318
0
my ($self, %args) = @_;
319
0
my $uri = $self->endpoint(
320
'admin_conversations_create',
321
);
322
my $content = encode_json_utf8({
323
0
%args{grep { exists $args{$_} } qw(name description is_private org_wide team_id)}
0
324
});
325
0
my ($res) = await $self->http_post(
326
$uri,
327
$content,
328
content_type => 'application/json; charset=utf-8',
329
);
330
0
0
die $res unless $res->{ok};
331
0
return $res;
332
}
333
334
335
=head2 admin_conversations_delete
336
337
Delete a public or private channel.
338
339
L
340
341
Takes the following named parameters:
342
343
=over 4
344
345
=item * C - The channel to delete. (string, required)
346
347
=back
348
349
Resolves to a structure representing the response.
350
351
=cut
352
353
0
0
1
async sub admin_conversations_delete {
354
0
my ($self, %args) = @_;
355
0
my $uri = $self->endpoint(
356
'admin_conversations_delete',
357
);
358
my $content = encode_json_utf8({
359
0
%args{grep { exists $args{$_} } qw(channel_id)}
0
360
});
361
0
my ($res) = await $self->http_post(
362
$uri,
363
$content,
364
content_type => 'application/json; charset=utf-8',
365
);
366
0
0
die $res unless $res->{ok};
367
0
return $res;
368
}
369
370
371
=head2 admin_conversations_disconnect_shared
372
373
Disconnect a connected channel from one or more workspaces.
374
375
L
376
377
Takes the following named parameters:
378
379
=over 4
380
381
=item * C - The channel to be disconnected from some workspaces. (string, required)
382
383
=item * C - The team to be removed from the channel. Currently only a single team id can be specified. (string, optional)
384
385
=back
386
387
Resolves to a structure representing the response.
388
389
=cut
390
391
0
0
1
async sub admin_conversations_disconnect_shared {
392
0
my ($self, %args) = @_;
393
0
my $uri = $self->endpoint(
394
'admin_conversations_disconnect_shared',
395
);
396
my $content = encode_json_utf8({
397
0
%args{grep { exists $args{$_} } qw(channel_id leaving_team_ids)}
0
398
});
399
0
my ($res) = await $self->http_post(
400
$uri,
401
$content,
402
content_type => 'application/json; charset=utf-8',
403
);
404
0
0
die $res unless $res->{ok};
405
0
return $res;
406
}
407
408
409
=head2 admin_conversations_ekm_list_original_connected_channel_info
410
411
List all disconnected channels—i.e., channels that were once connected to other workspaces and then disconnected—and the corresponding original channel IDs for key revocation with EKM.
412
413
L
414
415
Takes the following named parameters:
416
417
=over 4
418
419
=item * C - A comma-separated list of channels to filter to. (string, optional)
420
421
=item * C - A comma-separated list of the workspaces to which the channels you would like returned belong. (string, optional)
422
423
=item * C - The maximum number of items to return. Must be between 1 - 1000 both inclusive. (integer, optional)
424
425
=item * C - Set `cursor` to `next_cursor` returned by the previous call to list items in the next page. (string, optional)
426
427
=back
428
429
Resolves to a structure representing the response.
430
431
=cut
432
433
0
0
1
async sub admin_conversations_ekm_list_original_connected_channel_info {
434
0
my ($self, %args) = @_;
435
my $uri = $self->endpoint(
436
'admin_conversations_ekm_list_original_connected_channel_info',
437
0
%args{grep { exists $args{$_} } qw(channel_ids team_ids limit cursor)}
0
438
);
439
0
my ($res) = await $self->http_get(
440
$uri,
441
);
442
0
0
die $res unless $res->{ok};
443
0
return $res;
444
}
445
446
447
=head2 admin_conversations_get_conversation_prefs
448
449
Get conversation preferences for a public or private channel.
450
451
L
452
453
Takes the following named parameters:
454
455
=over 4
456
457
=item * C - The channel to get preferences for. (string, required)
458
459
=back
460
461
Resolves to a structure representing the response.
462
463
=cut
464
465
0
0
1
async sub admin_conversations_get_conversation_prefs {
466
0
my ($self, %args) = @_;
467
0
my $uri = $self->endpoint(
468
'admin_conversations_get_conversation_prefs',
469
);
470
my $content = encode_json_utf8({
471
0
%args{grep { exists $args{$_} } qw(channel_id)}
0
472
});
473
0
my ($res) = await $self->http_post(
474
$uri,
475
$content,
476
content_type => 'application/json; charset=utf-8',
477
);
478
0
0
die $res unless $res->{ok};
479
0
return $res;
480
}
481
482
483
=head2 admin_conversations_get_teams
484
485
Get all the workspaces a given public or private channel is connected to within this Enterprise org.
486
487
L
488
489
Takes the following named parameters:
490
491
=over 4
492
493
=item * C - The channel to determine connected workspaces within the organization for. (string, required)
494
495
=item * C - Set `cursor` to `next_cursor` returned by the previous call to list items in the next page (string, optional)
496
497
=item * C - The maximum number of items to return. Must be between 1 - 1000 both inclusive. (integer, optional)
498
499
=back
500
501
Resolves to a structure representing the response.
502
503
=cut
504
505
0
0
1
async sub admin_conversations_get_teams {
506
0
my ($self, %args) = @_;
507
0
my $uri = $self->endpoint(
508
'admin_conversations_get_teams',
509
);
510
my $content = encode_json_utf8({
511
0
%args{grep { exists $args{$_} } qw(channel_id cursor limit)}
0
512
});
513
0
my ($res) = await $self->http_post(
514
$uri,
515
$content,
516
content_type => 'application/json; charset=utf-8',
517
);
518
0
0
die $res unless $res->{ok};
519
0
return $res;
520
}
521
522
523
=head2 admin_conversations_invite
524
525
Invite a user to a public or private channel.
526
527
L
528
529
Takes the following named parameters:
530
531
=over 4
532
533
=item * C - The users to invite. (string, required)
534
535
=item * C - The channel that the users will be invited to. (string, required)
536
537
=back
538
539
Resolves to a structure representing the response.
540
541
=cut
542
543
0
0
1
async sub admin_conversations_invite {
544
0
my ($self, %args) = @_;
545
0
my $uri = $self->endpoint(
546
'admin_conversations_invite',
547
);
548
my $content = encode_json_utf8({
549
0
%args{grep { exists $args{$_} } qw(user_ids channel_id)}
0
550
});
551
0
my ($res) = await $self->http_post(
552
$uri,
553
$content,
554
content_type => 'application/json; charset=utf-8',
555
);
556
0
0
die $res unless $res->{ok};
557
0
return $res;
558
}
559
560
561
=head2 admin_conversations_rename
562
563
Rename a public or private channel.
564
565
L
566
567
Takes the following named parameters:
568
569
=over 4
570
571
=item * C - The channel to rename. (string, required)
572
573
=item * C - (string, required)
574
575
=back
576
577
Resolves to a structure representing the response.
578
579
=cut
580
581
0
0
1
async sub admin_conversations_rename {
582
0
my ($self, %args) = @_;
583
0
my $uri = $self->endpoint(
584
'admin_conversations_rename',
585
);
586
my $content = encode_json_utf8({
587
0
%args{grep { exists $args{$_} } qw(channel_id name)}
0
588
});
589
0
my ($res) = await $self->http_post(
590
$uri,
591
$content,
592
content_type => 'application/json; charset=utf-8',
593
);
594
0
0
die $res unless $res->{ok};
595
0
return $res;
596
}
597
598
599
=head2 admin_conversations_restrict_access_add_group
600
601
Add an allowlist of IDP groups for accessing a channel
602
603
L
604
605
Takes the following named parameters:
606
607
=over 4
608
609
=item * C - The workspace where the channel exists. This argument is required for channels only tied to one workspace, and optional for channels that are shared across an organization. (string, optional)
610
611
=item * C - The [IDP Group](https://slack.com/help/articles/115001435788-Connect-identity-provider-groups-to-your-Enterprise-Grid-org) ID to be an allowlist for the private channel. (string, required)
612
613
=item * C - The channel to link this group to. (string, required)
614
615
=back
616
617
Resolves to a structure representing the response.
618
619
=cut
620
621
0
0
1
async sub admin_conversations_restrict_access_add_group {
622
0
my ($self, %args) = @_;
623
0
my $uri = $self->endpoint(
624
'admin_conversations_restrict_access_add_group',
625
);
626
my $content = encode_json_utf8({
627
0
%args{grep { exists $args{$_} } qw(team_id group_id channel_id)}
0
628
});
629
0
my ($res) = await $self->http_post(
630
$uri,
631
$content,
632
content_type => 'application/json; charset=utf-8',
633
);
634
0
0
die $res unless $res->{ok};
635
0
return $res;
636
}
637
638
639
=head2 admin_conversations_restrict_access_list_groups
640
641
List all IDP Groups linked to a channel
642
643
L
644
645
Takes the following named parameters:
646
647
=over 4
648
649
=item * C - (string, required)
650
651
=item * C - The workspace where the channel exists. This argument is required for channels only tied to one workspace, and optional for channels that are shared across an organization. (string, optional)
652
653
=back
654
655
Resolves to a structure representing the response.
656
657
=cut
658
659
0
0
1
async sub admin_conversations_restrict_access_list_groups {
660
0
my ($self, %args) = @_;
661
my $uri = $self->endpoint(
662
'admin_conversations_restrict_access_list_groups',
663
0
%args{grep { exists $args{$_} } qw(channel_id team_id)}
0
664
);
665
0
my ($res) = await $self->http_get(
666
$uri,
667
);
668
0
0
die $res unless $res->{ok};
669
0
return $res;
670
}
671
672
673
=head2 admin_conversations_restrict_access_remove_group
674
675
Remove a linked IDP group linked from a private channel
676
677
L
678
679
Takes the following named parameters:
680
681
=over 4
682
683
=item * C - The workspace where the channel exists. This argument is required for channels only tied to one workspace, and optional for channels that are shared across an organization. (string, required)
684
685
=item * C - The [IDP Group](https://slack.com/help/articles/115001435788-Connect-identity-provider-groups-to-your-Enterprise-Grid-org) ID to remove from the private channel. (string, required)
686
687
=item * C - The channel to remove the linked group from. (string, required)
688
689
=back
690
691
Resolves to a structure representing the response.
692
693
=cut
694
695
0
0
1
async sub admin_conversations_restrict_access_remove_group {
696
0
my ($self, %args) = @_;
697
0
my $uri = $self->endpoint(
698
'admin_conversations_restrict_access_remove_group',
699
);
700
my $content = encode_json_utf8({
701
0
%args{grep { exists $args{$_} } qw(team_id group_id channel_id)}
0
702
});
703
0
my ($res) = await $self->http_post(
704
$uri,
705
$content,
706
content_type => 'application/json; charset=utf-8',
707
);
708
0
0
die $res unless $res->{ok};
709
0
return $res;
710
}
711
712
713
=head2 admin_conversations_search
714
715
Search for public or private channels in an Enterprise organization.
716
717
L
718
719
Takes the following named parameters:
720
721
=over 4
722
723
=item * C - Comma separated string of team IDs, signifying the workspaces to search through. (string, optional)
724
725
=item * C - Name of the the channel to query by. (string, optional)
726
727
=item * C - Maximum number of items to be returned. Must be between 1 - 20 both inclusive. Default is 10. (integer, optional)
728
729
=item * C - Set `cursor` to `next_cursor` returned by the previous call to list items in the next page. (string, optional)
730
731
=item * C - The type of channel to include or exclude in the search. For example `private` will search private channels, while `private_exclude` will exclude them. For a full list of types, check the [Types section](#types). (string, optional)
732
733
=item * C - Possible values are `relevant` (search ranking based on what we think is closest), `name` (alphabetical), `member_count` (number of users in the channel), and `created` (date channel was created). You can optionally pair this with the `sort_dir` arg to change how it is sorted (string, optional)
734
735
=item * C - Sort direction. Possible values are `asc` for ascending order like (1, 2, 3) or (a, b, c), and `desc` for descending order like (3, 2, 1) or (c, b, a) (string, optional)
736
737
=back
738
739
Resolves to a structure representing the response.
740
741
=cut
742
743
0
0
1
async sub admin_conversations_search {
744
0
my ($self, %args) = @_;
745
0
my $uri = $self->endpoint(
746
'admin_conversations_search',
747
);
748
my $content = encode_json_utf8({
749
0
%args{grep { exists $args{$_} } qw(team_ids query limit cursor search_channel_types sort sort_dir)}
0
750
});
751
0
my ($res) = await $self->http_post(
752
$uri,
753
$content,
754
content_type => 'application/json; charset=utf-8',
755
);
756
0
return $res;
757
}
758
759
760
=head2 admin_conversations_set_conversation_prefs
761
762
Set the posting permissions for a public or private channel.
763
764
L
765
766
Takes the following named parameters:
767
768
=over 4
769
770
=item * C - The channel to set the prefs for (string, required)
771
772
=item * C - The prefs for this channel in a stringified JSON format. (string, required)
773
774
=back
775
776
Resolves to a structure representing the response.
777
778
=cut
779
780
0
0
1
async sub admin_conversations_set_conversation_prefs {
781
0
my ($self, %args) = @_;
782
0
my $uri = $self->endpoint(
783
'admin_conversations_set_conversation_prefs',
784
);
785
my $content = encode_json_utf8({
786
0
%args{grep { exists $args{$_} } qw(channel_id prefs)}
0
787
});
788
0
my ($res) = await $self->http_post(
789
$uri,
790
$content,
791
content_type => 'application/json; charset=utf-8',
792
);
793
0
0
die $res unless $res->{ok};
794
0
return $res;
795
}
796
797
798
=head2 admin_conversations_set_teams
799
800
Set the workspaces in an Enterprise grid org that connect to a public or private channel.
801
802
L
803
804
Takes the following named parameters:
805
806
=over 4
807
808
=item * C - The encoded `channel_id` to add or remove to workspaces. (string, required)
809
810
=item * C - The workspace to which the channel belongs. Omit this argument if the channel is a cross-workspace shared channel. (string, optional)
811
812
=item * C - A comma-separated list of workspaces to which the channel should be shared. Not required if the channel is being shared org-wide. (string, optional)
813
814
=item * C - True if channel has to be converted to an org channel (boolean, optional)
815
816
=back
817
818
Resolves to a structure representing the response.
819
820
=cut
821
822
0
0
1
async sub admin_conversations_set_teams {
823
0
my ($self, %args) = @_;
824
0
my $uri = $self->endpoint(
825
'admin_conversations_set_teams',
826
);
827
my $content = encode_json_utf8({
828
0
%args{grep { exists $args{$_} } qw(channel_id team_id target_team_ids org_channel)}
0
829
});
830
0
my ($res) = await $self->http_post(
831
$uri,
832
$content,
833
content_type => 'application/json; charset=utf-8',
834
);
835
0
0
die $res unless $res->{ok};
836
0
return $res;
837
}
838
839
840
=head2 admin_conversations_unarchive
841
842
Unarchive a public or private channel.
843
844
L
845
846
Takes the following named parameters:
847
848
=over 4
849
850
=item * C - The channel to unarchive. (string, required)
851
852
=back
853
854
Resolves to a structure representing the response.
855
856
=cut
857
858
0
0
1
async sub admin_conversations_unarchive {
859
0
my ($self, %args) = @_;
860
0
my $uri = $self->endpoint(
861
'admin_conversations_unarchive',
862
);
863
my $content = encode_json_utf8({
864
0
%args{grep { exists $args{$_} } qw(channel_id)}
0
865
});
866
0
my ($res) = await $self->http_post(
867
$uri,
868
$content,
869
content_type => 'application/json; charset=utf-8',
870
);
871
0
0
die $res unless $res->{ok};
872
0
return $res;
873
}
874
875
876
=head2 admin_emoji_add
877
878
Add an emoji.
879
880
L
881
882
Takes the following named parameters:
883
884
=over 4
885
886
=item * C - The name of the emoji to be removed. Colons (`:myemoji:`) around the value are not required, although they may be included. (string, required)
887
888
=item * C - The URL of a file to use as an image for the emoji. Square images under 128KB and with transparent backgrounds work best. (string, required)
889
890
=back
891
892
Resolves to a structure representing the response.
893
894
=cut
895
896
0
0
1
async sub admin_emoji_add {
897
0
my ($self, %args) = @_;
898
0
my $uri = $self->endpoint(
899
'admin_emoji_add',
900
);
901
my $content = encode_json_utf8({
902
0
%args{grep { exists $args{$_} } qw(name url)}
0
903
});
904
0
my ($res) = await $self->http_post(
905
$uri,
906
$content,
907
content_type => 'application/json; charset=utf-8',
908
);
909
0
0
die $res unless $res->{ok};
910
0
return $res;
911
}
912
913
914
=head2 admin_emoji_add_alias
915
916
Add an emoji alias.
917
918
L
919
920
Takes the following named parameters:
921
922
=over 4
923
924
=item * C - The name of the emoji to be aliased. Colons (`:myemoji:`) around the value are not required, although they may be included. (string, required)
925
926
=item * C - The alias of the emoji. (string, required)
927
928
=back
929
930
Resolves to a structure representing the response.
931
932
=cut
933
934
0
0
1
async sub admin_emoji_add_alias {
935
0
my ($self, %args) = @_;
936
0
my $uri = $self->endpoint(
937
'admin_emoji_add_alias',
938
);
939
my $content = encode_json_utf8({
940
0
%args{grep { exists $args{$_} } qw(name alias_for)}
0
941
});
942
0
my ($res) = await $self->http_post(
943
$uri,
944
$content,
945
content_type => 'application/json; charset=utf-8',
946
);
947
0
0
die $res unless $res->{ok};
948
0
return $res;
949
}
950
951
952
=head2 admin_emoji_list
953
954
List emoji for an Enterprise Grid organization.
955
956
L
957
958
Takes the following named parameters:
959
960
=over 4
961
962
=item * C - Set `cursor` to `next_cursor` returned by the previous call to list items in the next page (string, optional)
963
964
=item * C - The maximum number of items to return. Must be between 1 - 1000 both inclusive. (integer, optional)
965
966
=back
967
968
Resolves to a structure representing the response.
969
970
=cut
971
972
0
0
1
async sub admin_emoji_list {
973
0
my ($self, %args) = @_;
974
my $uri = $self->endpoint(
975
'admin_emoji_list',
976
0
%args{grep { exists $args{$_} } qw(cursor limit)}
0
977
);
978
0
my ($res) = await $self->http_get(
979
$uri,
980
);
981
0
0
die $res unless $res->{ok};
982
0
return $res;
983
}
984
985
986
=head2 admin_emoji_remove
987
988
Remove an emoji across an Enterprise Grid organization
989
990
L
991
992
Takes the following named parameters:
993
994
=over 4
995
996
=item * C - The name of the emoji to be removed. Colons (`:myemoji:`) around the value are not required, although they may be included. (string, required)
997
998
=back
999
1000
Resolves to a structure representing the response.
1001
1002
=cut
1003
1004
0
0
1
async sub admin_emoji_remove {
1005
0
my ($self, %args) = @_;
1006
0
my $uri = $self->endpoint(
1007
'admin_emoji_remove',
1008
);
1009
my $content = encode_json_utf8({
1010
0
%args{grep { exists $args{$_} } qw(name)}
0
1011
});
1012
0
my ($res) = await $self->http_post(
1013
$uri,
1014
$content,
1015
content_type => 'application/json; charset=utf-8',
1016
);
1017
0
0
die $res unless $res->{ok};
1018
0
return $res;
1019
}
1020
1021
1022
=head2 admin_emoji_rename
1023
1024
Rename an emoji.
1025
1026
L
1027
1028
Takes the following named parameters:
1029
1030
=over 4
1031
1032
=item * C - The name of the emoji to be renamed. Colons (`:myemoji:`) around the value are not required, although they may be included. (string, required)
1033
1034
=item * C - The new name of the emoji. (string, required)
1035
1036
=back
1037
1038
Resolves to a structure representing the response.
1039
1040
=cut
1041
1042
0
0
1
async sub admin_emoji_rename {
1043
0
my ($self, %args) = @_;
1044
0
my $uri = $self->endpoint(
1045
'admin_emoji_rename',
1046
);
1047
my $content = encode_json_utf8({
1048
0
%args{grep { exists $args{$_} } qw(name new_name)}
0
1049
});
1050
0
my ($res) = await $self->http_post(
1051
$uri,
1052
$content,
1053
content_type => 'application/json; charset=utf-8',
1054
);
1055
0
0
die $res unless $res->{ok};
1056
0
return $res;
1057
}
1058
1059
1060
=head2 admin_invite_requests_approve
1061
1062
Approve a workspace invite request.
1063
1064
L
1065
1066
Takes the following named parameters:
1067
1068
=over 4
1069
1070
=item * C - ID for the workspace where the invite request was made. (string, optional)
1071
1072
=item * C - ID of the request to invite. (string, required)
1073
1074
=back
1075
1076
Resolves to a structure representing the response.
1077
1078
=cut
1079
1080
0
0
1
async sub admin_invite_requests_approve {
1081
0
my ($self, %args) = @_;
1082
0
my $uri = $self->endpoint(
1083
'admin_invite_requests_approve',
1084
);
1085
my $content = encode_json_utf8({
1086
0
%args{grep { exists $args{$_} } qw(team_id invite_request_id)}
0
1087
});
1088
0
my ($res) = await $self->http_post(
1089
$uri,
1090
$content,
1091
content_type => 'application/json; charset=utf-8',
1092
);
1093
0
0
die $res unless $res->{ok};
1094
0
return $res;
1095
}
1096
1097
1098
=head2 admin_invite_requests_approved_list
1099
1100
List all approved workspace invite requests.
1101
1102
L
1103
1104
Takes the following named parameters:
1105
1106
=over 4
1107
1108
=item * C - ID for the workspace where the invite requests were made. (string, optional)
1109
1110
=item * C - Value of the `next_cursor` field sent as part of the previous API response (string, optional)
1111
1112
=item * C - The number of results that will be returned by the API on each invocation. Must be between 1 - 1000, both inclusive (integer, optional)
1113
1114
=back
1115
1116
Resolves to a structure representing the response.
1117
1118
=cut
1119
1120
0
0
1
async sub admin_invite_requests_approved_list {
1121
0
my ($self, %args) = @_;
1122
0
my $uri = $self->endpoint(
1123
'admin_invite_requests_approved_list',
1124
);
1125
my $content = encode_json_utf8({
1126
0
%args{grep { exists $args{$_} } qw(team_id cursor limit)}
0
1127
});
1128
0
my ($res) = await $self->http_post(
1129
$uri,
1130
$content,
1131
content_type => 'application/json; charset=utf-8',
1132
);
1133
0
0
die $res unless $res->{ok};
1134
0
return $res;
1135
}
1136
1137
1138
=head2 admin_invite_requests_denied_list
1139
1140
List all denied workspace invite requests.
1141
1142
L
1143
1144
Takes the following named parameters:
1145
1146
=over 4
1147
1148
=item * C - ID for the workspace where the invite requests were made. (string, optional)
1149
1150
=item * C - Value of the `next_cursor` field sent as part of the previous API response (string, optional)
1151
1152
=item * C - The number of results that will be returned by the API on each invocation. Must be between 1 - 1000 both inclusive (integer, optional)
1153
1154
=back
1155
1156
Resolves to a structure representing the response.
1157
1158
=cut
1159
1160
0
0
1
async sub admin_invite_requests_denied_list {
1161
0
my ($self, %args) = @_;
1162
0
my $uri = $self->endpoint(
1163
'admin_invite_requests_denied_list',
1164
);
1165
my $content = encode_json_utf8({
1166
0
%args{grep { exists $args{$_} } qw(team_id cursor limit)}
0
1167
});
1168
0
my ($res) = await $self->http_post(
1169
$uri,
1170
$content,
1171
content_type => 'application/json; charset=utf-8',
1172
);
1173
0
0
die $res unless $res->{ok};
1174
0
return $res;
1175
}
1176
1177
1178
=head2 admin_invite_requests_deny
1179
1180
Deny a workspace invite request.
1181
1182
L
1183
1184
Takes the following named parameters:
1185
1186
=over 4
1187
1188
=item * C - ID for the workspace where the invite request was made. (string, optional)
1189
1190
=item * C - ID of the request to invite. (string, required)
1191
1192
=back
1193
1194
Resolves to a structure representing the response.
1195
1196
=cut
1197
1198
0
0
1
async sub admin_invite_requests_deny {
1199
0
my ($self, %args) = @_;
1200
0
my $uri = $self->endpoint(
1201
'admin_invite_requests_deny',
1202
);
1203
my $content = encode_json_utf8({
1204
0
%args{grep { exists $args{$_} } qw(team_id invite_request_id)}
0
1205
});
1206
0
my ($res) = await $self->http_post(
1207
$uri,
1208
$content,
1209
content_type => 'application/json; charset=utf-8',
1210
);
1211
0
0
die $res unless $res->{ok};
1212
0
return $res;
1213
}
1214
1215
1216
=head2 admin_invite_requests_list
1217
1218
List all pending workspace invite requests.
1219
1220
L
1221
1222
Takes the following named parameters:
1223
1224
=over 4
1225
1226
=item * C - ID for the workspace where the invite requests were made. (string, optional)
1227
1228
=item * C - Value of the `next_cursor` field sent as part of the previous API response (string, optional)
1229
1230
=item * C - The number of results that will be returned by the API on each invocation. Must be between 1 - 1000, both inclusive (integer, optional)
1231
1232
=back
1233
1234
Resolves to a structure representing the response.
1235
1236
=cut
1237
1238
0
0
1
async sub admin_invite_requests_list {
1239
0
my ($self, %args) = @_;
1240
0
my $uri = $self->endpoint(
1241
'admin_invite_requests_list',
1242
);
1243
my $content = encode_json_utf8({
1244
0
%args{grep { exists $args{$_} } qw(team_id cursor limit)}
0
1245
});
1246
0
my ($res) = await $self->http_post(
1247
$uri,
1248
$content,
1249
content_type => 'application/json; charset=utf-8',
1250
);
1251
0
0
die $res unless $res->{ok};
1252
0
return $res;
1253
}
1254
1255
1256
=head2 admin_teams_admins_list
1257
1258
List all of the admins on a given workspace.
1259
1260
L
1261
1262
Takes the following named parameters:
1263
1264
=over 4
1265
1266
=item * C - The maximum number of items to return. (integer, optional)
1267
1268
=item * C - Set `cursor` to `next_cursor` returned by the previous call to list items in the next page. (string, optional)
1269
1270
=item * C - (string, required)
1271
1272
=back
1273
1274
Resolves to a structure representing the response.
1275
1276
=cut
1277
1278
0
0
1
async sub admin_teams_admins_list {
1279
0
my ($self, %args) = @_;
1280
my $uri = $self->endpoint(
1281
'admin_teams_admins_list',
1282
0
%args{grep { exists $args{$_} } qw(limit cursor team_id)}
0
1283
);
1284
0
my ($res) = await $self->http_get(
1285
$uri,
1286
);
1287
0
0
die $res unless $res->{ok};
1288
0
return $res;
1289
}
1290
1291
1292
=head2 admin_teams_create
1293
1294
Create an Enterprise team.
1295
1296
L
1297
1298
Takes the following named parameters:
1299
1300
=over 4
1301
1302
=item * C - Team domain (for example, slacksoftballteam). (string, required)
1303
1304
=item * C - Team name (for example, Slack Softball Team). (string, required)
1305
1306
=item * C - Description for the team. (string, optional)
1307
1308
=item * C - Who can join the team. A team's discoverability can be `open`, `closed`, `invite_only`, or `unlisted`. (string, optional)
1309
1310
=back
1311
1312
Resolves to a structure representing the response.
1313
1314
=cut
1315
1316
0
0
1
async sub admin_teams_create {
1317
0
my ($self, %args) = @_;
1318
0
my $uri = $self->endpoint(
1319
'admin_teams_create',
1320
);
1321
my $content = encode_json_utf8({
1322
0
%args{grep { exists $args{$_} } qw(team_domain team_name team_description team_discoverability)}
0
1323
});
1324
0
my ($res) = await $self->http_post(
1325
$uri,
1326
$content,
1327
content_type => 'application/json; charset=utf-8',
1328
);
1329
0
0
die $res unless $res->{ok};
1330
0
return $res;
1331
}
1332
1333
1334
=head2 admin_teams_list
1335
1336
List all teams on an Enterprise organization
1337
1338
L
1339
1340
Takes the following named parameters:
1341
1342
=over 4
1343
1344
=item * C - The maximum number of items to return. Must be between 1 - 100 both inclusive. (integer, optional)
1345
1346
=item * C - Set `cursor` to `next_cursor` returned by the previous call to list items in the next page. (string, optional)
1347
1348
=back
1349
1350
Resolves to a structure representing the response.
1351
1352
=cut
1353
1354
0
0
1
async sub admin_teams_list {
1355
0
my ($self, %args) = @_;
1356
0
my $uri = $self->endpoint(
1357
'admin_teams_list',
1358
);
1359
my $content = encode_json_utf8({
1360
0
%args{grep { exists $args{$_} } qw(limit cursor)}
0
1361
});
1362
0
my ($res) = await $self->http_post(
1363
$uri,
1364
$content,
1365
content_type => 'application/json; charset=utf-8',
1366
);
1367
0
0
die $res unless $res->{ok};
1368
0
return $res;
1369
}
1370
1371
1372
=head2 admin_teams_owners_list
1373
1374
List all of the owners on a given workspace.
1375
1376
L
1377
1378
Takes the following named parameters:
1379
1380
=over 4
1381
1382
=item * C - (string, required)
1383
1384
=item * C - The maximum number of items to return. Must be between 1 - 1000 both inclusive. (integer, optional)
1385
1386
=item * C - Set `cursor` to `next_cursor` returned by the previous call to list items in the next page. (string, optional)
1387
1388
=back
1389
1390
Resolves to a structure representing the response.
1391
1392
=cut
1393
1394
0
0
1
async sub admin_teams_owners_list {
1395
0
my ($self, %args) = @_;
1396
my $uri = $self->endpoint(
1397
'admin_teams_owners_list',
1398
0
%args{grep { exists $args{$_} } qw(team_id limit cursor)}
0
1399
);
1400
0
my ($res) = await $self->http_get(
1401
$uri,
1402
);
1403
0
0
die $res unless $res->{ok};
1404
0
return $res;
1405
}
1406
1407
1408
=head2 admin_teams_settings_info
1409
1410
Fetch information about settings in a workspace
1411
1412
L
1413
1414
Takes the following named parameters:
1415
1416
=over 4
1417
1418
=item * C - (string, required)
1419
1420
=back
1421
1422
Resolves to a structure representing the response.
1423
1424
=cut
1425
1426
0
0
1
async sub admin_teams_settings_info {
1427
0
my ($self, %args) = @_;
1428
0
my $uri = $self->endpoint(
1429
'admin_teams_settings_info',
1430
);
1431
my $content = encode_json_utf8({
1432
0
%args{grep { exists $args{$_} } qw(team_id)}
0
1433
});
1434
0
my ($res) = await $self->http_post(
1435
$uri,
1436
$content,
1437
content_type => 'application/json; charset=utf-8',
1438
);
1439
0
0
die $res unless $res->{ok};
1440
0
return $res;
1441
}
1442
1443
1444
=head2 admin_teams_settings_set_default_channels
1445
1446
Set the default channels of a workspace.
1447
1448
L
1449
1450
Takes the following named parameters:
1451
1452
=over 4
1453
1454
=item * C - ID for the workspace to set the default channel for. (string, required)
1455
1456
=item * C - An array of channel IDs. (string, required)
1457
1458
=back
1459
1460
Resolves to a structure representing the response.
1461
1462
=cut
1463
1464
0
0
1
async sub admin_teams_settings_set_default_channels {
1465
0
my ($self, %args) = @_;
1466
0
my $uri = $self->endpoint(
1467
'admin_teams_settings_set_default_channels',
1468
);
1469
my $content = encode_json_utf8({
1470
0
%args{grep { exists $args{$_} } qw(team_id channel_ids)}
0
1471
});
1472
0
my ($res) = await $self->http_post(
1473
$uri,
1474
$content,
1475
content_type => 'application/json; charset=utf-8',
1476
);
1477
0
0
die $res unless $res->{ok};
1478
0
return $res;
1479
}
1480
1481
1482
=head2 admin_teams_settings_set_description
1483
1484
Set the description of a given workspace.
1485
1486
L
1487
1488
Takes the following named parameters:
1489
1490
=over 4
1491
1492
=item * C - ID for the workspace to set the description for. (string, required)
1493
1494
=item * C - The new description for the workspace. (string, required)
1495
1496
=back
1497
1498
Resolves to a structure representing the response.
1499
1500
=cut
1501
1502
0
0
1
async sub admin_teams_settings_set_description {
1503
0
my ($self, %args) = @_;
1504
0
my $uri = $self->endpoint(
1505
'admin_teams_settings_set_description',
1506
);
1507
my $content = encode_json_utf8({
1508
0
%args{grep { exists $args{$_} } qw(team_id description)}
0
1509
});
1510
0
my ($res) = await $self->http_post(
1511
$uri,
1512
$content,
1513
content_type => 'application/json; charset=utf-8',
1514
);
1515
0
0
die $res unless $res->{ok};
1516
0
return $res;
1517
}
1518
1519
1520
=head2 admin_teams_settings_set_discoverability
1521
1522
An API method that allows admins to set the discoverability of a given workspace
1523
1524
L
1525
1526
Takes the following named parameters:
1527
1528
=over 4
1529
1530
=item * C - The ID of the workspace to set discoverability on. (string, required)
1531
1532
=item * C - This workspace's discovery setting. It must be set to one of `open`, `invite_only`, `closed`, or `unlisted`. (string, required)
1533
1534
=back
1535
1536
Resolves to a structure representing the response.
1537
1538
=cut
1539
1540
0
0
1
async sub admin_teams_settings_set_discoverability {
1541
0
my ($self, %args) = @_;
1542
0
my $uri = $self->endpoint(
1543
'admin_teams_settings_set_discoverability',
1544
);
1545
my $content = encode_json_utf8({
1546
0
%args{grep { exists $args{$_} } qw(team_id discoverability)}
0
1547
});
1548
0
my ($res) = await $self->http_post(
1549
$uri,
1550
$content,
1551
content_type => 'application/json; charset=utf-8',
1552
);
1553
0
0
die $res unless $res->{ok};
1554
0
return $res;
1555
}
1556
1557
1558
=head2 admin_teams_settings_set_icon
1559
1560
Sets the icon of a workspace.
1561
1562
L
1563
1564
Takes the following named parameters:
1565
1566
=over 4
1567
1568
=item * C - Image URL for the icon (string, required)
1569
1570
=item * C - ID for the workspace to set the icon for. (string, required)
1571
1572
=back
1573
1574
Resolves to a structure representing the response.
1575
1576
=cut
1577
1578
0
0
1
async sub admin_teams_settings_set_icon {
1579
0
my ($self, %args) = @_;
1580
0
my $uri = $self->endpoint(
1581
'admin_teams_settings_set_icon',
1582
);
1583
my $content = encode_json_utf8({
1584
0
%args{grep { exists $args{$_} } qw(image_url team_id)}
0
1585
});
1586
0
my ($res) = await $self->http_post(
1587
$uri,
1588
$content,
1589
content_type => 'application/json; charset=utf-8',
1590
);
1591
0
0
die $res unless $res->{ok};
1592
0
return $res;
1593
}
1594
1595
1596
=head2 admin_teams_settings_set_name
1597
1598
Set the name of a given workspace.
1599
1600
L
1601
1602
Takes the following named parameters:
1603
1604
=over 4
1605
1606
=item * C - ID for the workspace to set the name for. (string, required)
1607
1608
=item * C - The new name of the workspace. (string, required)
1609
1610
=back
1611
1612
Resolves to a structure representing the response.
1613
1614
=cut
1615
1616
0
0
1
async sub admin_teams_settings_set_name {
1617
0
my ($self, %args) = @_;
1618
0
my $uri = $self->endpoint(
1619
'admin_teams_settings_set_name',
1620
);
1621
my $content = encode_json_utf8({
1622
0
%args{grep { exists $args{$_} } qw(team_id name)}
0
1623
});
1624
0
my ($res) = await $self->http_post(
1625
$uri,
1626
$content,
1627
content_type => 'application/json; charset=utf-8',
1628
);
1629
0
0
die $res unless $res->{ok};
1630
0
return $res;
1631
}
1632
1633
1634
=head2 admin_usergroups_add_channels
1635
1636
Add one or more default channels to an IDP group.
1637
1638
L
1639
1640
Takes the following named parameters:
1641
1642
=over 4
1643
1644
=item * C - ID of the IDP group to add default channels for. (string, required)
1645
1646
=item * C - The workspace to add default channels in. (string, optional)
1647
1648
=item * C - Comma separated string of channel IDs. (string, required)
1649
1650
=back
1651
1652
Resolves to a structure representing the response.
1653
1654
=cut
1655
1656
0
0
1
async sub admin_usergroups_add_channels {
1657
0
my ($self, %args) = @_;
1658
0
my $uri = $self->endpoint(
1659
'admin_usergroups_add_channels',
1660
);
1661
my $content = encode_json_utf8({
1662
0
%args{grep { exists $args{$_} } qw(usergroup_id team_id channel_ids)}
0
1663
});
1664
0
my ($res) = await $self->http_post(
1665
$uri,
1666
$content,
1667
content_type => 'application/json; charset=utf-8',
1668
);
1669
0
0
die $res unless $res->{ok};
1670
0
return $res;
1671
}
1672
1673
1674
=head2 admin_usergroups_add_teams
1675
1676
Associate one or more default workspaces with an organization-wide IDP group.
1677
1678
L
1679
1680
Takes the following named parameters:
1681
1682
=over 4
1683
1684
=item * C - An encoded usergroup (IDP Group) ID. (string, required)
1685
1686
=item * C - A comma separated list of encoded team (workspace) IDs. Each workspace *MUST* belong to the organization associated with the token. (string, required)
1687
1688
=item * C - When `true`, this method automatically creates new workspace accounts for the IDP group members. (boolean, optional)
1689
1690
=back
1691
1692
Resolves to a structure representing the response.
1693
1694
=cut
1695
1696
0
0
1
async sub admin_usergroups_add_teams {
1697
0
my ($self, %args) = @_;
1698
0
my $uri = $self->endpoint(
1699
'admin_usergroups_add_teams',
1700
);
1701
my $content = encode_json_utf8({
1702
0
%args{grep { exists $args{$_} } qw(usergroup_id team_ids auto_provision)}
0
1703
});
1704
0
my ($res) = await $self->http_post(
1705
$uri,
1706
$content,
1707
content_type => 'application/json; charset=utf-8',
1708
);
1709
0
0
die $res unless $res->{ok};
1710
0
return $res;
1711
}
1712
1713
1714
=head2 admin_usergroups_list_channels
1715
1716
List the channels linked to an org-level IDP group (user group).
1717
1718
L
1719
1720
Takes the following named parameters:
1721
1722
=over 4
1723
1724
=item * C - ID of the IDP group to list default channels for. (string, required)
1725
1726
=item * C - ID of the the workspace. (string, optional)
1727
1728
=item * C - Flag to include or exclude the count of members per channel. (boolean, optional)
1729
1730
=back
1731
1732
Resolves to a structure representing the response.
1733
1734
=cut
1735
1736
0
0
1
async sub admin_usergroups_list_channels {
1737
0
my ($self, %args) = @_;
1738
0
my $uri = $self->endpoint(
1739
'admin_usergroups_list_channels',
1740
);
1741
my $content = encode_json_utf8({
1742
0
%args{grep { exists $args{$_} } qw(usergroup_id team_id include_num_members)}
0
1743
});
1744
0
my ($res) = await $self->http_post(
1745
$uri,
1746
$content,
1747
content_type => 'application/json; charset=utf-8',
1748
);
1749
0
0
die $res unless $res->{ok};
1750
0
return $res;
1751
}
1752
1753
1754
=head2 admin_usergroups_remove_channels
1755
1756
Remove one or more default channels from an org-level IDP group (user group).
1757
1758
L
1759
1760
Takes the following named parameters:
1761
1762
=over 4
1763
1764
=item * C - ID of the IDP Group (string, required)
1765
1766
=item * C - Comma-separated string of channel IDs (string, required)
1767
1768
=back
1769
1770
Resolves to a structure representing the response.
1771
1772
=cut
1773
1774
0
0
1
async sub admin_usergroups_remove_channels {
1775
0
my ($self, %args) = @_;
1776
0
my $uri = $self->endpoint(
1777
'admin_usergroups_remove_channels',
1778
);
1779
my $content = encode_json_utf8({
1780
0
%args{grep { exists $args{$_} } qw(usergroup_id channel_ids)}
0
1781
});
1782
0
my ($res) = await $self->http_post(
1783
$uri,
1784
$content,
1785
content_type => 'application/json; charset=utf-8',
1786
);
1787
0
0
die $res unless $res->{ok};
1788
0
return $res;
1789
}
1790
1791
1792
=head2 admin_users_assign
1793
1794
Add an Enterprise user to a workspace.
1795
1796
L
1797
1798
Takes the following named parameters:
1799
1800
=over 4
1801
1802
=item * C - The ID (`T1234`) of the workspace. (string, required)
1803
1804
=item * C - The ID of the user to add to the workspace. (string, required)
1805
1806
=item * C - True if user should be added to the workspace as a guest. (boolean, optional)
1807
1808
=item * C - True if user should be added to the workspace as a single-channel guest. (boolean, optional)
1809
1810
=item * C - Comma separated values of channel IDs to add user in the new workspace. (string, optional)
1811
1812
=back
1813
1814
Resolves to a structure representing the response.
1815
1816
=cut
1817
1818
0
0
1
async sub admin_users_assign {
1819
0
my ($self, %args) = @_;
1820
0
my $uri = $self->endpoint(
1821
'admin_users_assign',
1822
);
1823
my $content = encode_json_utf8({
1824
0
%args{grep { exists $args{$_} } qw(team_id user_id is_restricted is_ultra_restricted channel_ids)}
0
1825
});
1826
0
my ($res) = await $self->http_post(
1827
$uri,
1828
$content,
1829
content_type => 'application/json; charset=utf-8',
1830
);
1831
0
0
die $res unless $res->{ok};
1832
0
return $res;
1833
}
1834
1835
1836
=head2 admin_users_invite
1837
1838
Invite a user to a workspace.
1839
1840
L
1841
1842
Takes the following named parameters:
1843
1844
=over 4
1845
1846
=item * C - The ID (`T1234`) of the workspace. (string, required)
1847
1848
=item * C - The email address of the person to invite. (string, required)
1849
1850
=item * C - A comma-separated list of `channel_id`s for this user to join. At least one channel is required. (string, required)
1851
1852
=item * C - An optional message to send to the user in the invite email. (string, optional)
1853
1854
=item * C - Full name of the user. (string, optional)
1855
1856
=item * C - Allow this invite to be resent in the future if a user has not signed up yet. (default: false) (boolean, optional)
1857
1858
=item * C - Is this user a multi-channel guest user? (default: false) (boolean, optional)
1859
1860
=item * C - Is this user a single channel guest user? (default: false) (boolean, optional)
1861
1862
=item * C - Timestamp when guest account should be disabled. Only include this timestamp if you are inviting a guest user and you want their account to expire on a certain date. (string, optional)
1863
1864
=back
1865
1866
Resolves to a structure representing the response.
1867
1868
=cut
1869
1870
0
0
1
async sub admin_users_invite {
1871
0
my ($self, %args) = @_;
1872
0
my $uri = $self->endpoint(
1873
'admin_users_invite',
1874
);
1875
my $content = encode_json_utf8({
1876
0
%args{grep { exists $args{$_} } qw(team_id email channel_ids custom_message real_name resend is_restricted is_ultra_restricted guest_expiration_ts)}
0
1877
});
1878
0
my ($res) = await $self->http_post(
1879
$uri,
1880
$content,
1881
content_type => 'application/json; charset=utf-8',
1882
);
1883
0
0
die $res unless $res->{ok};
1884
0
return $res;
1885
}
1886
1887
1888
=head2 admin_users_list
1889
1890
List users on a workspace
1891
1892
L
1893
1894
Takes the following named parameters:
1895
1896
=over 4
1897
1898
=item * C - The ID (`T1234`) of the workspace. (string, required)
1899
1900
=item * C - Set `cursor` to `next_cursor` returned by the previous call to list items in the next page. (string, optional)
1901
1902
=item * C - Limit for how many users to be retrieved per page (integer, optional)
1903
1904
=back
1905
1906
Resolves to a structure representing the response.
1907
1908
=cut
1909
1910
0
0
1
async sub admin_users_list {
1911
0
my ($self, %args) = @_;
1912
0
my $uri = $self->endpoint(
1913
'admin_users_list',
1914
);
1915
my $content = encode_json_utf8({
1916
0
%args{grep { exists $args{$_} } qw(team_id cursor limit)}
0
1917
});
1918
0
my ($res) = await $self->http_post(
1919
$uri,
1920
$content,
1921
content_type => 'application/json; charset=utf-8',
1922
);
1923
0
0
die $res unless $res->{ok};
1924
0
return $res;
1925
}
1926
1927
1928
=head2 admin_users_remove
1929
1930
Remove a user from a workspace.
1931
1932
L
1933
1934
Takes the following named parameters:
1935
1936
=over 4
1937
1938
=item * C - The ID (`T1234`) of the workspace. (string, required)
1939
1940
=item * C - The ID of the user to remove. (string, required)
1941
1942
=back
1943
1944
Resolves to a structure representing the response.
1945
1946
=cut
1947
1948
0
0
1
async sub admin_users_remove {
1949
0
my ($self, %args) = @_;
1950
0
my $uri = $self->endpoint(
1951
'admin_users_remove',
1952
);
1953
my $content = encode_json_utf8({
1954
0
%args{grep { exists $args{$_} } qw(team_id user_id)}
0
1955
});
1956
0
my ($res) = await $self->http_post(
1957
$uri,
1958
$content,
1959
content_type => 'application/json; charset=utf-8',
1960
);
1961
0
0
die $res unless $res->{ok};
1962
0
return $res;
1963
}
1964
1965
1966
=head2 admin_users_session_invalidate
1967
1968
Invalidate a single session for a user by session_id
1969
1970
L
1971
1972
Takes the following named parameters:
1973
1974
=over 4
1975
1976
=item * C - ID of the team that the session belongs to (string, required)
1977
1978
=item * C - (integer, required)
1979
1980
=back
1981
1982
Resolves to a structure representing the response.
1983
1984
=cut
1985
1986
0
0
1
async sub admin_users_session_invalidate {
1987
0
my ($self, %args) = @_;
1988
0
my $uri = $self->endpoint(
1989
'admin_users_session_invalidate',
1990
);
1991
my $content = encode_json_utf8({
1992
0
%args{grep { exists $args{$_} } qw(team_id session_id)}
0
1993
});
1994
0
my ($res) = await $self->http_post(
1995
$uri,
1996
$content,
1997
content_type => 'application/json; charset=utf-8',
1998
);
1999
0
0
die $res unless $res->{ok};
2000
0
return $res;
2001
}
2002
2003
2004
=head2 admin_users_session_reset
2005
2006
Wipes all valid sessions on all devices for a given user
2007
2008
L
2009
2010
Takes the following named parameters:
2011
2012
=over 4
2013
2014
=item * C - The ID of the user to wipe sessions for (string, required)
2015
2016
=item * C - Only expire mobile sessions (default: false) (boolean, optional)
2017
2018
=item * C - Only expire web sessions (default: false) (boolean, optional)
2019
2020
=back
2021
2022
Resolves to a structure representing the response.
2023
2024
=cut
2025
2026
0
0
1
async sub admin_users_session_reset {
2027
0
my ($self, %args) = @_;
2028
0
my $uri = $self->endpoint(
2029
'admin_users_session_reset',
2030
);
2031
my $content = encode_json_utf8({
2032
0
%args{grep { exists $args{$_} } qw(user_id mobile_only web_only)}
0
2033
});
2034
0
my ($res) = await $self->http_post(
2035
$uri,
2036
$content,
2037
content_type => 'application/json; charset=utf-8',
2038
);
2039
0
0
die $res unless $res->{ok};
2040
0
return $res;
2041
}
2042
2043
2044
=head2 admin_users_set_admin
2045
2046
Set an existing guest, regular user, or owner to be an admin user.
2047
2048
L
2049
2050
Takes the following named parameters:
2051
2052
=over 4
2053
2054
=item * C - The ID (`T1234`) of the workspace. (string, required)
2055
2056
=item * C - The ID of the user to designate as an admin. (string, required)
2057
2058
=back
2059
2060
Resolves to a structure representing the response.
2061
2062
=cut
2063
2064
0
0
1
async sub admin_users_set_admin {
2065
0
my ($self, %args) = @_;
2066
0
my $uri = $self->endpoint(
2067
'admin_users_set_admin',
2068
);
2069
my $content = encode_json_utf8({
2070
0
%args{grep { exists $args{$_} } qw(team_id user_id)}
0
2071
});
2072
0
my ($res) = await $self->http_post(
2073
$uri,
2074
$content,
2075
content_type => 'application/json; charset=utf-8',
2076
);
2077
0
0
die $res unless $res->{ok};
2078
0
return $res;
2079
}
2080
2081
2082
=head2 admin_users_set_expiration
2083
2084
Set an expiration for a guest user
2085
2086
L
2087
2088
Takes the following named parameters:
2089
2090
=over 4
2091
2092
=item * C - The ID (`T1234`) of the workspace. (string, required)
2093
2094
=item * C - The ID of the user to set an expiration for. (string, required)
2095
2096
=item * C - Timestamp when guest account should be disabled. (integer, required)
2097
2098
=back
2099
2100
Resolves to a structure representing the response.
2101
2102
=cut
2103
2104
0
0
1
async sub admin_users_set_expiration {
2105
0
my ($self, %args) = @_;
2106
0
my $uri = $self->endpoint(
2107
'admin_users_set_expiration',
2108
);
2109
my $content = encode_json_utf8({
2110
0
%args{grep { exists $args{$_} } qw(team_id user_id expiration_ts)}
0
2111
});
2112
0
my ($res) = await $self->http_post(
2113
$uri,
2114
$content,
2115
content_type => 'application/json; charset=utf-8',
2116
);
2117
0
0
die $res unless $res->{ok};
2118
0
return $res;
2119
}
2120
2121
2122
=head2 admin_users_set_owner
2123
2124
Set an existing guest, regular user, or admin user to be a workspace owner.
2125
2126
L
2127
2128
Takes the following named parameters:
2129
2130
=over 4
2131
2132
=item * C - The ID (`T1234`) of the workspace. (string, required)
2133
2134
=item * C - Id of the user to promote to owner. (string, required)
2135
2136
=back
2137
2138
Resolves to a structure representing the response.
2139
2140
=cut
2141
2142
0
0
1
async sub admin_users_set_owner {
2143
0
my ($self, %args) = @_;
2144
0
my $uri = $self->endpoint(
2145
'admin_users_set_owner',
2146
);
2147
my $content = encode_json_utf8({
2148
0
%args{grep { exists $args{$_} } qw(team_id user_id)}
0
2149
});
2150
0
my ($res) = await $self->http_post(
2151
$uri,
2152
$content,
2153
content_type => 'application/json; charset=utf-8',
2154
);
2155
0
0
die $res unless $res->{ok};
2156
0
return $res;
2157
}
2158
2159
2160
=head2 admin_users_set_regular
2161
2162
Set an existing guest user, admin user, or owner to be a regular user.
2163
2164
L
2165
2166
Takes the following named parameters:
2167
2168
=over 4
2169
2170
=item * C - The ID (`T1234`) of the workspace. (string, required)
2171
2172
=item * C - The ID of the user to designate as a regular user. (string, required)
2173
2174
=back
2175
2176
Resolves to a structure representing the response.
2177
2178
=cut
2179
2180
0
0
1
async sub admin_users_set_regular {
2181
0
my ($self, %args) = @_;
2182
0
my $uri = $self->endpoint(
2183
'admin_users_set_regular',
2184
);
2185
my $content = encode_json_utf8({
2186
0
%args{grep { exists $args{$_} } qw(team_id user_id)}
0
2187
});
2188
0
my ($res) = await $self->http_post(
2189
$uri,
2190
$content,
2191
content_type => 'application/json; charset=utf-8',
2192
);
2193
0
0
die $res unless $res->{ok};
2194
0
return $res;
2195
}
2196
2197
2198
=head2 api_test
2199
2200
Checks API calling code.
2201
2202
L
2203
2204
Takes the following named parameters:
2205
2206
=over 4
2207
2208
=item * C - Error response to return (string, optional)
2209
2210
=item * C - example property to return (string, optional)
2211
2212
=back
2213
2214
Resolves to a structure representing the response.
2215
2216
=cut
2217
2218
0
0
1
async sub api_test {
2219
0
my ($self, %args) = @_;
2220
0
my $uri = $self->endpoint(
2221
'api_test',
2222
);
2223
my $content = encode_json_utf8({
2224
0
%args{grep { exists $args{$_} } qw(error foo)}
0
2225
});
2226
0
my ($res) = await $self->http_post(
2227
$uri,
2228
$content,
2229
content_type => 'application/json; charset=utf-8',
2230
);
2231
0
0
die $res unless $res->{ok};
2232
0
return $res;
2233
}
2234
2235
2236
=head2 apps_event_authorizations_list
2237
2238
Get a list of authorizations for the given event context. Each authorization represents an app installation that the event is visible to.
2239
2240
L
2241
2242
Takes the following named parameters:
2243
2244
=over 4
2245
2246
=item * C - (string, required)
2247
2248
=item * C - (string, optional)
2249
2250
=item * C - (integer, optional)
2251
2252
=back
2253
2254
Resolves to a structure representing the response.
2255
2256
=cut
2257
2258
0
0
1
async sub apps_event_authorizations_list {
2259
0
my ($self, %args) = @_;
2260
0
my $uri = $self->endpoint(
2261
'apps_event_authorizations_list',
2262
);
2263
my $content = encode_json_utf8({
2264
0
%args{grep { exists $args{$_} } qw(event_context cursor limit)}
0
2265
});
2266
0
my ($res) = await $self->http_post(
2267
$uri,
2268
$content,
2269
content_type => 'application/json; charset=utf-8',
2270
);
2271
0
0
die $res unless $res->{ok};
2272
0
return $res;
2273
}
2274
2275
2276
=head2 apps_permissions_info
2277
2278
Returns list of permissions this app has on a team.
2279
2280
L
2281
2282
Resolves to a structure representing the response.
2283
2284
=cut
2285
2286
0
0
1
async sub apps_permissions_info {
2287
0
my ($self, %args) = @_;
2288
0
my $uri = $self->endpoint(
2289
'apps_permissions_info',
2290
);
2291
0
my ($res) = await $self->http_get(
2292
$uri,
2293
);
2294
0
0
die $res unless $res->{ok};
2295
0
return $res;
2296
}
2297
2298
2299
=head2 apps_permissions_request
2300
2301
Allows an app to request additional scopes
2302
2303
L
2304
2305
Takes the following named parameters:
2306
2307
=over 4
2308
2309
=item * C - A comma separated list of scopes to request for (string, required)
2310
2311
=item * C - Token used to trigger the permissions API (string, required)
2312
2313
=back
2314
2315
Resolves to a structure representing the response.
2316
2317
=cut
2318
2319
0
0
1
async sub apps_permissions_request {
2320
0
my ($self, %args) = @_;
2321
my $uri = $self->endpoint(
2322
'apps_permissions_request',
2323
0
%args{grep { exists $args{$_} } qw(scopes trigger_id)}
0
2324
);
2325
0
my ($res) = await $self->http_get(
2326
$uri,
2327
);
2328
0
0
die $res unless $res->{ok};
2329
0
return $res;
2330
}
2331
2332
2333
=head2 apps_permissions_resources_list
2334
2335
Returns list of resource grants this app has on a team.
2336
2337
L
2338
2339
Takes the following named parameters:
2340
2341
=over 4
2342
2343
=item * C - Paginate through collections of data by setting the `cursor` parameter to a `next_cursor` attribute returned by a previous request's `response_metadata`. Default value fetches the first "page" of the collection. See [pagination](/docs/pagination) for more detail. (string, optional)
2344
2345
=item * C - The maximum number of items to return. (integer, optional)
2346
2347
=back
2348
2349
Resolves to a structure representing the response.
2350
2351
=cut
2352
2353
0
0
1
async sub apps_permissions_resources_list {
2354
0
my ($self, %args) = @_;
2355
my $uri = $self->endpoint(
2356
'apps_permissions_resources_list',
2357
0
%args{grep { exists $args{$_} } qw(cursor limit)}
0
2358
);
2359
0
my ($res) = await $self->http_get(
2360
$uri,
2361
);
2362
0
0
die $res unless $res->{ok};
2363
0
return $res;
2364
}
2365
2366
2367
=head2 apps_permissions_scopes_list
2368
2369
Returns list of scopes this app has on a team.
2370
2371
L
2372
2373
Resolves to a structure representing the response.
2374
2375
=cut
2376
2377
0
0
1
async sub apps_permissions_scopes_list {
2378
0
my ($self, %args) = @_;
2379
0
my $uri = $self->endpoint(
2380
'apps_permissions_scopes_list',
2381
);
2382
0
my ($res) = await $self->http_get(
2383
$uri,
2384
);
2385
0
0
die $res unless $res->{ok};
2386
0
return $res;
2387
}
2388
2389
2390
=head2 apps_permissions_users_list
2391
2392
Returns list of user grants and corresponding scopes this app has on a team.
2393
2394
L
2395
2396
Takes the following named parameters:
2397
2398
=over 4
2399
2400
=item * C - Paginate through collections of data by setting the `cursor` parameter to a `next_cursor` attribute returned by a previous request's `response_metadata`. Default value fetches the first "page" of the collection. See [pagination](/docs/pagination) for more detail. (string, optional)
2401
2402
=item * C - The maximum number of items to return. (integer, optional)
2403
2404
=back
2405
2406
Resolves to a structure representing the response.
2407
2408
=cut
2409
2410
0
0
1
async sub apps_permissions_users_list {
2411
0
my ($self, %args) = @_;
2412
my $uri = $self->endpoint(
2413
'apps_permissions_users_list',
2414
0
%args{grep { exists $args{$_} } qw(cursor limit)}
0
2415
);
2416
0
my ($res) = await $self->http_get(
2417
$uri,
2418
);
2419
0
0
die $res unless $res->{ok};
2420
0
return $res;
2421
}
2422
2423
2424
=head2 apps_permissions_users_request
2425
2426
Enables an app to trigger a permissions modal to grant an app access to a user access scope.
2427
2428
L
2429
2430
Takes the following named parameters:
2431
2432
=over 4
2433
2434
=item * C - A comma separated list of user scopes to request for (string, required)
2435
2436
=item * C - Token used to trigger the request (string, required)
2437
2438
=item * C - The user this scope is being requested for (string, required)
2439
2440
=back
2441
2442
Resolves to a structure representing the response.
2443
2444
=cut
2445
2446
0
0
1
async sub apps_permissions_users_request {
2447
0
my ($self, %args) = @_;
2448
my $uri = $self->endpoint(
2449
'apps_permissions_users_request',
2450
0
%args{grep { exists $args{$_} } qw(scopes trigger_id user)}
0
2451
);
2452
0
my ($res) = await $self->http_get(
2453
$uri,
2454
);
2455
0
0
die $res unless $res->{ok};
2456
0
return $res;
2457
}
2458
2459
2460
=head2 apps_uninstall
2461
2462
Uninstalls your app from a workspace.
2463
2464
L
2465
2466
Takes the following named parameters:
2467
2468
=over 4
2469
2470
=item * C - Issued when you created your application. (string, optional)
2471
2472
=item * C - Issued when you created your application. (string, optional)
2473
2474
=back
2475
2476
Resolves to a structure representing the response.
2477
2478
=cut
2479
2480
0
0
1
async sub apps_uninstall {
2481
0
my ($self, %args) = @_;
2482
my $uri = $self->endpoint(
2483
'apps_uninstall',
2484
0
%args{grep { exists $args{$_} } qw(client_id client_secret)}
0
2485
);
2486
0
my ($res) = await $self->http_get(
2487
$uri,
2488
);
2489
0
0
die $res unless $res->{ok};
2490
0
return $res;
2491
}
2492
2493
2494
=head2 auth_revoke
2495
2496
Revokes a token.
2497
2498
L
2499
2500
Takes the following named parameters:
2501
2502
=over 4
2503
2504
=item * C - Setting this parameter to `1` triggers a _testing mode_ where the specified token will not actually be revoked. (boolean, optional)
2505
2506
=back
2507
2508
Resolves to a structure representing the response.
2509
2510
=cut
2511
2512
0
0
1
async sub auth_revoke {
2513
0
my ($self, %args) = @_;
2514
my $uri = $self->endpoint(
2515
'auth_revoke',
2516
0
%args{grep { exists $args{$_} } qw(test)}
0
2517
);
2518
0
my ($res) = await $self->http_get(
2519
$uri,
2520
);
2521
0
0
die $res unless $res->{ok};
2522
0
return $res;
2523
}
2524
2525
2526
=head2 auth_test
2527
2528
Checks authentication & identity.
2529
2530
L
2531
2532
Resolves to a structure representing the response.
2533
2534
=cut
2535
2536
0
0
1
async sub auth_test {
2537
0
my ($self, %args) = @_;
2538
0
my $uri = $self->endpoint(
2539
'auth_test',
2540
);
2541
0
my ($res) = await $self->http_post(
2542
$uri,
2543
);
2544
0
0
die $res unless $res->{ok};
2545
0
return $res;
2546
}
2547
2548
2549
=head2 bots_info
2550
2551
Gets information about a bot user.
2552
2553
L
2554
2555
Takes the following named parameters:
2556
2557
=over 4
2558
2559
=item * C - Bot user to get info on (string, optional)
2560
2561
=back
2562
2563
Resolves to a structure representing the response.
2564
2565
=cut
2566
2567
0
0
1
async sub bots_info {
2568
0
my ($self, %args) = @_;
2569
my $uri = $self->endpoint(
2570
'bots_info',
2571
0
%args{grep { exists $args{$_} } qw(bot)}
0
2572
);
2573
0
my ($res) = await $self->http_get(
2574
$uri,
2575
);
2576
0
0
die $res unless $res->{ok};
2577
0
return $res;
2578
}
2579
2580
2581
=head2 calls_add
2582
2583
Registers a new Call.
2584
2585
L
2586
2587
Takes the following named parameters:
2588
2589
=over 4
2590
2591
=item * C - An ID supplied by the 3rd-party Call provider. It must be unique across all Calls from that service. (string, required)
2592
2593
=item * C - An optional, human-readable ID supplied by the 3rd-party Call provider. If supplied, this ID will be displayed in the Call object. (string, optional)
2594
2595
=item * C - The URL required for a client to join the Call. (string, required)
2596
2597
=item * C - When supplied, available Slack clients will attempt to directly launch the 3rd-party Call with this URL. (string, optional)
2598
2599
=item * C - Call start time in UTC UNIX timestamp format (integer, optional)
2600
2601
=item * C - The name of the Call. (string, optional)
2602
2603
=item * C - The valid Slack user ID of the user who created this Call. When this method is called with a user token, the `created_by` field is optional and defaults to the authed user of the token. Otherwise, the field is required. (string, optional)
2604
2605
=item * C - The list of users to register as participants in the Call. [Read more on how to specify users here](/apis/calls#users). (string, optional)
2606
2607
=back
2608
2609
Resolves to a structure representing the response.
2610
2611
=cut
2612
2613
0
0
1
async sub calls_add {
2614
0
my ($self, %args) = @_;
2615
0
my $uri = $self->endpoint(
2616
'calls_add',
2617
);
2618
my $content = encode_json_utf8({
2619
0
%args{grep { exists $args{$_} } qw(external_unique_id external_display_id join_url desktop_app_join_url date_start title created_by users)}
0
2620
});
2621
0
my ($res) = await $self->http_post(
2622
$uri,
2623
$content,
2624
content_type => 'application/json; charset=utf-8',
2625
);
2626
0
0
die $res unless $res->{ok};
2627
0
return $res;
2628
}
2629
2630
2631
=head2 calls_end
2632
2633
Ends a Call.
2634
2635
L
2636
2637
Takes the following named parameters:
2638
2639
=over 4
2640
2641
=item * C - `id` returned when registering the call using the [`calls.add`](/methods/calls.add) method. (string, required)
2642
2643
=item * C - Call duration in seconds (integer, optional)
2644
2645
=back
2646
2647
Resolves to a structure representing the response.
2648
2649
=cut
2650
2651
0
0
1
async sub calls_end {
2652
0
my ($self, %args) = @_;
2653
0
my $uri = $self->endpoint(
2654
'calls_end',
2655
);
2656
my $content = encode_json_utf8({
2657
0
%args{grep { exists $args{$_} } qw(id duration)}
0
2658
});
2659
0
my ($res) = await $self->http_post(
2660
$uri,
2661
$content,
2662
content_type => 'application/json; charset=utf-8',
2663
);
2664
0
0
die $res unless $res->{ok};
2665
0
return $res;
2666
}
2667
2668
2669
=head2 calls_info
2670
2671
Returns information about a Call.
2672
2673
L
2674
2675
Takes the following named parameters:
2676
2677
=over 4
2678
2679
=item * C - `id` of the Call returned by the [`calls.add`](/methods/calls.add) method. (string, required)
2680
2681
=back
2682
2683
Resolves to a structure representing the response.
2684
2685
=cut
2686
2687
0
0
1
async sub calls_info {
2688
0
my ($self, %args) = @_;
2689
0
my $uri = $self->endpoint(
2690
'calls_info',
2691
);
2692
my $content = encode_json_utf8({
2693
0
%args{grep { exists $args{$_} } qw(id)}
0
2694
});
2695
0
my ($res) = await $self->http_post(
2696
$uri,
2697
$content,
2698
content_type => 'application/json; charset=utf-8',
2699
);
2700
0
0
die $res unless $res->{ok};
2701
0
return $res;
2702
}
2703
2704
2705
=head2 calls_participants_add
2706
2707
Registers new participants added to a Call.
2708
2709
L
2710
2711
Takes the following named parameters:
2712
2713
=over 4
2714
2715
=item * C - `id` returned by the [`calls.add`](/methods/calls.add) method. (string, required)
2716
2717
=item * C - The list of users to add as participants in the Call. [Read more on how to specify users here](/apis/calls#users). (string, required)
2718
2719
=back
2720
2721
Resolves to a structure representing the response.
2722
2723
=cut
2724
2725
0
0
1
async sub calls_participants_add {
2726
0
my ($self, %args) = @_;
2727
0
my $uri = $self->endpoint(
2728
'calls_participants_add',
2729
);
2730
my $content = encode_json_utf8({
2731
0
%args{grep { exists $args{$_} } qw(id users)}
0
2732
});
2733
0
my ($res) = await $self->http_post(
2734
$uri,
2735
$content,
2736
content_type => 'application/json; charset=utf-8',
2737
);
2738
0
0
die $res unless $res->{ok};
2739
0
return $res;
2740
}
2741
2742
2743
=head2 calls_participants_remove
2744
2745
Registers participants removed from a Call.
2746
2747
L
2748
2749
Takes the following named parameters:
2750
2751
=over 4
2752
2753
=item * C - `id` returned by the [`calls.add`](/methods/calls.add) method. (string, required)
2754
2755
=item * C - The list of users to remove as participants in the Call. [Read more on how to specify users here](/apis/calls#users). (string, required)
2756
2757
=back
2758
2759
Resolves to a structure representing the response.
2760
2761
=cut
2762
2763
0
0
1
async sub calls_participants_remove {
2764
0
my ($self, %args) = @_;
2765
0
my $uri = $self->endpoint(
2766
'calls_participants_remove',
2767
);
2768
my $content = encode_json_utf8({
2769
0
%args{grep { exists $args{$_} } qw(id users)}
0
2770
});
2771
0
my ($res) = await $self->http_post(
2772
$uri,
2773
$content,
2774
content_type => 'application/json; charset=utf-8',
2775
);
2776
0
0
die $res unless $res->{ok};
2777
0
return $res;
2778
}
2779
2780
2781
=head2 calls_update
2782
2783
Updates information about a Call.
2784
2785
L
2786
2787
Takes the following named parameters:
2788
2789
=over 4
2790
2791
=item * C - `id` returned by the [`calls.add`](/methods/calls.add) method. (string, required)
2792
2793
=item * C - The name of the Call. (string, optional)
2794
2795
=item * C - The URL required for a client to join the Call. (string, optional)
2796
2797
=item * C - When supplied, available Slack clients will attempt to directly launch the 3rd-party Call with this URL. (string, optional)
2798
2799
=back
2800
2801
Resolves to a structure representing the response.
2802
2803
=cut
2804
2805
0
0
1
async sub calls_update {
2806
0
my ($self, %args) = @_;
2807
0
my $uri = $self->endpoint(
2808
'calls_update',
2809
);
2810
my $content = encode_json_utf8({
2811
0
%args{grep { exists $args{$_} } qw(id title join_url desktop_app_join_url)}
0
2812
});
2813
0
my ($res) = await $self->http_post(
2814
$uri,
2815
$content,
2816
content_type => 'application/json; charset=utf-8',
2817
);
2818
0
0
die $res unless $res->{ok};
2819
0
return $res;
2820
}
2821
2822
2823
=head2 chat_delete
2824
2825
Deletes a message.
2826
2827
L
2828
2829
Takes the following named parameters:
2830
2831
=over 4
2832
2833
=item * C - Timestamp of the message to be deleted. (number, optional)
2834
2835
=item * C - Channel containing the message to be deleted. (string, optional)
2836
2837
=item * C - Pass true to delete the message as the authed user with `chat:write:user` scope. [Bot users](/bot-users) in this context are considered authed users. If unused or false, the message will be deleted with `chat:write:bot` scope. (boolean, optional)
2838
2839
=back
2840
2841
Resolves to a structure representing the response.
2842
2843
=cut
2844
2845
0
0
1
async sub chat_delete {
2846
0
my ($self, %args) = @_;
2847
0
my $uri = $self->endpoint(
2848
'chat_delete',
2849
);
2850
my $content = encode_json_utf8({
2851
0
%args{grep { exists $args{$_} } qw(ts channel as_user)}
0
2852
});
2853
0
my ($res) = await $self->http_post(
2854
$uri,
2855
$content,
2856
content_type => 'application/json; charset=utf-8',
2857
);
2858
0
0
die $res unless $res->{ok};
2859
0
return $res;
2860
}
2861
2862
2863
=head2 chat_delete_scheduled_message
2864
2865
Deletes a pending scheduled message from the queue.
2866
2867
L
2868
2869
Takes the following named parameters:
2870
2871
=over 4
2872
2873
=item * C - Pass true to delete the message as the authed user with `chat:write:user` scope. [Bot users](/bot-users) in this context are considered authed users. If unused or false, the message will be deleted with `chat:write:bot` scope. (boolean, optional)
2874
2875
=item * C - The channel the scheduled_message is posting to (string, required)
2876
2877
=item * C - `scheduled_message_id` returned from call to chat.scheduleMessage (string, required)
2878
2879
=back
2880
2881
Resolves to a structure representing the response.
2882
2883
=cut
2884
2885
0
0
1
async sub chat_delete_scheduled_message {
2886
0
my ($self, %args) = @_;
2887
0
my $uri = $self->endpoint(
2888
'chat_delete_scheduled_message',
2889
);
2890
my $content = encode_json_utf8({
2891
0
%args{grep { exists $args{$_} } qw(as_user channel scheduled_message_id)}
0
2892
});
2893
0
my ($res) = await $self->http_post(
2894
$uri,
2895
$content,
2896
content_type => 'application/json; charset=utf-8',
2897
);
2898
0
0
die $res unless $res->{ok};
2899
0
return $res;
2900
}
2901
2902
2903
=head2 chat_get_permalink
2904
2905
Retrieve a permalink URL for a specific extant message
2906
2907
L
2908
2909
Takes the following named parameters:
2910
2911
=over 4
2912
2913
=item * C - The ID of the conversation or channel containing the message (string, required)
2914
2915
=item * C - A message's `ts` value, uniquely identifying it within a channel (string, required)
2916
2917
=back
2918
2919
Resolves to a structure representing the response.
2920
2921
=cut
2922
2923
0
0
1
async sub chat_get_permalink {
2924
0
my ($self, %args) = @_;
2925
my $uri = $self->endpoint(
2926
'chat_get_permalink',
2927
0
%args{grep { exists $args{$_} } qw(channel message_ts)}
0
2928
);
2929
0
my ($res) = await $self->http_get(
2930
$uri,
2931
);
2932
0
0
die $res unless $res->{ok};
2933
0
return $res;
2934
}
2935
2936
2937
=head2 chat_me_message
2938
2939
Share a me message into a channel.
2940
2941
L
2942
2943
Takes the following named parameters:
2944
2945
=over 4
2946
2947
=item * C - Channel to send message to. Can be a public channel, private group or IM channel. Can be an encoded ID, or a name. (string, optional)
2948
2949
=item * C - Text of the message to send. (string, optional)
2950
2951
=back
2952
2953
Resolves to a structure representing the response.
2954
2955
=cut
2956
2957
0
0
1
async sub chat_me_message {
2958
0
my ($self, %args) = @_;
2959
0
my $uri = $self->endpoint(
2960
'chat_me_message',
2961
);
2962
my $content = encode_json_utf8({
2963
0
%args{grep { exists $args{$_} } qw(channel text)}
0
2964
});
2965
0
my ($res) = await $self->http_post(
2966
$uri,
2967
$content,
2968
content_type => 'application/json; charset=utf-8',
2969
);
2970
0
0
die $res unless $res->{ok};
2971
0
return $res;
2972
}
2973
2974
2975
=head2 chat_post_ephemeral
2976
2977
Sends an ephemeral message to a user in a channel.
2978
2979
L
2980
2981
Takes the following named parameters:
2982
2983
=over 4
2984
2985
=item * C - Pass true to post the message as the authed user. Defaults to true if the chat:write:bot scope is not included. Otherwise, defaults to false. (boolean, optional)
2986
2987
=item * C - A JSON-based array of structured attachments, presented as a URL-encoded string. (string, optional)
2988
2989
=item * C - A JSON-based array of structured blocks, presented as a URL-encoded string. (string, optional)
2990
2991
=item * C - Channel, private group, or IM channel to send message to. Can be an encoded ID, or a name. (string, required)
2992
2993
=item * C - Emoji to use as the icon for this message. Overrides `icon_url`. Must be used in conjunction with `as_user` set to `false`, otherwise ignored. See [authorship](#authorship) below. (string, optional)
2994
2995
=item * C - URL to an image to use as the icon for this message. Must be used in conjunction with `as_user` set to false, otherwise ignored. See [authorship](#authorship) below. (string, optional)
2996
2997
=item * C - Find and link channel names and usernames. (boolean, optional)
2998
2999
=item * C - Change how messages are treated. Defaults to `none`. See [below](#formatting). (string, optional)
3000
3001
=item * C - How this field works and whether it is required depends on other fields you use in your API call. [See below](#text_usage) for more detail. (string, optional)
3002
3003
=item * C - Provide another message's `ts` value to post this message in a thread. Avoid using a reply's `ts` value; use its parent's value instead. Ephemeral messages in threads are only shown if there is already an active thread. (string, optional)
3004
3005
=item * C - `id` of the user who will receive the ephemeral message. The user should be in the channel specified by the `channel` argument. (string, required)
3006
3007
=item * C - Set your bot's user name. Must be used in conjunction with `as_user` set to false, otherwise ignored. See [authorship](#authorship) below. (string, optional)
3008
3009
=back
3010
3011
Resolves to a structure representing the response.
3012
3013
=cut
3014
3015
0
0
1
async sub chat_post_ephemeral {
3016
0
my ($self, %args) = @_;
3017
0
my $uri = $self->endpoint(
3018
'chat_post_ephemeral',
3019
);
3020
my $content = encode_json_utf8({
3021
0
%args{grep { exists $args{$_} } qw(as_user attachments blocks channel icon_emoji icon_url link_names parse text thread_ts user username)}
0
3022
});
3023
0
my ($res) = await $self->http_post(
3024
$uri,
3025
$content,
3026
content_type => 'application/json; charset=utf-8',
3027
);
3028
0
0
die $res unless $res->{ok};
3029
0
return $res;
3030
}
3031
3032
3033
=head2 chat_post_message
3034
3035
Sends a message to a channel.
3036
3037
L
3038
3039
Takes the following named parameters:
3040
3041
=over 4
3042
3043
=item * C - Pass true to post the message as the authed user, instead of as a bot. Defaults to false. See [authorship](#authorship) below. (string, optional)
3044
3045
=item * C - A JSON-based array of structured attachments, presented as a URL-encoded string. (string, optional)
3046
3047
=item * C - A JSON-based array of structured blocks, presented as a URL-encoded string. (string, optional)
3048
3049
=item * C - Channel, private group, or IM channel to send message to. Can be an encoded ID, or a name. See [below](#channels) for more details. (string, required)
3050
3051
=item * C - Emoji to use as the icon for this message. Overrides `icon_url`. Must be used in conjunction with `as_user` set to `false`, otherwise ignored. See [authorship](#authorship) below. (string, optional)
3052
3053
=item * C - URL to an image to use as the icon for this message. Must be used in conjunction with `as_user` set to false, otherwise ignored. See [authorship](#authorship) below. (string, optional)
3054
3055
=item * C - Find and link channel names and usernames. (boolean, optional)
3056
3057
=item * C - Disable Slack markup parsing by setting to `false`. Enabled by default. (boolean, optional)
3058
3059
=item * C - Change how messages are treated. Defaults to `none`. See [below](#formatting). (string, optional)
3060
3061
=item * C - Used in conjunction with `thread_ts` and indicates whether reply should be made visible to everyone in the channel or conversation. Defaults to `false`. (boolean, optional)
3062
3063
=item * C - How this field works and whether it is required depends on other fields you use in your API call. [See below](#text_usage) for more detail. (string, optional)
3064
3065
=item * C - Provide another message's `ts` value to make this message a reply. Avoid using a reply's `ts` value; use its parent instead. (string, optional)
3066
3067
=item * C - Pass true to enable unfurling of primarily text-based content. (boolean, optional)
3068
3069
=item * C - Pass false to disable unfurling of media content. (boolean, optional)
3070
3071
=item * C - Set your bot's user name. Must be used in conjunction with `as_user` set to false, otherwise ignored. See [authorship](#authorship) below. (string, optional)
3072
3073
=back
3074
3075
Resolves to a structure representing the response.
3076
3077
=cut
3078
3079
0
0
1
async sub chat_post_message {
3080
0
my ($self, %args) = @_;
3081
0
my $uri = $self->endpoint(
3082
'chat_post_message',
3083
);
3084
my $content = encode_json_utf8({
3085
0
%args{grep { exists $args{$_} } qw(as_user attachments blocks channel icon_emoji icon_url link_names mrkdwn parse reply_broadcast text thread_ts unfurl_links unfurl_media username)}
0
3086
});
3087
0
my ($res) = await $self->http_post(
3088
$uri,
3089
$content,
3090
content_type => 'application/json; charset=utf-8',
3091
);
3092
0
0
die $res unless $res->{ok};
3093
0
return $res;
3094
}
3095
3096
3097
=head2 chat_schedule_message
3098
3099
Schedules a message to be sent to a channel.
3100
3101
L
3102
3103
Takes the following named parameters:
3104
3105
=over 4
3106
3107
=item * C - Channel, private group, or DM channel to send message to. Can be an encoded ID, or a name. See [below](#channels) for more details. (string, optional)
3108
3109
=item * C - How this field works and whether it is required depends on other fields you use in your API call. [See below](#text_usage) for more detail. (string, optional)
3110
3111
=item * C - Unix EPOCH timestamp of time in future to send the message. (string, optional)
3112
3113
=item * C - Change how messages are treated. Defaults to `none`. See [chat.postMessage](chat.postMessage#formatting). (string, optional)
3114
3115
=item * C - Pass true to post the message as the authed user, instead of as a bot. Defaults to false. See [chat.postMessage](chat.postMessage#authorship). (boolean, optional)
3116
3117
=item * C - Find and link channel names and usernames. (boolean, optional)
3118
3119
=item * C - A JSON-based array of structured attachments, presented as a URL-encoded string. (string, optional)
3120
3121
=item * C - A JSON-based array of structured blocks, presented as a URL-encoded string. (string, optional)
3122
3123
=item * C - Pass true to enable unfurling of primarily text-based content. (boolean, optional)
3124
3125
=item * C - Pass false to disable unfurling of media content. (boolean, optional)
3126
3127
=item * C - Provide another message's `ts` value to make this message a reply. Avoid using a reply's `ts` value; use its parent instead. (number, optional)
3128
3129
=item * C - Used in conjunction with `thread_ts` and indicates whether reply should be made visible to everyone in the channel or conversation. Defaults to `false`. (boolean, optional)
3130
3131
=back
3132
3133
Resolves to a structure representing the response.
3134
3135
=cut
3136
3137
0
0
1
async sub chat_schedule_message {
3138
0
my ($self, %args) = @_;
3139
0
my $uri = $self->endpoint(
3140
'chat_schedule_message',
3141
);
3142
my $content = encode_json_utf8({
3143
0
%args{grep { exists $args{$_} } qw(channel text post_at parse as_user link_names attachments blocks unfurl_links unfurl_media thread_ts reply_broadcast)}
0
3144
});
3145
0
my ($res) = await $self->http_post(
3146
$uri,
3147
$content,
3148
content_type => 'application/json; charset=utf-8',
3149
);
3150
0
0
die $res unless $res->{ok};
3151
0
return $res;
3152
}
3153
3154
3155
=head2 chat_scheduled_messages_list
3156
3157
Returns a list of scheduled messages.
3158
3159
L
3160
3161
Takes the following named parameters:
3162
3163
=over 4
3164
3165
=item * C - The channel of the scheduled messages (string, optional)
3166
3167
=item * C - A UNIX timestamp of the latest value in the time range (number, optional)
3168
3169
=item * C - A UNIX timestamp of the oldest value in the time range (number, optional)
3170
3171
=item * C - Maximum number of original entries to return. (integer, optional)
3172
3173
=item * C - For pagination purposes, this is the `cursor` value returned from a previous call to `chat.scheduledmessages.list` indicating where you want to start this call from. (string, optional)
3174
3175
=back
3176
3177
Resolves to a structure representing the response.
3178
3179
=cut
3180
3181
0
0
1
async sub chat_scheduled_messages_list {
3182
0
my ($self, %args) = @_;
3183
0
my $uri = $self->endpoint(
3184
'chat_scheduled_messages_list',
3185
);
3186
my $content = encode_json_utf8({
3187
0
%args{grep { exists $args{$_} } qw(channel latest oldest limit cursor)}
0
3188
});
3189
0
my ($res) = await $self->http_post(
3190
$uri,
3191
$content,
3192
content_type => 'application/json; charset=utf-8',
3193
);
3194
0
0
die $res unless $res->{ok};
3195
0
return $res;
3196
}
3197
3198
3199
=head2 chat_unfurl
3200
3201
Provide custom unfurl behavior for user-posted URLs
3202
3203
L
3204
3205
Takes the following named parameters:
3206
3207
=over 4
3208
3209
=item * C - Channel ID of the message (string, required)
3210
3211
=item * C - Timestamp of the message to add unfurl behavior to. (string, required)
3212
3213
=item * C - URL-encoded JSON map with keys set to URLs featured in the the message, pointing to their unfurl blocks or message attachments. (string, optional)
3214
3215
=item * C - Provide a simply-formatted string to send as an ephemeral message to the user as invitation to authenticate further and enable full unfurling behavior (string, optional)
3216
3217
=item * C - Set to `true` or `1` to indicate the user must install your Slack app to trigger unfurls for this domain (boolean, optional)
3218
3219
=item * C - Send users to this custom URL where they will complete authentication in your app to fully trigger unfurling. Value should be properly URL-encoded. (string, optional)
3220
3221
=back
3222
3223
Resolves to a structure representing the response.
3224
3225
=cut
3226
3227
0
0
1
async sub chat_unfurl {
3228
0
my ($self, %args) = @_;
3229
0
my $uri = $self->endpoint(
3230
'chat_unfurl',
3231
);
3232
my $content = encode_json_utf8({
3233
0
%args{grep { exists $args{$_} } qw(channel ts unfurls user_auth_message user_auth_required user_auth_url)}
0
3234
});
3235
0
my ($res) = await $self->http_post(
3236
$uri,
3237
$content,
3238
content_type => 'application/json; charset=utf-8',
3239
);
3240
0
0
die $res unless $res->{ok};
3241
0
return $res;
3242
}
3243
3244
3245
=head2 chat_update
3246
3247
Updates a message.
3248
3249
L
3250
3251
Takes the following named parameters:
3252
3253
=over 4
3254
3255
=item * C - Pass true to update the message as the authed user. [Bot users](/bot-users) in this context are considered authed users. (string, optional)
3256
3257
=item * C - A JSON-based array of structured attachments, presented as a URL-encoded string. This field is required when not presenting `text`. If you don't include this field, the message's previous `attachments` will be retained. To remove previous `attachments`, include an empty array for this field. (string, optional)
3258
3259
=item * C - A JSON-based array of [structured blocks](/block-kit/building), presented as a URL-encoded string. If you don't include this field, the message's previous `blocks` will be retained. To remove previous `blocks`, include an empty array for this field. (string, optional)
3260
3261
=item * C - Channel containing the message to be updated. (string, required)
3262
3263
=item * C - Find and link channel names and usernames. Defaults to `none`. If you do not specify a value for this field, the original value set for the message will be overwritten with the default, `none`. (string, optional)
3264
3265
=item * C - Change how messages are treated. Defaults to `client`, unlike `chat.postMessage`. Accepts either `none` or `full`. If you do not specify a value for this field, the original value set for the message will be overwritten with the default, `client`. (string, optional)
3266
3267
=item * C - New text for the message, using the [default formatting rules](/reference/surfaces/formatting). It's not required when presenting `blocks` or `attachments`. (string, optional)
3268
3269
=item * C - Timestamp of the message to be updated. (string, required)
3270
3271
=back
3272
3273
Resolves to a structure representing the response.
3274
3275
=cut
3276
3277
0
0
1
async sub chat_update {
3278
0
my ($self, %args) = @_;
3279
0
my $uri = $self->endpoint(
3280
'chat_update',
3281
);
3282
my $content = encode_json_utf8({
3283
0
%args{grep { exists $args{$_} } qw(as_user attachments blocks channel link_names parse text ts)}
0
3284
});
3285
0
my ($res) = await $self->http_post(
3286
$uri,
3287
$content,
3288
content_type => 'application/json; charset=utf-8',
3289
);
3290
0
0
die $res unless $res->{ok};
3291
0
return $res;
3292
}
3293
3294
3295
=head2 conversations_archive
3296
3297
Archives a conversation.
3298
3299
L
3300
3301
Takes the following named parameters:
3302
3303
=over 4
3304
3305
=item * C - ID of conversation to archive (string, optional)
3306
3307
=back
3308
3309
Resolves to a structure representing the response.
3310
3311
=cut
3312
3313
0
0
1
async sub conversations_archive {
3314
0
my ($self, %args) = @_;
3315
0
my $uri = $self->endpoint(
3316
'conversations_archive',
3317
);
3318
my $content = encode_json_utf8({
3319
0
%args{grep { exists $args{$_} } qw(channel)}
0
3320
});
3321
0
my ($res) = await $self->http_post(
3322
$uri,
3323
$content,
3324
content_type => 'application/json; charset=utf-8',
3325
);
3326
0
0
die $res unless $res->{ok};
3327
0
return $res;
3328
}
3329
3330
3331
=head2 conversations_close
3332
3333
Closes a direct message or multi-person direct message.
3334
3335
L
3336
3337
Takes the following named parameters:
3338
3339
=over 4
3340
3341
=item * C - Conversation to close. (string, optional)
3342
3343
=back
3344
3345
Resolves to a structure representing the response.
3346
3347
=cut
3348
3349
0
0
1
async sub conversations_close {
3350
0
my ($self, %args) = @_;
3351
0
my $uri = $self->endpoint(
3352
'conversations_close',
3353
);
3354
my $content = encode_json_utf8({
3355
0
%args{grep { exists $args{$_} } qw(channel)}
0
3356
});
3357
0
my ($res) = await $self->http_post(
3358
$uri,
3359
$content,
3360
content_type => 'application/json; charset=utf-8',
3361
);
3362
0
0
die $res unless $res->{ok};
3363
0
return $res;
3364
}
3365
3366
3367
=head2 conversations_create
3368
3369
Initiates a public or private channel-based conversation
3370
3371
L
3372
3373
Takes the following named parameters:
3374
3375
=over 4
3376
3377
=item * C - Name of the public or private channel to create (string, optional)
3378
3379
=item * C - Create a private channel instead of a public one (boolean, optional)
3380
3381
=back
3382
3383
Resolves to a structure representing the response.
3384
3385
=cut
3386
3387
0
0
1
async sub conversations_create {
3388
0
my ($self, %args) = @_;
3389
0
my $uri = $self->endpoint(
3390
'conversations_create',
3391
);
3392
my $content = encode_json_utf8({
3393
0
%args{grep { exists $args{$_} } qw(name is_private)}
0
3394
});
3395
0
my ($res) = await $self->http_post(
3396
$uri,
3397
$content,
3398
content_type => 'application/json; charset=utf-8',
3399
);
3400
0
0
die $res unless $res->{ok};
3401
0
return $res;
3402
}
3403
3404
3405
=head2 conversations_history
3406
3407
Fetches a conversation's history of messages and events.
3408
3409
L
3410
3411
Takes the following named parameters:
3412
3413
=over 4
3414
3415
=item * C - Conversation ID to fetch history for. (string, optional)
3416
3417
=item * C - End of time range of messages to include in results. (number, optional)
3418
3419
=item * C - Start of time range of messages to include in results. (number, optional)
3420
3421
=item * C - Include messages with latest or oldest timestamp in results only when either timestamp is specified. (boolean, optional)
3422
3423
=item * C - The maximum number of items to return. Fewer than the requested number of items may be returned, even if the end of the users list hasn't been reached. (integer, optional)
3424
3425
=item * C - Paginate through collections of data by setting the `cursor` parameter to a `next_cursor` attribute returned by a previous request's `response_metadata`. Default value fetches the first "page" of the collection. See [pagination](/docs/pagination) for more detail. (string, optional)
3426
3427
=back
3428
3429
Resolves to a structure representing the response.
3430
3431
=cut
3432
3433
0
0
1
async sub conversations_history {
3434
0
my ($self, %args) = @_;
3435
my $uri = $self->endpoint(
3436
'conversations_history',
3437
0
%args{grep { exists $args{$_} } qw(channel latest oldest inclusive limit cursor)}
0
3438
);
3439
0
my ($res) = await $self->http_get(
3440
$uri,
3441
);
3442
0
0
die $res unless $res->{ok};
3443
0
return $res;
3444
}
3445
3446
3447
=head2 conversations_info
3448
3449
Retrieve information about a conversation.
3450
3451
L
3452
3453
Takes the following named parameters:
3454
3455
=over 4
3456
3457
=item * C - Conversation ID to learn more about (string, optional)
3458
3459
=item * C - Set this to `true` to receive the locale for this conversation. Defaults to `false` (boolean, optional)
3460
3461
=item * C - Set to `true` to include the member count for the specified conversation. Defaults to `false` (boolean, optional)
3462
3463
=back
3464
3465
Resolves to a structure representing the response.
3466
3467
=cut
3468
3469
0
0
1
async sub conversations_info {
3470
0
my ($self, %args) = @_;
3471
my $uri = $self->endpoint(
3472
'conversations_info',
3473
0
%args{grep { exists $args{$_} } qw(channel include_locale include_num_members)}
0
3474
);
3475
0
my ($res) = await $self->http_get(
3476
$uri,
3477
);
3478
0
0
die $res unless $res->{ok};
3479
0
return $res;
3480
}
3481
3482
3483
=head2 conversations_invite
3484
3485
Invites users to a channel.
3486
3487
L
3488
3489
Takes the following named parameters:
3490
3491
=over 4
3492
3493
=item * C - The ID of the public or private channel to invite user(s) to. (string, optional)
3494
3495
=item * C - A comma separated list of user IDs. Up to 1000 users may be listed. (string, optional)
3496
3497
=back
3498
3499
Resolves to a structure representing the response.
3500
3501
=cut
3502
3503
0
0
1
async sub conversations_invite {
3504
0
my ($self, %args) = @_;
3505
0
my $uri = $self->endpoint(
3506
'conversations_invite',
3507
);
3508
my $content = encode_json_utf8({
3509
0
%args{grep { exists $args{$_} } qw(channel users)}
0
3510
});
3511
0
my ($res) = await $self->http_post(
3512
$uri,
3513
$content,
3514
content_type => 'application/json; charset=utf-8',
3515
);
3516
0
0
die $res unless $res->{ok};
3517
0
return $res;
3518
}
3519
3520
3521
=head2 conversations_join
3522
3523
Joins an existing conversation.
3524
3525
L
3526
3527
Takes the following named parameters:
3528
3529
=over 4
3530
3531
=item * C - ID of conversation to join (string, optional)
3532
3533
=back
3534
3535
Resolves to a structure representing the response.
3536
3537
=cut
3538
3539
0
0
1
async sub conversations_join {
3540
0
my ($self, %args) = @_;
3541
0
my $uri = $self->endpoint(
3542
'conversations_join',
3543
);
3544
my $content = encode_json_utf8({
3545
0
%args{grep { exists $args{$_} } qw(channel)}
0
3546
});
3547
0
my ($res) = await $self->http_post(
3548
$uri,
3549
$content,
3550
content_type => 'application/json; charset=utf-8',
3551
);
3552
0
0
die $res unless $res->{ok};
3553
0
return $res;
3554
}
3555
3556
3557
=head2 conversations_kick
3558
3559
Removes a user from a conversation.
3560
3561
L
3562
3563
Takes the following named parameters:
3564
3565
=over 4
3566
3567
=item * C - ID of conversation to remove user from. (string, optional)
3568
3569
=item * C - User ID to be removed. (string, optional)
3570
3571
=back
3572
3573
Resolves to a structure representing the response.
3574
3575
=cut
3576
3577
0
0
1
async sub conversations_kick {
3578
0
my ($self, %args) = @_;
3579
0
my $uri = $self->endpoint(
3580
'conversations_kick',
3581
);
3582
my $content = encode_json_utf8({
3583
0
%args{grep { exists $args{$_} } qw(channel user)}
0
3584
});
3585
0
my ($res) = await $self->http_post(
3586
$uri,
3587
$content,
3588
content_type => 'application/json; charset=utf-8',
3589
);
3590
0
0
die $res unless $res->{ok};
3591
0
return $res;
3592
}
3593
3594
3595
=head2 conversations_leave
3596
3597
Leaves a conversation.
3598
3599
L
3600
3601
Takes the following named parameters:
3602
3603
=over 4
3604
3605
=item * C - Conversation to leave (string, optional)
3606
3607
=back
3608
3609
Resolves to a structure representing the response.
3610
3611
=cut
3612
3613
0
0
1
async sub conversations_leave {
3614
0
my ($self, %args) = @_;
3615
0
my $uri = $self->endpoint(
3616
'conversations_leave',
3617
);
3618
my $content = encode_json_utf8({
3619
0
%args{grep { exists $args{$_} } qw(channel)}
0
3620
});
3621
0
my ($res) = await $self->http_post(
3622
$uri,
3623
$content,
3624
content_type => 'application/json; charset=utf-8',
3625
);
3626
0
0
die $res unless $res->{ok};
3627
0
return $res;
3628
}
3629
3630
3631
=head2 conversations_list
3632
3633
Lists all channels in a Slack team.
3634
3635
L
3636
3637
Takes the following named parameters:
3638
3639
=over 4
3640
3641
=item * C - Set to `true` to exclude archived channels from the list (boolean, optional)
3642
3643
=item * C - Mix and match channel types by providing a comma-separated list of any combination of `public_channel`, `private_channel`, `mpim`, `im` (string, optional)
3644
3645
=item * C - The maximum number of items to return. Fewer than the requested number of items may be returned, even if the end of the list hasn't been reached. Must be an integer no larger than 1000. (integer, optional)
3646
3647
=item * C - Paginate through collections of data by setting the `cursor` parameter to a `next_cursor` attribute returned by a previous request's `response_metadata`. Default value fetches the first "page" of the collection. See [pagination](/docs/pagination) for more detail. (string, optional)
3648
3649
=back
3650
3651
Resolves to a structure representing the response.
3652
3653
=cut
3654
3655
0
0
1
async sub conversations_list {
3656
0
my ($self, %args) = @_;
3657
my $uri = $self->endpoint(
3658
'conversations_list',
3659
0
%args{grep { exists $args{$_} } qw(exclude_archived types limit cursor)}
0
3660
);
3661
0
my ($res) = await $self->http_get(
3662
$uri,
3663
);
3664
0
0
die $res unless $res->{ok};
3665
0
return $res;
3666
}
3667
3668
3669
=head2 conversations_mark
3670
3671
Sets the read cursor in a channel.
3672
3673
L
3674
3675
Takes the following named parameters:
3676
3677
=over 4
3678
3679
=item * C - Channel or conversation to set the read cursor for. (string, optional)
3680
3681
=item * C - Unique identifier of message you want marked as most recently seen in this conversation. (number, optional)
3682
3683
=back
3684
3685
Resolves to a structure representing the response.
3686
3687
=cut
3688
3689
0
0
1
async sub conversations_mark {
3690
0
my ($self, %args) = @_;
3691
0
my $uri = $self->endpoint(
3692
'conversations_mark',
3693
);
3694
my $content = encode_json_utf8({
3695
0
%args{grep { exists $args{$_} } qw(channel ts)}
0
3696
});
3697
0
my ($res) = await $self->http_post(
3698
$uri,
3699
$content,
3700
content_type => 'application/json; charset=utf-8',
3701
);
3702
0
0
die $res unless $res->{ok};
3703
0
return $res;
3704
}
3705
3706
3707
=head2 conversations_members
3708
3709
Retrieve members of a conversation.
3710
3711
L
3712
3713
Takes the following named parameters:
3714
3715
=over 4
3716
3717
=item * C - ID of the conversation to retrieve members for (string, optional)
3718
3719
=item * C - The maximum number of items to return. Fewer than the requested number of items may be returned, even if the end of the users list hasn't been reached. (integer, optional)
3720
3721
=item * C - Paginate through collections of data by setting the `cursor` parameter to a `next_cursor` attribute returned by a previous request's `response_metadata`. Default value fetches the first "page" of the collection. See [pagination](/docs/pagination) for more detail. (string, optional)
3722
3723
=back
3724
3725
Resolves to a structure representing the response.
3726
3727
=cut
3728
3729
0
0
1
async sub conversations_members {
3730
0
my ($self, %args) = @_;
3731
my $uri = $self->endpoint(
3732
'conversations_members',
3733
0
%args{grep { exists $args{$_} } qw(channel limit cursor)}
0
3734
);
3735
0
my ($res) = await $self->http_get(
3736
$uri,
3737
);
3738
0
0
die $res unless $res->{ok};
3739
0
return $res;
3740
}
3741
3742
3743
=head2 conversations_open
3744
3745
Opens or resumes a direct message or multi-person direct message.
3746
3747
L
3748
3749
Takes the following named parameters:
3750
3751
=over 4
3752
3753
=item * C - Resume a conversation by supplying an `im` or `mpim`'s ID. Or provide the `users` field instead. (string, optional)
3754
3755
=item * C - Comma separated lists of users. If only one user is included, this creates a 1:1 DM. The ordering of the users is preserved whenever a multi-person direct message is returned. Supply a `channel` when not supplying `users`. (string, optional)
3756
3757
=item * C - Boolean, indicates you want the full IM channel definition in the response. (boolean, optional)
3758
3759
=back
3760
3761
Resolves to a structure representing the response.
3762
3763
=cut
3764
3765
0
0
1
async sub conversations_open {
3766
0
my ($self, %args) = @_;
3767
0
my $uri = $self->endpoint(
3768
'conversations_open',
3769
);
3770
my $content = encode_json_utf8({
3771
0
%args{grep { exists $args{$_} } qw(channel users return_im)}
0
3772
});
3773
0
my ($res) = await $self->http_post(
3774
$uri,
3775
$content,
3776
content_type => 'application/json; charset=utf-8',
3777
);
3778
0
0
die $res unless $res->{ok};
3779
0
return $res;
3780
}
3781
3782
3783
=head2 conversations_rename
3784
3785
Renames a conversation.
3786
3787
L
3788
3789
Takes the following named parameters:
3790
3791
=over 4
3792
3793
=item * C - ID of conversation to rename (string, optional)
3794
3795
=item * C - New name for conversation. (string, optional)
3796
3797
=back
3798
3799
Resolves to a structure representing the response.
3800
3801
=cut
3802
3803
0
0
1
async sub conversations_rename {
3804
0
my ($self, %args) = @_;
3805
0
my $uri = $self->endpoint(
3806
'conversations_rename',
3807
);
3808
my $content = encode_json_utf8({
3809
0
%args{grep { exists $args{$_} } qw(channel name)}
0
3810
});
3811
0
my ($res) = await $self->http_post(
3812
$uri,
3813
$content,
3814
content_type => 'application/json; charset=utf-8',
3815
);
3816
0
0
die $res unless $res->{ok};
3817
0
return $res;
3818
}
3819
3820
3821
=head2 conversations_replies
3822
3823
Retrieve a thread of messages posted to a conversation
3824
3825
L
3826
3827
Takes the following named parameters:
3828
3829
=over 4
3830
3831
=item * C - Conversation ID to fetch thread from. (string, optional)
3832
3833
=item * C - Unique identifier of a thread's parent message. `ts` must be the timestamp of an existing message with 0 or more replies. If there are no replies then just the single message referenced by `ts` will return - it is just an ordinary, unthreaded message. (number, optional)
3834
3835
=item * C - End of time range of messages to include in results. (number, optional)
3836
3837
=item * C - Start of time range of messages to include in results. (number, optional)
3838
3839
=item * C - Include messages with latest or oldest timestamp in results only when either timestamp is specified. (boolean, optional)
3840
3841
=item * C - The maximum number of items to return. Fewer than the requested number of items may be returned, even if the end of the users list hasn't been reached. (integer, optional)
3842
3843
=item * C - Paginate through collections of data by setting the `cursor` parameter to a `next_cursor` attribute returned by a previous request's `response_metadata`. Default value fetches the first "page" of the collection. See [pagination](/docs/pagination) for more detail. (string, optional)
3844
3845
=back
3846
3847
Resolves to a structure representing the response.
3848
3849
=cut
3850
3851
0
0
1
async sub conversations_replies {
3852
0
my ($self, %args) = @_;
3853
my $uri = $self->endpoint(
3854
'conversations_replies',
3855
0
%args{grep { exists $args{$_} } qw(channel ts latest oldest inclusive limit cursor)}
0
3856
);
3857
0
my ($res) = await $self->http_get(
3858
$uri,
3859
);
3860
0
0
die $res unless $res->{ok};
3861
0
return $res;
3862
}
3863
3864
3865
=head2 conversations_set_purpose
3866
3867
Sets the purpose for a conversation.
3868
3869
L
3870
3871
Takes the following named parameters:
3872
3873
=over 4
3874
3875
=item * C - Conversation to set the purpose of (string, optional)
3876
3877
=item * C - A new, specialer purpose (string, optional)
3878
3879
=back
3880
3881
Resolves to a structure representing the response.
3882
3883
=cut
3884
3885
0
0
1
async sub conversations_set_purpose {
3886
0
my ($self, %args) = @_;
3887
0
my $uri = $self->endpoint(
3888
'conversations_set_purpose',
3889
);
3890
my $content = encode_json_utf8({
3891
0
%args{grep { exists $args{$_} } qw(channel purpose)}
0
3892
});
3893
0
my ($res) = await $self->http_post(
3894
$uri,
3895
$content,
3896
content_type => 'application/json; charset=utf-8',
3897
);
3898
0
0
die $res unless $res->{ok};
3899
0
return $res;
3900
}
3901
3902
3903
=head2 conversations_set_topic
3904
3905
Sets the topic for a conversation.
3906
3907
L
3908
3909
Takes the following named parameters:
3910
3911
=over 4
3912
3913
=item * C - Conversation to set the topic of (string, optional)
3914
3915
=item * C - The new topic string. Does not support formatting or linkification. (string, optional)
3916
3917
=back
3918
3919
Resolves to a structure representing the response.
3920
3921
=cut
3922
3923
0
0
1
async sub conversations_set_topic {
3924
0
my ($self, %args) = @_;
3925
0
my $uri = $self->endpoint(
3926
'conversations_set_topic',
3927
);
3928
my $content = encode_json_utf8({
3929
0
%args{grep { exists $args{$_} } qw(channel topic)}
0
3930
});
3931
0
my ($res) = await $self->http_post(
3932
$uri,
3933
$content,
3934
content_type => 'application/json; charset=utf-8',
3935
);
3936
0
0
die $res unless $res->{ok};
3937
0
return $res;
3938
}
3939
3940
3941
=head2 conversations_unarchive
3942
3943
Reverses conversation archival.
3944
3945
L
3946
3947
Takes the following named parameters:
3948
3949
=over 4
3950
3951
=item * C - ID of conversation to unarchive (string, optional)
3952
3953
=back
3954
3955
Resolves to a structure representing the response.
3956
3957
=cut
3958
3959
0
0
1
async sub conversations_unarchive {
3960
0
my ($self, %args) = @_;
3961
0
my $uri = $self->endpoint(
3962
'conversations_unarchive',
3963
);
3964
my $content = encode_json_utf8({
3965
0
%args{grep { exists $args{$_} } qw(channel)}
0
3966
});
3967
0
my ($res) = await $self->http_post(
3968
$uri,
3969
$content,
3970
content_type => 'application/json; charset=utf-8',
3971
);
3972
0
0
die $res unless $res->{ok};
3973
0
return $res;
3974
}
3975
3976
3977
=head2 dialog_open
3978
3979
Open a dialog with a user
3980
3981
L
3982
3983
Takes the following named parameters:
3984
3985
=over 4
3986
3987
=item * C - The dialog definition. This must be a JSON-encoded string. (string, required)
3988
3989
=item * C - Exchange a trigger to post to the user. (string, required)
3990
3991
=back
3992
3993
Resolves to a structure representing the response.
3994
3995
=cut
3996
3997
0
0
1
async sub dialog_open {
3998
0
my ($self, %args) = @_;
3999
0
my $uri = $self->endpoint(
4000
'dialog_open',
4001
);
4002
my $content = encode_json_utf8({
4003
0
%args{grep { exists $args{$_} } qw(dialog trigger_id)}
0
4004
});
4005
0
my ($res) = await $self->http_post(
4006
$uri,
4007
$content,
4008
content_type => 'application/json; charset=utf-8',
4009
);
4010
0
0
die $res unless $res->{ok};
4011
0
return $res;
4012
}
4013
4014
4015
=head2 dnd_end_dnd
4016
4017
Ends the current user's Do Not Disturb session immediately.
4018
4019
L
4020
4021
Resolves to a structure representing the response.
4022
4023
=cut
4024
4025
0
0
1
async sub dnd_end_dnd {
4026
0
my ($self, %args) = @_;
4027
0
my $uri = $self->endpoint(
4028
'dnd_end_dnd',
4029
);
4030
0
my ($res) = await $self->http_post(
4031
$uri,
4032
);
4033
0
0
die $res unless $res->{ok};
4034
0
return $res;
4035
}
4036
4037
4038
=head2 dnd_end_snooze
4039
4040
Ends the current user's snooze mode immediately.
4041
4042
L
4043
4044
Resolves to a structure representing the response.
4045
4046
=cut
4047
4048
0
0
1
async sub dnd_end_snooze {
4049
0
my ($self, %args) = @_;
4050
0
my $uri = $self->endpoint(
4051
'dnd_end_snooze',
4052
);
4053
0
my ($res) = await $self->http_post(
4054
$uri,
4055
);
4056
0
0
die $res unless $res->{ok};
4057
0
return $res;
4058
}
4059
4060
4061
=head2 dnd_info
4062
4063
Retrieves a user's current Do Not Disturb status.
4064
4065
L
4066
4067
Takes the following named parameters:
4068
4069
=over 4
4070
4071
=item * C - User to fetch status for (defaults to current user) (string, optional)
4072
4073
=back
4074
4075
Resolves to a structure representing the response.
4076
4077
=cut
4078
4079
0
0
1
async sub dnd_info {
4080
0
my ($self, %args) = @_;
4081
my $uri = $self->endpoint(
4082
'dnd_info',
4083
0
%args{grep { exists $args{$_} } qw(user)}
0
4084
);
4085
0
my ($res) = await $self->http_get(
4086
$uri,
4087
);
4088
0
0
die $res unless $res->{ok};
4089
0
return $res;
4090
}
4091
4092
4093
=head2 dnd_set_snooze
4094
4095
Turns on Do Not Disturb mode for the current user, or changes its duration.
4096
4097
L
4098
4099
Takes the following named parameters:
4100
4101
=over 4
4102
4103
=item * C - Number of minutes, from now, to snooze until. (string, required)
4104
4105
=back
4106
4107
Resolves to a structure representing the response.
4108
4109
=cut
4110
4111
0
0
1
async sub dnd_set_snooze {
4112
0
my ($self, %args) = @_;
4113
0
my $uri = $self->endpoint(
4114
'dnd_set_snooze',
4115
);
4116
my $content = encode_json_utf8({
4117
0
%args{grep { exists $args{$_} } qw(num_minutes)}
0
4118
});
4119
0
my ($res) = await $self->http_post(
4120
$uri,
4121
$content,
4122
content_type => 'application/json; charset=utf-8',
4123
);
4124
0
0
die $res unless $res->{ok};
4125
0
return $res;
4126
}
4127
4128
4129
=head2 dnd_team_info
4130
4131
Retrieves the Do Not Disturb status for up to 50 users on a team.
4132
4133
L
4134
4135
Takes the following named parameters:
4136
4137
=over 4
4138
4139
=item * C - Comma-separated list of users to fetch Do Not Disturb status for (string, optional)
4140
4141
=back
4142
4143
Resolves to a structure representing the response.
4144
4145
=cut
4146
4147
0
0
1
async sub dnd_team_info {
4148
0
my ($self, %args) = @_;
4149
my $uri = $self->endpoint(
4150
'dnd_team_info',
4151
0
%args{grep { exists $args{$_} } qw(users)}
0
4152
);
4153
0
my ($res) = await $self->http_get(
4154
$uri,
4155
);
4156
0
0
die $res unless $res->{ok};
4157
0
return $res;
4158
}
4159
4160
4161
=head2 emoji_list
4162
4163
Lists custom emoji for a team.
4164
4165
L
4166
4167
Resolves to a structure representing the response.
4168
4169
=cut
4170
4171
0
0
1
async sub emoji_list {
4172
0
my ($self, %args) = @_;
4173
0
my $uri = $self->endpoint(
4174
'emoji_list',
4175
);
4176
0
my ($res) = await $self->http_get(
4177
$uri,
4178
);
4179
0
0
die $res unless $res->{ok};
4180
0
return $res;
4181
}
4182
4183
4184
=head2 files_comments_delete
4185
4186
Deletes an existing comment on a file.
4187
4188
L
4189
4190
Takes the following named parameters:
4191
4192
=over 4
4193
4194
=item * C - File to delete a comment from. (string, optional)
4195
4196
=item * C - The comment to delete. (string, optional)
4197
4198
=back
4199
4200
Resolves to a structure representing the response.
4201
4202
=cut
4203
4204
0
0
1
async sub files_comments_delete {
4205
0
my ($self, %args) = @_;
4206
0
my $uri = $self->endpoint(
4207
'files_comments_delete',
4208
);
4209
my $content = encode_json_utf8({
4210
0
%args{grep { exists $args{$_} } qw(file id)}
0
4211
});
4212
0
my ($res) = await $self->http_post(
4213
$uri,
4214
$content,
4215
content_type => 'application/json; charset=utf-8',
4216
);
4217
0
0
die $res unless $res->{ok};
4218
0
return $res;
4219
}
4220
4221
4222
=head2 files_delete
4223
4224
Deletes a file.
4225
4226
L
4227
4228
Takes the following named parameters:
4229
4230
=over 4
4231
4232
=item * C - ID of file to delete. (string, optional)
4233
4234
=back
4235
4236
Resolves to a structure representing the response.
4237
4238
=cut
4239
4240
0
0
1
async sub files_delete {
4241
0
my ($self, %args) = @_;
4242
0
my $uri = $self->endpoint(
4243
'files_delete',
4244
);
4245
my $content = encode_json_utf8({
4246
0
%args{grep { exists $args{$_} } qw(file)}
0
4247
});
4248
0
my ($res) = await $self->http_post(
4249
$uri,
4250
$content,
4251
content_type => 'application/json; charset=utf-8',
4252
);
4253
0
0
die $res unless $res->{ok};
4254
0
return $res;
4255
}
4256
4257
4258
=head2 files_info
4259
4260
Gets information about a file.
4261
4262
L
4263
4264
Takes the following named parameters:
4265
4266
=over 4
4267
4268
=item * C - Specify a file by providing its ID. (string, optional)
4269
4270
=item * C - (string, optional)
4271
4272
=item * C - (string, optional)
4273
4274
=item * C - The maximum number of items to return. Fewer than the requested number of items may be returned, even if the end of the list hasn't been reached. (integer, optional)
4275
4276
=item * C - Parameter for pagination. File comments are paginated for a single file. Set `cursor` equal to the `next_cursor` attribute returned by the previous request's `response_metadata`. This parameter is optional, but pagination is mandatory: the default value simply fetches the first "page" of the collection of comments. See [pagination](/docs/pagination) for more details. (string, optional)
4277
4278
=back
4279
4280
Resolves to a structure representing the response.
4281
4282
=cut
4283
4284
0
0
1
async sub files_info {
4285
0
my ($self, %args) = @_;
4286
my $uri = $self->endpoint(
4287
'files_info',
4288
0
%args{grep { exists $args{$_} } qw(file count page limit cursor)}
0
4289
);
4290
0
my ($res) = await $self->http_get(
4291
$uri,
4292
);
4293
0
0
die $res unless $res->{ok};
4294
0
return $res;
4295
}
4296
4297
4298
=head2 files_list
4299
4300
List for a team, in a channel, or from a user with applied filters.
4301
4302
L
4303
4304
Takes the following named parameters:
4305
4306
=over 4
4307
4308
=item * C - Filter files created by a single user. (string, optional)
4309
4310
=item * C - Filter files appearing in a specific channel, indicated by its ID. (string, optional)
4311
4312
=item * C - Filter files created after this timestamp (inclusive). (number, optional)
4313
4314
=item * C - Filter files created before this timestamp (inclusive). (number, optional)
4315
4316
=item * C - Filter files by type ([see below](#file_types)). You can pass multiple values in the types argument, like `types=spaces,snippets`.The default value is `all`, which does not filter the list. (string, optional)
4317
4318
=item * C - (string, optional)
4319
4320
=item * C - (string, optional)
4321
4322
=item * C - Show truncated file info for files hidden due to being too old, and the team who owns the file being over the file limit. (boolean, optional)
4323
4324
=back
4325
4326
Resolves to a structure representing the response.
4327
4328
=cut
4329
4330
0
0
1
async sub files_list {
4331
0
my ($self, %args) = @_;
4332
my $uri = $self->endpoint(
4333
'files_list',
4334
0
%args{grep { exists $args{$_} } qw(user channel ts_from ts_to types count page show_files_hidden_by_limit)}
0
4335
);
4336
0
my ($res) = await $self->http_get(
4337
$uri,
4338
);
4339
0
0
die $res unless $res->{ok};
4340
0
return $res;
4341
}
4342
4343
4344
=head2 files_remote_add
4345
4346
Adds a file from a remote service
4347
4348
L
4349
4350
Takes the following named parameters:
4351
4352
=over 4
4353
4354
=item * C - Creator defined GUID for the file. (string, optional)
4355
4356
=item * C - Title of the file being shared. (string, optional)
4357
4358
=item * C - type of file (string, optional)
4359
4360
=item * C - URL of the remote file. (string, optional)
4361
4362
=item * C - Preview of the document via `multipart/form-data`. (string, optional)
4363
4364
=item * C - A text file (txt, pdf, doc, etc.) containing textual search terms that are used to improve discovery of the remote file. (string, optional)
4365
4366
=back
4367
4368
Resolves to a structure representing the response.
4369
4370
=cut
4371
4372
0
0
1
async sub files_remote_add {
4373
0
my ($self, %args) = @_;
4374
0
my $uri = $self->endpoint(
4375
'files_remote_add',
4376
);
4377
my $content = encode_json_utf8({
4378
0
%args{grep { exists $args{$_} } qw(external_id title filetype external_url preview_image indexable_file_contents)}
0
4379
});
4380
0
my ($res) = await $self->http_post(
4381
$uri,
4382
$content,
4383
content_type => 'application/json; charset=utf-8',
4384
);
4385
0
0
die $res unless $res->{ok};
4386
0
return $res;
4387
}
4388
4389
4390
=head2 files_remote_info
4391
4392
Retrieve information about a remote file added to Slack
4393
4394
L
4395
4396
Takes the following named parameters:
4397
4398
=over 4
4399
4400
=item * C - Specify a file by providing its ID. (string, optional)
4401
4402
=item * C - Creator defined GUID for the file. (string, optional)
4403
4404
=back
4405
4406
Resolves to a structure representing the response.
4407
4408
=cut
4409
4410
0
0
1
async sub files_remote_info {
4411
0
my ($self, %args) = @_;
4412
my $uri = $self->endpoint(
4413
'files_remote_info',
4414
0
%args{grep { exists $args{$_} } qw(file external_id)}
0
4415
);
4416
0
my ($res) = await $self->http_get(
4417
$uri,
4418
);
4419
0
0
die $res unless $res->{ok};
4420
0
return $res;
4421
}
4422
4423
4424
=head2 files_remote_list
4425
4426
Retrieve information about a remote file added to Slack
4427
4428
L
4429
4430
Takes the following named parameters:
4431
4432
=over 4
4433
4434
=item * C - Filter files appearing in a specific channel, indicated by its ID. (string, optional)
4435
4436
=item * C - Filter files created after this timestamp (inclusive). (number, optional)
4437
4438
=item * C - Filter files created before this timestamp (inclusive). (number, optional)
4439
4440
=item * C - The maximum number of items to return. (integer, optional)
4441
4442
=item * C - Paginate through collections of data by setting the `cursor` parameter to a `next_cursor` attribute returned by a previous request's `response_metadata`. Default value fetches the first "page" of the collection. See [pagination](/docs/pagination) for more detail. (string, optional)
4443
4444
=back
4445
4446
Resolves to a structure representing the response.
4447
4448
=cut
4449
4450
0
0
1
async sub files_remote_list {
4451
0
my ($self, %args) = @_;
4452
my $uri = $self->endpoint(
4453
'files_remote_list',
4454
0
%args{grep { exists $args{$_} } qw(channel ts_from ts_to limit cursor)}
0
4455
);
4456
0
my ($res) = await $self->http_get(
4457
$uri,
4458
);
4459
0
0
die $res unless $res->{ok};
4460
0
return $res;
4461
}
4462
4463
4464
=head2 files_remote_remove
4465
4466
Remove a remote file.
4467
4468
L
4469
4470
Takes the following named parameters:
4471
4472
=over 4
4473
4474
=item * C - Specify a file by providing its ID. (string, optional)
4475
4476
=item * C - Creator defined GUID for the file. (string, optional)
4477
4478
=back
4479
4480
Resolves to a structure representing the response.
4481
4482
=cut
4483
4484
0
0
1
async sub files_remote_remove {
4485
0
my ($self, %args) = @_;
4486
0
my $uri = $self->endpoint(
4487
'files_remote_remove',
4488
);
4489
my $content = encode_json_utf8({
4490
0
%args{grep { exists $args{$_} } qw(file external_id)}
0
4491
});
4492
0
my ($res) = await $self->http_post(
4493
$uri,
4494
$content,
4495
content_type => 'application/json; charset=utf-8',
4496
);
4497
0
0
die $res unless $res->{ok};
4498
0
return $res;
4499
}
4500
4501
4502
=head2 files_remote_share
4503
4504
Share a remote file into a channel.
4505
4506
L
4507
4508
Takes the following named parameters:
4509
4510
=over 4
4511
4512
=item * C - Specify a file registered with Slack by providing its ID. Either this field or `external_id` or both are required. (string, optional)
4513
4514
=item * C - The globally unique identifier (GUID) for the file, as set by the app registering the file with Slack. Either this field or `file` or both are required. (string, optional)
4515
4516
=item * C - Comma-separated list of channel IDs where the file will be shared. (string, optional)
4517
4518
=back
4519
4520
Resolves to a structure representing the response.
4521
4522
=cut
4523
4524
0
0
1
async sub files_remote_share {
4525
0
my ($self, %args) = @_;
4526
my $uri = $self->endpoint(
4527
'files_remote_share',
4528
0
%args{grep { exists $args{$_} } qw(file external_id channels)}
0
4529
);
4530
0
my ($res) = await $self->http_get(
4531
$uri,
4532
);
4533
0
0
die $res unless $res->{ok};
4534
0
return $res;
4535
}
4536
4537
4538
=head2 files_remote_update
4539
4540
Updates an existing remote file.
4541
4542
L
4543
4544
Takes the following named parameters:
4545
4546
=over 4
4547
4548
=item * C - Specify a file by providing its ID. (string, optional)
4549
4550
=item * C - Creator defined GUID for the file. (string, optional)
4551
4552
=item * C - Title of the file being shared. (string, optional)
4553
4554
=item * C - type of file (string, optional)
4555
4556
=item * C - URL of the remote file. (string, optional)
4557
4558
=item * C - Preview of the document via `multipart/form-data`. (string, optional)
4559
4560
=item * C - File containing contents that can be used to improve searchability for the remote file. (string, optional)
4561
4562
=back
4563
4564
Resolves to a structure representing the response.
4565
4566
=cut
4567
4568
0
0
1
async sub files_remote_update {
4569
0
my ($self, %args) = @_;
4570
0
my $uri = $self->endpoint(
4571
'files_remote_update',
4572
);
4573
my $content = encode_json_utf8({
4574
0
%args{grep { exists $args{$_} } qw(file external_id title filetype external_url preview_image indexable_file_contents)}
0
4575
});
4576
0
my ($res) = await $self->http_post(
4577
$uri,
4578
$content,
4579
content_type => 'application/json; charset=utf-8',
4580
);
4581
0
0
die $res unless $res->{ok};
4582
0
return $res;
4583
}
4584
4585
4586
=head2 files_revoke_public_url
4587
4588
Revokes public/external sharing access for a file
4589
4590
L
4591
4592
Takes the following named parameters:
4593
4594
=over 4
4595
4596
=item * C - File to revoke (string, optional)
4597
4598
=back
4599
4600
Resolves to a structure representing the response.
4601
4602
=cut
4603
4604
0
0
1
async sub files_revoke_public_url {
4605
0
my ($self, %args) = @_;
4606
0
my $uri = $self->endpoint(
4607
'files_revoke_public_url',
4608
);
4609
my $content = encode_json_utf8({
4610
0
%args{grep { exists $args{$_} } qw(file)}
0
4611
});
4612
0
my ($res) = await $self->http_post(
4613
$uri,
4614
$content,
4615
content_type => 'application/json; charset=utf-8',
4616
);
4617
0
0
die $res unless $res->{ok};
4618
0
return $res;
4619
}
4620
4621
4622
=head2 files_shared_public_url
4623
4624
Enables a file for public/external sharing.
4625
4626
L
4627
4628
Takes the following named parameters:
4629
4630
=over 4
4631
4632
=item * C - File to share (string, optional)
4633
4634
=back
4635
4636
Resolves to a structure representing the response.
4637
4638
=cut
4639
4640
0
0
1
async sub files_shared_public_url {
4641
0
my ($self, %args) = @_;
4642
0
my $uri = $self->endpoint(
4643
'files_shared_public_url',
4644
);
4645
my $content = encode_json_utf8({
4646
0
%args{grep { exists $args{$_} } qw(file)}
0
4647
});
4648
0
my ($res) = await $self->http_post(
4649
$uri,
4650
$content,
4651
content_type => 'application/json; charset=utf-8',
4652
);
4653
0
0
die $res unless $res->{ok};
4654
0
return $res;
4655
}
4656
4657
=head2 migration_exchange
4658
4659
For Enterprise Grid workspaces, map local user IDs to global user IDs
4660
4661
L
4662
4663
Takes the following named parameters:
4664
4665
=over 4
4666
4667
=item * C - A comma-separated list of user ids, up to 400 per request (string, required)
4668
4669
=item * C - Specify team_id starts with `T` in case of Org Token (string, optional)
4670
4671
=item * C - Specify `true` to convert `W` global user IDs to workspace-specific `U` IDs. Defaults to `false`. (boolean, optional)
4672
4673
=back
4674
4675
Resolves to a structure representing the response.
4676
4677
=cut
4678
4679
0
0
1
async sub migration_exchange {
4680
0
my ($self, %args) = @_;
4681
my $uri = $self->endpoint(
4682
'migration_exchange',
4683
0
%args{grep { exists $args{$_} } qw(users team_id to_old)}
0
4684
);
4685
0
my ($res) = await $self->http_get(
4686
$uri,
4687
);
4688
0
0
die $res unless $res->{ok};
4689
0
return $res;
4690
}
4691
4692
4693
=head2 oauth_access
4694
4695
Exchanges a temporary OAuth verifier code for an access token.
4696
4697
L
4698
4699
Takes the following named parameters:
4700
4701
=over 4
4702
4703
=item * C - Issued when you created your application. (string, optional)
4704
4705
=item * C - Issued when you created your application. (string, optional)
4706
4707
=item * C - The `code` param returned via the OAuth callback. (string, optional)
4708
4709
=item * C - This must match the originally submitted URI (if one was sent). (string, optional)
4710
4711
=item * C - Request the user to add your app only to a single channel. Only valid with a [legacy workspace app](https://api.slack.com/legacy-workspace-apps). (boolean, optional)
4712
4713
=back
4714
4715
Resolves to a structure representing the response.
4716
4717
=cut
4718
4719
0
0
1
async sub oauth_access {
4720
0
my ($self, %args) = @_;
4721
my $uri = $self->endpoint(
4722
'oauth_access',
4723
0
%args{grep { exists $args{$_} } qw(client_id client_secret code redirect_uri single_channel)}
0
4724
);
4725
0
my ($res) = await $self->http_get(
4726
$uri,
4727
);
4728
0
0
die $res unless $res->{ok};
4729
0
return $res;
4730
}
4731
4732
4733
=head2 oauth_token
4734
4735
Exchanges a temporary OAuth verifier code for a workspace token.
4736
4737
L
4738
4739
Takes the following named parameters:
4740
4741
=over 4
4742
4743
=item * C - Issued when you created your application. (string, optional)
4744
4745
=item * C - Issued when you created your application. (string, optional)
4746
4747
=item * C - The `code` param returned via the OAuth callback. (string, optional)
4748
4749
=item * C - This must match the originally submitted URI (if one was sent). (string, optional)
4750
4751
=item * C - Request the user to add your app only to a single channel. (boolean, optional)
4752
4753
=back
4754
4755
Resolves to a structure representing the response.
4756
4757
=cut
4758
4759
0
0
1
async sub oauth_token {
4760
0
my ($self, %args) = @_;
4761
my $uri = $self->endpoint(
4762
'oauth_token',
4763
0
%args{grep { exists $args{$_} } qw(client_id client_secret code redirect_uri single_channel)}
0
4764
);
4765
0
my ($res) = await $self->http_get(
4766
$uri,
4767
);
4768
0
0
die $res unless $res->{ok};
4769
0
return $res;
4770
}
4771
4772
4773
=head2 oauth_v2_access
4774
4775
Exchanges a temporary OAuth verifier code for an access token.
4776
4777
L
4778
4779
Takes the following named parameters:
4780
4781
=over 4
4782
4783
=item * C - Issued when you created your application. (string, optional)
4784
4785
=item * C - Issued when you created your application. (string, optional)
4786
4787
=item * C - The `code` param returned via the OAuth callback. (string, required)
4788
4789
=item * C - This must match the originally submitted URI (if one was sent). (string, optional)
4790
4791
=back
4792
4793
Resolves to a structure representing the response.
4794
4795
=cut
4796
4797
0
0
1
async sub oauth_v2_access {
4798
0
my ($self, %args) = @_;
4799
my $uri = $self->endpoint(
4800
'oauth_v2_access',
4801
0
%args{grep { exists $args{$_} } qw(client_id client_secret code redirect_uri)}
0
4802
);
4803
0
my ($res) = await $self->http_get(
4804
$uri,
4805
);
4806
0
0
die $res unless $res->{ok};
4807
0
return $res;
4808
}
4809
4810
4811
=head2 pins_add
4812
4813
Pins an item to a channel.
4814
4815
L
4816
4817
Takes the following named parameters:
4818
4819
=over 4
4820
4821
=item * C - Channel to pin the item in. (string, required)
4822
4823
=item * C - Timestamp of the message to pin. (string, optional)
4824
4825
=back
4826
4827
Resolves to a structure representing the response.
4828
4829
=cut
4830
4831
0
0
1
async sub pins_add {
4832
0
my ($self, %args) = @_;
4833
0
my $uri = $self->endpoint(
4834
'pins_add',
4835
);
4836
my $content = encode_json_utf8({
4837
0
%args{grep { exists $args{$_} } qw(channel timestamp)}
0
4838
});
4839
0
my ($res) = await $self->http_post(
4840
$uri,
4841
$content,
4842
content_type => 'application/json; charset=utf-8',
4843
);
4844
0
0
die $res unless $res->{ok};
4845
0
return $res;
4846
}
4847
4848
4849
=head2 pins_list
4850
4851
Lists items pinned to a channel.
4852
4853
L
4854
4855
Takes the following named parameters:
4856
4857
=over 4
4858
4859
=item * C - Channel to get pinned items for. (string, required)
4860
4861
=back
4862
4863
Resolves to a structure representing the response.
4864
4865
=cut
4866
4867
0
0
1
async sub pins_list {
4868
0
my ($self, %args) = @_;
4869
my $uri = $self->endpoint(
4870
'pins_list',
4871
0
%args{grep { exists $args{$_} } qw(channel)}
0
4872
);
4873
0
my ($res) = await $self->http_get(
4874
$uri,
4875
);
4876
0
return $res;
4877
}
4878
4879
4880
=head2 pins_remove
4881
4882
Un-pins an item from a channel.
4883
4884
L
4885
4886
Takes the following named parameters:
4887
4888
=over 4
4889
4890
=item * C - Channel where the item is pinned to. (string, required)
4891
4892
=item * C - Timestamp of the message to un-pin. (string, optional)
4893
4894
=back
4895
4896
Resolves to a structure representing the response.
4897
4898
=cut
4899
4900
0
0
1
async sub pins_remove {
4901
0
my ($self, %args) = @_;
4902
0
my $uri = $self->endpoint(
4903
'pins_remove',
4904
);
4905
my $content = encode_json_utf8({
4906
0
%args{grep { exists $args{$_} } qw(channel timestamp)}
0
4907
});
4908
0
my ($res) = await $self->http_post(
4909
$uri,
4910
$content,
4911
content_type => 'application/json; charset=utf-8',
4912
);
4913
0
0
die $res unless $res->{ok};
4914
0
return $res;
4915
}
4916
4917
4918
=head2 reactions_add
4919
4920
Adds a reaction to an item.
4921
4922
L
4923
4924
Takes the following named parameters:
4925
4926
=over 4
4927
4928
=item * C - Channel where the message to add reaction to was posted. (string, required)
4929
4930
=item * C - Reaction (emoji) name. (string, required)
4931
4932
=item * C - Timestamp of the message to add reaction to. (string, required)
4933
4934
=back
4935
4936
Resolves to a structure representing the response.
4937
4938
=cut
4939
4940
0
0
1
async sub reactions_add {
4941
0
my ($self, %args) = @_;
4942
0
my $uri = $self->endpoint(
4943
'reactions_add',
4944
);
4945
my $content = encode_json_utf8({
4946
0
%args{grep { exists $args{$_} } qw(channel name timestamp)}
0
4947
});
4948
0
my ($res) = await $self->http_post(
4949
$uri,
4950
$content,
4951
content_type => 'application/json; charset=utf-8',
4952
);
4953
0
0
die $res unless $res->{ok};
4954
0
return $res;
4955
}
4956
4957
4958
=head2 reactions_get
4959
4960
Gets reactions for an item.
4961
4962
L
4963
4964
Takes the following named parameters:
4965
4966
=over 4
4967
4968
=item * C - Channel where the message to get reactions for was posted. (string, optional)
4969
4970
=item * C - File to get reactions for. (string, optional)
4971
4972
=item * C - File comment to get reactions for. (string, optional)
4973
4974
=item * C - If true always return the complete reaction list. (boolean, optional)
4975
4976
=item * C - Timestamp of the message to get reactions for. (string, optional)
4977
4978
=back
4979
4980
Resolves to a structure representing the response.
4981
4982
=cut
4983
4984
0
0
1
async sub reactions_get {
4985
0
my ($self, %args) = @_;
4986
my $uri = $self->endpoint(
4987
'reactions_get',
4988
0
%args{grep { exists $args{$_} } qw(channel file file_comment full timestamp)}
0
4989
);
4990
0
my ($res) = await $self->http_get(
4991
$uri,
4992
);
4993
0
return $res;
4994
}
4995
4996
4997
=head2 reactions_list
4998
4999
Lists reactions made by a user.
5000
5001
L
5002
5003
Takes the following named parameters:
5004
5005
=over 4
5006
5007
=item * C - Show reactions made by this user. Defaults to the authed user. (string, optional)
5008
5009
=item * C - If true always return the complete reaction list. (boolean, optional)
5010
5011
=item * C - (integer, optional)
5012
5013
=item * C - (integer, optional)
5014
5015
=item * C - Parameter for pagination. Set `cursor` equal to the `next_cursor` attribute returned by the previous request's `response_metadata`. This parameter is optional, but pagination is mandatory: the default value simply fetches the first "page" of the collection. See [pagination](/docs/pagination) for more details. (string, optional)
5016
5017
=item * C - The maximum number of items to return. Fewer than the requested number of items may be returned, even if the end of the list hasn't been reached. (integer, optional)
5018
5019
=back
5020
5021
Resolves to a structure representing the response.
5022
5023
=cut
5024
5025
0
0
1
async sub reactions_list {
5026
0
my ($self, %args) = @_;
5027
my $uri = $self->endpoint(
5028
'reactions_list',
5029
0
%args{grep { exists $args{$_} } qw(user full count page cursor limit)}
0
5030
);
5031
0
my ($res) = await $self->http_get(
5032
$uri,
5033
);
5034
0
0
die $res unless $res->{ok};
5035
0
return $res;
5036
}
5037
5038
5039
=head2 reactions_remove
5040
5041
Removes a reaction from an item.
5042
5043
L
5044
5045
Takes the following named parameters:
5046
5047
=over 4
5048
5049
=item * C - Reaction (emoji) name. (string, required)
5050
5051
=item * C - File to remove reaction from. (string, optional)
5052
5053
=item * C - File comment to remove reaction from. (string, optional)
5054
5055
=item * C - Channel where the message to remove reaction from was posted. (string, optional)
5056
5057
=item * C - Timestamp of the message to remove reaction from. (string, optional)
5058
5059
=back
5060
5061
Resolves to a structure representing the response.
5062
5063
=cut
5064
5065
0
0
1
async sub reactions_remove {
5066
0
my ($self, %args) = @_;
5067
0
my $uri = $self->endpoint(
5068
'reactions_remove',
5069
);
5070
my $content = encode_json_utf8({
5071
0
%args{grep { exists $args{$_} } qw(name file file_comment channel timestamp)}
0
5072
});
5073
0
my ($res) = await $self->http_post(
5074
$uri,
5075
$content,
5076
content_type => 'application/json; charset=utf-8',
5077
);
5078
0
0
die $res unless $res->{ok};
5079
0
return $res;
5080
}
5081
5082
5083
=head2 reminders_add
5084
5085
Creates a reminder.
5086
5087
L
5088
5089
Takes the following named parameters:
5090
5091
=over 4
5092
5093
=item * C - The content of the reminder (string, required)
5094
5095
=item * C - When this reminder should happen: the Unix timestamp (up to five years from now), the number of seconds until the reminder (if within 24 hours), or a natural language description (Ex. "in 15 minutes," or "every Thursday") (string, required)
5096
5097
=item * C - The user who will receive the reminder. If no user is specified, the reminder will go to user who created it. (string, optional)
5098
5099
=back
5100
5101
Resolves to a structure representing the response.
5102
5103
=cut
5104
5105
0
0
1
async sub reminders_add {
5106
0
my ($self, %args) = @_;
5107
0
my $uri = $self->endpoint(
5108
'reminders_add',
5109
);
5110
my $content = encode_json_utf8({
5111
0
%args{grep { exists $args{$_} } qw(text time user)}
0
5112
});
5113
0
my ($res) = await $self->http_post(
5114
$uri,
5115
$content,
5116
content_type => 'application/json; charset=utf-8',
5117
);
5118
0
0
die $res unless $res->{ok};
5119
0
return $res;
5120
}
5121
5122
5123
=head2 reminders_complete
5124
5125
Marks a reminder as complete.
5126
5127
L
5128
5129
Takes the following named parameters:
5130
5131
=over 4
5132
5133
=item * C - The ID of the reminder to be marked as complete (string, optional)
5134
5135
=back
5136
5137
Resolves to a structure representing the response.
5138
5139
=cut
5140
5141
0
0
1
async sub reminders_complete {
5142
0
my ($self, %args) = @_;
5143
0
my $uri = $self->endpoint(
5144
'reminders_complete',
5145
);
5146
my $content = encode_json_utf8({
5147
0
%args{grep { exists $args{$_} } qw(reminder)}
0
5148
});
5149
0
my ($res) = await $self->http_post(
5150
$uri,
5151
$content,
5152
content_type => 'application/json; charset=utf-8',
5153
);
5154
0
0
die $res unless $res->{ok};
5155
0
return $res;
5156
}
5157
5158
5159
=head2 reminders_delete
5160
5161
Deletes a reminder.
5162
5163
L
5164
5165
Takes the following named parameters:
5166
5167
=over 4
5168
5169
=item * C - The ID of the reminder (string, optional)
5170
5171
=back
5172
5173
Resolves to a structure representing the response.
5174
5175
=cut
5176
5177
0
0
1
async sub reminders_delete {
5178
0
my ($self, %args) = @_;
5179
0
my $uri = $self->endpoint(
5180
'reminders_delete',
5181
);
5182
my $content = encode_json_utf8({
5183
0
%args{grep { exists $args{$_} } qw(reminder)}
0
5184
});
5185
0
my ($res) = await $self->http_post(
5186
$uri,
5187
$content,
5188
content_type => 'application/json; charset=utf-8',
5189
);
5190
0
0
die $res unless $res->{ok};
5191
0
return $res;
5192
}
5193
5194
5195
=head2 reminders_info
5196
5197
Gets information about a reminder.
5198
5199
L
5200
5201
Takes the following named parameters:
5202
5203
=over 4
5204
5205
=item * C - The ID of the reminder (string, optional)
5206
5207
=back
5208
5209
Resolves to a structure representing the response.
5210
5211
=cut
5212
5213
0
0
1
async sub reminders_info {
5214
0
my ($self, %args) = @_;
5215
my $uri = $self->endpoint(
5216
'reminders_info',
5217
0
%args{grep { exists $args{$_} } qw(reminder)}
0
5218
);
5219
0
my ($res) = await $self->http_get(
5220
$uri,
5221
);
5222
0
0
die $res unless $res->{ok};
5223
0
return $res;
5224
}
5225
5226
5227
=head2 reminders_list
5228
5229
Lists all reminders created by or for a given user.
5230
5231
L
5232
5233
Resolves to a structure representing the response.
5234
5235
=cut
5236
5237
0
0
1
async sub reminders_list {
5238
0
my ($self, %args) = @_;
5239
0
my $uri = $self->endpoint(
5240
'reminders_list',
5241
);
5242
0
my ($res) = await $self->http_get(
5243
$uri,
5244
);
5245
0
0
die $res unless $res->{ok};
5246
0
return $res;
5247
}
5248
5249
5250
=head2 rtm_connect
5251
5252
Starts a Real Time Messaging session.
5253
5254
L
5255
5256
Takes the following named parameters:
5257
5258
=over 4
5259
5260
=item * C - Batch presence deliveries via subscription. Enabling changes the shape of `presence_change` events. See [batch presence](/docs/presence-and-status#batching). (boolean, optional)
5261
5262
=item * C - Only deliver presence events when requested by subscription. See [presence subscriptions](/docs/presence-and-status#subscriptions). (boolean, optional)
5263
5264
=back
5265
5266
Resolves to a structure representing the response.
5267
5268
=cut
5269
5270
0
0
1
async sub rtm_connect {
5271
0
my ($self, %args) = @_;
5272
my $uri = $self->endpoint(
5273
'rtm_connect',
5274
0
%args{grep { exists $args{$_} } qw(batch_presence_aware presence_sub)}
0
5275
);
5276
0
my ($res) = await $self->http_get(
5277
$uri,
5278
);
5279
0
0
die $res unless $res->{ok};
5280
0
return $res;
5281
}
5282
5283
5284
=head2 search_messages
5285
5286
Searches for messages matching a query.
5287
5288
L
5289
5290
Takes the following named parameters:
5291
5292
=over 4
5293
5294
=item * C - Pass the number of results you want per "page". Maximum of `100`. (integer, optional)
5295
5296
=item * C - Pass a value of `true` to enable query highlight markers (see below). (boolean, optional)
5297
5298
=item * C - (integer, optional)
5299
5300
=item * C - Search query. (string, required)
5301
5302
=item * C - Return matches sorted by either `score` or `timestamp`. (string, optional)
5303
5304
=item * C - Change sort direction to ascending (`asc`) or descending (`desc`). (string, optional)
5305
5306
=back
5307
5308
Resolves to a structure representing the response.
5309
5310
=cut
5311
5312
0
0
1
async sub search_messages {
5313
0
my ($self, %args) = @_;
5314
my $uri = $self->endpoint(
5315
'search_messages',
5316
0
%args{grep { exists $args{$_} } qw(count highlight page query sort sort_dir)}
0
5317
);
5318
0
my ($res) = await $self->http_get(
5319
$uri,
5320
);
5321
0
0
die $res unless $res->{ok};
5322
0
return $res;
5323
}
5324
5325
5326
=head2 stars_add
5327
5328
Adds a star to an item.
5329
5330
L
5331
5332
Takes the following named parameters:
5333
5334
=over 4
5335
5336
=item * C - Channel to add star to, or channel where the message to add star to was posted (used with `timestamp`). (string, optional)
5337
5338
=item * C - File to add star to. (string, optional)
5339
5340
=item * C - File comment to add star to. (string, optional)
5341
5342
=item * C - Timestamp of the message to add star to. (string, optional)
5343
5344
=back
5345
5346
Resolves to a structure representing the response.
5347
5348
=cut
5349
5350
0
0
1
async sub stars_add {
5351
0
my ($self, %args) = @_;
5352
0
my $uri = $self->endpoint(
5353
'stars_add',
5354
);
5355
my $content = encode_json_utf8({
5356
0
%args{grep { exists $args{$_} } qw(channel file file_comment timestamp)}
0
5357
});
5358
0
my ($res) = await $self->http_post(
5359
$uri,
5360
$content,
5361
content_type => 'application/json; charset=utf-8',
5362
);
5363
0
0
die $res unless $res->{ok};
5364
0
return $res;
5365
}
5366
5367
5368
=head2 stars_list
5369
5370
Lists stars for a user.
5371
5372
L
5373
5374
Takes the following named parameters:
5375
5376
=over 4
5377
5378
=item * C - (string, optional)
5379
5380
=item * C - (string, optional)
5381
5382
=item * C - Parameter for pagination. Set `cursor` equal to the `next_cursor` attribute returned by the previous request's `response_metadata`. This parameter is optional, but pagination is mandatory: the default value simply fetches the first "page" of the collection. See [pagination](/docs/pagination) for more details. (string, optional)
5383
5384
=item * C - The maximum number of items to return. Fewer than the requested number of items may be returned, even if the end of the list hasn't been reached. (integer, optional)
5385
5386
=back
5387
5388
Resolves to a structure representing the response.
5389
5390
=cut
5391
5392
0
0
1
async sub stars_list {
5393
0
my ($self, %args) = @_;
5394
my $uri = $self->endpoint(
5395
'stars_list',
5396
0
%args{grep { exists $args{$_} } qw(count page cursor limit)}
0
5397
);
5398
0
my ($res) = await $self->http_get(
5399
$uri,
5400
);
5401
0
0
die $res unless $res->{ok};
5402
0
return $res;
5403
}
5404
5405
5406
=head2 stars_remove
5407
5408
Removes a star from an item.
5409
5410
L
5411
5412
Takes the following named parameters:
5413
5414
=over 4
5415
5416
=item * C - Channel to remove star from, or channel where the message to remove star from was posted (used with `timestamp`). (string, optional)
5417
5418
=item * C - File to remove star from. (string, optional)
5419
5420
=item * C - File comment to remove star from. (string, optional)
5421
5422
=item * C - Timestamp of the message to remove star from. (string, optional)
5423
5424
=back
5425
5426
Resolves to a structure representing the response.
5427
5428
=cut
5429
5430
0
0
1
async sub stars_remove {
5431
0
my ($self, %args) = @_;
5432
0
my $uri = $self->endpoint(
5433
'stars_remove',
5434
);
5435
my $content = encode_json_utf8({
5436
0
%args{grep { exists $args{$_} } qw(channel file file_comment timestamp)}
0
5437
});
5438
0
my ($res) = await $self->http_post(
5439
$uri,
5440
$content,
5441
content_type => 'application/json; charset=utf-8',
5442
);
5443
0
0
die $res unless $res->{ok};
5444
0
return $res;
5445
}
5446
5447
5448
=head2 team_access_logs
5449
5450
Gets the access logs for the current team.
5451
5452
L
5453
5454
Takes the following named parameters:
5455
5456
=over 4
5457
5458
=item * C - End of time range of logs to include in results (inclusive). (string, optional)
5459
5460
=item * C - (string, optional)
5461
5462
=item * C - (string, optional)
5463
5464
=back
5465
5466
Resolves to a structure representing the response.
5467
5468
=cut
5469
5470
0
0
1
async sub team_access_logs {
5471
0
my ($self, %args) = @_;
5472
my $uri = $self->endpoint(
5473
'team_access_logs',
5474
0
%args{grep { exists $args{$_} } qw(before count page)}
0
5475
);
5476
0
my ($res) = await $self->http_get(
5477
$uri,
5478
);
5479
0
0
die $res unless $res->{ok};
5480
0
return $res;
5481
}
5482
5483
5484
=head2 team_billable_info
5485
5486
Gets billable users information for the current team.
5487
5488
L
5489
5490
Takes the following named parameters:
5491
5492
=over 4
5493
5494
=item * C - A user to retrieve the billable information for. Defaults to all users. (string, optional)
5495
5496
=back
5497
5498
Resolves to a structure representing the response.
5499
5500
=cut
5501
5502
0
0
1
async sub team_billable_info {
5503
0
my ($self, %args) = @_;
5504
my $uri = $self->endpoint(
5505
'team_billable_info',
5506
0
%args{grep { exists $args{$_} } qw(user)}
0
5507
);
5508
0
my ($res) = await $self->http_get(
5509
$uri,
5510
);
5511
0
0
die $res unless $res->{ok};
5512
0
return $res;
5513
}
5514
5515
5516
=head2 team_info
5517
5518
Gets information about the current team.
5519
5520
L
5521
5522
Takes the following named parameters:
5523
5524
=over 4
5525
5526
=item * C - Team to get info on, if omitted, will return information about the current team. Will only return team that the authenticated token is allowed to see through external shared channels (string, optional)
5527
5528
=back
5529
5530
Resolves to a structure representing the response.
5531
5532
=cut
5533
5534
0
0
1
async sub team_info {
5535
0
my ($self, %args) = @_;
5536
my $uri = $self->endpoint(
5537
'team_info',
5538
0
%args{grep { exists $args{$_} } qw(team)}
0
5539
);
5540
0
my ($res) = await $self->http_get(
5541
$uri,
5542
);
5543
0
0
die $res unless $res->{ok};
5544
0
return $res;
5545
}
5546
5547
5548
=head2 team_integration_logs
5549
5550
Gets the integration logs for the current team.
5551
5552
L
5553
5554
Takes the following named parameters:
5555
5556
=over 4
5557
5558
=item * C - Filter logs to this Slack app. Defaults to all logs. (string, optional)
5559
5560
=item * C - Filter logs with this change type. Defaults to all logs. (string, optional)
5561
5562
=item * C - (string, optional)
5563
5564
=item * C - (string, optional)
5565
5566
=item * C - Filter logs to this service. Defaults to all logs. (string, optional)
5567
5568
=item * C - Filter logs generated by this user’s actions. Defaults to all logs. (string, optional)
5569
5570
=back
5571
5572
Resolves to a structure representing the response.
5573
5574
=cut
5575
5576
0
0
1
async sub team_integration_logs {
5577
0
my ($self, %args) = @_;
5578
my $uri = $self->endpoint(
5579
'team_integration_logs',
5580
0
%args{grep { exists $args{$_} } qw(app_id change_type count page service_id user)}
0
5581
);
5582
0
my ($res) = await $self->http_get(
5583
$uri,
5584
);
5585
0
0
die $res unless $res->{ok};
5586
0
return $res;
5587
}
5588
5589
5590
=head2 team_profile_get
5591
5592
Retrieve a team's profile.
5593
5594
L
5595
5596
Takes the following named parameters:
5597
5598
=over 4
5599
5600
=item * C - Filter by visibility. (string, optional)
5601
5602
=back
5603
5604
Resolves to a structure representing the response.
5605
5606
=cut
5607
5608
0
0
1
async sub team_profile_get {
5609
0
my ($self, %args) = @_;
5610
my $uri = $self->endpoint(
5611
'team_profile_get',
5612
0
%args{grep { exists $args{$_} } qw(visibility)}
0
5613
);
5614
0
my ($res) = await $self->http_get(
5615
$uri,
5616
);
5617
0
0
die $res unless $res->{ok};
5618
0
return $res;
5619
}
5620
5621
5622
=head2 usergroups_create
5623
5624
Create a User Group
5625
5626
L
5627
5628
Takes the following named parameters:
5629
5630
=over 4
5631
5632
=item * C - A comma separated string of encoded channel IDs for which the User Group uses as a default. (string, optional)
5633
5634
=item * C - A short description of the User Group. (string, optional)
5635
5636
=item * C - A mention handle. Must be unique among channels, users and User Groups. (string, optional)
5637
5638
=item * C - Include the number of users in each User Group. (boolean, optional)
5639
5640
=item * C - A name for the User Group. Must be unique among User Groups. (string, required)
5641
5642
=back
5643
5644
Resolves to a structure representing the response.
5645
5646
=cut
5647
5648
0
0
1
async sub usergroups_create {
5649
0
my ($self, %args) = @_;
5650
0
my $uri = $self->endpoint(
5651
'usergroups_create',
5652
);
5653
my $content = encode_json_utf8({
5654
0
%args{grep { exists $args{$_} } qw(channels description handle include_count name)}
0
5655
});
5656
0
my ($res) = await $self->http_post(
5657
$uri,
5658
$content,
5659
content_type => 'application/json; charset=utf-8',
5660
);
5661
0
0
die $res unless $res->{ok};
5662
0
return $res;
5663
}
5664
5665
5666
=head2 usergroups_disable
5667
5668
Disable an existing User Group
5669
5670
L
5671
5672
Takes the following named parameters:
5673
5674
=over 4
5675
5676
=item * C - Include the number of users in the User Group. (boolean, optional)
5677
5678
=item * C - The encoded ID of the User Group to disable. (string, required)
5679
5680
=back
5681
5682
Resolves to a structure representing the response.
5683
5684
=cut
5685
5686
0
0
1
async sub usergroups_disable {
5687
0
my ($self, %args) = @_;
5688
0
my $uri = $self->endpoint(
5689
'usergroups_disable',
5690
);
5691
my $content = encode_json_utf8({
5692
0
%args{grep { exists $args{$_} } qw(include_count usergroup)}
0
5693
});
5694
0
my ($res) = await $self->http_post(
5695
$uri,
5696
$content,
5697
content_type => 'application/json; charset=utf-8',
5698
);
5699
0
0
die $res unless $res->{ok};
5700
0
return $res;
5701
}
5702
5703
5704
=head2 usergroups_enable
5705
5706
Enable a User Group
5707
5708
L
5709
5710
Takes the following named parameters:
5711
5712
=over 4
5713
5714
=item * C - Include the number of users in the User Group. (boolean, optional)
5715
5716
=item * C - The encoded ID of the User Group to enable. (string, required)
5717
5718
=back
5719
5720
Resolves to a structure representing the response.
5721
5722
=cut
5723
5724
0
0
1
async sub usergroups_enable {
5725
0
my ($self, %args) = @_;
5726
0
my $uri = $self->endpoint(
5727
'usergroups_enable',
5728
);
5729
my $content = encode_json_utf8({
5730
0
%args{grep { exists $args{$_} } qw(include_count usergroup)}
0
5731
});
5732
0
my ($res) = await $self->http_post(
5733
$uri,
5734
$content,
5735
content_type => 'application/json; charset=utf-8',
5736
);
5737
0
0
die $res unless $res->{ok};
5738
0
return $res;
5739
}
5740
5741
5742
=head2 usergroups_list
5743
5744
List all User Groups for a team
5745
5746
L
5747
5748
Takes the following named parameters:
5749
5750
=over 4
5751
5752
=item * C - Include the list of users for each User Group. (boolean, optional)
5753
5754
=item * C - Include the number of users in each User Group. (boolean, optional)
5755
5756
=item * C - Include disabled User Groups. (boolean, optional)
5757
5758
=back
5759
5760
Resolves to a structure representing the response.
5761
5762
=cut
5763
5764
0
0
1
async sub usergroups_list {
5765
0
my ($self, %args) = @_;
5766
my $uri = $self->endpoint(
5767
'usergroups_list',
5768
0
%args{grep { exists $args{$_} } qw(include_users include_count include_disabled)}
0
5769
);
5770
0
my ($res) = await $self->http_get(
5771
$uri,
5772
);
5773
0
0
die $res unless $res->{ok};
5774
0
return $res;
5775
}
5776
5777
5778
=head2 usergroups_update
5779
5780
Update an existing User Group
5781
5782
L
5783
5784
Takes the following named parameters:
5785
5786
=over 4
5787
5788
=item * C - A mention handle. Must be unique among channels, users and User Groups. (string, optional)
5789
5790
=item * C - A short description of the User Group. (string, optional)
5791
5792
=item * C - A comma separated string of encoded channel IDs for which the User Group uses as a default. (string, optional)
5793
5794
=item * C - Include the number of users in the User Group. (boolean, optional)
5795
5796
=item * C - The encoded ID of the User Group to update. (string, required)
5797
5798
=item * C - A name for the User Group. Must be unique among User Groups. (string, optional)
5799
5800
=back
5801
5802
Resolves to a structure representing the response.
5803
5804
=cut
5805
5806
0
0
1
async sub usergroups_update {
5807
0
my ($self, %args) = @_;
5808
0
my $uri = $self->endpoint(
5809
'usergroups_update',
5810
);
5811
my $content = encode_json_utf8({
5812
0
%args{grep { exists $args{$_} } qw(handle description channels include_count usergroup name)}
0
5813
});
5814
0
my ($res) = await $self->http_post(
5815
$uri,
5816
$content,
5817
content_type => 'application/json; charset=utf-8',
5818
);
5819
0
0
die $res unless $res->{ok};
5820
0
return $res;
5821
}
5822
5823
5824
=head2 usergroups_users_list
5825
5826
List all users in a User Group
5827
5828
L
5829
5830
Takes the following named parameters:
5831
5832
=over 4
5833
5834
=item * C - Allow results that involve disabled User Groups. (boolean, optional)
5835
5836
=item * C - The encoded ID of the User Group to update. (string, required)
5837
5838
=back
5839
5840
Resolves to a structure representing the response.
5841
5842
=cut
5843
5844
0
0
1
async sub usergroups_users_list {
5845
0
my ($self, %args) = @_;
5846
my $uri = $self->endpoint(
5847
'usergroups_users_list',
5848
0
%args{grep { exists $args{$_} } qw(include_disabled usergroup)}
0
5849
);
5850
0
my ($res) = await $self->http_get(
5851
$uri,
5852
);
5853
0
0
die $res unless $res->{ok};
5854
0
return $res;
5855
}
5856
5857
5858
=head2 usergroups_users_update
5859
5860
Update the list of users for a User Group
5861
5862
L
5863
5864
Takes the following named parameters:
5865
5866
=over 4
5867
5868
=item * C - Include the number of users in the User Group. (boolean, optional)
5869
5870
=item * C - The encoded ID of the User Group to update. (string, required)
5871
5872
=item * C - A comma separated string of encoded user IDs that represent the entire list of users for the User Group. (string, required)
5873
5874
=back
5875
5876
Resolves to a structure representing the response.
5877
5878
=cut
5879
5880
0
0
1
async sub usergroups_users_update {
5881
0
my ($self, %args) = @_;
5882
0
my $uri = $self->endpoint(
5883
'usergroups_users_update',
5884
);
5885
my $content = encode_json_utf8({
5886
0
%args{grep { exists $args{$_} } qw(include_count usergroup users)}
0
5887
});
5888
0
my ($res) = await $self->http_post(
5889
$uri,
5890
$content,
5891
content_type => 'application/json; charset=utf-8',
5892
);
5893
0
0
die $res unless $res->{ok};
5894
0
return $res;
5895
}
5896
5897
5898
=head2 users_conversations
5899
5900
List conversations the calling user may access.
5901
5902
L
5903
5904
Takes the following named parameters:
5905
5906
=over 4
5907
5908
=item * C - Browse conversations by a specific user ID's membership. Non-public channels are restricted to those where the calling user shares membership. (string, optional)
5909
5910
=item * C - Mix and match channel types by providing a comma-separated list of any combination of `public_channel`, `private_channel`, `mpim`, `im` (string, optional)
5911
5912
=item * C - Set to `true` to exclude archived channels from the list (boolean, optional)
5913
5914
=item * C - The maximum number of items to return. Fewer than the requested number of items may be returned, even if the end of the list hasn't been reached. Must be an integer no larger than 1000. (integer, optional)
5915
5916
=item * C - Paginate through collections of data by setting the `cursor` parameter to a `next_cursor` attribute returned by a previous request's `response_metadata`. Default value fetches the first "page" of the collection. See [pagination](/docs/pagination) for more detail. (string, optional)
5917
5918
=back
5919
5920
Resolves to a structure representing the response.
5921
5922
=cut
5923
5924
0
0
1
async sub users_conversations {
5925
0
my ($self, %args) = @_;
5926
my $uri = $self->endpoint(
5927
'users_conversations',
5928
0
%args{grep { exists $args{$_} } qw(user types exclude_archived limit cursor)}
0
5929
);
5930
0
my ($res) = await $self->http_get(
5931
$uri,
5932
);
5933
0
0
die $res unless $res->{ok};
5934
0
return $res;
5935
}
5936
5937
5938
=head2 users_delete_photo
5939
5940
Delete the user profile photo
5941
5942
L
5943
5944
Resolves to a structure representing the response.
5945
5946
=cut
5947
5948
0
0
1
async sub users_delete_photo {
5949
0
my ($self, %args) = @_;
5950
0
my $uri = $self->endpoint(
5951
'users_delete_photo',
5952
);
5953
0
my ($res) = await $self->http_post(
5954
$uri,
5955
);
5956
0
0
die $res unless $res->{ok};
5957
0
return $res;
5958
}
5959
5960
5961
=head2 users_get_presence
5962
5963
Gets user presence information.
5964
5965
L
5966
5967
Takes the following named parameters:
5968
5969
=over 4
5970
5971
=item * C - User to get presence info on. Defaults to the authed user. (string, optional)
5972
5973
=back
5974
5975
Resolves to a structure representing the response.
5976
5977
=cut
5978
5979
0
0
1
async sub users_get_presence {
5980
0
my ($self, %args) = @_;
5981
my $uri = $self->endpoint(
5982
'users_get_presence',
5983
0
%args{grep { exists $args{$_} } qw(user)}
0
5984
);
5985
0
my ($res) = await $self->http_get(
5986
$uri,
5987
);
5988
0
0
die $res unless $res->{ok};
5989
0
return $res;
5990
}
5991
5992
5993
=head2 users_identity
5994
5995
Get a user's identity.
5996
5997
L
5998
5999
Resolves to a structure representing the response.
6000
6001
=cut
6002
6003
0
0
1
async sub users_identity {
6004
0
my ($self, %args) = @_;
6005
0
my $uri = $self->endpoint(
6006
'users_identity',
6007
);
6008
0
my ($res) = await $self->http_get(
6009
$uri,
6010
);
6011
0
return $res;
6012
}
6013
6014
6015
=head2 users_info
6016
6017
Gets information about a user.
6018
6019
L
6020
6021
Takes the following named parameters:
6022
6023
=over 4
6024
6025
=item * C - Set this to `true` to receive the locale for this user. Defaults to `false` (boolean, optional)
6026
6027
=item * C - User to get info on (string, optional)
6028
6029
=back
6030
6031
Resolves to a structure representing the response.
6032
6033
=cut
6034
6035
0
0
1
async sub users_info {
6036
0
my ($self, %args) = @_;
6037
my $uri = $self->endpoint(
6038
'users_info',
6039
0
%args{grep { exists $args{$_} } qw(include_locale user)}
0
6040
);
6041
0
my ($res) = await $self->http_get(
6042
$uri,
6043
);
6044
0
0
die $res unless $res->{ok};
6045
0
return $res;
6046
}
6047
6048
6049
=head2 users_list
6050
6051
Lists all users in a Slack team.
6052
6053
L
6054
6055
Takes the following named parameters:
6056
6057
=over 4
6058
6059
=item * C - The maximum number of items to return. Fewer than the requested number of items may be returned, even if the end of the users list hasn't been reached. Providing no `limit` value will result in Slack attempting to deliver you the entire result set. If the collection is too large you may experience `limit_required` or HTTP 500 errors. (integer, optional)
6060
6061
=item * C - Paginate through collections of data by setting the `cursor` parameter to a `next_cursor` attribute returned by a previous request's `response_metadata`. Default value fetches the first "page" of the collection. See [pagination](/docs/pagination) for more detail. (string, optional)
6062
6063
=item * C - Set this to `true` to receive the locale for users. Defaults to `false` (boolean, optional)
6064
6065
=back
6066
6067
Resolves to a structure representing the response.
6068
6069
=cut
6070
6071
0
0
1
async sub users_list {
6072
0
my ($self, %args) = @_;
6073
my $uri = $self->endpoint(
6074
'users_list',
6075
0
%args{grep { exists $args{$_} } qw(limit cursor include_locale)}
0
6076
);
6077
0
my ($res) = await $self->http_get(
6078
$uri,
6079
);
6080
0
0
die $res unless $res->{ok};
6081
0
return $res;
6082
}
6083
6084
6085
=head2 users_lookup_by_email
6086
6087
Find a user with an email address.
6088
6089
L
6090
6091
Takes the following named parameters:
6092
6093
=over 4
6094
6095
=item * C - An email address belonging to a user in the workspace (string, required)
6096
6097
=back
6098
6099
Resolves to a structure representing the response.
6100
6101
=cut
6102
6103
0
0
1
async sub users_lookup_by_email {
6104
0
my ($self, %args) = @_;
6105
my $uri = $self->endpoint(
6106
'users_lookup_by_email',
6107
0
%args{grep { exists $args{$_} } qw(email)}
0
6108
);
6109
0
my ($res) = await $self->http_get(
6110
$uri,
6111
);
6112
0
0
die $res unless $res->{ok};
6113
0
return $res;
6114
}
6115
6116
6117
=head2 users_profile_get
6118
6119
Retrieves a user's profile information.
6120
6121
L
6122
6123
Takes the following named parameters:
6124
6125
=over 4
6126
6127
=item * C - Include labels for each ID in custom profile fields (boolean, optional)
6128
6129
=item * C - User to retrieve profile info for (string, optional)
6130
6131
=back
6132
6133
Resolves to a structure representing the response.
6134
6135
=cut
6136
6137
0
0
1
async sub users_profile_get {
6138
0
my ($self, %args) = @_;
6139
my $uri = $self->endpoint(
6140
'users_profile_get',
6141
0
%args{grep { exists $args{$_} } qw(include_labels user)}
0
6142
);
6143
0
my ($res) = await $self->http_get(
6144
$uri,
6145
);
6146
0
0
die $res unless $res->{ok};
6147
0
return $res;
6148
}
6149
6150
6151
=head2 users_profile_set
6152
6153
Set the profile information for a user.
6154
6155
L
6156
6157
Takes the following named parameters:
6158
6159
=over 4
6160
6161
=item * C - Name of a single key to set. Usable only if `profile` is not passed. (string, optional)
6162
6163
=item * C - Collection of key:value pairs presented as a URL-encoded JSON hash. At most 50 fields may be set. Each field name is limited to 255 characters. (string, optional)
6164
6165
=item * C - ID of user to change. This argument may only be specified by team admins on paid teams. (string, optional)
6166
6167
=item * C - Value to set a single key to. Usable only if `profile` is not passed. (string, optional)
6168
6169
=back
6170
6171
Resolves to a structure representing the response.
6172
6173
=cut
6174
6175
0
0
1
async sub users_profile_set {
6176
0
my ($self, %args) = @_;
6177
0
my $uri = $self->endpoint(
6178
'users_profile_set',
6179
);
6180
my $content = encode_json_utf8({
6181
0
%args{grep { exists $args{$_} } qw(name profile user value)}
0
6182
});
6183
0
my ($res) = await $self->http_post(
6184
$uri,
6185
$content,
6186
content_type => 'application/json; charset=utf-8',
6187
);
6188
0
0
die $res unless $res->{ok};
6189
0
return $res;
6190
}
6191
6192
6193
=head2 users_set_active
6194
6195
Marked a user as active. Deprecated and non-functional.
6196
6197
L
6198
6199
Resolves to a structure representing the response.
6200
6201
=cut
6202
6203
0
0
1
async sub users_set_active {
6204
0
my ($self, %args) = @_;
6205
0
my $uri = $self->endpoint(
6206
'users_set_active',
6207
);
6208
0
my ($res) = await $self->http_post(
6209
$uri,
6210
);
6211
0
0
die $res unless $res->{ok};
6212
0
return $res;
6213
}
6214
6215
6216
=head2 users_set_photo
6217
6218
Set the user profile photo
6219
6220
L
6221
6222
Takes the following named parameters:
6223
6224
=over 4
6225
6226
=item * C - Width/height of crop box (always square) (string, optional)
6227
6228
=item * C - X coordinate of top-left corner of crop box (string, optional)
6229
6230
=item * C - Y coordinate of top-left corner of crop box (string, optional)
6231
6232
=item * C - File contents via `multipart/form-data`. (string, optional)
6233
6234
=back
6235
6236
Resolves to a structure representing the response.
6237
6238
=cut
6239
6240
0
0
1
async sub users_set_photo {
6241
0
my ($self, %args) = @_;
6242
0
my $uri = $self->endpoint(
6243
'users_set_photo',
6244
);
6245
my $content = encode_json_utf8({
6246
0
%args{grep { exists $args{$_} } qw(crop_w crop_x crop_y image)}
0
6247
});
6248
0
my ($res) = await $self->http_post(
6249
$uri,
6250
$content,
6251
content_type => 'application/json; charset=utf-8',
6252
);
6253
0
0
die $res unless $res->{ok};
6254
0
return $res;
6255
}
6256
6257
6258
=head2 users_set_presence
6259
6260
Manually sets user presence.
6261
6262
L
6263
6264
Takes the following named parameters:
6265
6266
=over 4
6267
6268
=item * C - Either `auto` or `away` (string, required)
6269
6270
=back
6271
6272
Resolves to a structure representing the response.
6273
6274
=cut
6275
6276
0
0
1
async sub users_set_presence {
6277
0
my ($self, %args) = @_;
6278
0
my $uri = $self->endpoint(
6279
'users_set_presence',
6280
);
6281
my $content = encode_json_utf8({
6282
0
%args{grep { exists $args{$_} } qw(presence)}
0
6283
});
6284
0
my ($res) = await $self->http_post(
6285
$uri,
6286
$content,
6287
content_type => 'application/json; charset=utf-8',
6288
);
6289
0
0
die $res unless $res->{ok};
6290
0
return $res;
6291
}
6292
6293
6294
=head2 views_open
6295
6296
Open a view for a user.
6297
6298
L
6299
6300
Takes the following named parameters:
6301
6302
=over 4
6303
6304
=item * C - Exchange a trigger to post to the user. (string, required)
6305
6306
=item * C - A [view payload](/reference/surfaces/views). This must be a JSON-encoded string. (string, required)
6307
6308
=back
6309
6310
Resolves to a structure representing the response.
6311
6312
=cut
6313
6314
0
0
1
async sub views_open {
6315
0
my ($self, %args) = @_;
6316
0
my $uri = $self->endpoint(
6317
'views_open',
6318
);
6319
my $content = encode_json_utf8({
6320
0
%args{grep { exists $args{$_} } qw(trigger_id view)}
0
6321
});
6322
0
my ($res) = await $self->http_post(
6323
$uri,
6324
$content,
6325
content_type => 'application/json; charset=utf-8',
6326
);
6327
0
0
die $res unless $res->{ok};
6328
0
return $res;
6329
}
6330
6331
6332
=head2 views_publish
6333
6334
Publish a static view for a User.
6335
6336
L
6337
6338
Takes the following named parameters:
6339
6340
=over 4
6341
6342
=item * C - `id` of the user you want publish a view to. (string, required)
6343
6344
=item * C - A [view payload](/reference/surfaces/views). This must be a JSON-encoded string. (string, required)
6345
6346
=item * C - A string that represents view state to protect against possible race conditions. (string, optional)
6347
6348
=back
6349
6350
Resolves to a structure representing the response.
6351
6352
=cut
6353
6354
0
0
1
async sub views_publish {
6355
0
my ($self, %args) = @_;
6356
0
my $uri = $self->endpoint(
6357
'views_publish',
6358
);
6359
my $content = encode_json_utf8({
6360
0
%args{grep { exists $args{$_} } qw(user_id view hash)}
0
6361
});
6362
0
my ($res) = await $self->http_post(
6363
$uri,
6364
$content,
6365
content_type => 'application/json; charset=utf-8',
6366
);
6367
0
0
die $res unless $res->{ok};
6368
0
return $res;
6369
}
6370
6371
6372
=head2 views_push
6373
6374
Push a view onto the stack of a root view.
6375
6376
L
6377
6378
Takes the following named parameters:
6379
6380
=over 4
6381
6382
=item * C - Exchange a trigger to post to the user. (string, required)
6383
6384
=item * C - A [view payload](/reference/surfaces/views). This must be a JSON-encoded string. (string, required)
6385
6386
=back
6387
6388
Resolves to a structure representing the response.
6389
6390
=cut
6391
6392
0
0
1
async sub views_push {
6393
0
my ($self, %args) = @_;
6394
0
my $uri = $self->endpoint(
6395
'views_push',
6396
);
6397
my $content = encode_json_utf8({
6398
0
%args{grep { exists $args{$_} } qw(trigger_id view)}
0
6399
});
6400
0
my ($res) = await $self->http_post(
6401
$uri,
6402
$content,
6403
content_type => 'application/json; charset=utf-8',
6404
);
6405
0
0
die $res unless $res->{ok};
6406
0
return $res;
6407
}
6408
6409
6410
=head2 views_update
6411
6412
Update an existing view.
6413
6414
L
6415
6416
Takes the following named parameters:
6417
6418
=over 4
6419
6420
=item * C - A unique identifier of the view to be updated. Either `view_id` or `external_id` is required. (string, optional)
6421
6422
=item * C - A unique identifier of the view set by the developer. Must be unique for all views on a team. Max length of 255 characters. Either `view_id` or `external_id` is required. (string, optional)
6423
6424
=item * C - A [view object](/reference/surfaces/views). This must be a JSON-encoded string. (string, optional)
6425
6426
=item * C - A string that represents view state to protect against possible race conditions. (string, optional)
6427
6428
=back
6429
6430
Resolves to a structure representing the response.
6431
6432
=cut
6433
6434
0
0
1
async sub views_update {
6435
0
my ($self, %args) = @_;
6436
0
my $uri = $self->endpoint(
6437
'views_update',
6438
);
6439
my $content = encode_json_utf8({
6440
0
%args{grep { exists $args{$_} } qw(view_id external_id view hash)}
0
6441
});
6442
0
my ($res) = await $self->http_post(
6443
$uri,
6444
$content,
6445
content_type => 'application/json; charset=utf-8',
6446
);
6447
0
0
die $res unless $res->{ok};
6448
0
return $res;
6449
}
6450
6451
6452
=head2 workflows_step_completed
6453
6454
Indicate that an app's step in a workflow completed execution.
6455
6456
L
6457
6458
Takes the following named parameters:
6459
6460
=over 4
6461
6462
=item * C - Context identifier that maps to the correct workflow step execution. (string, required)
6463
6464
=item * C - Key-value object of outputs from your step. Keys of this object reflect the configured `key` properties of your [`outputs`](/reference/workflows/workflow_step#output) array from your `workflow_step` object. (string, optional)
6465
6466
=back
6467
6468
Resolves to a structure representing the response.
6469
6470
=cut
6471
6472
0
0
1
async sub workflows_step_completed {
6473
0
my ($self, %args) = @_;
6474
0
my $uri = $self->endpoint(
6475
'workflows_step_completed',
6476
);
6477
my $content = encode_json_utf8({
6478
0
%args{grep { exists $args{$_} } qw(workflow_step_execute_id outputs)}
0
6479
});
6480
0
my ($res) = await $self->http_post(
6481
$uri,
6482
$content,
6483
content_type => 'application/json; charset=utf-8',
6484
);
6485
0
0
die $res unless $res->{ok};
6486
0
return $res;
6487
}
6488
6489
6490
=head2 workflows_step_failed
6491
6492
Indicate that an app's step in a workflow failed to execute.
6493
6494
L
6495
6496
Takes the following named parameters:
6497
6498
=over 4
6499
6500
=item * C - Context identifier that maps to the correct workflow step execution. (string, required)
6501
6502
=item * C - A JSON-based object with a `message` property that should contain a human readable error message. (string, required)
6503
6504
=back
6505
6506
Resolves to a structure representing the response.
6507
6508
=cut
6509
6510
0
0
1
async sub workflows_step_failed {
6511
0
my ($self, %args) = @_;
6512
0
my $uri = $self->endpoint(
6513
'workflows_step_failed',
6514
);
6515
my $content = encode_json_utf8({
6516
0
%args{grep { exists $args{$_} } qw(workflow_step_execute_id error)}
0
6517
});
6518
0
my ($res) = await $self->http_post(
6519
$uri,
6520
$content,
6521
content_type => 'application/json; charset=utf-8',
6522
);
6523
0
0
die $res unless $res->{ok};
6524
0
return $res;
6525
}
6526
6527
6528
=head2 workflows_update_step
6529
6530
Update the configuration for a workflow extension step.
6531
6532
L
6533
6534
Takes the following named parameters:
6535
6536
=over 4
6537
6538
=item * C - A context identifier provided with `view_submission` payloads used to call back to `workflows.updateStep`. (string, required)
6539
6540
=item * C - A JSON key-value map of inputs required from a user during configuration. This is the data your app expects to receive when the workflow step starts. **Please note**: the embedded variable format is set and replaced by the workflow system. You cannot create custom variables that will be replaced at runtime. [Read more about variables in workflow steps here](/workflows/steps#variables). (string, optional)
6541
6542
=item * C - An JSON array of output objects used during step execution. This is the data your app agrees to provide when your workflow step was executed. (string, optional)
6543
6544
=item * C - An optional field that can be used to override the step name that is shown in the Workflow Builder. (string, optional)
6545
6546
=item * C - An optional field that can be used to override app image that is shown in the Workflow Builder. (string, optional)
6547
6548
=back
6549
6550
Resolves to a structure representing the response.
6551
6552
=cut
6553
6554
0
0
1
async sub workflows_update_step {
6555
0
my ($self, %args) = @_;
6556
0
my $uri = $self->endpoint(
6557
'workflows_update_step',
6558
);
6559
my $content = encode_json_utf8({
6560
0
%args{grep { exists $args{$_} } qw(workflow_step_edit_id inputs outputs step_name step_image_url)}
0
6561
});
6562
0
my ($res) = await $self->http_post(
6563
$uri,
6564
$content,
6565
content_type => 'application/json; charset=utf-8',
6566
);
6567
0
0
die $res unless $res->{ok};
6568
0
return $res;
6569
}
6570
6571
1;