Package google.chat.v1

فهرست

سرویس چت

توسعه‌دهندگان را قادر می‌سازد تا برنامه‌های چت و ادغام‌ها را در پلتفرم چت گوگل بسازند.

فضای واردات کامل

rpc CompleteImportSpace( CompleteImportSpaceRequest ) returns ( CompleteImportSpaceResponse )

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

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

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

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

دامنه‌های مجوز

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

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

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

ایجاد ایموجی سفارشی

rpc CreateCustomEmoji( CreateCustomEmojiRequest ) returns ( CustomEmoji )

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

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

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

  • https://www.googleapis.com/auth/chat.customemojis
دامنه‌های مجوز

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

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

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

ایجادعضویت

rpc CreateMembership( CreateMembershipRequest ) returns ( Membership )

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

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

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

    • 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

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

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

برای مثال، موارد زیر را ببینید:

دامنه‌های مجوز

به یکی از حوزه‌های 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 )

پیامی را در فضای چت گوگل ایجاد می‌کند. برای مثال، به «ارسال پیام» مراجعه کنید.

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

  • احراز هویت برنامه با دامنه مجوز:
    • 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 (فقط فاصله‌ها در حالت واردات)

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

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

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

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

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

حداکثر اندازه پیام، شامل محتوای پیام، ۳۲۰۰۰ بایت است.

برای درخواست‌های webhook ، پاسخ شامل کل پیام نیست. پاسخ علاوه بر اطلاعات موجود در درخواست، فقط فیلدهای 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

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

ایجاد پین پیام

rpc CreateMessagePin( CreateMessagePinRequest ) returns ( MessagePin )

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

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

  • https://www.googleapis.com/auth/chat.spaces.pins
  • https://www.googleapis.com/auth/chat.spaces
دامنه‌های مجوز

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

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

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

ایجاد واکنش

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

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

ایجادبخش

rpc CreateSection( CreateSectionRequest ) returns ( Section )

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

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

  • https://www.googleapis.com/auth/chat.users.sections
دامنه‌های مجوز

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

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

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

ایجاد فضا

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 باید در درخواست تنظیم شود.

هنگام احراز هویت به عنوان یک برنامه، برنامه چت به عنوان عضوی از فضا اضافه می‌شود. با این حال، برخلاف احراز هویت انسانی، برنامه چت به عنوان مدیر فضا اضافه نمی‌شود. به طور پیش‌فرض، برنامه چت می‌تواند توسط همه اعضای فضا از فضا حذف شود. برای اینکه فقط مدیران فضا بتوانند برنامه را از یک فضا حذف کنند، 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

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

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

rpc DeleteCustomEmoji( DeleteCustomEmojiRequest ) returns ( Empty )

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

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

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

  • https://www.googleapis.com/auth/chat.customemojis
دامنه‌های مجوز

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

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

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

حذف عضویت

rpc DeleteMembership( DeleteMembershipRequest ) returns ( Membership )

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

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

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

    • 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

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

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

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

دامنه‌های مجوز

به یکی از حوزه‌های 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 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

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

پین کردن پیام حذف

rpc DeleteMessagePin( DeleteMessagePinRequest ) returns ( Empty )

پین پیام را حذف می‌کند.

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

  • https://www.googleapis.com/auth/chat.spaces.pins
  • https://www.googleapis.com/auth/chat.spaces
دامنه‌های مجوز

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

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

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

واکنش را حذف کنید

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

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

حذفبخش

rpc DeleteSection( DeleteSectionRequest ) returns ( Empty )

یک بخش از نوع CUSTOM_SECTION را حذف می‌کند.

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

برای جزئیات بیشتر، به ایجاد و سازماندهی بخش‌ها در Google Chat مراجعه کنید.

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

  • https://www.googleapis.com/auth/chat.users.sections
دامنه‌های مجوز

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

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

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

حذف فضا

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

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

یافتن پیام مستقیم

rpc FindDirectMessage( FindDirectMessageRequest ) returns ( Space )

پیام مستقیم موجود با کاربر مشخص شده را برمی‌گرداند. اگر هیچ فضایی برای پیام مستقیم پیدا نشود، خطای 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

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

یافتن چت‌های گروهی

rpc FindGroupChats( FindGroupChatsRequest ) returns ( FindGroupChatsResponse )

تمام فاصله‌های دارای spaceType == GROUP_CHAT را برمی‌گرداند، که عضویت‌های انسانی آنها دقیقاً شامل کاربر فراخواننده و کاربران مشخص شده در FindGroupChatsRequest.users است. فقط اعضایی که به مکالمه پیوسته‌اند پشتیبانی می‌شوند. برای مثال، به Find group chats مراجعه کنید.

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

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

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

  • https://www.googleapis.com/auth/chat.memberships.readonly
  • https://www.googleapis.com/auth/chat.memberships
دامنه‌های مجوز

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

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

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

دریافت پیوست

rpc GetAttachment( GetAttachmentRequest ) returns ( Attachment )

فراداده‌های یک پیوست پیام را دریافت می‌کند. داده‌های پیوست با استفاده از رابط برنامه‌نویسی کاربردی رسانه (media API) دریافت می‌شوند. برای مثال، به دریافت فراداده‌های مربوط به یک پیوست پیام مراجعه کنید.

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

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

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

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

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

دریافت در دسترس بودن

rpc GetAvailability( GetAvailabilityRequest ) returns ( Availability )

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

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

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

  • https://www.googleapis.com/auth/chat.users.availability.readonly
  • https://www.googleapis.com/auth/chat.users.availability
دامنه‌های مجوز

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

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

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

دریافت ایموجی سفارشی

rpc GetCustomEmoji( GetCustomEmojiRequest ) returns ( CustomEmoji )

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

ایموجی‌های سفارشی فقط برای حساب‌های 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 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

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

دریافت پیام

rpc GetMessage( GetMessageRequest ) returns ( Message )

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

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

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

    • https://www.googleapis.com/auth/chat.bot : هنگام استفاده از این محدوده مجوز، این متد جزئیاتی درباره پیامی که برنامه چت به آن دسترسی دارد، مانند پیام‌های مستقیم و دستورات اسلش که برنامه چت را فراخوانی می‌کنند، برمی‌گرداند.
    • https://www.googleapis.com/auth/chat.app.messages.readonly با تأیید مدیر . هنگام استفاده از این محدوده احراز هویت، این متد جزئیات مربوط به یک پیام عمومی در یک فضا را برمی‌گرداند.
  • احراز هویت کاربر با یکی از حوزه‌های مجوز زیر:

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

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

دامنه‌های مجوز

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

  • https://www.googleapis.com/auth/chat.bot
  • https://www.googleapis.com/auth/chat.messages
  • https://www.googleapis.com/auth/chat.messages.readonly
  • https://www.googleapis.com/auth/chat.app.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

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

رویداد GetSpace

rpc GetSpaceEvent( GetSpaceEventRequest ) returns ( SpaceEvent )

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

نکته: فیلد permissionSettings در شیء Space از داده‌های رویداد Space برای این درخواست برگردانده نمی‌شود.

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

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

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

    • 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

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

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

دامنه‌های مجوز

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

  • https://www.googleapis.com/auth/chat.app.memberships
  • https://www.googleapis.com/auth/chat.app.memberships.readonly
  • https://www.googleapis.com/auth/chat.app.messages.readonly
  • https://www.googleapis.com/auth/chat.app.spaces
  • https://www.googleapis.com/auth/chat.app.spaces.readonly
  • https://www.googleapis.com/auth/chat.app.all.messages.readonly
  • https://www.googleapis.com/auth/chat.app.all.spaces.readonly
  • https://www.googleapis.com/auth/chat.app.all.memberships.readonly
  • 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

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

تنظیمات اعلان GetSpace

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

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

دریافت نخخواندن وضعیت

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

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

لیست ایموجی‌های سفارشی

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 به آنها دسترسی دارد، اما عضویت‌های برنامه 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

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

پین‌های لیست پیام

rpc ListMessagePins( ListMessagePinsRequest ) returns ( ListMessagePinsResponse )

پین‌های پیام را در یک فضا فهرست می‌کند. کاربران می‌توانند پیام‌های مهم را برای دسترسی آسان در فضاها پین کنند. برای اطلاعات بیشتر، به پین ​​کردن یا لغو پین کردن مکالمه در Google Chat مراجعه کنید.

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

  • https://www.googleapis.com/auth/chat.spaces.pins.readonly
  • https://www.googleapis.com/auth/chat.spaces.pins
  • https://www.googleapis.com/auth/chat.spaces.readonly
  • https://www.googleapis.com/auth/chat.spaces
دامنه‌های مجوز

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

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

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

لیست پیام‌ها

rpc ListMessages( ListMessagesRequest ) returns ( ListMessagesResponse )

پیام‌های موجود در فضایی که فراخواننده عضو آن است، از جمله پیام‌های اعضای مسدود شده و فضاها را فهرست می‌کند. پیام‌های سیستمی، مانند پیام‌هایی که اعضای فضای جدید را اعلام می‌کنند، شامل نمی‌شوند. اگر پیام‌های یک فضا را بدون هیچ پیامی فهرست کنید، پاسخ یک شیء خالی است. هنگام استفاده از رابط REST/HTTP، پاسخ حاوی یک شیء JSON خالی، {} است. برای مثال، به List messages مراجعه کنید.

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

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

    • https://www.googleapis.com/auth/chat.app.messages.readonly . هنگام استفاده از این محدوده احراز هویت، این متد فقط پیام‌های عمومی را در یک فاصله برمی‌گرداند. این شامل پیام‌های خصوصی نمی‌شود.
  • احراز هویت کاربر با یکی از حوزه‌های مجوز زیر:

    • 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
  • https://www.googleapis.com/auth/chat.app.messages.readonly

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

واکنش‌های فهرست

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

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

آیتم‌های بخش فهرست

rpc ListSectionItems( ListSectionItemsRequest ) returns ( ListSectionItemsResponse )

موارد موجود در یک بخش را فهرست می‌کند.

فقط فاصله‌ها می‌توانند آیتم‌های بخش باشند. برای جزئیات بیشتر، به «ایجاد و سازماندهی بخش‌ها در گوگل چت» مراجعه کنید.

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

  • https://www.googleapis.com/auth/chat.users.sections
  • https://www.googleapis.com/auth/chat.users.sections.readonly
دامنه‌های مجوز

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

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

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

فهرست بخش‌ها

rpc ListSections( ListSectionsRequest ) returns ( ListSectionsResponse )

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

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

  • https://www.googleapis.com/auth/chat.users.sections
  • https://www.googleapis.com/auth/chat.users.sections.readonly
