Package google.chat.v1

شاخص

سرویس چت

توسعه دهندگان را قادر می سازد تا برنامه های گپ و ادغام را در سیستم عامل Google Chat ایجاد کنند.

CompleteImportSpace

rpc CompleteImportSpace( CompleteImportSpaceRequest ) returns ( CompleteImportSpaceResponse )

فرآیند واردات را برای فضای مشخص شده تکمیل می کند و آن را برای کاربران قابل مشاهده می کند.

به احراز هویت کاربر و تفویض اختیار در سطح دامنه با محدوده مجوز نیاز دارد:

  • https://www.googleapis.com/auth/chat.import

برای اطلاعات بیشتر، به مجوز برنامه‌های گپ Google برای وارد کردن داده‌ها مراجعه کنید.

محدوده مجوز

به محدوده OAuth زیر نیاز دارد:

  • https://www.googleapis.com/auth/chat.import

برای اطلاعات بیشتر، به راهنمای مجوز مراجعه کنید.

CreateCustomEmoji

rpc CreateCustomEmoji( CreateCustomEmojiRequest ) returns ( CustomEmoji )

یک ایموجی سفارشی ایجاد می کند.

شکلک‌های سفارشی فقط برای حساب‌های Google Workspace در دسترس هستند و سرپرست باید شکلک‌های سفارشی را برای سازمان روشن کند. برای اطلاعات بیشتر، در مورد اموجی‌های سفارشی در گپ Google بدانید و مجوزهای شکلک سفارشی را مدیریت کنید .

نیاز به احراز هویت کاربر با دامنه مجوز دارد:

  • https://www.googleapis.com/auth/chat.customemojis
محدوده مجوز

به محدوده OAuth زیر نیاز دارد:

  • https://www.googleapis.com/auth/chat.customemojis

برای اطلاعات بیشتر، به راهنمای مجوز مراجعه کنید.

ایجاد عضویت

rpc CreateMembership( CreateMembershipRequest ) returns ( Membership )

عضویت در برنامه چت تماس ، کاربر یا یک گروه Google را ایجاد می کند. ایجاد عضویت برای سایر برنامه های چت پشتیبانی نمی شود. هنگام ایجاد عضویت، اگر خط‌مشی پذیرش خودکار عضو مشخص‌شده خاموش باشد، دعوت می‌شود و باید قبل از پیوستن، دعوت فضایی را بپذیرد. در غیر این صورت ، ایجاد عضویت ، عضو را مستقیماً به فضای مشخص شده اضافه می کند.

از انواع احراز هویت زیر پشتیبانی می کند:

  • احراز هویت برنامه با تأیید مدیر و دامنه مجوز:

    • https://www.googleapis.com/auth/chat.app.memberships
  • احراز هویت کاربر با یکی از حوزه های مجوز زیر:

    • https://www.googleapis.com/auth/chat.memberships
    • https://www.googleapis.com/auth/chat.memberships.app (برای افزودن برنامه تماس به فضا)
    • https://www.googleapis.com/auth/chat.import (فقط فضاهای حالت واردات)
    • احراز هویت کاربر، زمانی که یک حساب سرپرست احراز هویت می‌شود، use_admin_access true است، و از محدوده مجوز زیر استفاده می‌شود، امتیازات سرپرست اعطا می‌شود:
      • https://www.googleapis.com/auth/chat.admin.memberships

احراز هویت برنامه برای موارد استفاده زیر پشتیبانی نمی‌شود:

  • دعوت از کاربران خارجی به سازمان Workspace که صاحب فضا است.
  • افزودن یک گروه Google به یک فضا
  • افزودن یک برنامه چت به یک فضا.

برای مثال استفاده، نگاه کنید به:

محدوده مجوز

به یکی از حوزه های OAuth زیر نیاز دارد:

  • https://www.googleapis.com/auth/chat.app.memberships
  • https://www.googleapis.com/auth/chat.admin.memberships
  • https://www.googleapis.com/auth/chat.import
  • https://www.googleapis.com/auth/chat.memberships
  • https://www.googleapis.com/auth/chat.memberships.app

برای اطلاعات بیشتر ، به راهنمای مجوز مراجعه کنید.

ایجاد پیام

rpc CreateMessage( CreateMessageRequest ) returns ( Message )

پیامی را در فضای چت Google ایجاد می کند. برای مثال، به ارسال پیام مراجعه کنید.

از انواع احراز هویت زیر پشتیبانی می کند:

  • احراز هویت برنامه با محدوده مجوز:
    • https://www.googleapis.com/auth/chat.bot
  • احراز هویت کاربر با یکی از اسکوپ های مجوز زیر:
    • https://www.googleapis.com/auth/chat.messages.create
    • https://www.googleapis.com/auth/chat.messages
    • https://www.googleapis.com/auth/chat.import (فقط فضاهای حالت واردات)

Chat بسته به نوع احراز هویتی که در درخواست خود استفاده می کنید، فرستنده پیام را متفاوت نسبت می دهد.

تصویر زیر نشان می دهد که چگونه Chat هنگام استفاده از احراز هویت برنامه، پیامی را نسبت می دهد. Chat برنامه چت را به عنوان فرستنده پیام نمایش می دهد. محتوای پیام می‌تواند شامل متن ( text )، کارت‌ها ( cardsV2 ) و ابزارک‌های جانبی (ویدجت‌های accessoryWidgets ) باشد.

پیام با احراز هویت برنامه ارسال شد

The following image shows how Chat attributes a message when you use user authentication. Chat کاربر را به عنوان فرستنده پیام نمایش می دهد و برنامه Chat را با نمایش نام پیام به آن نسبت می دهد. محتوای پیام فقط می تواند حاوی متن ( text ) باشد.

پیام با احراز هویت کاربر ارسال شد

حداکثر اندازه پیام، با احتساب محتوای پیام، 32000 بایت است.

برای درخواست های وب هوک ، پاسخ حاوی پیام کامل نیست. پاسخ فقط فیلدهای name و thread.name را علاوه بر اطلاعاتی که در درخواست بود پر می کند.

محدوده مجوز

به یکی از حوزه های OAuth زیر نیاز دارد:

  • 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

برای اطلاعات بیشتر ، به راهنمای مجوز مراجعه کنید.

CreateReaction

rpc CreateReaction( CreateReactionRequest ) returns ( Reaction )

یک واکنش ایجاد می کند و آن را به یک پیام اضافه می کند. برای مثال، افزودن واکنش به پیام را ببینید.

به احراز هویت کاربر با یکی از حوزه های مجوز زیر نیاز دارد:

  • https://www.googleapis.com/auth/chat.messages.reactions.create
  • https://www.googleapis.com/auth/chat.messages.reactions
  • https://www.googleapis.com/auth/chat.messages
  • https://www.googleapis.com/auth/chat.import (فقط فضاهای حالت واردات)
محدوده مجوز

به یکی از حوزه های OAuth زیر نیاز دارد:

  • 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

برای اطلاعات بیشتر، به راهنمای مجوز مراجعه کنید.

CreateSpace

rpc CreateSpace( CreateSpaceRequest ) returns ( Space )

فضا ایجاد می کند. می توان از آن برای ایجاد یک فضای نامگذاری شده یا یک چت گروهی در Import mode استفاده کرد. برای مثال، ایجاد فاصله را ببینید.

از انواع احراز هویت زیر پشتیبانی می کند:

  • احراز هویت برنامه با تأیید مدیر و یکی از مجوزهای زیر:

    • https://www.googleapis.com/auth/chat.app.spaces.create
    • https://www.googleapis.com/auth/chat.app.spaces
  • احراز هویت کاربر با یکی از حوزه های مجوز زیر:

    • https://www.googleapis.com/auth/chat.spaces.create
    • https://www.googleapis.com/auth/chat.spaces
    • https://www.googleapis.com/auth/chat.import (فقط فضاهای حالت واردات)

هنگام احراز هویت به عنوان یک برنامه، قسمت space.customer باید در درخواست تنظیم شود.

هنگام احراز هویت به عنوان یک برنامه، برنامه Chat به عنوان عضوی از فضا اضافه می شود. با این حال ، بر خلاف احراز هویت انسانی ، برنامه گپ به عنوان مدیر فضا اضافه نمی شود. به طور پیش فرض ، برنامه چت توسط همه اعضای فضایی می تواند از فضا خارج شود. برای اینکه فقط مدیران فضا بتوانند برنامه را از یک فضا حذف کنند ، space.permission_settings.manage_apps را برای managers_allowed تنظیم کنید.

عضویت در فضا پس از ایجاد بستگی به این دارد که آیا فضا در Import mode ایجاد شده است:

  • حالت واردات: هیچ عضوی ایجاد نمی شود.
  • همه حالت های دیگر: کاربر تماس گیرنده به عنوان عضو اضافه می شود. این است:
    • خود برنامه هنگام استفاده از احراز هویت برنامه.
    • کاربر انسانی هنگام استفاده از احراز هویت کاربر.

اگر هنگام ایجاد یک فضا ، پیام خطا را ALREADY_EXISTS دریافت کرده اید ، یک displayName متفاوت را امتحان کنید. فضای موجود در سازمان Google Workspace ممکن است از قبل از این نام نمایشی استفاده کند.

محدوده مجوز

به یکی از حوزه های OAuth زیر نیاز دارد:

  • https://www.googleapis.com/auth/chat.app.spaces.create
  • https://www.googleapis.com/auth/chat.app.spaces
  • https://www.googleapis.com/auth/chat.import
  • https://www.googleapis.com/auth/chat.spaces
  • https://www.googleapis.com/auth/chat.spaces.create

For more information, see the Authorization guide .

حذف سفارشی ایموجی

rpc DeleteCustomEmoji( DeleteCustomEmojiRequest ) returns ( Empty )

یک ایموجی سفارشی را حذف می کند. به طور پیش فرض، کاربران فقط می توانند شکلک های سفارشی خود را حذف کنند. مدیران ایموجی که توسط مدیر منصوب شده است می توانند هر ایموجی سفارشی را در سازمان حذف کنند. به آموزش درباره شکلک های سفارشی در گپ Google مراجعه کنید.

شکلک‌های سفارشی فقط برای حساب‌های Google Workspace در دسترس هستند و سرپرست باید شکلک‌های سفارشی را برای سازمان روشن کند. برای اطلاعات بیشتر ، به یادگیری در مورد ایموجی های سفارشی در Google Chat مراجعه کنید و مجوزهای ایموجی سفارشی را مدیریت کنید .

نیاز به احراز هویت کاربر با دامنه مجوز دارد:

  • https://www.googleapis.com/auth/chat.customemojis
محدوده مجوز

به محدوده OAuth زیر نیاز دارد:

  • https://www.googleapis.com/auth/chat.customemojis

برای اطلاعات بیشتر ، به راهنمای مجوز مراجعه کنید.

حذف عضویت

rpc DeleteMembership( DeleteMembershipRequest ) returns ( Membership )

عضویت را حذف می کند. For an example, see Remove a user or a Google Chat app from a space .

از انواع احراز هویت زیر پشتیبانی می کند:

  • احراز هویت برنامه با تأیید سرپرست و محدوده مجوز:

    • https://www.googleapis.com/auth/chat.app.memberships
  • احراز هویت کاربر با یکی از اسکوپ های مجوز زیر:

    • https://www.googleapis.com/auth/chat.memberships
    • https://www.googleapis.com/auth/chat.memberships.app (برای حذف برنامه تماس از فضا)
    • https://www.googleapis.com/auth/chat.import (فقط فضاهای حالت واردات)
    • احراز هویت کاربر، زمانی که یک حساب سرپرست احراز هویت می‌شود، use_admin_access true است، و از محدوده مجوز زیر استفاده می‌شود، امتیازات سرپرست اعطا می‌شود:
      • https://www.googleapis.com/auth/chat.admin.memberships

احراز هویت برنامه برای موارد استفاده زیر پشتیبانی نمی شود:

  • حذف یک گروه Google از یک فضا.
  • حذف یک برنامه چت از یک فضا.

برای حذف عضویت برای مدیران فضا، درخواست کننده باید یک مدیر فضا باشد. If you're using app authentication the Chat app must be the space creator.

محدوده مجوز

به یکی از حوزه های OAuth زیر نیاز دارد:

  • https://www.googleapis.com/auth/chat.app.memberships
  • https://www.googleapis.com/auth/chat.admin.memberships
  • https://www.googleapis.com/auth/chat.import
  • https://www.googleapis.com/auth/chat.memberships
  • https://www.googleapis.com/auth/chat.memberships.app

For more information, see the Authorization guide .

حذف

rpc DeleteMessage( DeleteMessageRequest ) returns ( Empty )

یک پیام را حذف می کند. برای مثال، حذف یک پیام را ببینید.

از انواع احراز هویت زیر پشتیبانی می کند:

  • احراز هویت برنامه با محدوده مجوز:

    • https://www.googleapis.com/auth/chat.bot
  • احراز هویت کاربر با یکی از اسکوپ های مجوز زیر:

    • https://www.googleapis.com/auth/chat.messages
    • https://www.googleapis.com/auth/chat.import (فقط فضاهای حالت واردات)

هنگام استفاده از تأیید اعتبار برنامه ، درخواست ها فقط می توانند پیام های ایجاد شده توسط برنامه چت تماس را حذف کنند.

محدوده مجوز

به یکی از حوزه های OAuth زیر نیاز دارد:

  • https://www.googleapis.com/auth/chat.bot
  • https://www.googleapis.com/auth/chat.import
  • https://www.googleapis.com/auth/chat.messages

برای اطلاعات بیشتر، به راهنمای مجوز مراجعه کنید.

DeleteReaction

rpc DeleteReaction( DeleteReactionRequest ) returns ( Empty )

واکنش به یک پیام را حذف می کند. برای مثال، حذف واکنش را ببینید.

به احراز هویت کاربر با یکی از اسکوپ های مجوز زیر نیاز دارد:

  • https://www.googleapis.com/auth/chat.messages.reactions
  • https://www.googleapis.com/auth/chat.messages
  • https://www.googleapis.com/auth/chat.import (فقط فضاهای حالت واردات)
محدوده مجوز

به یکی از حوزه های OAuth زیر نیاز دارد:

  • https://www.googleapis.com/auth/chat.import
  • https://www.googleapis.com/auth/chat.messages
  • https://www.googleapis.com/auth/chat.messages.reactions

برای اطلاعات بیشتر ، به راهنمای مجوز مراجعه کنید.

DeleteSpace

rpc DeleteSpace( DeleteSpaceRequest ) returns ( Empty )

فضای نامگذاری شده را حذف می کند. همیشه یک حذف آبشاری انجام می دهد، به این معنی که منابع فرزند فضا - مانند پیام های ارسال شده در فضا و عضویت در فضا - نیز حذف می شوند. برای مثال، حذف یک فاصله را ببینید.

از انواع احراز هویت زیر پشتیبانی می کند:

  • احراز هویت برنامه با تأیید سرپرست و محدوده مجوز:

    • https://www.googleapis.com/auth/chat.app.delete (فقط در فضاهایی که برنامه ایجاد کرده است)
  • احراز هویت کاربر با یکی از حوزه های مجوز زیر:

    • https://www.googleapis.com/auth/chat.delete
    • https://www.googleapis.com/auth/chat.import (فقط فضاهای حالت واردات)
    • احراز هویت کاربر، زمانی که یک حساب سرپرست احراز هویت می‌شود، use_admin_access true است، و از محدوده مجوز زیر استفاده می‌شود، امتیازات سرپرست اعطا می‌شود:
      • https://www.googleapis.com/auth/chat.admin.delete
محدوده مجوز

به یکی از حوزه های OAuth زیر نیاز دارد:

  • https://www.googleapis.com/auth/chat.app.delete
  • https://www.googleapis.com/auth/chat.admin.delete
  • https://www.googleapis.com/auth/chat.import
  • https://www.googleapis.com/auth/chat.delete

برای اطلاعات بیشتر ، به راهنمای مجوز مراجعه کنید.

FindDirectMessage

rpc FindDirectMessage( FindDirectMessageRequest ) returns ( Space )

Returns the existing direct message with the specified user. اگر فضای پیام مستقیم پیدا نشد، خطای 404 NOT_FOUND را برمی‌گرداند. برای مثال، به یافتن یک پیام مستقیم مراجعه کنید.

با احراز هویت برنامه ، فضای پیام مستقیم بین کاربر مشخص شده و برنامه چت در حال تماس را برمی‌گرداند.

با احراز هویت کاربر ، فضای پیام مستقیم بین کاربر مشخص شده و کاربر احراز هویت شده را برمی گرداند.

از انواع احراز هویت زیر پشتیبانی می کند:

محدوده مجوز

به یکی از حوزه های OAuth زیر نیاز دارد:

  • https://www.googleapis.com/auth/chat.spaces
  • https://www.googleapis.com/auth/chat.spaces.readonly
  • https://www.googleapis.com/auth/chat.bot

برای اطلاعات بیشتر، به راهنمای مجوز مراجعه کنید.

GetAttachment

