Method: spaces.messages.delete
ลบข้อความ โปรดดูตัวอย่างที่หัวข้อลบข้อความ
รองรับการตรวจสอบสิทธิ์ประเภทต่อไปนี้
เมื่อใช้การตรวจสอบสิทธิ์ของแอป คำขอจะลบได้เฉพาะข้อความที่สร้างโดยแอป Chat ที่โทรเข้ามาเท่านั้น
คำขอ HTTP
DELETE https://chat.googleapis.com/v1/{name=spaces/*/messages/*}
URL ใช้ไวยากรณ์การแปลง gRPC
พารามิเตอร์เส้นทาง
พารามิเตอร์ |
name |
string
ต้องระบุ ชื่อทรัพยากรของข้อความ รูปแบบ: spaces/{space}/messages/{message} หากตั้งค่ารหัสที่กำหนดเองสำหรับข้อความไว้ คุณจะใช้ค่าจากฟิลด์ clientAssignedMessageId สำหรับ {message} ได้ โปรดดูรายละเอียดที่หัวข้อตั้งชื่อข้อความ
|
พารามิเตอร์การค้นหา
พารามิเตอร์ |
force |
boolean
ไม่บังคับ เมื่อ true การลบข้อความจะลบการตอบกลับแบบแยกชุดข้อความด้วย เมื่อเป็น false หากข้อความมีการตอบกลับแบบแยกชุดข้อความ การลบจะดำเนินการไม่สำเร็จ ใช้ได้เมื่อตรวจสอบสิทธิ์ในฐานะผู้ใช้เท่านั้น ไม่มีผลเมื่อตรวจสอบสิทธิ์เป็นแอป Chat
|
เนื้อหาของคำขอ
เนื้อหาของคำขอต้องว่างเปล่า
เนื้อหาการตอบกลับ
หากทำสำเร็จ เนื้อหาการตอบกลับจะเป็นออบเจ็กต์ JSON ว่าง
ขอบเขตการให้สิทธิ์
ต้องใช้ขอบเขต OAuth ต่อไปนี้
https://www.googleapis.com/auth/chat.bot
https://www.googleapis.com/auth/chat.import
https://www.googleapis.com/auth/chat.messages
ดูข้อมูลเพิ่มเติมได้ที่คู่มือการให้สิทธิ์
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-01-22 UTC
[null,null,["อัปเดตล่าสุด 2025-01-22 UTC"],[[["This method enables you to delete messages and optionally their replies using an HTTP DELETE request."],["It supports both app and user authentication, with app authentication limiting deletion to messages created by the app."],["You can specify whether to force delete threaded replies with the `force` query parameter when using user authentication."],["The request requires specifying the message's resource name in the URL path and an empty request body."],["Authorization is required using one of the specified OAuth scopes."]]],["This document details how to delete a message using the Chat API. The `DELETE` request targets a specific message's resource name in the format `spaces/*/messages/*`. It supports both app and user authentication, with different limitations for each. The request requires a message's name as a path parameter. A `force` query parameter is optional for user authentication to delete threaded replies. The request body is empty, and a successful response returns an empty JSON object. One of three specified OAuth scopes is required.\n"]]