دامنه‌های مجوز

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

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

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

رویدادهای ListSpace

rpc ListSpaceEvents( ListSpaceEventsRequest ) returns ( ListSpaceEventsResponse )

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

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

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

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

    • 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

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

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

دامنه‌های مجوز

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

  • https://www.googleapis.com/auth/chat.app.memberships
  • https://www.googleapis.com/auth/chat.app.memberships.readonly
  • https://www.googleapis.com/auth/chat.app.messages.readonly
  • https://www.googleapis.com/auth/chat.app.spaces
  • https://www.googleapis.com/auth/chat.app.spaces.readonly
  • https://www.googleapis.com/auth/chat.app.all.messages.readonly
  • https://www.googleapis.com/auth/chat.app.all.spaces.readonly
  • https://www.googleapis.com/auth/chat.app.all.memberships.readonly
  • 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

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

لیست‌اسپیس‌ها

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 MarkAsActive( MarkAsActiveRequest ) returns ( Availability )

کاربر را در گوگل چت به عنوان ACTIVE علامت‌گذاری می‌کند.

وضعیت دسترسی کاربر را روی ACTIVE تنظیم می‌کند. وضعیت ACTIVE تا زمان انقضای مشخص شده ادامه می‌یابد و در آن زمان وضعیت کاربر به AWAY تبدیل می‌شود. توجه داشته باشید که اگر کاربر به طور فعال از Chat استفاده کند، مدت زمان وضعیت ACTIVE ممکن است فراتر از انقضای ارائه شده باشد.

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

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

  • https://www.googleapis.com/auth/chat.users.availability
دامنه‌های مجوز

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

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

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

MarkAsAway

rpc MarkAsAway( MarkAsAwayRequest ) returns ( Availability )

کاربر را در Google Chat به عنوان AWAY علامت‌گذاری می‌کند.

وضعیت کاربر را روی حالت «دور از دسترس» (out) قرار می‌دهد و تحت تأثیر فعالیت کاربر قرار نمی‌گیرد.

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

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

  • https://www.googleapis.com/auth/chat.users.availability
دامنه‌های مجوز

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

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

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

علامت‌گذاری‌شده به عنوان مزاحم نشوید

rpc MarkAsDoNotDisturb( MarkAsDoNotDisturbRequest ) returns ( Availability )

کاربر را در چت گوگل به عنوان DO_NOT_DISTURB علامت‌گذاری می‌کند.

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

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

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

  • https://www.googleapis.com/auth/chat.users.availability
دامنه‌های مجوز

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

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

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

آیتم بخش را جابجا کنید

rpc MoveSectionItem( MoveSectionItemRequest ) returns ( MoveSectionItemResponse )

یک آیتم را از یک بخش به بخش دیگر منتقل می‌کند. برای مثال، اگر یک بخش حاوی فاصله باشد، می‌توان از این روش برای انتقال یک فاصله به بخش دیگری استفاده کرد. برای جزئیات بیشتر، به «ایجاد و سازماندهی بخش‌ها در گوگل چت» مراجعه کنید.

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

  • https://www.googleapis.com/auth/chat.users.sections
دامنه‌های مجوز

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

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

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

بخش موقعیت

rpc PositionSection( PositionSectionRequest ) returns ( PositionSectionResponse )

ترتیب مرتب‌سازی یک بخش را تغییر می‌دهد. برای جزئیات بیشتر، به «ایجاد و سازماندهی بخش‌ها در Google Chat» مراجعه کنید.

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

  • https://www.googleapis.com/auth/chat.users.sections
دامنه‌های مجوز

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

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

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

کارت‌های پیام جایگزین

rpc ReplaceMessageCards( ReplaceMessageCardsRequest ) returns ( ReplaceMessageCardsResponse )

جایگزین کارت‌های موجود در یک پیام می‌شود.

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

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

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

دامنه‌های مجوز

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

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

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

جستجوی پیام‌ها

rpc SearchMessages( SearchMessagesRequest ) returns ( SearchMessagesResponse )

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

برای جستجو در تمام فضاهایی که کاربر به آنها دسترسی دارد، parent برابر با spaces/- قرار دهید. استفاده از هر مقدار دیگری برای parent منجر به خطای INVALID_ARGUMENT می‌شود. فیلد name پیام‌های برگشتی با نام کامل منبع پر شده است که شامل space خاصی است که پیام در آن قرار دارد.

این API همه انواع پیام‌ها را برنمی‌گرداند. انواع پیام‌های فهرست‌شده در زیر در پاسخ گنجانده نشده‌اند. ListMessages برای فهرست کردن همه پیام‌ها استفاده کنید.

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

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

  • 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

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

فضاهای جستجو

rpc SearchSpaces( SearchSpacesRequest ) returns ( SearchSpacesResponse )

فهرستی از فضاها را در یک سازمان‌دهی Google Workspace برمی‌گرداند. برای مثال، به «جستجو و مدیریت فضاها» مراجعه کنید.

وقتی use_admin_access روی false تنظیم شود، نتایج به فضاهایی محدود می‌شوند که کاربر فراخوانی‌کننده، عضو پیوسته باشد. برای جستجو با امتیازات مدیر، use_admin_access را روی true تنظیم کنید.

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

دامنه‌های مجوز

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

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

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

فضای راه اندازی

rpc SetUpSpace( SetUpSpaceRequest ) returns ( Space )

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

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

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

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

