Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 51 additions & 0 deletions examples/FaxDraftCreateExample.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
using System;
using System.Collections.Generic;

using Dropbox.Sign.Api;
using Dropbox.Sign.Client;
using Dropbox.Sign.Model;

namespace Dropbox.SignSandbox;

public class FaxDraftCreateExample
{
public static void Run()
{
var config = new Configuration();
config.Username = "YOUR_API_KEY";

var editorOptions = new SubEditorPageOptions(
forceUploadPage: false,
forceEditorPage: true,
forceReviewPage: true
);
var faxDraftCreateRequest = new FaxDraftCreateRequest(
clientId: "b6b8e7deaf8f0b95c029dca049356d4a2cf9710a",
fileUrls: new List<string>
{
"https://www.dropbox.com/s/ad9qnhbrjjn64tu/mutual-NDA-example.pdf?dl=1",
},
recipients: new List<string>
{
"+14155552671",
},
editorOptions: editorOptions,
testMode: true
);

try
{
var response = new FaxApi(config).FaxDraftCreate(
faxDraftCreateRequest: faxDraftCreateRequest
);

Console.WriteLine(response);
}
catch (ApiException e)
{
Console.WriteLine("Exception when calling FaxApi#FaxDraftCreate: " + e.Message);
Console.WriteLine("Status Code: " + e.ErrorCode);
Console.WriteLine(e.StackTrace);
}
}
}
48 changes: 48 additions & 0 deletions examples/FaxDraftCreateExample.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
package com.dropbox.sign_sandbox;

import com.dropbox.sign.ApiException;
import com.dropbox.sign.Configuration;
import com.dropbox.sign.api.FaxApi;
import com.dropbox.sign.auth.HttpBasicAuth;
import com.dropbox.sign.model.FaxDraftCreateRequest;
import com.dropbox.sign.model.SubEditorPageOptions;

import java.util.List;

