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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
39 changes: 39 additions & 0 deletions examples/AccountSettingsGetExample.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
using System;

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

namespace Dropbox.SignSandbox;

public class AccountSettingsGetExample
{
public static void Run()
{
var config = new Configuration();
config.Username = "YOUR_API_KEY";
// config.AccessToken = "YOUR_ACCESS_TOKEN";

try
{
var response = new AccountApi(config).AccountSettingsGet();
var company = response.Settings.Company;

Console.WriteLine(response);
Console.WriteLine(response.AccountId);
Console.WriteLine(company.Value);
Console.WriteLine(company.IsInherited);
Console.WriteLine(company.Source);
Console.WriteLine(company.Type);
Console.WriteLine(company.Writable);
Console.WriteLine(company.Lock.Mode);
Console.WriteLine(company.Lock.Source);
Console.WriteLine(response.Warnings);
}
catch (ApiException e)
{
Console.WriteLine("Exception when calling AccountApi#AccountSettingsGet: " + e.Message);
Console.WriteLine("Status Code: " + e.ErrorCode);
Console.WriteLine(e.StackTrace);
}
}
}
40 changes: 40 additions & 0 deletions examples/AccountSettingsGetExample.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
package com.dropbox.sign_sandbox;

import com.dropbox.sign.ApiException;
import com.dropbox.sign.Configuration;
import com.dropbox.sign.api.AccountApi;
import com.dropbox.sign.auth.HttpBasicAuth;
import com.dropbox.sign.model.SettingResponse;