rpc GetAttachment( GetAttachmentRequest ) returns ( Attachment )

فراداده یک پیوست پیام را دریافت می کند. داده های پیوست با استفاده از API رسانه ای بدست می آیند. به عنوان مثال ، به ابرداده در مورد پیوست پیام مراجعه کنید.

Requires app authentication with the authorization scope :

  • https://www.googleapis.com/auth/chat.bot
حوزه های مجوز

به محدوده OAuth زیر نیاز دارد:

  • https://www.googleapis.com/auth/chat.bot

برای اطلاعات بیشتر ، به راهنمای مجوز مراجعه کنید.

GetCustomEmoji

rpc GetCustomEmoji( GetCustomEmojiRequest ) returns ( CustomEmoji )

جزئیات یک ایموجی سفارشی را برمی‌گرداند.

شکلک‌های سفارشی فقط برای حساب‌های Google Workspace در دسترس هستند و سرپرست باید شکلک‌های سفارشی را برای سازمان روشن کند. برای اطلاعات بیشتر، در مورد اموجی‌های سفارشی در گپ Google بدانید و مجوزهای شکلک سفارشی را مدیریت کنید .

به احراز هویت کاربر با یکی از اسکوپ های مجوز زیر نیاز دارد:

  • https://www.googleapis.com/auth/chat.customemojis.readonly
  • https://www.googleapis.com/auth/chat.customemojis
محدوده مجوز

به یکی از حوزه های OAuth زیر نیاز دارد:

  • https://www.googleapis.com/auth/chat.customemojis
  • https://www.googleapis.com/auth/chat.customemojis.readonly

برای اطلاعات بیشتر ، به راهنمای مجوز مراجعه کنید.

GetMembership

rpc GetMembership( GetMembershipRequest ) returns ( Membership )

جزئیات عضویت را برمی‌گرداند. به عنوان مثال ، به جزئیات مربوط به عضویت برنامه کاربر یا Google Chat مراجعه کنید.

از انواع احراز هویت زیر پشتیبانی می کند:

  • احراز هویت برنامه با یکی از اسکوپ های مجوز زیر:

    • https://www.googleapis.com/auth/chat.bot
    • https://www.googleapis.com/auth/chat.app.memberships ( به تأیید مدیر نیاز دارد)
  • احراز هویت کاربر با یکی از اسکوپ های مجوز زیر:

    • https://www.googleapis.com/auth/chat.memberships.readonly
    • https://www.googleapis.com/auth/chat.memberships
    • احراز هویت کاربر هنگامی که حساب سرپرست احراز هویت می‌شود، use_admin_access true است و یکی از حوزه‌های مجوز زیر استفاده می‌شود، امتیازات سرپرست را اعطا می‌کند:
      • https://www.googleapis.com/auth/chat.admin.memberships.readonly
      • https://www.googleapis.com/auth/chat.admin.memberships
حوزه های مجوز

به یکی از حوزه های OAuth زیر نیاز دارد:

  • https://www.googleapis.com/auth/chat.admin.memberships
  • https://www.googleapis.com/auth/chat.admin.memberships.readonly
  • https://www.googleapis.com/auth/chat.app.memberships
  • https://www.googleapis.com/auth/chat.bot
  • https://www.googleapis.com/auth/chat.memberships
  • https://www.googleapis.com/auth/chat.memberships.readonly

برای اطلاعات بیشتر، به راهنمای مجوز مراجعه کنید.

GetMessage

rpc GetMessage( GetMessageRequest ) returns ( Message )

جزئیات یک پیام را برمی گرداند. برای مثال ، به جزئیات مربوط به یک پیام مراجعه کنید.

از انواع احراز هویت زیر پشتیبانی می کند:

توجه: ممکن است پیامی را از یک عضو یا فضای مسدود شده برگرداند.

محدوده مجوز

به یکی از حوزه های OAuth زیر نیاز دارد:

  • https://www.googleapis.com/auth/chat.bot
  • https://www.googleapis.com/auth/chat.messages
  • https://www.googleapis.com/auth/chat.messages.readonly

برای اطلاعات بیشتر ، به راهنمای مجوز مراجعه کنید.

GetSpace

rpc GetSpace( GetSpaceRequest ) returns ( Space )

جزئیات یک فضا را برمی‌گرداند. برای مثال، به دریافت جزئیات در مورد یک فضا مراجعه کنید.

از انواع احراز هویت زیر پشتیبانی می کند:

  • احراز هویت برنامه با یکی از حوزه های مجوز زیر:

    • https://www.googleapis.com/auth/chat.bot
    • https://www.googleapis.com/auth/chat.app.spaces با تأیید مدیر
  • احراز هویت کاربر با یکی از حوزه های مجوز زیر:

    • https://www.googleapis.com/auth/chat.spaces.readonly
    • https://www.googleapis.com/auth/chat.spaces
    • احراز هویت کاربر هنگامی که حساب سرپرست احراز هویت می‌شود، use_admin_access true است و یکی از حوزه‌های مجوز زیر استفاده می‌شود، امتیازات سرپرست را اعطا می‌کند:
      • https://www.googleapis.com/auth/chat.admin.spaces.readonly
      • https://www.googleapis.com/auth/chat.admin.spaces

احراز هویت برنامه دارای محدودیت های زیر است:

  • space.access_settings فقط هنگام استفاده از دامنه chat.app.spaces جمع می شود.
  • space.predefind_permission_settings و space.permission_settings فقط هنگام استفاده از محدوده chat.app.spaces پر می شوند و فقط برای فضاهایی که برنامه ایجاد کرده است.
محدوده مجوز

به یکی از حوزه های OAuth زیر نیاز دارد:

  • https://www.googleapis.com/auth/chat.admin.spaces
  • https://www.googleapis.com/auth/chat.admin.spaces.readonly
  • https://www.googleapis.com/auth/chat.spaces
  • https://www.googleapis.com/auth/chat.spaces.readonly
  • https://www.googleapis.com/auth/chat.bot
  • https://www.googleapis.com/auth/chat.app.spaces

برای اطلاعات بیشتر ، به راهنمای مجوز مراجعه کنید.

GetSpaceEvent

rpc GetSpaceEvent( GetSpaceEventRequest ) returns ( SpaceEvent )

رویدادی را از فضای گپ Google برمی‌گرداند. بارگذاری رویداد حاوی جدیدترین نسخه منبعی است که تغییر کرده است. به عنوان مثال، اگر رویدادی را درباره یک پیام جدید درخواست کنید اما پیام بعداً به‌روزرسانی شد، سرور منبع Message به‌روز شده را در بارگذاری رویداد برمی‌گرداند.

توجه: قسمت permissionSettings در شیء فضایی داده های رویداد فضایی برای این درخواست بازگردانده نمی شود.

به احراز هویت کاربر با دامنه مجوز مناسب برای خواندن داده های درخواست شده نیاز دارد:

  • https://www.googleapis.com/auth/chat.spaces.readonly
  • https://www.googleapis.com/auth/chat.spaces
  • https://www.googleapis.com/auth/chat.messages.readonly
  • https://www.googleapis.com/auth/chat.messages
  • https://www.googleapis.com/auth/chat.messages.reactions.readonly
  • https://www.googleapis.com/auth/chat.messages.reactions
  • https://www.googleapis.com/auth/chat.memberships.readonly
  • https://www.googleapis.com/auth/chat.memberships

برای به دست آوردن یک رویداد ، کاربر معتبر باید عضو فضا باشد.

به عنوان مثال ، جزئیات مربوط به یک رویداد را از یک فضای چت Google دریافت کنید .

محدوده مجوز

به یکی از حوزه های OAuth زیر نیاز دارد:

  • https://www.googleapis.com/auth/chat.spaces
  • https://www.googleapis.com/auth/chat.spaces.readonly
  • https://www.googleapis.com/auth/chat.messages
  • https://www.googleapis.com/auth/chat.messages.readonly
  • https://www.googleapis.com/auth/chat.memberships
  • https://www.googleapis.com/auth/chat.memberships.readonly
  • https://www.googleapis.com/auth/chat.messages.reactions
  • https://www.googleapis.com/auth/chat.messages.reactions.readonly

برای اطلاعات بیشتر ، به راهنمای مجوز مراجعه کنید.

GetSpaceNotificationSetting

rpc GetSpaceNotificationSetting( GetSpaceNotificationSettingRequest ) returns ( SpaceNotificationSetting )

تنظیمات اعلان فضایی را دریافت می کند. به عنوان مثال ، به تنظیم اطلاع رسانی فضایی تماس گیرنده مراجعه کنید.

نیاز به احراز هویت کاربر با محدوده مجوز :

  • https://www.googleapis.com/auth/chat.users.spacesettings
محدوده مجوز

به محدوده OAuth زیر نیاز دارد:

  • https://www.googleapis.com/auth/chat.users.spacesettings

برای اطلاعات بیشتر ، به راهنمای مجوز مراجعه کنید.

GetSpaceReadState

rpc GetSpaceReadState( GetSpaceReadStateRequest ) returns ( SpaceReadState )

جزئیات مربوط به حالت خوانده شده کاربر را در یک فضا ، که برای شناسایی پیام های خوانده شده و خوانده نشده استفاده می شود ، برمی گرداند. برای مثال، به دریافت جزئیات در مورد وضعیت خواندن فضای کاربر مراجعه کنید.

به احراز هویت کاربر با یکی از حوزه های مجوز زیر نیاز دارد:

  • https://www.googleapis.com/auth/chat.users.readstate.readonly
  • https://www.googleapis.com/auth/chat.users.readstate
محدوده مجوز

به یکی از حوزه های OAuth زیر نیاز دارد:

  • https://www.googleapis.com/auth/chat.users.readstate
  • https://www.googleapis.com/auth/chat.users.readstate.readonly

برای اطلاعات بیشتر ، به راهنمای مجوز مراجعه کنید.

GetThreadReadState

rpc GetThreadReadState( GetThreadReadStateRequest ) returns ( ThreadReadState )

جزئیات مربوط به حالت خوانده شده کاربر را در یک موضوع باز می گرداند ، که برای شناسایی پیام های خوانده شده و خوانده نشده استفاده می شود. برای مثال، به دریافت جزئیات در مورد وضعیت خواندن رشته کاربر مراجعه کنید.

به احراز هویت کاربر با یکی از حوزه های مجوز زیر نیاز دارد:

  • https://www.googleapis.com/auth/chat.users.readstate.readonly
  • https://www.googleapis.com/auth/chat.users.readstate
محدوده مجوز

به یکی از حوزه های OAuth زیر نیاز دارد:

  • https://www.googleapis.com/auth/chat.users.readstate
  • https://www.googleapis.com/auth/chat.users.readstate.readonly

برای اطلاعات بیشتر ، به راهنمای مجوز مراجعه کنید.

ListCustomEmojis

rpc ListCustomEmojis( ListCustomEmojisRequest ) returns ( ListCustomEmojisResponse )

ایموجی های سفارشی قابل مشاهده برای کاربر معتبر است.

شکلک‌های سفارشی فقط برای حساب‌های Google Workspace در دسترس هستند و سرپرست باید شکلک‌های سفارشی را برای سازمان روشن کند. برای اطلاعات بیشتر ، به یادگیری در مورد ایموجی های سفارشی در Google Chat مراجعه کنید و مجوزهای ایموجی سفارشی را مدیریت کنید .

به احراز هویت کاربر با یکی از حوزه های مجوز زیر نیاز دارد:

  • https://www.googleapis.com/auth/chat.customemojis.readonly
  • https://www.googleapis.com/auth/chat.customemojis
محدوده مجوز

به یکی از حوزه های OAuth زیر نیاز دارد:

  • https://www.googleapis.com/auth/chat.customemojis
  • https://www.googleapis.com/auth/chat.customemojis.readonly

برای اطلاعات بیشتر، به راهنمای مجوز مراجعه کنید.

لیست اعضا

rpc ListMemberships( ListMembershipsRequest ) returns ( ListMembershipsResponse )

عضویت ها را در یک فضا فهرست می کند. برای مثال، فهرست کاربران و برنامه‌های چت Google را در یک فضا ببینید. فهرست کردن عضویت‌ها با احراز هویت برنامه، عضویت‌ها را در فضاهایی فهرست می‌کند که برنامه Chat به آنها دسترسی دارد، اما عضویت‌های برنامه Chat، از جمله عضویت خود را استثنا نمی‌کند. لیست عضویت با تأیید اعتبار کاربر ، عضویت در فضاهایی را که کاربر معتبر به آن دسترسی دارد ، لیست می کند.

از انواع احراز هویت زیر پشتیبانی می کند:

  • احراز هویت برنامه با یکی از اسکوپ های مجوز زیر:

    • https://www.googleapis.com/auth/chat.bot
    • https://www.googleapis.com/auth/chat.app.memberships ( به تأیید مدیر نیاز دارد)
  • احراز هویت کاربر با یکی از حوزه های مجوز زیر:

    • https://www.googleapis.com/auth/chat.memberships.readonly
    • https://www.googleapis.com/auth/chat.memberships
    • https://www.googleapis.com/auth/chat.import (فقط فضاهای حالت واردات)
    • احراز هویت کاربر هنگامی که حساب سرپرست احراز هویت می‌شود، use_admin_access true است و یکی از حوزه‌های مجوز زیر استفاده می‌شود، امتیازات سرپرست را اعطا می‌کند:
      • https://www.googleapis.com/auth/chat.admin.memberships.readonly
      • https://www.googleapis.com/auth/chat.admin.memberships
محدوده مجوز

به یکی از حوزه های OAuth زیر نیاز دارد:

  • https://www.googleapis.com/auth/chat.admin.memberships
  • https://www.googleapis.com/auth/chat.admin.memberships.readonly
  • https://www.googleapis.com/auth/chat.app.memberships
  • https://www.googleapis.com/auth/chat.bot
  • https://www.googleapis.com/auth/chat.import
  • https://www.googleapis.com/auth/chat.memberships
  • https://www.googleapis.com/auth/chat.memberships.readonly

برای اطلاعات بیشتر ، به راهنمای مجوز مراجعه کنید.

ListMessages

rpc ListMessages( ListMessagesRequest ) returns ( ListMessagesResponse )

پیام هایی را در فضایی که تماس گیرنده عضو آن است ، از جمله پیام های اعضای مسدود شده و فضاها لیست می کند. اگر پیام ها را از فضایی بدون پیام لیست کنید ، پاسخ یک شیء خالی است. When using a REST/HTTP interface, the response contains an empty JSON object, {} . برای مثال، فهرست پیام‌ها را ببینید.

Requires user authentication with one of the following authorization scopes :

  • https://www.googleapis.com/auth/chat.messages.readonly
  • https://www.googleapis.com/auth/chat.messages
  • https://www.googleapis.com/auth/chat.import (فقط فضاهای حالت واردات)
محدوده مجوز

به یکی از حوزه های OAuth زیر نیاز دارد:

  • https://www.googleapis.com/auth/chat.import
  • https://www.googleapis.com/auth/chat.messages
  • https://www.googleapis.com/auth/chat.messages.readonly

برای اطلاعات بیشتر، به راهنمای مجوز مراجعه کنید.

ListReactions

rpc ListReactions( ListReactionsRequest ) returns ( ListReactionsResponse )

واکنش ها به یک پیام را فهرست می کند. برای مثال ، برای یک پیام به واکنش لیست مراجعه کنید.

به احراز هویت کاربر با یکی از حوزه های مجوز زیر نیاز دارد:

  • https://www.googleapis.com/auth/chat.messages.reactions.readonly
  • https://www.googleapis.com/auth/chat.messages.reactions
  • https://www.googleapis.com/auth/chat.messages.readonly
  • https://www.googleapis.com/auth/chat.messages
حوزه های مجوز

به یکی از حوزه های OAuth زیر نیاز دارد:

  • https://www.googleapis.com/auth/chat.messages
  • https://www.googleapis.com/auth/chat.messages.readonly
  • https://www.googleapis.com/auth/chat.messages.reactions
  • https://www.googleapis.com/auth/chat.messages.reactions.readonly

برای اطلاعات بیشتر، به راهنمای مجوز مراجعه کنید.

ListSpaceEvents

rpc ListSpaceEvents( ListSpaceEventsRequest ) returns ( ListSpaceEventsResponse )

رویدادها را از فضای چت Google فهرست می کند. برای هر رویداد، محموله حاوی جدیدترین نسخه منبع چت است. برای مثال، اگر رویدادهای مربوط به اعضای جدید فضایی را فهرست کنید، سرور منابع Membership را که حاوی آخرین جزئیات عضویت است، برمی‌گرداند. اگر اعضای جدید در طول دوره درخواست شده حذف شوند ، بارگذاری رویداد شامل یک منبع Membership خالی است.

نیاز به احراز هویت کاربر با محدوده مجوز مناسب برای خواندن داده های درخواستی:

  • https://www.googleapis.com/auth/chat.spaces.readonly
  • https://www.googleapis.com/auth/chat.spaces
  • https://www.googleapis.com/auth/chat.messages.readonly
  • https://www.googleapis.com/auth/chat.messages
  • https://www.googleapis.com/auth/chat.messages.reactions.readonly
  • https://www.googleapis.com/auth/chat.messages.reactions
  • https://www.googleapis.com/auth/chat.memberships.readonly
  • https://www.googleapis.com/auth/chat.memberships

