|
| 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.FaxApi; |
| 6 | +import com.dropbox.sign.auth.HttpBasicAuth; |
| 7 | +import com.dropbox.sign.model.FaxDraftCreateRequest; |
| 8 | +import com.dropbox.sign.model.SubEditorPageOptions; |
| 9 | + |
| 10 | +import java.util.List; |
| 11 | + |
| 12 | +public class FaxDraftCreateExample |
| 13 | +{ |
| 14 | + public static void main(String[] args) |
| 15 | + { |
| 16 | + var config = Configuration.getDefaultApiClient(); |
| 17 | + ((HttpBasicAuth) config.getAuthentication("api_key")).setUsername("YOUR_API_KEY"); |
| 18 | + |
| 19 | + var editorOptions = new SubEditorPageOptions(); |
| 20 | + editorOptions.forceUploadPage(false); |
| 21 | + editorOptions.forceEditorPage(true); |
| 22 | + editorOptions.forceReviewPage(true); |
| 23 | + |
| 24 | + var faxDraftCreateRequest = new FaxDraftCreateRequest(); |
| 25 | + faxDraftCreateRequest.clientId("b6b8e7deaf8f0b95c029dca049356d4a2cf9710a"); |
| 26 | + faxDraftCreateRequest.fileUrls(List.of( |
| 27 | + "https://www.dropbox.com/s/ad9qnhbrjjn64tu/mutual-NDA-example.pdf?dl=1" |
| 28 | + )); |
| 29 | + faxDraftCreateRequest.recipients(List.of("+14155552671")); |
| 30 | + faxDraftCreateRequest.editorOptions(editorOptions); |
| 31 | + faxDraftCreateRequest.testMode(true); |
| 32 | + |
| 33 | + try |
| 34 | + { |
| 35 | + var response = new FaxApi(config).faxDraftCreate( |
| 36 | + faxDraftCreateRequest |
| 37 | + ); |
| 38 | + |
| 39 | + System.out.println(response); |
| 40 | + } catch (ApiException e) { |
| 41 | + System.err.println("Exception when calling FaxApi#faxDraftCreate"); |
| 42 | + System.err.println("Status code: " + e.getCode()); |
| 43 | + System.err.println("Reason: " + e.getResponseBody()); |
| 44 | + System.err.println("Response headers: " + e.getResponseHeaders()); |
| 45 | + e.printStackTrace(); |
| 46 | + } |
| 47 | + } |
| 48 | +} |
0 commit comments