Method: locations.questions.answers.upsert
קל לארגן דפים בעזרת אוספים
אפשר לשמור ולסווג תוכן על סמך ההעדפות שלך.
יוצר תשובה או מעדכן את התשובה הקיימת שנכתבה על ידי המשתמש לשאלה שצוינה. כל משתמש יכול ליצור רק תשובה אחת לכל שאלה.
בקשת HTTP
POST https://mybusinessqanda.googleapis.com/v1/{parent=locations/*/questions/*}/answers:upsert
בכתובת ה-URL נעשה שימוש בתחביר המרת קידוד של gRPC.
פרמטרים של נתיב
פרמטרים |
parent |
string
חובה. שם השאלה שעליה רוצים לכתוב את התשובה.
|
גוף הבקשה
גוף הבקשה מכיל נתונים במבנה הבא:
ייצוג JSON |
{
"answer": {
object (Answer )
}
} |
שדות |
answer |
object (Answer )
חובה. התשובה החדשה.
|
גוף התשובה
אם הפעולה בוצעה ללא שגיאות, גוף התגובה יכלול מופע של Answer
.
היקפי ההרשאות
נדרש היקף ההרשאות הבא של OAuth:
https://www.googleapis.com/auth/business.manage
למידע נוסף, קראו את המאמר סקירה כללית של OAuth 2.0.
אלא אם צוין אחרת, התוכן של דף זה הוא ברישיון Creative Commons Attribution 4.0 ודוגמאות הקוד הן ברישיון Apache 2.0. לפרטים, ניתן לעיין במדיניות האתר Google Developers. Java הוא סימן מסחרי רשום של חברת Oracle ו/או של השותפים העצמאיים שלה.
עדכון אחרון: 2025-07-25 (שעון UTC).
[null,null,["עדכון אחרון: 2025-07-25 (שעון UTC)."],[[["\u003cp\u003eThis documentation outlines the process for creating or updating an answer to a question using the My Business Q&A API.\u003c/p\u003e\n"],["\u003cp\u003eThe request requires a \u003ccode\u003ePOST\u003c/code\u003e method to a specific endpoint with parameters specifying the question and the new answer content.\u003c/p\u003e\n"],["\u003cp\u003eThe request body must contain a JSON object with the answer details, adhering to a defined structure.\u003c/p\u003e\n"],["\u003cp\u003eSuccessful execution results in a response containing the created or updated answer object.\u003c/p\u003e\n"],["\u003cp\u003eAuthorization using the \u003ccode\u003ebusiness.manage\u003c/code\u003e scope is required to utilize this API functionality.\u003c/p\u003e\n"]]],["This describes how to create or update an answer to a user question via an API. A `POST` HTTP request is sent to a specific URL containing the question's location (`parent`). The request body, formatted as JSON, contains the new `answer`. The `parent` path parameter is required, specifying the question's name. Authorization requires the `business.manage` OAuth scope. Upon success, the response body returns the created or updated `Answer`.\n"],null,["# Method: locations.questions.answers.upsert\n\n- [HTTP request](#body.HTTP_TEMPLATE)\n- [Path parameters](#body.PATH_PARAMETERS)\n- [Request body](#body.request_body)\n - [JSON representation](#body.request_body.SCHEMA_REPRESENTATION)\n- [Response body](#body.response_body)\n- [Authorization scopes](#body.aspect)\n\nCreates an answer or updates the existing answer written by the user for the specified question. A user can only create one answer per question.\n\n### HTTP request\n\n`POST https://mybusinessqanda.googleapis.com/v1/{parent=locations/*/questions/*}/answers:upsert`\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 name of the question to write an answer for. |\n\n### Request body\n\nThe request body contains data with the following structure:\n\n| JSON representation |\n|----------------------------------------------------------------------------------------------------|\n| ``` { \"answer\": { object (/my-business/reference/qanda/rest/v1/locations.questions#Answer) } } ``` |\n\n| Fields ||\n|----------|------------------------------------------------------------------------------------------------------------------|\n| `answer` | `object (`[Answer](/my-business/reference/qanda/rest/v1/locations.questions#Answer)`)` Required. The new answer. |\n\n### Response body\n\nIf successful, the response body contains an instance of [Answer](/my-business/reference/qanda/rest/v1/locations.questions#Answer).\n\n### Authorization scopes\n\nRequires the following OAuth scope:\n\n- `https://www.googleapis.com/auth/business.manage`\n\nFor more information, see the [OAuth 2.0 Overview](https://developers.google.com/identity/protocols/OAuth2)."]]