# Dialogflow API . projects . locations . agents . webhooks

## Instance Methods

Close httplib2 connections.

Creates a webhook in the specified agent.

Deletes the specified webhook.

Retrieves the specified webhook.

Returns the list of all webhooks in the specified agent.

Retrieves the next page of results.

Updates the specified webhook.

### Method Details

`close()`

    Close httplib2 connections.

`create(parent, body=None, x__xgafv=None)`

    Creates a webhook in the specified agent.

    Args:
      parent: string, Required. The agent to create a webhook for. Format: `projects//locations//agents/`. (required)
      body: object, The request body.
        The object takes the form of:

    { # Webhooks host the developer's business logic. During a session, webhooks allow the developer to use the data extracted by Dialogflow's natural language processing to generate dynamic responses, validate collected data, or trigger actions on the backend.
        "timeout": "A String", # Webhook execution timeout. Execution is considered failed if Dialogflow doesn't receive a response from webhook at the end of the timeout period. Defaults to 5 seconds, maximum allowed timeout is 30 seconds.
        "name": "A String", # The unique identifier of the webhook. Required for the Webhooks.UpdateWebhook method. Webhooks.CreateWebhook populates the name automatically. Format: `projects//locations//agents//webhooks/`.
        "disabled": True or False, # Indicates whether the webhook is disabled.
        "genericWebService": { # Represents configuration for a generic web service. # Configuration for a generic web service.
          "uri": "A String", # Required. The webhook URI for receiving POST requests. It must use https protocol.
          "password": "A String", # The password for HTTP Basic authentication.
          "username": "A String", # The user name for HTTP Basic authentication.
          "requestHeaders": { # The HTTP request headers to send together with webhook requests.
            "a_key": "A String",
          },
        },
        "displayName": "A String", # Required. The human-readable name of the webhook, unique within the agent.
      }

      x__xgafv: string, V1 error format.
        Allowed values
          1 - v1 error format
          2 - v2 error format

    Returns:
      An object of the form:

        { # Webhooks host the developer's business logic. During a session, webhooks allow the developer to use the data extracted by Dialogflow's natural language processing to generate dynamic responses, validate collected data, or trigger actions on the backend.
          "timeout": "A String", # Webhook execution timeout. Execution is considered failed if Dialogflow doesn't receive a response from webhook at the end of the timeout period. Defaults to 5 seconds, maximum allowed timeout is 30 seconds.
          "name": "A String", # The unique identifier of the webhook. Required for the Webhooks.UpdateWebhook method. Webhooks.CreateWebhook populates the name automatically. Format: `projects//locations//agents//webhooks/`.
          "disabled": True or False, # Indicates whether the webhook is disabled.
          "genericWebService": { # Represents configuration for a generic web service. # Configuration for a generic web service.
            "uri": "A String", # Required. The webhook URI for receiving POST requests. It must use https protocol.
            "password": "A String", # The password for HTTP Basic authentication.
            "username": "A String", # The user name for HTTP Basic authentication.
            "requestHeaders": { # The HTTP request headers to send together with webhook requests.
              "a_key": "A String",
            },
          },
          "displayName": "A String", # Required. The human-readable name of the webhook, unique within the agent.
        }

`delete(name, force=None, x__xgafv=None)`

    Deletes the specified webhook.

    Args:
      name: string, Required. The name of the webhook to delete. Format: `projects//locations//agents//webhooks/`. (required)
      force: boolean, This field has no effect for webhook not being used. For webhooks that are used by pages/flows/transition route groups: * If `force` is set to false, an error will be returned with message indicating the referenced resources. * If `force` is set to true, Dialogflow will remove the webhook, as well as any references to the webhook (i.e. Webhook and tagin fulfillments that point to this webhook will be removed).
      x__xgafv: string, V1 error format.
        Allowed values
          1 - v1 error format
          2 - v2 error format

    Returns:
      An object of the form:

        { # A generic empty message that you can re-use to avoid defining duplicated empty messages in your APIs. A typical example is to use it as the request or the response type of an API method. For instance: service Foo { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } The JSON representation for `Empty` is empty JSON object `{}`.
      }

`get(name, x__xgafv=None)`

    Retrieves the specified webhook.

    Args:
      name: string, Required. The name of the webhook. Format: `projects//locations//agents//webhooks/`. (required)
      x__xgafv: string, V1 error format.
        Allowed values
          1 - v1 error format
          2 - v2 error format

    Returns:
      An object of the form:

        { # Webhooks host the developer's business logic. During a session, webhooks allow the developer to use the data extracted by Dialogflow's natural language processing to generate dynamic responses, validate collected data, or trigger actions on the backend.
          "timeout": "A String", # Webhook execution timeout. Execution is considered failed if Dialogflow doesn't receive a response from webhook at the end of the timeout period. Defaults to 5 seconds, maximum allowed timeout is 30 seconds.
          "name": "A String", # The unique identifier of the webhook. Required for the Webhooks.UpdateWebhook method. Webhooks.CreateWebhook populates the name automatically. Format: `projects//locations//agents//webhooks/`.
          "disabled": True or False, # Indicates whether the webhook is disabled.
          "genericWebService": { # Represents configuration for a generic web service. # Configuration for a generic web service.
            "uri": "A String", # Required. The webhook URI for receiving POST requests. It must use https protocol.
            "password": "A String", # The password for HTTP Basic authentication.
            "username": "A String", # The user name for HTTP Basic authentication.
            "requestHeaders": { # The HTTP request headers to send together with webhook requests.
              "a_key": "A String",
            },
          },
          "displayName": "A String", # Required. The human-readable name of the webhook, unique within the agent.
        }

