Skip to content

Latest commit

 

History

History
291 lines (218 loc) · 10 KB

File metadata and controls

291 lines (218 loc) · 10 KB

TemplatesApi

All URIs are relative to https://api.pandadoc.com

Method HTTP request Description
deleteTemplate DELETE /public/v1/templates/{id} Delete Template
detailsTemplate GET /public/v1/templates/{id}/details Details Template
listTemplates GET /public/v1/templates List Templates

deleteTemplate

deleteTemplate(id)

Delete Template

Delete a template

Example

// Import classes:
import com.pandadoc.client.ApiClient;
import com.pandadoc.client.ApiException;
import com.pandadoc.client.Configuration;
import com.pandadoc.client.auth.*;
import com.pandadoc.client.models.*;
import com.pandadoc.client.api.TemplatesApi;

import java.util.Arrays;
import java.io.File;
import java.util.List;

public class Example {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();
        defaultClient.setBasePath("https://api.pandadoc.com");
        
        // Configure API key authorization: apiKey
        ApiKeyAuth apiKey = (ApiKeyAuth) defaultClient.getAuthentication("apiKey");
        apiKey.setApiKey("YOUR API KEY");
        // Uncomment the following line to set a prefix for the API key, e.g. "API-Key" (defaults to null)
        //apiKey.setApiKeyPrefix("API-Key");

        // Configure OAuth2 access token for authorization: oauth2
        // OAuth oauth2 = (OAuth) defaultClient.getAuthentication("oauth2");
        // oauth2.setAccessToken("YOUR ACCESS TOKEN");

        TemplatesApi apiInstance = new TemplatesApi(defaultClient);
        // String | Template ID
        String id = "EE8yUNg5HztqVAuH85He8V";
        try {
            apiInstance.deleteTemplate(id);
        } catch (ApiException e) {
            System.err.println("Exception when calling TemplatesApi#deleteTemplate");
            System.err.println("Status code: " + e.getCode());
            System.err.println("Reason: " + e.getResponseBody());
            System.err.println("Response headers: " + e.getResponseHeaders());
            e.printStackTrace();
        }
    }
}

Parameters

Name Type Description Notes
id String Template ID

Return type

null (empty response body)

Authorization

apiKey, oauth2

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
204 No content -
400 Bad Request -
401 Authentication error -
403 Permission error -
404 Not found -
429 Too Many Requests -

detailsTemplate

TemplateDetailsResponse detailsTemplate(id)

Details Template

Return detailed data about a template.

Example

// Import classes:
import com.pandadoc.client.ApiClient;
import com.pandadoc.client.ApiException;
import com.pandadoc.client.Configuration;
import com.pandadoc.client.auth.*;
import com.pandadoc.client.models.*;
import com.pandadoc.client.api.TemplatesApi;

import java.util.Arrays;
import java.io.File;
import java.util.List;

public class Example {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();
        defaultClient.setBasePath("https://api.pandadoc.com");
        
        // Configure API key authorization: apiKey
        ApiKeyAuth apiKey = (ApiKeyAuth) defaultClient.getAuthentication("apiKey");
        apiKey.setApiKey("YOUR API KEY");
        // Uncomment the following line to set a prefix for the API key, e.g. "API-Key" (defaults to null)
        //apiKey.setApiKeyPrefix("API-Key");

        // Configure OAuth2 access token for authorization: oauth2
        // OAuth oauth2 = (OAuth) defaultClient.getAuthentication("oauth2");
        // oauth2.setAccessToken("YOUR ACCESS TOKEN");

        TemplatesApi apiInstance = new TemplatesApi(defaultClient);
        // String | Template ID
        String id = "EE8yUNg5HztqVAuH85He8V";
        try {
            TemplateDetailsResponse result = apiInstance.detailsTemplate(id);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling TemplatesApi#detailsTemplate");
            System.err.println("Status code: " + e.getCode());
            System.err.println("Reason: " + e.getResponseBody());
            System.err.println("Response headers: " + e.getResponseHeaders());
            e.printStackTrace();
        }
    }
}

