سنوقف ميزة "الرسائل التجارية من Google" نهائيًا في 31 يوليو 2024. يمكنك الاطّلاع على مزيد من المعلومات
هنا.
Method: conversations.messages.create
تنظيم صفحاتك في مجموعات
يمكنك حفظ المحتوى وتصنيفه حسب إعداداتك المفضّلة.
يرسل رسالة من وكيل إلى مستخدم. إذا لم تكن هناك محادثة أو حاول الوكيل إرسال رسالة ضمن محادثة ليس لديه الإذن بالمشاركة فيها، يعرض رسالة الخطأ PERMISSION DENIED
.
طلب HTTP
POST https://businessmessages.googleapis.com/v1/{parent=conversations/*}/messages
يستخدِم عنوان URL بنية تحويل ترميز gRPC.
مَعلمات المسار
المَعلمات |
parent |
string
مطلوبة. المحادثة التي تحتوي على الرسالة. ينتقل إلى "المحادثات/{conversationId}".
|
معلمات طلب البحث
المَعلمات |
forceFallback |
boolean
اختياريّ. علامة لإرسال النص الاحتياطي المحدّد بدلاً من محتوى الرسالة الأخرى لا يتوفّر هذا الخيار إلا للوكلاء الذين لم يتم إطلاقهم. إذا كانت العلامة "صحيحة" ولم يتم تحديد النص الاحتياطي، تعرِض ميزة "الرسائل التجارية" رسالة خطأ.
|
نص الطلب
يحتوي نص الطلب على مثال Message
.
نص الاستجابة
إذا كانت الاستجابة ناجحة، يحتوي نص الاستجابة على مثيل Message
تم إنشاؤه حديثًا.
نطاقات التفويض
يجب توفير نطاق OAuth التالي:
https://www.googleapis.com/auth/businessmessages
لمزيد من المعلومات، راجِع نظرة عامة على بروتوكول OAuth 2.0.
إنّ محتوى هذه الصفحة مرخّص بموجب ترخيص Creative Commons Attribution 4.0 ما لم يُنصّ على خلاف ذلك، ونماذج الرموز مرخّصة بموجب ترخيص Apache 2.0. للاطّلاع على التفاصيل، يُرجى مراجعة سياسات موقع Google Developers. إنّ Java هي علامة تجارية مسجَّلة لشركة Oracle و/أو شركائها التابعين.
تاريخ التعديل الأخير: 2025-07-25 (حسب التوقيت العالمي المتفَّق عليه)
[null,null,["تاريخ التعديل الأخير: 2025-07-25 (حسب التوقيت العالمي المتفَّق عليه)"],[[["\u003cp\u003eSends a message from an agent to a user within a specific conversation.\u003c/p\u003e\n"],["\u003cp\u003eReturns a \u003ccode\u003ePERMISSION DENIED\u003c/code\u003e error if the conversation doesn't exist or the agent isn't authorized.\u003c/p\u003e\n"],["\u003cp\u003eAllows sending fallback text instead of the main message content for non-launched agents using the \u003ccode\u003eforceFallback\u003c/code\u003e query parameter.\u003c/p\u003e\n"],["\u003cp\u003eRequires the \u003ccode\u003ehttps://www.googleapis.com/auth/businessmessages\u003c/code\u003e OAuth scope for authorization.\u003c/p\u003e\n"],["\u003cp\u003eUses the \u003ccode\u003ePOST\u003c/code\u003e method with the URL \u003ccode\u003ehttps://businessmessages.googleapis.com/v1/{parent=conversations/*}/messages\u003c/code\u003e to send the message.\u003c/p\u003e\n"]]],[],null,["# Method: conversations.messages.create\n\nSends a message from an agent to a user. If a conversation doesn't exist or an agent tries to send a message in a conversation that it isn't authorized to participate in, returns a `PERMISSION DENIED` error.\n\n### HTTP request\n\n`POST https://businessmessages.googleapis.com/v1/{parent=conversations/*}/messages`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Path parameters\n\n| Parameters ||\n|----------|--------------------------------------------------------------------------------------------------------------|\n| `parent` | `string` Required. The conversation that contains the message. Resolves to \"conversations/{conversationId}\". |\n\n### Query parameters\n\n| Parameters ||\n|-----------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `forceFallback` | `boolean` Optional. A flag to send the specified fallback text instead of other message content. Only available to agents that aren't launched. If the flag is true and fallback text isn't specified, Business Messages returns an error. |\n\n### Request body\n\nThe request body contains an instance of [Message](/business-communications/business-messages/reference/rest/v1/conversations.messages#Message).\n\n### Response body\n\nIf successful, the response body contains a newly created instance of [Message](/business-communications/business-messages/reference/rest/v1/conversations.messages#Message).\n\n### Authorization scopes\n\nRequires the following OAuth scope:\n\n- `https://www.googleapis.com/auth/businessmessages`\n\nFor more information, see the [OAuth 2.0 Overview](https://developers.google.com/identity/protocols/OAuth2)."]]