To generate a new API token go to your profile section
and then select "API Keys" from the sidebar
Choose any name you want for your new API token and hit the "Create Token" button.
One your token is created, a popup will appear and you will be able to get your token value. Keep in mind that that is the only time when you will see the token so make sure that you don't lose it.
If you want to revoke any token that you have previously created, you can do it by clicking the "trash" icon next to the token's name within the list of active tokens.