Google Chat API の概要
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
このページでは、Google Chat API とそのリファレンス ドキュメントの使用方法の概要について説明します。
Google Chat API には、gRPC と REST の両方のインターフェースと、両方をサポートするクライアント ライブラリがあります。必要に応じて、提供されているクライアント ライブラリがニーズを満たしていない場合は、gRPC または REST インターフェースを使用する独自のクライアント ライブラリを作成できます。
クライアント ライブラリ
ほとんどの開発者が Google Chat API を呼び出すには、Python、Java、Node.js などの任意の言語用に公式にサポートされている Cloud クライアント ライブラリを使用することをおすすめします。
Google Apps Script でコーディングする場合は、クライアント ライブラリをインストールする代わりに、高度な Chat サービスを使用します。
型、メソッド、フィールドの名前
クライアント ライブラリ、gRPC、REST のいずれを使用するかによって、Google Chat API のタイプ、メソッド、フィールド名は多少異なります。
- Cloud クライアント ライブラリは、gRPC サービスとそのメソッド別に配置されます。Google API クライアント ライブラリは、REST リソースに対応するオブジェクトまたはクラスを含むサービスとして配置されます。これらのサービスには、対応するメソッドも含まれています。
- gRPC は、サービスとそのメソッド別に配置されます。
- REST は、リソース階層とそのメソッド別に配置されます。
- gRPC フィールド名はスネークケースを使用します。
- REST フィールド名ではキャメルケースが使用されますが、API サービスではキャメルケースまたはスネークケースのいずれかが認められます。
- クライアント ライブラリのフィールド名は、その言語でどの名前が慣用的であるかに応じて、タイトルケース、キャメルケース、スネークケースのいずれかを使用します。
プロトコル バッファ
クライアント ライブラリ、REST、gRPC のいずれを使用する場合でも、基盤となるサービスはプロトコル バッファを使用して定義されます。特に、このサービスは proto3 を使用します。
API を呼び出すときに、一部のリクエスト フィールドまたはレスポンス フィールドでは、プロトコル バッファの既知の型の基本的な理解が必要になることがあります。
また、REST API を呼び出すときに、プロトコル バッファのデフォルト値の動作により、JSON レスポンスでフィールドが欠落する可能性があります。これらのフィールドはデフォルト値に設定されているため、レスポンスには含まれません。
API バージョン
次の API バージョンを使用できます。
デベロッパー プレビュー
ドキュメントには、デベロッパー プレビュー プログラムでのみ使用可能な API メソッドやフィールドが記載されている場合があります。最新のプレビュー機能をテストしてプレビューし、フィードバックを提供するには、デベロッパー プレビュー プログラムにご参加ください。
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンスにより使用許諾されます。コードサンプルは Apache 2.0 ライセンスにより使用許諾されます。詳しくは、Google Developers サイトのポリシーをご覧ください。Java は Oracle および関連会社の登録商標です。
最終更新日 2025-08-29 UTC。
[null,null,["最終更新日 2025-08-29 UTC。"],[[["\u003cp\u003eThis page offers guidance on utilizing the Google Chat API and navigating its reference documentation, including gRPC and REST interfaces.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers are encouraged to use the provided client libraries for Python, Java, Node.js, or the Advanced Chat service for Google Apps Script.\u003c/p\u003e\n"],["\u003cp\u003eType, method, and field names may vary slightly depending on whether you are using client libraries, gRPC, or REST, with details provided on their respective conventions.\u003c/p\u003e\n"],["\u003cp\u003eThe Google Chat API is built upon protocol buffers, specifically proto3, which may require a basic understanding for certain request and response fields.\u003c/p\u003e\n"],["\u003cp\u003eStable API version v1 is currently available, with access to developer preview features obtainable through the Developer Preview Program.\u003c/p\u003e\n"]]],["The Google Chat API offers gRPC and REST interfaces, with corresponding client libraries or the option to create custom ones. Developers can use Cloud Client Libraries, or the Advanced Chat service with Google Apps Script. Type, method, and field names vary across libraries, gRPC, and REST. The API relies on protocol buffers (proto3), which can impact JSON responses due to default value behavior. The current stable version is v1, with a Developer Preview program for testing new features.\n"],null,["# Google Chat API overview\n\nThis page provides an overview of how to use Google Chat API and its reference\ndocumentation.\n\nGoogle Chat API has both [gRPC](/workspace/chat/api/reference/rpc) and\n[REST](/workspace/chat/api/reference/rest) interfaces, and\n[client libraries](/workspace/chat/libraries) that support both. Optionally, if\nthe provided client libraries don't meet your needs, you can write your own\nclient libraries that use the gRPC or REST interface.\n\nClient libraries\n----------------\n\nThe recommended way for most developers to call the Google Chat API\nis with our officially supported\n[Cloud Client Libraries](/workspace/chat/libraries)\nfor your preferred language, like Python, Java, or Node.js.\n\nIf you're coding with Google Apps Script, use the\n[Advanced Chat service](/apps-script/advanced/chat)\ninstead of installing a client library.\n\nType, method, and field names\n-----------------------------\n\nDepending on whether you're using client libraries, gRPC, or REST, the type,\nmethod, and field names for the Google Chat API vary somewhat:\n\n- Cloud Client Libraries are arranged by gRPC services and their methods. Google API Client Libraries are arranged as services that contain objects or classes that correspond with REST resources, which also contain corresponding methods.\n- gRPC is arranged by services and their methods.\n- REST is arranged by resource hierarchies and their methods.\n- gRPC field names use snake case.\n- REST field names use camel case, though the API service will accept either camel case or snake case.\n- Client library field names use either title case, camel case or snake case, depending on which name is idiomatic for the language.\n\nProtocol buffers\n----------------\n\nWhether you are using client libraries, REST, or gRPC, the underlying service is\ndefined using [protocol buffers](/protocol-buffers). In particular, the service\nuses [proto3](/protocol-buffers/docs/proto3).\n\nWhen calling the API, some request or response fields can require a basic\nunderstanding of\n[protocol buffer well-known types](/protocol-buffers/docs/reference/google.protobuf).\n\nIn addition, when calling the REST API, the\n[default value](/protocol-buffers/docs/proto3#default) behavior for protocol\nbuffers may result in missing fields in a JSON response. These fields are\nset to the default value, so they are not included in the response.\n\nAPI versions\n------------\n\nThe following API versions are available:\n\n- **v1**: Stable.\n\nDeveloper Preview\n-----------------\n\nIn the documentation, you might see API methods or fields that are only\navailable through the Developer Preview Program. To test and preview and offer\nfeedback on the latest preview features, join the\n[Developer Preview Program](/workspace/preview).\n\nRelated topics\n--------------\n\n- [Call the Google Chat API](/workspace/chat/api-overview)"]]