|
| 1 | +package com.dropbox.sign_sandbox; |
| 2 | + |
| 3 | +import com.dropbox.sign.ApiException; |
| 4 | +import com.dropbox.sign.Configuration; |
| 5 | +import com.dropbox.sign.api.*; |
| 6 | +import com.dropbox.sign.auth.*; |
| 7 | +import com.dropbox.sign.JSON; |
| 8 | +import com.dropbox.sign.model.*; |
| 9 | + |
| 10 | +import java.io.File; |
| 11 | +import java.math.BigDecimal; |
| 12 | +import java.time.LocalDate; |
| 13 | +import java.time.OffsetDateTime; |
| 14 | +import java.util.ArrayList; |
| 15 | +import java.util.List; |
| 16 | +import java.util.Map; |
| 17 | + |
| 18 | +public class TemplateUpdateExample |
| 19 | +{ |
| 20 | + public static void main(String[] args) |
| 21 | + { |
| 22 | + var config = Configuration.getDefaultApiClient(); |
| 23 | + ((HttpBasicAuth) config.getAuthentication("api_key")).setUsername("YOUR_API_KEY"); |
| 24 | + // ((HttpBearerAuth) config.getAuthentication("oauth2")).setBearerToken("YOUR_ACCESS_TOKEN"); |
| 25 | + |
| 26 | + var templateUpdateRequest = new TemplateUpdateRequest(); |
| 27 | + templateUpdateRequest.allowFormView(false); |
| 28 | + templateUpdateRequest.title("Test Title"); |
| 29 | + templateUpdateRequest.subject("Test Subject"); |
| 30 | + templateUpdateRequest.message("Test Message"); |
| 31 | + templateUpdateRequest.ccRoles(List.of ( |
| 32 | + "CC Role 1", |
| 33 | + "CC Role 2" |
| 34 | + )); |
| 35 | + |
| 36 | + try |
| 37 | + { |
| 38 | + var response = new TemplateApi(config).templateUpdate( |
| 39 | + "f57db65d3f933b5316d398057a36176831451a35", // templateId |
| 40 | + templateUpdateRequest |
| 41 | + ); |
| 42 | + |
| 43 | + System.out.println(response); |
| 44 | + } catch (ApiException e) { |
| 45 | + System.err.println("Exception when calling TemplateApi#templateUpdate"); |
| 46 | + System.err.println("Status code: " + e.getCode()); |
| 47 | + System.err.println("Reason: " + e.getResponseBody()); |
| 48 | + System.err.println("Response headers: " + e.getResponseHeaders()); |
| 49 | + e.printStackTrace(); |
| 50 | + } |
| 51 | + } |
| 52 | +} |
0 commit comments