Skip to main content

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

NameTypeRequiredDescription
UsernamestringyesusernameAccepted characters: A-z (case-insensitive), 0-9 and underscores.Length: 5-32 characters.

Returns

bool

Possible errors

CodeTypeDescription
400USERNAME_INVALIDThe provided username is not valid.
400USERNAME_OCCUPIEDThe provided username is already occupied.
400USERNAME_PURCHASE_AVAILABLEThe specified username can be purchased on https://fragment.com.

References