برای ایجاد یک پیام مستقیم (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 UpdateAvailability( UpdateAvailabilityRequest ) returns ( Availability )

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

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

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

  • https://www.googleapis.com/auth/chat.users.availability
دامنه‌های مجوز

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

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

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

عضویت را به‌روزرسانی کنید

rpc UpdateMembership( UpdateMembershipRequest ) returns ( Membership )

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

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

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

    • 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

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

پیام به‌روزرسانی

rpc UpdateMessage( UpdateMessageRequest ) returns ( Message )

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

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

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

    • 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

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

بخش به‌روزرسانی

rpc UpdateSection( UpdateSectionRequest ) returns ( Section )

یک بخش را به‌روزرسانی می‌کند. فقط بخش‌هایی از نوع CUSTOM_SECTION می‌توانند به‌روزرسانی شوند. برای جزئیات بیشتر، به «ایجاد و سازماندهی بخش‌ها در Google Chat» مراجعه کنید.

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

  • https://www.googleapis.com/auth/chat.users.sections
دامنه‌های مجوز

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

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

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

به‌روزرسانی فضا

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

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

تنظیمات اعلان به‌روزرسانی‌فضا

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

فهرستی از دکمه‌ها.

اکشن‌ریسپشن

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

فیلدها
type

ResponseType

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

url

string

فقط ورودی. آدرس اینترنتی برای تأیید اعتبار یا پیکربندی کاربران. (فقط برای انواع پاسخ REQUEST_CONFIG .)

dialog_action

DialogAction

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

updated_widget

UpdatedWidget

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

نوع پاسخ

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

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

موارد انتخابی

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

فیلدها
items[]

SelectionItem

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

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

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

فیلدها
widget

string

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

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

SelectionItems

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

وضعیت اقدام

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

فیلدها
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

طول زیررشته در متن پیام متنی ساده که این حاشیه‌نویسی با آن مطابقت دارد. در صورت عدم وجود، طول 0 را نشان می‌دهد.

start_index

int32

اندیس شروع (مبتنی بر 0، شامل) در بدنه پیام متنی ساده که این حاشیه‌نویسی با آن مطابقت دارد.

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

UserMentionMetadata

فراداده‌های مربوط به ذکر نام کاربر.

slash_command

SlashCommandMetadata

فراداده برای یک دستور اسلش.

custom_emoji_metadata

CustomEmojiMetadata

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

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

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

انوم‌ها
ANNOTATION_TYPE_UNSPECIFIED مقدار پیش‌فرض برای enum. استفاده نکنید.
USER_MENTION یک کاربر ذکر شده است.
SLASH_COMMAND یک دستور اسلش (/) فراخوانی می‌شود.
CUSTOM_EMOJI یک حاشیه‌نویسی ایموجی سفارشی.

فراداده‌ی AppCommand

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

فیلدها
app_command_id

int32

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

app_command_type

AppCommandType

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

نوع دستور App

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

انوم‌ها
APP_COMMAND_TYPE_UNSPECIFIED مقدار پیش‌فرض. نامشخص.
SLASH_COMMAND یک دستور اسلش. کاربر دستور را در یک پیام چت ارسال می‌کند.
QUICK_COMMAND یک دستور سریع. کاربر دستور را از منوی چت در قسمت پاسخ پیام انتخاب می‌کند.
MESSAGE_ACTION یک اقدام پیام. کاربر دستور را از منوی زمینه پیام در چت انتخاب می‌کند.

گیف پیوست شده

یک تصویر 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

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

source

Source

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

فیلد Union data_ref . ارجاع داده به پیوست. data_ref فقط می‌تواند یکی از موارد زیر باشد:
attachment_data_ref

AttachmentDataRef

اختیاری. ارجاع به داده‌های پیوست. این فیلد برای ایجاد یا به‌روزرسانی پیام‌های دارای پیوست یا با استفاده از API رسانه برای دانلود داده‌های پیوست استفاده می‌شود.

drive_data_ref

DriveDataRef

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

منبع

منبع پیوست.

انوم‌ها
SOURCE_UNSPECIFIED رزرو شده.
DRIVE_FILE فایل، فایل گوگل درایو است.
UPLOADED_CONTENT فایل در چت آپلود شد.

اطلاعات پیوست

ارجاع به داده‌های پیوست.

فیلدها
resource_name

string

اختیاری. نام منبع داده‌های پیوست. این فیلد با API رسانه برای دانلود داده‌های پیوست استفاده می‌شود.

attachment_upload_token

string

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

مخاطب

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

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

فیلدها
name

string

نام منبع مخاطب هدف که می‌تواند فضا را کشف کند یا به آن بپیوندد. برای جزئیات بیشتر، به «قابل کشف کردن یک فضا برای مخاطب هدف» مراجعه کنید. قالب: audiences/{audience}

برای استفاده از مخاطب هدف پیش‌فرض برای سازمان‌دهی Google Workspace، گزینه audiences/default را تنظیم کنید.

در دسترس بودن

اطلاعات در دسترس بودن فعلی کاربر در Google Chat، از جمله وضعیت او (مثلاً فعال، دور از دسترس، مزاحم نشوید) و هرگونه وضعیت سفارشی را نشان می‌دهد.

فیلدها
name

string

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

قالب: users/{user}/availability

{user} شناسه‌ی Person در People API یا Admin SDK directory API است. برای مثال، users/123456789 .

آدرس ایمیل کاربر یا me نیز می‌تواند به عنوان نام مستعار برای اشاره به تماس‌گیرنده استفاده شود. برای مثال، users/user@example.com یا users/me .

state

State

فقط خروجی. وضعیت فعلی دسترسی کاربر.

custom_status

CustomStatus

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

فیلد اتحادیه state_metadata . متادیتای اضافی مرتبط با وضعیت در دسترس بودن کاربر. state_metadata فقط می‌تواند یکی از موارد زیر باشد:
do_not_disturb_metadata

DoNotDisturbMetadata

فقط خروجی. فراداده در صورتی که وضعیت کاربر روی DO_NOT_DISTURB تنظیم شده باشد.

ایالت

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

انوم‌ها
STATE_UNSPECIFIED مقدار پیش‌فرض. وضعیت نامشخص است.
ACTIVE بر اساس فعالیت‌های اخیر، کاربر در حال حاضر فعال است.
IDLE کاربر در حال حاضر بیکار است. این وضعیت نشان دهنده یک دوره عدم فعالیت پس از فعال بودن، قبل از انتقال بالقوه به حالت OUTY است.
AWAY کاربر در حال حاضر غایب است. این وضعیت می‌تواند یا به صورت خودکار پس از مدتی عدم فعالیت در حالت فعال یا غیرفعال تنظیم شود، یا می‌تواند به صورت دستی توسط کاربر تنظیم شود. در صورت تنظیم دستی از طریق MarkAsAway ، این وضعیت صرف نظر از فعالیت کاربر ادامه می‌یابد.
DO_NOT_DISTURB کاربر در حالت «مزاحم نشوید» است که به صورت دستی تنظیم شده است.

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

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

فیلدها
calendar_id

string

شناسه تقویم تقویم پیوند داده شده.

event_id

string

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

کارت با شناسه

کارتی در یک پیام گوگل چت.

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

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

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

سازنده کارت را باز کنید

فیلدها
card_id

string

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

card

Card

یک کارت. حداکثر اندازه ۳۲ کیلوبایت.

ChatSpaceLinkData

داده‌ها برای لینک‌های فضای چت.

فیلدها
space

string

فضای منبع فضای چت لینک شده.

قالب: spaces/{space}

thread

string

رشته‌ی منبع فضای چتِ لینک‌شده.

قالب: spaces/{space}/threads/{thread}

message

string

پیام منبع فضای چت لینک‌شده.

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

استناد

استنادها، ارجاعات درون‌خطی هستند که می‌توانند اطلاعات دقیق‌تری در مورد ارجاع درون‌خطی در اختیار کاربران قرار دهند. ارجاعات درون‌خطی مربوطه باید در متن پیام با فرمت نشانه‌گذاری <chat-citation data-id="{id}">{text}</chat-citation> وجود داشته باشند. استنادها فقط زمانی پشتیبانی می‌شوند که markup_syntax پیام روی MARKDOWN تنظیم شده باشد.

استنادهای بدون مرجع در Elements.citations (آن‌هایی که فاقد برچسب <chat-citation> منطبق در متن پیام هستند) نادیده گرفته می‌شوند و باعث رد شدن پیام نمی‌شوند.

فیلدها
id

string

الزامی. شناسه تعریف‌شده توسط برنامه. باید فقط شامل حروف و اعداد ASCII و کمتر از ۶۳ کاراکتر باشد.

cited_sources[]

CitedSource

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

منبع ذکر شده

ارجاع به یک منبع اطلاعات.

فیلدها
title

string

الزامی. عنوان متن ساده‌ی CitedSource . این فیلد از قالب‌بندی پشتیبانی نمی‌کند.

uri

string

الزامی. آدرس اینترنتی (URI) که به منبعی که توسط این CitedSource به آن ارجاع داده شده است، اشاره می‌کند.

snippet

Snippet

اختیاری. قطعه کدی که حاوی اطلاعات مستقیماً از منبع است.

footer

Footer

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

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

فیلدها
text

string

اختیاری. متنی که قرار است در پاورقی نمایش داده شود.

قطعه کد

یک شیء قطعه کد که گزیده‌ای از یک مجموعه داده بزرگتر را نشان می‌دهد.

فیلدها
text

string

اختیاری. گزیده‌ای کوتاه از متن ساده که مستقیماً از مجموعه داده‌ها گرفته شده و ممکن است در چت رندر شود. از فرمت markdown پشتیبانی نمی‌کند.

image_preview

ElementsImage

اختیاری. پیش‌نمایش تصویر از قطعه کدی که به عنوان ورودی هنگام ایجاد استناد ارائه شده است.

درخواست کامل ImportSpace

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

فیلدها
name

string

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

قالب: spaces/{space}

کامل کردن ImportSpaceResponse

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

فیلدها
space

Space

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

افزودن متن به نشانه‌گذاری

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

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

کارت

کارت یک عنصر رابط کاربری است که می‌تواند شامل ویجت‌های رابط کاربری مانند متن و تصاویر باشد.

فیلدها
header

CardHeader

سربرگ کارت. سربرگ معمولاً شامل یک عنوان و یک تصویر است.

sections[]

Section

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

card_actions[]

CardAction

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

name

string

نام کارت.

کارت اکشن

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

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

فیلدها
action_label

string

برچسبی که قبلاً در آیتم منوی عملیات نمایش داده می‌شد.

on_click

OnClick

عمل onclick برای این مورد عملیاتی.

هدر کارت

فیلدها
title

string

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

subtitle

string

عنوان فرعی سربرگ کارت.

image_style

ImageStyle

نوع تصویر (برای مثال، حاشیه مربعی یا حاشیه دایره‌ای).

image_url

string

آدرس اینترنتی (URL) تصویر در هدر کارت.

سبک تصویر

انوم‌ها
IMAGE_STYLE_UNSPECIFIED
IMAGE حاشیه مربعی.
AVATAR حاشیه دایره‌ای.

بخش

یک بخش شامل مجموعه‌ای از ویجت‌ها است که به ترتیبی که مشخص شده‌اند (به صورت عمودی) رندر می‌شوند. در تمام پلتفرم‌ها، کارت‌ها عرض ثابت و باریکی دارند، بنابراین در حال حاضر نیازی به ویژگی‌های طرح‌بندی (مثلاً float) نیست.

فیلدها
header

string

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

widgets[]

WidgetMarkup

یک بخش باید حداقل شامل یک ویجت باشد.

درخواست ایجاد ایموجی سفارشی

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

فیلدها
custom_emoji

CustomEmoji

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

درخواست عضویت

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

فیلدها
parent

string

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

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

membership

Membership

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

فیلد memberType باید شامل یک کاربر باشد که فیلدهای user.name و user.type آن پر شده باشد. سرور یک نام منبع اختصاص می‌دهد و هر چیزی که مشخص شده باشد را بازنویسی می‌کند.

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

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

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

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

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

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

use_admin_access

bool

اختیاری. وقتی true ، متد با استفاده از امتیازات مدیر Google Workspace کاربر اجرا می‌شود.

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

به دامنه OAuth 2.0 مربوط به chat.admin.memberships نیاز دارد.

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

گزینه‌های اعلان ایجادپیام

گزینه‌هایی برای رفتار اعلان هنگام ارسال پیام.

فیلدها
notification_type

NotificationType

نوع اعلان برای پیام.

نوع اعلان

گزینه‌های نوع اعلان برای پیام.

انوم‌ها
NOTIFICATION_TYPE_NONE رفتار پیش‌فرض. رفتار اعلان مشابه زمانی است که کاربر انسانی پیام را با استفاده از رابط کاربری چت ارسال می‌کند: هیچ اعلانی به فرستنده انسانی ارسال نمی‌شود.
NOTIFICATION_TYPE_FORCE_NOTIFY

دریافت‌کنندگان را مجبور به دریافت اعلان کنید. این گزینه تنظیمات اعلان فضای کاربران و تنظیمات «مزاحم نشوید چت» را نادیده می‌گیرد. این گزینه تنظیمات «مزاحم نشوید» در سطح دستگاه را نادیده نمی‌گیرد.

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

NOTIFICATION_TYPE_SILENT

به گیرندگان اطلاع ندهید و پیام را به عنوان خوانده نشده علامت گذاری نکنید. این کار مشابه بی‌صدا کردن مکالمه یا فعال کردن حالت «مزاحم نشوید» توسط کاربر است.

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

درخواست ایجادپیامپین

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

فیلدها
parent

string

الزامی. فضای والد که پین ​​پیام در آن ایجاد می‌شود. قالب: spaces/{space}

message_pin

MessagePin

الزامی. پین پیام برای ایجاد.

درخواست ایجاد پیام

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

فیلدها
parent

string

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

قالب: spaces/{space}

message

Message

الزامی. متن پیام.

thread_key
(deprecated)

string

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

request_id

string

اختیاری. یک شناسه منحصر به فرد برای این درخواست. یک UUID تصادفی توصیه می‌شود. تعیین شناسه درخواست، درخواست را به صورت خودتوان (idempotent) در می‌آورد، که تضمین می‌کند چندین درخواست یکسان با شناسه درخواست یکسان، فقط منجر به ایجاد یک پیام واحد می‌شوند. درخواست‌های بعدی با شناسه درخواست یکسان، پیام موجود را برمی‌گردانند و پیام را به‌روزرسانی نمی‌کنند، حتی اگر جزئیات درخواستی با وضعیت فعلی متفاوت باشد.

برای استفاده موثر از این فیلد:

  • اطمینان حاصل کنید که درخواست‌های بعدی یکسان هستند و از همان اعتبارنامه‌های احراز هویت درخواست اصلی استفاده می‌کنند.
  • اگر پیامی از قبل با شناسه درخواست ارائه شده ایجاد شده باشد، درخواست آن پیام را برمی‌گرداند. توجه داشته باشید که پیام برگردانده شده ممکن است به طور کامل پر نشده باشد؛ API پیام موجود در درخواست شما را با نام‌های منابع اختصاص داده شده توسط سیستم پر می‌کند. برای بازیابی آخرین فراداده برای پیام، GetMessage را فراخوانی کنید.
  • استفاده مجدد از یک شناسه درخواست موجود با یک کاربر احراز هویت شده متفاوت منجر به خطا می‌شود.
message_reply_option

MessageReplyOption

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

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

message_id

string

اختیاری. یک شناسه سفارشی برای یک پیام. به برنامه‌های چت اجازه می‌دهد بدون نیاز به ذخیره شناسه اختصاص داده شده توسط سیستم در نام منبع پیام (که در فیلد name پیام نمایش داده می‌شود)، پیام را دریافت، به‌روزرسانی یا حذف کنند.

مقدار این فیلد باید شرایط زیر را داشته باشد:

  • با client- شروع می‌شود. برای مثال، client-custom-name یک شناسه سفارشی معتبر است، اما custom-name نیست.
  • شامل حداکثر ۶۳ کاراکتر و فقط حروف کوچک، اعداد و خط فاصله باشد.
  • در یک فضا منحصر به فرد است. یک برنامه چت نمی‌تواند از یک شناسه سفارشی برای پیام‌های مختلف استفاده کند.

برای جزئیات، به «نام‌گذاری یک پیام» مراجعه کنید.

create_message_notification_options

CreateMessageNotificationOptions

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

گزینه پاسخ به پیام

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

انوم‌ها
MESSAGE_REPLY_OPTION_UNSPECIFIED پیش‌فرض. یک رشته جدید را شروع می‌کند. استفاده از این گزینه هرگونه thread ID یا thread_key که شامل شود را نادیده می‌گیرد.
REPLY_MESSAGE_FALLBACK_TO_NEW_THREAD پیام را به عنوان پاسخی به رشته‌ی مشخص شده توسط thread ID یا thread_key ایجاد می‌کند. در صورت عدم موفقیت، پیام به جای آن یک رشته‌ی جدید را شروع می‌کند.
REPLY_MESSAGE_OR_FAIL پیام را به عنوان پاسخی به رشته‌ی مشخص شده توسط thread ID یا thread_key ایجاد می‌کند. اگر از thread_key جدید استفاده شود، یک رشته‌ی جدید ایجاد می‌شود. اگر ایجاد پیام با شکست مواجه شود، به جای آن خطای NOT_FOUND برگردانده می‌شود.

درخواست واکنش ایجاد کنید

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

فیلدها
parent

string

الزامی. پیامی که واکنش در آن ایجاد می‌شود.

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

reaction

Reaction

الزامی. واکنش به خلق کردن.

درخواست ایجادبخش

درخواست پیام برای ایجاد بخش

فیلدها
parent

string

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

قالب: users/{user}

section

Section

الزامی. بخشی که باید ایجاد شود.

درخواست ایجاد فضا

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

فیلدها
space

Space

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

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

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

request_id

string

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

برای استفاده موثر از این فیلد:

  • اطمینان حاصل کنید که درخواست‌های بعدی یکسان هستند و از همان اعتبارنامه‌های احراز هویت درخواست اصلی استفاده می‌کنند.
  • اگر فضایی از قبل با شناسه درخواست ارائه شده ایجاد شده باشد، درخواست آن فضا را برمی‌گرداند. توجه داشته باشید که فضای برگردانده شده ممکن است به طور کامل پر نشده باشد؛ API فضای موجود در درخواست شما را با نام منبع اختصاص داده شده توسط سیستم پر می‌کند. برای بازیابی آخرین فراداده برای فضا، GetSpace را فراخوانی کنید.
  • استفاده مجدد از یک شناسه درخواست موجود با یک کاربر احراز هویت شده متفاوت منجر به خطا می‌شود.

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

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

فیلدها
name

string

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

قالب: customEmojis/{customEmoji}

uid

string

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

emoji_name

string

اختیاری. تغییرناپذیر. نامی که توسط کاربر برای ایموجی سفارشی ارائه می‌شود و در سازمان منحصر به فرد است.

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

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

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

temporary_image_uri

string

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

payload

CustomEmojiPayload

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

بارگیری سفارشی ایموجی

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

فیلدها
file_content

bytes

الزامی. فقط ورودی. تصویر مورد استفاده برای ایموجی سفارشی.

حجم فایل ارسالی باید کمتر از ۲۵۶ کیلوبایت و ابعاد تصویر باید مربعی و بین ۶۴ تا ۵۰۰ پیکسل باشد. محدودیت‌ها ممکن است تغییر کنند.

filename

string

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

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

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

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

فیلدها
custom_emoji

CustomEmoji

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

وضعیت سفارشی

وضعیت سفارشی کاربر را در گوگل چت نشان می‌دهد. این شامل یک پیام متنی کوتاه با یک ایموجی اختیاری است که کاربر برای ارائه اطلاعات بیشتر در مورد در دسترس بودن خود تنظیم می‌کند.

فیلدها
text

string

الزامی. متن وضعیت سفارشی. این یک رشته با حداکثر طول ۶۴ خواهد بود.

emoji

Emoji

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

expiration فیلد Union. زمان انقضای وضعیت سفارشی. می‌تواند به صورت یک مهر زمانی مطلق یا یک مدت زمان مشخص شود. expiration فقط می‌تواند یکی از موارد زیر باشد:
expire_time

Timestamp

مهر زمانی که وضعیت سفارشی منقضی می‌شود.

ttl

Duration

فقط ورودی. مدت زمان ماندگاری که پس از آن وضعیت سفارشی منقضی می‌شود.

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

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

فیلدها
name

string

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

قالب: customEmojis/{customEmoji}

می‌توانید از نام ایموجی به عنوان نام مستعار برای {customEmoji} استفاده کنید. برای مثال، customEmojis/:example-emoji: که :example-emoji: نام ایموجی برای یک ایموجی سفارشی است.

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

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

فیلدها
name

string

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

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

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

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

use_admin_access

bool

اختیاری. وقتی true ، متد با استفاده از امتیازات مدیر Google Workspace کاربر اجرا می‌شود.

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

به دامنه OAuth 2.0 مربوط به chat.admin.memberships نیاز دارد.

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

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

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

فیلدها
name

string

الزامی. نام منبع پین پیام برای حذف. قالب: space/{space}/messagePins/{message_pin}

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

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

فیلدها
name

string

الزامی. نام منبع پیام.

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

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

force

bool

اختیاری. وقتی true ، حذف یک پیام، پاسخ‌های رشته‌ای آن را نیز حذف می‌کند. وقتی مقدار آن false ، اگر پیامی دارای پاسخ‌های رشته‌ای باشد، حذف ناموفق خواهد بود.

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

درخواست واکنش حذف

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

فیلدها
name

string

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

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

درخواست حذف بخش

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

فیلدها
name

string

الزامی. نام بخشی که باید حذف شود.

قالب: users/{user}/sections/{section}

درخواست حذف فضا

درخواست حذف فاصله

فیلدها
name

string

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

قالب: spaces/{space}

use_admin_access

bool

اختیاری. وقتی true ، متد با استفاده از امتیازات مدیر Google Workspace کاربر اجرا می‌شود.

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

به دامنه OAuth 2.0 مربوط به chat.admin.delete نیاز دارد.

حذففراداده

اطلاعات مربوط به پیام حذف شده. یک پیام زمانی حذف می‌شود که delete_time تنظیم شده باشد.

فیلدها
deletion_type

DeletionType

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

نوع حذف

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

انوم‌ها
DELETION_TYPE_UNSPECIFIED این مقدار بلااستفاده است.
CREATOR کاربر پیام خودش را حذف کرد.
SPACE_OWNER مالک یا مدیر، پیام را حذف کرد.
ADMIN یکی از مدیران Google Workspace پیام را حذف کرد. مدیران می‌توانند هر پیامی را در این فضا، از جمله پیام‌های ارسال شده توسط هر یک از اعضای فضا یا برنامه چت، حذف کنند.
APP_MESSAGE_EXPIRY یک برنامه چت، پیام خود را پس از انقضا حذف کرد.
CREATOR_VIA_APP یک برنامه چت، پیام را از طرف سازنده (با استفاده از احراز هویت کاربر) حذف کرد.
SPACE_OWNER_VIA_APP یک برنامه چت، پیام را از طرف یک مدیر فضا (با استفاده از احراز هویت کاربر) حذف کرد.
SPACE_MEMBER یکی از اعضای این فضا پیام را حذف کرد. کاربران می‌توانند پیام‌های ارسال شده توسط برنامه‌ها را حذف کنند.

گفتگو

دور بدنه‌ی کارتِ دیالوگ را می‌پوشاند.

فیلدها
body

Card

فقط ورودی. بدنه‌ی دیالوگ، که در یک ماژول رندر می‌شود. برنامه‌های گوگل چت از موجودیت‌های کارت زیر پشتیبانی نمی‌کنند: DateTimePicker ، OnChangeAction .

دیالوگ اکشن

شامل یک کادر محاوره‌ای و کد وضعیت درخواست است.

فیلدها
action_status

ActionStatus

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

action میدانی اتحادیه. اقدامی که باید انجام شود. action می‌تواند فقط یکی از موارد زیر باشد:
dialog

Dialog

فقط ورودی. کادر محاوره‌ای برای درخواست.

مزاحم نشویدفراداده

فراداده مرتبط با وضعیت در دسترس بودن DO_NOT_DISTURB ، که مشخص می‌کند وضعیت مورد نظر چه زمانی منقضی می‌شود.

فیلدها
expiration_time

Timestamp

فقط خروجی. مهر زمانی که تا آن زمان کاربر باید به عنوان DO_NOT_DISTURB علامت گذاری شود. این حداکثر می‌تواند ۱ سال آینده باشد.

درایودیتارف

ارجاعی به داده‌های یک فایل پیوست درایو.

فیلدها
drive_file_id

string

شناسه فایل درایو. از آن به همراه Drive API استفاده کنید.

درایولینک دیتا

داده‌های مربوط به لینک‌های گوگل درایو.

فیلدها
drive_data_ref

DriveDataRef

یک DriveDataRef که به یک فایل گوگل درایو ارجاع می‌دهد.

mime_type

string

نوع MIME منبع گوگل درایو لینک‌شده.

عناصر

عناصر، اجزای اضافی هستند که ممکن است با متن پیام ارائه شده در هنگام ایجاد پیام مرتبط باشند یا نباشند.

فیلدها
cited_sources[]

CitedSource

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

citations[]

Citation

فهرستی از ارجاعات درون‌خطی که در متن پیام (از طریق تگ‌های <chat-citation> ) به آن‌ها ارجاع داده شده و به صورت کارت‌های شناور تعاملی نمایش داده می‌شوند.

عناصرتصویر

یک شیء که روش‌های مختلف نمایش یک تصویر را در خود جای داده است. نمایش‌های پشتیبانی‌شده‌ی فعلی: - تصویری که از یک URI گرفته شده است. نمایش‌های اضافی ممکن است در آینده پشتیبانی شوند.

فیلدها
image فیلد Union. الزامی. یکی از نمایش‌های تصویر پشتیبانی شده. image می‌تواند فقط یکی از موارد زیر باشد:
image_uri

string

الزامی. یک URL با دسترسی عمومی برای یک تصویر.

ایموجی

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

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

string

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

custom_emoji

CustomEmoji

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

خلاصه واکنش ایموجی

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

فیلدها
emoji

Emoji

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

reaction_count

int32

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

درخواست پیام مستقیم را پیدا کنید

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

فیلدها
name

string

الزامی. نام منبعی که کاربر باید با آن پیام مستقیم را پیدا کند.

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

درخواست چت‌های گروهی

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

فیلدها
users[]

string

اختیاری. نام منابع همه کاربران انسانی در چت گروهی با کاربر تماس گیرنده. برنامه‌های چت را نمی‌توان در درخواست گنجاند.

حداکثر تعداد کاربرانی که می‌توانند در یک درخواست واحد مشخص شوند، 49 است.

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

page_size

int32

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

اگر مشخص نشده باشد، حداکثر 10 فاصله برگردانده می‌شود.

حداکثر مقدار ۳۰ است. اگر از مقداری بیشتر از ۳۰ استفاده کنید، به طور خودکار به ۳۰ تغییر می‌کند.

مقادیر منفی خطای INVALID_ARGUMENT را برمی‌گردانند.

page_token

string

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

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

space_view

SpaceView

نوع نمای فضای درخواستی. در صورت عدم تنظیم، پیش‌فرض روی SPACE_VIEW_RESOURCE_NAME_ONLY است. درخواست‌هایی که SPACE_VIEW_EXPANDED را مشخص می‌کنند باید شامل محدوده‌هایی باشند که امکان خواندن داده‌های فضا را فراهم می‌کنند، برای مثال، https://www.googleapis.com/auth/chat.spaces یا https://www.googleapis.com/auth/chat.spaces.readonly .

یافتن گروه‌ها، گفتگوها، پاسخ

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

فیلدها
spaces[]

Space

فهرست فضاهای موجود در صفحه درخواستی (یا صفحه اول).

next_page_token

string

یک توکن که می‌توانید به عنوان pageToken برای بازیابی صفحه بعدی نتایج ارسال کنید. اگر خالی باشد، صفحات بعدی وجود ندارند.

فراداده‌ی ارسال‌شده

فراداده‌ای درباره فضای مبدأ که پیام از آن ارسال شده است.

فیلدها
space

string

فقط خروجی. نام منبع فضای منبع. قالب: spaces/{space}

space_display_name

string

فقط خروجی. نام نمایشی فضای مبدا یا DM در زمان ارسال. برای SPACE ، این نام فضا است. برای DIRECT_MESSAGE ، این نام شرکت‌کننده دیگر است (مثلاً "کاربر A"). برای GROUP_CHAT ، این یک نام تولید شده بر اساس نام کوچک اعضا است که به 5 عدد شامل سازنده محدود می‌شود (مثلاً "کاربر A، کاربر B").

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

Request to get an attachment.

فیلدها
name

string

Required. Resource name of the attachment, in the form spaces/{space}/messages/{message}/attachments/{attachment} .

GetAvailabilityRequest

Request message for the GetAvailability method.

فیلدها
name

string

Required. The resource name of the availability to retrieve.

Format: users/{user}/availability

{user} is the id for the Person in the People API or Admin SDK directory API. For example, users/123456789 .

The user's email address or me can also be used as an alias to refer to the caller. For example, users/user@example.com or users/me .

GetCustomEmojiRequest

A request to return a single custom emoji.

فیلدها
name

string

Required. Resource name of the custom emoji.

Format: customEmojis/{customEmoji}

You can use the emoji name as an alias for {customEmoji} . For example, customEmojis/:example-emoji: where :example-emoji: is the emoji name for a custom emoji.

GetMembershipRequest

Request to get a membership of a space.

فیلدها
name

string

Required. Resource name of the membership to retrieve.

To get the app's own membership by using user authentication , you can optionally use spaces/{space}/members/app .

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

You can use the user's email as an alias for {member} . For example, spaces/{space}/members/example@gmail.com where example@gmail.com is the email of the Google Chat user.

use_admin_access

bool

Optional. 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 or chat.admin.memberships.readonly OAuth 2.0 scopes .

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

GetMessageRequest

Request to get a message.

فیلدها
name

string

Required. Resource name of the message.

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

If you've set a custom ID for your message, you can use the value from the clientAssignedMessageId field for {message} . For details, see Name a message .

GetSpaceEventRequest

Request message for getting a space event.

فیلدها
name

string

Required. The resource name of the space event.

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

GetSpaceNotificationSettingRequest

Request message to get space notification setting. Only supports getting notification setting for the calling user.

فیلدها
name

string

Required. Format: users/{user}/spaces/{space}/spaceNotificationSetting

  • users/me/spaces/{space}/spaceNotificationSetting , OR
  • users/user@example.com/spaces/{space}/spaceNotificationSetting , OR
  • users/123456789/spaces/{space}/spaceNotificationSetting . Note: Only the caller's user id or email is allowed in the path.

GetSpaceReadStateRequest

Request message for GetSpaceReadState API.

فیلدها
name

string

Required. Resource name of the space read state to retrieve.

Only supports getting 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

GetSpaceRequest

A request to return a single space.

فیلدها
name

string

Required. Resource name of the space, in the form spaces/{space} .

Format: spaces/{space}

use_admin_access

bool

Optional. 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 or chat.admin.spaces.readonly OAuth 2.0 scopes .

GetThreadReadStateRequest

Request message for GetThreadReadStateRequest API.

فیلدها
name

string

Required. Resource name of the thread read state to retrieve.

Only supports getting 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}/threads/{thread}/threadReadState .

  • Their Workspace email address. For example, users/user@example.com/spaces/{space}/threads/{thread}/threadReadState .

  • Their user id. For example, users/123456789/spaces/{space}/threads/{thread}/threadReadState .