public class FaxDraftCreateExample
{
public static void main(String[] args)
{
var config = Configuration.getDefaultApiClient();
((HttpBasicAuth) config.getAuthentication("api_key")).setUsername("YOUR_API_KEY");

var editorOptions = new SubEditorPageOptions();
editorOptions.forceUploadPage(false);
editorOptions.forceEditorPage(true);
editorOptions.forceReviewPage(true);

var faxDraftCreateRequest = new FaxDraftCreateRequest();
faxDraftCreateRequest.clientId("b6b8e7deaf8f0b95c029dca049356d4a2cf9710a");
faxDraftCreateRequest.fileUrls(List.of(
"https://www.dropbox.com/s/ad9qnhbrjjn64tu/mutual-NDA-example.pdf?dl=1"
));
faxDraftCreateRequest.recipients(List.of("+14155552671"));
faxDraftCreateRequest.editorOptions(editorOptions);
faxDraftCreateRequest.testMode(true);

try
{
var response = new FaxApi(config).faxDraftCreate(
faxDraftCreateRequest
);

System.out.println(response);
} catch (ApiException e) {
System.err.println("Exception when calling FaxApi#faxDraftCreate");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
36 changes: 36 additions & 0 deletions examples/FaxDraftCreateExample.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?php

namespace Dropbox\SignSandbox;

require_once __DIR__ . '/../vendor/autoload.php';

use Dropbox;

$config = Dropbox\Sign\Configuration::getDefaultConfiguration();
$config->setUsername("YOUR_API_KEY");

$editor_options = (new Dropbox\Sign\Model\SubEditorPageOptions())
->setForceUploadPage(false)
->setForceEditorPage(true)
->setForceReviewPage(true);

$fax_draft_create_request = (new Dropbox\Sign\Model\FaxDraftCreateRequest())
->setClientId("b6b8e7deaf8f0b95c029dca049356d4a2cf9710a")
->setFileUrls([
"https://www.dropbox.com/s/ad9qnhbrjjn64tu/mutual-NDA-example.pdf?dl=1",
])
->setRecipients([
"+14155552671",
])
->setEditorOptions($editor_options)
->setTestMode(true);

try {
$response = (new Dropbox\Sign\Api\FaxApi(config: $config))->faxDraftCreate(
fax_draft_create_request: $fax_draft_create_request,
);

print_r($response);
} catch (Dropbox\Sign\ApiException $e) {
echo "Exception when calling FaxApi#faxDraftCreate: {$e->getMessage()}";
}
32 changes: 32 additions & 0 deletions examples/FaxDraftCreateExample.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
from pprint import pprint

from dropbox_sign import ApiClient, ApiException, Configuration, api, models

configuration = Configuration(
username="YOUR_API_KEY",
)

with ApiClient(configuration) as api_client:
editor_options = models.SubEditorPageOptions(
force_upload_page=False,
force_editor_page=True,
force_review_page=True,
)
fax_draft_create_request = models.FaxDraftCreateRequest(
client_id="b6b8e7deaf8f0b95c029dca049356d4a2cf9710a",
file_urls=[
"https://www.dropbox.com/s/ad9qnhbrjjn64tu/mutual-NDA-example.pdf?dl=1",
],
recipients=["+14155552671"],
editor_options=editor_options,
test_mode=True,
)

try:
response = api.FaxApi(api_client).fax_draft_create(
fax_draft_create_request=fax_draft_create_request,
)

pprint(response)
except ApiException as e:
print("Exception when calling FaxApi#fax_draft_create: %s\n" % e)
30 changes: 30 additions & 0 deletions examples/FaxDraftCreateExample.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
require "json"
require "dropbox-sign"

Dropbox::Sign.configure do |config|
config.username = "YOUR_API_KEY"
end

editor_options = Dropbox::Sign::SubEditorPageOptions.new
editor_options.force_upload_page = false
editor_options.force_editor_page = true
editor_options.force_review_page = true

fax_draft_create_request = Dropbox::Sign::FaxDraftCreateRequest.new
fax_draft_create_request.client_id = "b6b8e7deaf8f0b95c029dca049356d4a2cf9710a"
fax_draft_create_request.file_urls = [
"https://www.dropbox.com/s/ad9qnhbrjjn64tu/mutual-NDA-example.pdf?dl=1",
]
fax_draft_create_request.recipients = ["+14155552671"]
fax_draft_create_request.editor_options = editor_options
fax_draft_create_request.test_mode = true

begin
response = Dropbox::Sign::FaxApi.new.fax_draft_create(
fax_draft_create_request,
)

p response
rescue Dropbox::Sign::ApiError => e
puts "Exception when calling FaxApi#fax_draft_create: #{e}"
end
8 changes: 8 additions & 0 deletions examples/FaxDraftCreateExample.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
curl -X POST 'https://api.hellosign.com/v3/fax/draft/create' \
-u 'YOUR_API_KEY:' \
-F 'client_id=YOUR_CLIENT_ID' \
-F 'file_urls[0]=https://www.dropbox.com/s/ad9qnhbrjjn64tu/mutual-NDA-example.pdf?dl=1' \
-F 'recipients[0]=+14155552671' \
-F 'editor_options[force_editor_page]=1' \
-F 'editor_options[force_review_page]=1' \
-F 'test_mode=1'
28 changes: 28 additions & 0 deletions examples/FaxDraftCreateExample.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import api from "@dropbox/sign"
import models from "@dropbox/sign"

const apiCaller = new api.FaxApi();
apiCaller.username = "YOUR_API_KEY";

const faxDraftCreateRequest: models.FaxDraftCreateRequest = {
clientId: "b6b8e7deaf8f0b95c029dca049356d4a2cf9710a",
fileUrls: [
"https://www.dropbox.com/s/ad9qnhbrjjn64tu/mutual-NDA-example.pdf?dl=1",
],
recipients: ["+14155552671"],
editorOptions: {
forceUploadPage: false,
forceEditorPage: true,
forceReviewPage: true,
},
testMode: true,
};

apiCaller.faxDraftCreate(
faxDraftCreateRequest,
).then(response => {
console.log(response.body);
}).catch(error => {
console.log("Exception when calling FaxApi#faxDraftCreate:");
console.log(error.body);
});
15 changes: 15 additions & 0 deletions examples/json/FaxDraftCreateEmbeddedRequest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"client_id": "b6b8e7deaf8f0b95c029dca049356d4a2cf9710a",
"file_urls": [
"https://www.dropbox.com/s/ad9qnhbrjjn64tu/mutual-NDA-example.pdf?dl=1"
],
"recipients": [
"+14155552671"
],
"editor_options": {
"force_upload_page": false,
"force_editor_page": true,
"force_review_page": true
},
"test_mode": true
}
7 changes: 7 additions & 0 deletions examples/json/FaxDraftCreateEmbeddedResponse.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"fax_draft": {
"fax_id": "c2e9691c85d9d6fa6ae773842e3680b2b8650f1d",
"url": "https://embedded.fax.dropbox.com/prep-and-send/embedded-fax?cached_params_token=30c4d8df776038c2fa5f7094c3718937",
"expires_at": 1787857200
}
}
6 changes: 6 additions & 0 deletions examples/json/FaxDraftCreateRequest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"file_urls": [
"https://www.dropbox.com/s/ad9qnhbrjjn64tu/mutual-NDA-example.pdf?dl=1"
],
"test_mode": true
}
7 changes: 7 additions & 0 deletions examples/json/FaxDraftCreateResponse.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"fax_draft": {
"fax_id": "c2e9691c85d9d6fa6ae773842e3680b2b8650f1d",
"url": "https://app.fax.dropbox.com/prep-and-send/30c4d8df776038c2fa5f7094c3718937b8650f1d",
"expires_at": 1787857200
}
}
Loading
Loading