I assume error 1223 says something about a missing license?
Did you get an "activation code" in an email from MDA for the license? I've never heard of a "license key".
You paste the activation code into iLok Manager to get the license. Then you activate the license to your iLok USB stick or to your iLok cloud account.
Hauptwerk doesn't ask you for licenses -- it asks iLok.
From the HW user guide talking about setting up the HW license, this is the same process:
"Use iLok License Manager to log into your iLok account, and then use Licenses | Redeem Activation Code within iLok License Manager to enter the license activation code that you were sent."
Then you need to activate the license, which is still done in iLok, not in HW.