Format: users/{user}/spaces/{space}/threads/{thread}/threadReadState

گروه

A Google Group in Google Chat.

فیلدها
name

string

Resource name for a Google Group.

Represents a group in Cloud Identity Groups API.

Format: groups/{group}

HistoryState

The history state for messages and spaces. Specifies how long messages and conversation threads are kept after creation.

Enums
HISTORY_STATE_UNSPECIFIED Default value. Do not use.
HISTORY_OFF History off. Messages and threads are kept for 24 hours .
HISTORY_ON History on. The organization's Vault retention rules specify for how long messages and threads are kept.

ListCustomEmojisRequest

A request to return a list of custom emojis.

فیلدها
page_size

int32

Optional. The maximum number of custom emojis returned. The service can return fewer custom emojis 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

Optional. (If resuming from a previous query.)

A page token received from a previous list custom emoji 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

Optional. A query filter.

Supports filtering by creator.

To filter by creator, you must specify a valid value. Currently only creator("users/me") and NOT creator("users/me") are accepted to filter custom emojis by whether they were created by the calling user or not.

For example, the following query returns custom emojis created by the caller:

creator("users/me")

Invalid queries are rejected with an INVALID_ARGUMENT error.

ListCustomEmojisResponse

A response to list custom emojis.

فیلدها
custom_emojis[]

