התכונה 'פעולות שיחה' הוצאה משימוש ב-13 ביוני 2023.
כאן תוכלו לקרוא מידע נוסף על ההוצאה משימוש של 'פעולות שיחה'.
Webhook
קל לארגן דפים בעזרת אוספים
אפשר לשמור ולסווג תוכן על סמך ההעדפות שלך.
מטא-נתונים לסוגים שונים של webhooks. אם אתם משתמשים ב-inlineCloudFunction
, קוד המקור חייב להיות בספרייה עם שם זהה לערך של המפתח executeFunction
. לדוגמה, ערך של my_webhook
עבור המפתח executeFunction
יהיה במבנה קוד כזה: - /webhooks/my_webhook.yaml
- /webhooks/my_webhook/index.js
- /webhooks/my_webhook/package.json
ייצוג YAML |
handlers:
- object (Handler )
# Union field webhook_type can be only one of the following:
httpsEndpoint:
object (HttpsEndpoint )
inlineCloudFunction:
object (InlineCloudFunction )
# End of list of possible types for union field webhook_type . |
שדות |
handlers[] |
object (Handler )
רשימת גורמים מטפלים ב-webhook הזה.
|
שדה איחוד webhook_type . יש תמיכה רק בסוג webhook אחד. webhook_type יכול להיות רק אחת מהאפשרויות הבאות: |
httpsEndpoint |
object (HttpsEndpoint )
נקודת קצה (endpoint) מותאמת אישית של webhook.
|
inlineCloudFunction |
object (InlineCloudFunction )
מטא-נתונים של פונקציה ב-Cloud Functions שנפרסו מקוד בתיקיית ה-webhooks.
|
מטפל
הצהרת השם של ה-handler של webhoook. לתגובה לפעולה מאתר אחר (webhook) יכולים להיות רשומים כמה handlers. ניתן לקרוא ל-handlers האלה מכמה מקומות בפרויקט Actions.
שדות |
name |
string
חובה. שם ה-handler. חייב להיות ייחודי בכל הגורמים המטפלים בפרויקט Actions. אפשר לבדוק את שם ה-handler הזה כדי להפעיל את הפונקציה הנכונה בקוד המקור של מילוי ההזמנות.
|
HttpsEndpoint
נקודת קצה ב-REST כדי לקבל התראה אם אתם לא משתמשים בעורך המוטבע.
ייצוג YAML |
baseUrl: string
httpHeaders:
string: string
endpointApiVersion: integer |
שדות |
baseUrl |
string
כתובת ה-URL הבסיסית מסוג HTTPS של נקודת הקצה של מילוי ההזמנות (אין תמיכה ב-HTTP). שמות ה-handler מתווספים לנתיב כתובת ה-URL הבסיסית אחרי נקודתיים (בהתאם למדריך הסגנון בכתובת https://cloud.google.com/apis/design/custom_methods). לדוגמה, כתובת ה-URL הבסיסית היא https://gactions.service.com/api יקבלו בקשות עם כתובת ה-URL 'https://gactions.service.com/api:{method}'.
|
endpointApiVersion |
integer
גרסת הפרוטוקול שמשמש את נקודת הקצה. זה הפרוטוקול שמשותף לכל סוגי מילוי ההזמנות, ולא ספציפי לסוג מילוי ההזמנות של Google.
|
InlineCloudFunction
מכיל את המטא-נתונים של פונקציה מוטבעת של Cloud Functions שנפרסה מתיקיית ה-webhooks.
ייצוג YAML |
executeFunction: string |
שדות |
executeFunction |
string
שם נקודת הכניסה של הפונקציה של Cloud Functions. הערך בשדה הזה צריך להתאים לשם השיטה שמיוצאת מקוד המקור.
|
אלא אם צוין אחרת, התוכן של דף זה הוא ברישיון Creative Commons Attribution 4.0 ודוגמאות הקוד הן ברישיון Apache 2.0. לפרטים, ניתן לעיין במדיניות האתר Google Developers. Java הוא סימן מסחרי רשום של חברת Oracle ו/או של השותפים העצמאיים שלה.
עדכון אחרון: 2025-07-26 (שעון UTC).
[null,null,["עדכון אחרון: 2025-07-26 (שעון UTC)."],[[["\u003cp\u003eWebhooks use YAML to define metadata for different handler types like HTTPS endpoints and inline Cloud Functions.\u003c/p\u003e\n"],["\u003cp\u003eInline Cloud Functions require source code in a directory matching the \u003ccode\u003eexecuteFunction\u003c/code\u003e value.\u003c/p\u003e\n"],["\u003cp\u003eHandlers specify the webhook's name and can be invoked from various points in your Actions project.\u003c/p\u003e\n"],["\u003cp\u003eHTTPS endpoints define the base URL and optional HTTP headers for external fulfillment.\u003c/p\u003e\n"],["\u003cp\u003eInline Cloud Functions use the \u003ccode\u003eexecuteFunction\u003c/code\u003e field to identify the entry point in your source code.\u003c/p\u003e\n"]]],[],null,["# Webhook\n\n- [YAML representation](#SCHEMA_REPRESENTATION)\n- [Handler](#Handler)\n - [YAML representation](#Handler.SCHEMA_REPRESENTATION)\n- [HttpsEndpoint](#HttpsEndpoint)\n - [YAML representation](#HttpsEndpoint.SCHEMA_REPRESENTATION)\n- [InlineCloudFunction](#InlineCloudFunction)\n - [YAML representation](#InlineCloudFunction.SCHEMA_REPRESENTATION)\n\nMetadata for different types of webhooks. If you're using `inlineCloudFunction`, your source code must be in a directory with the same name as the value for the `executeFunction` key. For example, a value of `my_webhook` for the`executeFunction` key would have a code structure like this: - `/webhooks/my_webhook.yaml` - `/webhooks/my_webhook/index.js` - `/webhooks/my_webhook/package.json`\n\n| YAML representation ||\n|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|\n| ``` handlers: - object (/assistant/actionssdk/reference/rest/Shared.Types/Webhook#Handler) # Union field `webhook_type` can be only one of the following: httpsEndpoint: object (/assistant/actionssdk/reference/rest/Shared.Types/Webhook#HttpsEndpoint) inlineCloudFunction: object (/assistant/actionssdk/reference/rest/Shared.Types/Webhook#InlineCloudFunction) # End of list of possible types for union field `webhook_type`. ``` |\n\n| Fields ||\n|-----------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|\n| `handlers[]` | `object (`[Handler](/assistant/actionssdk/reference/rest/Shared.Types/Webhook#Handler)`)` List of handlers for this webhook. |\n| Union field `webhook_type`. Only one webhook type is supported. `webhook_type` can be only one of the following: |||\n| `httpsEndpoint` | `object (`[HttpsEndpoint](/assistant/actionssdk/reference/rest/Shared.Types/Webhook#HttpsEndpoint)`)` Custom webhook HTTPS endpoint. |\n| `inlineCloudFunction` | `object (`[InlineCloudFunction](/assistant/actionssdk/reference/rest/Shared.Types/Webhook#InlineCloudFunction)`)` Metadata for cloud function deployed from code in the webhooks folder. |\n\nHandler\n-------\n\nDeclares the name of the webhoook handler. A webhook can have multiple handlers registered. These handlers can be called from multiple places in your Actions project.\n\n| YAML representation ||\n|----------------------|---|\n| ``` name: string ``` |\n\n| Fields ||\n|--------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `name` | `string` Required. Name of the handler. Must be unique across all handlers the Actions project. You can check the name of this handler to invoke the correct function in your fulfillment source code. |\n\nHttpsEndpoint\n-------------\n\nREST endpoint to notify if you're not using the inline editor.\n\n| YAML representation ||\n|---------------------------------------------------------------------------------|---|\n| ``` baseUrl: string httpHeaders: string: string endpointApiVersion: integer ``` |\n\n| Fields ||\n|----------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `baseUrl` | `string` The HTTPS base URL for your fulfillment endpoint (HTTP is not supported). Handler names are appended to the base URL path after a colon (following the style guide in \u003chttps://cloud.google.com/apis/design/custom_methods)\u003e. For example a base URL of 'https://gactions.service.com/api' would receive requests with URL 'https://gactions.service.com/api:{method}'. |\n| `httpHeaders` | `map (key: string, value: string)` Map of HTTP parameters to be included in the POST request. An object containing a list of `\"key\": value` pairs. Example: `{ \"name\": \"wrench\", \"mass\": \"1.3kg\", \"count\": \"3\" }`. |\n| `endpointApiVersion` | `integer` Version of the protocol used by the endpoint. This is the protocol shared by all fulfillment types and not specific to Google fulfillment type. |\n\nInlineCloudFunction\n-------------------\n\nHolds the metadata of an inline Cloud Function deployed from the webhooks folder.\n\n| YAML representation ||\n|---------------------------------|---|\n| ``` executeFunction: string ``` |\n\n| Fields ||\n|-------------------|-------------------------------------------------------------------------------------------------------------------------------------------------|\n| `executeFunction` | `string` The name of the Cloud Function entry point. The value of this field should match the name of the method exported from the source code. |"]]