برای فهرست کردن رویدادها، کاربر احراز هویت شده باید عضوی از فضا باشد.

برای مثال ، به لیست رویدادها از فضای چت Google مراجعه کنید.

محدوده مجوز

به یکی از حوزه های OAuth زیر نیاز دارد:

  • https://www.googleapis.com/auth/chat.spaces
  • https://www.googleapis.com/auth/chat.spaces.readonly
  • https://www.googleapis.com/auth/chat.messages
  • https://www.googleapis.com/auth/chat.messages.readonly
  • https://www.googleapis.com/auth/chat.memberships
  • https://www.googleapis.com/auth/chat.memberships.readonly
  • https://www.googleapis.com/auth/chat.messages.reactions
  • https://www.googleapis.com/auth/chat.messages.reactions.readonly

برای اطلاعات بیشتر، به راهنمای مجوز مراجعه کنید.

ListSpaces

rpc ListSpaces( ListSpacesRequest ) returns ( ListSpacesResponse )

فضاهایی را که تماس گیرنده عضوی از آنها است را فهرست می کند. تا زمانی که اولین پیام ارسال نشود، چت‌های گروهی و پیام‌های پیامکی فهرست نمی‌شوند. برای مثال، لیست فاصله ها را ببینید.

از انواع احراز هویت زیر پشتیبانی می کند:

برای فهرست کردن همه فضاهای نامگذاری شده توسط سازمان Google Workspace، به جای آن از روش spaces.search() با استفاده از امتیازات سرپرست Workspace استفاده کنید.

محدوده مجوز

به یکی از حوزه های OAuth زیر نیاز دارد:

  • https://www.googleapis.com/auth/chat.spaces
  • https://www.googleapis.com/auth/chat.spaces.readonly
  • https://www.googleapis.com/auth/chat.bot

برای اطلاعات بیشتر ، به راهنمای مجوز مراجعه کنید.

فضاهای جستجو

rpc SearchSpaces( SearchSpacesRequest ) returns ( SearchSpacesResponse )

فهرستی از فضاهای یک سازمان Google Workspace را بر اساس جستجوی سرپرست برمی‌گرداند.

به احراز هویت کاربر با امتیازات سرپرست و یکی از حوزه های مجوز زیر نیاز دارد:

  • https://www.googleapis.com/auth/chat.admin.spaces.readonly
  • https://www.googleapis.com/auth/chat.admin.spaces

در درخواست، use_admin_access روی true تنظیم کنید.

محدوده مجوز

به یکی از حوزه های OAuth زیر نیاز دارد:

  • https://www.googleapis.com/auth/chat.admin.spaces
  • https://www.googleapis.com/auth/chat.admin.spaces.readonly

برای اطلاعات بیشتر ، به راهنمای مجوز مراجعه کنید.

SetUpSpace

rpc SetUpSpace( SetUpSpaceRequest ) returns ( Space )

فضایی ایجاد می کند و کاربران مشخصی را به آن اضافه می کند. کاربر تماس گیرنده به طور خودکار به فضا اضافه می شود و نباید به عنوان عضویت در درخواست مشخص شود. برای مثال، به تنظیم فضایی با اعضای اولیه مراجعه کنید.

برای مشخص کردن اعضای انسانی برای اضافه کردن ، عضویت با membership.member.name . برای افزودن کاربر انسانی ، users/{user} استفاده کنید ، جایی که {user} می تواند آدرس ایمیل برای کاربر باشد. برای کاربران در همان سازمان Workspace {user} همچنین می‌تواند id شخص از People API یا id کاربر در Directory API باشد. برای مثال، اگر شناسه نمایه افراد API People برای user@example.com 123456789 باشد، می‌توانید با تنظیم membership.member.name به users/user@example.com یا users/123456789 کاربر را به فضا اضافه کنید.

برای تعیین گروه‌های Google برای افزودن، عضویت‌ها را با membership.group_member.name مناسب اضافه کنید. برای افزودن یا دعوت یک گروه Google، groups/{group} استفاده کنید، جایی که {group} id گروه از Cloud Identity Groups API است. برای مثال، می‌توانید از API جستجوی Cloud Identity Groups برای بازیابی شناسه 123456789 برای ایمیل گروهی group@example.com استفاده کنید، سپس می‌توانید با تنظیم membership.group_member.name group_member.name به groups/123456789 گروه را به فضا اضافه کنید. ایمیل گروهی پشتیبانی نمی‌شود و گروه‌های Google را فقط می‌توان به‌عنوان عضو در فضاهای نام‌گذاری شده اضافه کرد.

برای یک فضای نامگذاری شده یا چت گروهی، اگر تماس گیرنده مسدود شود، یا توسط برخی از اعضا مسدود شده باشد، یا اجازه اضافه کردن برخی از اعضا را نداشته باشد، آن اعضا به فضای ایجاد شده اضافه نمی شوند.

برای ایجاد یک پیام مستقیم (DM) بین کاربر تماس گیرنده و کاربر انسانی دیگر، دقیقاً یک عضویت را برای نشان دادن کاربر انسانی مشخص کنید. اگر یکی از کاربران دیگری را مسدود کند، درخواست با شکست مواجه می شود و DM ایجاد نمی شود.

برای ایجاد یک DM بین کاربر تماس و برنامه تماس ، Space.singleUserBotDm را به true تنظیم کرده و هیچ عضویت را مشخص نکنید. فقط می توانید از این روش برای تنظیم DM با برنامه تماس استفاده کنید. برای افزودن برنامه تماس به عنوان عضو یک فضا یا DM موجود بین دو کاربر انسانی ، به دعوت یا اضافه کردن کاربر یا برنامه به یک فضا مراجعه کنید.

اگر DM در حال حاضر بین دو کاربر وجود داشته باشد ، حتی اگر یک کاربر در زمان درخواست درخواست دیگری را مسدود کند ، DM موجود بازگردانده می شود.

فضاهای دارای پاسخ رشته ای پشتیبانی نمی شوند. اگر هنگام تنظیم یک فاصله، پیام خطای ALREADY_EXISTS را دریافت کردید، یک displayName دیگر را امتحان کنید. فضای موجود در سازمان Google Workspace ممکن است از قبل از این نام نمایشی استفاده کند.

به احراز هویت کاربر با یکی از حوزه های مجوز زیر نیاز دارد:

  • https://www.googleapis.com/auth/chat.spaces.create
  • https://www.googleapis.com/auth/chat.spaces
محدوده مجوز

به یکی از حوزه های OAuth زیر نیاز دارد:

  • https://www.googleapis.com/auth/chat.spaces
  • https://www.googleapis.com/auth/chat.spaces.create

برای اطلاعات بیشتر، به راهنمای مجوز مراجعه کنید.

به روزرسانی

rpc UpdateMembership( UpdateMembershipRequest ) returns ( Membership )

عضویت را به روز می کند. به عنوان مثال ، عضویت یک کاربر را در یک فضا به روز کنید.

از انواع احراز هویت زیر پشتیبانی می کند:

  • App authentication with administrator approval and the authorization scope:

    • https://www.googleapis.com/auth/chat.app.memberships (فقط در فضاهایی که برنامه ایجاد شده است)
  • احراز هویت کاربر با یکی از حوزه های مجوز زیر:

    • https://www.googleapis.com/auth/chat.memberships
    • https://www.googleapis.com/auth/chat.import (فقط فضاهای حالت واردات)
    • احراز هویت کاربر، زمانی که یک حساب سرپرست احراز هویت می‌شود، use_admin_access true است، و از محدوده مجوز زیر استفاده می‌شود، امتیازات سرپرست اعطا می‌شود:
      • https://www.googleapis.com/auth/chat.admin.memberships
محدوده مجوز

به یکی از حوزه های OAuth زیر نیاز دارد:

  • https://www.googleapis.com/auth/chat.app.memberships
  • https://www.googleapis.com/auth/chat.admin.memberships
  • https://www.googleapis.com/auth/chat.import
  • https://www.googleapis.com/auth/chat.memberships

برای اطلاعات بیشتر ، به راهنمای مجوز مراجعه کنید.

UpdateMessage

rpc UpdateMessage( UpdateMessageRequest ) returns ( Message )

یک پیام را به روز می کند. بین روشهای patch و update تفاوت وجود دارد. متد patch از یک درخواست patch استفاده می کند در حالی که روش update از یک درخواست put استفاده می کند. توصیه می کنیم از روش patch استفاده کنید. برای مثال، به‌روزرسانی یک پیام را ببینید.

از انواع احراز هویت زیر پشتیبانی می کند:

  • احراز هویت برنامه با محدوده مجوز:

    • https://www.googleapis.com/auth/chat.bot
  • احراز هویت کاربر با یکی از حوزه های مجوز زیر:

    • https://www.googleapis.com/auth/chat.messages
    • https://www.googleapis.com/auth/chat.import (فقط فضاهای حالت واردات)

هنگام استفاده از احراز هویت برنامه، درخواست‌ها فقط می‌توانند پیام‌های ایجاد شده توسط برنامه چت را به‌روزرسانی کنند.

محدوده مجوز

به یکی از حوزه های OAuth زیر نیاز دارد:

  • https://www.googleapis.com/auth/chat.bot
  • https://www.googleapis.com/auth/chat.import
  • https://www.googleapis.com/auth/chat.messages

برای اطلاعات بیشتر، به راهنمای مجوز مراجعه کنید.

UpdateSpace

rpc UpdateSpace( UpdateSpaceRequest ) returns ( Space )

یک فضا را به روز می کند. برای مثال، به‌روزرسانی یک فاصله را ببینید.

اگر فیلد displayName به‌روزرسانی می‌کنید و پیام خطای ALREADY_EXISTS را دریافت می‌کنید، نام نمایشی دیگری را امتحان کنید. ممکن است فضای موجود در سازمان Google Workspace قبلاً از این نام نمایشی استفاده کند.

از انواع احراز هویت زیر پشتیبانی می کند:

  • احراز هویت برنامه با تأیید مدیر و یکی از مجوزهای زیر:

    • https://www.googleapis.com/auth/chat.app.spaces
  • احراز هویت کاربر با یکی از اسکوپ های مجوز زیر:

    • https://www.googleapis.com/auth/chat.spaces
    • https://www.googleapis.com/auth/chat.import (فقط فضاهای حالت واردات)
    • احراز هویت کاربر هنگامی که یک حساب سرپرست احراز هویت می‌شود، use_admin_access true است و از حوزه‌های مجوز زیر استفاده می‌شود، امتیازات سرپرست اعطا می‌شود:
      • https://www.googleapis.com/auth/chat.admin.spaces

احراز هویت برنامه محدودیت های زیر را دارد:

  • برای به‌روزرسانی space.predefined_permission_settings یا space.permission_settings ، برنامه باید سازنده فضا باشد.
  • به روز رسانی space.access_settings.audience برای احراز هویت برنامه پشتیبانی نمی شود.
محدوده مجوز

به یکی از حوزه های OAuth زیر نیاز دارد:

  • https://www.googleapis.com/auth/chat.app.spaces
  • https://www.googleapis.com/auth/chat.admin.spaces
  • https://www.googleapis.com/auth/chat.import
  • https://www.googleapis.com/auth/chat.spaces

برای اطلاعات بیشتر، به راهنمای مجوز مراجعه کنید.

UpdateSpaceNotificationSetting

rpc UpdateSpaceNotificationSetting( UpdateSpaceNotificationSettingRequest ) returns ( SpaceNotificationSetting )

تنظیمات اعلان فضایی را به روز می کند. به عنوان مثال ، تنظیمات اطلاع رسانی فضایی تماس گیرنده را به روز کنید.

نیاز به احراز هویت کاربر با محدوده مجوز :

  • https://www.googleapis.com/auth/chat.users.spacesettings
محدوده مجوز

به محدوده OAuth زیر نیاز دارد:

  • https://www.googleapis.com/auth/chat.users.spacesettings

برای اطلاعات بیشتر ، به راهنمای مجوز مراجعه کنید.

UpdateSpaceReadState

rpc UpdateSpaceReadState( UpdateSpaceReadStateRequest ) returns ( SpaceReadState )

وضعیت خواندن کاربر را در یک فضا به روز می کند، که برای شناسایی پیام های خوانده شده و خوانده نشده استفاده می شود. به عنوان مثال ، به بروزرسانی وضعیت خوانده شده فضای کاربر مراجعه کنید.

نیاز به احراز هویت کاربر با دامنه مجوز دارد:

  • https://www.googleapis.com/auth/chat.users.readstate
محدوده مجوز

به محدوده OAuth زیر نیاز دارد:

  • https://www.googleapis.com/auth/chat.users.readstate

برای اطلاعات بیشتر ، به راهنمای مجوز مراجعه کنید.

لوازم جانبی

یک یا چند ابزارک تعاملی که در پایین یک پیام ظاهر می شوند. برای جزئیات، به افزودن ویجت‌های تعاملی در پایین پیام رجوع کنید.

فیلدها
action میدانی اتحادیه نوع عمل. action فقط می تواند یکی از موارد زیر باشد:
button_list

ButtonList

لیستی از دکمه ها

ActionResponse

پارامترهایی که یک برنامه چت می تواند برای پیکربندی نحوه ارسال پاسخ خود استفاده کند.

فیلدها
type

ResponseType

فقط ورودی نوع پاسخ برنامه چت.

url

string

فقط ورودی URL برای احراز هویت یا پیکربندی کاربران. (فقط برای انواع پاسخ REQUEST_CONFIG .)

dialog_action

DialogAction

فقط ورودی پاسخ به یک رویداد تعامل مربوط به یک گفتگو . باید با ResponseType.Dialog همراه باشد.

updated_widget

UpdatedWidget

فقط ورودی پاسخ ویجت به روز شده.

نوع پاسخ

نوع پاسخ برنامه چت.

Enums
TYPE_UNSPECIFIED نوع پیش‌فرض که به‌عنوان NEW_MESSAGE استفاده می‌شود.
NEW_MESSAGE به عنوان یک پیام جدید در تاپیک ارسال کنید.
UPDATE_MESSAGE پیام برنامه چت را به روز کنید. این فقط در رویداد CARD_CLICKED که نوع فرستنده پیام BOT است مجاز است.
UPDATE_USER_MESSAGE_CARDS کارت ها را در پیام کاربر به روز کنید. این فقط به عنوان پاسخی به یک رویداد MESSAGE با نشانی اینترنتی منطبق، یا یک رویداد CARD_CLICKED که نوع فرستنده پیام HUMAN است مجاز است. متن نادیده گرفته می شود.
REQUEST_CONFIG به طور خصوصی از کاربر برای تأیید اعتبار یا پیکربندی اضافی بخواهید.
DIALOG دیالوگی ارائه می دهد.
UPDATE_WIDGET پرس و جو گزینه های تکمیل خودکار متن ویجت.

انتخاب آیتم ها

فهرست نتایج تکمیل خودکار ویجت.

فیلدها
items[]

SelectionItem

آرایه ای از اشیاء SelectionItem.

ویجت به روز شده

برای ویجت‌های selectionInput ، پیشنهادات تکمیل خودکار را برای یک منوی چند انتخابی برمی‌گرداند.

فیلدها
widget

string

شناسه ویجت به روز شده. شناسه باید برای ویجت که باعث درخواست به روزرسانی شده است ، مطابقت داشته باشد.

فیلد اتحادیه updated_widget . ویجت در پاسخ به اقدام کاربر به روز شد. updated_widget فقط می تواند یکی از موارد زیر باشد:
suggestions

SelectionItems

فهرست نتایج تکمیل خودکار ویجت

ActionStatus

وضعیت درخواست برای فراخوانی یا ارسال گفتگو را نشان می دهد.

فیلدها
status_code

Code

کد وضعیت.

user_facing_message

string

پیامی برای ارسال به کاربران در مورد وضعیت درخواست آنها. در صورت عدم استفاده ، یک پیام عمومی بر اساس status_code ارسال می شود.

حاشیه نویسی

حاشیه‌نویسی‌ها را می‌توان با متن ساده پیام یا تراشه‌هایی مرتبط کرد که به منابع Google Workspace مانند Google Docs یا Sheets با start_index و length 0 پیوند دارند. برای افزودن قالب‌بندی اولیه به پیام نوشتاری، به قالب‌بندی پیام‌های متنی مراجعه کنید.

مثال متن پیام ساده:

Hello @FooBot how are you!"

فراداده حاشیه نویسی مربوطه:

"annotations":[{
  "type":"USER_MENTION",
  "startIndex":6,
  "length":7,
  "userMention": {
    "user": {
      "name":"users/{user}",
      "displayName":"FooBot",
      "avatarUrl":"https://goo.gl/aeDtrS",
      "type":"BOT"
    },
    "type":"MENTION"
   }
}]
فیلدها
type

AnnotationType

