HTTP 401 · Unauthorized
HTTP 401 Authentication

When & why it happens

A required auth key perm was omitted from the request. Populate it and retry.

Handling in gogram

Surfaced as *gogram.ErrResponseCode. Match on the message:

if err, ok := err.(*gogram.ErrResponseCode); ok { if err.Message == "AUTH_KEY_PERM_EMPTY" { // handle this error } }