setWebhook
Set a webhook URL to receive incoming updates. After setting a webhook, the getUpdates method will no longer work. Supports uploading a self-signed certificate.
Request
POST /:token/setwebhook
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| url | String | Yes | Webhook URL (must be HTTPS) |
| certificate | File | No | Self-signed SSL certificate in PEM format |
| ip_address | String | No | Fixed IP address for the webhook |
| max_connections | Integer | No | Maximum number of concurrent connections |
| allowed_updates | String[] | No | List of allowed update types to receive |
| secret_token | String | No | Secret token used to verify the request origin |
Response
Returns Boolean true on success.
json
{
"ok": true,
"result": true
}Error Codes
| Code | Description |
|---|---|
| 400 | Bad request parameters or invalid URL format |
| 401 | Invalid token |
| 403 | Bot does not have permission to perform this action |
