If you got your key outside of Blizzard, well then your probably going to have to open a support ticket with full details of how and where you 'won' the key.
I have the game but i can't play because i don't have any code.
What i have to do to "win" a code?
I cannot answer you how you can get a key, but you can sign up at beta sign-up button on top of this page.
Hope this helps you.
We're going to be automatically flagging for Hearthstone access any Battle.net account that opted-in for the Hearthstone Beta before Jan 7, 2014 and hasn't yet attached a key to their account. This will be done in the couple of weeks following that date.
We're not able to check to see if a particular Battle.net account was sent an invite already or resend an email upon request.
I'm available in the forums Monday - Friday, 12 pm - 8 pm Pacific Time
Please provide feedback! - https://www.surveymonkey.com/s/Omrakos