Webhook
با مجموعهها، منظم بمانید
ذخیره و طبقهبندی محتوا براساس اولویتهای شما.
متادیتا برای انواع مختلف وب هوک. اگر از 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_type . فقط یک نوع وب هوک پشتیبانی می شود. webhook_type فقط می تواند یکی از موارد زیر باشد: |
httpsEndpoint | object ( HttpsEndpoint ) نقطه پایانی HTTPS وب هوک سفارشی. |
inlineCloudFunction | object ( InlineCloudFunction ) فراداده برای عملکرد ابری که از کد موجود در پوشه webhooks مستقر شده است. |
هندلر
نام کنترل کننده webhoook را اعلام می کند. یک وب هوک می تواند چندین کنترل کننده ثبت شده داشته باشد. این کنترل کننده ها را می توان از چندین مکان در پروژه Actions شما فراخوانی کرد.
نمایندگی YAML |
---|
name: string |
فیلدها |
---|
name | string مورد نیاز. نام کنترل کننده باید در بین همه کنترلکنندههای پروژه Actions منحصربهفرد باشد. می توانید نام این کنترل کننده را بررسی کنید تا عملکرد صحیح را در کد منبع تکمیل خود فراخوانی کنید. |
HttpsEndpoint
REST نقطه پایانی برای اطلاع در صورتی که از ویرایشگر درون خطی استفاده نمی کنید.
نمایندگی YAML |
---|
baseUrl: string
httpHeaders:
string: string
endpointApiVersion: integer |
فیلدها |
---|
baseUrl | string نشانی وب پایه 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 درون خطی را که از پوشه webhooks مستقر شده نگه می دارد.
نمایندگی YAML |
---|
executeFunction: string |
فیلدها |
---|
executeFunction | string نام نقطه ورودی Cloud Function. مقدار این فیلد باید با نام روش صادر شده از کد منبع مطابقت داشته باشد. |
جز در مواردی که غیر از این ذکر شده باشد،محتوای این صفحه تحت مجوز Creative Commons Attribution 4.0 License است. نمونه کدها نیز دارای مجوز Apache 2.0 License است. برای اطلاع از جزئیات، به خطمشیهای سایت Google Developers مراجعه کنید. جاوا علامت تجاری ثبتشده Oracle و/یا شرکتهای وابسته به آن است.
تاریخ آخرین بهروزرسانی 2025-07-24 بهوقت ساعت هماهنگ جهانی.
[null,null,["تاریخ آخرین بهروزرسانی 2025-07-24 بهوقت ساعت هماهنگ جهانی."],[[["\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. |"]]