نوع این حاشیه نویسی

length

int32

Length of the substring in the plain-text message body this annotation corresponds to. در صورت وجود ، طول 0 را نشان می دهد.

start_index

int32

Start index (0-based, inclusive) in the plain-text message body this annotation corresponds to.

Union Field metadata . ابرداده اضافی در مورد حاشیه نویسی. metadata فقط می تواند یکی از موارد زیر باشد:
user_mention

UserMentionMetadata

ابرداده از کاربر ذکر شده است.

slash_command

SlashCommandMetadata

ابرداده برای یک فرمان برش.

custom_emoji_metadata

CustomEmojiMetadata

ابرداده برای یک ایموجی سفارشی.

حاشیه نویسی

Type of the annotation.

Enums
ANNOTATION_TYPE_UNSPECIFIED Default value for the enum. استفاده نکنید
USER_MENTION یک کاربر ذکر شده است.
SLASH_COMMAND یک دستور slash فراخوانی شده است.
CUSTOM_EMOJI حاشیه نویسی ایموجی سفارشی.

aspcommandmetadata

Metadata about a Chat app command .

فیلدها
app_command_id

int32

شناسه برای دستور مشخص شده در پیکربندی API چت.

app_command_type

AppCommandType

نوع دستور برنامه چت.

عکسبرداری

نوع دستور برنامه چت. برای جزئیات بیشتر ، به انواع دستورات برنامه چت مراجعه کنید.

Enums
APP_COMMAND_TYPE_UNSPECIFIED مقدار پیش فرض نامشخص
SLASH_COMMAND A slash command. کاربر دستور را در یک پیام گپ ارسال می کند.
QUICK_COMMAND یک دستور سریع کاربر دستور را از منوی چت در منطقه پاسخ پیام انتخاب می کند.

ضمیمه

تصویری GIF که توسط یک URL مشخص شده است.

فیلدها
uri

string

فقط خروجی URL که میزبان تصویر GIF است.

پیوست

پیوست در گپ گوگل.

فیلدها
name

string

اختیاری. نام منبع ضمیمه ، در spaces/{space}/messages/{message}/attachments/{attachment} .

content_name

string

فقط خروجی نام اصلی پرونده برای محتوا ، نه مسیر کامل.

content_type

string

فقط خروجی نوع محتوا (نوع MIME) پرونده.

thumbnail_uri

string

فقط خروجی URL تصویر کوچک که باید برای پیش نمایش دلبستگی به یک کاربر انسانی استفاده شود. برنامه های گپ نباید از این URL برای بارگیری محتوای پیوست استفاده کنند.

download_uri

string

فقط خروجی URL بارگیری که باید از آن استفاده شود تا کاربر انسانی بتواند پیوست را بارگیری کند. برنامه های گپ نباید از این URL برای بارگیری محتوای پیوست استفاده کنند.

source

Source

فقط خروجی منبع پیوست.

Union Field data_ref . مرجع داده به پیوست. data_ref تنها می تواند یکی از موارد زیر باشد:
attachment_data_ref

AttachmentDataRef

اختیاری. مرجع داده های پیوست. This field is used to create or update messages with attachments, or with the media API to download the attachment data.

drive_data_ref

DriveDataRef

فقط خروجی مرجع پیوست Google Drive. این قسمت با Google Drive API استفاده می شود.

منبع

منبع پیوست.

Enums
SOURCE_UNSPECIFIED رزرو شده است.
DRIVE_FILE پرونده یک پرونده Google Drive است.
UPLOADED_CONTENT پرونده برای گپ بارگذاری می شود.

AttachmentDataref

A reference to the attachment data.

فیلدها
resource_name

string

اختیاری. The resource name of the attachment data. این قسمت با استفاده از API Media برای بارگیری داده های پیوست استفاده می شود.

attachment_upload_token

string

اختیاری. نشانه مات حاوی مرجع به پیوست آپلود شده. Treated by clients as an opaque string and used to create or update Chat messages with attachments.

calendareventlinkdata

داده ها برای پیوندهای رویداد تقویم.

فیلدها
calendar_id

string

شناسه تقویم تقویم مرتبط.

event_id

string

The Event identifier of the linked Calendar event.

کارتن

کارت در پیام گپ Google.

فقط برنامه های چت می توانند کارت ایجاد کنند. اگر برنامه چت شما به عنوان کاربر تأیید می شود ، پیام نمی تواند حاوی کارت باشد.

کارت های طراحی و پیش نمایش با سازنده کارت.

Open the Card Builder

فیلدها
card_id

string

اگر پیام حاوی چندین کارت باشد ، لازم است. یک شناسه منحصر به فرد برای کارت در یک پیام.

card

Card

کارت حداکثر اندازه 32 کیلوبایت است.

chatspacelinkdata

داده ها برای پیوندهای فضایی چت.

فیلدها
space

string

فضای منبع فضایی چت مرتبط.

قالب: spaces/{space}

thread

string

موضوع منبع فضایی چت مرتبط.

Format: spaces/{space}/threads/{thread}

message

string

پیام منبع فضایی چت مرتبط.

قالب: spaces/{space}/messages/{message}

CompleteImportSpaceRequest

پیام را برای تکمیل فرایند واردات برای یک فضا درخواست کنید.

فیلدها
name

string

مورد نیاز. نام منبع فضای حالت واردات.

قالب: spaces/{space}

پاسخ کامل

پیام پاسخ برای تکمیل فرآیند واردات برای یک فضا.

فیلدها
space

Space

فضای حالت واردات.

متناسب

این نوع فیلدهایی ندارد.

نشانه گذاری برای توسعه دهندگان برای مشخص کردن محتوای یک افزونه متنی.

کارت

کارت یک عنصر UI است که می تواند حاوی ابزارک های UI مانند متن و تصاویر باشد.

فیلدها
header

CardHeader

هدر کارت. یک هدر معمولاً شامل یک عنوان و یک تصویر است.

sections[]

Section

بخش ها توسط یک تقسیم کننده خط از هم جدا می شوند.

card_actions[]

CardAction

اقدامات این کارت

name

string

نام کارت

کاردستی

اقدام کارت عمل مرتبط با کارت است. برای کارت فاکتور ، یک اقدام معمولی خواهد بود: فاکتور ، فاکتور ایمیل را حذف کنید یا فاکتور را در مرورگر باز کنید.

توسط برنامه های گپ Google پشتیبانی نمی شود.

فیلدها
action_label

string

برچسب مورد استفاده در مورد منوی اکشن نمایش داده می شود.

on_click

OnClick

عمل OnClick برای این مورد اقدام.

CardHeader

فیلدها
title

string

عنوان باید مشخص شود. این هدر دارای ارتفاع ثابت است: اگر هم عنوان و هم زیرنویس مشخص شده باشد ، هر یک یک خط را به خود اختصاص می دهد. اگر فقط عنوان مشخص شده باشد ، هر دو خط را به خود اختصاص می دهد.

subtitle

string

زیرنویس هدر کارت.

image_style

ImageStyle

The image's type (for example, square border or circular border).

image_url

string

URL تصویر در هدر کارت.

تصویر

Enums
IMAGE_STYLE_UNSPECIFIED
IMAGE مرز مربع
AVATAR مرز دایره ای.

بخش

یک بخش شامل مجموعه ای از ابزارک ها است که به ترتیب مشخص شده (به صورت عمودی) ارائه می شوند. در تمام سیستم عامل ها ، کارت ها دارای عرض ثابت باریک هستند ، بنابراین در حال حاضر نیازی به خصوصیات چیدمان (به عنوان مثال ، شناور) نیست.

فیلدها
header

string

هدر بخش. متن فرمت شده پشتیبانی می شود. برای کسب اطلاعات بیشتر در مورد قالب بندی متن ، به قالب بندی متن در برنامه های گپ Google و قالب بندی متن در افزودنی های فضای کاری Google مراجعه کنید.

widgets[]

WidgetMarkup

A section must contain at least one widget.

CreateCustomemoJireQuest

A request to create a custom emoji.

فیلدها
custom_emoji

CustomEmoji

مورد نیاز. ایموجی های سفارشی برای ایجاد.

CreatemembershipRequest

برای ایجاد عضویت پیام را درخواست کنید.

فیلدها
parent

string

مورد نیاز. نام منابع فضایی که برای ایجاد عضویت برای آن ایجاد می شود.

قالب: فضاها/{فضا}

membership

Membership

مورد نیاز. رابطه عضویت برای ایجاد.

قسمت memberType باید دارای یک کاربر با زمینه های user.name و user.type باشد. سرور نام منبع را اختصاص داده و هر چیزی را که مشخص شده است بازنویسی می کند.

هنگامی که یک برنامه چت یک رابطه عضویت برای یک کاربر انسانی ایجاد می کند ، باید از اسکوپ های مجوز خاصی استفاده کند و مقادیر خاصی را برای زمینه های خاص تعیین کند:

  • هنگام تأیید اعتبار به عنوان کاربر ، دامنه مجوز chat.memberships مورد نیاز است.

  • When authenticating as an app , the chat.app.memberships authorization scope is required.

  • Set user.type to HUMAN , and set user.name with format users/{user} , where {user} can be the email address for the user. برای کاربران در همان سازمان فضای کاری {user} همچنین می تواند id شخص از API افراد یا id کاربر در API دایرکتوری باشد. به عنوان مثال ، اگر شناسه پروفایل People API Person for user@example.com 123456789 است ، می توانید با تنظیم membership.member.name به users/user@example.com یا users/123456789 کاربر را به فضا اضافه کنید.

دعوت از کاربران خارجی به سازمان فضای کاری که صاحب این فضا است ، نیاز به احراز هویت کاربر دارد.

هنگامی که یک برنامه چت یک رابطه عضویت را برای خود ایجاد می کند ، باید به عنوان کاربر تأیید شود و از دامنه chat.memberships.app استفاده کند BOT user.type user.name تنظیم users/app .

use_admin_access

bool

اختیاری. در صورت true ، این روش با استفاده از امتیازات مدیر فضای کاری کاربر کاربر اجرا می شود.

کاربر فراخوانی باید یک مدیر فضای کاری Google با امتیازات مدیریت چت و فضاها باشد.

به دامنه chat.admin.memberships oauth 2.0 نیاز دارد.

ایجاد عضویت در برنامه یا ایجاد عضویت برای کاربران خارج از سازمان فضای کاری Google Administrator با استفاده از Admin Access پشتیبانی نمی شود.

createmessagerequest

پیام ایجاد می کند.

فیلدها
parent

string

مورد نیاز. نام منبع فضایی که در آن می توانید پیام ایجاد کنید.

قالب: spaces/{space}

message

Message

مورد نیاز. بدن پیام

thread_key
(deprecated)

string

اختیاری. deprecated: به جای آن از thread.thread_key استفاده کنید. شناسه برای موضوع. حداکثر 4000 کاراکتر را پشتیبانی می کند. برای شروع یا اضافه کردن به یک موضوع ، یک پیام ایجاد کرده و یک threadKey یا موضوع یا thread.name را مشخص کنید. به عنوان مثال استفاده ، به شروع یا پاسخ به موضوع پیام مراجعه کنید.

request_id

string

اختیاری. شناسه درخواست منحصر به فرد برای این پیام. مشخص کردن یک شناسه درخواست موجود ، پیام ایجاد شده با آن شناسه را به جای ایجاد پیام جدید برمی گرداند.

message_reply_option

MessageReplyOption

اختیاری. مشخص می کند که آیا یک پیام یک موضوع را شروع می کند یا به یکی پاسخ می دهد. فقط در فضاهای نامگذاری شده پشتیبانی می شود.

هنگام پاسخ به تعامل کاربر ، این قسمت نادیده گرفته می شود. برای تعامل در یک موضوع ، پاسخ در همان موضوع ایجاد می شود. در غیر این صورت ، پاسخ به عنوان یک موضوع جدید ایجاد می شود.

message_id

string

اختیاری. یک شناسه سفارشی برای یک پیام. اجازه می دهیم برنامه های گپ بدون نیاز به ذخیره شناسه تعیین شده توسط سیستم در نام منبع پیام (که در قسمت name پیام ارائه شده است) دریافت ، به روزرسانی یا حذف پیام را حذف ، به روز کنید.

The value for this field must meet the following requirements:

  • با client- شروع می شود. به عنوان مثال ، client-custom-name یک شناسه سفارشی معتبر است ، اما custom-name نیست.
  • Contains up to 63 characters and only lowercase letters, numbers, and hyphens.
  • در یک فضا بی نظیر است. یک برنامه چت نمی تواند از همان شناسه سفارشی برای پیام های مختلف استفاده کند.

برای جزئیات بیشتر ، به یک پیام مراجعه کنید.

پیام رسانی

Specifies how to reply to a message. ممکن است کشورهای بیشتری در آینده اضافه شوند.

Enums
MESSAGE_REPLY_OPTION_UNSPECIFIED پیش فرض یک موضوع جدید را شروع می کند. Using this option ignores any thread ID or thread_key that's included.
REPLY_MESSAGE_FALLBACK_TO_NEW_THREAD پیام را به عنوان پاسخی به موضوع مشخص شده توسط thread ID یا thread_key ایجاد می کند. If it fails, the message starts a new thread instead.
REPLY_MESSAGE_OR_FAIL پیام را به عنوان پاسخی به موضوع مشخص شده توسط thread ID یا thread_key ایجاد می کند. If a new thread_key is used, a new thread is created. اگر ایجاد پیام از بین برود ، به جای آن یک خطای NOT_FOUND بازگردانده می شود.

رفیق

واکنشی به یک پیام ایجاد می کند.

فیلدها
parent

string

مورد نیاز. پیامی که در آن واکنش ایجاد شده است.

قالب: spaces/{space}/messages/{message}

reaction

Reaction

مورد نیاز. واکنش برای ایجاد.

CreateSpacereQuest

درخواستی برای ایجاد یک فضای نامگذاری شده بدون عضو.

فیلدها
space

Space

مورد نیاز. زمینه های displayName و spaceType باید جمع شوند. فقط SpaceType.SPACE و SpaceType.GROUP_CHAT پشتیبانی می شوند. SpaceType.GROUP_CHAT فقط در صورت تنظیم صحیح importMode قابل استفاده است.

اگر پیام خطا را ALREADY_EXISTS دریافت کرده اید ، یک displayName متفاوت را امتحان کنید. یک فضای موجود در سازمان فضای کاری Google ممکن است در حال حاضر از این نام نمایش استفاده کند.

name فضایی روی سرور اختصاص داده شده است تا هر چیزی که در این زمینه مشخص شده باشد نادیده گرفته شود.

request_id

string

اختیاری. یک شناسه منحصر به فرد برای این درخواست. یک UUID تصادفی توصیه می شود. مشخص کردن شناسه درخواست موجود ، فضای ایجاد شده با آن شناسه را به جای ایجاد یک فضای جدید باز می گرداند. مشخص کردن شناسه درخواست موجود از همان برنامه چت با کاربر معتبر متفاوت خطایی را برمی گرداند.

سفارشی

نمایانگر یک ایموجی سفارشی است .

فیلدها
name

string

شناسه نام منبع ایموجی های سفارشی ، که توسط سرور اختصاص داده شده است.

قالب: customEmojis/{customEmoji}

uid

string

فقط خروجی کلید منحصر به فرد برای منبع ایموجی سفارشی.

emoji_name

string

اختیاری. تغییر ناپذیر نام توسط کاربر برای ایموجی های سفارشی ، که در سازمان بی نظیر است.

هنگام ایجاد ایموجی های سفارشی ، مورد نیاز است ، فقط در غیر این صورت خروجی.

نامهای ایموجی باید با استفاده از کلون ها شروع و پایان یابد ، باید حروف کوچک باشد و فقط می تواند حاوی شخصیت های الفبایی ، هیپنوها و زیرزمین ها باشد. Hyphens and underscores should be used to separate words and cannot be used consecutively.

مثال :: :valid-emoji-name:

temporary_image_uri

string

فقط خروجی یک URL موقت تصویر برای ایموجی های سفارشی ، حداقل برای 10 دقیقه معتبر است. توجه داشته باشید که هنگام ایجاد ایموجی های سفارشی ، این در پاسخ جمع نمی شود.

payload

CustomEmojiPayload

اختیاری. فقط ورودی داده های بارگذاری Required when the custom emoji is created.

بار سفارشی

داده های بار برای ایموجی های سفارشی.

فیلدها
file_content

bytes

مورد نیاز. Input only. تصویری که برای ایموجی های سفارشی استفاده می شود.

بار بار باید زیر 256 کیلوبایت باشد و ابعاد تصویر باید مربع و بین 64 تا 500 پیکسل باشد. محدودیت ها در معرض تغییر هستند.

filename

string

مورد نیاز. فقط ورودی نام پرونده تصویر

پسوند پرونده پشتیبانی شده: .png ، .jpg ، .gif .

سفارشی

ابرداده حاشیه نویسی برای ایموجی های سفارشی.

فیلدها
custom_emoji

CustomEmoji

ایموجی های سفارشی.

leeletecustomemojirequest

