account.checkUsername
Validates a username and checks availability.
func (c *Client) AccountCheckUsername(ctx context.Context, username string) (bool, error)
Calling this method
client.Run(ctx, func(ctx context.Context) error {
api := client.API()
res, err := api.AccountCheckUsername(ctx, username)
if err != nil {
return err
}
_ = res // bool
return nil
})
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
Username | string | yes | usernameAccepted characters: A-z (case-insensitive), 0-9 and underscores.Length: 5-32 characters. |
Returns
bool
Possible errors
| Code | Type | Description |
|---|---|---|
| 400 | USERNAME_INVALID | The provided username is not valid. |
| 400 | USERNAME_OCCUPIED | The provided username is already occupied. |
| 400 | USERNAME_PURCHASE_AVAILABLE | The specified username can be purchased on https://fragment.com. |
References
- Official documentation
- Generated Go reference
- TL definition:
account.checkUsername#2714d86c