code: def api_reference(root_url, service, version):
      
      root_url = root_url.rstrip('/')
      if root_url == OLD_ROOT_URL:
          return 'https://references.taskcluster.net/{}/{}/api.json'.format(service, version)
      else:
          return '{}/references/{}/{}/api.json'.format(root_url, service, version)
docs: Generate URL for a Taskcluster api reference.