Skip to content

Commit 5c20615

Browse files
committed
Add Embedded Fax API to OpenAPI
1 parent f00994d commit 5c20615

108 files changed

Lines changed: 11635 additions & 3 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

examples/FaxDraftCreateExample.cs

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
using System;
2+
using System.Collections.Generic;
3+
4+
using Dropbox.Sign.Api;
5+
using Dropbox.Sign.Client;
6+
using Dropbox.Sign.Model;
7+
8+
namespace Dropbox.SignSandbox;
9+
10+
public class FaxDraftCreateExample
11+
{
12+
public static void Run()
13+
{
14+
var config = new Configuration();
15+
config.Username = "YOUR_API_KEY";
16+
17+
var editorOptions = new SubEditorPageOptions(
18+
forceUploadPage: false,
19+
forceEditorPage: true,
20+
forceReviewPage: true
21+
);
22+
var faxDraftCreateRequest = new FaxDraftCreateRequest(
23+
clientId: "b6b8e7deaf8f0b95c029dca049356d4a2cf9710a",
24+
fileUrls: new List<string>
25+
{
26+
"https://www.dropbox.com/s/ad9qnhbrjjn64tu/mutual-NDA-example.pdf?dl=1",
27+
},
28+
recipients: new List<string>
29+
{
30+
"+14155552671",
31+
},
32+
editorOptions: editorOptions,
33+
testMode: true
34+
);
35+
36+
try
37+
{
38+
var response = new FaxApi(config).FaxDraftCreate(
39+
faxDraftCreateRequest: faxDraftCreateRequest
40+
);
41+
42+
Console.WriteLine(response);
43+
}
44+
catch (ApiException e)
45+
{
46+
Console.WriteLine("Exception when calling FaxApi#FaxDraftCreate: " + e.Message);
47+
Console.WriteLine("Status Code: " + e.ErrorCode);
48+
Console.WriteLine(e.StackTrace);
49+
}
50+
}
51+
}
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
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+
}

examples/FaxDraftCreateExample.php

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<?php
2+
3+
namespace Dropbox\SignSandbox;
4+
5+
require_once __DIR__ . '/../vendor/autoload.php';
6+
7+
use Dropbox;
8+
9+
$config = Dropbox\Sign\Configuration::getDefaultConfiguration();
10+
$config->setUsername("YOUR_API_KEY");
11+
12+
$editor_options = (new Dropbox\Sign\Model\SubEditorPageOptions())
13+
->setForceUploadPage(false)
14+
->setForceEditorPage(true)
15+
->setForceReviewPage(true);
16+
17+
$fax_draft_create_request = (new Dropbox\Sign\Model\FaxDraftCreateRequest())
18+
->setClientId("b6b8e7deaf8f0b95c029dca049356d4a2cf9710a")
19+
->setFileUrls([
20+
"https://www.dropbox.com/s/ad9qnhbrjjn64tu/mutual-NDA-example.pdf?dl=1",
21+
])
22+
->setRecipients([
23+
"+14155552671",
24+
])
25+
->setEditorOptions($editor_options)
26+
->setTestMode(true);
27+
28+
try {
29+
$response = (new Dropbox\Sign\Api\FaxApi(config: $config))->faxDraftCreate(
30+
fax_draft_create_request: $fax_draft_create_request,
31+
);
32+
33+
print_r($response);
34+
} catch (Dropbox\Sign\ApiException $e) {
35+
echo "Exception when calling FaxApi#faxDraftCreate: {$e->getMessage()}";
36+
}

examples/FaxDraftCreateExample.py

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
from pprint import pprint
2+
3+
from dropbox_sign import ApiClient, ApiException, Configuration, api, models
4+
5+
configuration = Configuration(
6+
username="YOUR_API_KEY",
7+
)
8+
9+
with ApiClient(configuration) as api_client:
10+
editor_options = models.SubEditorPageOptions(
11+
force_upload_page=False,
12+
force_editor_page=True,
13+
force_review_page=True,
14+
)
15+
fax_draft_create_request = models.FaxDraftCreateRequest(
16+
client_id="b6b8e7deaf8f0b95c029dca049356d4a2cf9710a",
17+
file_urls=[
18+
"https://www.dropbox.com/s/ad9qnhbrjjn64tu/mutual-NDA-example.pdf?dl=1",
19+
],
20+
recipients=["+14155552671"],
21+
editor_options=editor_options,
22+
test_mode=True,
23+
)
24+
25+
try:
26+
response = api.FaxApi(api_client).fax_draft_create(
27+
fax_draft_create_request=fax_draft_create_request,
28+
)
29+
30+
pprint(response)
31+
except ApiException as e:
32+
print("Exception when calling FaxApi#fax_draft_create: %s\n" % e)