CustomEmoji

Unordered list. List of custom emojis.

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.

ListMembershipsRequest

Request message for listing memberships.

فیلدها
parent

string

Required. The resource name of the space for which to fetch a membership list.

Format: spaces/{space}

page_size

int32

Optional. The maximum number of memberships to return. The service might return fewer than this value.

If unspecified, at most 100 memberships are returned.

The maximum value is 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

Optional. A page token, received from a previous call to list memberships. Provide this parameter to retrieve the subsequent page.

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

filter

string

Optional. A query filter.

You can filter memberships by a member's role ( role ) and type ( member.type ).

To filter by role, set role to ROLE_MEMBER or ROLE_MANAGER .

To filter by type, set member.type to HUMAN or BOT . You can also filter for member.type using the != operator.

To filter by both role and type, use the AND operator. To filter by either role or type, use the OR operator.

Either member.type = "HUMAN" or member.type != "BOT" is required when use_admin_access is set to true. Other member type filters will be rejected.

For example, the following queries are valid:

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

member.type != "BOT"

The following queries are invalid:

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

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

show_groups

bool

Optional. 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

Optional. When true , also returns memberships associated with invited members, in addition to other types of memberships. If a filter is set, invited memberships that don't match the filter criteria aren't returned.

Currently requires user authentication .

use_admin_access

bool

Optional. 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.

ListMessagePinsRequest

Request message for listing message pins.

فیلدها
parent

string

Required. The parent space which owns the collection of pinned items Format: spaces/{space}

page_size

int32

Optional. The maximum number of message pins returned. The service might return fewer messages than this value. The maximum value is 100. If you use a value more than 100, it's automatically changed to 100. If unspecified, at most 100 message pins will be returned. Negative values return an INVALID_ARGUMENT error.

page_token

string

Optional. A page token received from a previous list message pins 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.

ListMessagePinsResponse

Response message for listing message pins.

فیلدها
message_pins[]

MessagePin

The pinned messages from the specified space.

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.

ListMessagesRequest

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

فیلدها
parent

string

Required. The resource name of the space to list messages from.

Format: spaces/{space}

page_size

int32

Optional. 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

Optional. 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

Optional. 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

Optional. 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

Optional. 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

Required. The message users reacted to.

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

page_size

int32

Optional. The maximum number of reactions returned. The service can return fewer reactions than this value. If unspecified, the default value is 25. The maximum value is 200; values above 200 are changed to 200.

page_token

string

Optional. (If resuming from a previous query.)

A page token received from a previous list reactions call. Provide this to retrieve the subsequent page.

When paginating, the filter value should match the call that provided the page token. Passing a different value might lead to unexpected results.

filter

string

Optional. 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.

ListSectionItemsRequest

Request message for listing section items.

فیلدها
parent

string

Required. The parent, which is the section resource name that owns this collection of section items. Only supports listing section items for the calling user.

When you're filtering by space, use the wildcard - to search across all sections. For example, users/{user}/sections/- .

Format: users/{user}/sections/{section}

page_size

int32

Optional. The maximum number of section items to return. The service may return fewer than this value.

If unspecified, at most 10 section items will be returned.

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

Negative values return an INVALID_ARGUMENT error.

page_token

string

Optional. A page token, received from a previous list section items call. Provide this 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

Optional. A query filter.

Currently only supports filtering by space.

For example, space = spaces/{space} .

Invalid queries are rejected with an INVALID_ARGUMENT error.

ListSectionItemsResponse

Response message for listing section items.

فیلدها
section_items[]

SectionItem

The section items from the specified section.

next_page_token

string

A token, which can be sent as page_token to retrieve the next page. If this field is omitted, there are no subsequent pages.

ListSectionsRequest

