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 - 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 ipAddress)
      Optional
      Parameters:
      ipAddress - 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 maxConnections)
      Optional
      Parameters:
      maxConnections - 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[] allowedUpdates)
      Optional
      Parameters:
      allowedUpdates - A JSON-serialized list of the update types you want your bot to receive.
      Returns:
      SetWebhook
    • dropPendingUpdates

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

      public SetWebhook secretToken(String secretToken)
      Optional
      Parameters:
      secretToken - 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