Welcome to Apple Support Communities.
If I'm understanding correctly, you are having some trouble signing into iMessage with your Apple ID because of an error. I will be glad to assist. Take a look at the following article to see if it helps:
If you get an error when trying to activate iMessage or FaceTime
Cheers.