Request message for listing sections.

فیلدها
parent

string

Required. The parent, which is the user resource name that owns this collection of sections. Only supports listing sections for the calling user. To refer to the calling user, set one of the following:

  • The me alias. For example, users/me .

  • Their Workspace email address. For example, users/user@example.com .

  • Their user id. For example, users/123456789 .

Format: users/{user}

page_size

int32

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

If unspecified, at most 10 sections will be returned.

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

Negative values return an INVALID_ARGUMENT error.

page_token

string

Optional. A page token, received from a previous list sections call. Provide this 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.

ListSectionsResponse

Response message for listing sections.

فیلدها
sections[]

Section

The sections from the specified user.

next_page_token

string

A token, which can be sent as page_token to retrieve the next page. If this field is omitted, there are no subsequent pages.

ListSpaceEventsRequest

Request message for listing space events.

فیلدها
parent

string

Required. Resource name of the Google Chat space where the events occurred.

Format: spaces/{space} .

page_size

int32

Optional. 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

Optional. 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

Required. 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

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

If unspecified, at most 100 spaces are returned.

The maximum value is 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

Optional. A page token, received from a previous list spaces call. Provide this parameter to retrieve the subsequent page.

When paginating, the filter value should match the call that provided the page token. Passing a different value may lead to unexpected results.

filter

string

Optional. 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.

MarkAsActiveRequest

Request message for the MarkAsActive method.

فیلدها
name

string

Required. The resource name of the availability to mark as active. Format: users/{user}/availability

{user} is the id for the Person in the People API or Admin SDK directory API. For example, users/123456789 .

The user's email address or me can also be used as an alias to refer to the caller. For example, users/user@example.com or users/me .

Union field expiration . The expiration for the ACTIVE availability state. The user will be marked as Away after expiration. If no expiration is provided, the ACTIVE state will expire 30 minutes from the current time. expiration can be only one of the following:
expire_time

Timestamp

The absolute timestamp when the ACTIVE state expires.

ttl

Duration

The duration from the current time until the ACTIVE state expires. Using a short TTL can effectively reset the user's state to be based on activity after this brief duration.

MarkAsAwayRequest

Request message for the MarkAsAway method.

فیلدها
name

string

Required. The resource name of the availability to mark as away. Format: users/{user}/availability

{user} is the id for the Person in the People API or Admin SDK directory API. For example, users/123456789 .

The user's email address or me can also be used as an alias to refer to the caller. For example, users/user@example.com or users/me .

MarkAsDoNotDisturbRequest

Request message for the MarkAsDoNotDisturb method.

فیلدها
name

string

Required. The resource name of the availability to mark as Do Not Disturb. Format: users/{user}/availability

{user} is the id for the Person in the People API or Admin SDK directory API. For example, users/123456789 .

The user's email address or me can also be used as an alias to refer to the caller. For example, users/user@example.com or users/me .

Union field expiration . Required. The expiration for the DND availability state. The user will be marked as Away after expiration. This can be at most 1 year from the current time. expiration can be only one of the following:
expire_time

Timestamp

The absolute timestamp when the DND state expires.

ttl

Duration

The duration from the current time until the DND state expires.

نشانه‌گذاری

Specifies the markup syntax used to format the Chat message text. Applies to the text field of the Message resource.

Enums
MARKUP_SYNTAX_UNSPECIFIED Represents the unspecified value.
MARKUP_SYNTAX_CHAT Uses Google Chat's markup syntax. See https://developers.google.com/workspace/chat/format-messages#format-texts for more information.
MARKUP_SYNTAX_MARKDOWN Uses Markdown syntax. This syntax is based on the CommonMark specification, with additional extensions. See https://developers.google.com/workspace/chat/format-messages#format-texts for more information.

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

Optional. 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

Optional. 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

Optional. 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

Optional. 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.

affiliation

Affiliation

Output only. A user's relationship to the Workspace organization that owns the space. In spaces owned by consumer accounts, the affiliation of all members is EXTERNAL .

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

Optional. 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

Optional. The Google Group the membership corresponds to.

Reading or mutating memberships for Google Groups requires user authentication .

وابستگی

Represents the affiliation of a user to the Google Workspace organization that owns the space. This enum may have more values added in the future.

Enums
AFFILIATION_UNSPECIFIED Default value. This value is unused.
INTERNAL An account managed by the same Google Workspace organization that owns the space.
EXTERNAL An account external to the Google Workspace organization that owns the space (eg, a consumer account, or an account managed by a different Workspace organization).
MANAGED_EXTERNAL An account managed by the Workspace organization that owns the space, but provisioned for a user who is external to the organization (eg, a Guest user). To learn more about guests, see https://support.google.com/chat/answer/16997417 .

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. In the Chat UI, this role is called Member.

The user has basic permissions, like sending messages to the space. Managers and owners can grant members additional permissions in a space, including:

  • Add or remove members.
  • Modify space details.
  • Turn history on or off.
  • Mention everyone in the space with @all .
  • Manage Chat apps and webhooks installed in the space.

In direct messages and unnamed group conversations, everyone has this role.

ROLE_MANAGER

A space owner. In the Chat UI, this role is called Owner.

The user has the complete set of space permissions to manage the space, including:

  • Change the role of other members in the space to member, manager, or owner.
  • Delete the space.

Only supported in SpaceType.SPACE (named spaces).

To learn more, see Learn more about your role as a space owner or manager .

ROLE_ASSISTANT_MANAGER

A space manager. In the Chat UI, this role is called Manager.

The user has all basic permissions of ROLE_MEMBER , and can be granted a subset of administrative permissions by an owner. By default, managers have all the permissions of an owner except for the ability to:

  • Delete the space.
  • Make another space member an owner.
  • Change an owner's role.

By default, managers permissions include but aren't limited to:

  • Make another member a manager.
  • Delete messages in the space.
  • Manage space permissions.
  • Receive notifications for requests to join the space if the manager has the "manage members" permission in the space settings.
  • Make a space discoverable.

Only supported in SpaceType.SPACE (named spaces).

To learn more, see Manage space settings .

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

Fields
memberships[]

MembershipUpdatedEventData

A list of updated memberships.

MembershipCreatedEventData

Event payload for a new membership.

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

Fields
membership

Membership

The new membership.

MembershipDeletedEventData

Event payload for a deleted membership.

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

Fields
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

Fields
membership

Membership

The updated membership.

پیام

A message in a Google Chat space.

Fields
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

Optional. 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

Optional. 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, bulleted list, and block quote.

  • 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.

  • Bullet list items using asterisks ( * )—for example, * item .

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

Optional. An array of cards .

Chat apps can create cards with app authentication . As part of the Developer Preview Program , if your Chat app authenticates as a user , it can create card messages. If your Chat app is not part of Developer Preview Program, it can't create cards with user authentication.

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

Design and preview cards with 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

Optional. 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

Optional. User-uploaded attachment.

matched_url

MatchedUrl

Output only. A URL in the Chat message text field 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 .

silent

bool

Output only. Whether this is a silent message. Silent messages are messages where Chat suppresses push notifications for recipients.

client_assigned_message_id

string

Optional. 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

Optional. 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

Optional. Information about a message that another message quotes.

When you create a message, you can quote messages within the same thread, or quote a root message to create a new root message. However, you can't quote a message reply from a different thread.

When you update a message, you can't add or replace the quotedMessageMetadata field, but you can remove it.

For example usage, see Quote another message .

attached_gifs[]

AttachedGif

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

accessory_widgets[]

AccessoryWidget

Optional. 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 .

elements

Elements

Optional. Elements are additional components provided during message creation that may or may not be associated with specific portions of the message text. These differ from annotations, which are output-only and offer supplementary information tied to message fragments or the entire message text.

markup_syntax

MarkupSyntax

Optional. Specifies how the server interprets the message text field content.

MessageBatchCreatedEventData

Event payload for multiple new messages.

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

Fields
messages[]

MessageCreatedEventData

A list of new messages.

MessageBatchDeletedEventData

Event payload for multiple deleted messages.

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

Fields
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

Fields
message

Message

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

MessagePin

A pin on a Chat message. For more information see Pin a message .

Fields
name

string

Identifier. The resource name of the message pin. Format: spaces/{space}/messagePins/{message_pin} The resource ID component matches the resource ID component of the message. For example, a message with spaces/AAA/messages/bbb.ccc corresponds to the message pin with the resource name spaces/AAA/messagePins/bbb.ccc .

message

string

Required. Immutable. The resource name of the message that is pinned. Format: spaces/{space}/messages/{message}

MessageUpdatedEventData

Event payload for an updated message.

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

Fields
message

Message

The updated message.

MoveSectionItemRequest

Request message for moving a section item across sections.

Fields
name

string

Required. The resource name of the section item to move.

Format: users/{user}/sections/{section}/items/{item}

target_section

string

Required. The resource name of the section to move the section item to.

Format: users/{user}/sections/{section}

MoveSectionItemResponse

Response message for moving a section item.

Fields
section_item

SectionItem

The updated section item.

PositionSectionRequest

Request message for positioning a section.

فیلدها
name

string

Required. The resource name of the section to position.

Format: users/{user}/sections/{section}

Union field position . Required. The new position of the section. position can be only one of the following:
sort_order

int32

Optional. The absolute position of the section in the list of sections. The position must be greater than 0. If the position is greater than the number of sections, the section will be appended to the end of the list. This operation inserts the section at the given position and shifts the original section at that position, and those below it, to the next position.

relative_position

Position

Optional. The relative position of the section in the list of sections.

موقعیت

The position of the section.

Enums
POSITION_UNSPECIFIED Unspecified position.
START Start of the list of sections.
END End of the list of sections.

PositionSectionResponse

Response message for positioning a section.

فیلدها
section

Section

The updated section.

QuotedMessageMetadata

Information about a message that another message quotes.

When you update a message, you can't add or replace the quotedMessageMetadata field, but you can remove it.

For example usage, see Quote another message .

Fields
name

string

Required. Resource name of the message that is quoted.

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

last_update_time

Timestamp

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

If the message was edited, use this field, last_update_time . If the message was never edited, use create_time .

If last_update_time doesn't match the latest version of the quoted message, the request fails.

quote_type

QuoteType

Optional. Specifies the quote type. If not set, defaults to REPLY in the message read/write path for backward compatibility.

quoted_message_snapshot

QuotedMessageSnapshot

Output only. A snapshot of the quoted message's content.

forwarded_metadata

ForwardedMetadata

Output only. Metadata about the source space of the quoted message. Populated only for FORWARD quote type.

QuoteType

The quote type of the quoted message.

