/
chat-api.json
3730 lines (3730 loc) Β· 207 KB
/
chat-api.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
{
"auth": {
"oauth2": {
"scopes": {
"https://www.googleapis.com/auth/chat.bot": {
"description": "Private Service: https://www.googleapis.com/auth/chat.bot"
},
"https://www.googleapis.com/auth/chat.delete": {
"description": "Delete conversations and spaces \u0026 remove access to associated files in Google Chat"
},
"https://www.googleapis.com/auth/chat.import": {
"description": "Import spaces, messages, and memberships into Google Chat."
},
"https://www.googleapis.com/auth/chat.memberships": {
"description": "View, add, and remove members from conversations in Google Chat"
},
"https://www.googleapis.com/auth/chat.memberships.app": {
"description": "Add and remove itself from conversations in Google Chat"
},
"https://www.googleapis.com/auth/chat.memberships.readonly": {
"description": "View members in Google Chat conversations."
},
"https://www.googleapis.com/auth/chat.messages": {
"description": "View, compose, send, update, and delete messages, and add, view, and delete reactions to messages."
},
"https://www.googleapis.com/auth/chat.messages.create": {
"description": "Compose and send messages in Google Chat"
},
"https://www.googleapis.com/auth/chat.messages.reactions": {
"description": "View, add, and delete reactions to messages in Google Chat"
},
"https://www.googleapis.com/auth/chat.messages.reactions.create": {
"description": "Add reactions to messages in Google Chat"
},
"https://www.googleapis.com/auth/chat.messages.reactions.readonly": {
"description": "View reactions to messages in Google Chat"
},
"https://www.googleapis.com/auth/chat.messages.readonly": {
"description": "View messages and reactions in Google Chat"
},
"https://www.googleapis.com/auth/chat.spaces": {
"description": "Create conversations and spaces and view or update metadata (including history settings) in Google Chat"
},
"https://www.googleapis.com/auth/chat.spaces.create": {
"description": "Create new conversations in Google Chat"
},
"https://www.googleapis.com/auth/chat.spaces.readonly": {
"description": "View chat and spaces in Google Chat"
}
}
}
},
"basePath": "",
"baseUrl": "https://chat.googleapis.com/",
"batchPath": "batch",
"canonicalName": "Hangouts Chat",
"description": "Enables apps to fetch information and perform actions in Google Chat. Authentication is a prerequisite for using the Google Chat REST API.",
"discoveryVersion": "v1",
"documentationLink": "https://developers.google.com/hangouts/chat",
"fullyEncodeReservedExpansion": true,
"icons": {
"x16": "http://www.google.com/images/icons/product/search-16.gif",
"x32": "http://www.google.com/images/icons/product/search-32.gif"
},
"id": "chat:v1",
"kind": "discovery#restDescription",
"mtlsRootUrl": "https://chat.mtls.googleapis.com/",
"name": "chat",
"ownerDomain": "google.com",
"ownerName": "Google",
"parameters": {
"$.xgafv": {
"description": "V1 error format.",
"enum": [
"1",
"2"
],
"enumDescriptions": [
"v1 error format",
"v2 error format"
],
"location": "query",
"type": "string"
},
"access_token": {
"description": "OAuth access token.",
"location": "query",
"type": "string"
},
"alt": {
"default": "json",
"description": "Data format for response.",
"enum": [
"json",
"media",
"proto"
],
"enumDescriptions": [
"Responses with Content-Type of application/json",
"Media download with context-dependent Content-Type",
"Responses with Content-Type of application/x-protobuf"
],
"location": "query",
"type": "string"
},
"callback": {
"description": "JSONP",
"location": "query",
"type": "string"
},
"fields": {
"description": "Selector specifying which fields to include in a partial response.",
"location": "query",
"type": "string"
},
"key": {
"description": "API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.",
"location": "query",
"type": "string"
},
"oauth_token": {
"description": "OAuth 2.0 token for the current user.",
"location": "query",
"type": "string"
},
"prettyPrint": {
"default": "true",
"description": "Returns response with indentations and line breaks.",
"location": "query",
"type": "boolean"
},
"quotaUser": {
"description": "Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.",
"location": "query",
"type": "string"
},
"uploadType": {
"description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").",
"location": "query",
"type": "string"
},
"upload_protocol": {
"description": "Upload protocol for media (e.g. \"raw\", \"multipart\").",
"location": "query",
"type": "string"
}
},
"protocol": "rest",
"resources": {
"media": {
"methods": {
"download": {
"description": "Downloads media. Download is supported on the URI `/v1/media/{+name}?alt=media`.",
"flatPath": "v1/media/{mediaId}",
"httpMethod": "GET",
"id": "chat.media.download",
"parameterOrder": [
"resourceName"
],
"parameters": {
"resourceName": {
"description": "Name of the media that is being downloaded. See ReadRequest.resource_name.",
"location": "path",
"pattern": "^.*$",
"required": true,
"type": "string"
}
},
"path": "v1/media/{+resourceName}",
"response": {
"$ref": "Media"
},
"scopes": [
"https://www.googleapis.com/auth/chat.bot",
"https://www.googleapis.com/auth/chat.messages",
"https://www.googleapis.com/auth/chat.messages.readonly"
],
"supportsMediaDownload": true
},
"upload": {
"description": "Uploads an attachment. For an example, see [Upload media as a file attachment](https://developers.google.com/chat/api/guides/v1/media-and-attachments/upload). Requires user [authentication](https://developers.google.com/chat/api/guides/auth/users) and the `chat.messages` or `chat.messages.create` authorization scope. You can upload attachments up to 200 MB. Certain file types aren't supported. For details, see [File types blocked by Google Chat](https://support.google.com/chat/answer/7651457?\u0026co=GENIE.Platform%3DDesktop#File%20types%20blocked%20in%20Google%20Chat).",
"flatPath": "v1/spaces/{spacesId}/attachments:upload",
"httpMethod": "POST",
"id": "chat.media.upload",
"mediaUpload": {
"accept": [
"*/*"
],
"maxSize": "209715200",
"protocols": {
"resumable": {
"multipart": true,
"path": "/resumable/upload/v1/{+parent}/attachments:upload"
},
"simple": {
"multipart": true,
"path": "/upload/v1/{+parent}/attachments:upload"
}
}
},
"parameterOrder": [
"parent"
],
"parameters": {
"parent": {
"description": "Required. Resource name of the Chat space in which the attachment is uploaded. Format \"spaces/{space}\".",
"location": "path",
"pattern": "^spaces/[^/]+$",
"required": true,
"type": "string"
}
},
"path": "v1/{+parent}/attachments:upload",
"request": {
"$ref": "UploadAttachmentRequest"
},
"response": {
"$ref": "UploadAttachmentResponse"
},
"scopes": [
"https://www.googleapis.com/auth/chat.import",
"https://www.googleapis.com/auth/chat.messages",
"https://www.googleapis.com/auth/chat.messages.create"
],
"supportsMediaUpload": true
}
}
},
"spaces": {
"methods": {
"create": {
"description": "Creates a named space. Spaces grouped by topics aren't supported. For an example, see [Create a space](https://developers.google.com/chat/api/guides/v1/spaces/create). If you receive the error message `ALREADY_EXISTS` when creating a space, try a different `displayName`. An existing space within the Google Workspace organization might already use this display name. Requires [user authentication](https://developers.google.com/chat/api/guides/auth/users) and the `chat.spaces.create` or `chat.spaces` scope.",
"flatPath": "v1/spaces",
"httpMethod": "POST",
"id": "chat.spaces.create",
"parameterOrder": [],
"parameters": {
"requestId": {
"description": "Optional. A unique identifier for this request. A random UUID is recommended. Specifying an existing request ID returns the space created with that ID instead of creating a new space. Specifying an existing request ID from the same Chat app with a different authenticated user returns an error.",
"location": "query",
"type": "string"
}
},
"path": "v1/spaces",
"request": {
"$ref": "Space"
},
"response": {
"$ref": "Space"
},
"scopes": [
"https://www.googleapis.com/auth/chat.import",
"https://www.googleapis.com/auth/chat.spaces",
"https://www.googleapis.com/auth/chat.spaces.create"
]
},
"delete": {
"description": "Deletes a named space. Always performs a cascading delete, which means that the space's child resourcesβlike messages posted in the space and memberships in the spaceβare also deleted. For an example, see [Delete a space](https://developers.google.com/chat/api/guides/v1/spaces/delete). Requires [user authentication](https://developers.google.com/chat/api/guides/auth/users) from a user who has permission to delete the space, and the `chat.delete` scope.",
"flatPath": "v1/spaces/{spacesId}",
"httpMethod": "DELETE",
"id": "chat.spaces.delete",
"parameterOrder": [
"name"
],
"parameters": {
"name": {
"description": "Required. Resource name of the space to delete. Format: `spaces/{space}`",
"location": "path",
"pattern": "^spaces/[^/]+$",
"required": true,
"type": "string"
}
},
"path": "v1/{+name}",
"response": {
"$ref": "Empty"
},
"scopes": [
"https://www.googleapis.com/auth/chat.delete",
"https://www.googleapis.com/auth/chat.import"
]
},
"findDirectMessage": {
"description": "Returns the existing direct message with the specified user. If no direct message space is found, returns a `404 NOT_FOUND` error. For an example, see [Find a direct message](/chat/api/guides/v1/spaces/find-direct-message). With [user authentication](https://developers.google.com/chat/api/guides/auth/users), returns the direct message space between the specified user and the authenticated user. With [service account authentication](https://developers.google.com/chat/api/guides/auth/service-accounts), returns the direct message space between the specified user and the calling Chat app. Requires [user authentication](https://developers.google.com/chat/api/guides/auth/users) or [service account authentication](https://developers.google.com/chat/api/guides/auth/service-accounts).",
"flatPath": "v1/spaces:findDirectMessage",
"httpMethod": "GET",
"id": "chat.spaces.findDirectMessage",
"parameterOrder": [],
"parameters": {
"name": {
"description": "Required. Resource name of the user to find direct message with. Format: `users/{user}`, where `{user}` is either the `{person_id}` for the [person](https://developers.google.com/people/api/rest/v1/people) from the People API, or the `id` for the [user](https://developers.google.com/admin-sdk/directory/reference/rest/v1/users) in the Directory API. For example, if the People API `Person.resourceName` is `people/123456789`, you can find a direct message with that person by using `users/123456789` as the `name`. When [authenticated as a user](https://developers.google.com/chat/api/guides/auth/users), you can use the email as an alias for `{user}`. For example, `users/example@gmail.com` where `example@gmail.com` is the email of the Google Chat user.",
"location": "query",
"type": "string"
}
},
"path": "v1/spaces:findDirectMessage",
"response": {
"$ref": "Space"
},
"scopes": [
"https://www.googleapis.com/auth/chat.bot",
"https://www.googleapis.com/auth/chat.spaces",
"https://www.googleapis.com/auth/chat.spaces.readonly"
]
},
"get": {
"description": "Returns details about a space. For an example, see [Get a space](https://developers.google.com/chat/api/guides/v1/spaces/get). Requires [authentication](https://developers.google.com/chat/api/guides/auth). Fully supports [service account authentication](https://developers.google.com/chat/api/guides/auth/service-accounts) and [user authentication](https://developers.google.com/chat/api/guides/auth/users). [User authentication](https://developers.google.com/chat/api/guides/auth/users) requires the `chat.spaces` or `chat.spaces.readonly` authorization scope.",
"flatPath": "v1/spaces/{spacesId}",
"httpMethod": "GET",
"id": "chat.spaces.get",
"parameterOrder": [
"name"
],
"parameters": {
"name": {
"description": "Required. Resource name of the space, in the form \"spaces/*\". Format: `spaces/{space}`",
"location": "path",
"pattern": "^spaces/[^/]+$",
"required": true,
"type": "string"
}
},
"path": "v1/{+name}",
"response": {
"$ref": "Space"
},
"scopes": [
"https://www.googleapis.com/auth/chat.bot",
"https://www.googleapis.com/auth/chat.spaces",
"https://www.googleapis.com/auth/chat.spaces.readonly"
]
},
"list": {
"description": "Lists spaces the caller is a member of. Group chats and DMs aren't listed until the first message is sent. For an example, see [List spaces](https://developers.google.com/chat/api/guides/v1/spaces/list). Requires [authentication](https://developers.google.com/chat/api/guides/auth). Fully supports [service account authentication](https://developers.google.com/chat/api/guides/auth/service-accounts) and [user authentication](https://developers.google.com/chat/api/guides/auth/users) requires the `chat.spaces` or `chat.spaces.readonly` authorization scope. Lists spaces visible to the caller or authenticated user. Group chats and DMs aren't listed until the first message is sent.",
"flatPath": "v1/spaces",
"httpMethod": "GET",
"id": "chat.spaces.list",
"parameterOrder": [],
"parameters": {
"filter": {
"description": "Optional. A query filter. Requires [user authentication](https://developers.google.com/chat/api/guides/auth/users). You can filter spaces by the space type ([`space_type`](https://developers.google.com/chat/api/reference/rest/v1/spaces#spacetype)). To filter by space type, you must specify valid enum value, such as `SPACE` or `GROUP_CHAT` (the `space_type` can't be `SPACE_TYPE_UNSPECIFIED`). To query for multiple space types, use the `OR` operator. For example, the following queries are valid: ``` space_type = \"SPACE\" spaceType = \"GROUP_CHAT\" OR spaceType = \"DIRECT_MESSAGE\" ``` Invalid queries are rejected by the server with an `INVALID_ARGUMENT` error. With [service account authentication](https://developers.google.com/chat/api/guides/auth/service-accounts), this field is ignored and the query always returns all spaces. But the Chat API still validates the query syntax with service accounts, so invalid queries are still rejected.",
"location": "query",
"type": "string"
},
"pageSize": {
"description": "Optional. The maximum number of spaces to return. The service might return fewer than this value. If unspecified, at most 100 spaces are returned. The maximum value is 1,000. If you use a value more than 1,000, it's automatically changed to 1,000. Negative values return an `INVALID_ARGUMENT` error.",
"format": "int32",
"location": "query",
"type": "integer"
},
"pageToken": {
"description": "Optional. A page token, received from a previous list spaces call. Provide this parameter to retrieve the subsequent page. When paginating, the filter value should match the call that provided the page token. Passing a different value may lead to unexpected results.",
"location": "query",
"type": "string"
}
},
"path": "v1/spaces",
"response": {
"$ref": "ListSpacesResponse"
},
"scopes": [
"https://www.googleapis.com/auth/chat.bot",
"https://www.googleapis.com/auth/chat.spaces",
"https://www.googleapis.com/auth/chat.spaces.readonly"
]
},
"patch": {
"description": "Updates a space. For an example, see [Update a space](https://developers.google.com/chat/api/guides/v1/spaces/update). If you're updating the `displayName` field and receive the error message `ALREADY_EXISTS`, try a different display name.. An existing space within the Google Workspace organization might already use this display name. Requires [user authentication](https://developers.google.com/chat/api/guides/auth/users) and the `chat.spaces` scope.",
"flatPath": "v1/spaces/{spacesId}",
"httpMethod": "PATCH",
"id": "chat.spaces.patch",
"parameterOrder": [
"name"
],
"parameters": {
"name": {
"description": "Resource name of the space. Format: `spaces/{space}`",
"location": "path",
"pattern": "^spaces/[^/]+$",
"required": true,
"type": "string"
},
"updateMask": {
"description": "Required. The updated field paths, comma separated if there are multiple. Currently supported field paths: - `display_name` (Only supports changing the display name of a space with the `SPACE` type, or when also including the `space_type` mask to change a `GROUP_CHAT` space type to `SPACE`. Trying to update the display name of a `GROUP_CHAT` or a `DIRECT_MESSAGE` space results in an invalid argument error. If you receive the error message `ALREADY_EXISTS` when updating the `displayName`, try a different `displayName`. An existing space within the Google Workspace organization might already use this display name.) - `space_type` (Only supports changing a `GROUP_CHAT` space type to `SPACE`. Include `display_name` together with `space_type` in the update mask and ensure that the specified space has a non-empty display name and the `SPACE` space type. Including the `space_type` mask and the `SPACE` type in the specified space when updating the display name is optional if the existing space already has the `SPACE` type. Trying to update the space type in other ways results in an invalid argument error). - `space_details` - `space_history_state` (Supports [turning history on or off for the space](https://support.google.com/chat/answer/7664687) if [the organization allows users to change their history setting](https://support.google.com/a/answer/7664184). Warning: mutually exclusive with all other field paths.)",
"format": "google-fieldmask",
"location": "query",
"type": "string"
}
},
"path": "v1/{+name}",
"request": {
"$ref": "Space"
},
"response": {
"$ref": "Space"
},
"scopes": [
"https://www.googleapis.com/auth/chat.import",
"https://www.googleapis.com/auth/chat.spaces"
]
},
"setup": {
"description": "Creates a space and adds specified users to it. The calling user is automatically added to the space, and shouldn't be specified as a membership in the request. For an example, see [Set up a space](https://developers.google.com/chat/api/guides/v1/spaces/set-up). To specify the human members to add, add memberships with the appropriate `member.name` in the `SetUpSpaceRequest`. To add a human user, use `users/{user}`, where `{user}` can be the email address for the user. For users in the same Workspace organization `{user}` can also be the `{person_id}` for the person from the People API, or the `id` for the user in the Directory API. For example, if the People API Person `resourceName` for `user@example.com` is `people/123456789`, you can add the user to the space by setting the `membership.member.name` to `users/user@example.com` or `users/123456789`. For a space or group chat, if the caller blocks or is blocked by some members, then those members aren't added to the created space. To create a direct message (DM) between the calling user and another human user, specify exactly one membership to represent the human user. If one user blocks the other, the request fails and the DM isn't created. To create a DM between the calling user and the calling app, set `Space.singleUserBotDm` to `true` and don't specify any memberships. You can only use this method to set up a DM with the calling app. To add the calling app as a member of a space or an existing DM between two human users, see [create a membership](https://developers.google.com/chat/api/guides/v1/members/create). If a DM already exists between two users, even when one user blocks the other at the time a request is made, then the existing DM is returned. Spaces with threaded replies aren't supported. If you receive the error message `ALREADY_EXISTS` when setting up a space, try a different `displayName`. An existing space within the Google Workspace organization might already use this display name. Requires [user authentication](https://developers.google.com/chat/api/guides/auth/users) and the `chat.spaces.create` or `chat.spaces` scope.",
"flatPath": "v1/spaces:setup",
"httpMethod": "POST",
"id": "chat.spaces.setup",
"parameterOrder": [],
"parameters": {},
"path": "v1/spaces:setup",
"request": {
"$ref": "SetUpSpaceRequest"
},
"response": {
"$ref": "Space"
},
"scopes": [
"https://www.googleapis.com/auth/chat.spaces",
"https://www.googleapis.com/auth/chat.spaces.create"
]
}
},
"resources": {
"members": {
"methods": {
"create": {
"description": "Creates a human membership or app membership for the calling app. Creating memberships for other apps isn't supported. For an example, see [ Create a membership](https://developers.google.com/chat/api/guides/v1/members/create). When creating a membership, if the specified member has their auto-accept policy turned off, then they're invited, and must accept the space invitation before joining. Otherwise, creating a membership adds the member directly to the specified space. Requires [user authentication](https://developers.google.com/chat/api/guides/auth/users) and the `chat.memberships` (for human membership) or `chat.memberships.app` (for app membership) scope. To specify the member to add, set the `membership.member.name` in the `CreateMembershipRequest`: - To add the calling app to a space or a direct message between two human users, use `users/app`. Unable to add other apps to the space. - To add a human user, use `users/{user}`, where `{user}` can be the email address for the user. For users in the same Workspace organization `{user}` can also be the `{person_id}` for the person from the People API, or the `id` for the user in the Directory API. For example, if the People API Person `resourceName` for `user@example.com` is `people/123456789`, you can add the user to the space by setting the `membership.member.name` to `users/user@example.com` or `users/123456789`.",
"flatPath": "v1/spaces/{spacesId}/members",
"httpMethod": "POST",
"id": "chat.spaces.members.create",
"parameterOrder": [
"parent"
],
"parameters": {
"parent": {
"description": "Required. The resource name of the space for which to create the membership. Format: spaces/{space}",
"location": "path",
"pattern": "^spaces/[^/]+$",
"required": true,
"type": "string"
}
},
"path": "v1/{+parent}/members",
"request": {
"$ref": "Membership"
},
"response": {
"$ref": "Membership"
},
"scopes": [
"https://www.googleapis.com/auth/chat.import",
"https://www.googleapis.com/auth/chat.memberships",
"https://www.googleapis.com/auth/chat.memberships.app"
]
},
"delete": {
"description": "Deletes a membership. For an example, see [Delete a membership](https://developers.google.com/chat/api/guides/v1/members/delete). Requires [user authentication](https://developers.google.com/chat/api/guides/auth/users) and the `chat.memberships` or `chat.memberships.app` authorization scope.",
"flatPath": "v1/spaces/{spacesId}/members/{membersId}",
"httpMethod": "DELETE",
"id": "chat.spaces.members.delete",
"parameterOrder": [
"name"
],
"parameters": {
"name": {
"description": "Required. Resource name of the membership to delete. Chat apps can delete human users' or their own memberships. Chat apps can't delete other apps' memberships. When deleting a human membership, requires the `chat.memberships` scope and `spaces/{space}/members/{member}` format. You can use the email as an alias for `{member}`. For example, `spaces/{space}/members/example@gmail.com` where `example@gmail.com` is the email of the Google Chat user. When deleting an app membership, requires the `chat.memberships.app` scope and `spaces/{space}/members/app` format. Format: `spaces/{space}/members/{member}` or `spaces/{space}/members/app`.",
"location": "path",
"pattern": "^spaces/[^/]+/members/[^/]+$",
"required": true,
"type": "string"
}
},
"path": "v1/{+name}",
"response": {
"$ref": "Membership"
},
"scopes": [
"https://www.googleapis.com/auth/chat.memberships",
"https://www.googleapis.com/auth/chat.memberships.app"
]
},
"get": {
"description": "Returns details about a membership. For an example, see [Get a membership](https://developers.google.com/chat/api/guides/v1/members/get). Requires [authentication](https://developers.google.com/chat/api/guides/auth). Fully supports [service account authentication](https://developers.google.com/chat/api/guides/auth/service-accounts) and [user authentication](https://developers.google.com/chat/api/guides/auth/users). [User authentication](https://developers.google.com/chat/api/guides/auth/users) requires the `chat.memberships` or `chat.memberships.readonly` authorization scope.",
"flatPath": "v1/spaces/{spacesId}/members/{membersId}",
"httpMethod": "GET",
"id": "chat.spaces.members.get",
"parameterOrder": [
"name"
],
"parameters": {
"name": {
"description": "Required. Resource name of the membership to retrieve. To get the app's own membership, you can optionally use `spaces/{space}/members/app`. Format: `spaces/{space}/members/{member}` or `spaces/{space}/members/app` When [authenticated as a user](https://developers.google.com/chat/api/guides/auth/users), you can use the user's email as an alias for `{member}`. For example, `spaces/{space}/members/example@gmail.com` where `example@gmail.com` is the email of the Google Chat user.",
"location": "path",
"pattern": "^spaces/[^/]+/members/[^/]+$",
"required": true,
"type": "string"
}
},
"path": "v1/{+name}",
"response": {
"$ref": "Membership"
},
"scopes": [
"https://www.googleapis.com/auth/chat.bot",
"https://www.googleapis.com/auth/chat.memberships",
"https://www.googleapis.com/auth/chat.memberships.readonly"
]
},
"list": {
"description": "Lists memberships in a space. For an example, see [List memberships](https://developers.google.com/chat/api/guides/v1/members/list). Listing memberships with [app authentication](https://developers.google.com/chat/api/guides/auth/service-accounts) lists memberships in spaces that the Chat app has access to, but excludes Chat app memberships, including its own. Listing memberships with [User authentication](https://developers.google.com/chat/api/guides/auth/users) lists memberships in spaces that the authenticated user has access to. Requires [authentication](https://developers.google.com/chat/api/guides/auth). Fully supports [service account authentication](https://developers.google.com/chat/api/guides/auth/service-accounts) and [user authentication](https://developers.google.com/chat/api/guides/auth/users). [User authentication](https://developers.google.com/chat/api/guides/auth/users) requires the `chat.memberships` or `chat.memberships.readonly` authorization scope.",
"flatPath": "v1/spaces/{spacesId}/members",
"httpMethod": "GET",
"id": "chat.spaces.members.list",
"parameterOrder": [
"parent"
],
"parameters": {
"filter": {
"description": "Optional. A query filter. You can filter memberships by a member's role ([`role`](https://developers.google.com/chat/api/reference/rest/v1/spaces.members#membershiprole)) and type ([`member.type`](https://developers.google.com/chat/api/reference/rest/v1/User#type)). To filter by role, set `role` to `ROLE_MEMBER` or `ROLE_MANAGER`. To filter by type, set `member.type` to `HUMAN` or `BOT`. To filter by both role and type, use the `AND` operator. To filter by either role or type, use the `OR` operator. For example, the following queries are valid: ``` role = \"ROLE_MANAGER\" OR role = \"ROLE_MEMBER\" member.type = \"HUMAN\" AND role = \"ROLE_MANAGER\" ``` The following queries are invalid: ``` member.type = \"HUMAN\" AND member.type = \"BOT\" role = \"ROLE_MANAGER\" AND role = \"ROLE_MEMBER\" ``` Invalid queries are rejected by the server with an `INVALID_ARGUMENT` error.",
"location": "query",
"type": "string"
},
"pageSize": {
"description": "Optional. The maximum number of memberships to return. The service might return fewer than this value. If unspecified, at most 100 memberships are returned. The maximum value is 1,000. If you use a value more than 1,000, it's automatically changed to 1,000. Negative values return an `INVALID_ARGUMENT` error.",
"format": "int32",
"location": "query",
"type": "integer"
},
"pageToken": {
"description": "Optional. A page token, received from a previous call to list memberships. Provide this parameter to retrieve the subsequent page. When paginating, all other parameters provided should match the call that provided the page token. Passing different values to the other parameters might lead to unexpected results.",
"location": "query",
"type": "string"
},
"parent": {
"description": "Required. The resource name of the space for which to fetch a membership list. Format: spaces/{space}",
"location": "path",
"pattern": "^spaces/[^/]+$",
"required": true,
"type": "string"
},
"showInvited": {
"description": "Optional. When `true`, also returns memberships associated with invited members, in addition to other types of memberships. If a filter is set, invited memberships that don't match the filter criteria aren't returned. Currently requires [user authentication](https://developers.google.com/chat/api/guides/auth/users).",
"location": "query",
"type": "boolean"
}
},
"path": "v1/{+parent}/members",
"response": {
"$ref": "ListMembershipsResponse"
},
"scopes": [
"https://www.googleapis.com/auth/chat.bot",
"https://www.googleapis.com/auth/chat.memberships",
"https://www.googleapis.com/auth/chat.memberships.readonly"
]
}
}
},
"messages": {
"methods": {
"create": {
"description": "Creates a message. For an example, see [Create a message](https://developers.google.com/chat/api/guides/crudl/messages#create_a_message). Requires [authentication](https://developers.google.com/chat/api/guides/auth). Creating a text message supports both [user authentication](https://developers.google.com/chat/api/guides/auth/users) and [app authentication] (https://developers.google.com/chat/api/guides/auth/service-accounts). [User authentication](https://developers.google.com/chat/api/guides/auth/users) requires the `chat.messages` or `chat.messages.create` authorization scope. Creating a card message only supports and requires [app authentication] (https://developers.google.com/chat/api/guides/auth/service-accounts). Because Chat provides authentication for [webhooks](https://developers.google.com/chat/how-tos/webhooks) as part of the URL that's generated when a webhook is registered, webhooks can create messages without a service account or user authentication.",
"flatPath": "v1/spaces/{spacesId}/messages",
"httpMethod": "POST",
"id": "chat.spaces.messages.create",
"parameterOrder": [
"parent"
],
"parameters": {
"messageId": {
"description": "Optional. A custom name for a Chat message assigned at creation. Must start with `client-` and contain only lowercase letters, numbers, and hyphens up to 63 characters in length. Specify this field to get, update, or delete the message with the specified value. Assigning a custom name lets a a Chat app recall the message without saving the message `name` from the [response body](/chat/api/reference/rest/v1/spaces.messages/get#response-body) returned when creating the message. Assigning a custom name doesn't replace the generated `name` field, the message's resource name. Instead, it sets the custom name as the `clientAssignedMessageId` field, which you can reference while processing later operations, like updating or deleting the message. For example usage, see [Name a created message](https://developers.google.com/chat/api/guides/v1/messages/create#name_a_created_message).",
"location": "query",
"type": "string"
},
"messageReplyOption": {
"description": "Optional. Specifies whether a message starts a thread or replies to one. Only supported in named spaces.",
"enum": [
"MESSAGE_REPLY_OPTION_UNSPECIFIED",
"REPLY_MESSAGE_FALLBACK_TO_NEW_THREAD",
"REPLY_MESSAGE_OR_FAIL"
],
"enumDescriptions": [
"Default. Starts a thread.",
"Creates the message as a reply to the thread specified by thread ID or `thread_key`. If it fails, the message starts a new thread instead.",
"Creates the message as a reply to the thread specified by thread ID or `thread_key`. If it fails, a `NOT_FOUND` error is returned instead."
],
"location": "query",
"type": "string"
},
"parent": {
"description": "Required. The resource name of the space in which to create a message. Format: `spaces/{space}`",
"location": "path",
"pattern": "^spaces/[^/]+$",
"required": true,
"type": "string"
},
"requestId": {
"description": "Optional. A unique request ID for this message. Specifying an existing request ID returns the message created with that ID instead of creating a new message.",
"location": "query",
"type": "string"
},
"threadKey": {
"deprecated": true,
"description": "Optional. Deprecated: Use thread.thread_key instead. ID for the thread. Supports up to 4000 characters. To start or add to a thread, create a message and specify a `threadKey` or the thread.name. For example usage, see [Start or reply to a message thread](https://developers.google.com/chat/api/guides/crudl/messages#start_or_reply_to_a_message_thread).",
"location": "query",
"type": "string"
}
},
"path": "v1/{+parent}/messages",
"request": {
"$ref": "Message"
},
"response": {
"$ref": "Message"
},
"scopes": [
"https://www.googleapis.com/auth/chat.bot",
"https://www.googleapis.com/auth/chat.import",
"https://www.googleapis.com/auth/chat.messages",
"https://www.googleapis.com/auth/chat.messages.create"
]
},
"delete": {
"description": "Deletes a message. For an example, see [Delete a message](https://developers.google.com/chat/api/guides/v1/messages/delete). Requires [authentication](https://developers.google.com/chat/api/guides/auth). Fully supports [service account authentication](https://developers.google.com/chat/api/guides/auth/service-accounts) and [user authentication](https://developers.google.com/chat/api/guides/auth/users). [User authentication](https://developers.google.com/chat/api/guides/auth/users) requires the `chat.messages` authorization scope. Requests authenticated with service accounts can only delete messages created by the calling Chat app.",
"flatPath": "v1/spaces/{spacesId}/messages/{messagesId}",
"httpMethod": "DELETE",
"id": "chat.spaces.messages.delete",
"parameterOrder": [
"name"
],
"parameters": {
"force": {
"description": "When `true`, deleting a message also deletes its threaded replies. When `false`, if a message has threaded replies, deletion fails. Only applies when [authenticating as a user](https://developers.google.com/chat/api/guides/auth/users). Has no effect when [authenticating with a service account] (https://developers.google.com/chat/api/guides/auth/service-accounts).",
"location": "query",
"type": "boolean"
},
"name": {
"description": "Required. Resource name of the message that you want to delete, in the form `spaces/*/messages/*` Example: `spaces/AAAAAAAAAAA/messages/BBBBBBBBBBB.BBBBBBBBBBB`",
"location": "path",
"pattern": "^spaces/[^/]+/messages/[^/]+$",
"required": true,
"type": "string"
}
},
"path": "v1/{+name}",
"response": {
"$ref": "Empty"
},
"scopes": [
"https://www.googleapis.com/auth/chat.bot",
"https://www.googleapis.com/auth/chat.import",
"https://www.googleapis.com/auth/chat.messages"
]
},
"get": {
"description": "Returns details about a message. For an example, see [Read a message](https://developers.google.com/chat/api/guides/v1/messages/get). Requires [authentication](https://developers.google.com/chat/api/guides/auth). Fully supports [service account authentication](https://developers.google.com/chat/api/guides/auth/service-accounts) and [user authentication](https://developers.google.com/chat/api/guides/auth/users). [User authentication](https://developers.google.com/chat/api/guides/auth/users) requires the `chat.messages` or `chat.messages.readonly` authorization scope. Note: Might return a message from a blocked member or space.",
"flatPath": "v1/spaces/{spacesId}/messages/{messagesId}",
"httpMethod": "GET",
"id": "chat.spaces.messages.get",
"parameterOrder": [
"name"
],
"parameters": {
"name": {
"description": "Required. Resource name of the message to retrieve. Format: `spaces/{space}/messages/{message}` If the message begins with `client-`, then it has a custom name assigned by a Chat app that created it with the Chat REST API. That Chat app (but not others) can pass the custom name to get, update, or delete the message. To learn more, see [create and name a message] (https://developers.google.com/chat/api/guides/v1/messages/create#name_a_created_message).",
"location": "path",
"pattern": "^spaces/[^/]+/messages/[^/]+$",
"required": true,
"type": "string"
}
},
"path": "v1/{+name}",
"response": {
"$ref": "Message"
},
"scopes": [
"https://www.googleapis.com/auth/chat.bot",
"https://www.googleapis.com/auth/chat.messages",
"https://www.googleapis.com/auth/chat.messages.readonly"
]
},
"list": {
"description": "Lists messages in a space that the caller is a member of, including messages from blocked members and spaces. For an example, see [List messages](/chat/api/guides/v1/messages/list). Requires [user authentication](https://developers.google.com/chat/api/guides/auth/users) and the `chat.messages` or `chat.messages.readonly` authorization scope.",
"flatPath": "v1/spaces/{spacesId}/messages",
"httpMethod": "GET",
"id": "chat.spaces.messages.list",
"parameterOrder": [
"parent"
],
"parameters": {
"filter": {
"description": "A query filter. You can filter messages by date (`create_time`) and thread (`thread.name`). To filter messages by the date they were created, specify the `create_time` with a timestamp in [RFC-3339](https://www.rfc-editor.org/rfc/rfc3339) format and double quotation marks. For example, `\"2023-04-21T11:30:00-04:00\"`. You can use the greater than operator `\u003e` to list messages that were created after a timestamp, or the less than operator `\u003c` to list messages that were created before a timestamp. To filter messages within a time interval, use the `AND` operator between two timestamps. To filter by thread, specify the `thread.name`, formatted as `spaces/{space}/threads/{thread}`. You can only specify one `thread.name` per query. To filter by both thread and date, use the `AND` operator in your query. For example, the following queries are valid: ``` create_time \u003e \"2012-04-21T11:30:00-04:00\" create_time \u003e \"2012-04-21T11:30:00-04:00\" AND thread.name = spaces/AAAAAAAAAAA/threads/123 create_time \u003e \"2012-04-21T11:30:00+00:00\" AND create_time \u003c \"2013-01-01T00:00:00+00:00\" AND thread.name = spaces/AAAAAAAAAAA/threads/123 thread.name = spaces/AAAAAAAAAAA/threads/123 ``` Invalid queries are rejected by the server with an `INVALID_ARGUMENT` error.",
"location": "query",
"type": "string"
},
"orderBy": {
"description": "Optional, if resuming from a previous query. How the list of messages is ordered. Specify a value to order by an ordering operation. Valid ordering operation values are as follows: - `ASC` for ascending. - `DESC` for descending. The default ordering is `create_time ASC`.",
"location": "query",
"type": "string"
},
"pageSize": {
"description": "The maximum number of messages returned. The service might return fewer messages than this value. If unspecified, at most 25 are returned. The maximum value is 1,000. If you use a value more than 1,000, it's automatically changed to 1,000. Negative values return an `INVALID_ARGUMENT` error.",
"format": "int32",
"location": "query",
"type": "integer"
},
"pageToken": {
"description": "Optional, if resuming from a previous query. A page token received from a previous list messages call. Provide this parameter to retrieve the subsequent page. When paginating, all other parameters provided should match the call that provided the page token. Passing different values to the other parameters might lead to unexpected results.",
"location": "query",
"type": "string"
},
"parent": {
"description": "Required. The resource name of the space to list messages from. Format: `spaces/{space}`",
"location": "path",
"pattern": "^spaces/[^/]+$",
"required": true,
"type": "string"
},
"showDeleted": {
"description": "Whether to include deleted messages. Deleted messages include deleted time and metadata about their deletion, but message content is unavailable.",
"location": "query",
"type": "boolean"
}
},
"path": "v1/{+parent}/messages",
"response": {
"$ref": "ListMessagesResponse"
},
"scopes": [
"https://www.googleapis.com/auth/chat.import",
"https://www.googleapis.com/auth/chat.messages",
"https://www.googleapis.com/auth/chat.messages.readonly"
]
},
"patch": {
"description": "Updates a message. There's a difference between the `patch` and `update` methods. The `patch` method uses a `patch` request while the `update` method uses a `put` request. We recommend using the `patch` method. For an example, see [Update a message](https://developers.google.com/chat/api/guides/v1/messages/update). Requires [authentication](https://developers.google.com/chat/api/guides/auth). Fully supports [service account authentication](https://developers.google.com/chat/api/guides/auth/service-accounts) and [user authentication](https://developers.google.com/chat/api/guides/auth/users). [User authentication](https://developers.google.com/chat/api/guides/auth/users) requires the `chat.messages` authorization scope. Requests authenticated with service accounts can only update messages created by the calling Chat app.",
"flatPath": "v1/spaces/{spacesId}/messages/{messagesId}",
"httpMethod": "PATCH",
"id": "chat.spaces.messages.patch",
"parameterOrder": [
"name"
],
"parameters": {
"allowMissing": {
"description": "Optional. If `true` and the message isn't found, a new message is created and `updateMask` is ignored. The specified message ID must be [client-assigned](https://developers.google.com/chat/api/guides/v1/messages/create#name_a_created_message) or the request fails.",
"location": "query",
"type": "boolean"
},
"name": {
"description": "Resource name in the form `spaces/*/messages/*`. Example: `spaces/AAAAAAAAAAA/messages/BBBBBBBBBBB.BBBBBBBBBBB`",
"location": "path",
"pattern": "^spaces/[^/]+/messages/[^/]+$",
"required": true,
"type": "string"
},
"updateMask": {
"description": "Required. The field paths to update. Separate multiple values with commas. Currently supported field paths: - `text` - `attachment` - `cards` (Requires [service account authentication](/chat/api/guides/auth/service-accounts).) - `cards_v2` (Requires [service account authentication](/chat/api/guides/auth/service-accounts).)",
"format": "google-fieldmask",
"location": "query",
"type": "string"
}
},
"path": "v1/{+name}",
"request": {
"$ref": "Message"
},
"response": {
"$ref": "Message"
},
"scopes": [
"https://www.googleapis.com/auth/chat.bot",
"https://www.googleapis.com/auth/chat.import",
"https://www.googleapis.com/auth/chat.messages"
]
},
"update": {
"description": "Updates a message. There's a difference between the `patch` and `update` methods. The `patch` method uses a `patch` request while the `update` method uses a `put` request. We recommend using the `patch` method. For an example, see [Update a message](https://developers.google.com/chat/api/guides/v1/messages/update). Requires [authentication](https://developers.google.com/chat/api/guides/auth). Fully supports [service account authentication](https://developers.google.com/chat/api/guides/auth/service-accounts) and [user authentication](https://developers.google.com/chat/api/guides/auth/users). [User authentication](https://developers.google.com/chat/api/guides/auth/users) requires the `chat.messages` authorization scope. Requests authenticated with service accounts can only update messages created by the calling Chat app.",
"flatPath": "v1/spaces/{spacesId}/messages/{messagesId}",
"httpMethod": "PUT",
"id": "chat.spaces.messages.update",
"parameterOrder": [
"name"
],
"parameters": {
"allowMissing": {
"description": "Optional. If `true` and the message isn't found, a new message is created and `updateMask` is ignored. The specified message ID must be [client-assigned](https://developers.google.com/chat/api/guides/v1/messages/create#name_a_created_message) or the request fails.",
"location": "query",
"type": "boolean"
},
"name": {
"description": "Resource name in the form `spaces/*/messages/*`. Example: `spaces/AAAAAAAAAAA/messages/BBBBBBBBBBB.BBBBBBBBBBB`",
"location": "path",
"pattern": "^spaces/[^/]+/messages/[^/]+$",
"required": true,
"type": "string"
},
"updateMask": {
"description": "Required. The field paths to update. Separate multiple values with commas. Currently supported field paths: - `text` - `attachment` - `cards` (Requires [service account authentication](/chat/api/guides/auth/service-accounts).) - `cards_v2` (Requires [service account authentication](/chat/api/guides/auth/service-accounts).)",
"format": "google-fieldmask",
"location": "query",
"type": "string"
}
},
"path": "v1/{+name}",
"request": {
"$ref": "Message"
},
"response": {
"$ref": "Message"
},
"scopes": [
"https://www.googleapis.com/auth/chat.bot",
"https://www.googleapis.com/auth/chat.import",
"https://www.googleapis.com/auth/chat.messages"
]
}
},
"resources": {
"attachments": {
"methods": {
"get": {
"description": "Gets the metadata of a message attachment. The attachment data is fetched using the [media API](https://developers.google.com/chat/api/reference/rest/v1/media/download). For an example, see [Get a message attachment](https://developers.google.com/chat/api/guides/v1/media-and-attachments/get). Requires [service account authentication](https://developers.google.com/chat/api/guides/auth/service-accounts).",
"flatPath": "v1/spaces/{spacesId}/messages/{messagesId}/attachments/{attachmentsId}",
"httpMethod": "GET",
"id": "chat.spaces.messages.attachments.get",
"parameterOrder": [
"name"
],
"parameters": {
"name": {
"description": "Required. Resource name of the attachment, in the form `spaces/*/messages/*/attachments/*`.",
"location": "path",
"pattern": "^spaces/[^/]+/messages/[^/]+/attachments/[^/]+$",
"required": true,
"type": "string"
}
},
"path": "v1/{+name}",
"response": {
"$ref": "Attachment"
},
"scopes": [
"https://www.googleapis.com/auth/chat.bot"
]
}
}
},
"reactions": {
"methods": {
"create": {
"description": "Creates a reaction and adds it to a message. For an example, see [Create a reaction](https://developers.google.com/chat/api/guides/v1/reactions/create). Requires [user authentication](https://developers.google.com/chat/api/guides/auth/users) and the `chat.messages`, `chat.messages.reactions`, or `chat.messages.reactions.create` scope. Only unicode emoji are supported.",
"flatPath": "v1/spaces/{spacesId}/messages/{messagesId}/reactions",
"httpMethod": "POST",
"id": "chat.spaces.messages.reactions.create",
"parameterOrder": [
"parent"
],
"parameters": {
"parent": {
"description": "Required. The message where the reaction is created. Format: `spaces/{space}/messages/{message}`",
"location": "path",
"pattern": "^spaces/[^/]+/messages/[^/]+$",
"required": true,
"type": "string"
}
},
"path": "v1/{+parent}/reactions",
"request": {
"$ref": "Reaction"
},
"response": {
"$ref": "Reaction"
},
"scopes": [
"https://www.googleapis.com/auth/chat.import",
"https://www.googleapis.com/auth/chat.messages",
"https://www.googleapis.com/auth/chat.messages.reactions",
"https://www.googleapis.com/auth/chat.messages.reactions.create"
]
},
"delete": {
"description": "Deletes a reaction to a message. For an example, see [Delete a reaction](https://developers.google.com/chat/api/guides/v1/reactions/delete). Requires [user authentication](https://developers.google.com/chat/api/guides/auth/users) and the `chat.messages` or `chat.messages.reactions` scope.",
"flatPath": "v1/spaces/{spacesId}/messages/{messagesId}/reactions/{reactionsId}",
"httpMethod": "DELETE",
"id": "chat.spaces.messages.reactions.delete",
"parameterOrder": [
"name"
],
"parameters": {
"name": {
"description": "Required. Name of the reaction to delete. Format: `spaces/{space}/messages/{message}/reactions/{reaction}`",
"location": "path",
"pattern": "^spaces/[^/]+/messages/[^/]+/reactions/[^/]+$",
"required": true,
"type": "string"
}
},
"path": "v1/{+name}",
"response": {
"$ref": "Empty"
},
"scopes": [
"https://www.googleapis.com/auth/chat.import",
"https://www.googleapis.com/auth/chat.messages",
"https://www.googleapis.com/auth/chat.messages.reactions"
]
},
"list": {
"description": "Lists reactions to a message. For an example, see [List reactions](https://developers.google.com/chat/api/guides/v1/reactions/list). Requires [user authentication](https://developers.google.com/chat/api/guides/auth/users) and `chat.messages`, `chat.messages.readonly`, `chat.messages.reactions`, or `chat.messages.reactions.readonly` scope.",
"flatPath": "v1/spaces/{spacesId}/messages/{messagesId}/reactions",
"httpMethod": "GET",
"id": "chat.spaces.messages.reactions.list",
"parameterOrder": [
"parent"
],
"parameters": {
"filter": {
"description": "Optional. A query filter. You can filter reactions by [emoji](https://developers.google.com/chat/api/reference/rest/v1/Emoji) (either `emoji.unicode` or `emoji.custom_emoji.uid`) and [user](https://developers.google.com/chat/api/reference/rest/v1/User) (`user.name`). To filter reactions for multiple emojis or users, join similar fields with the `OR` operator, such as `emoji.unicode = \"π\" OR emoji.unicode = \"π\"` and `user.name = \"users/AAAAAA\" OR user.name = \"users/BBBBBB\"`. To filter reactions by emoji and user, use the `AND` operator, such as `emoji.unicode = \"π\" AND user.name = \"users/AAAAAA\"`. If your query uses both `AND` and `OR`, group them with parentheses. For example, the following queries are valid: ``` user.name = \"users/{user}\" emoji.unicode = \"π\" emoji.custom_emoji.uid = \"{uid}\" emoji.unicode = \"π\" OR emoji.unicode = \"π\" emoji.unicode = \"π\" OR emoji.custom_emoji.uid = \"{uid}\" emoji.unicode = \"π\" AND user.name = \"users/{user}\" (emoji.unicode = \"π\" OR emoji.custom_emoji.uid = \"{uid}\") AND user.name = \"users/{user}\" ``` The following queries are invalid: ``` emoji.unicode = \"π\" AND emoji.unicode = \"π\" emoji.unicode = \"π\" AND emoji.custom_emoji.uid = \"{uid}\" emoji.unicode = \"π\" OR user.name = \"users/{user}\" emoji.unicode = \"π\" OR emoji.custom_emoji.uid = \"{uid}\" OR user.name = \"users/{user}\" emoji.unicode = \"π\" OR emoji.custom_emoji.uid = \"{uid}\" AND user.name = \"users/{user}\" ``` Invalid queries are rejected by the server with an `INVALID_ARGUMENT` error.",
"location": "query",
"type": "string"
},
"pageSize": {
"description": "Optional. The maximum number of reactions returned. The service can return fewer reactions than this value. If unspecified, the default value is 25. The maximum value is 200; values above 200 are changed to 200.",
"format": "int32",
"location": "query",
"type": "integer"
},
"pageToken": {
"description": "Optional. (If resuming from a previous query.) A page token received from a previous list reactions call. Provide this to retrieve the subsequent page. When paginating, the filter value should match the call that provided the page token. Passing a different value might lead to unexpected results.",
"location": "query",
"type": "string"
},
"parent": {
"description": "Required. The message users reacted to. Format: `spaces/{space}/messages/{message}`",
"location": "path",
"pattern": "^spaces/[^/]+/messages/[^/]+$",
"required": true,
"type": "string"
}
},
"path": "v1/{+parent}/reactions",
"response": {
"$ref": "ListReactionsResponse"
},
"scopes": [
"https://www.googleapis.com/auth/chat.messages",
"https://www.googleapis.com/auth/chat.messages.reactions",
"https://www.googleapis.com/auth/chat.messages.reactions.readonly",
"https://www.googleapis.com/auth/chat.messages.readonly"
]
}
}
}
}
}
}
}
},
"revision": "20230816",
"rootUrl": "https://chat.googleapis.com/",
"schemas": {
"ActionParameter": {
"description": "List of string parameters to supply when the action method is invoked. For example, consider three snooze buttons: snooze now, snooze one day, snooze next week. You might use `action method = snooze()`, passing the snooze type and snooze time in the list of string parameters.",
"id": "ActionParameter",
"properties": {
"key": {
"description": "The name of the parameter for the action script.",
"type": "string"
},
"value": {
"description": "The value of the parameter.",
"type": "string"
}
},
"type": "object"
},
"ActionResponse": {
"description": "Parameters that a Chat app can use to configure how its response is posted.",
"id": "ActionResponse",
"properties": {
"dialogAction": {
"$ref": "DialogAction",
"description": "Input only. A response to an event related to a [dialog](https://developers.google.com/chat/how-tos/dialogs). Must be accompanied by `ResponseType.Dialog`."
},
"type": {
"description": "Input only. The type of Chat app response.",
"enum": [
"TYPE_UNSPECIFIED",
"NEW_MESSAGE",
"UPDATE_MESSAGE",
"UPDATE_USER_MESSAGE_CARDS",
"REQUEST_CONFIG",
"DIALOG"
],
"enumDescriptions": [
"Default type that's handled as `NEW_MESSAGE`.",
"Post as a new message in the topic.",
"Update the Chat app's message. This is only permitted on a `CARD_CLICKED` event where the message sender type is `BOT`.",
"Update the cards on a user's message. This is only permitted as a response to a `MESSAGE` event with a matched url, or a `CARD_CLICKED` event where the message sender type is `HUMAN`. Text is ignored.",
"Privately ask the user for additional authentication or configuration.",
"Presents a [dialog](https://developers.google.com/chat/how-tos/dialogs)."