درخواست حذف ایموجی های سفارشی.

فیلدها
name

string

مورد نیاز. نام منابع ایموجی های سفارشی برای حذف.

قالب: customEmojis/{customEmoji}

You can use the emoji name as an alias for {customEmoji} . به عنوان مثال ، customEmojis/:example-emoji: کجا :example-emoji: نام ایموجی برای یک ایموجی سفارشی است.

DeletemembershipRequest

درخواست حذف عضویت در یک فضا.

فیلدها
name

string

مورد نیاز. نام منابع عضویت برای حذف. برنامه های گپ می توانند عضویت کاربران انسانی یا خود را حذف کنند. برنامه های چت نمی توانند عضویت برنامه های دیگر را حذف کنند.

هنگام حذف عضویت در انسانی ، به دامنه chat.memberships با تأیید اعتبار کاربر یا chat.memberships.app با احراز هویت برنامه و spaces/{space}/members/{member} نیاز دارد. می توانید از ایمیل به عنوان نام مستعار برای {member} استفاده کنید. به عنوان مثال ، spaces/{space}/members/example@gmail.com که در آن example@gmail.com ایمیل کاربر گپ Google است.

هنگام حذف عضویت در برنامه ، chat.memberships.app memberships.app دامنه و spaces/{space}/members/app نیاز دارد.

Format: spaces/{space}/members/{member} or spaces/{space}/members/app .

use_admin_access

bool

اختیاری. در صورت true ، این روش با استفاده از امتیازات مدیر فضای کاری کاربر کاربر اجرا می شود.

کاربر فراخوانی باید یک مدیر فضای کاری Google با امتیازات مدیریت چت و فضاها باشد.

به دامنه chat.admin.memberships oauth 2.0 نیاز دارد.

حذف عضویت در برنامه در یک فضا با استفاده از دسترسی مدیر پشتیبانی نمی شود.

DeleteMessageRequest

درخواست حذف پیام.

فیلدها
name

string

مورد نیاز. نام منبع پیام.

قالب: spaces/{space}/messages/{message}

اگر یک شناسه سفارشی را برای پیام خود تنظیم کرده اید ، می توانید از قسمت clientAssignedMessageId برای {message} استفاده کنید. برای جزئیات بیشتر ، به یک پیام مراجعه کنید.

force

bool

اختیاری. هنگامی که true ، حذف یک پیام نیز پاسخ های موضوعی خود را حذف می کند. هنگامی که false ، اگر یک پیام پاسخ داده شود ، حذف حذف می شود.

فقط در هنگام تأیید اعتبار به عنوان کاربر اعمال می شود. در هنگام تأیید اعتبار به عنوان برنامه چت هیچ تاثیری ندارد.

deletereactionRequest

واکنشی به یک پیام حذف می کند.

فیلدها
name

string

مورد نیاز. نام واکنش برای حذف.

قالب: spaces/{space}/messages/{message}/reactions/{reaction}

leletespacerequest

درخواست حذف یک فضا.

فیلدها
name

string

مورد نیاز. Resource name of the space to delete.

قالب: spaces/{space}

use_admin_access

bool

اختیاری. در صورت true ، این روش با استفاده از امتیازات مدیر فضای کاری کاربر کاربر اجرا می شود.

کاربر فراخوانی باید یک مدیر فضای کاری Google با امتیازات مدیریت چت و فضاها باشد.

به دامنه chat.admin.delete oauth 2.0 نیاز دارد.

حذف metadata

Information about a deleted message. هنگام تنظیم delete_time یک پیام حذف می شود.

فیلدها
deletion_type

DeletionType

نشان می دهد چه کسی پیام را حذف کرده است.

حذف

چه کسی پیام را حذف کرد و چگونه حذف شد. مقادیر بیشتری ممکن است در آینده اضافه شود. برای جزئیات بیشتر در مورد حذف پیام ها ، ویرایش یا حذف پیام در Google Chat را مشاهده کنید.

Enums
DELETION_TYPE_UNSPECIFIED این مقدار بلااستفاده است.
CREATOR کاربر پیام خود را حذف کرد.
SPACE_OWNER A space manager deleted the message.
ADMIN یک مدیر فضای کاری Google پیام را حذف کرد. سرپرستان می توانند هر پیام را در فضا حذف کنند ، از جمله پیام های ارسال شده توسط هر یک از اعضای فضایی یا برنامه چت.
APP_MESSAGE_EXPIRY یک برنامه گپ هنگام انقضا ، پیام خود را حذف کرد.
CREATOR_VIA_APP یک برنامه چت پیام را به نمایندگی از خالق (با استفاده از تأیید اعتبار کاربر) حذف کرد.
SPACE_OWNER_VIA_APP A Chat app deleted the message on behalf of a space manager (using user authentication).
SPACE_MEMBER یکی از اعضای فضا پیام را حذف کرد. کاربران می توانند پیام های ارسال شده توسط برنامه ها را حذف کنند.

گفتگو

بسته بندی اطراف بدنه دیالوگ.

فیلدها
body

Card

Input only. بدنه گفتگو ، که در یک معین ارائه می شود. برنامه های گپ Google از موجودات کارت زیر پشتیبانی نمی کنند: DateTimePicker ، OnChangeAction .

گفتگو

حاوی یک گفتگوی و کد وضعیت درخواست است.

فیلدها
action_status

ActionStatus

فقط ورودی وضعیت برای درخواست برای استناد به یا ارسال گفتگو . در صورت لزوم وضعیت و پیام را به کاربران نشان می دهد. به عنوان مثال ، در صورت بروز خطا یا موفقیت.

action میدانی اتحادیه. عمل برای انجام action can be only one of the following:
dialog

Dialog

Input only. گفتگو برای درخواست.

Driendataref

اشاره به داده های پیوست درایو.

فیلدها
drive_file_id

string

شناسه پرونده درایو. با API درایو استفاده کنید.

دیلینکستاتا

داده ها برای پیوندهای Google Drive.

فیلدها
drive_data_ref

DriveDataRef

یک Driredataref که به یک پرونده Google Drive اشاره می کند.

mime_type

string

نوع MIME منبع Google Drive Linked.

ایموجی

ایموجی که به عنوان واکنشی به یک پیام استفاده می شود.

فیلدها
content میدان اتحادیه. مورد نیاز. محتوای ایموجی ها. content می تواند تنها یکی از موارد زیر باشد:
unicode

string

اختیاری. یک ایموجی اساسی که توسط یک رشته یونیکد نشان داده شده است.

custom_emoji

CustomEmoji

A custom emoji.

emojirectionsummary

تعداد افرادی که با یک ایموجی خاص به پیام واکنش نشان دادند.

فیلدها
emoji

Emoji

فقط خروجی ایموجی های مرتبط با واکنش.

reaction_count

int32

فقط خروجی تعداد کل واکنش ها با استفاده از ایموجی های مرتبط.

FindDirectMessagerequest

درخواستی برای دریافت فضای پیام مستقیم بر اساس منبع کاربر.

فیلدها
name

string

مورد نیاز. نام منبع کاربر برای یافتن پیام مستقیم با.

قالب: users/{user} ، که در آن {user} یا id شخص از افراد API افراد است ، یا id کاربر در API دایرکتوری. به عنوان مثال ، اگر شناسه پروفایل API People 123456789 باشد ، می توانید با استفاده users/123456789 به عنوان name ، یک پیام مستقیم با آن شخص پیدا کنید. هنگامی که به عنوان کاربر تأیید می شود ، می توانید از ایمیل به عنوان نام مستعار برای {user} استفاده کنید. به عنوان مثال ، users/example@gmail.com example@gmail.com که در آن example@gmail.com ایمیل کاربر Google Chat است.

GetAttachmentRequest

درخواست دریافت پیوست.

فیلدها
name

string

مورد نیاز. نام منبع ضمیمه ، در spaces/{space}/messages/{message}/attachments/{attachment} .

getCustomemoJireQuest

درخواست بازگشت یک ایموجی سفارشی واحد.

فیلدها
name

string

مورد نیاز. Resource name of the custom emoji.

قالب: customEmojis/{customEmoji}

می توانید از نام ایموجی به عنوان نام مستعار برای {customEmoji} استفاده کنید. For example, customEmojis/:example-emoji: where :example-emoji: is the emoji name for a custom emoji.

GetMembershipRequest

درخواست عضویت در یک فضا.

فیلدها
name

string

مورد نیاز. نام منابع عضویت برای بازیابی.

برای به دست آوردن عضویت خود برنامه با استفاده از تأیید اعتبار کاربر ، می توانید به صورت اختیاری spaces/{space}/members/app استفاده کنید.

قالب: spaces/{space}/members/{member} یا spaces/{space}/members/app

می توانید از ایمیل کاربر به عنوان نام مستعار برای {member} استفاده کنید. به عنوان مثال ، spaces/{space}/members/example@gmail.com که در آن example@gmail.com ایمیل کاربر گپ Google است.

use_admin_access

bool

اختیاری. در صورت true ، این روش با استفاده از امتیازات مدیر فضای کاری کاربر کاربر اجرا می شود.

The calling user must be a Google Workspace administrator with the manage chat and spaces conversations privilege .

نیاز به chat.admin.memberships یا chat.admin.memberships.readonly oauth 2.0 Scopes دارد.

دریافت عضویت در برنامه در یک فضا هنگام استفاده از Admin Access پشتیبانی نمی شود.

GetMessagerEquest

Request to get a message.

فیلدها
name

string

مورد نیاز. نام منبع پیام.

قالب: spaces/{space}/messages/{message}

اگر یک شناسه سفارشی را برای پیام خود تنظیم کرده اید ، می توانید از قسمت clientAssignedMessageId برای {message} استفاده کنید. برای جزئیات بیشتر ، به یک پیام مراجعه کنید.

getSpaceEventRequest

برای دریافت یک رویداد فضایی پیام را درخواست کنید.

فیلدها
name

string

مورد نیاز. نام منابع رویداد فضایی.

قالب: spaces/{space}/spaceEvents/{spaceEvent}

getSpacenotificationatingRequest

برای دریافت تنظیم اطلاع رسانی فضایی ، پیام را درخواست کنید. فقط از دریافت تنظیم اعلان برای کاربر فراخوانی پشتیبانی می کند.

فیلدها
name

string

مورد نیاز. قالب: کاربران/{کاربر}/فضاها/{فضا}/Spacenotificationationsing

  • users/me/spaces/{space}/spaceNotificationSetting ، یا
  • users/user@example.com/spaces/{space}/spaceNotificationSetting ، یا
  • users/123456789/spaces/{space}/spaceNotificationSetting . توجه: فقط شناسه کاربر یا ایمیل تماس گیرنده در مسیر مجاز است.

getSpacereadStaterequest

درخواست پیام برای API GetSpacereadState.

فیلدها
name

string

مورد نیاز. نام منابع از حالت خوانده شده برای بازیابی.

فقط از خواندن حالت خوانده شده برای کاربر فراخوانی پشتیبانی می کند.

برای مراجعه به کاربر تماس ، یکی از موارد زیر را تنظیم کنید:

  • من me مستعار به عنوان مثال ، users/me/spaces/{space}/spaceReadState .

  • آدرس ایمیل فضای کاری آنها. به عنوان مثال ، users/user@example.com/spaces/{space}/spaceReadState /spacereadstate.

  • شناسه کاربر آنها به عنوان مثال ، users/123456789/spaces/{space}/spaceReadState .

Format: users/{user}/spaces/{space}/spaceReadState

GetSpacereQuest

درخواست بازگشت یک فضای واحد.

فیلدها
name

string

مورد نیاز. نام منبع فضا ، در spaces/{space} .

قالب: spaces/{space}

use_admin_access

bool

اختیاری. When true , the method runs using the user's Google Workspace administrator privileges.

کاربر فراخوانی باید یک مدیر فضای کاری Google با امتیازات مدیریت چت و فضاها باشد.

به Scopes chat.admin.spaces یا chat.admin.spaces.readonly oauth 2.0 نیاز دارد.

GetThreadReadStateRequest

Request message for GetThreadReadStateRequest API.

فیلدها
name

string

مورد نیاز. نام منبع موضوع موضوع را برای بازیابی.

فقط از خواندن حالت خوانده شده برای کاربر فراخوانی پشتیبانی می کند.

برای مراجعه به کاربر تماس ، یکی از موارد زیر را تنظیم کنید:

  • من me مستعار به عنوان مثال ، users/me/spaces/{space}/threads/{thread}/threadReadState .

  • آدرس ایمیل فضای کاری آنها. For example, users/user@example.com/spaces/{space}/threads/{thread}/threadReadState .

  • شناسه کاربر آنها به عنوان مثال ، users/123456789/spaces/{space}/threads/{thread}/threadReadState .

فرمت: کاربران/{کاربر}/فضاها/{فضا}/موضوع/{موضوع}/ThreadReadState

گروه

یک گروه Google در Google Chat.

فیلدها
name

string

نام منابع برای یک گروه Google.

گروهی در گروه های هویت ابری API را نشان می دهد.

قالب: گروه ها/{گروه}

تاریخچه

وضعیت تاریخ برای پیام ها و فضاها. Specifies how long messages and conversation threads are kept after creation.

Enums
HISTORY_STATE_UNSPECIFIED مقدار پیش فرض استفاده نکنید.
HISTORY_OFF تاریخ خاموش. Messages and threads are kept for 24 hours .
HISTORY_ON تاریخ در. قوانین حفظ طاق سازمان مشخص می کند که چه مدت پیام ها و موضوعات نگه داشته می شوند.

ListCustomeMoJisRequest

درخواست بازگشت لیستی از ایموجی های سفارشی.

فیلدها
page_size

int32

اختیاری. حداکثر تعداد ایموجی های سفارشی بازگشتند. این سرویس می تواند کمتر از این مقدار ایموجی های سفارشی برگردد. اگر نامشخص باشد ، مقدار پیش فرض 25 است. حداکثر مقدار 200 است. مقادیر بالاتر از 200 به 200 تغییر می یابد.

page_token

string

اختیاری. (در صورت از سرگیری از یک پرس و جو قبلی.)

نشانه ای از صفحه دریافت شده از لیست قبلی تماس ایموجی سفارشی. این کار را برای بازیابی صفحه بعدی ارائه دهید.

هنگام پیگیری ، مقدار فیلتر باید با تماس ارائه شده با صفحه مطابقت داشته باشد. عبور از یک مقدار متفاوت ممکن است منجر به نتایج غیر منتظره شود.

filter

string

اختیاری. یک فیلتر پرس و جو.

از فیلتر توسط خالق پشتیبانی می کند.

برای فیلتر کردن توسط خالق ، باید یک مقدار معتبر را مشخص کنید. در حال حاضر فقط creator("users/me") و NOT creator("users/me") پذیرفته شده اند که آیا آنها توسط کاربر فراخوانی ایجاد شده اند یا نه ، ایموجی های سفارشی را فیلتر کنند.

به عنوان مثال ، پرس و جو زیر ایموجی های سفارشی ایجاد شده توسط تماس گیرنده را برمی گرداند:

creator("users/me")

نمایش داده شدگان نامعتبر با یک خطای INVALID_ARGUMENT رد می شوند.

پاسخ لیست

پاسخ به لیست ایموجی های سفارشی.

فیلدها
custom_emojis[]

CustomEmoji

لیست بدون هماهنگ. لیست ایموجی های سفارشی.

next_page_token

string

نشانه ای که می توانید به عنوان pageToken برای بازیابی صفحه بعدی نتایج ارسال کنید. If empty, there are no subsequent pages.

listmembershipsrequest

درخواست پیام برای لیست عضویت.

فیلدها
parent

string

مورد نیاز. نام منبع فضایی که می توانید لیست عضویت را بدست آورید.

قالب: فضاها/{فضا}

page_size

int32

اختیاری. حداکثر تعداد عضویت برای بازگشت. این سرویس ممکن است کمتر از این مقدار برگردد.

در صورت نامشخص ، حداکثر 100 عضویت بازگردانده می شوند.

The maximum value is 1000. If you use a value more than 1000, it's automatically changed to 1000.

Negative values return an INVALID_ARGUMENT error.

page_token

string

اختیاری. یک نشان صفحه ، از یک تماس قبلی برای لیست عضویت دریافت شده است. این پارامتر را برای بازیابی صفحه بعدی ارائه دهید.

هنگام پیگیری ، تمام پارامترهای دیگر ارائه شده باید با تماس ارائه شده با صفحه نمایش مطابقت داشته باشند. انتقال مقادیر مختلف به پارامترهای دیگر ممکن است منجر به نتایج غیر منتظره شود.

filter

string

اختیاری. یک فیلتر پرس و جو.

شما می توانید عضویت در نقش ( role ) و نوع ( member.type ) عضویت را فیلتر کنید.

برای فیلتر کردن بر اساس نقش ، role در ROLE_MEMBER یا ROLE_MANAGER تنظیم کنید.

برای فیلتر کردن بر اساس نوع ، member.type به HUMAN یا BOT تنظیم کنید. همچنین می توانید با استفاده از اپراتور != member.type فیلتر کنید.