Enums
QUOTE_TYPE_UNSPECIFIED Reserved. This value is unused.
REPLY

When quote_type is REPLY , you can do the following:

  • If you're replying in a thread, you can quote another message in that thread.

  • If you're creating a root message, you can quote another root message in that space.

FORWARD

When quote_type is FORWARD , you can quote a:

  • Message from a different space.

  • Message reply from a different thread in the same space.

QuotedMessageSnapshot

Provides a snapshot of the content of the quoted message at the time of quoting or forwarding

Fields
sender

string

Output only. The quoted message's author name. Populated for both REPLY & FORWARD quote types.

text

string

Output only. Snapshot of the quoted message's text content.

formatted_text

string

Output only. Contains the quoted message text with markups added to support rich formatting like hyperlinks,custom emojis, markup, etc. Populated only for FORWARD quote type.

annotations[]

Annotation

Output only. Annotations parsed from the text body of the quoted message. Populated only for FORWARD quote type.

attachments[]

Attachment

Output only. Attachments that were part of the quoted message. These are copies of the quoted message's attachment metadata. Populated only for FORWARD quote type.

واکنش

A reaction to a message.

Fields
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

Required. The emoji used in the reaction.

ReactionBatchCreatedEventData

Event payload for multiple new reactions.

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

Fields
reactions[]

ReactionCreatedEventData

A list of new reactions.

ReactionBatchDeletedEventData

Event payload for multiple deleted reactions.

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

Fields
reactions[]

ReactionDeletedEventData

A list of deleted reactions.

ReactionCreatedEventData

Event payload for a new reaction.

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

Fields
reaction

Reaction

The new reaction.

ReactionDeletedEventData

Event payload for a deleted reaction.

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

Fields
reaction

Reaction

The deleted reaction.

ReplaceMessageCardsRequest

Request message for ReplaceMessageCards API method.

فیلدها
name

string

Required. The resource name of the message.

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

cards_v2[]

CardWithId

Optional. An array of cards to be included in the message. These cards will replace the existing cards of the message. If empty, the original cards included in the message will be cleared.

ReplaceMessageCardsResponse

This type has no fields.

Response message for ReplaceMessageCards API.

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.

Fields
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.
GMAIL_MESSAGE A Gmail message rich link type. Specifically, a Gmail chip from Share to Chat . The API only supports reading messages with GMAIL_MESSAGE rich links.
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.

SearchMessageResult

A single result item from a message search.

Fields
message

Message

The matched message.

space_mute_setting

MuteSetting

The mute setting of the calling user for the space where the message is posted. The caller app can use this information to decide how to process the message depending on whether the space is muted for the user or not.

Only returned if the request view is SEARCH_MESSAGES_VIEW_FULL and the calling credentials include the following authorization scope :

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

bool

Indicates if the matched message is read by the calling user.

Only returned if the request view is SEARCH_MESSAGES_VIEW_FULL and the calling credentials include one of the following authorization scopes :

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

SearchMessagesRequest

Request message for searching messages.

Fields
parent

string

Required. The resource name of the space to search within.

To search across all spaces the user has access to, set this field to spaces/- . Using any other value for parent results in an INVALID_ARGUMENT error.

To limit the search to one or more spaces, use space.name or space.display_name in the filter .

filter

string

Required. A search query.

The query can specify one or more search keywords, which are used to filter the results,

You can also filter the results using the following message fields:

  • create_time : Accepts a timestamp in RFC-3339 format and the supported comparison operators are: < and >= .
  • sender.name : The resource name of the sender ( users/{user} ). Only supports = . You can use the e-mail as an alias for {user} . For example, users/example@gmail.com , where example@gmail.com is the e-mail of the Google Chat user.
  • space.name : The resource name of the space where the message is posted. ( spaces/{space} ). Only supports = . If this filter is not set, the search is performed across all direct messages and spaces the user has access to as a space member.
  • space.display_name : Supports the operator : (has) and filters spaces based on a partial match of their display name. Results are limited to the top five space matches. For example, space.display_name:Project searches for messages in the top five spaces that contain the word "Project" in their display names.
  • attachment : Supports the operator :* (has any) to check for the presence of attachments. If attachment:* is specified, only messages that have at least one attachment are returned.
  • annotations.user_mentions.user.name : The resource name of the mentioned user ( users/{user} ). Only supports : (has). For example: annotations.user_mentions.user.name:"users/1234567890" returns only messages that contain a mention to the specified user. Alternatively, the alias me can be used to filter for messages that mention the caller user, for example: annotations.user_mentions.user.name:users/me . You can also use the e-mail as an alias for {user} , for example, users/example@gmail.com .

For advanced filtering, the following functions are also available:

  • has_link() : Returns only messages that have at least one hyperlink in the message text.
  • is_unread() : Filters out messages that have been read by the calling user.

Using the space.display_name filter requires that the calling credentials include one of the following authorization scopes :

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

Using the is_unread() filter requires that the calling credentials include one of the following authorization scopes :

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

Across different fields, only AND operators are supported. A valid example is sender.name = "users/1234567890" AND is_unread() . The word AND is optional and is implied if omitted. For example, sender.name = "users/1234567890" is_unread() is valid and is equivalent to the previous example. An invalid example is sender.name = "users/1234567890" OR is_unread() because OR is not supported between different fields.

Among the same field:

  • create_time supports only AND , and can only be used to represent an interval, such as create_time >= "2022-01-01T00:00:00+00:00" AND create_time < "2023-01-01T00:00:00+00:00" .
  • sender.name supports only the OR operator, for example: sender.name = "users/1234567890" OR sender.name = "users/0987654321" .
  • space.name supports only the OR operator, for example: space.name = "spaces/ABCDEFGH" OR space.name = "spaces/QWERTYUI" .
  • space.display_name supports the operators AND and OR , but not a mix of both. For example: space.display_name:Project AND space.display_name:Tasks returns messages that are in spaces with display names containing both Project and Tasks , whereas space.display_name:Project OR space.display_name:Tasks returns messages that are in spaces with display names containing either Project or Tasks or both.
  • annotations.user_mentions.user.name supports the operators AND and OR , but not a mix of both. For example: annotations.user_mentions.user.name:"users/1234567890" AND annotations.user_mentions.user.name:"users/0987654321" returns only messages that mentions both users, whereas annotations.user_mentions.user.name:"users/1234567890" OR annotations.user_mentions.user.name:"users/0987654321" returns messages that mention either user or both.

Parentheses are required to disambiguate operator precedence when combining AND and OR operators in the same query. For example: (sender.name="users/me" OR sender.name="users/123456") AND is_unread() . Otherwise, parentheses are optional.

The following example queries are valid:

"Pending reports" AND create_time >= "2023-01-01T00:00:00Z"

sender.name = "users/example@gmail.com"

annotations.user_mentions.user.name:"users/0987654321"

attachment:* AND space.name = "spaces/ABCDEFGH"

tasks AND is_unread() AND sender.name = "users/1234567890"

"things to do" "urgent"

(sender.name = "users/1234567890")
AND (create_time < "2023-05-01T00:00:00Z")

tasks AND space.name = "spaces/ABCDEFGH" AND has_link()

"project one" is_unread()

space.display_name:Project tasks

The maximum query length is 1,000 characters.

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

page_size

int32

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

If unspecified, at most 25 are returned.

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

page_token

string

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

order_by

string

Optional. How the results list is ordered.

Supported attributes to order by are:

  • create_time : Sorts the results by the time of the message creation. Default value.
  • relevance : Sorts the results by relevance. ( Developer Preview)

The default ordering is create_time desc . Only a single order per query ( create_time or relevance ) is supported. Only descending order ( desc ) is supported, and it must be specified after the order attribute.

view

SearchMessagesView

Optional. Specifies what kind of search results view to return. The default is SEARCH_MESSAGES_VIEW_BASIC .

SearchMessagesView

The kinds of view that are supported for partial search results.

Enums
SEARCH_MESSAGES_VIEW_UNSPECIFIED The default / unset value. The API will default to the BASIC view.
SEARCH_MESSAGES_VIEW_BASIC Includes only the matched messages in the results, but no additional metadata. This is the default value.
SEARCH_MESSAGES_VIEW_FULL Includes everything in the results: the matched messages and additional metadata.

SearchMessagesResponse

Response message for searching messages.

Fields
results[]

SearchMessageResult

The list of search results that matched the query.

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.

SearchSpacesRequest

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

Fields
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 .

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

Required. A search query.

You can search by using the following parameters when useAdminAccess is set to true :

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

When useAdminAccess is set to false :

  • display_name
  • external_user_allowed
  • space_type

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

customer is required when useAdminAccess is set to true , 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 . When useAdminAccess is set to false , display_name is required to retrieve meaningful results. Otherwise, the default behavior is to return an empty response.

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 when useAdminAccess is set to true :

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")

The following example queries are valid when useAdminAccess is set to false :

display_name:"Hello World" AND space_type = "SPACE"

(display_name:"Hello" OR display_name:"Fun") AND space_type = "SPACE"

(external_user_allowed = "true" AND space_type = "SPACE") // Returns an
empty response.

(external_user_allowed = "true" AND display_name:"Hello" AND space_type =
"SPACE")
order_by

string

Optional. 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.

When useAdminAccess is false , only create_time and relevance are supported for ordering. Only DESC is supported for these fields in non-admin searches.

Valid ordering operation values are:

  • ASC for ascending. Default value.

  • DESC for descending.

The supported syntax are when useAdminAccess is set to true :

  • 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

When useAdminAccess is set to false :

SearchSpacesResponse

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

Fields
spaces[]
(deprecated)

Space

Deprecated: Please use the new results field instead. A page of the requested spaces. This field will be populated only when useAdminAccess is set to true and deprecated in favor of the new results field.

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.

results[]

SearchSpaceResult

Output only. The list of search results that matched the query.

SearchSpaceResult

A single result item from a space search.

Fields
space

Space

Output only. The matched space.

بخش

Represents a section in Google Chat. Sections help users organize their spaces. There are two types of sections:

  1. System Sections: These are predefined sections managed by Google Chat. Their resource names are fixed, and they cannot be created, deleted, or have their display_name modified. Examples include:

    • users/{user}/sections/default-direct-messages
    • users/{user}/sections/default-spaces
    • users/{user}/sections/default-apps
  2. Custom Sections: These are sections created and managed by the user. Creating a custom section using CreateSection requires a display_name . Custom sections can be updated using UpdateSection and deleted using DeleteSection .

فیلدها
name

string

Identifier. Resource name of the section.

For system sections, the section ID is a constant string:

  • DEFAULT_DIRECT_MESSAGES: users/{user}/sections/default-direct-messages
  • DEFAULT_SPACES: users/{user}/sections/default-spaces
  • DEFAULT_APPS: users/{user}/sections/default-apps

