If you are looking for sample code to create connection record using WebAPI for Dynamics 365 CE, this post will help you. I am creating connection record for opportunity, you can change lookups entity based on your requirement. Hope it will help someone !!