برای فیلتر کردن توسط هر دو نقش و نوع ، از اپراتور AND اپراتور استفاده کنید. برای فیلتر کردن توسط هر دو نقش یا نوع ، از اپراتور OR استفاده کنید.

هر دو member.type = "HUMAN" یا member.type != "BOT" لازم است وقتی use_admin_access روی درست تنظیم شود. سایر فیلترهای نوع عضو رد می شوند.

به عنوان مثال ، نمایش داده های زیر معتبر است:

role = "ROLE_MANAGER" OR role = "ROLE_MEMBER"
member.type = "HUMAN" AND role = "ROLE_MANAGER"

member.type != "BOT"

نمایش داده های زیر نامعتبر است:

member.type = "HUMAN" AND member.type = "BOT"
role = "ROLE_MANAGER" AND role = "ROLE_MEMBER"

نمایش داده شدگان نامعتبر توسط سرور با یک خطای INVALID_ARGUMENT رد می شوند.

show_groups

bool

اختیاری. When true , also returns memberships associated with a Google Group , in addition to other types of memberships. If a filter is set, Google Group memberships that don't match the filter criteria aren't returned.

show_invited

bool

اختیاری. 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 .

use_admin_access

bool

اختیاری. When true , the method runs using the user's Google Workspace administrator privileges.

The calling user must be a Google Workspace administrator with the manage chat and spaces conversations privilege .

Requires either the chat.admin.memberships.readonly or chat.admin.memberships OAuth 2.0 scope .

Listing app memberships in a space isn't supported when using admin access.

ListMembershipsResponse

Response to list memberships of the space.

فیلدها
memberships[]

Membership

Unordered list. List of memberships in the requested (or first) page.

next_page_token

string

A token that you can send as pageToken to retrieve the next page of results. If empty, there are no subsequent pages.

ListMessagesRequest

Lists messages in the specified space, that the user is a member of.

فیلدها
parent

string

مورد نیاز. The resource name of the space to list messages from.

Format: spaces/{space}

page_size

int32

اختیاری. 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 1000. If you use a value more than 1000, it's automatically changed to 1000.

Negative values return an INVALID_ARGUMENT error.

page_token

string

اختیاری. 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.

filter

string

اختیاری. 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 format and double quotation marks. For example, "2023-04-21T11:30:00-04:00" . You can use the greater than operator > to list messages that were created after a timestamp, or the less than operator < 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 > "2012-04-21T11:30:00-04:00"

create_time > "2012-04-21T11:30:00-04:00" AND
  thread.name = spaces/AAAAAAAAAAA/threads/123

create_time > "2012-04-21T11:30:00+00:00" AND

create_time < "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.

order_by

string

اختیاری. 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 .

show_deleted

bool

اختیاری. Whether to include deleted messages. Deleted messages include deleted time and metadata about their deletion, but message content is unavailable.

ListMessagesResponse

Response message for listing messages.

فیلدها
messages[]

Message

List of messages.

next_page_token

string

You can send a token as pageToken to retrieve the next page of results. If empty, there are no subsequent pages.

ListReactionsRequest

Lists reactions to a message.

فیلدها
parent

string

مورد نیاز. The message users reacted to.

Format: spaces/{space}/messages/{message}

page_size

int32

اختیاری. 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.

page_token

string