examples/FaxDraftCreateExample.rb

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
require "json"
2+
require "dropbox-sign"
3+
4+
Dropbox::Sign.configure do |config|
5+
config.username = "YOUR_API_KEY"
6+
end
7+
8+
editor_options = Dropbox::Sign::SubEditorPageOptions.new
9+
editor_options.force_upload_page = false
10+
editor_options.force_editor_page = true
11+
editor_options.force_review_page = true
12+
13+
fax_draft_create_request = Dropbox::Sign::FaxDraftCreateRequest.new
14+
fax_draft_create_request.client_id = "b6b8e7deaf8f0b95c029dca049356d4a2cf9710a"
15+
fax_draft_create_request.file_urls = [
16+
"https://www.dropbox.com/s/ad9qnhbrjjn64tu/mutual-NDA-example.pdf?dl=1",
17+
]
18+
fax_draft_create_request.recipients = ["+14155552671"]
19+
fax_draft_create_request.editor_options = editor_options
20+
fax_draft_create_request.test_mode = true
21+
22+
begin
23+
response = Dropbox::Sign::FaxApi.new.fax_draft_create(
24+
fax_draft_create_request,
25+
)
26+
27+
p response
28+
rescue Dropbox::Sign::ApiError => e
29+
puts "Exception when calling FaxApi#fax_draft_create: #{e}"
30+
end

examples/FaxDraftCreateExample.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
curl -X POST 'https://api.hellosign.com/v3/fax/draft/create' \
2+
-u 'YOUR_API_KEY:' \
3+
-F 'client_id=YOUR_CLIENT_ID' \
4+
-F 'file_urls[0]=https://www.dropbox.com/s/ad9qnhbrjjn64tu/mutual-NDA-example.pdf?dl=1' \
5+
-F 'recipients[0]=+14155552671' \
6+
-F 'editor_options[force_editor_page]=1' \
7+
-F 'editor_options[force_review_page]=1' \
8+
-F 'test_mode=1'

examples/FaxDraftCreateExample.ts

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
import api from "@dropbox/sign"
2+
import models from "@dropbox/sign"
3+
4+
const apiCaller = new api.FaxApi();
5+
apiCaller.username = "YOUR_API_KEY";
6+
7+
const faxDraftCreateRequest: models.FaxDraftCreateRequest = {
8+
clientId: "b6b8e7deaf8f0b95c029dca049356d4a2cf9710a",
9+
fileUrls: [
10+
"https://www.dropbox.com/s/ad9qnhbrjjn64tu/mutual-NDA-example.pdf?dl=1",
11+
],
12+
recipients: ["+14155552671"],
13+
editorOptions: {
14+
forceUploadPage: false,
15+
forceEditorPage: true,
16+
forceReviewPage: true,
17+
},
18+
testMode: true,
19+
};
20+
21+
apiCaller.faxDraftCreate(
22+
faxDraftCreateRequest,
23+
).then(response => {
24+
console.log(response.body);
25+
}).catch(error => {
26+
console.log("Exception when calling FaxApi#faxDraftCreate:");
27+
console.log(error.body);
28+
});
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"client_id": "b6b8e7deaf8f0b95c029dca049356d4a2cf9710a",
3+
"file_urls": [
4+
"https://www.dropbox.com/s/ad9qnhbrjjn64tu/mutual-NDA-example.pdf?dl=1"
5+
],
6+
"recipients": [
7+
"+14155552671"
8+
],
9+
"editor_options": {
10+
"force_upload_page": false,
11+
"force_editor_page": true,
12+
"force_review_page": true
13+
},
14+
"test_mode": true
15+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"fax_draft": {
3+
"fax_id": "c2e9691c85d9d6fa6ae773842e3680b2b8650f1d",
4+
"url": "https://embedded.fax.dropbox.com/prep-and-send/embedded-fax?cached_params_token=30c4d8df776038c2fa5f7094c3718937",
5+
"expires_at": 1787857200
6+
}
7+
}

0 commit comments

Comments
 (0)