The simplest thing to do would be use non–pretty permalinks.
It is often overlooked, but you can just form a link like example.com?p=123
and WordPress will understand it and automagically redirect to pretty permalink too (if enabled, which is typically is).
Only need site URL and ID for the post, no PHP calls, no complex stitching it together from data.