اختیاری. (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.

filter

string

اختیاری. A query filter.

You can filter reactions by emoji (either emoji.unicode or emoji.custom_emoji.uid ) and 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 with an INVALID_ARGUMENT error.

ListReactionsResponse

Response to a list reactions request.

فیلدها
reactions[]

Reaction

List of reactions in the requested (or first) page.

next_page_token

string

Continuation token to retrieve the next page of results. It's empty for the last page of results.

ListSpaceEventsRequest

Request message for listing space events.

فیلدها
parent

string

مورد نیاز. Resource name of the Google Chat space where the events occurred.

Format: spaces/{space} .

page_size

int32

اختیاری. The maximum number of space events returned. The service might return fewer than this value.

Negative values return an INVALID_ARGUMENT error.

page_token

string

اختیاری. A page token, received from a previous list space events call. Provide this to retrieve the subsequent page.

When paginating, all other parameters provided to list space events must match the call that provided the page token. Passing different values to the other parameters might lead to unexpected results.

filter

string

مورد نیاز. A query filter.

You must specify at least one event type ( event_type ) using the has : operator. To filter by multiple event types, use the OR operator. Omit batch event types in your filter. The request automatically returns any related batch events. For example, if you filter by new reactions ( google.workspace.chat.reaction.v1.created ), the server also returns batch new reactions events ( google.workspace.chat.reaction.v1.batchCreated ). For a list of supported event types, see the SpaceEvents reference documentation .

Optionally, you can also filter by start time ( start_time ) and end time ( end_time ):

  • start_time : Exclusive timestamp from which to start listing space events. You can list events that occurred up to 28 days ago. If unspecified, lists space events from the past 28 days.
  • end_time : Inclusive timestamp until which space events are listed. If unspecified, lists events up to the time of the request.

To specify a start or end time, use the equals = operator and format in RFC-3339 . To filter by both start_time and end_time , use the AND operator.

For example, the following queries are valid:

start_time="2023-08-23T19:20:33+00:00" AND
end_time="2023-08-23T19:21:54+00:00"
start_time="2023-08-23T19:20:33+00:00" AND
(event_types:"google.workspace.chat.space.v1.updated" OR
event_types:"google.workspace.chat.message.v1.created")

The following queries are invalid:

start_time="2023-08-23T19:20:33+00:00" OR
end_time="2023-08-23T19:21:54+00:00"
event_types:"google.workspace.chat.space.v1.updated" AND
event_types:"google.workspace.chat.message.v1.created"

Invalid queries are rejected by the server with an INVALID_ARGUMENT error.

ListSpaceEventsResponse

Response message for listing space events.

فیلدها
space_events[]

SpaceEvent

Results are returned in chronological order (oldest event first). Note: The permissionSettings field is not returned in the Space object for list requests.

next_page_token

string

Continuation token used to fetch more events. If this field is omitted, there are no subsequent pages.

ListSpacesRequest

A request to list the spaces the caller is a member of.

فیلدها
page_size

int32

اختیاری. 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 1000. If you use a value more than 1000, it's automatically changed to 1000.

Negative values return an INVALID_ARGUMENT error.

page_token

string

اختیاری. 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.

filter

string

اختیاری. A query filter.

You can filter spaces by the space type ( space_type ).

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.

ListSpacesResponse

The response for a list spaces request.

فیلدها
spaces[]

Space

List of spaces in the requested (or first) page. Note: The permissionSettings field is not returned in the Space object for list requests.

next_page_token

string

You can send a token as pageToken to retrieve the next page of results. If empty, there are no subsequent pages.

MatchedUrl

A matched URL in a Chat message. Chat apps can preview matched URLs. For more information, see Preview links .

فیلدها
url

string

Output only. The URL that was matched.

MeetSpaceLinkData

Data for Meet space links.

فیلدها
meeting_code

string

Meeting code of the linked Meet space.

type

Type

Indicates the type of the Meet space.

huddle_status

HuddleStatus

اختیاری. Output only. If the Meet is a Huddle, indicates the status of the huddle. Otherwise, this is unset.

HuddleStatus

The status of the huddle

Enums
HUDDLE_STATUS_UNSPECIFIED Default value for the enum. Don't use.
STARTED The huddle has started.
ENDED The huddle has ended. In this case the Meet space URI and identifiers will no longer be valid.
MISSED The huddle has been missed. In this case the Meet space URI and identifiers will no longer be valid.

تایپ کنید

The type of the Meet space.

Enums
TYPE_UNSPECIFIED Default value for the enum. Don't use.
MEETING The Meet space is a meeting.
HUDDLE The Meet space is a huddle.

عضویت

Represents a membership relation in Google Chat, such as whether a user or Chat app is invited to, part of, or absent from a space.

فیلدها
name

string

Identifier. Resource name of the membership, assigned by the server.

Format: spaces/{space}/members/{member}

state

MembershipState

Output only. State of the membership.

role

MembershipRole

اختیاری. User's role within a Chat space, which determines their permitted actions in the space.

This field can only be used as input in UpdateMembership .

create_time

Timestamp

اختیاری. Immutable. The creation time of the membership, such as when a member joined or was invited to join a space. This field is output only, except when used to import historical memberships in import mode spaces.

delete_time

Timestamp

اختیاری. Immutable. The deletion time of the membership, such as when a member left or was removed from a space. This field is output only, except when used to import historical memberships in import mode spaces.

Union field memberType . Member associated with this membership. Other member types might be supported in the future. memberType can be only one of the following:
member

User

اختیاری. The Google Chat user or app the membership corresponds to. If your Chat app authenticates as a user , the output populates the user name and type .

group_member

Group

اختیاری. The Google Group the membership corresponds to.

Reading or mutating memberships for Google Groups requires user authentication .

MembershipRole

Represents a user's permitted actions in a Chat space. More enum values might be added in the future.

Enums
MEMBERSHIP_ROLE_UNSPECIFIED Default value. For users : they aren't a member of the space, but can be invited. For Google Groups : they're always assigned this role (other enum values might be used in the future).
ROLE_MEMBER A member of the space. The user has basic permissions, like sending messages to the space. In 1:1 and unnamed group conversations, everyone has this role.
ROLE_MANAGER A space manager. The user has all basic permissions plus administrative permissions that let them manage the space, like adding or removing members. Only supported in SpaceType.SPACE .

MembershipState

Specifies the member's relationship with a space. Other membership states might be supported in the future.

Enums
MEMBERSHIP_STATE_UNSPECIFIED Default value. Don't use.
JOINED The user is added to the space, and can participate in the space.
INVITED The user is invited to join the space, but hasn't joined it.
NOT_A_MEMBER The user doesn't belong to the space and doesn't have a pending invitation to join the space.

MembershipBatchCreatedEventData

Event payload for multiple new memberships.

Event type: google.workspace.chat.membership.v1.batchCreated

فیلدها
memberships[]

MembershipCreatedEventData

A list of new memberships.

MembershipBatchDeletedEventData

Event payload for multiple deleted memberships.

Event type: google.workspace.chat.membership.v1.batchDeleted

فیلدها
memberships[]

MembershipDeletedEventData

A list of deleted memberships.

MembershipBatchUpdatedEventData

Event payload for multiple updated memberships.

Event type: google.workspace.chat.membership.v1.batchUpdated

فیلدها
memberships[]

MembershipUpdatedEventData

A list of updated memberships.

MembershipCreatedEventData

Event payload for a new membership.

Event type: google.workspace.chat.membership.v1.created .

فیلدها
membership

Membership

The new membership.

MembershipDeletedEventData

Event payload for a deleted membership.

Event type: google.workspace.chat.membership.v1.deleted

فیلدها
membership

Membership

The deleted membership. Only the name and state fields are populated.

MembershipUpdatedEventData

Event payload for an updated membership.

Event type: google.workspace.chat.membership.v1.updated

فیلدها
membership

Membership

The updated membership.

پیام

A message in a Google Chat space.

فیلدها
name

string

Identifier. Resource name of the message.

Format: spaces/{space}/messages/{message}

Where {space} is the ID of the space where the message is posted and {message} is a system-assigned ID for the message. For example, spaces/AAAAAAAAAAA/messages/BBBBBBBBBBB.BBBBBBBBBBB .

If you set a custom ID when you create a message, you can use this ID to specify the message in a request by replacing {message} with the value from the clientAssignedMessageId field. For example, spaces/AAAAAAAAAAA/messages/client-custom-name . For details, see Name a message .

sender

User

Output only. The user who created the message. If your Chat app authenticates as a user , the output populates the user name and type .

create_time

Timestamp

اختیاری. Immutable. For spaces created in Chat, the time at which the message was created. This field is output only, except when used in import mode spaces.

For import mode spaces, set this field to the historical timestamp at which the message was created in the source in order to preserve the original creation time.

last_update_time

Timestamp

Output only. The time at which the message was last edited by a user. If the message has never been edited, this field is empty.

delete_time

Timestamp

Output only. The time at which the message was deleted in Google Chat. If the message is never deleted, this field is empty.

text

string

اختیاری. Plain-text body of the message. The first link to an image, video, or web page generates a preview chip . You can also @mention a Google Chat user , or everyone in the space.

To learn about creating text messages, see Send a message .

formatted_text

string

Output only. Contains the message text with markups added to communicate formatting. This field might not capture all formatting visible in the UI, but includes the following:

  • Markup syntax for bold, italic, strikethrough, monospace, monospace block, and bulleted list.

  • User mentions using the format <users/{user}> .

  • Custom hyperlinks using the format <{url}|{rendered_text}> where the first string is the URL and the second is the rendered text—for example, <http://example.com|custom text> .

  • Custom emoji using the format :{emoji_name}: —for example, :smile: . This doesn't apply to Unicode emoji, such as U+1F600 for a grinning face emoji.

For more information, see View text formatting sent in a message

cards[]
(deprecated)

Card

Deprecated: Use cards_v2 instead.

Rich, formatted, and interactive cards that you can use to display UI elements such as: formatted texts, buttons, and clickable images. Cards are normally displayed below the plain-text body of the message. cards and cards_v2 can have a maximum size of 32 KB.

cards_v2[]

CardWithId

اختیاری. An array of cards .

Only Chat apps can create cards. If your Chat app authenticates as a user , the messages can't contain cards.

To learn how to create a message that contains cards, see Send a message .

Design and preview cards with the Card Builder.

Open the Card Builder

annotations[]

Annotation

Output only. Annotations can be associated with the plain-text body of the message or with chips that link to Google Workspace resources like Google Docs or Sheets with start_index and length of 0.

thread

Thread

The thread the message belongs to. For example usage, see Start or reply to a message thread .

space

Space

Output only. If your Chat app authenticates as a user , the output only populates the space name .

fallback_text

string

اختیاری. A plain-text description of the message's cards, used when the actual cards can't be displayed—for example, mobile notifications.

action_response

ActionResponse

Input only. Parameters that a Chat app can use to configure how its response is posted.

argument_text

string

Output only. Plain-text body of the message with all Chat app mentions stripped out.

slash_command

SlashCommand

Output only. Slash command information, if applicable.

attachment[]

Attachment

اختیاری. User-uploaded attachment.

matched_url

MatchedUrl

Output only. A URL in spaces.messages.text that matches a link preview pattern. For more information, see Preview links .

thread_reply

bool

Output only. When true , the message is a response in a reply thread. When false , the message is visible in the space's top-level conversation as either the first message of a thread or a message with no threaded replies.

If the space doesn't support reply in threads, this field is always false .

client_assigned_message_id

string

اختیاری. A custom ID for the message. You can use field to identify a message, or to get, delete, or update a message. To set a custom ID, specify the messageId field when you create the message. For details, see Name a message .

emoji_reaction_summaries[]

EmojiReactionSummary

Output only. The list of emoji reaction summaries on the message.

private_message_viewer

User

اختیاری. Immutable. Input for creating a message, otherwise output only. The user that can view the message. When set, the message is private and only visible to the specified user and the Chat app. To include this field in your request, you must call the Chat API using app authentication and omit the following:

For details, see Send a message privately .

deletion_metadata

DeletionMetadata

Output only. Information about a deleted message. A message is deleted when delete_time is set.

quoted_message_metadata

QuotedMessageMetadata

Output only. Information about a message that's quoted by a Google Chat user in a space. Google Chat users can quote a message to reply to it.

attached_gifs[]

AttachedGif

Output only. GIF images that are attached to the message.

accessory_widgets[]

AccessoryWidget

اختیاری. One or more interactive widgets that appear at the bottom of a message. You can add accessory widgets to messages that contain text, cards, or both text and cards. Not supported for messages that contain dialogs. For details, see Add interactive widgets at the bottom of a message .

Creating a message with accessory widgets requires app authentication .

MessageBatchCreatedEventData

Event payload for multiple new messages.

Event type: google.workspace.chat.message.v1.batchCreated

فیلدها
messages[]

MessageCreatedEventData

A list of new messages.

MessageBatchDeletedEventData

Event payload for multiple deleted messages.

Event type: google.workspace.chat.message.v1.batchDeleted

فیلدها
messages[]

MessageDeletedEventData

A list of deleted messages.

MessageBatchUpdatedEventData

Event payload for multiple updated messages.

Event type: google.workspace.chat.message.v1.batchUpdated

فیلدها
messages[]

MessageUpdatedEventData

A list of updated messages.

MessageCreatedEventData

Event payload for a new message.

Event type: google.workspace.chat.message.v1.created

فیلدها
message

Message

The new message.

MessageDeletedEventData

Event payload for a deleted message.

Event type: google.workspace.chat.message.v1.deleted

فیلدها
message

Message

The deleted message. Only the name , createTime , deleteTime , and deletionMetadata fields are populated.

MessageUpdatedEventData

Event payload for an updated message.

Event type: google.workspace.chat.message.v1.updated

فیلدها
message

Message

The updated message.

QuotedMessageMetadata

Information about a quoted message.

فیلدها
name

string

Output only. Resource name of the quoted message.

Format: spaces/{space}/messages/{message}

last_update_time

Timestamp

Output only. The timestamp when the quoted message was created or when the quoted message was last updated.

واکنش

A reaction to a message.

فیلدها
name

string

Identifier. The resource name of the reaction.

Format: spaces/{space}/messages/{message}/reactions/{reaction}

user

User

Output only. The user who created the reaction.

emoji

Emoji

مورد نیاز. The emoji used in the reaction.

ReactionBatchCreatedEventData

Event payload for multiple new reactions.

Event type: google.workspace.chat.reaction.v1.batchCreated

فیلدها
reactions[]

ReactionCreatedEventData

A list of new reactions.

ReactionBatchDeletedEventData

Event payload for multiple deleted reactions.

Event type: google.workspace.chat.reaction.v1.batchDeleted

فیلدها
reactions[]

ReactionDeletedEventData

A list of deleted reactions.

ReactionCreatedEventData

Event payload for a new reaction.

Event type: google.workspace.chat.reaction.v1.created

فیلدها
reaction

Reaction

The new reaction.

ReactionDeletedEventData

Event payload for a deleted reaction.

Type: google.workspace.chat.reaction.v1.deleted

فیلدها
reaction

Reaction

The deleted reaction.

RichLinkMetadata

A rich link to a resource. Rich links can be associated with the plain-text body of the message or represent chips that link to Google Workspace resources like Google Docs or Sheets with start_index and length of 0.

فیلدها
uri

string

The URI of this link.

Union field data . Data for the linked resource. data can be only one of the following:

RichLinkType

The rich link type. More types might be added in the future.

Enums
DRIVE_FILE A Google Drive rich link type.
CHAT_SPACE A Chat space rich link type. For example, a space smart chip.
MEET_SPACE A Meet message rich link type. For example, a Meet chip.
CALENDAR_EVENT A Calendar message rich link type. For example, a Calendar chip.

SearchSpacesRequest

Request to search for a list of spaces based on a query.

فیلدها
use_admin_access

bool

When true , the method runs using the user's Google Workspace administrator privileges.

The calling user must be a Google Workspace administrator with the manage chat and spaces conversations privilege .

Requires either the chat.admin.spaces.readonly or chat.admin.spaces OAuth 2.0 scope .

This method currently only supports admin access, thus only true is accepted for this field.

page_size

int32

The maximum number of spaces to return. The service may return fewer than this value.

If unspecified, at most 100 spaces are returned.

The maximum value is 1000. If you use a value more than 1000, it's automatically changed to 1000.

page_token

string

A token, received from the previous search spaces 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.

query

string

مورد نیاز. A search query.

You can search by using the following parameters:

  • create_time
  • customer
  • display_name
  • external_user_allowed
  • last_active_time
  • space_history_state
  • space_type

create_time and last_active_time accept a timestamp in RFC-3339 format and the supported comparison operators are: = , < , > , <= , >= .

customer is required and is used to indicate which customer to fetch spaces from. customers/my_customer is the only supported value.

display_name only accepts the HAS ( : ) operator. The text to match is first tokenized into tokens and each token is prefix-matched case-insensitively and independently as a substring anywhere in the space's display_name . For example, Fun Eve matches Fun event or The evening was fun , but not notFun event or even .

external_user_allowed accepts either true or false .

space_history_state only accepts values from the historyState field of a space resource.

space_type is required and the only valid value is SPACE .

Across different fields, only AND operators are supported. A valid example is space_type = "SPACE" AND display_name:"Hello" and an invalid example is space_type = "SPACE" OR display_name:"Hello" .

Among the same field, space_type doesn't support AND or OR operators. display_name , 'space_history_state', and 'external_user_allowed' only support OR operators. last_active_time and create_time support both AND and OR operators. AND can only be used to represent an interval, such as last_active_time < "2022-01-01T00:00:00+00:00" AND last_active_time > "2023-01-01T00:00:00+00:00" .

The following example queries are valid:

customer = "customers/my_customer" AND space_type = "SPACE"

customer = "customers/my_customer" AND space_type = "SPACE" AND
display_name:"Hello World"

customer = "customers/my_customer" AND space_type = "SPACE" AND
(last_active_time < "2020-01-01T00:00:00+00:00" OR last_active_time >
"2022-01-01T00:00:00+00:00")

customer = "customers/my_customer" AND space_type = "SPACE" AND
(display_name:"Hello World" OR display_name:"Fun event") AND
(last_active_time > "2020-01-01T00:00:00+00:00" AND last_active_time <
"2022-01-01T00:00:00+00:00")

customer = "customers/my_customer" AND space_type = "SPACE" AND
(create_time > "2019-01-01T00:00:00+00:00" AND create_time <
"2020-01-01T00:00:00+00:00") AND (external_user_allowed = "true") AND
(space_history_state = "HISTORY_ON" OR space_history_state = "HISTORY_OFF")
order_by

string

اختیاری. How the list of spaces is ordered.

Supported attributes to order by are:

  • membership_count.joined_direct_human_user_count — Denotes the count of human users that have directly joined a space.
  • last_active_time — Denotes the time when last eligible item is added to any topic of this space.
  • create_time — Denotes the time of the space creation.

Valid ordering operation values are:

  • ASC for ascending. Default value.

  • DESC for descending.

The supported syntax are:

  • membership_count.joined_direct_human_user_count DESC
  • membership_count.joined_direct_human_user_count ASC
  • last_active_time DESC
  • last_active_time ASC
  • create_time DESC
  • create_time ASC

SearchSpacesResponse

Response with a list of spaces corresponding to the search spaces request.

فیلدها
spaces[]

Space

A page of the requested spaces.

next_page_token

string

A token that can be used to retrieve the next page. If this field is empty, there are no subsequent pages.

total_size

int32

The total number of spaces that match the query, across all pages. If the result is over 10,000 spaces, this value is an estimate.

SetUpSpaceRequest

Request to create a space and add specified users to it.

فیلدها
space

Space

مورد نیاز. The Space.spaceType field is required.

To create a space, set Space.spaceType to SPACE and set Space.displayName . 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.

To create a group chat, set Space.spaceType to GROUP_CHAT . Don't set Space.displayName .

To create a 1:1 conversation between humans, set Space.spaceType to DIRECT_MESSAGE and set Space.singleUserBotDm to false . Don't set Space.displayName or Space.spaceDetails .

To create an 1:1 conversation between a human and the calling Chat app, set Space.spaceType to DIRECT_MESSAGE and Space.singleUserBotDm to true . Don't set Space.displayName or Space.spaceDetails .

If a DIRECT_MESSAGE space already exists, that space is returned instead of creating a new space.

request_id

string

اختیاری. 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.

memberships[]

Membership

اختیاری. The Google Chat users or groups to invite to join the space. Omit the calling user, as they are added automatically.

The set currently allows up to 49 memberships (in addition to the caller).

For human membership, the Membership.member field must contain a user with name populated (format: users/{user} ) and type set to User.Type.HUMAN . You can only add human users when setting up a space (adding Chat apps is only supported for direct message setup with the calling app). You can also add members using the user's email as an alias for {user}. For example, the user.name can be users/example@gmail.com . To invite Gmail users or users from external Google Workspace domains, user's email must be used for {user} .

For Google group membership, the Membership.group_member field must contain a group with name populated (format groups/{group} ). You can only add Google groups when setting Space.spaceType to SPACE .

Optional when setting Space.spaceType to SPACE .

Required when setting Space.spaceType to GROUP_CHAT , along with at least two memberships.

Required when setting Space.spaceType to DIRECT_MESSAGE with a human user, along with exactly one membership.

Must be empty when creating a 1:1 conversation between a human and the calling Chat app (when setting Space.spaceType to DIRECT_MESSAGE and Space.singleUserBotDm to true ).

SlashCommand

Metadata about a slash command in Google Chat.

فیلدها
command_id

int64

The ID of the slash command.

SlashCommandMetadata

Annotation metadata for slash commands (/).

فیلدها
bot

User

The Chat app whose command was invoked.

type

Type

The type of slash command.

command_name

string

The name of the invoked slash command.

command_id

int64

The command ID of the invoked slash command.

triggers_dialog

bool

Indicates whether the slash command is for a dialog.

تایپ کنید

Enums
TYPE_UNSPECIFIED Default value for the enum. Don't use.
ADD Add Chat app to space.
INVOKE Invoke slash command in space.

فضا

A space in Google Chat. Spaces are conversations between two or more users or 1:1 messages between a user and a Chat app.

فیلدها
name

string

Identifier. Resource name of the space.

Format: spaces/{space}

Where {space} represents the system-assigned ID for the space. You can obtain the space ID by calling the spaces.list() method or from the space URL. For example, if the space URL is https://mail.google.com/mail/u/0/#chat/space/AAAAAAAAA , the space ID is AAAAAAAAA .

type
(deprecated)

Type

Output only. Deprecated: Use space_type instead. The type of a space.

space_type

SpaceType

اختیاری. The type of space. Required when creating a space or updating the space type of a space. Output only for other usage.

single_user_bot_dm

bool

اختیاری. Whether the space is a DM between a Chat app and a single human.

threaded
(deprecated)

bool

Output only. Deprecated: Use spaceThreadingState instead. Whether messages are threaded in this space.

display_name

string

اختیاری. The space's display name. Required when creating a space with a spaceType of SPACE . If you receive the error message ALREADY_EXISTS when creating a space or updating the displayName , try a different displayName . An existing space within the Google Workspace organization might already use this display name.

For direct messages, this field might be empty.

Supports up to 128 characters.

external_user_allowed

bool

اختیاری. Immutable. Whether this space permits any Google Chat user as a member. Input when creating a space in a Google Workspace organization. Omit this field when creating spaces in the following conditions:

  • The authenticated user uses a consumer account (unmanaged user account). By default, a space created by a consumer account permits any Google Chat user.

For existing spaces, this field is output only.

space_threading_state

SpaceThreadingState

Output only. The threading state in the Chat space.

space_details

SpaceDetails

اختیاری. Details about the space including description and rules.

space_history_state

HistoryState

اختیاری. The message history state for messages and threads in this space.

import_mode

bool

اختیاری. Whether this space is created in Import Mode as part of a data migration into Google Workspace. While spaces are being imported, they aren't visible to users until the import is complete.

Creating a space in Import Mode requires user authentication .

create_time

Timestamp

اختیاری. Immutable. For spaces created in Chat, the time the space was created. This field is output only, except when used in import mode spaces.

For import mode spaces, set this field to the historical timestamp at which the space was created in the source in order to preserve the original creation time.

Only populated in the output when spaceType is GROUP_CHAT or SPACE .

last_active_time

Timestamp

Output only. Timestamp of the last message in the space.

admin_installed

bool

Output only. For direct message (DM) spaces with a Chat app, whether the space was created by a Google Workspace administrator. Administrators can install and set up a direct message with a Chat app on behalf of users in their organization.

To support admin install, your Chat app must feature direct messaging.

membership_count

MembershipCount

Output only. The count of joined memberships grouped by member type. Populated when the space_type is SPACE , DIRECT_MESSAGE or GROUP_CHAT .

access_settings

AccessSettings

اختیاری. Specifies the access setting of the space. Only populated when the space_type is SPACE .

space_uri

string

Output only. The URI for a user to access the space.

import_mode_expire_time

Timestamp

Output only. The time when the space will be automatically deleted by the system if it remains in import mode.

Each space created in import mode must exit this mode before this expire time using spaces.completeImport .

This field is only populated for spaces that were created with import mode.

customer

string

اختیاری. Immutable. The customer id of the domain of the space. Required only when creating a space with app authentication and SpaceType is SPACE , otherwise should not be set.

In the format customers/{customer} , where customer is the id from the Admin SDK customer resource . Private apps can also use the customers/my_customer alias to create the space in the same Google Workspace organization as the app.

For DMs, this field isn't populated.

Union field space_permission_settings . Represents the permission settings of a space. Only populated when the space_type is SPACE . space_permission_settings can be only one of the following:
predefined_permission_settings

PredefinedPermissionSettings

اختیاری. Input only. Predefined space permission settings, input only when creating a space. If the field is not set, a collaboration space is created. After you create the space, settings are populated in the PermissionSettings field.

Setting predefined permission settings supports:

permission_settings

PermissionSettings

اختیاری. Space permission settings for existing spaces. Input for updating exact space permission settings, where existing permission settings are replaced. Output lists current permission settings.

Reading and updating permission settings supports:

AccessSettings

Represents the access setting of the space.

فیلدها
access_state

AccessState

Output only. Indicates the access state of the space.

audience

string

اختیاری. The resource name of the target audience who can discover the space, join the space, and preview the messages in the space. If unset, only users or Google Groups who have been individually invited or added to the space can access it. For details, see Make a space discoverable to a target audience .

Format: audiences/{audience}

To use the default target audience for the Google Workspace organization, set to audiences/default .

Reading the target audience supports:

This field is not populated when using the chat.bot scope with app authentication .

Setting the target audience requires user authentication .

AccessState

Represents the access state of the space.

Enums
ACCESS_STATE_UNSPECIFIED Access state is unknown or not supported in this API.
PRIVATE Only users or Google Groups that have been individually added or invited by other users or Google Workspace administrators can discover and access the space.
DISCOVERABLE

A space manager has granted a target audience access to the space. Users or Google Groups that have been individually added or invited to the space can also discover and access the space. To learn more, see Make a space discoverable to specific users .

Creating discoverable spaces requires user authentication .

MembershipCount

Represents the count of memberships of a space, grouped into categories.

فیلدها
joined_direct_human_user_count

int32

Output only. Count of human users that have directly joined the space, not counting users joined by having membership in a joined group.

joined_group_count

int32

Output only. Count of all groups that have directly joined the space.

PermissionSetting

Represents a space permission setting.

فیلدها
managers_allowed

bool

اختیاری. Whether spaces managers have this permission.

members_allowed

bool

اختیاری. Whether non-manager members have this permission.

PermissionSettings

Permission settings that you can specify when updating an existing named space.

To set permission settings when creating a space, specify the PredefinedPermissionSettings field in your request.

فیلدها
manage_members_and_groups

PermissionSetting

اختیاری. Setting for managing members and groups in a space.

modify_space_details

PermissionSetting

اختیاری. Setting for updating space name, avatar, description and guidelines.

toggle_history

PermissionSetting

اختیاری. Setting for toggling space history on and off.

use_at_mention_all

PermissionSetting

اختیاری. Setting for using @all in a space.

manage_apps

PermissionSetting

اختیاری. Setting for managing apps in a space.

manage_webhooks

PermissionSetting

اختیاری. Setting for managing webhooks in a space.

post_messages

PermissionSetting

Output only. Setting for posting messages in a space.

reply_messages

PermissionSetting

اختیاری. Setting for replying to messages in a space.

PredefinedPermissionSettings

Predefined permission settings that you can only specify when creating a named space. More settings might be added in the future. For details about permission settings for named spaces, see Learn about spaces .

Enums
PREDEFINED_PERMISSION_SETTINGS_UNSPECIFIED Unspecified. Don't use.
COLLABORATION_SPACE Setting to make the space a collaboration space where all members can post messages.
ANNOUNCEMENT_SPACE Setting to make the space an announcement space where only space managers can post messages.

SpaceDetails

Details about the space including description and rules.

فیلدها
description

string

اختیاری. A description of the space. For example, describe the space's discussion topic, functional purpose, or participants.

Supports up to 150 characters.

guidelines

string

اختیاری. The space's rules, expectations, and etiquette.

Supports up to 5,000 characters.

SpaceThreadingState

Specifies the type of threading state in the Chat space.

Enums
SPACE_THREADING_STATE_UNSPECIFIED رزرو شده است.
THREADED_MESSAGES Named spaces that support message threads. When users respond to a message, they can reply in-thread, which keeps their response in the context of the original message.
GROUPED_MESSAGES Named spaces where the conversation is organized by topic. Topics and their replies are grouped together.
UNTHREADED_MESSAGES Direct messages (DMs) between two people and group conversations between 3 or more people.

SpaceType

The type of space. Required when creating or updating a space. Output only for other usage.

Enums
SPACE_TYPE_UNSPECIFIED رزرو شده است.
SPACE A place where people send messages, share files, and collaborate. A SPACE can include Chat apps.
GROUP_CHAT Group conversations between 3 or more people. A GROUP_CHAT can include Chat apps.
DIRECT_MESSAGE 1:1 messages between two humans or a human and a Chat app.

تایپ کنید

Deprecated: Use SpaceType instead.

Enums
TYPE_UNSPECIFIED رزرو شده است.
ROOM Conversations between two or more humans.
DM 1:1 Direct Message between a human and a Chat app, where all messages are flat. Note that this doesn't include direct messages between two humans.

SpaceBatchUpdatedEventData

Event payload for multiple updates to a space.

Event type: google.workspace.chat.space.v1.batchUpdated

فیلدها
spaces[]

SpaceUpdatedEventData

A list of updated spaces.

SpaceEvent

An event that represents a change or activity in a Google Chat space. To learn more, see Work with events from Google Chat .

فیلدها
name

string

Resource name of the space event.

Format: spaces/{space}/spaceEvents/{spaceEvent}

event_time

Timestamp

Time when the event occurred.

event_type

string

Type of space event. Each event type has a batch version, which represents multiple instances of the event type that occur in a short period of time. For spaceEvents.list() requests, omit batch event types in your query filter. By default, the server returns both event type and its batch version.

Supported event types for messages :

  • New message: google.workspace.chat.message.v1.created
  • Updated message: google.workspace.chat.message.v1.updated
  • Deleted message: google.workspace.chat.message.v1.deleted
  • Multiple new messages: google.workspace.chat.message.v1.batchCreated
  • Multiple updated messages: google.workspace.chat.message.v1.batchUpdated
  • Multiple deleted messages: google.workspace.chat.message.v1.batchDeleted

Supported event types for memberships :

  • New membership: google.workspace.chat.membership.v1.created
  • Updated membership: google.workspace.chat.membership.v1.updated
  • Deleted membership: google.workspace.chat.membership.v1.deleted
  • Multiple new memberships: google.workspace.chat.membership.v1.batchCreated
  • Multiple updated memberships: google.workspace.chat.membership.v1.batchUpdated
  • Multiple deleted memberships: google.workspace.chat.membership.v1.batchDeleted

Supported event types for reactions :

  • New reaction: google.workspace.chat.reaction.v1.created
  • Deleted reaction: google.workspace.chat.reaction.v1.deleted
  • Multiple new reactions: google.workspace.chat.reaction.v1.batchCreated
  • Multiple deleted reactions: google.workspace.chat.reaction.v1.batchDeleted

Supported event types about the space :

  • Updated space: google.workspace.chat.space.v1.updated
  • Multiple space updates: google.workspace.chat.space.v1.batchUpdated

Union field payload .

payload can be only one of the following:

message_created_event_data

MessageCreatedEventData

Event payload for a new message.

Event type: google.workspace.chat.message.v1.created

message_updated_event_data

MessageUpdatedEventData

Event payload for an updated message.

Event type: google.workspace.chat.message.v1.updated

message_deleted_event_data

MessageDeletedEventData

Event payload for a deleted message.

Event type: google.workspace.chat.message.v1.deleted

message_batch_created_event_data

MessageBatchCreatedEventData

Event payload for multiple new messages.

Event type: google.workspace.chat.message.v1.batchCreated

message_batch_updated_event_data

MessageBatchUpdatedEventData

Event payload for multiple updated messages.

Event type: google.workspace.chat.message.v1.batchUpdated

message_batch_deleted_event_data

MessageBatchDeletedEventData

Event payload for multiple deleted messages.

Event type: google.workspace.chat.message.v1.batchDeleted

space_updated_event_data

SpaceUpdatedEventData

Event payload for a space update.

Event type: google.workspace.chat.space.v1.updated

space_batch_updated_event_data

SpaceBatchUpdatedEventData

Event payload for multiple updates to a space.

Event type: google.workspace.chat.space.v1.batchUpdated

membership_created_event_data

MembershipCreatedEventData

Event payload for a new membership.

Event type: google.workspace.chat.membership.v1.created

membership_updated_event_data

MembershipUpdatedEventData

Event payload for an updated membership.

Event type: google.workspace.chat.membership.v1.updated

membership_deleted_event_data

MembershipDeletedEventData

Event payload for a deleted membership.

Event type: google.workspace.chat.membership.v1.deleted

membership_batch_created_event_data

MembershipBatchCreatedEventData

Event payload for multiple new memberships.

Event type: google.workspace.chat.membership.v1.batchCreated

membership_batch_updated_event_data

MembershipBatchUpdatedEventData

Event payload for multiple updated memberships.

Event type: google.workspace.chat.membership.v1.batchUpdated

membership_batch_deleted_event_data

MembershipBatchDeletedEventData

Event payload for multiple deleted memberships.

Event type: google.workspace.chat.membership.v1.batchDeleted

reaction_created_event_data

ReactionCreatedEventData

Event payload for a new reaction.

Event type: google.workspace.chat.reaction.v1.created

reaction_deleted_event_data

ReactionDeletedEventData

Event payload for a deleted reaction.

Event type: google.workspace.chat.reaction.v1.deleted

reaction_batch_created_event_data

ReactionBatchCreatedEventData

Event payload for multiple new reactions.

Event type: google.workspace.chat.reaction.v1.batchCreated

reaction_batch_deleted_event_data

ReactionBatchDeletedEventData

Event payload for multiple deleted reactions.

Event type: google.workspace.chat.reaction.v1.batchDeleted

SpaceNotificationSetting

The notification setting of a user in a space.

فیلدها
name

string

Identifier. The resource name of the space notification setting. Format: users/{user}/spaces/{space}/spaceNotificationSetting .

notification_setting

NotificationSetting

The notification setting.

mute_setting

MuteSetting

The space notification mute setting.

MuteSetting

The space notification mute setting types.

Enums
MUTE_SETTING_UNSPECIFIED رزرو شده است.
UNMUTED The user will receive notifications for the space based on the notification setting.
MUTED The user will not receive any notifications for the space, regardless of the notification setting.

NotificationSetting

The notification setting types. Other types might be supported in the future.

Enums
NOTIFICATION_SETTING_UNSPECIFIED رزرو شده است.
ALL Notifications are triggered by @mentions, followed threads, first message of new threads. All new threads are automatically followed, unless manually unfollowed by the user.
MAIN_CONVERSATIONS The notification is triggered by @mentions, followed threads, first message of new threads. Not available for 1:1 direct messages.
FOR_YOU The notification is triggered by @mentions, followed threads. Not available for 1:1 direct messages.
OFF Notification is off.

SpaceReadState

A user's read state within a space, used to identify read and unread messages.

فیلدها
name

string

Resource name of the space read state.

Format: users/{user}/spaces/{space}/spaceReadState

last_read_time

Timestamp

اختیاری. The time when the user's space read state was updated. Usually this corresponds with either the timestamp of the last read message, or a timestamp specified by the user to mark the last read position in a space.

SpaceUpdatedEventData

Event payload for an updated space.

Event type: google.workspace.chat.space.v1.updated

فیلدها
space

Space

The updated space.

موضوع

A thread in a Google Chat space. For example usage, see Start or reply to a message thread .

If you specify a thread when creating a message, you can set the messageReplyOption field to determine what happens if no matching thread is found.

فیلدها
name

string

Identifier. Resource name of the thread.

Example: spaces/{space}/threads/{thread}

thread_key

string

اختیاری. Input for creating or updating a thread. Otherwise, output only. ID for the thread. Supports up to 4000 characters.

This ID is unique to the Chat app that sets it. For example, if multiple Chat apps create a message using the same thread key, the messages are posted in different threads. To reply in a thread created by a person or another Chat app, specify the thread name field instead.

ThreadReadState

A user's read state within a thread, used to identify read and unread messages.

فیلدها
name

string

Resource name of the thread read state.

Format: users/{user}/spaces/{space}/threads/{thread}/threadReadState

last_read_time

Timestamp

The time when the user's thread read state was updated. Usually this corresponds with the timestamp of the last read message in a thread.

UpdateMembershipRequest

Request message for updating a membership.

فیلدها
membership

Membership

مورد نیاز. The membership to update. Only fields specified by update_mask are updated.

update_mask

FieldMask

مورد نیاز. The field paths to update. Separate multiple values with commas or use * to update all field paths.

Currently supported field paths:

  • role
use_admin_access

bool

اختیاری. When true , the method runs using the user's Google Workspace administrator privileges.

The calling user must be a Google Workspace administrator with the manage chat and spaces conversations privilege .

Requires the chat.admin.memberships OAuth 2.0 scope .

UpdateMessageRequest

Request to update a message.

فیلدها
message

Message

مورد نیاز. Message with fields updated.

update_mask

FieldMask

مورد نیاز. The field paths to update. Separate multiple values with commas or use * to update all field paths.

Currently supported field paths:

allow_missing

bool

اختیاری. 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 or the request fails.

UpdateSpaceNotificationSettingRequest

Request to update the space notification settings. Only supports updating notification setting for the calling user.

فیلدها
space_notification_setting

SpaceNotificationSetting

مورد نیاز. The resource name for the space notification settings must be populated in the form of users/{user}/spaces/{space}/spaceNotificationSetting . Only fields specified by update_mask are updated.

update_mask

FieldMask

مورد نیاز. Supported field paths:

  • notification_setting

  • mute_setting

UpdateSpaceReadStateRequest

Request message for UpdateSpaceReadState API.

فیلدها
space_read_state

SpaceReadState

مورد نیاز. The space read state and fields to update.

Only supports updating read state for the calling user.

To refer to the calling user, set one of the following:

  • The me alias. For example, users/me/spaces/{space}/spaceReadState .

  • Their Workspace email address. For example, users/user@example.com/spaces/{space}/spaceReadState .

  • Their user id. For example, users/123456789/spaces/{space}/spaceReadState .

Format: users/{user}/spaces/{space}/spaceReadState

update_mask

FieldMask

مورد نیاز. The field paths to update. Currently supported field paths:

  • last_read_time

When the last_read_time is before the latest message create time, the space appears as unread in the UI.

To mark the space as read, set last_read_time to any value later (larger) than the latest message create time. The last_read_time is coerced to match the latest message create time. Note that the space read state only affects the read state of messages that are visible in the space's top-level conversation. Replies in threads are unaffected by this timestamp, and instead rely on the thread read state.

UpdateSpaceRequest

A request to update a single space.

فیلدها
space

Space

مورد نیاز. Space with fields to be updated. Space.name must be populated in the form of spaces/{space} . Only fields specified by update_mask are updated.

update_mask

FieldMask

مورد نیاز. The updated field paths, comma separated if there are multiple.

You can update the following fields for a space:

space_details : Updates the space's description. Supports up to 150 characters.

display_name : Only supports updating the display name for spaces where spaceType field is SPACE . If you receive the error message ALREADY_EXISTS , try a different value. 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_type is not supported with useAdminAccess .

space_history_state : Updates space history settings by turning history on or off for the space. Only supported if history settings are enabled for the Google Workspace organization. To update the space history state, you must omit all other field masks in your request. space_history_state is not supported with useAdminAccess .

access_settings.audience : Updates the access setting of who can discover the space, join the space, and preview the messages in named space where spaceType field is SPACE . If the existing space has a target audience, you can remove the audience and restrict space access by omitting a value for this field mask. To update access settings for a space, the authenticating user must be a space manager and omit all other field masks in your request. You can't update this field if the space is in import mode . To learn more, see Make a space discoverable to specific users . access_settings.audience is not supported with useAdminAccess .

permission_settings : Supports changing the permission settings of a space. When updating permission settings, you can only specify permissionSettings field masks; you cannot update other field masks at the same time. permissionSettings is not supported with useAdminAccess . The supported field masks include:

  • permission_settings.manageMembersAndGroups
  • permission_settings.modifySpaceDetails
  • permission_settings.toggleHistory
  • permission_settings.useAtMentionAll
  • permission_settings.manageApps
  • permission_settings.manageWebhooks
  • permission_settings.replyMessages
use_admin_access

bool

اختیاری. When true , the method runs using the user's Google Workspace administrator privileges.

The calling user must be a Google Workspace administrator with the manage chat and spaces conversations privilege .

Requires the chat.admin.spaces OAuth 2.0 scope .

Some FieldMask values are not supported using admin access. For details, see the description of update_mask .

کاربر

A user in Google Chat. When returned as an output from a request, if your Chat app authenticates as a user , the output for a User resource only populates the user's name and type .

فیلدها
name

string

Resource name for a Google Chat user .

Format: users/{user} . users/app can be used as an alias for the calling app bot user.

For human users , {user} is the same user identifier as:

  • the id for the Person in the People API. For example, users/123456789 in Chat API represents the same person as the 123456789 Person profile ID in People API.

  • the id for a user in the Admin SDK Directory API.

  • the user's email address can be used as an alias for {user} in API requests. For example, if the People API Person profile ID for user@example.com is 123456789 , you can use users/user@example.com as an alias to reference users/123456789 . Only the canonical resource name (for example users/123456789 ) will be returned from the API.

display_name

string

Output only. The user's display name.

domain_id

string

Unique identifier of the user's Google Workspace domain.

type

Type

User type.

is_anonymous

bool

Output only. When true , the user is deleted or their profile is not visible.

تایپ کنید

Enums
TYPE_UNSPECIFIED Default value for the enum. استفاده نکنید.
HUMAN Human user.
BOT Chat app user.

UserMentionMetadata

Annotation metadata for user mentions (@).

فیلدها
user

User

The user mentioned.

type

Type

The type of user mention.

تایپ کنید

Enums
TYPE_UNSPECIFIED Default value for the enum. Don't use.
ADD Add user to space.
MENTION Mention user in space.

WidgetMarkup

A widget is a UI element that presents text and images.

فیلدها
buttons[]

Button

A list of buttons. Buttons is also oneof data and only one of these fields should be set.

Union field data . A WidgetMarkup can only have one of the following items. You can use multiple WidgetMarkup fields to display more items. data can be only one of the following:
text_paragraph

TextParagraph

Display a text paragraph in this widget.

image

Image

Display an image in this widget.

key_value

KeyValue

Display a key value item in this widget.

دکمه

A button. Can be a text button or an image button.

فیلدها

Union field type .

type can be only one of the following:

text_button

TextButton

A button with text and onclick action.

image_button

ImageButton

A button with image and onclick action.

FormAction

A form action describes the behavior when the form is submitted. For example, you can invoke Apps Script to handle the form.

فیلدها
action_method_name

string

The method name is used to identify which part of the form triggered the form submission. This information is echoed back to the Chat app as part of the card click event. You can use the same method name for several elements that trigger a common behavior.

parameters[]

ActionParameter

List of action parameters.

ActionParameter

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.

فیلدها
key

string

The name of the parameter for the action script.

value

string

The value of the parameter.

نماد

The set of supported icons.

Enums
ICON_UNSPECIFIED
AIRPLANE
BOOKMARK
BUS
CAR
CLOCK
CONFIRMATION_NUMBER_ICON
DOLLAR
DESCRIPTION
EMAIL
EVENT_PERFORMER
EVENT_SEAT
FLIGHT_ARRIVAL
FLIGHT_DEPARTURE
HOTEL
HOTEL_ROOM_TYPE
INVITE
MAP_PIN
MEMBERSHIP
MULTIPLE_PEOPLE
OFFER
PERSON
PHONE
RESTAURANT_ICON
SHOPPING_CART
STAR
STORE
TICKET
TRAIN
VIDEO_CAMERA
VIDEO_PLAY

تصویر

An image that's specified by a URL and can have an onclick action.

فیلدها
image_url

string

The URL of the image.

on_click

OnClick

The onclick action.

aspect_ratio

double

The aspect ratio of this image (width and height). This field lets you reserve the right height for the image while waiting for it to load. It's not meant to override the built-in aspect ratio of the image. If unset, the server fills it by prefetching the image.

ImageButton

An image button with an onclick action.

فیلدها
on_click

OnClick

The onclick action.

name

string

The name of this image_button that's used for accessibility. Default value is provided if this name isn't specified.

Union field icons . The icon can be specified by an Icon enum or a URL. icons can be only one of the following:
icon

Icon

The icon specified by an enum that indices to an icon provided by Chat API.

icon_url

string

The icon specified by a URL.

KeyValue

A UI element contains a key (label) and a value (content). This element can also contain some actions such as onclick button.

فیلدها
top_label

string

The text of the top label. Formatted text supported. For more information about formatting text, see Formatting text in Google Chat apps and Formatting text in Google Workspace Add-ons .

content

string

The text of the content. Formatted text supported and always required. For more information about formatting text, see Formatting text in Google Chat apps and Formatting text in Google Workspace Add-ons .

content_multiline

bool

If the content should be multiline.

bottom_label

string

The text of the bottom label. Formatted text supported. For more information about formatting text, see Formatting text in Google Chat apps and Formatting text in Google Workspace Add-ons .

on_click

OnClick

The onclick action. Only the top label, bottom label, and content region are clickable.

Union field icons . At least one of icons, top_label and bottom_label must be defined. icons can be only one of the following:
icon

Icon

An enum value that's replaced by the Chat API with the corresponding icon image.

icon_url

string

The icon specified by a URL.

Union field control . A control widget. You can set either button or switch_widget , but not both. control can be only one of the following:
button

Button

A button that can be clicked to trigger an action.

OnClick

An onclick action (for example, open a link).

فیلدها

Union field data .

data can be only one of the following:

action

FormAction

A form action is triggered by this onclick action if specified.

TextButton

A button with text and onclick action.

فیلدها
text

string

The text of the button.

on_click

OnClick

The onclick action of the button.

TextParagraph

A paragraph of text. Formatted text supported. For more information about formatting text, see Formatting text in Google Chat apps and Formatting text in Google Workspace Add-ons .

فیلدها
text

string