Parameters

Name Type Description Notes
id String Template ID

Return type

TemplateDetailsResponse

Authorization

apiKey, oauth2

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 OK -
401 Authentication error -
403 Permission error -
404 Not found -
429 Too Many Requests -

listTemplates

TemplateListResponse listTemplates(q, shared, deleted, count, page, id, folderUuid, tag, fields)

List Templates

Optionally, filter by a search query or tags.

Example

// Import classes:
import com.pandadoc.client.ApiClient;
import com.pandadoc.client.ApiException;
import com.pandadoc.client.Configuration;
import com.pandadoc.client.auth.*;
import com.pandadoc.client.models.*;
import com.pandadoc.client.api.TemplatesApi;

import java.util.Arrays;
import java.io.File;
import java.util.List;

public class Example {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();
        defaultClient.setBasePath("https://api.pandadoc.com");
        
        // Configure API key authorization: apiKey
        ApiKeyAuth apiKey = (ApiKeyAuth) defaultClient.getAuthentication("apiKey");
        apiKey.setApiKey("YOUR API KEY");
        // Uncomment the following line to set a prefix for the API key, e.g. "API-Key" (defaults to null)
        //apiKey.setApiKeyPrefix("API-Key");

        // Configure OAuth2 access token for authorization: oauth2
        // OAuth oauth2 = (OAuth) defaultClient.getAuthentication("oauth2");
        // oauth2.setAccessToken("YOUR ACCESS TOKEN");

        TemplatesApi apiInstance = new TemplatesApi(defaultClient);
        // String | Optional search query. Filter by template name.
        String q = "Sample onboarding template";
        // Boolean | Returns only the shared templates.
        Boolean shared = true;
        // Boolean | Optional. Returns only the deleted templates.
        Boolean deleted = true;
        // Integer | Optionally, specify how many templates to return. Default is 50 templates, maximum is 100 templates.
        Integer count = 10;
        // Integer | Optionally, specify which page of the dataset to return.
        Integer page = 56;
        // String | Optionally, specify template ID.
        String id = "e9LxBesSL73AeZMzeYdfvV";
        // String | UUID of the folder where the templates are stored.
        String folderUuid = "xDKHoJ8DkwhiTQSUzNveCJ";
        // List<String> | Optional search tag. Filter by template tag.
        List<String> tag = Arrays.asList();
        // String | A comma-separated list of additional fields to include in the response.  Each field must be a valid template property.  Currently, only one additional field, `content_date_modified`, is supported.  For example, `GET /templates?fields=content_date_modified`.
        String fields = "fields_example";
        try {
            TemplateListResponse result = apiInstance.listTemplates(q, shared, deleted, count, page, id, folderUuid, tag, fields);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling TemplatesApi#listTemplates");
            System.err.println("Status code: " + e.getCode());
            System.err.println("Reason: " + e.getResponseBody());
            System.err.println("Response headers: " + e.getResponseHeaders());
            e.printStackTrace();
        }
    }
}

Parameters

Name Type Description Notes
q String Optional search query. Filter by template name. [optional]
shared Boolean Returns only the shared templates. [optional]
deleted Boolean Optional. Returns only the deleted templates. [optional]
count Integer Optionally, specify how many templates to return. Default is 50 templates, maximum is 100 templates. [optional]
page Integer Optionally, specify which page of the dataset to return. [optional]
id String Optionally, specify template ID. [optional]
folderUuid String UUID of the folder where the templates are stored. [optional]
tag List<String> Optional search tag. Filter by template tag. [optional]
fields String A comma-separated list of additional fields to include in the response. Each field must be a valid template property. Currently, only one additional field, `content_date_modified`, is supported. For example, `GET /templates?fields=content_date_modified`. [optional]

Return type

TemplateListResponse

Authorization

apiKey, oauth2

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 OK -
401 Authentication error -
429 Too Many Requests -