public class AccountSettingsGetExample
{
public static void main(String[] args)
{
var config = Configuration.getDefaultApiClient();
((HttpBasicAuth) config.getAuthentication("api_key")).setUsername("YOUR_API_KEY");
// ((HttpBearerAuth) config.getAuthentication("oauth2")).setBearerToken("YOUR_ACCESS_TOKEN");

try
{
var response = new AccountApi(config).accountSettingsGet();
SettingResponse company = response.getSettings().getCompany();

System.out.println(response);
System.out.println(response.getAccountId());
System.out.println(company.getValue());
System.out.println(company.getIsInherited());
System.out.println(company.getSource());
System.out.println(company.getType());
System.out.println(company.getWritable());
System.out.println(company.getLock().getMode());
System.out.println(company.getLock().getSource());
System.out.println(response.getWarnings());
} catch (ApiException e) {
System.err.println("Exception when calling AccountApi#accountSettingsGet");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
35 changes: 35 additions & 0 deletions examples/AccountSettingsGetExample.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?php

namespace Dropbox\SignSandbox;

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

use Dropbox;

$config = Dropbox\Sign\Configuration::getDefaultConfiguration();
$config->setUsername('YOUR_API_KEY');
// $config->setAccessToken('YOUR_ACCESS_TOKEN');

try {
$response = (new Dropbox\Sign\Api\AccountApi(config: $config))->accountSettingsGet();
$company = $response->getSettings()->getCompany();

print_r($response);
print_r([
'account_id' => $response->getAccountId(),
'company' => [
'value' => $company->getValue(),
'is_inherited' => $company->getIsInherited(),
'source' => $company->getSource(),
'type' => $company->getType(),
'writable' => $company->getWritable(),
'lock' => [
'mode' => $company->getLock()->getMode(),
'source' => $company->getLock()->getSource(),
],
],
'warnings' => $response->getWarnings(),
]);
} catch (Dropbox\Sign\ApiException $e) {
echo "Exception when calling AccountApi#accountSettingsGet: {$e->getMessage()}";
}
32 changes: 32 additions & 0 deletions examples/AccountSettingsGetExample.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

configuration = Configuration(
username="YOUR_API_KEY",
# access_token="YOUR_ACCESS_TOKEN",
)

with ApiClient(configuration) as api_client:
try:
response = api.AccountApi(api_client).account_settings_get()
company = response.settings.company

pprint(response)
pprint({
"account_id": response.account_id,
"company": {
"value": company.value,
"is_inherited": company.is_inherited,
"source": company.source,
"type": company.type,
"writable": company.writable,
"lock": {
"mode": company.lock.mode,
"source": company.lock.source,
},
},
"warnings": response.warnings,
})
except ApiException as e:
print("Exception when calling AccountApi#account_settings_get: %s\n" % e)
30 changes: 30 additions & 0 deletions examples/AccountSettingsGetExample.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
require "dropbox-sign"

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

begin
response = Dropbox::Sign::AccountApi.new.account_settings_get
company = response.settings.company

p response
p({
account_id: response.account_id,
company: {
value: company.value,
is_inherited: company.is_inherited,
source: company.source,
type: company.type,
writable: company.writable,
lock: {
mode: company.lock.mode,
source: company.lock.source,
},
},
warnings: response.warnings,
})
rescue Dropbox::Sign::ApiError => e
puts "Exception when calling AccountApi#account_settings_get: #{e}"
end
20 changes: 20 additions & 0 deletions examples/AccountSettingsGetExample.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
curl -X GET 'https://api.hellosign.com/v3/account/settings' \
-u 'YOUR_API_KEY:'

# {
# "account_id": "ab55cd14a97219e36b5ff5fe23f2f9329b0c1e97",
# "settings": {
# "company": {
# "value": "Northwind",
# "is_inherited": false,
# "source": "account",
# "type": "string",
# "writable": true,
# "lock": {
# "mode": "members",
# "source": "default"
# }
# }
# },
# "warnings": []
# }
28 changes: 28 additions & 0 deletions examples/AccountSettingsGetExample.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import api from "@dropbox/sign"

const apiCaller = new api.AccountApi();
apiCaller.username = "YOUR_API_KEY";
// apiCaller.accessToken = "YOUR_ACCESS_TOKEN";

apiCaller.accountSettingsGet().then(response => {
const company = response.body.settings.company;
console.log(response.body);
console.log({
accountId: response.body.accountId,
company: {
value: company.value,
isInherited: company.isInherited,
source: company.source,
type: company.type,
writable: company.writable,
lock: {
mode: company.lock.mode,
source: company.lock.source,
},
},
warnings: response.body.warnings,
});
}).catch(error => {
console.log("Exception when calling AccountApi#accountSettingsGet:");
console.log(error.body);
});
44 changes: 44 additions & 0 deletions examples/AccountSettingsUpdateExample.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
using System;
using System.Collections.Generic;

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

namespace Dropbox.SignSandbox;

public class AccountSettingsUpdateExample
{
public static void Run()
{
var config = new Configuration();
config.Username = "YOUR_API_KEY";
// config.AccessToken = "YOUR_ACCESS_TOKEN";

var accountSettingsUpdateRequest = new AccountSettingsUpdateRequest(
dateFormat: DateFormat.MMDDYYYY,
requiredSignatureTypes: new List<RequiredSignatureType>()
{
RequiredSignatureType.Draw,
RequiredSignatureType.Type,
},
shouldEnableTamperProof: false,
unset: new List<string>() { "company" }
);

try
{
var response = new AccountApi(config).AccountSettingsUpdate(
accountSettingsUpdateRequest: accountSettingsUpdateRequest
);

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

import com.dropbox.sign.ApiException;
import com.dropbox.sign.Configuration;
import com.dropbox.sign.api.AccountApi;
import com.dropbox.sign.auth.HttpBasicAuth;
import com.dropbox.sign.model.AccountSettingsUpdateRequest;
import com.dropbox.sign.model.DateFormat;
import com.dropbox.sign.model.RequiredSignatureType;
import java.util.List;

public class AccountSettingsUpdateExample
{
public static void main(String[] args)
{
var config = Configuration.getDefaultApiClient();
((HttpBasicAuth) config.getAuthentication("api_key")).setUsername("YOUR_API_KEY");
// ((HttpBearerAuth) config.getAuthentication("oauth2")).setBearerToken("YOUR_ACCESS_TOKEN");

var accountSettingsUpdateRequest = new AccountSettingsUpdateRequest()
.dateFormat(DateFormat.MM_DD_YYYY)
.requiredSignatureTypes(List.of(
RequiredSignatureType.DRAW,
RequiredSignatureType.TYPE
))
.shouldEnableTamperProof(false)
.unset(List.of("company"));

try
{
var response = new AccountApi(config).accountSettingsUpdate(
accountSettingsUpdateRequest
);

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

namespace Dropbox\SignSandbox;

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

use Dropbox;

$config = Dropbox\Sign\Configuration::getDefaultConfiguration();
$config->setUsername('YOUR_API_KEY');
// $config->setAccessToken('YOUR_ACCESS_TOKEN');

$account_settings_update_request = (new Dropbox\Sign\Model\AccountSettingsUpdateRequest())
->setDateFormat(Dropbox\Sign\Model\DateFormat::MM_DD_YYYY)
->setRequiredSignatureTypes([
Dropbox\Sign\Model\RequiredSignatureType::DRAW,
Dropbox\Sign\Model\RequiredSignatureType::TYPE,
])
->setShouldEnableTamperProof(false)
->setUnset(['company']);

try {
$response = (new Dropbox\Sign\Api\AccountApi(config: $config))->accountSettingsUpdate(
account_settings_update_request: $account_settings_update_request,
);

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

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

configuration = Configuration(
username="YOUR_API_KEY",
# access_token="YOUR_ACCESS_TOKEN",
)

with ApiClient(configuration) as api_client:
account_settings_update_request = models.AccountSettingsUpdateRequest(
date_format=models.DateFormat.MM_SLASH_DD_SLASH_YYYY,
required_signature_types=[
models.RequiredSignatureType.DRAW,
models.RequiredSignatureType.TYPE,
],
should_enable_tamper_proof=False,
unset=["company"],
)

try:
response = api.AccountApi(api_client).account_settings_update(
account_settings_update_request=account_settings_update_request,
)

pprint(response)
except ApiException as e:
print("Exception when calling AccountApi#account_settings_update: %s\n" % e)
Loading
Loading