Bot Error Codes

301

301 is not an error, it is a redirect. It is likely that you try to use HTTP instead of HTTPS.

5xx

Server error, need to wait some time and try again.

401

The token is invalid.

403

The bot can't write to specified chat.

409

There are can be only one request getUpdates/setWebhook in a time. GetUpdates can't be used while webhook is set.