public EnvelopeTemplateResults listTemplates(String accountId, TemplatesApi.ListTemplatesOptions options) throws ApiException {
    Object localVarPostBody = "{}";
    
      // verify the required parameter 'accountId' is set
      if (accountId == null) {
      throw new ApiException(400, "Missing the required parameter 'accountId' when calling listTemplates");
      }
    
    // create path and map variables
    String localVarPath = "/v2/accounts/{accountId}/templates".replaceAll("\\{format\\}","json")
      .replaceAll("\\{" + "accountId" + "\\}", apiClient.escapeString(accountId.toString()));

    // query params
    java.util.List<Pair> localVarQueryParams = new java.util.ArrayList<Pair>();
    java.util.Map<String, String> localVarHeaderParams = new java.util.HashMap<String, String>();
    java.util.Map<String, Object> localVarFormParams = new java.util.HashMap<String, Object>();

    if (options != null) {
       localVarQueryParams.addAll(apiClient.parameterToPairs("", "count", options.count));
       localVarQueryParams.addAll(apiClient.parameterToPairs("", "folder", options.folder));
       localVarQueryParams.addAll(apiClient.parameterToPairs("", "folder_ids", options.folderIds));
       localVarQueryParams.addAll(apiClient.parameterToPairs("", "from_date", options.fromDate));
       localVarQueryParams.addAll(apiClient.parameterToPairs("", "include", options.include));
       localVarQueryParams.addAll(apiClient.parameterToPairs("", "modified_from_date", options.modifiedFromDate));
       localVarQueryParams.addAll(apiClient.parameterToPairs("", "modified_to_date", options.modifiedToDate));
       localVarQueryParams.addAll(apiClient.parameterToPairs("", "order", options.order));
       localVarQueryParams.addAll(apiClient.parameterToPairs("", "order_by", options.orderBy));
       localVarQueryParams.addAll(apiClient.parameterToPairs("", "search_text", options.searchText));
       localVarQueryParams.addAll(apiClient.parameterToPairs("", "shared_by_me", options.sharedByMe));
       localVarQueryParams.addAll(apiClient.parameterToPairs("", "start_position", options.startPosition));
       localVarQueryParams.addAll(apiClient.parameterToPairs("", "to_date", options.toDate));
       localVarQueryParams.addAll(apiClient.parameterToPairs("", "used_from_date", options.usedFromDate));
       localVarQueryParams.addAll(apiClient.parameterToPairs("", "used_to_date", options.usedToDate));
       localVarQueryParams.addAll(apiClient.parameterToPairs("", "user_filter", options.userFilter));
       localVarQueryParams.addAll(apiClient.parameterToPairs("", "user_id", options.userId));
    }
    
    
      final String[] localVarAccepts = {
    "application/json"
      };
      final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);

      final String[] localVarContentTypes = {
    
      };
      final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);

      String[] localVarAuthNames = new String[] { "docusignAccessCode" }; //{  };

        GenericType<EnvelopeTemplateResults> localVarReturnType = new GenericType<EnvelopeTemplateResults>() {};
        return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
          }
public EnvelopeTemplateResults listTemplates ( String accountId , TemplatesApi . ListTemplatesOptions options ) throws ApiException { Object localVarPostBody = "{}" ; if ( accountId == null ) { throw new ApiException ( 400 , "Missing the required parameter 'accountId' when calling listTemplates" ) ; } String localVarPath = "/v2/accounts/{accountId}/templates" . replaceAll ( "\\{format\\}" , "json" ) . replaceAll ( "\\{" + "accountId" + "\\}" , apiClient . escapeString ( accountId . toString ( ) ) ) ; java . util . List < Pair > localVarQueryParams = new java . util . ArrayList < Pair > ( ) ; java . util . Map < String , String > localVarHeaderParams = new java . util . HashMap < String , String > ( ) ; java . util . Map < String , Object > localVarFormParams = new java . util . HashMap < String , Object > ( ) ; if ( options != null ) { localVarQueryParams . addAll ( apiClient . parameterToPairs ( "" , "count" , options . count ) ) ; localVarQueryParams . addAll ( apiClient . parameterToPairs ( "" , "folder" , options . folder ) ) ; localVarQueryParams . addAll ( apiClient . parameterToPairs ( "" , "folder_ids" , options . folderIds ) ) ; localVarQueryParams . addAll ( apiClient . parameterToPairs ( "" , "from_date" , options . fromDate ) ) ; localVarQueryParams . addAll ( apiClient . parameterToPairs ( "" , "include" , options . include ) ) ; localVarQueryParams . addAll ( apiClient . parameterToPairs ( "" , "modified_from_date" , options . modifiedFromDate ) ) ; localVarQueryParams . addAll ( apiClient . parameterToPairs ( "" , "modified_to_date" , options . modifiedToDate ) ) ; localVarQueryParams . addAll ( apiClient . parameterToPairs ( "" , "order" , options . order ) ) ; localVarQueryParams . addAll ( apiClient . parameterToPairs ( "" , "order_by" , options . orderBy ) ) ; localVarQueryParams . addAll ( apiClient . parameterToPairs ( "" , "search_text" , options . searchText ) ) ; localVarQueryParams . addAll ( apiClient . parameterToPairs ( "" , "shared_by_me" , options . sharedByMe ) ) ; localVarQueryParams . addAll ( apiClient . parameterToPairs ( "" , "start_position" , options . startPosition ) ) ; localVarQueryParams . addAll ( apiClient . parameterToPairs ( "" , "to_date" , options . toDate ) ) ; localVarQueryParams . addAll ( apiClient . parameterToPairs ( "" , "used_from_date" , options . usedFromDate ) ) ; localVarQueryParams . addAll ( apiClient . parameterToPairs ( "" , "used_to_date" , options . usedToDate ) ) ; localVarQueryParams . addAll ( apiClient . parameterToPairs ( "" , "user_filter" , options . userFilter ) ) ; localVarQueryParams . addAll ( apiClient . parameterToPairs ( "" , "user_id" , options . userId ) ) ; } final String [ ] localVarAccepts = { "application/json" } ; final String localVarAccept = apiClient . selectHeaderAccept ( localVarAccepts ) ; final String [ ] localVarContentTypes = { } ; final String localVarContentType = apiClient . selectHeaderContentType ( localVarContentTypes ) ; String [ ] localVarAuthNames = new String [ ] { "docusignAccessCode" } ; GenericType < EnvelopeTemplateResults > localVarReturnType = new GenericType < EnvelopeTemplateResults > ( ) { } ; return apiClient . invokeAPI ( localVarPath , "GET" , localVarQueryParams , localVarPostBody , localVarHeaderParams , localVarFormParams , localVarAccept , localVarContentType , localVarAuthNames , localVarReturnType ) ; }
Gets the definition of a template.
Retrieves the list of templates for the specified account. The request can be limited to a specific folder.
@param accountId The external account number (int) or account ID Guid. (required)
@param options for modifying the method behavior.
@return EnvelopeTemplateResults
@throws ApiException if fails to make API call