`list(parent, pageSize=None, pageToken=None, x__xgafv=None)`

    Returns the list of all webhooks in the specified agent.

    Args:
      parent: string, Required. The agent to list all webhooks for. Format: `projects//locations//agents/`. (required)
      pageSize: integer, The maximum number of items to return in a single page. By default 100 and at most 1000.
      pageToken: string, The next_page_token value returned from a previous list request.
      x__xgafv: string, V1 error format.
        Allowed values
          1 - v1 error format
          2 - v2 error format

    Returns:
      An object of the form:

        { # The response message for Webhooks.ListWebhooks.
        "nextPageToken": "A String", # Token to retrieve the next page of results, or empty if there are no more results in the list.
        "webhooks": [ # The list of webhooks. There will be a maximum number of items returned based on the page_size field in the request.
          { # Webhooks host the developer's business logic. During a session, webhooks allow the developer to use the data extracted by Dialogflow's natural language processing to generate dynamic responses, validate collected data, or trigger actions on the backend.
              "timeout": "A String", # Webhook execution timeout. Execution is considered failed if Dialogflow doesn't receive a response from webhook at the end of the timeout period. Defaults to 5 seconds, maximum allowed timeout is 30 seconds.
              "name": "A String", # The unique identifier of the webhook. Required for the Webhooks.UpdateWebhook method. Webhooks.CreateWebhook populates the name automatically. Format: `projects//locations//agents//webhooks/`.
              "disabled": True or False, # Indicates whether the webhook is disabled.
              "genericWebService": { # Represents configuration for a generic web service. # Configuration for a generic web service.
                "uri": "A String", # Required. The webhook URI for receiving POST requests. It must use https protocol.
                "password": "A String", # The password for HTTP Basic authentication.
                "username": "A String", # The user name for HTTP Basic authentication.
                "requestHeaders": { # The HTTP request headers to send together with webhook requests.
                  "a_key": "A String",
                },
              },
              "displayName": "A String", # Required. The human-readable name of the webhook, unique within the agent.
            },
        ],
      }

`list_next(previous_request, previous_response)`

    Retrieves the next page of results.

    Args:
      previous_request: The request for the previous page. (required)
      previous_response: The response from the request for the previous page. (required)

    Returns:
      A request object that you can call 'execute()' on to request the next
      page. Returns None if there are no more items in the collection.

`patch(name, body=None, updateMask=None, x__xgafv=None)`

    Updates the specified webhook.

    Args:
      name: string, The unique identifier of the webhook. Required for the Webhooks.UpdateWebhook method. Webhooks.CreateWebhook populates the name automatically. Format: `projects//locations//agents//webhooks/`. (required)
      body: object, The request body.
        The object takes the form of:

    { # Webhooks host the developer's business logic. During a session, webhooks allow the developer to use the data extracted by Dialogflow's natural language processing to generate dynamic responses, validate collected data, or trigger actions on the backend.
        "timeout": "A String", # Webhook execution timeout. Execution is considered failed if Dialogflow doesn't receive a response from webhook at the end of the timeout period. Defaults to 5 seconds, maximum allowed timeout is 30 seconds.
        "name": "A String", # The unique identifier of the webhook. Required for the Webhooks.UpdateWebhook method. Webhooks.CreateWebhook populates the name automatically. Format: `projects//locations//agents//webhooks/`.
        "disabled": True or False, # Indicates whether the webhook is disabled.
        "genericWebService": { # Represents configuration for a generic web service. # Configuration for a generic web service.
          "uri": "A String", # Required. The webhook URI for receiving POST requests. It must use https protocol.
          "password": "A String", # The password for HTTP Basic authentication.
          "username": "A String", # The user name for HTTP Basic authentication.
          "requestHeaders": { # The HTTP request headers to send together with webhook requests.
            "a_key": "A String",
          },
        },
        "displayName": "A String", # Required. The human-readable name of the webhook, unique within the agent.
      }

      updateMask: string, The mask to control which fields get updated. If the mask is not present, all fields will be updated.
      x__xgafv: string, V1 error format.
        Allowed values
          1 - v1 error format
          2 - v2 error format

    Returns:
      An object of the form:

        { # Webhooks host the developer's business logic. During a session, webhooks allow the developer to use the data extracted by Dialogflow's natural language processing to generate dynamic responses, validate collected data, or trigger actions on the backend.
          "timeout": "A String", # Webhook execution timeout. Execution is considered failed if Dialogflow doesn't receive a response from webhook at the end of the timeout period. Defaults to 5 seconds, maximum allowed timeout is 30 seconds.
          "name": "A String", # The unique identifier of the webhook. Required for the Webhooks.UpdateWebhook method. Webhooks.CreateWebhook populates the name automatically. Format: `projects//locations//agents//webhooks/`.
          "disabled": True or False, # Indicates whether the webhook is disabled.
          "genericWebService": { # Represents configuration for a generic web service. # Configuration for a generic web service.
            "uri": "A String", # Required. The webhook URI for receiving POST requests. It must use https protocol.
            "password": "A String", # The password for HTTP Basic authentication.
            "username": "A String", # The user name for HTTP Basic authentication.
            "requestHeaders": { # The HTTP request headers to send together with webhook requests.
              "a_key": "A String",
            },
          },
          "displayName": "A String", # Required. The human-readable name of the webhook, unique within the agent.
        }