click-to-copy function for API URL buttons