Format: users/{user}/sections/{section}

display_name

string

Optional. The section's display name. Only populated for sections of type CUSTOM_SECTION . Supports up to 80 characters. Required when creating a CUSTOM_SECTION .

sort_order

int32

Output only. The order of the section in relation to other sections. Sections with a lower sort_order value appear before sections with a higher value.

type

SectionType

Required. The type of the section.

SectionType

Section types.

Enums
SECTION_TYPE_UNSPECIFIED Unspecified section type.
CUSTOM_SECTION Custom section.
DEFAULT_DIRECT_MESSAGES Default section containing DIRECT_MESSAGE between two human users or GROUP_CHAT spaces that don't belong to any custom section.
DEFAULT_SPACES Default spaces that don't belong to any custom section.
DEFAULT_APPS Default section containing a user's installed apps.

SectionItem

A user's defined section item. This is used to represent section items, such as spaces, grouped under a section.

Fields
name

string

Identifier. The resource name of the section item.

Format: users/{user}/sections/{section}/items/{item}

Union field item . Required. The section item. item can be only one of the following:
space

string

Optional. The space resource name.

Format: spaces/{space}

SetUpSpaceRequest

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

Fields
space

Space

الزامی. فیلد Space.spaceType الزامی است.

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

برای ایجاد چت گروهی، Space.spaceType را روی GROUP_CHAT تنظیم کنید. Space.displayName تنظیم نکنید.

برای ایجاد یک مکالمه ۱:۱ بین انسان‌ها، Space.spaceType را روی DIRECT_MESSAGE تنظیم کنید و Space.singleUserBotDm را روی false تنظیم کنید. Space.displayName یا Space.spaceDetails را تنظیم نکنید.

برای ایجاد یک مکالمه ۱:۱ بین یک انسان و برنامه چت فراخوانی شده، Space.spaceType را روی DIRECT_MESSAGE و Space.singleUserBotDm را روی true تنظیم کنید. Space.displayName یا Space.spaceDetails را تنظیم نکنید.

اگر یک فضای DIRECT_MESSAGE از قبل وجود داشته باشد، به جای ایجاد یک فضای جدید، آن فضا بازگردانده می‌شود.

request_id

string

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

برای استفاده موثر از این فیلد:

  • اطمینان حاصل کنید که درخواست‌های بعدی یکسان هستند و از همان اعتبارنامه‌های احراز هویت درخواست اصلی استفاده می‌کنند.
  • If a space was already created with the provided request ID, the request returns that space. Note that the returned space might not be fully populated; the API echoes the space in your request with the system-assigned resource name populated. To retrieve the latest metadata for the space, call GetSpace .
  • استفاده مجدد از یک شناسه درخواست موجود با یک کاربر احراز هویت شده متفاوت منجر به خطا می‌شود.
memberships[]

Membership

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

این مجموعه در حال حاضر امکان عضویت تا ۴۹ نفر (علاوه بر تماس‌گیرنده) را فراهم می‌کند.

برای عضویت انسانی، فیلد Membership.member باید شامل یک user با name ثبت شده (فرمت: users/{user} ) و type داده شده روی User.Type.HUMAN باشد. شما فقط می‌توانید هنگام تنظیم یک فضا، کاربران انسانی را اضافه کنید (افزودن برنامه‌های چت فقط برای تنظیم پیام مستقیم با برنامه فراخوانی پشتیبانی می‌شود). همچنین می‌توانید اعضا را با استفاده از ایمیل کاربر به عنوان نام مستعار برای {user} اضافه کنید. به عنوان مثال، user.name می‌تواند users/example@gmail.com باشد. برای دعوت از کاربران Gmail یا کاربران از دامنه‌های خارجی Google Workspace، ایمیل کاربر باید برای {user} استفاده شود.

برای عضویت در گروه گوگل، فیلد Membership.group_member باید شامل group باشد که name آن ذکر شده باشد (فرمت groups/{group} ). شما فقط می‌توانید گروه‌های گوگل را هنگام تنظیم Space.spaceType روی SPACE اضافه کنید.

اختیاری هنگام تنظیم Space.spaceType روی SPACE .

هنگام تنظیم Space.spaceType روی GROUP_CHAT ، همراه با حداقل دو عضویت، الزامی است.

هنگام تنظیم Space.spaceType روی DIRECT_MESSAGE با یک کاربر انسانی، همراه با دقیقاً یک عضویت، الزامی است.

هنگام ایجاد مکالمه ۱:۱ بین یک انسان و برنامه چت فراخوانی شده (هنگام تنظیم Space.spaceType روی DIRECT_MESSAGE و Space.singleUserBotDm روی true )، باید خالی باشد.

SlashCommand

Metadata about a slash command in Google Chat.

Fields
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

Optional. 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

Optional. 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

Optional. 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

Optional. 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

Optional. Details about the space including description and rules.

space_history_state

HistoryState

Optional. The message history state for messages and threads in this space.

import_mode

bool

Optional. 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

Optional. 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

Optional. 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

Optional. 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.

This field isn't populated for direct messages (DMs) or when the space is created by non-Google Workspace users.

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

Optional. 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

Optional. 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:

AccessPermissionSetting

An access permission setting.

فیلدها
principals[]

Principal

Optional. Unordered list. Allowed principals for this permission.

AccessPermissionSettings

Access permission settings for a space.

Fields
discover_space_setting

AccessPermissionSetting

Optional. Access permission setting for discovering the space.

join_space_setting

AccessPermissionSetting

Optional. Access permission setting for joining the space.

AccessSettings

Represents the access setting of the space.

فیلدها
access_state

AccessState

Output only. Indicates the access state of the space.

audience

string

Optional. 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 .

access_permission_settings

AccessPermissionSettings

Optional. Access permission settings for the space.

To set the target audience when creating a space, specify the accessSettings.audience field in your request.

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.

Fields
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.

Fields
managers_allowed

bool

Optional. Whether space owners ( ROLE_MANAGER ) have this permission.

members_allowed

bool

Optional. Whether basic space members ( ROLE_MEMBER ) have this permission.

assistant_managers_allowed

bool

Optional. Whether space managers ROLE_ASSISTANT_MANAGER ) 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.

Fields
manage_members_and_groups

PermissionSetting

Optional. Setting for managing members and groups in a space.

modify_space_details

PermissionSetting

Optional. Setting for updating space name, avatar, description and guidelines.

toggle_history

PermissionSetting

Optional. Setting for toggling space history on and off.

use_at_mention_all

PermissionSetting

Optional. Setting for using @all in a space.

manage_apps

PermissionSetting

Optional. Setting for managing apps in a space.

manage_webhooks

PermissionSetting

Optional. Setting for managing webhooks in a space.

post_messages

PermissionSetting

Output only. Setting for posting messages in a space.

reply_messages

PermissionSetting

Optional. 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.

مدیر

A principal representing an entity granted access.

Fields
Union field principal_type . The type of principal. principal_type can be only one of the following:
audience

Audience

An audience.

SpaceDetails

Details about the space including description and rules.

Fields
description

string

Optional. A description of the space. For example, describe the space's discussion topic, functional purpose, or participants.

Supports up to 150 characters.

guidelines

string

Optional. 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 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

Spaces that don't support message threading. This space threading state is only used for special cases including:

  • Continuous meeting chat where threading is intentionally turned off.
  • Legacy group conversations that were created prior to 2022.

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

Fields
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 .

Fields
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.

Fields
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.

Fields
name

string

Resource name of the space read state.

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

last_read_time

Timestamp

Optional. 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

Fields
space

Space

The updated space.

SpaceView

A view that specifies which fields should be populated on the Space resource. To ensure compatibility with future releases, we recommend that your code account for additional values.

Enums
SPACE_VIEW_UNSPECIFIED The default / unset value.
SPACE_VIEW_RESOURCE_NAME_ONLY Populates only the Space resource name.
SPACE_VIEW_EXPANDED Populates Space resource fields. Note: the permissionSettings field will not be populated. Requests that specify SPACE_VIEW_EXPANDED must include scopes that allow reading space data, for example, https://www.googleapis.com/auth/chat.spaces or https://www.googleapis.com/auth/chat.spaces.readonly .

موضوع

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.

Fields
name

string

Identifier. Resource name of the thread.

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

thread_key

string

Optional. 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.

Fields
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.

UpdateAvailabilityRequest

Request message for the UpdateAvailability method.

Fields
availability

Availability

Required. The availability to update.

update_mask

FieldMask

Required. The list of fields to update. The only field that can be updated is custom_status .

UpdateMembershipRequest

Request message for updating a membership.

Fields
membership

Membership

Required. The membership to update. Only fields specified by update_mask are updated.

update_mask

FieldMask

Required. 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

Optional. 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

Required. Message with fields updated.

update_mask

FieldMask

Required. The field paths to update. Separate multiple values with commas or use * to update all field paths.

Currently supported field paths:

allow_missing

bool

Optional. If true and the message isn't found, a new message is created and updateMask is ignored. The specified message ID must be client-assigned or the request fails.

UpdateSectionRequest

Request message for updating a section.

Fields
section

Section

Required. The section to update.

update_mask

FieldMask

Required. The mask to specify which fields to update.

Currently supported field paths:

  • display_name

UpdateSpaceNotificationSettingRequest

Request to update the space notification settings. Only supports updating notification setting for the calling user.

Fields
space_notification_setting

SpaceNotificationSetting

Required. 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

Required. Supported field paths:

  • notification_setting

  • mute_setting

UpdateSpaceReadStateRequest

Request message for UpdateSpaceReadState API.

Fields
space_read_state

SpaceReadState

Required. 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

Required. 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.

Fields
space

Space

Required. 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

Required. 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 and guidelines. You must pass both description and guidelines in the update request as SpaceDetails . If you only want to update one of the fields, pass the existing value for the other field.

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 .

access_settings.access_permission_settings : Updates the access permission settings of who can discover and join the space where spaceType field is SPACE . Principals allowed to join the space must also be allowed to discover it. To update access permission settings for a space, the authenticating user must be a space manager or assistant manager and omit all other field masks in the 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.access_permission_settings is not supported with useAdminAccess . The supported field masks include:

  • access_settings.access_permission_settings.discoverSpaceSetting
  • access_settings.access_permission_settings.joinSpaceSetting

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

Optional. 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 .

Fields
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. DO NOT USE.
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.

Fields
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.

Fields
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.

Fields
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.

Fields
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.

Fields
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.

Fields
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).

Fields

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.

Fields
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 .

Fields
text

string