ipad screen sharing with apple tv4
I want to be able to share my ipad with my apple tv 4, in the past I have opened airplay on both devices and it worked fine. At that time I had an earlier apple tv. when i go to connect the ipad to the apple tv it asks for a code, I have no idea what this is; is there a way to bypass this or any other suggestions would be much appreciated