Class SetWebhook


public class SetWebhook extends AbstractBaseRequest<SetWebhook, Boolean>
SetWebhook class. Returns True on success.
Since:
3 March 2025
  • Constructor Details

    • SetWebhook

      public SetWebhook(String url, Api api)
      Required
      Parameters:
      url - url
      api -
  • Method Details

    • certificate

      public SetWebhook certificate(File certificate)
      Optional
      Parameters:
      certificate - Upload your public key certificate so that the root certificate in use can be checked.
      Returns:
      SetWebhook
      See Also:
    • ipAddress

      public SetWebhook ipAddress(String ip_address)
      Optional
      Parameters:
      ip_address - The fixed IP address which will be used to send webhook requests instead of the IP address resolved through DNS
      Returns:
      SetWebhook
    • maxConnections

      public SetWebhook maxConnections(int max_connections)
      Optional
      Parameters:
      max_connections - The maximum allowed number of simultaneous HTTPS connections to the webhook for update delivery, 1-100. Defaults to 40. Use lower values to limit the load on your bot's server, and higher values to increase your bot's throughput.
      Returns:
      SetWebhook
    • allowedUpdates

      public SetWebhook allowedUpdates(Updates[] allowed_updates)
      Optional
      Parameters:
      allowed_updates - A JSON-serialized list of the update types you want your bot to receive.
      Returns:
      SetWebhook
    • dropPendingUpdates

      public SetWebhook dropPendingUpdates(Boolean drop_pending_updates)
      Optional
      Parameters:
      drop_pending_updates - Pass True to drop all pending updates
      Returns:
      SetWebhook
    • secretToken

      public SetWebhook secretToken(String secret_token)
      Optional
      Parameters:
      secret_token - A secret token to be sent in a header “X-Telegram-Bot-Api-Secret-Token” in every webhook request, 1-256 characters. Only characters A-Z, a-z, 0-9, _ and - are allowed. The header is useful to ensure that the request comes from a webhook set by you.
      Returns:
      SetWebhook