Sign in
agent:

Fetch a Docusign template by ID

There was a problem that the LLM was not able to address. Please rephrase your prompt and try again.

Retrieve details of a specific DocuSign template using its unique template ID.

import requests # Configuration base_url = "https://demo.docusign.net/restapi" # For production, use https://www.docusign.net/restapi # Endpoint to fetch a template url = f"{base_url}/v2.1/accounts/{account_id}/templates/{template_id}" # Headers with the access token headers = { "Authorization": f"Bearer {access_token}", "Content-Type": "application/json" } # Make the API call response = requests.get(url, headers=headers) # Handle the response if response.status_code == 200: template = response.json() print("Template Details:") print(f"Name: {template['name']}") print(f"ID: {template['templateId']}") print(f"Description: {template.get('description', 'No description')}") print(f"Shared: {template.get('shared', 'No info')}") elif response.status_code == 404: print(f"Template with ID '{template_id}' not found. Please check the template ID and try again.") else: print("An error occurred while fetching the template:") print(f"Status Code: {response.status_code}") print("Response:", response.json())
copied