diff --git a/.github/workflows/github-actions.yml b/.github/workflows/github-actions.yml index 1046c5f..d906a48 100644 --- a/.github/workflows/github-actions.yml +++ b/.github/workflows/github-actions.yml @@ -40,7 +40,7 @@ jobs: - name: Setup .NET uses: actions/setup-dotnet@v3 with: - dotnet-version: 6.0.x + dotnet-version: 8.0.x - name: Restore dependencies run: dotnet restore ${SOLUTION}.sln diff --git a/.gitignore b/.gitignore index 02e0c34..78294d9 100644 --- a/.gitignore +++ b/.gitignore @@ -361,6 +361,8 @@ MigrationBackup/ # Fody - auto-generated XML schema FodyWeavers.xsd +git_push.sh +global.json vendor /api .openapi-generator diff --git a/.openapi-generator-ignore b/.openapi-generator-ignore index 77ed52e..7484ee5 100644 --- a/.openapi-generator-ignore +++ b/.openapi-generator-ignore @@ -21,7 +21,3 @@ #docs/*.md # Then explicitly reverse the ignore rule for a single file: #!docs/README.md - -git_push.sh -**/Model/*AllOf* -docs/*AllOf* diff --git a/Dropbox.Sign.sln b/Dropbox.Sign.sln old mode 100755 new mode 100644 diff --git a/README.md b/README.md index f792b19..aec7a58 100644 --- a/README.md +++ b/README.md @@ -23,8 +23,8 @@ directory that corresponds to the file you want updated. This C# SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: - API version: 3.0.0 -- SDK version: 1.8.0 -- Generator version: 7.8.0 +- SDK version: 2.0.0 +- Generator version: 7.12.0 - Build package: org.openapitools.codegen.languages.CSharpClientCodegen ### Building @@ -49,7 +49,7 @@ this command. ## Dependencies -- [RestSharp](https://www.nuget.org/packages/RestSharp) - 106.13.0 or later +- [RestSharp](https://www.nuget.org/packages/RestSharp) - 112.0.0 or later - [Json.NET](https://www.nuget.org/packages/Newtonsoft.Json/) - 13.0.2 or later - [JsonSubTypes](https://www.nuget.org/packages/JsonSubTypes/) - 1.8.0 or later - [System.ComponentModel.Annotations](https://www.nuget.org/packages/System.ComponentModel.Annotations) - 5.0.0 or later @@ -82,36 +82,39 @@ c.Proxy = webProxy; ```csharp using System; +using System.Collections.Generic; +using System.IO; +using System.Text.Json; using Dropbox.Sign.Api; using Dropbox.Sign.Client; using Dropbox.Sign.Model; -public class Example +namespace Dropbox.SignSandbox; + +public class AccountCreateExample { - public static void Main() + public static void Run() { var config = new Configuration(); - // Configure HTTP basic authorization: api_key config.Username = "YOUR_API_KEY"; + // config.AccessToken = "YOUR_ACCESS_TOKEN"; - // or, configure Bearer (JWT) authorization: oauth2 - // config.AccessToken = "YOUR_BEARER_TOKEN"; - - var accountApi = new AccountApi(config); - - var data = new AccountCreateRequest( + var accountCreateRequest = new AccountCreateRequest( emailAddress: "newuser@dropboxsign.com" ); try { - var result = accountApi.AccountCreate(data); - Console.WriteLine(result); + var response = new AccountApi(config).AccountCreate( + accountCreateRequest: accountCreateRequest + ); + + Console.WriteLine(response); } catch (ApiException e) { - Console.WriteLine("Exception when calling Dropbox Sign API: " + e.Message); + Console.WriteLine("Exception when calling AccountApi#AccountCreate: " + e.Message); Console.WriteLine("Status Code: " + e.ErrorCode); Console.WriteLine(e.StackTrace); } @@ -142,7 +145,7 @@ Class | Method | HTTP request | Description *EmbeddedApi* | [**EmbeddedEditUrl**](docs/EmbeddedApi.md#embeddedediturl) | **POST** /embedded/edit_url/{template_id} | Get Embedded Template Edit URL *EmbeddedApi* | [**EmbeddedSignUrl**](docs/EmbeddedApi.md#embeddedsignurl) | **GET** /embedded/sign_url/{signature_id} | Get Embedded Sign URL *FaxApi* | [**FaxDelete**](docs/FaxApi.md#faxdelete) | **DELETE** /fax/{fax_id} | Delete Fax -*FaxApi* | [**FaxFiles**](docs/FaxApi.md#faxfiles) | **GET** /fax/files/{fax_id} | List Fax Files +*FaxApi* | [**FaxFiles**](docs/FaxApi.md#faxfiles) | **GET** /fax/files/{fax_id} | Download Fax Files *FaxApi* | [**FaxGet**](docs/FaxApi.md#faxget) | **GET** /fax/{fax_id} | Get Fax *FaxApi* | [**FaxList**](docs/FaxApi.md#faxlist) | **GET** /fax/list | Lists Faxes *FaxApi* | [**FaxSend**](docs/FaxApi.md#faxsend) | **POST** /fax/send | Send Fax @@ -161,6 +164,10 @@ Class | Method | HTTP request | Description *SignatureRequestApi* | [**SignatureRequestCancel**](docs/SignatureRequestApi.md#signaturerequestcancel) | **POST** /signature_request/cancel/{signature_request_id} | Cancel Incomplete Signature Request *SignatureRequestApi* | [**SignatureRequestCreateEmbedded**](docs/SignatureRequestApi.md#signaturerequestcreateembedded) | **POST** /signature_request/create_embedded | Create Embedded Signature Request *SignatureRequestApi* | [**SignatureRequestCreateEmbeddedWithTemplate**](docs/SignatureRequestApi.md#signaturerequestcreateembeddedwithtemplate) | **POST** /signature_request/create_embedded_with_template | Create Embedded Signature Request with Template +*SignatureRequestApi* | [**SignatureRequestEdit**](docs/SignatureRequestApi.md#signaturerequestedit) | **PUT** /signature_request/edit/{signature_request_id} | Edit Signature Request +*SignatureRequestApi* | [**SignatureRequestEditEmbedded**](docs/SignatureRequestApi.md#signaturerequesteditembedded) | **PUT** /signature_request/edit_embedded/{signature_request_id} | Edit Embedded Signature Request +*SignatureRequestApi* | [**SignatureRequestEditEmbeddedWithTemplate**](docs/SignatureRequestApi.md#signaturerequesteditembeddedwithtemplate) | **PUT** /signature_request/edit_embedded_with_template/{signature_request_id} | Edit Embedded Signature Request with Template +*SignatureRequestApi* | [**SignatureRequestEditWithTemplate**](docs/SignatureRequestApi.md#signaturerequesteditwithtemplate) | **PUT** /signature_request/edit_with_template/{signature_request_id} | Edit Signature Request With Template *SignatureRequestApi* | [**SignatureRequestFiles**](docs/SignatureRequestApi.md#signaturerequestfiles) | **GET** /signature_request/files/{signature_request_id} | Download Files *SignatureRequestApi* | [**SignatureRequestFilesAsDataUri**](docs/SignatureRequestApi.md#signaturerequestfilesasdatauri) | **GET** /signature_request/files_as_data_uri/{signature_request_id} | Download Files as Data Uri *SignatureRequestApi* | [**SignatureRequestFilesAsFileUrl**](docs/SignatureRequestApi.md#signaturerequestfilesasfileurl) | **GET** /signature_request/files_as_file_url/{signature_request_id} | Download Files as File Url @@ -265,6 +272,10 @@ Class | Method | HTTP request | Description - [Model.SignatureRequestBulkSendWithTemplateRequest](docs/SignatureRequestBulkSendWithTemplateRequest.md) - [Model.SignatureRequestCreateEmbeddedRequest](docs/SignatureRequestCreateEmbeddedRequest.md) - [Model.SignatureRequestCreateEmbeddedWithTemplateRequest](docs/SignatureRequestCreateEmbeddedWithTemplateRequest.md) + - [Model.SignatureRequestEditEmbeddedRequest](docs/SignatureRequestEditEmbeddedRequest.md) + - [Model.SignatureRequestEditEmbeddedWithTemplateRequest](docs/SignatureRequestEditEmbeddedWithTemplateRequest.md) + - [Model.SignatureRequestEditRequest](docs/SignatureRequestEditRequest.md) + - [Model.SignatureRequestEditWithTemplateRequest](docs/SignatureRequestEditWithTemplateRequest.md) - [Model.SignatureRequestGetResponse](docs/SignatureRequestGetResponse.md) - [Model.SignatureRequestListResponse](docs/SignatureRequestListResponse.md) - [Model.SignatureRequestRemindRequest](docs/SignatureRequestRemindRequest.md) diff --git a/VERSION b/VERSION index 27f9cd3..227cea2 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.8.0 +2.0.0 diff --git a/bin/copy-constants.php b/bin/copy-constants.php new file mode 100755 index 0000000..8853805 --- /dev/null +++ b/bin/copy-constants.php @@ -0,0 +1,64 @@ +#!/usr/bin/env php +run(); \ No newline at end of file diff --git a/bin/dotnet b/bin/dotnet index f1b73ac..b3e5c44 100755 --- a/bin/dotnet +++ b/bin/dotnet @@ -12,4 +12,4 @@ docker run --rm \ -v "${ROOT_DIR}:${WORKING_DIR}" \ -w "${WORKING_DIR}" \ -u root:root \ - mcr.microsoft.com/dotnet/sdk:6.0 "$@" + mcr.microsoft.com/dotnet/sdk:8.0 "$@" diff --git a/docs/AccountApi.md b/docs/AccountApi.md index 897f4d2..f62f833 100644 --- a/docs/AccountApi.md +++ b/docs/AccountApi.md @@ -20,36 +20,39 @@ Creates a new Dropbox Sign Account that is associated with the specified `email_ ### Example ```csharp using System; +using System.Collections.Generic; +using System.IO; +using System.Text.Json; using Dropbox.Sign.Api; using Dropbox.Sign.Client; using Dropbox.Sign.Model; -public class Example +namespace Dropbox.SignSandbox; + +public class AccountCreateExample { - public static void Main() + public static void Run() { var config = new Configuration(); - // Configure HTTP basic authorization: api_key config.Username = "YOUR_API_KEY"; + // config.AccessToken = "YOUR_ACCESS_TOKEN"; - // or, configure Bearer (JWT) authorization: oauth2 - // config.AccessToken = "YOUR_BEARER_TOKEN"; - - var accountApi = new AccountApi(config); - - var data = new AccountCreateRequest( + var accountCreateRequest = new AccountCreateRequest( emailAddress: "newuser@dropboxsign.com" ); try { - var result = accountApi.AccountCreate(data); - Console.WriteLine(result); + var response = new AccountApi(config).AccountCreate( + accountCreateRequest: accountCreateRequest + ); + + Console.WriteLine(response); } catch (ApiException e) { - Console.WriteLine("Exception when calling Dropbox Sign API: " + e.Message); + Console.WriteLine("Exception when calling AccountApi#AccountCreate: " + e.Message); Console.WriteLine("Status Code: " + e.ErrorCode); Console.WriteLine(e.StackTrace); } @@ -117,32 +120,33 @@ Returns the properties and settings of your Account. ### Example ```csharp using System; +using System.Collections.Generic; +using System.IO; +using System.Text.Json; using Dropbox.Sign.Api; using Dropbox.Sign.Client; using Dropbox.Sign.Model; -public class Example +namespace Dropbox.SignSandbox; + +public class AccountGetExample { - public static void Main() + public static void Run() { var config = new Configuration(); - // Configure HTTP basic authorization: api_key config.Username = "YOUR_API_KEY"; - - // or, configure Bearer (JWT) authorization: oauth2 - // config.AccessToken = "YOUR_BEARER_TOKEN"; - - var accountApi = new AccountApi(config); + // config.AccessToken = "YOUR_ACCESS_TOKEN"; try { - var result = accountApi.AccountGet(null, "jack@example.com"); - Console.WriteLine(result); + var response = new AccountApi(config).AccountGet(); + + Console.WriteLine(response); } catch (ApiException e) { - Console.WriteLine("Exception when calling Dropbox Sign API: " + e.Message); + Console.WriteLine("Exception when calling AccountApi#AccountGet: " + e.Message); Console.WriteLine("Status Code: " + e.ErrorCode); Console.WriteLine(e.StackTrace); } @@ -211,36 +215,40 @@ Updates the properties and settings of your Account. Currently only allows for u ### Example ```csharp using System; +using System.Collections.Generic; +using System.IO; +using System.Text.Json; using Dropbox.Sign.Api; using Dropbox.Sign.Client; using Dropbox.Sign.Model; -public class Example +namespace Dropbox.SignSandbox; + +public class AccountUpdateExample { - public static void Main() + public static void Run() { var config = new Configuration(); - // Configure HTTP basic authorization: api_key config.Username = "YOUR_API_KEY"; + // config.AccessToken = "YOUR_ACCESS_TOKEN"; - // or, configure Bearer (JWT) authorization: oauth2 - // config.AccessToken = "YOUR_BEARER_TOKEN"; - - var accountApi = new AccountApi(config); - - var data = new AccountUpdateRequest( - callbackUrl: "https://www.example.com/callback" + var accountUpdateRequest = new AccountUpdateRequest( + callbackUrl: "https://www.example.com/callback", + locale: "en-US" ); try { - var result = accountApi.AccountUpdate(data); - Console.WriteLine(result); + var response = new AccountApi(config).AccountUpdate( + accountUpdateRequest: accountUpdateRequest + ); + + Console.WriteLine(response); } catch (ApiException e) { - Console.WriteLine("Exception when calling Dropbox Sign API: " + e.Message); + Console.WriteLine("Exception when calling AccountApi#AccountUpdate: " + e.Message); Console.WriteLine("Status Code: " + e.ErrorCode); Console.WriteLine(e.StackTrace); } @@ -308,36 +316,39 @@ Verifies whether an Dropbox Sign Account exists for the given email address. ### Example ```csharp using System; +using System.Collections.Generic; +using System.IO; +using System.Text.Json; using Dropbox.Sign.Api; using Dropbox.Sign.Client; using Dropbox.Sign.Model; -public class Example +namespace Dropbox.SignSandbox; + +public class AccountVerifyExample { - public static void Main() + public static void Run() { var config = new Configuration(); - // Configure HTTP basic authorization: api_key config.Username = "YOUR_API_KEY"; + // config.AccessToken = "YOUR_ACCESS_TOKEN"; - // or, configure Bearer (JWT) authorization: oauth2 - // config.AccessToken = "YOUR_BEARER_TOKEN"; - - var accountApi = new AccountApi(config); - - var data = new AccountVerifyRequest( + var accountVerifyRequest = new AccountVerifyRequest( emailAddress: "some_user@dropboxsign.com" ); try { - var result = accountApi.AccountVerify(data); - Console.WriteLine(result); + var response = new AccountApi(config).AccountVerify( + accountVerifyRequest: accountVerifyRequest + ); + + Console.WriteLine(response); } catch (ApiException e) { - Console.WriteLine("Exception when calling Dropbox Sign API: " + e.Message); + Console.WriteLine("Exception when calling AccountApi#AccountVerify: " + e.Message); Console.WriteLine("Status Code: " + e.ErrorCode); Console.WriteLine(e.StackTrace); } diff --git a/docs/ApiAppApi.md b/docs/ApiAppApi.md index e587a69..e94d26a 100644 --- a/docs/ApiAppApi.md +++ b/docs/ApiAppApi.md @@ -23,29 +23,28 @@ Creates a new API App. using System; using System.Collections.Generic; using System.IO; +using System.Text.Json; + using Dropbox.Sign.Api; using Dropbox.Sign.Client; using Dropbox.Sign.Model; -public class Example +namespace Dropbox.SignSandbox; + +public class ApiAppCreateExample { - public static void Main() + public static void Run() { var config = new Configuration(); - // Configure HTTP basic authorization: api_key config.Username = "YOUR_API_KEY"; - - // or, configure Bearer (JWT) authorization: oauth2 - // config.AccessToken = "YOUR_BEARER_TOKEN"; - - var apiAppApi = new ApiAppApi(config); + // config.AccessToken = "YOUR_ACCESS_TOKEN"; var oauth = new SubOAuth( callbackUrl: "https://example.com/oauth", - scopes: new List() { + scopes: [ SubOAuth.ScopesEnum.BasicAccountInfo, - SubOAuth.ScopesEnum.RequestSignature - } + SubOAuth.ScopesEnum.RequestSignature, + ] ); var whiteLabelingOptions = new SubWhiteLabelingOptions( @@ -53,27 +52,30 @@ public class Example primaryButtonTextColor: "#ffffff" ); - var customLogoFile = new FileStream( - "CustomLogoFile.png", - FileMode.Open - ); - - var data = new ApiAppCreateRequest( + var apiAppCreateRequest = new ApiAppCreateRequest( name: "My Production App", - domains: new List(){"example.com"}, + domains: [ + "example.com", + ], + customLogoFile: new FileStream( + path: "CustomLogoFile.png", + mode: FileMode.Open + ), oauth: oauth, - whiteLabelingOptions: whiteLabelingOptions, - customLogoFile: customLogoFile + whiteLabelingOptions: whiteLabelingOptions ); try { - var result = apiAppApi.ApiAppCreate(data); - Console.WriteLine(result); + var response = new ApiAppApi(config).ApiAppCreate( + apiAppCreateRequest: apiAppCreateRequest + ); + + Console.WriteLine(response); } catch (ApiException e) { - Console.WriteLine("Exception when calling Dropbox Sign API: " + e.Message); + Console.WriteLine("Exception when calling ApiAppApi#ApiAppCreate: " + e.Message); Console.WriteLine("Status Code: " + e.ErrorCode); Console.WriteLine(e.StackTrace); } @@ -143,32 +145,31 @@ Deletes an API App. Can only be invoked for apps you own. using System; using System.Collections.Generic; using System.IO; +using System.Text.Json; + using Dropbox.Sign.Api; using Dropbox.Sign.Client; using Dropbox.Sign.Model; -public class Example +namespace Dropbox.SignSandbox; + +public class ApiAppDeleteExample { - public static void Main() + public static void Run() { var config = new Configuration(); - // Configure HTTP basic authorization: api_key config.Username = "YOUR_API_KEY"; - - // or, configure Bearer (JWT) authorization: oauth2 - // config.AccessToken = "YOUR_BEARER_TOKEN"; - - var apiAppApi = new ApiAppApi(config); - - var clientId = "0dd3b823a682527788c4e40cb7b6f7e9"; + // config.AccessToken = "YOUR_ACCESS_TOKEN"; try { - apiAppApi.ApiAppDelete(clientId); + new ApiAppApi(config).ApiAppDelete( + clientId: "0dd3b823a682527788c4e40cb7b6f7e9" + ); } catch (ApiException e) { - Console.WriteLine("Exception when calling Dropbox Sign API: " + e.Message); + Console.WriteLine("Exception when calling ApiAppApi#ApiAppDelete: " + e.Message); Console.WriteLine("Status Code: " + e.ErrorCode); Console.WriteLine(e.StackTrace); } @@ -233,34 +234,35 @@ Returns an object with information about an API App. ### Example ```csharp using System; +using System.Collections.Generic; +using System.IO; +using System.Text.Json; using Dropbox.Sign.Api; using Dropbox.Sign.Client; using Dropbox.Sign.Model; -public class Example +namespace Dropbox.SignSandbox; + +public class ApiAppGetExample { - public static void Main() + public static void Run() { var config = new Configuration(); - // Configure HTTP basic authorization: api_key config.Username = "YOUR_API_KEY"; - - // or, configure Bearer (JWT) authorization: oauth2 - // config.AccessToken = "YOUR_BEARER_TOKEN"; - - var apiAppApi = new ApiAppApi(config); - - var clientId = "0dd3b823a682527788c4e40cb7b6f7e9"; + // config.AccessToken = "YOUR_ACCESS_TOKEN"; try { - var result = apiAppApi.ApiAppGet(clientId); - Console.WriteLine(result); + var response = new ApiAppApi(config).ApiAppGet( + clientId: "0dd3b823a682527788c4e40cb7b6f7e9" + ); + + Console.WriteLine(response); } catch (ApiException e) { - Console.WriteLine("Exception when calling Dropbox Sign API: " + e.Message); + Console.WriteLine("Exception when calling ApiAppApi#ApiAppGet: " + e.Message); Console.WriteLine("Status Code: " + e.ErrorCode); Console.WriteLine(e.StackTrace); } @@ -328,35 +330,36 @@ Returns a list of API Apps that are accessible by you. If you are on a team with ### Example ```csharp using System; +using System.Collections.Generic; +using System.IO; +using System.Text.Json; using Dropbox.Sign.Api; using Dropbox.Sign.Client; using Dropbox.Sign.Model; -public class Example +namespace Dropbox.SignSandbox; + +public class ApiAppListExample { - public static void Main() + public static void Run() { var config = new Configuration(); - // Configure HTTP basic authorization: api_key config.Username = "YOUR_API_KEY"; - - // or, configure Bearer (JWT) authorization: oauth2 - // config.AccessToken = "YOUR_BEARER_TOKEN"; - - var apiAppApi = new ApiAppApi(config); - - var page = 1; - var pageSize = 2; + // config.AccessToken = "YOUR_ACCESS_TOKEN"; try { - var result = apiAppApi.ApiAppList(page, pageSize); - Console.WriteLine(result); + var response = new ApiAppApi(config).ApiAppList( + page: 1, + pageSize: 20 + ); + + Console.WriteLine(response); } catch (ApiException e) { - Console.WriteLine("Exception when calling Dropbox Sign API: " + e.Message); + Console.WriteLine("Exception when calling ApiAppApi#ApiAppList: " + e.Message); Console.WriteLine("Status Code: " + e.ErrorCode); Console.WriteLine(e.StackTrace); } @@ -427,29 +430,28 @@ Updates an existing API App. Can only be invoked for apps you own. Only the fiel using System; using System.Collections.Generic; using System.IO; +using System.Text.Json; + using Dropbox.Sign.Api; using Dropbox.Sign.Client; using Dropbox.Sign.Model; -public class Example +namespace Dropbox.SignSandbox; + +public class ApiAppUpdateExample { - public static void Main() + public static void Run() { var config = new Configuration(); - // Configure HTTP basic authorization: api_key config.Username = "YOUR_API_KEY"; - - // or, configure Bearer (JWT) authorization: oauth2 - // config.AccessToken = "YOUR_BEARER_TOKEN"; - - var apiAppApi = new ApiAppApi(config); + // config.AccessToken = "YOUR_ACCESS_TOKEN"; var oauth = new SubOAuth( callbackUrl: "https://example.com/oauth", - scopes: new List() { + scopes: [ SubOAuth.ScopesEnum.BasicAccountInfo, - SubOAuth.ScopesEnum.RequestSignature - } + SubOAuth.ScopesEnum.RequestSignature, + ] ); var whiteLabelingOptions = new SubWhiteLabelingOptions( @@ -457,29 +459,32 @@ public class Example primaryButtonTextColor: "#ffffff" ); - var customLogoFile = new FileStream( - "CustomLogoFile.png", - FileMode.Open - ); - - var data = new ApiAppUpdateRequest( - name: "My Production App", - domains: new List(){"example.com"}, + var apiAppUpdateRequest = new ApiAppUpdateRequest( + callbackUrl: "https://example.com/dropboxsign", + name: "New Name", + domains: [ + "example.com", + ], + customLogoFile: new FileStream( + path: "CustomLogoFile.png", + mode: FileMode.Open + ), oauth: oauth, - whiteLabelingOptions: whiteLabelingOptions, - customLogoFile: customLogoFile + whiteLabelingOptions: whiteLabelingOptions ); - var clientId = "0dd3b823a682527788c4e40cb7b6f7e9"; - try { - var result = apiAppApi.ApiAppUpdate(clientId, data); - Console.WriteLine(result); + var response = new ApiAppApi(config).ApiAppUpdate( + clientId: "0dd3b823a682527788c4e40cb7b6f7e9", + apiAppUpdateRequest: apiAppUpdateRequest + ); + + Console.WriteLine(response); } catch (ApiException e) { - Console.WriteLine("Exception when calling Dropbox Sign API: " + e.Message); + Console.WriteLine("Exception when calling ApiAppApi#ApiAppUpdate: " + e.Message); Console.WriteLine("Status Code: " + e.ErrorCode); Console.WriteLine(e.StackTrace); } diff --git a/docs/BulkSendJobApi.md b/docs/BulkSendJobApi.md index 050257d..46b2626 100644 --- a/docs/BulkSendJobApi.md +++ b/docs/BulkSendJobApi.md @@ -20,33 +20,35 @@ Returns the status of the BulkSendJob and its SignatureRequests specified by the using System; using System.Collections.Generic; using System.IO; +using System.Text.Json; + using Dropbox.Sign.Api; using Dropbox.Sign.Client; using Dropbox.Sign.Model; -public class Example +namespace Dropbox.SignSandbox; + +public class BulkSendJobGetExample { - public static void Main() + public static void Run() { var config = new Configuration(); - // Configure HTTP basic authorization: api_key config.Username = "YOUR_API_KEY"; - - // or, configure Bearer (JWT) authorization: oauth2 - // config.AccessToken = "YOUR_BEARER_TOKEN"; - - var bulkSendJobApi = new BulkSendJobApi(config); - - var bulkSendJobId = "6e683bc0369ba3d5b6f43c2c22a8031dbf6bd174"; + // config.AccessToken = "YOUR_ACCESS_TOKEN"; try { - var result = bulkSendJobApi.BulkSendJobGet(bulkSendJobId); - Console.WriteLine(result); + var response = new BulkSendJobApi(config).BulkSendJobGet( + bulkSendJobId: "6e683bc0369ba3d5b6f43c2c22a8031dbf6bd174", + page: 1, + pageSize: 20 + ); + + Console.WriteLine(response); } catch (ApiException e) { - Console.WriteLine("Exception when calling Dropbox Sign API: " + e.Message); + Console.WriteLine("Exception when calling BulkSendJobApi#BulkSendJobGet: " + e.Message); Console.WriteLine("Status Code: " + e.ErrorCode); Console.WriteLine(e.StackTrace); } @@ -118,34 +120,34 @@ Returns a list of BulkSendJob that you can access. using System; using System.Collections.Generic; using System.IO; +using System.Text.Json; + using Dropbox.Sign.Api; using Dropbox.Sign.Client; using Dropbox.Sign.Model; -public class Example +namespace Dropbox.SignSandbox; + +public class BulkSendJobListExample { - public static void Main() + public static void Run() { var config = new Configuration(); - // Configure HTTP basic authorization: api_key config.Username = "YOUR_API_KEY"; - - // or, configure Bearer (JWT) authorization: oauth2 - // config.AccessToken = "YOUR_BEARER_TOKEN"; - - var bulkSendJobApi = new BulkSendJobApi(config); - - var page = 1; - var pageSize = 20; + // config.AccessToken = "YOUR_ACCESS_TOKEN"; try { - var result = bulkSendJobApi.BulkSendJobList(page, pageSize); - Console.WriteLine(result); + var response = new BulkSendJobApi(config).BulkSendJobList( + page: 1, + pageSize: 20 + ); + + Console.WriteLine(response); } catch (ApiException e) { - Console.WriteLine("Exception when calling Dropbox Sign API: " + e.Message); + Console.WriteLine("Exception when calling BulkSendJobApi#BulkSendJobList: " + e.Message); Console.WriteLine("Status Code: " + e.ErrorCode); Console.WriteLine(e.StackTrace); } diff --git a/docs/EmbeddedApi.md b/docs/EmbeddedApi.md index 39c38b4..473f3df 100644 --- a/docs/EmbeddedApi.md +++ b/docs/EmbeddedApi.md @@ -20,38 +20,43 @@ Retrieves an embedded object containing a template url that can be opened in an using System; using System.Collections.Generic; using System.IO; +using System.Text.Json; + using Dropbox.Sign.Api; using Dropbox.Sign.Client; using Dropbox.Sign.Model; -public class Example +namespace Dropbox.SignSandbox; + +public class EmbeddedEditUrlExample { - public static void Main() + public static void Run() { var config = new Configuration(); - // Configure HTTP basic authorization: api_key config.Username = "YOUR_API_KEY"; + // config.AccessToken = "YOUR_ACCESS_TOKEN"; - // or, configure Bearer (JWT) authorization: oauth2 - // config.AccessToken = "YOUR_BEARER_TOKEN"; - - var embeddedApi = new EmbeddedApi(config); + var mergeFields = new List(); - var data = new EmbeddedEditUrlRequest( - ccRoles: new List(){""}, - mergeFields: new List() + var embeddedEditUrlRequest = new EmbeddedEditUrlRequest( + ccRoles: [ + "", + ], + mergeFields: mergeFields ); - var templateId = "5de8179668f2033afac48da1868d0093bf133266"; - try { - var result = embeddedApi.EmbeddedEditUrl(templateId, data); - Console.WriteLine(result); + var response = new EmbeddedApi(config).EmbeddedEditUrl( + templateId: "f57db65d3f933b5316d398057a36176831451a35", + embeddedEditUrlRequest: embeddedEditUrlRequest + ); + + Console.WriteLine(response); } catch (ApiException e) { - Console.WriteLine("Exception when calling Dropbox Sign API: " + e.Message); + Console.WriteLine("Exception when calling EmbeddedApi#EmbeddedEditUrl: " + e.Message); Console.WriteLine("Status Code: " + e.ErrorCode); Console.WriteLine(e.StackTrace); } @@ -122,33 +127,33 @@ Retrieves an embedded object containing a signature url that can be opened in an using System; using System.Collections.Generic; using System.IO; +using System.Text.Json; + using Dropbox.Sign.Api; using Dropbox.Sign.Client; using Dropbox.Sign.Model; -public class Example +namespace Dropbox.SignSandbox; + +public class EmbeddedSignUrlExample { - public static void Main() + public static void Run() { var config = new Configuration(); - // Configure HTTP basic authorization: api_key config.Username = "YOUR_API_KEY"; - - // or, configure Bearer (JWT) authorization: oauth2 - // config.AccessToken = "YOUR_BEARER_TOKEN"; - - var embeddedApi = new EmbeddedApi(config); - - var signatureId = "50e3542f738adfa7ddd4cbd4c00d2a8ab6e4194b"; + // config.AccessToken = "YOUR_ACCESS_TOKEN"; try { - var result = embeddedApi.EmbeddedSignUrl(signatureId); - Console.WriteLine(result); + var response = new EmbeddedApi(config).EmbeddedSignUrl( + signatureId: "50e3542f738adfa7ddd4cbd4c00d2a8ab6e4194b" + ); + + Console.WriteLine(response); } catch (ApiException e) { - Console.WriteLine("Exception when calling Dropbox Sign API: " + e.Message); + Console.WriteLine("Exception when calling EmbeddedApi#EmbeddedSignUrl: " + e.Message); Console.WriteLine("Status Code: " + e.ErrorCode); Console.WriteLine(e.StackTrace); } diff --git a/docs/FaxApi.md b/docs/FaxApi.md index 303d4ef..41349a4 100644 --- a/docs/FaxApi.md +++ b/docs/FaxApi.md @@ -5,7 +5,7 @@ All URIs are relative to *https://api.hellosign.com/v3* | Method | HTTP request | Description | |--------|--------------|-------------| | [**FaxDelete**](FaxApi.md#faxdelete) | **DELETE** /fax/{fax_id} | Delete Fax | -| [**FaxFiles**](FaxApi.md#faxfiles) | **GET** /fax/files/{fax_id} | List Fax Files | +| [**FaxFiles**](FaxApi.md#faxfiles) | **GET** /fax/files/{fax_id} | Download Fax Files | | [**FaxGet**](FaxApi.md#faxget) | **GET** /fax/{fax_id} | Get Fax | | [**FaxList**](FaxApi.md#faxlist) | **GET** /fax/list | Lists Faxes | | [**FaxSend**](FaxApi.md#faxsend) | **POST** /fax/send | Send Fax | @@ -16,33 +16,37 @@ All URIs are relative to *https://api.hellosign.com/v3* Delete Fax -Deletes the specified Fax from the system. +Deletes the specified Fax from the system ### Example ```csharp using System; using System.Collections.Generic; using System.IO; +using System.Text.Json; + using Dropbox.Sign.Api; using Dropbox.Sign.Client; using Dropbox.Sign.Model; -public class Example +namespace Dropbox.SignSandbox; + +public class FaxDeleteExample { - public static void Main() + public static void Run() { var config = new Configuration(); config.Username = "YOUR_API_KEY"; - var faxApi = new FaxApi(config); - try { - faxApi.FaxDelete("fa5c8a0b0f492d768749333ad6fcc214c111e967"); + new FaxApi(config).FaxDelete( + faxId: "fa5c8a0b0f492d768749333ad6fcc214c111e967" + ); } catch (ApiException e) { - Console.WriteLine("Exception when calling Dropbox Sign API: " + e.Message); + Console.WriteLine("Exception when calling FaxApi#FaxDelete: " + e.Message); Console.WriteLine("Status Code: " + e.ErrorCode); Console.WriteLine(e.StackTrace); } @@ -100,41 +104,43 @@ void (empty response body) # **FaxFiles** > System.IO.Stream FaxFiles (string faxId) -List Fax Files +Download Fax Files -Returns list of fax files +Downloads files associated with a Fax ### Example ```csharp using System; using System.Collections.Generic; using System.IO; +using System.Text.Json; + using Dropbox.Sign.Api; using Dropbox.Sign.Client; using Dropbox.Sign.Model; -public class Example +namespace Dropbox.SignSandbox; + +public class FaxFilesExample { - public static void Main() + public static void Run() { var config = new Configuration(); config.Username = "YOUR_API_KEY"; - var faxApi = new FaxApi(config); - - var faxId = "fa5c8a0b0f492d768749333ad6fcc214c111e967"; - try { - var result = faxApi.FaxFiles(faxId); - var fileStream = File.Create("file_response.pdf"); - result.Seek(0, SeekOrigin.Begin); - result.CopyTo(fileStream); + var response = new FaxApi(config).FaxFiles( + faxId: "fa5c8a0b0f492d768749333ad6fcc214c111e967" + ); + var fileStream = File.Create("./file_response"); + response.Seek(0, SeekOrigin.Begin); + response.CopyTo(fileStream); fileStream.Close(); } catch (ApiException e) { - Console.WriteLine("Exception when calling Dropbox Sign API: " + e.Message); + Console.WriteLine("Exception when calling FaxApi#FaxFiles: " + e.Message); Console.WriteLine("Status Code: " + e.ErrorCode); Console.WriteLine(e.StackTrace); } @@ -149,7 +155,7 @@ This returns an ApiResponse object which contains the response data, status code ```csharp try { - // List Fax Files + // Download Fax Files ApiResponse response = apiInstance.FaxFilesWithHttpInfo(faxId); Debug.Write("Status Code: " + response.StatusCode); Debug.Write("Response Headers: " + response.Headers); @@ -197,36 +203,39 @@ catch (ApiException e) Get Fax -Returns information about fax +Returns information about a Fax ### Example ```csharp using System; +using System.Collections.Generic; +using System.IO; +using System.Text.Json; using Dropbox.Sign.Api; using Dropbox.Sign.Client; using Dropbox.Sign.Model; -public class Example +namespace Dropbox.SignSandbox; + +public class FaxGetExample { - public static void Main() + public static void Run() { var config = new Configuration(); - // Configure HTTP basic authorization: api_key config.Username = "YOUR_API_KEY"; - var faxApi = new FaxApi(config); - - var faxId = "fa5c8a0b0f492d768749333ad6fcc214c111e967"; - try { - var result = faxApi.FaxGet(faxId); - Console.WriteLine(result); + var response = new FaxApi(config).FaxGet( + faxId: "fa5c8a0b0f492d768749333ad6fcc214c111e967" + ); + + Console.WriteLine(response); } catch (ApiException e) { - Console.WriteLine("Exception when calling Dropbox Sign API: " + e.Message); + Console.WriteLine("Exception when calling FaxApi#FaxGet: " + e.Message); Console.WriteLine("Status Code: " + e.ErrorCode); Console.WriteLine(e.StackTrace); } @@ -289,37 +298,40 @@ catch (ApiException e) Lists Faxes -Returns properties of multiple faxes +Returns properties of multiple Faxes ### Example ```csharp using System; +using System.Collections.Generic; +using System.IO; +using System.Text.Json; using Dropbox.Sign.Api; using Dropbox.Sign.Client; using Dropbox.Sign.Model; -public class Example +namespace Dropbox.SignSandbox; + +public class FaxListExample { - public static void Main() + public static void Run() { var config = new Configuration(); - // Configure HTTP basic authorization: api_key config.Username = "YOUR_API_KEY"; - var faxApi = new FaxApi(config); - - var page = 1; - var pageSize = 2; - try { - var result = faxApi.FaxList(page, pageSize); - Console.WriteLine(result); + var response = new FaxApi(config).FaxList( + page: 1, + pageSize: 20 + ); + + Console.WriteLine(response); } catch (ApiException e) { - Console.WriteLine("Exception when calling Dropbox Sign API: " + e.Message); + Console.WriteLine("Exception when calling FaxApi#FaxList: " + e.Message); Console.WriteLine("Status Code: " + e.ErrorCode); Console.WriteLine(e.StackTrace); } @@ -352,8 +364,8 @@ catch (ApiException e) | Name | Type | Description | Notes | |------|------|-------------|-------| -| **page** | **int?** | Page | [optional] [default to 1] | -| **pageSize** | **int?** | Page size | [optional] [default to 20] | +| **page** | **int?** | Which page number of the Fax List to return. Defaults to `1`. | [optional] [default to 1] | +| **pageSize** | **int?** | Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. | [optional] [default to 20] | ### Return type @@ -383,54 +395,56 @@ catch (ApiException e) Send Fax -Action to prepare and send a fax +Creates and sends a new Fax with the submitted file(s) ### Example ```csharp using System; using System.Collections.Generic; using System.IO; +using System.Text.Json; + using Dropbox.Sign.Api; using Dropbox.Sign.Client; using Dropbox.Sign.Model; -public class Example +namespace Dropbox.SignSandbox; + +public class FaxSendExample { - public static void Main() + public static void Run() { var config = new Configuration(); config.Username = "YOUR_API_KEY"; - var faxApi = new FaxApi(config); - - var files = new List { - new FileStream( - "./example_fax.pdf", - FileMode.Open, - FileAccess.Read, - FileShare.Read - ) - }; - - var data = new FaxSendRequest( - files: files, - testMode: true, + var faxSendRequest = new FaxSendRequest( recipient: "16690000001", sender: "16690000000", + testMode: true, coverPageTo: "Jill Fax", - coverPageMessage: "I'm sending you a fax!", coverPageFrom: "Faxer Faxerson", + coverPageMessage: "I'm sending you a fax!", title: "This is what the fax is about!", + files: new List + { + new FileStream( + path: "./example_fax.pdf", + mode: FileMode.Open + ), + } ); try { - var result = faxApi.FaxSend(data); - Console.WriteLine(result); + var response = new FaxApi(config).FaxSend( + faxSendRequest: faxSendRequest + ); + + Console.WriteLine(response); } catch (ApiException e) { - Console.WriteLine("Exception when calling Dropbox Sign API: " + e.Message); + Console.WriteLine("Exception when calling FaxApi#FaxSend: " + e.Message); Console.WriteLine("Status Code: " + e.ErrorCode); Console.WriteLine(e.StackTrace); } diff --git a/docs/FaxLineAddUserRequest.md b/docs/FaxLineAddUserRequest.md index f89c0de..705c9d9 100644 --- a/docs/FaxLineAddUserRequest.md +++ b/docs/FaxLineAddUserRequest.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Number** | **string** | The Fax Line number. | **AccountId** | **string** | Account ID | [optional] **EmailAddress** | **string** | Email address | [optional] +**Number** | **string** | The Fax Line number | **AccountId** | **string** | Account ID | [optional] **EmailAddress** | **string** | Email address | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/FaxLineApi.md b/docs/FaxLineApi.md index 9fdd09b..42ebfe8 100644 --- a/docs/FaxLineApi.md +++ b/docs/FaxLineApi.md @@ -25,32 +25,37 @@ Grants a user access to the specified Fax Line. using System; using System.Collections.Generic; using System.IO; +using System.Text.Json; + using Dropbox.Sign.Api; using Dropbox.Sign.Client; using Dropbox.Sign.Model; -public class Example +namespace Dropbox.SignSandbox; + +public class FaxLineAddUserExample { - public static void Main() + public static void Run() { var config = new Configuration(); config.Username = "YOUR_API_KEY"; - var faxLineApi = new FaxLineApi(config); - - var data = new FaxLineAddUserRequest( + var faxLineAddUserRequest = new FaxLineAddUserRequest( number: "[FAX_NUMBER]", emailAddress: "member@dropboxsign.com" ); try { - var result = faxLineApi.FaxLineAddUser(data); - Console.WriteLine(result); + var response = new FaxLineApi(config).FaxLineAddUser( + faxLineAddUserRequest: faxLineAddUserRequest + ); + + Console.WriteLine(response); } catch (ApiException e) { - Console.WriteLine("Exception when calling Dropbox Sign API: " + e.Message); + Console.WriteLine("Exception when calling FaxLineApi#FaxLineAddUser: " + e.Message); Console.WriteLine("Status Code: " + e.ErrorCode); Console.WriteLine(e.StackTrace); } @@ -113,34 +118,39 @@ catch (ApiException e) Get Available Fax Line Area Codes -Returns a response with the area codes available for a given state/provice and city. +Returns a list of available area codes for a given state/province and city ### Example ```csharp using System; using System.Collections.Generic; using System.IO; +using System.Text.Json; + using Dropbox.Sign.Api; using Dropbox.Sign.Client; using Dropbox.Sign.Model; -public class Example +namespace Dropbox.SignSandbox; + +public class FaxLineAreaCodeGetExample { - public static void Main() + public static void Run() { var config = new Configuration(); config.Username = "YOUR_API_KEY"; - var faxLineApi = new FaxLineApi(config); - try { - var result = faxLineApi.FaxLineAreaCodeGet("US", "CA"); - Console.WriteLine(result); + var response = new FaxLineApi(config).FaxLineAreaCodeGet( + country: "US" + ); + + Console.WriteLine(response); } catch (ApiException e) { - Console.WriteLine("Exception when calling Dropbox Sign API: " + e.Message); + Console.WriteLine("Exception when calling FaxLineApi#FaxLineAreaCodeGet: " + e.Message); Console.WriteLine("Status Code: " + e.ErrorCode); Console.WriteLine(e.StackTrace); } @@ -173,10 +183,10 @@ catch (ApiException e) | Name | Type | Description | Notes | |------|------|-------------|-------| -| **country** | **string** | Filter area codes by country. | | -| **state** | **string?** | Filter area codes by state. | [optional] | -| **province** | **string?** | Filter area codes by province. | [optional] | -| **city** | **string?** | Filter area codes by city. | [optional] | +| **country** | **string** | Filter area codes by country | | +| **state** | **string?** | Filter area codes by state | [optional] | +| **province** | **string?** | Filter area codes by province | [optional] | +| **city** | **string?** | Filter area codes by city | [optional] | ### Return type @@ -206,39 +216,44 @@ catch (ApiException e) Purchase Fax Line -Purchases a new Fax Line. +Purchases a new Fax Line ### Example ```csharp using System; using System.Collections.Generic; using System.IO; +using System.Text.Json; + using Dropbox.Sign.Api; using Dropbox.Sign.Client; using Dropbox.Sign.Model; -public class Example +namespace Dropbox.SignSandbox; + +public class FaxLineCreateExample { - public static void Main() + public static void Run() { var config = new Configuration(); config.Username = "YOUR_API_KEY"; - var faxLineApi = new FaxLineApi(config); - - var data = new FaxLineCreateRequest( + var faxLineCreateRequest = new FaxLineCreateRequest( areaCode: 209, - country: "US" + country: FaxLineCreateRequest.CountryEnum.US ); try { - var result = faxLineApi.FaxLineCreate(data); - Console.WriteLine(result); + var response = new FaxLineApi(config).FaxLineCreate( + faxLineCreateRequest: faxLineCreateRequest + ); + + Console.WriteLine(response); } catch (ApiException e) { - Console.WriteLine("Exception when calling Dropbox Sign API: " + e.Message); + Console.WriteLine("Exception when calling FaxLineApi#FaxLineCreate: " + e.Message); Console.WriteLine("Status Code: " + e.ErrorCode); Console.WriteLine(e.StackTrace); } @@ -308,30 +323,34 @@ Deletes the specified Fax Line from the subscription. using System; using System.Collections.Generic; using System.IO; +using System.Text.Json; + using Dropbox.Sign.Api; using Dropbox.Sign.Client; using Dropbox.Sign.Model; -public class Example +namespace Dropbox.SignSandbox; + +public class FaxLineDeleteExample { - public static void Main() + public static void Run() { var config = new Configuration(); config.Username = "YOUR_API_KEY"; - var faxLineApi = new FaxLineApi(config); - - var data = new FaxLineDeleteRequest( + var faxLineDeleteRequest = new FaxLineDeleteRequest( number: "[FAX_NUMBER]" ); try { - faxLineApi.FaxLineDelete(data); + new FaxLineApi(config).FaxLineDelete( + faxLineDeleteRequest: faxLineDeleteRequest + ); } catch (ApiException e) { - Console.WriteLine("Exception when calling Dropbox Sign API: " + e.Message); + Console.WriteLine("Exception when calling FaxLineApi#FaxLineDelete: " + e.Message); Console.WriteLine("Status Code: " + e.ErrorCode); Console.WriteLine(e.StackTrace); } @@ -398,27 +417,32 @@ Returns the properties and settings of a Fax Line. using System; using System.Collections.Generic; using System.IO; +using System.Text.Json; + using Dropbox.Sign.Api; using Dropbox.Sign.Client; using Dropbox.Sign.Model; -public class Example +namespace Dropbox.SignSandbox; + +public class FaxLineGetExample { - public static void Main() + public static void Run() { var config = new Configuration(); config.Username = "YOUR_API_KEY"; - var faxLineApi = new FaxLineApi(config); - try { - var result = faxLineApi.FaxLineGet("[FAX_NUMBER]"); - Console.WriteLine(result); + var response = new FaxLineApi(config).FaxLineGet( + number: "123-123-1234" + ); + + Console.WriteLine(response); } catch (ApiException e) { - Console.WriteLine("Exception when calling Dropbox Sign API: " + e.Message); + Console.WriteLine("Exception when calling FaxLineApi#FaxLineGet: " + e.Message); Console.WriteLine("Status Code: " + e.ErrorCode); Console.WriteLine(e.StackTrace); } @@ -451,7 +475,7 @@ catch (ApiException e) | Name | Type | Description | Notes | |------|------|-------------|-------| -| **number** | **string** | The Fax Line number. | | +| **number** | **string** | The Fax Line number | | ### Return type @@ -488,27 +512,34 @@ Returns the properties and settings of multiple Fax Lines. using System; using System.Collections.Generic; using System.IO; +using System.Text.Json; + using Dropbox.Sign.Api; using Dropbox.Sign.Client; using Dropbox.Sign.Model; -public class Example +namespace Dropbox.SignSandbox; + +public class FaxLineListExample { - public static void Main() + public static void Run() { var config = new Configuration(); config.Username = "YOUR_API_KEY"; - var faxLineApi = new FaxLineApi(config); - try { - var result = faxLineApi.FaxLineList(); - Console.WriteLine(result); + var response = new FaxLineApi(config).FaxLineList( + accountId: "ab55cd14a97219e36b5ff5fe23f2f9329b0c1e97", + page: 1, + pageSize: 20 + ); + + Console.WriteLine(response); } catch (ApiException e) { - Console.WriteLine("Exception when calling Dropbox Sign API: " + e.Message); + Console.WriteLine("Exception when calling FaxLineApi#FaxLineList: " + e.Message); Console.WriteLine("Status Code: " + e.ErrorCode); Console.WriteLine(e.StackTrace); } @@ -542,9 +573,9 @@ catch (ApiException e) | Name | Type | Description | Notes | |------|------|-------------|-------| | **accountId** | **string?** | Account ID | [optional] | -| **page** | **int?** | Page | [optional] [default to 1] | -| **pageSize** | **int?** | Page size | [optional] [default to 20] | -| **showTeamLines** | **bool?** | Show team lines | [optional] | +| **page** | **int?** | Which page number of the Fax Line List to return. Defaults to `1`. | [optional] [default to 1] | +| **pageSize** | **int?** | Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. | [optional] [default to 20] | +| **showTeamLines** | **bool?** | Include Fax Lines belonging to team members in the list | [optional] | ### Return type @@ -574,39 +605,44 @@ catch (ApiException e) Remove Fax Line Access -Removes a user's access to the specified Fax Line. +Removes a user's access to the specified Fax Line ### Example ```csharp using System; using System.Collections.Generic; using System.IO; +using System.Text.Json; + using Dropbox.Sign.Api; using Dropbox.Sign.Client; using Dropbox.Sign.Model; -public class Example +namespace Dropbox.SignSandbox; + +public class FaxLineRemoveUserExample { - public static void Main() + public static void Run() { var config = new Configuration(); config.Username = "YOUR_API_KEY"; - var faxLineApi = new FaxLineApi(config); - - var data = new FaxLineRemoveUserRequest( + var faxLineRemoveUserRequest = new FaxLineRemoveUserRequest( number: "[FAX_NUMBER]", emailAddress: "member@dropboxsign.com" ); try { - var result = faxLineApi.FaxLineRemoveUser(data); - Console.WriteLine(result); + var response = new FaxLineApi(config).FaxLineRemoveUser( + faxLineRemoveUserRequest: faxLineRemoveUserRequest + ); + + Console.WriteLine(response); } catch (ApiException e) { - Console.WriteLine("Exception when calling Dropbox Sign API: " + e.Message); + Console.WriteLine("Exception when calling FaxLineApi#FaxLineRemoveUser: " + e.Message); Console.WriteLine("Status Code: " + e.ErrorCode); Console.WriteLine(e.StackTrace); } diff --git a/docs/FaxLineCreateRequest.md b/docs/FaxLineCreateRequest.md index 21d3ffc..d8bf8c4 100644 --- a/docs/FaxLineCreateRequest.md +++ b/docs/FaxLineCreateRequest.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**AreaCode** | **int** | Area code | **Country** | **string** | Country | **City** | **string** | City | [optional] **AccountId** | **string** | Account ID | [optional] +**AreaCode** | **int** | Area code of the new Fax Line | **Country** | **string** | Country of the area code | **City** | **string** | City of the area code | [optional] **AccountId** | **string** | Account ID of the account that will be assigned this new Fax Line | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/FaxLineDeleteRequest.md b/docs/FaxLineDeleteRequest.md index 673880d..1d8885b 100644 --- a/docs/FaxLineDeleteRequest.md +++ b/docs/FaxLineDeleteRequest.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Number** | **string** | The Fax Line number. | +**Number** | **string** | The Fax Line number | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/FaxLineRemoveUserRequest.md b/docs/FaxLineRemoveUserRequest.md index 0d73414..3be0e7b 100644 --- a/docs/FaxLineRemoveUserRequest.md +++ b/docs/FaxLineRemoveUserRequest.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Number** | **string** | The Fax Line number. | **AccountId** | **string** | Account ID | [optional] **EmailAddress** | **string** | Email address | [optional] +**Number** | **string** | The Fax Line number | **AccountId** | **string** | Account ID of the user to remove access | [optional] **EmailAddress** | **string** | Email address of the user to remove access | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/FaxSendRequest.md b/docs/FaxSendRequest.md index b02d7f0..371c7c0 100644 --- a/docs/FaxSendRequest.md +++ b/docs/FaxSendRequest.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Recipient** | **string** | Fax Send To Recipient | **Sender** | **string** | Fax Send From Sender (used only with fax number) | [optional] **Files** | **List<System.IO.Stream>** | Fax File to Send | [optional] **FileUrls** | **List<string>** | Fax File URL to Send | [optional] **TestMode** | **bool** | API Test Mode Setting | [optional] [default to false]**CoverPageTo** | **string** | Fax Cover Page for Recipient | [optional] **CoverPageFrom** | **string** | Fax Cover Page for Sender | [optional] **CoverPageMessage** | **string** | Fax Cover Page Message | [optional] **Title** | **string** | Fax Title | [optional] +**Recipient** | **string** | Recipient of the fax Can be a phone number in E.164 format or email address | **Sender** | **string** | Fax Send From Sender (used only with fax number) | [optional] **Files** | **List<System.IO.Stream>** | Use `files[]` to indicate the uploaded file(s) to fax

This endpoint requires either **files** or **file_urls[]**, but not both. | [optional] **FileUrls** | **List<string>** | Use `file_urls[]` to have Dropbox Fax download the file(s) to fax

This endpoint requires either **files** or **file_urls[]**, but not both. | [optional] **TestMode** | **bool** | API Test Mode Setting | [optional] [default to false]**CoverPageTo** | **string** | Fax cover page recipient information | [optional] **CoverPageFrom** | **string** | Fax cover page sender information | [optional] **CoverPageMessage** | **string** | Fax Cover Page Message | [optional] **Title** | **string** | Fax Title | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/OAuthApi.md b/docs/OAuthApi.md index c80ee27..2918ea9 100644 --- a/docs/OAuthApi.md +++ b/docs/OAuthApi.md @@ -20,33 +20,39 @@ Once you have retrieved the code from the user callback, you will need to exchan using System; using System.Collections.Generic; using System.IO; +using System.Text.Json; + using Dropbox.Sign.Api; using Dropbox.Sign.Client; using Dropbox.Sign.Model; -public class Example +namespace Dropbox.SignSandbox; + +public class OauthTokenGenerateExample { - public static void Main() + public static void Run() { var config = new Configuration(); - var oAuthApi = new OAuthApi(config); - - var data = new OAuthTokenGenerateRequest( - state: "900e06e2", - code: "1b0d28d90c86c141", + var oAuthTokenGenerateRequest = new OAuthTokenGenerateRequest( clientId: "cc91c61d00f8bb2ece1428035716b", - clientSecret: "1d14434088507ffa390e6f5528465" + clientSecret: "1d14434088507ffa390e6f5528465", + code: "1b0d28d90c86c141", + state: "900e06e2", + grantType: "authorization_code" ); try { - var result = oAuthApi.OauthTokenGenerate(data); - Console.WriteLine(result); + var response = new OAuthApi(config).OauthTokenGenerate( + oAuthTokenGenerateRequest: oAuthTokenGenerateRequest + ); + + Console.WriteLine(response); } catch (ApiException e) { - Console.WriteLine("Exception when calling Dropbox Sign API: " + e.Message); + Console.WriteLine("Exception when calling OAuthApi#OauthTokenGenerate: " + e.Message); Console.WriteLine("Status Code: " + e.ErrorCode); Console.WriteLine(e.StackTrace); } @@ -116,30 +122,36 @@ Access tokens are only valid for a given period of time (typically one hour) for using System; using System.Collections.Generic; using System.IO; +using System.Text.Json; + using Dropbox.Sign.Api; using Dropbox.Sign.Client; using Dropbox.Sign.Model; -public class Example +namespace Dropbox.SignSandbox; + +public class OauthTokenRefreshExample { - public static void Main() + public static void Run() { var config = new Configuration(); - var oAuthApi = new OAuthApi(config); - - var data = new OAuthTokenRefreshRequest( + var oAuthTokenRefreshRequest = new OAuthTokenRefreshRequest( + grantType: "refresh_token", refreshToken: "hNTI2MTFmM2VmZDQxZTZjOWRmZmFjZmVmMGMyNGFjMzI2MGI5YzgzNmE3" ); try { - var result = oAuthApi.OauthTokenRefresh(data); - Console.WriteLine(result); + var response = new OAuthApi(config).OauthTokenRefresh( + oAuthTokenRefreshRequest: oAuthTokenRefreshRequest + ); + + Console.WriteLine(response); } catch (ApiException e) { - Console.WriteLine("Exception when calling Dropbox Sign API: " + e.Message); + Console.WriteLine("Exception when calling OAuthApi#OauthTokenRefresh: " + e.Message); Console.WriteLine("Status Code: " + e.ErrorCode); Console.WriteLine(e.StackTrace); } diff --git a/docs/ReportApi.md b/docs/ReportApi.md index 9ea9879..324902c 100644 --- a/docs/ReportApi.md +++ b/docs/ReportApi.md @@ -19,40 +19,41 @@ Request the creation of one or more report(s). When the report(s) have been gen using System; using System.Collections.Generic; using System.IO; +using System.Text.Json; + using Dropbox.Sign.Api; using Dropbox.Sign.Client; using Dropbox.Sign.Model; -public class Example +namespace Dropbox.SignSandbox; + +public class ReportCreateExample { - public static void Main() + public static void Run() { var config = new Configuration(); - // Configure HTTP basic authorization: api_key config.Username = "YOUR_API_KEY"; - // or, configure Bearer (JWT) authorization: oauth2 - // config.AccessToken = "YOUR_BEARER_TOKEN"; - - var reportApi = new ReportApi(config); - - var data = new ReportCreateRequest( + var reportCreateRequest = new ReportCreateRequest( startDate: "09/01/2020", endDate: "09/01/2020", - reportType: new List() { + reportType: [ ReportCreateRequest.ReportTypeEnum.UserActivity, ReportCreateRequest.ReportTypeEnum.DocumentStatus, - } + ] ); try { - var result = reportApi.OauthCreate(data); - Console.WriteLine(result); + var response = new ReportApi(config).ReportCreate( + reportCreateRequest: reportCreateRequest + ); + + Console.WriteLine(response); } catch (ApiException e) { - Console.WriteLine("Exception when calling Dropbox Sign API: " + e.Message); + Console.WriteLine("Exception when calling ReportApi#ReportCreate: " + e.Message); Console.WriteLine("Status Code: " + e.ErrorCode); Console.WriteLine(e.StackTrace); } diff --git a/docs/SignatureRequestApi.md b/docs/SignatureRequestApi.md index a507cc0..fe084fa 100644 --- a/docs/SignatureRequestApi.md +++ b/docs/SignatureRequestApi.md @@ -9,6 +9,10 @@ All URIs are relative to *https://api.hellosign.com/v3* | [**SignatureRequestCancel**](SignatureRequestApi.md#signaturerequestcancel) | **POST** /signature_request/cancel/{signature_request_id} | Cancel Incomplete Signature Request | | [**SignatureRequestCreateEmbedded**](SignatureRequestApi.md#signaturerequestcreateembedded) | **POST** /signature_request/create_embedded | Create Embedded Signature Request | | [**SignatureRequestCreateEmbeddedWithTemplate**](SignatureRequestApi.md#signaturerequestcreateembeddedwithtemplate) | **POST** /signature_request/create_embedded_with_template | Create Embedded Signature Request with Template | +| [**SignatureRequestEdit**](SignatureRequestApi.md#signaturerequestedit) | **PUT** /signature_request/edit/{signature_request_id} | Edit Signature Request | +| [**SignatureRequestEditEmbedded**](SignatureRequestApi.md#signaturerequesteditembedded) | **PUT** /signature_request/edit_embedded/{signature_request_id} | Edit Embedded Signature Request | +| [**SignatureRequestEditEmbeddedWithTemplate**](SignatureRequestApi.md#signaturerequesteditembeddedwithtemplate) | **PUT** /signature_request/edit_embedded_with_template/{signature_request_id} | Edit Embedded Signature Request with Template | +| [**SignatureRequestEditWithTemplate**](SignatureRequestApi.md#signaturerequesteditwithtemplate) | **PUT** /signature_request/edit_with_template/{signature_request_id} | Edit Signature Request With Template | | [**SignatureRequestFiles**](SignatureRequestApi.md#signaturerequestfiles) | **GET** /signature_request/files/{signature_request_id} | Download Files | | [**SignatureRequestFilesAsDataUri**](SignatureRequestApi.md#signaturerequestfilesasdatauri) | **GET** /signature_request/files_as_data_uri/{signature_request_id} | Download Files as Data Uri | | [**SignatureRequestFilesAsFileUrl**](SignatureRequestApi.md#signaturerequestfilesasfileurl) | **GET** /signature_request/files_as_file_url/{signature_request_id} | Download Files as File Url | @@ -34,80 +38,114 @@ Creates BulkSendJob which sends up to 250 SignatureRequests in bulk based off of using System; using System.Collections.Generic; using System.IO; +using System.Text.Json; + using Dropbox.Sign.Api; using Dropbox.Sign.Client; using Dropbox.Sign.Model; -public class Example +namespace Dropbox.SignSandbox; + +public class SignatureRequestBulkCreateEmbeddedWithTemplateExample { - public static void Main() + public static void Run() { var config = new Configuration(); - // Configure HTTP basic authorization: api_key config.Username = "YOUR_API_KEY"; - // or, configure Bearer (JWT) authorization: oauth2 - // config.AccessToken = "YOUR_BEARER_TOKEN"; + var signerList2CustomFields1 = new SubBulkSignerListCustomField( + name: "company", + value: "123 LLC" + ); - var signatureRequestApi = new SignatureRequestApi(config); + var signerList2CustomFields = new List + { + signerList2CustomFields1, + }; - var signerList1Signer = new SubSignatureRequestTemplateSigner( + var signerList2Signers1 = new SubSignatureRequestTemplateSigner( role: "Client", - name: "George", - emailAddress: "george@example.com", - pin: "d79a3td" + name: "Mary", + emailAddress: "mary@example.com", + pin: "gd9as5b" ); - var signerList1CustomFields = new SubBulkSignerListCustomField( + var signerList2Signers = new List + { + signerList2Signers1, + }; + + var signerList1CustomFields1 = new SubBulkSignerListCustomField( name: "company", value: "ABC Corp" ); - var signerList1 = new SubBulkSignerList( - signers: new List(){signerList1Signer}, - customFields: new List(){signerList1CustomFields} - ); + var signerList1CustomFields = new List + { + signerList1CustomFields1, + }; - var signerList2Signer = new SubSignatureRequestTemplateSigner( + var signerList1Signers1 = new SubSignatureRequestTemplateSigner( role: "Client", - name: "Mary", - emailAddress: "mary@example.com", - pin: "gd9as5b" + name: "George", + emailAddress: "george@example.com", + pin: "d79a3td" ); - var signerList2CustomFields = new SubBulkSignerListCustomField( - name: "company", - value: "123 Corp" + var signerList1Signers = new List + { + signerList1Signers1, + }; + + var signerList1 = new SubBulkSignerList( + customFields: signerList1CustomFields, + signers: signerList1Signers ); var signerList2 = new SubBulkSignerList( - signers: new List(){signerList2Signer}, - customFields: new List(){signerList2CustomFields} + customFields: signerList2CustomFields, + signers: signerList2Signers ); - var cc1 = new SubCC( + var signerList = new List + { + signerList1, + signerList2, + }; + + var ccs1 = new SubCC( role: "Accounting", - emailAddress: "accouting@email.com" + emailAddress: "accounting@example.com" ); - var data = new SignatureRequestBulkCreateEmbeddedWithTemplateRequest( + var ccs = new List + { + ccs1, + }; + + var signatureRequestBulkCreateEmbeddedWithTemplateRequest = new SignatureRequestBulkCreateEmbeddedWithTemplateRequest( clientId: "1a659d9ad95bccd307ecad78d72192f8", - templateIds: new List(){"c26b8a16784a872da37ea946b9ddec7c1e11dff6"}, - subject: "Purchase Order", + templateIds: [ + "c26b8a16784a872da37ea946b9ddec7c1e11dff6", + ], message: "Glad we could come to an agreement.", - signerList: new List(){signerList1, signerList2}, - ccs: new List(){cc1}, - testMode: true + subject: "Purchase Order", + testMode: true, + signerList: signerList, + ccs: ccs ); try { - var result = signatureRequestApi.SignatureRequestBulkCreateEmbeddedWithTemplate(data); - Console.WriteLine(result); + var response = new SignatureRequestApi(config).SignatureRequestBulkCreateEmbeddedWithTemplate( + signatureRequestBulkCreateEmbeddedWithTemplateRequest: signatureRequestBulkCreateEmbeddedWithTemplateRequest + ); + + Console.WriteLine(response); } catch (ApiException e) { - Console.WriteLine("Exception when calling Dropbox Sign API: " + e.Message); + Console.WriteLine("Exception when calling SignatureRequestApi#SignatureRequestBulkCreateEmbeddedWithTemplate: " + e.Message); Console.WriteLine("Status Code: " + e.ErrorCode); Console.WriteLine(e.StackTrace); } @@ -177,79 +215,629 @@ Creates BulkSendJob which sends up to 250 SignatureRequests in bulk based off of using System; using System.Collections.Generic; using System.IO; +using System.Text.Json; + using Dropbox.Sign.Api; using Dropbox.Sign.Client; using Dropbox.Sign.Model; -public class Example +namespace Dropbox.SignSandbox; + +public class SignatureRequestBulkSendWithTemplateExample { - public static void Main() + public static void Run() { var config = new Configuration(); - // Configure HTTP basic authorization: api_key config.Username = "YOUR_API_KEY"; + // config.AccessToken = "YOUR_ACCESS_TOKEN"; - // or, configure Bearer (JWT) authorization: oauth2 - // config.AccessToken = "YOUR_BEARER_TOKEN"; + var signerList2CustomFields1 = new SubBulkSignerListCustomField( + name: "company", + value: "123 LLC" + ); - var signatureRequestApi = new SignatureRequestApi(config); + var signerList2CustomFields = new List + { + signerList2CustomFields1, + }; - var signerList1Signer = new SubSignatureRequestTemplateSigner( + var signerList2Signers1 = new SubSignatureRequestTemplateSigner( role: "Client", - name: "George", - emailAddress: "george@example.com", - pin: "d79a3td" + name: "Mary", + emailAddress: "mary@example.com", + pin: "gd9as5b" ); - var signerList1CustomFields = new SubBulkSignerListCustomField( + var signerList2Signers = new List + { + signerList2Signers1, + }; + + var signerList1CustomFields1 = new SubBulkSignerListCustomField( name: "company", value: "ABC Corp" ); + var signerList1CustomFields = new List + { + signerList1CustomFields1, + }; + + var signerList1Signers1 = new SubSignatureRequestTemplateSigner( + role: "Client", + name: "George", + emailAddress: "george@example.com", + pin: "d79a3td" + ); + + var signerList1Signers = new List + { + signerList1Signers1, + }; + var signerList1 = new SubBulkSignerList( - signers: new List(){signerList1Signer}, - customFields: new List(){signerList1CustomFields} + customFields: signerList1CustomFields, + signers: signerList1Signers ); - var signerList2Signer = new SubSignatureRequestTemplateSigner( + var signerList2 = new SubBulkSignerList( + customFields: signerList2CustomFields, + signers: signerList2Signers + ); + + var signerList = new List + { + signerList1, + signerList2, + }; + + var ccs1 = new SubCC( + role: "Accounting", + emailAddress: "accounting@example.com" + ); + + var ccs = new List + { + ccs1, + }; + + var signatureRequestBulkSendWithTemplateRequest = new SignatureRequestBulkSendWithTemplateRequest( + templateIds: [ + "c26b8a16784a872da37ea946b9ddec7c1e11dff6", + ], + message: "Glad we could come to an agreement.", + subject: "Purchase Order", + testMode: true, + signerList: signerList, + ccs: ccs + ); + + try + { + var response = new SignatureRequestApi(config).SignatureRequestBulkSendWithTemplate( + signatureRequestBulkSendWithTemplateRequest: signatureRequestBulkSendWithTemplateRequest + ); + + Console.WriteLine(response); + } + catch (ApiException e) + { + Console.WriteLine("Exception when calling SignatureRequestApi#SignatureRequestBulkSendWithTemplate: " + e.Message); + Console.WriteLine("Status Code: " + e.ErrorCode); + Console.WriteLine(e.StackTrace); + } + } +} + +``` + +#### Using the SignatureRequestBulkSendWithTemplateWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Bulk Send with Template + ApiResponse response = apiInstance.SignatureRequestBulkSendWithTemplateWithHttpInfo(signatureRequestBulkSendWithTemplateRequest); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling SignatureRequestApi.SignatureRequestBulkSendWithTemplateWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **signatureRequestBulkSendWithTemplateRequest** | [**SignatureRequestBulkSendWithTemplateRequest**](SignatureRequestBulkSendWithTemplateRequest.md) | | | + +### Return type + +[**BulkSendJobSendResponse**](BulkSendJobSendResponse.md) + +### Authorization + +[api_key](../README.md#api_key), [oauth2](../README.md#oauth2) + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
| +| **4XX** | failed_operation | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **SignatureRequestCancel** +> void SignatureRequestCancel (string signatureRequestId) + +Cancel Incomplete Signature Request + +Cancels an incomplete signature request. This action is **not reversible**. The request will be canceled and signers will no longer be able to sign. If they try to access the signature request they will receive a HTTP 410 status code indicating that the resource has been deleted. Cancelation is asynchronous and a successful call to this endpoint will return an empty 200 OK response if the signature request is eligible to be canceled and has been successfully queued. This 200 OK response does not indicate a successful cancelation of the signature request itself. The cancelation is confirmed via the `signature_request_canceled` event. It is recommended that a [callback handler](/api/reference/tag/Callbacks-and-Events) be implemented to listen for the `signature_request_canceled` event. This callback will be sent only when the cancelation has completed successfully. If a callback handler has been configured and the event has not been received within 60 minutes of making the call, check the status of the request in the [API Dashboard](https://app.hellosign.com/apidashboard) and retry the cancelation if necessary. To be eligible for cancelation, a signature request must have been sent successfully, must not yet have been signed by all signers, and you must either be the sender or own the API app under which it was sent. A partially signed signature request can be canceled. **NOTE:** To remove your access to a completed signature request, use the endpoint: `POST /signature_request/remove/[:signature_request_id]`. + +### Example +```csharp +using System; +using System.Collections.Generic; +using System.IO; +using System.Text.Json; + +using Dropbox.Sign.Api; +using Dropbox.Sign.Client; +using Dropbox.Sign.Model; + +namespace Dropbox.SignSandbox; + +public class SignatureRequestCancelExample +{ + public static void Run() + { + var config = new Configuration(); + config.Username = "YOUR_API_KEY"; + // config.AccessToken = "YOUR_ACCESS_TOKEN"; + + try + { + new SignatureRequestApi(config).SignatureRequestCancel( + signatureRequestId: "fa5c8a0b0f492d768749333ad6fcc214c111e967" + ); + } + catch (ApiException e) + { + Console.WriteLine("Exception when calling SignatureRequestApi#SignatureRequestCancel: " + e.Message); + Console.WriteLine("Status Code: " + e.ErrorCode); + Console.WriteLine(e.StackTrace); + } + } +} + +``` + +#### Using the SignatureRequestCancelWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Cancel Incomplete Signature Request + apiInstance.SignatureRequestCancelWithHttpInfo(signatureRequestId); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling SignatureRequestApi.SignatureRequestCancelWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **signatureRequestId** | **string** | The id of the incomplete SignatureRequest to cancel. | | + +### Return type + +void (empty response body) + +### Authorization + +[api_key](../README.md#api_key), [oauth2](../README.md#oauth2) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
| +| **4XX** | failed_operation | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **SignatureRequestCreateEmbedded** +> SignatureRequestGetResponse SignatureRequestCreateEmbedded (SignatureRequestCreateEmbeddedRequest signatureRequestCreateEmbeddedRequest) + +Create Embedded Signature Request + +Creates a new SignatureRequest with the submitted documents to be signed in an embedded iFrame. If form_fields_per_document is not specified, a signature page will be affixed where all signers will be required to add their signature, signifying their agreement to all contained documents. Note that embedded signature requests can only be signed in embedded iFrames whereas normal signature requests can only be signed on Dropbox Sign. + +### Example +```csharp +using System; +using System.Collections.Generic; +using System.IO; +using System.Text.Json; + +using Dropbox.Sign.Api; +using Dropbox.Sign.Client; +using Dropbox.Sign.Model; + +namespace Dropbox.SignSandbox; + +public class SignatureRequestCreateEmbeddedExample +{ + public static void Run() + { + var config = new Configuration(); + config.Username = "YOUR_API_KEY"; + // config.AccessToken = "YOUR_ACCESS_TOKEN"; + + var signingOptions = new SubSigningOptions( + defaultType: SubSigningOptions.DefaultTypeEnum.Draw, + draw: true, + phone: false, + type: true, + upload: true + ); + + var signers1 = new SubSignatureRequestSigner( + name: "Jack", + emailAddress: "jack@example.com", + order: 0 + ); + + var signers2 = new SubSignatureRequestSigner( + name: "Jill", + emailAddress: "jill@example.com", + order: 1 + ); + + var signers = new List + { + signers1, + signers2, + }; + + var signatureRequestCreateEmbeddedRequest = new SignatureRequestCreateEmbeddedRequest( + clientId: "b6b8e7deaf8f0b95c029dca049356d4a2cf9710a", + message: "Please sign this NDA and then we can discuss more. Let me know if you\nhave any questions.", + subject: "The NDA we talked about", + testMode: true, + title: "NDA with Acme Co.", + ccEmailAddresses: [ + "lawyer1@dropboxsign.com", + "lawyer2@dropboxsign.com", + ], + files: new List + { + new FileStream( + path: "./example_signature_request.pdf", + mode: FileMode.Open + ), + }, + signingOptions: signingOptions, + signers: signers + ); + + try + { + var response = new SignatureRequestApi(config).SignatureRequestCreateEmbedded( + signatureRequestCreateEmbeddedRequest: signatureRequestCreateEmbeddedRequest + ); + + Console.WriteLine(response); + } + catch (ApiException e) + { + Console.WriteLine("Exception when calling SignatureRequestApi#SignatureRequestCreateEmbedded: " + e.Message); + Console.WriteLine("Status Code: " + e.ErrorCode); + Console.WriteLine(e.StackTrace); + } + } +} + +``` + +#### Using the SignatureRequestCreateEmbeddedWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Create Embedded Signature Request + ApiResponse response = apiInstance.SignatureRequestCreateEmbeddedWithHttpInfo(signatureRequestCreateEmbeddedRequest); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling SignatureRequestApi.SignatureRequestCreateEmbeddedWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **signatureRequestCreateEmbeddedRequest** | [**SignatureRequestCreateEmbeddedRequest**](SignatureRequestCreateEmbeddedRequest.md) | | | + +### Return type + +[**SignatureRequestGetResponse**](SignatureRequestGetResponse.md) + +### Authorization + +[api_key](../README.md#api_key), [oauth2](../README.md#oauth2) + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
| +| **4XX** | failed_operation | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **SignatureRequestCreateEmbeddedWithTemplate** +> SignatureRequestGetResponse SignatureRequestCreateEmbeddedWithTemplate (SignatureRequestCreateEmbeddedWithTemplateRequest signatureRequestCreateEmbeddedWithTemplateRequest) + +Create Embedded Signature Request with Template + +Creates a new SignatureRequest based on the given Template(s) to be signed in an embedded iFrame. Note that embedded signature requests can only be signed in embedded iFrames whereas normal signature requests can only be signed on Dropbox Sign. + +### Example +```csharp +using System; +using System.Collections.Generic; +using System.IO; +using System.Text.Json; + +using Dropbox.Sign.Api; +using Dropbox.Sign.Client; +using Dropbox.Sign.Model; + +namespace Dropbox.SignSandbox; + +public class SignatureRequestCreateEmbeddedWithTemplateExample +{ + public static void Run() + { + var config = new Configuration(); + config.Username = "YOUR_API_KEY"; + // config.AccessToken = "YOUR_ACCESS_TOKEN"; + + var signingOptions = new SubSigningOptions( + defaultType: SubSigningOptions.DefaultTypeEnum.Draw, + draw: true, + phone: false, + type: true, + upload: true + ); + + var signers1 = new SubSignatureRequestTemplateSigner( role: "Client", - name: "Mary", - emailAddress: "mary@example.com", - pin: "gd9as5b" + name: "George", + emailAddress: "george@example.com" + ); + + var signers = new List + { + signers1, + }; + + var signatureRequestCreateEmbeddedWithTemplateRequest = new SignatureRequestCreateEmbeddedWithTemplateRequest( + clientId: "b6b8e7deaf8f0b95c029dca049356d4a2cf9710a", + templateIds: [ + "c26b8a16784a872da37ea946b9ddec7c1e11dff6", + ], + message: "Glad we could come to an agreement.", + subject: "Purchase Order", + testMode: true, + signingOptions: signingOptions, + signers: signers + ); + + try + { + var response = new SignatureRequestApi(config).SignatureRequestCreateEmbeddedWithTemplate( + signatureRequestCreateEmbeddedWithTemplateRequest: signatureRequestCreateEmbeddedWithTemplateRequest + ); + + Console.WriteLine(response); + } + catch (ApiException e) + { + Console.WriteLine("Exception when calling SignatureRequestApi#SignatureRequestCreateEmbeddedWithTemplate: " + e.Message); + Console.WriteLine("Status Code: " + e.ErrorCode); + Console.WriteLine(e.StackTrace); + } + } +} + +``` + +#### Using the SignatureRequestCreateEmbeddedWithTemplateWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Create Embedded Signature Request with Template + ApiResponse response = apiInstance.SignatureRequestCreateEmbeddedWithTemplateWithHttpInfo(signatureRequestCreateEmbeddedWithTemplateRequest); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling SignatureRequestApi.SignatureRequestCreateEmbeddedWithTemplateWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **signatureRequestCreateEmbeddedWithTemplateRequest** | [**SignatureRequestCreateEmbeddedWithTemplateRequest**](SignatureRequestCreateEmbeddedWithTemplateRequest.md) | | | + +### Return type + +[**SignatureRequestGetResponse**](SignatureRequestGetResponse.md) + +### Authorization + +[api_key](../README.md#api_key), [oauth2](../README.md#oauth2) + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
| +| **4XX** | failed_operation | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **SignatureRequestEdit** +> SignatureRequestGetResponse SignatureRequestEdit (string signatureRequestId, SignatureRequestEditRequest signatureRequestEditRequest) + +Edit Signature Request + +Edits and sends a SignatureRequest with the submitted documents. If `form_fields_per_document` is not specified, a signature page will be affixed where all signers will be required to add their signature, signifying their agreement to all contained documents. **NOTE:** Edit and resend *will* deduct your signature request quota. + +### Example +```csharp +using System; +using System.Collections.Generic; +using System.IO; +using System.Text.Json; + +using Dropbox.Sign.Api; +using Dropbox.Sign.Client; +using Dropbox.Sign.Model; + +namespace Dropbox.SignSandbox; + +public class SignatureRequestEditExample +{ + public static void Run() + { + var config = new Configuration(); + config.Username = "YOUR_API_KEY"; + // config.AccessToken = "YOUR_ACCESS_TOKEN"; + + var fieldOptions = new SubFieldOptions( + dateFormat: SubFieldOptions.DateFormatEnum.DD_MM_YYYY + ); + + var signingOptions = new SubSigningOptions( + defaultType: SubSigningOptions.DefaultTypeEnum.Draw, + draw: true, + phone: false, + type: true, + upload: true ); - var signerList2CustomFields = new SubBulkSignerListCustomField( - name: "company", - value: "123 Corp" + var signers1 = new SubSignatureRequestSigner( + name: "Jack", + emailAddress: "jack@example.com", + order: 0 ); - var signerList2 = new SubBulkSignerList( - signers: new List(){signerList2Signer}, - customFields: new List(){signerList2CustomFields} + var signers2 = new SubSignatureRequestSigner( + name: "Jill", + emailAddress: "jill@example.com", + order: 1 ); - var cc1 = new SubCC( - role: "Accounting", - emailAddress: "accouting@email.com" - ); + var signers = new List + { + signers1, + signers2, + }; - var data = new SignatureRequestBulkSendWithTemplateRequest( - templateIds: new List(){"c26b8a16784a872da37ea946b9ddec7c1e11dff6"}, - subject: "Purchase Order", - message: "Glad we could come to an agreement.", - signerList: new List(){signerList1, signerList2}, - ccs: new List(){cc1}, - testMode: true + var signatureRequestEditRequest = new SignatureRequestEditRequest( + message: "Please sign this NDA and then we can discuss more. Let me know if you\nhave any questions.", + subject: "The NDA we talked about", + testMode: true, + title: "NDA with Acme Co.", + ccEmailAddresses: [ + "lawyer1@dropboxsign.com", + "lawyer2@dropboxsign.com", + ], + files: new List + { + new FileStream( + path: "./example_signature_request.pdf", + mode: FileMode.Open + ), + }, + metadata: JsonSerializer.Deserialize>(""" + { + "custom_id": 1234, + "custom_text": "NDA #9" + } + """), + fieldOptions: fieldOptions, + signingOptions: signingOptions, + signers: signers ); try { - var result = signatureRequestApi.SignatureRequestBulkSendWithTemplate(data); - Console.WriteLine(result); + var response = new SignatureRequestApi(config).SignatureRequestEdit( + signatureRequestId: "fa5c8a0b0f492d768749333ad6fcc214c111e967", + signatureRequestEditRequest: signatureRequestEditRequest + ); + + Console.WriteLine(response); } catch (ApiException e) { - Console.WriteLine("Exception when calling Dropbox Sign API: " + e.Message); + Console.WriteLine("Exception when calling SignatureRequestApi#SignatureRequestEdit: " + e.Message); Console.WriteLine("Status Code: " + e.ErrorCode); Console.WriteLine(e.StackTrace); } @@ -258,21 +846,21 @@ public class Example ``` -#### Using the SignatureRequestBulkSendWithTemplateWithHttpInfo variant +#### Using the SignatureRequestEditWithHttpInfo variant This returns an ApiResponse object which contains the response data, status code and headers. ```csharp try { - // Bulk Send with Template - ApiResponse response = apiInstance.SignatureRequestBulkSendWithTemplateWithHttpInfo(signatureRequestBulkSendWithTemplateRequest); + // Edit Signature Request + ApiResponse response = apiInstance.SignatureRequestEditWithHttpInfo(signatureRequestId, signatureRequestEditRequest); Debug.Write("Status Code: " + response.StatusCode); Debug.Write("Response Headers: " + response.Headers); Debug.Write("Response Body: " + response.Data); } catch (ApiException e) { - Debug.Print("Exception when calling SignatureRequestApi.SignatureRequestBulkSendWithTemplateWithHttpInfo: " + e.Message); + Debug.Print("Exception when calling SignatureRequestApi.SignatureRequestEditWithHttpInfo: " + e.Message); Debug.Print("Status Code: " + e.ErrorCode); Debug.Print(e.StackTrace); } @@ -282,11 +870,12 @@ catch (ApiException e) | Name | Type | Description | Notes | |------|------|-------------|-------| -| **signatureRequestBulkSendWithTemplateRequest** | [**SignatureRequestBulkSendWithTemplateRequest**](SignatureRequestBulkSendWithTemplateRequest.md) | | | +| **signatureRequestId** | **string** | The id of the SignatureRequest to edit. | | +| **signatureRequestEditRequest** | [**SignatureRequestEditRequest**](SignatureRequestEditRequest.md) | | | ### Return type -[**BulkSendJobSendResponse**](BulkSendJobSendResponse.md) +[**SignatureRequestGetResponse**](SignatureRequestGetResponse.md) ### Authorization @@ -306,45 +895,94 @@ catch (ApiException e) [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **SignatureRequestCancel** -> void SignatureRequestCancel (string signatureRequestId) + +# **SignatureRequestEditEmbedded** +> SignatureRequestGetResponse SignatureRequestEditEmbedded (string signatureRequestId, SignatureRequestEditEmbeddedRequest signatureRequestEditEmbeddedRequest) -Cancel Incomplete Signature Request +Edit Embedded Signature Request -Cancels an incomplete signature request. This action is **not reversible**. The request will be canceled and signers will no longer be able to sign. If they try to access the signature request they will receive a HTTP 410 status code indicating that the resource has been deleted. Cancelation is asynchronous and a successful call to this endpoint will return an empty 200 OK response if the signature request is eligible to be canceled and has been successfully queued. This 200 OK response does not indicate a successful cancelation of the signature request itself. The cancelation is confirmed via the `signature_request_canceled` event. It is recommended that a [callback handler](/api/reference/tag/Callbacks-and-Events) be implemented to listen for the `signature_request_canceled` event. This callback will be sent only when the cancelation has completed successfully. If a callback handler has been configured and the event has not been received within 60 minutes of making the call, check the status of the request in the [API Dashboard](https://app.hellosign.com/apidashboard) and retry the cancelation if necessary. To be eligible for cancelation, a signature request must have been sent successfully, must not yet have been signed by all signers, and you must either be the sender or own the API app under which it was sent. A partially signed signature request can be canceled. **NOTE:** To remove your access to a completed signature request, use the endpoint: `POST /signature_request/remove/[:signature_request_id]`. +Edits a SignatureRequest with the submitted documents to be signed in an embedded iFrame. If form_fields_per_document is not specified, a signature page will be affixed where all signers will be required to add their signature, signifying their agreement to all contained documents. Note that embedded signature requests can only be signed in embedded iFrames whereas normal signature requests can only be signed on Dropbox Sign. **NOTE:** Edit and resend *will* deduct your signature request quota. ### Example ```csharp using System; using System.Collections.Generic; using System.IO; +using System.Text.Json; + using Dropbox.Sign.Api; using Dropbox.Sign.Client; using Dropbox.Sign.Model; -public class Example +namespace Dropbox.SignSandbox; + +public class SignatureRequestEditEmbeddedExample { - public static void Main() + public static void Run() { var config = new Configuration(); - // Configure HTTP basic authorization: api_key config.Username = "YOUR_API_KEY"; + // config.AccessToken = "YOUR_ACCESS_TOKEN"; - // or, configure Bearer (JWT) authorization: oauth2 - // config.AccessToken = "YOUR_BEARER_TOKEN"; + var signingOptions = new SubSigningOptions( + defaultType: SubSigningOptions.DefaultTypeEnum.Draw, + draw: true, + phone: false, + type: true, + upload: true + ); + + var signers1 = new SubSignatureRequestSigner( + name: "Jack", + emailAddress: "jack@example.com", + order: 0 + ); + + var signers2 = new SubSignatureRequestSigner( + name: "Jill", + emailAddress: "jill@example.com", + order: 1 + ); - var signatureRequestApi = new SignatureRequestApi(config); + var signers = new List + { + signers1, + signers2, + }; - var signatureRequestId = "2f9781e1a8e2045224d808c153c2e1d3df6f8f2f"; + var signatureRequestEditEmbeddedRequest = new SignatureRequestEditEmbeddedRequest( + clientId: "b6b8e7deaf8f0b95c029dca049356d4a2cf9710a", + message: "Please sign this NDA and then we can discuss more. Let me know if you\nhave any questions.", + subject: "The NDA we talked about", + testMode: true, + title: "NDA with Acme Co.", + ccEmailAddresses: [ + "lawyer1@dropboxsign.com", + "lawyer2@dropboxsign.com", + ], + files: new List + { + new FileStream( + path: "./example_signature_request.pdf", + mode: FileMode.Open + ), + }, + signingOptions: signingOptions, + signers: signers + ); try { - signatureRequestApi.SignatureRequestCancel(signatureRequestId); + var response = new SignatureRequestApi(config).SignatureRequestEditEmbedded( + signatureRequestId: "fa5c8a0b0f492d768749333ad6fcc214c111e967", + signatureRequestEditEmbeddedRequest: signatureRequestEditEmbeddedRequest + ); + + Console.WriteLine(response); } catch (ApiException e) { - Console.WriteLine("Exception when calling Dropbox Sign API: " + e.Message); + Console.WriteLine("Exception when calling SignatureRequestApi#SignatureRequestEditEmbedded: " + e.Message); Console.WriteLine("Status Code: " + e.ErrorCode); Console.WriteLine(e.StackTrace); } @@ -353,18 +991,21 @@ public class Example ``` -#### Using the SignatureRequestCancelWithHttpInfo variant +#### Using the SignatureRequestEditEmbeddedWithHttpInfo variant This returns an ApiResponse object which contains the response data, status code and headers. ```csharp try { - // Cancel Incomplete Signature Request - apiInstance.SignatureRequestCancelWithHttpInfo(signatureRequestId); + // Edit Embedded Signature Request + ApiResponse response = apiInstance.SignatureRequestEditEmbeddedWithHttpInfo(signatureRequestId, signatureRequestEditEmbeddedRequest); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); } catch (ApiException e) { - Debug.Print("Exception when calling SignatureRequestApi.SignatureRequestCancelWithHttpInfo: " + e.Message); + Debug.Print("Exception when calling SignatureRequestApi.SignatureRequestEditEmbeddedWithHttpInfo: " + e.Message); Debug.Print("Status Code: " + e.ErrorCode); Debug.Print(e.StackTrace); } @@ -374,11 +1015,12 @@ catch (ApiException e) | Name | Type | Description | Notes | |------|------|-------------|-------| -| **signatureRequestId** | **string** | The id of the incomplete SignatureRequest to cancel. | | +| **signatureRequestId** | **string** | The id of the SignatureRequest to edit. | | +| **signatureRequestEditEmbeddedRequest** | [**SignatureRequestEditEmbeddedRequest**](SignatureRequestEditEmbeddedRequest.md) | | | ### Return type -void (empty response body) +[**SignatureRequestGetResponse**](SignatureRequestGetResponse.md) ### Authorization @@ -386,7 +1028,7 @@ void (empty response body) ### HTTP request headers - - **Content-Type**: Not defined + - **Content-Type**: application/json, multipart/form-data - **Accept**: application/json @@ -398,85 +1040,78 @@ void (empty response body) [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **SignatureRequestCreateEmbedded** -> SignatureRequestGetResponse SignatureRequestCreateEmbedded (SignatureRequestCreateEmbeddedRequest signatureRequestCreateEmbeddedRequest) + +# **SignatureRequestEditEmbeddedWithTemplate** +> SignatureRequestGetResponse SignatureRequestEditEmbeddedWithTemplate (string signatureRequestId, SignatureRequestEditEmbeddedWithTemplateRequest signatureRequestEditEmbeddedWithTemplateRequest) -Create Embedded Signature Request +Edit Embedded Signature Request with Template -Creates a new SignatureRequest with the submitted documents to be signed in an embedded iFrame. If form_fields_per_document is not specified, a signature page will be affixed where all signers will be required to add their signature, signifying their agreement to all contained documents. Note that embedded signature requests can only be signed in embedded iFrames whereas normal signature requests can only be signed on Dropbox Sign. +Edits a SignatureRequest based on the given Template(s) to be signed in an embedded iFrame. Note that embedded signature requests can only be signed in embedded iFrames whereas normal signature requests can only be signed on Dropbox Sign. **NOTE:** Edit and resend *will* deduct your signature request quota. ### Example ```csharp using System; using System.Collections.Generic; using System.IO; +using System.Text.Json; + using Dropbox.Sign.Api; using Dropbox.Sign.Client; using Dropbox.Sign.Model; -public class Example +namespace Dropbox.SignSandbox; + +public class SignatureRequestEditEmbeddedWithTemplateExample { - public static void Main() + public static void Run() { var config = new Configuration(); - // Configure HTTP basic authorization: api_key config.Username = "YOUR_API_KEY"; - - // or, configure Bearer (JWT) authorization: oauth2 - // config.AccessToken = "YOUR_BEARER_TOKEN"; - - var signatureRequestApi = new SignatureRequestApi(config); - - var signer1 = new SubSignatureRequestSigner( - emailAddress: "jack@example.com", - name: "Jack", - order: 0 - ); - - var signer2 = new SubSignatureRequestSigner( - emailAddress: "jill@example.com", - name: "Jill", - order: 1 - ); + // config.AccessToken = "YOUR_ACCESS_TOKEN"; var signingOptions = new SubSigningOptions( + defaultType: SubSigningOptions.DefaultTypeEnum.Draw, draw: true, + phone: false, type: true, - upload: true, - phone: true, - defaultType: SubSigningOptions.DefaultTypeEnum.Draw + upload: true + ); + + var signers1 = new SubSignatureRequestTemplateSigner( + role: "Client", + name: "George", + emailAddress: "george@example.com" ); - var files = new List { - new FileStream( - "./example_signature_request.pdf", - FileMode.Open, - FileAccess.Read, - FileShare.Read - ) + var signers = new List + { + signers1, }; - var data = new SignatureRequestCreateEmbeddedRequest( - clientId: "ec64a202072370a737edf4a0eb7f4437", - title: "NDA with Acme Co.", - subject: "The NDA we talked about", - message: "Please sign this NDA and then we can discuss more. Let me know if you have any questions.", - signers: new List(){signer1, signer2}, - ccEmailAddresses: new List(){"lawyer1@dropboxsign.com", "lawyer2@dropboxsign.com"}, - files: files, + var signatureRequestEditEmbeddedWithTemplateRequest = new SignatureRequestEditEmbeddedWithTemplateRequest( + clientId: "b6b8e7deaf8f0b95c029dca049356d4a2cf9710a", + templateIds: [ + "c26b8a16784a872da37ea946b9ddec7c1e11dff6", + ], + message: "Glad we could come to an agreement.", + subject: "Purchase Order", + testMode: true, signingOptions: signingOptions, - testMode: true + signers: signers ); try { - var result = signatureRequestApi.SignatureRequestCreateEmbedded(data); - Console.WriteLine(result); + var response = new SignatureRequestApi(config).SignatureRequestEditEmbeddedWithTemplate( + signatureRequestId: "fa5c8a0b0f492d768749333ad6fcc214c111e967", + signatureRequestEditEmbeddedWithTemplateRequest: signatureRequestEditEmbeddedWithTemplateRequest + ); + + Console.WriteLine(response); } catch (ApiException e) { - Console.WriteLine("Exception when calling Dropbox Sign API: " + e.Message); + Console.WriteLine("Exception when calling SignatureRequestApi#SignatureRequestEditEmbeddedWithTemplate: " + e.Message); Console.WriteLine("Status Code: " + e.ErrorCode); Console.WriteLine(e.StackTrace); } @@ -485,21 +1120,21 @@ public class Example ``` -#### Using the SignatureRequestCreateEmbeddedWithHttpInfo variant +#### Using the SignatureRequestEditEmbeddedWithTemplateWithHttpInfo variant This returns an ApiResponse object which contains the response data, status code and headers. ```csharp try { - // Create Embedded Signature Request - ApiResponse response = apiInstance.SignatureRequestCreateEmbeddedWithHttpInfo(signatureRequestCreateEmbeddedRequest); + // Edit Embedded Signature Request with Template + ApiResponse response = apiInstance.SignatureRequestEditEmbeddedWithTemplateWithHttpInfo(signatureRequestId, signatureRequestEditEmbeddedWithTemplateRequest); Debug.Write("Status Code: " + response.StatusCode); Debug.Write("Response Headers: " + response.Headers); Debug.Write("Response Body: " + response.Data); } catch (ApiException e) { - Debug.Print("Exception when calling SignatureRequestApi.SignatureRequestCreateEmbeddedWithHttpInfo: " + e.Message); + Debug.Print("Exception when calling SignatureRequestApi.SignatureRequestEditEmbeddedWithTemplateWithHttpInfo: " + e.Message); Debug.Print("Status Code: " + e.ErrorCode); Debug.Print(e.StackTrace); } @@ -509,7 +1144,8 @@ catch (ApiException e) | Name | Type | Description | Notes | |------|------|-------------|-------| -| **signatureRequestCreateEmbeddedRequest** | [**SignatureRequestCreateEmbeddedRequest**](SignatureRequestCreateEmbeddedRequest.md) | | | +| **signatureRequestId** | **string** | The id of the SignatureRequest to edit. | | +| **signatureRequestEditEmbeddedWithTemplateRequest** | [**SignatureRequestEditEmbeddedWithTemplateRequest**](SignatureRequestEditEmbeddedWithTemplateRequest.md) | | | ### Return type @@ -533,66 +1169,101 @@ catch (ApiException e) [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **SignatureRequestCreateEmbeddedWithTemplate** -> SignatureRequestGetResponse SignatureRequestCreateEmbeddedWithTemplate (SignatureRequestCreateEmbeddedWithTemplateRequest signatureRequestCreateEmbeddedWithTemplateRequest) + +# **SignatureRequestEditWithTemplate** +> SignatureRequestGetResponse SignatureRequestEditWithTemplate (string signatureRequestId, SignatureRequestEditWithTemplateRequest signatureRequestEditWithTemplateRequest) -Create Embedded Signature Request with Template +Edit Signature Request With Template -Creates a new SignatureRequest based on the given Template(s) to be signed in an embedded iFrame. Note that embedded signature requests can only be signed in embedded iFrames whereas normal signature requests can only be signed on Dropbox Sign. +Edits and sends a SignatureRequest based off of the Template(s) specified with the template_ids parameter. **NOTE:** Edit and resend *will* deduct your signature request quota. ### Example ```csharp using System; using System.Collections.Generic; +using System.IO; +using System.Text.Json; + using Dropbox.Sign.Api; using Dropbox.Sign.Client; using Dropbox.Sign.Model; -public class Example +namespace Dropbox.SignSandbox; + +public class SignatureRequestEditWithTemplateExample { - public static void Main() + public static void Run() { var config = new Configuration(); - // Configure HTTP basic authorization: api_key config.Username = "YOUR_API_KEY"; + // config.AccessToken = "YOUR_ACCESS_TOKEN"; - // or, configure Bearer (JWT) authorization: oauth2 - // config.AccessToken = "YOUR_BEARER_TOKEN"; - - var signatureRequestApi = new SignatureRequestApi(config); + var signingOptions = new SubSigningOptions( + defaultType: SubSigningOptions.DefaultTypeEnum.Draw, + draw: true, + phone: false, + type: true, + upload: true + ); - var signer1 = new SubSignatureRequestTemplateSigner( + var signers1 = new SubSignatureRequestTemplateSigner( role: "Client", - name: "George" + name: "George", + emailAddress: "george@example.com" ); - var subSigningOptions = new SubSigningOptions( - draw: true, - type: true, - upload: true, - phone: false, - defaultType: SubSigningOptions.DefaultTypeEnum.Draw + var signers = new List + { + signers1, + }; + + var ccs1 = new SubCC( + role: "Accounting", + emailAddress: "accounting@example.com" ); - var data = new SignatureRequestCreateEmbeddedWithTemplateRequest( - clientId: "ec64a202072370a737edf4a0eb7f4437", - templateIds: new List(){"c26b8a16784a872da37ea946b9ddec7c1e11dff6"}, - subject: "Purchase Order", + var ccs = new List + { + ccs1, + }; + + var customFields1 = new SubCustomField( + name: "Cost", + editor: "Client", + required: true, + value: "$20,000" + ); + + var customFields = new List + { + customFields1, + }; + + var signatureRequestEditWithTemplateRequest = new SignatureRequestEditWithTemplateRequest( + templateIds: [ + "61a832ff0d8423f91d503e76bfbcc750f7417c78", + ], message: "Glad we could come to an agreement.", - signers: new List(){signer1}, - signingOptions: subSigningOptions, - testMode: true + subject: "Purchase Order", + testMode: true, + signingOptions: signingOptions, + signers: signers, + ccs: ccs, + customFields: customFields ); try { - var result = signatureRequestApi.SignatureRequestCreateEmbeddedWithTemplate(data); - Console.WriteLine(result); + var response = new SignatureRequestApi(config).SignatureRequestEditWithTemplate( + signatureRequestId: "fa5c8a0b0f492d768749333ad6fcc214c111e967", + signatureRequestEditWithTemplateRequest: signatureRequestEditWithTemplateRequest + ); + + Console.WriteLine(response); } catch (ApiException e) { - Console.WriteLine("Exception when calling Dropbox Sign API: " + e.Message); + Console.WriteLine("Exception when calling SignatureRequestApi#SignatureRequestEditWithTemplate: " + e.Message); Console.WriteLine("Status Code: " + e.ErrorCode); Console.WriteLine(e.StackTrace); } @@ -601,21 +1272,21 @@ public class Example ``` -#### Using the SignatureRequestCreateEmbeddedWithTemplateWithHttpInfo variant +#### Using the SignatureRequestEditWithTemplateWithHttpInfo variant This returns an ApiResponse object which contains the response data, status code and headers. ```csharp try { - // Create Embedded Signature Request with Template - ApiResponse response = apiInstance.SignatureRequestCreateEmbeddedWithTemplateWithHttpInfo(signatureRequestCreateEmbeddedWithTemplateRequest); + // Edit Signature Request With Template + ApiResponse response = apiInstance.SignatureRequestEditWithTemplateWithHttpInfo(signatureRequestId, signatureRequestEditWithTemplateRequest); Debug.Write("Status Code: " + response.StatusCode); Debug.Write("Response Headers: " + response.Headers); Debug.Write("Response Body: " + response.Data); } catch (ApiException e) { - Debug.Print("Exception when calling SignatureRequestApi.SignatureRequestCreateEmbeddedWithTemplateWithHttpInfo: " + e.Message); + Debug.Print("Exception when calling SignatureRequestApi.SignatureRequestEditWithTemplateWithHttpInfo: " + e.Message); Debug.Print("Status Code: " + e.ErrorCode); Debug.Print(e.StackTrace); } @@ -625,7 +1296,8 @@ catch (ApiException e) | Name | Type | Description | Notes | |------|------|-------------|-------| -| **signatureRequestCreateEmbeddedWithTemplateRequest** | [**SignatureRequestCreateEmbeddedWithTemplateRequest**](SignatureRequestCreateEmbeddedWithTemplateRequest.md) | | | +| **signatureRequestId** | **string** | The id of the SignatureRequest to edit. | | +| **signatureRequestEditWithTemplateRequest** | [**SignatureRequestEditWithTemplateRequest**](SignatureRequestEditWithTemplateRequest.md) | | | ### Return type @@ -661,37 +1333,37 @@ Obtain a copy of the current documents specified by the `signature_request_id` p ```csharp using System; using System.Collections.Generic; +using System.IO; +using System.Text.Json; + using Dropbox.Sign.Api; using Dropbox.Sign.Client; using Dropbox.Sign.Model; -public class Example +namespace Dropbox.SignSandbox; + +public class SignatureRequestFilesExample { - public static void Main() + public static void Run() { var config = new Configuration(); - // Configure HTTP basic authorization: api_key config.Username = "YOUR_API_KEY"; - - // or, configure Bearer (JWT) authorization: oauth2 - // config.AccessToken = "YOUR_BEARER_TOKEN"; - - var signatureRequestApi = new SignatureRequestApi(config); - - var signatureRequestId = "fa5c8a0b0f492d768749333ad6fcc214c111e967"; + // config.AccessToken = "YOUR_ACCESS_TOKEN"; try { - var result = signatureRequestApi.SignatureRequestFiles(signatureRequestId, "pdf"); - - var fileStream = File.Create("file_response.pdf"); - result.Seek(0, SeekOrigin.Begin); - result.CopyTo(fileStream); + var response = new SignatureRequestApi(config).SignatureRequestFiles( + signatureRequestId: "fa5c8a0b0f492d768749333ad6fcc214c111e967", + fileType: "pdf" + ); + var fileStream = File.Create("./file_response"); + response.Seek(0, SeekOrigin.Begin); + response.CopyTo(fileStream); fileStream.Close(); } catch (ApiException e) { - Console.WriteLine("Exception when calling Dropbox Sign API: " + e.Message); + Console.WriteLine("Exception when calling SignatureRequestApi#SignatureRequestFiles: " + e.Message); Console.WriteLine("Status Code: " + e.ErrorCode); Console.WriteLine(e.StackTrace); } @@ -761,33 +1433,34 @@ Obtain a copy of the current documents specified by the `signature_request_id` p ```csharp using System; using System.Collections.Generic; +using System.IO; +using System.Text.Json; + using Dropbox.Sign.Api; using Dropbox.Sign.Client; using Dropbox.Sign.Model; -public class Example +namespace Dropbox.SignSandbox; + +public class SignatureRequestFilesAsDataUriExample { - public static void Main() + public static void Run() { var config = new Configuration(); - // Configure HTTP basic authorization: api_key config.Username = "YOUR_API_KEY"; - - // or, configure Bearer (JWT) authorization: oauth2 - // config.AccessToken = "YOUR_BEARER_TOKEN"; - - var signatureRequestApi = new SignatureRequestApi(config); - - var signatureRequestId = "fa5c8a0b0f492d768749333ad6fcc214c111e967"; + // config.AccessToken = "YOUR_ACCESS_TOKEN"; try { - var result = signatureRequestApi.SignatureRequestFilesAsDataUri(signatureRequestId); - Console.WriteLine(result); + var response = new SignatureRequestApi(config).SignatureRequestFilesAsDataUri( + signatureRequestId: "fa5c8a0b0f492d768749333ad6fcc214c111e967" + ); + + Console.WriteLine(response); } catch (ApiException e) { - Console.WriteLine("Exception when calling Dropbox Sign API: " + e.Message); + Console.WriteLine("Exception when calling SignatureRequestApi#SignatureRequestFilesAsDataUri: " + e.Message); Console.WriteLine("Status Code: " + e.ErrorCode); Console.WriteLine(e.StackTrace); } @@ -856,33 +1529,35 @@ Obtain a copy of the current documents specified by the `signature_request_id` p ```csharp using System; using System.Collections.Generic; +using System.IO; +using System.Text.Json; + using Dropbox.Sign.Api; using Dropbox.Sign.Client; using Dropbox.Sign.Model; -public class Example +namespace Dropbox.SignSandbox; + +public class SignatureRequestFilesAsFileUrlExample { - public static void Main() + public static void Run() { var config = new Configuration(); - // Configure HTTP basic authorization: api_key config.Username = "YOUR_API_KEY"; - - // or, configure Bearer (JWT) authorization: oauth2 - // config.AccessToken = "YOUR_BEARER_TOKEN"; - - var signatureRequestApi = new SignatureRequestApi(config); - - var signatureRequestId = "fa5c8a0b0f492d768749333ad6fcc214c111e967"; + // config.AccessToken = "YOUR_ACCESS_TOKEN"; try { - var result = signatureRequestApi.SignatureRequestFilesAsFileUrl(signatureRequestId); - Console.WriteLine(result); + var response = new SignatureRequestApi(config).SignatureRequestFilesAsFileUrl( + signatureRequestId: "fa5c8a0b0f492d768749333ad6fcc214c111e967", + forceDownload: 1 + ); + + Console.WriteLine(response); } catch (ApiException e) { - Console.WriteLine("Exception when calling Dropbox Sign API: " + e.Message); + Console.WriteLine("Exception when calling SignatureRequestApi#SignatureRequestFilesAsFileUrl: " + e.Message); Console.WriteLine("Status Code: " + e.ErrorCode); Console.WriteLine(e.StackTrace); } @@ -952,33 +1627,34 @@ Returns the status of the SignatureRequest specified by the `signature_request_i ```csharp using System; using System.Collections.Generic; +using System.IO; +using System.Text.Json; + using Dropbox.Sign.Api; using Dropbox.Sign.Client; using Dropbox.Sign.Model; -public class Example +namespace Dropbox.SignSandbox; + +public class SignatureRequestGetExample { - public static void Main() + public static void Run() { var config = new Configuration(); - // Configure HTTP basic authorization: api_key config.Username = "YOUR_API_KEY"; - - // or, configure Bearer (JWT) authorization: oauth2 - // config.AccessToken = "YOUR_BEARER_TOKEN"; - - var signatureRequestApi = new SignatureRequestApi(config); - - var signatureRequestId = "fa5c8a0b0f492d768749333ad6fcc214c111e967"; + // config.AccessToken = "YOUR_ACCESS_TOKEN"; try { - var result = signatureRequestApi.SignatureRequestGet(signatureRequestId); - Console.WriteLine(result); + var response = new SignatureRequestApi(config).SignatureRequestGet( + signatureRequestId: "fa5c8a0b0f492d768749333ad6fcc214c111e967" + ); + + Console.WriteLine(response); } catch (ApiException e) { - Console.WriteLine("Exception when calling Dropbox Sign API: " + e.Message); + Console.WriteLine("Exception when calling SignatureRequestApi#SignatureRequestGet: " + e.Message); Console.WriteLine("Status Code: " + e.ErrorCode); Console.WriteLine(e.StackTrace); } @@ -1047,33 +1723,35 @@ Returns a list of SignatureRequests that you can access. This includes Signature ```csharp using System; using System.Collections.Generic; +using System.IO; +using System.Text.Json; + using Dropbox.Sign.Api; using Dropbox.Sign.Client; using Dropbox.Sign.Model; -public class Example +namespace Dropbox.SignSandbox; + +public class SignatureRequestListExample { - public static void Main() + public static void Run() { var config = new Configuration(); - // Configure HTTP basic authorization: api_key config.Username = "YOUR_API_KEY"; - - // or, configure Bearer (JWT) authorization: oauth2 - // config.AccessToken = "YOUR_BEARER_TOKEN"; - - var signatureRequestApi = new SignatureRequestApi(config); - - var accountId = "accountId"; + // config.AccessToken = "YOUR_ACCESS_TOKEN"; try { - var result = signatureRequestApi.SignatureRequestList(accountId); - Console.WriteLine(result); + var response = new SignatureRequestApi(config).SignatureRequestList( + page: 1, + pageSize: 20 + ); + + Console.WriteLine(response); } catch (ApiException e) { - Console.WriteLine("Exception when calling Dropbox Sign API: " + e.Message); + Console.WriteLine("Exception when calling SignatureRequestApi#SignatureRequestList: " + e.Message); Console.WriteLine("Status Code: " + e.ErrorCode); Console.WriteLine(e.StackTrace); } @@ -1145,33 +1823,34 @@ Releases a held SignatureRequest that was claimed and prepared from an [Unclaime ```csharp using System; using System.Collections.Generic; +using System.IO; +using System.Text.Json; + using Dropbox.Sign.Api; using Dropbox.Sign.Client; using Dropbox.Sign.Model; -public class Example +namespace Dropbox.SignSandbox; + +public class SignatureRequestReleaseHoldExample { - public static void Main() + public static void Run() { var config = new Configuration(); - // Configure HTTP basic authorization: api_key config.Username = "YOUR_API_KEY"; - - // or, configure Bearer (JWT) authorization: oauth2 - // config.AccessToken = "YOUR_BEARER_TOKEN"; - - var signatureRequestApi = new SignatureRequestApi(config); - - var signatureRequestId = "2f9781e1a8e2045224d808c153c2e1d3df6f8f2f"; + // config.AccessToken = "YOUR_ACCESS_TOKEN"; try { - var result = signatureRequestApi.SignatureRequestReleaseHold(signatureRequestId); - Console.WriteLine(result); + var response = new SignatureRequestApi(config).SignatureRequestReleaseHold( + signatureRequestId: "fa5c8a0b0f492d768749333ad6fcc214c111e967" + ); + + Console.WriteLine(response); } catch (ApiException e) { - Console.WriteLine("Exception when calling Dropbox Sign API: " + e.Message); + Console.WriteLine("Exception when calling SignatureRequestApi#SignatureRequestReleaseHold: " + e.Message); Console.WriteLine("Status Code: " + e.ErrorCode); Console.WriteLine(e.StackTrace); } @@ -1240,37 +1919,39 @@ Sends an email to the signer reminding them to sign the signature request. You c ```csharp using System; using System.Collections.Generic; +using System.IO; +using System.Text.Json; + using Dropbox.Sign.Api; using Dropbox.Sign.Client; using Dropbox.Sign.Model; -public class Example +namespace Dropbox.SignSandbox; + +public class SignatureRequestRemindExample { - public static void Main() + public static void Run() { var config = new Configuration(); - // Configure HTTP basic authorization: api_key config.Username = "YOUR_API_KEY"; + // config.AccessToken = "YOUR_ACCESS_TOKEN"; - // or, configure Bearer (JWT) authorization: oauth2 - // config.AccessToken = "YOUR_BEARER_TOKEN"; - - var signatureRequestApi = new SignatureRequestApi(config); - - var data = new SignatureRequestRemindRequest( + var signatureRequestRemindRequest = new SignatureRequestRemindRequest( emailAddress: "john@example.com" ); - var signatureRequestId = "2f9781e1a8e2045224d808c153c2e1d3df6f8f2f"; - try { - var result = signatureRequestApi.SignatureRequestRemind(signatureRequestId, data); - Console.WriteLine(result); + var response = new SignatureRequestApi(config).SignatureRequestRemind( + signatureRequestId: "fa5c8a0b0f492d768749333ad6fcc214c111e967", + signatureRequestRemindRequest: signatureRequestRemindRequest + ); + + Console.WriteLine(response); } catch (ApiException e) { - Console.WriteLine("Exception when calling Dropbox Sign API: " + e.Message); + Console.WriteLine("Exception when calling SignatureRequestApi#SignatureRequestRemind: " + e.Message); Console.WriteLine("Status Code: " + e.ErrorCode); Console.WriteLine(e.StackTrace); } @@ -1340,32 +2021,31 @@ Removes your access to a completed signature request. This action is **not rever ```csharp using System; using System.Collections.Generic; +using System.IO; +using System.Text.Json; + using Dropbox.Sign.Api; using Dropbox.Sign.Client; using Dropbox.Sign.Model; -public class Example +namespace Dropbox.SignSandbox; + +public class SignatureRequestRemoveExample { - public static void Main() + public static void Run() { var config = new Configuration(); - // Configure HTTP basic authorization: api_key config.Username = "YOUR_API_KEY"; - // or, configure Bearer (JWT) authorization: oauth2 - // config.AccessToken = "YOUR_BEARER_TOKEN"; - - var signatureRequestApi = new SignatureRequestApi(config); - - var signatureRequestId = "2f9781e1a8e2045224d808c153c2e1d3df6f8f2f"; - try { - signatureRequestApi.SignatureRequestRemove(signatureRequestId); + new SignatureRequestApi(config).SignatureRequestRemove( + signatureRequestId: "fa5c8a0b0f492d768749333ad6fcc214c111e967" + ); } catch (ApiException e) { - Console.WriteLine("Exception when calling Dropbox Sign API: " + e.Message); + Console.WriteLine("Exception when calling SignatureRequestApi#SignatureRequestRemove: " + e.Message); Console.WriteLine("Status Code: " + e.ErrorCode); Console.WriteLine(e.StackTrace); } @@ -1432,83 +2112,90 @@ Creates and sends a new SignatureRequest with the submitted documents. If `form_ using System; using System.Collections.Generic; using System.IO; +using System.Text.Json; + using Dropbox.Sign.Api; using Dropbox.Sign.Client; using Dropbox.Sign.Model; -public class Example +namespace Dropbox.SignSandbox; + +public class SignatureRequestSendExample { - public static void Main() + public static void Run() { var config = new Configuration(); - // Configure HTTP basic authorization: api_key config.Username = "YOUR_API_KEY"; + // config.AccessToken = "YOUR_ACCESS_TOKEN"; - // or, configure Bearer (JWT) authorization: oauth2 - // config.AccessToken = "YOUR_BEARER_TOKEN"; + var fieldOptions = new SubFieldOptions( + dateFormat: SubFieldOptions.DateFormatEnum.DD_MM_YYYY + ); - var signatureRequestApi = new SignatureRequestApi(config); + var signingOptions = new SubSigningOptions( + defaultType: SubSigningOptions.DefaultTypeEnum.Draw, + draw: true, + phone: false, + type: true, + upload: true + ); - var signer1 = new SubSignatureRequestSigner( - emailAddress: "jack@example.com", + var signers1 = new SubSignatureRequestSigner( name: "Jack", + emailAddress: "jack@example.com", order: 0 ); - var signer2 = new SubSignatureRequestSigner( - emailAddress: "jill@example.com", + var signers2 = new SubSignatureRequestSigner( name: "Jill", + emailAddress: "jill@example.com", order: 1 ); - var signingOptions = new SubSigningOptions( - draw: true, - type: true, - upload: true, - phone: true, - defaultType: SubSigningOptions.DefaultTypeEnum.Draw - ); - - var subFieldOptions = new SubFieldOptions( - dateFormat: SubFieldOptions.DateFormatEnum.DDMMYYYY - ); - - var metadata = new Dictionary() + var signers = new List { - ["custom_id"] = 1234, - ["custom_text"] = "NDA #9" + signers1, + signers2, }; - var files = new List { - new FileStream( - "./example_signature_request.pdf", - FileMode.Open, - FileAccess.Read, - FileShare.Read - ) - }; - - var data = new SignatureRequestSendRequest( - title: "NDA with Acme Co.", + var signatureRequestSendRequest = new SignatureRequestSendRequest( + message: "Please sign this NDA and then we can discuss more. Let me know if you\nhave any questions.", subject: "The NDA we talked about", - message: "Please sign this NDA and then we can discuss more. Let me know if you have any questions.", - signers: new List(){signer1, signer2}, - ccEmailAddresses: new List(){"lawyer1@dropboxsign.com", "lawyer2@dropboxsign.com"}, - files: files, - metadata: metadata, + testMode: true, + title: "NDA with Acme Co.", + ccEmailAddresses: [ + "lawyer1@dropboxsign.com", + "lawyer2@dropboxsign.com", + ], + files: new List + { + new FileStream( + path: "./example_signature_request.pdf", + mode: FileMode.Open + ), + }, + metadata: JsonSerializer.Deserialize>(""" + { + "custom_id": 1234, + "custom_text": "NDA #9" + } + """), + fieldOptions: fieldOptions, signingOptions: signingOptions, - fieldOptions: subFieldOptions, - testMode: true + signers: signers ); try { - var result = signatureRequestApi.SignatureRequestSend(data); - Console.WriteLine(result); + var response = new SignatureRequestApi(config).SignatureRequestSend( + signatureRequestSendRequest: signatureRequestSendRequest + ); + + Console.WriteLine(response); } catch (ApiException e) { - Console.WriteLine("Exception when calling Dropbox Sign API: " + e.Message); + Console.WriteLine("Exception when calling SignatureRequestApi#SignatureRequestSend: " + e.Message); Console.WriteLine("Status Code: " + e.ErrorCode); Console.WriteLine(e.StackTrace); } @@ -1577,68 +2264,88 @@ Creates and sends a new SignatureRequest based off of the Template(s) specified ```csharp using System; using System.Collections.Generic; +using System.IO; +using System.Text.Json; + using Dropbox.Sign.Api; using Dropbox.Sign.Client; using Dropbox.Sign.Model; -public class Example +namespace Dropbox.SignSandbox; + +public class SignatureRequestSendWithTemplateExample { - public static void Main() + public static void Run() { var config = new Configuration(); - // Configure HTTP basic authorization: api_key config.Username = "YOUR_API_KEY"; + // config.AccessToken = "YOUR_ACCESS_TOKEN"; - // or, configure Bearer (JWT) authorization: oauth2 - // config.AccessToken = "YOUR_BEARER_TOKEN"; - - var signatureRequestApi = new SignatureRequestApi(config); + var signingOptions = new SubSigningOptions( + defaultType: SubSigningOptions.DefaultTypeEnum.Draw, + draw: true, + phone: false, + type: true, + upload: true + ); - var signer1 = new SubSignatureRequestTemplateSigner( + var signers1 = new SubSignatureRequestTemplateSigner( role: "Client", - emailAddress: "george@example.com", - name: "George" + name: "George", + emailAddress: "george@example.com" ); - var cc1 = new SubCC( + var signers = new List + { + signers1, + }; + + var ccs1 = new SubCC( role: "Accounting", - emailAddress: "accouting@emaple.com" + emailAddress: "accounting@example.com" ); - var customField1 = new SubCustomField( + var ccs = new List + { + ccs1, + }; + + var customFields1 = new SubCustomField( name: "Cost", - value: "$20,000", editor: "Client", - required: true + required: true, + value: "$20,000" ); - var signingOptions = new SubSigningOptions( - draw: true, - type: true, - upload: true, - phone: false, - defaultType: SubSigningOptions.DefaultTypeEnum.Draw - ); + var customFields = new List + { + customFields1, + }; - var data = new SignatureRequestSendWithTemplateRequest( - templateIds: new List(){"c26b8a16784a872da37ea946b9ddec7c1e11dff6"}, - subject: "Purchase Order", + var signatureRequestSendWithTemplateRequest = new SignatureRequestSendWithTemplateRequest( + templateIds: [ + "61a832ff0d8423f91d503e76bfbcc750f7417c78", + ], message: "Glad we could come to an agreement.", - signers: new List(){signer1}, - ccs: new List(){cc1}, - customFields: new List(){customField1}, + subject: "Purchase Order", + testMode: true, signingOptions: signingOptions, - testMode: true + signers: signers, + ccs: ccs, + customFields: customFields ); try { - var result = signatureRequestApi.SignatureRequestSendWithTemplate(data); - Console.WriteLine(result); + var response = new SignatureRequestApi(config).SignatureRequestSendWithTemplate( + signatureRequestSendWithTemplateRequest: signatureRequestSendWithTemplateRequest + ); + + Console.WriteLine(response); } catch (ApiException e) { - Console.WriteLine("Exception when calling Dropbox Sign API: " + e.Message); + Console.WriteLine("Exception when calling SignatureRequestApi#SignatureRequestSendWithTemplate: " + e.Message); Console.WriteLine("Status Code: " + e.ErrorCode); Console.WriteLine(e.StackTrace); } @@ -1707,38 +2414,40 @@ Updates the email address and/or the name for a given signer on a signature requ ```csharp using System; using System.Collections.Generic; +using System.IO; +using System.Text.Json; + using Dropbox.Sign.Api; using Dropbox.Sign.Client; using Dropbox.Sign.Model; -public class Example +namespace Dropbox.SignSandbox; + +public class SignatureRequestUpdateExample { - public static void Main() + public static void Run() { var config = new Configuration(); - // Configure HTTP basic authorization: api_key config.Username = "YOUR_API_KEY"; + // config.AccessToken = "YOUR_ACCESS_TOKEN"; - // or, configure Bearer (JWT) authorization: oauth2 - // config.AccessToken = "YOUR_BEARER_TOKEN"; - - var signatureRequestApi = new SignatureRequestApi(config); - - var signatureRequestId = "2f9781e1a8e2045224d808c153c2e1d3df6f8f2f"; - - var data = new SignatureRequestUpdateRequest( - emailAddress: "john@example.com", - signatureId: "78caf2a1d01cd39cea2bc1cbb340dac3" + var signatureRequestUpdateRequest = new SignatureRequestUpdateRequest( + signatureId: "2f9781e1a8e2045224d808c153c2e1d3df6f8f2f", + emailAddress: "john@example.com" ); try { - var result = signatureRequestApi.SignatureRequestUpdate(signatureRequestId, data); - Console.WriteLine(result); + var response = new SignatureRequestApi(config).SignatureRequestUpdate( + signatureRequestId: "fa5c8a0b0f492d768749333ad6fcc214c111e967", + signatureRequestUpdateRequest: signatureRequestUpdateRequest + ); + + Console.WriteLine(response); } catch (ApiException e) { - Console.WriteLine("Exception when calling Dropbox Sign API: " + e.Message); + Console.WriteLine("Exception when calling SignatureRequestApi#SignatureRequestUpdate: " + e.Message); Console.WriteLine("Status Code: " + e.ErrorCode); Console.WriteLine(e.StackTrace); } diff --git a/docs/SignatureRequestEditEmbeddedRequest.md b/docs/SignatureRequestEditEmbeddedRequest.md new file mode 100644 index 0000000..3d7e417 --- /dev/null +++ b/docs/SignatureRequestEditEmbeddedRequest.md @@ -0,0 +1,10 @@ +# Dropbox.Sign.Model.SignatureRequestEditEmbeddedRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ClientId** | **string** | Client id of the app you're using to create this embedded signature request. Used for security purposes. | **Files** | **List<System.IO.Stream>** | Use `files[]` to indicate the uploaded file(s) to send for signature.

This endpoint requires either **files** or **file_urls[]**, but not both. | [optional] **FileUrls** | **List<string>** | Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature.

This endpoint requires either **files** or **file_urls[]**, but not both. | [optional] **Signers** | [**List<SubSignatureRequestSigner>**](SubSignatureRequestSigner.md) | Add Signers to your Signature Request.

This endpoint requires either **signers** or **grouped_signers**, but not both. | [optional] **GroupedSigners** | [**List<SubSignatureRequestGroupedSigners>**](SubSignatureRequestGroupedSigners.md) | Add Grouped Signers to your Signature Request.

This endpoint requires either **signers** or **grouped_signers**, but not both. | [optional] **AllowDecline** | **bool** | Allows signers to decline to sign a document if `true`. Defaults to `false`. | [optional] [default to false]**AllowReassign** | **bool** | Allows signers to reassign their signature requests to other signers if set to `true`. Defaults to `false`.

**NOTE:** Only available for Premium plan. | [optional] [default to false]**Attachments** | [**List<SubAttachment>**](SubAttachment.md) | A list describing the attachments | [optional] **CcEmailAddresses** | **List<string>** | The email addresses that should be CCed. | [optional] **CustomFields** | [**List<SubCustomField>**](SubCustomField.md) | When used together with merge fields, `custom_fields` allows users to add pre-filled data to their signature requests.

Pre-filled data can be used with "send-once" signature requests by adding merge fields with `form_fields_per_document` or [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) while passing values back with `custom_fields` together in one API call.

For using pre-filled on repeatable signature requests, merge fields are added to templates in the Dropbox Sign UI or by calling [/template/create_embedded_draft](/api/reference/operation/templateCreateEmbeddedDraft) and then passing `custom_fields` on subsequent signature requests referencing that template. | [optional] **FieldOptions** | [**SubFieldOptions**](SubFieldOptions.md) | | [optional] **FormFieldGroups** | [**List<SubFormFieldGroup>**](SubFormFieldGroup.md) | Group information for fields defined in `form_fields_per_document`. String-indexed JSON array with `group_label` and `requirement` keys. `form_fields_per_document` must contain fields referencing a group defined in `form_field_groups`. | [optional] **FormFieldRules** | [**List<SubFormFieldRule>**](SubFormFieldRule.md) | Conditional Logic rules for fields defined in `form_fields_per_document`. | [optional] **FormFieldsPerDocument** | [**List<SubFormFieldsPerDocumentBase>**](SubFormFieldsPerDocumentBase.md) | The fields that should appear on the document, expressed as an array of objects. (For more details you can read about it here: [Using Form Fields per Document](/docs/openapi/form-fields-per-document).)

**NOTE:** Fields like **text**, **dropdown**, **checkbox**, **radio**, and **hyperlink** have additional required and optional parameters. Check out the list of [additional parameters](/api/reference/constants/#form-fields-per-document) for these field types.

* Text Field use `SubFormFieldsPerDocumentText`
* Dropdown Field use `SubFormFieldsPerDocumentDropdown`
* Hyperlink Field use `SubFormFieldsPerDocumentHyperlink`
* Checkbox Field use `SubFormFieldsPerDocumentCheckbox`
* Radio Field use `SubFormFieldsPerDocumentRadio`
* Signature Field use `SubFormFieldsPerDocumentSignature`
* Date Signed Field use `SubFormFieldsPerDocumentDateSigned`
* Initials Field use `SubFormFieldsPerDocumentInitials`
* Text Merge Field use `SubFormFieldsPerDocumentTextMerge`
* Checkbox Merge Field use `SubFormFieldsPerDocumentCheckboxMerge` | [optional] **HideTextTags** | **bool** | Enables automatic Text Tag removal when set to true.

**NOTE:** Removing text tags this way can cause unwanted clipping. We recommend leaving this setting on `false` and instead hiding your text tags using white text or a similar approach. See the [Text Tags Walkthrough](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) for more information. | [optional] [default to false]**Message** | **string** | The custom message in the email that will be sent to the signers. | [optional] **Metadata** | **Dictionary<string, Object>** | Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request.

Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. | [optional] **SigningOptions** | [**SubSigningOptions**](SubSigningOptions.md) | | [optional] **Subject** | **string** | The subject in the email that will be sent to the signers. | [optional] **TestMode** | **bool** | Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`. | [optional] [default to false]**Title** | **string** | The title you want to assign to the SignatureRequest. | [optional] **UseTextTags** | **bool** | Send with a value of `true` if you wish to enable [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) parsing in your document. Defaults to disabled, or `false`. | [optional] [default to false]**PopulateAutoFillFields** | **bool** | Controls whether [auto fill fields](https://faq.hellosign.com/hc/en-us/articles/360051467511-Auto-Fill-Fields) can automatically populate a signer's information during signing.

**NOTE:** Keep your signer's information safe by ensuring that the _signer on your signature request is the intended party_ before using this feature. | [optional] [default to false]**ExpiresAt** | **int?** | When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/SignatureRequestEditEmbeddedWithTemplateRequest.md b/docs/SignatureRequestEditEmbeddedWithTemplateRequest.md new file mode 100644 index 0000000..8be8d1b --- /dev/null +++ b/docs/SignatureRequestEditEmbeddedWithTemplateRequest.md @@ -0,0 +1,10 @@ +# Dropbox.Sign.Model.SignatureRequestEditEmbeddedWithTemplateRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**TemplateIds** | **List<string>** | Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the template will be used. | **ClientId** | **string** | Client id of the app you're using to create this embedded signature request. Used for security purposes. | **Signers** | [**List<SubSignatureRequestTemplateSigner>**](SubSignatureRequestTemplateSigner.md) | Add Signers to your Templated-based Signature Request. | **AllowDecline** | **bool** | Allows signers to decline to sign a document if `true`. Defaults to `false`. | [optional] [default to false]**Ccs** | [**List<SubCC>**](SubCC.md) | Add CC email recipients. Required when a CC role exists for the Template. | [optional] **CustomFields** | [**List<SubCustomField>**](SubCustomField.md) | An array defining values and options for custom fields. Required when a custom field exists in the Template. | [optional] **Files** | **List<System.IO.Stream>** | Use `files[]` to indicate the uploaded file(s) to send for signature.

This endpoint requires either **files** or **file_urls[]**, but not both. | [optional] **FileUrls** | **List<string>** | Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature.

This endpoint requires either **files** or **file_urls[]**, but not both. | [optional] **Message** | **string** | The custom message in the email that will be sent to the signers. | [optional] **Metadata** | **Dictionary<string, Object>** | Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request.

Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. | [optional] **SigningOptions** | [**SubSigningOptions**](SubSigningOptions.md) | | [optional] **Subject** | **string** | The subject in the email that will be sent to the signers. | [optional] **TestMode** | **bool** | Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`. | [optional] [default to false]**Title** | **string** | The title you want to assign to the SignatureRequest. | [optional] **PopulateAutoFillFields** | **bool** | Controls whether [auto fill fields](https://faq.hellosign.com/hc/en-us/articles/360051467511-Auto-Fill-Fields) can automatically populate a signer's information during signing.

**NOTE:** Keep your signer's information safe by ensuring that the _signer on your signature request is the intended party_ before using this feature. | [optional] [default to false] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/SignatureRequestEditRequest.md b/docs/SignatureRequestEditRequest.md new file mode 100644 index 0000000..20f2164 --- /dev/null +++ b/docs/SignatureRequestEditRequest.md @@ -0,0 +1,10 @@ +# Dropbox.Sign.Model.SignatureRequestEditRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Files** | **List<System.IO.Stream>** | Use `files[]` to indicate the uploaded file(s) to send for signature.

This endpoint requires either **files** or **file_urls[]**, but not both. | [optional] **FileUrls** | **List<string>** | Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature.

This endpoint requires either **files** or **file_urls[]**, but not both. | [optional] **Signers** | [**List<SubSignatureRequestSigner>**](SubSignatureRequestSigner.md) | Add Signers to your Signature Request.

This endpoint requires either **signers** or **grouped_signers**, but not both. | [optional] **GroupedSigners** | [**List<SubSignatureRequestGroupedSigners>**](SubSignatureRequestGroupedSigners.md) | Add Grouped Signers to your Signature Request.

This endpoint requires either **signers** or **grouped_signers**, but not both. | [optional] **AllowDecline** | **bool** | Allows signers to decline to sign a document if `true`. Defaults to `false`. | [optional] [default to false]**AllowReassign** | **bool** | Allows signers to reassign their signature requests to other signers if set to `true`. Defaults to `false`.

**NOTE:** Only available for Premium plan and higher. | [optional] [default to false]**Attachments** | [**List<SubAttachment>**](SubAttachment.md) | A list describing the attachments | [optional] **CcEmailAddresses** | **List<string>** | The email addresses that should be CCed. | [optional] **ClientId** | **string** | The client id of the API App you want to associate with this request. Used to apply the branding and callback url defined for the app. | [optional] **CustomFields** | [**List<SubCustomField>**](SubCustomField.md) | When used together with merge fields, `custom_fields` allows users to add pre-filled data to their signature requests.

Pre-filled data can be used with "send-once" signature requests by adding merge fields with `form_fields_per_document` or [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) while passing values back with `custom_fields` together in one API call.

For using pre-filled on repeatable signature requests, merge fields are added to templates in the Dropbox Sign UI or by calling [/template/create_embedded_draft](/api/reference/operation/templateCreateEmbeddedDraft) and then passing `custom_fields` on subsequent signature requests referencing that template. | [optional] **FieldOptions** | [**SubFieldOptions**](SubFieldOptions.md) | | [optional] **FormFieldGroups** | [**List<SubFormFieldGroup>**](SubFormFieldGroup.md) | Group information for fields defined in `form_fields_per_document`. String-indexed JSON array with `group_label` and `requirement` keys. `form_fields_per_document` must contain fields referencing a group defined in `form_field_groups`. | [optional] **FormFieldRules** | [**List<SubFormFieldRule>**](SubFormFieldRule.md) | Conditional Logic rules for fields defined in `form_fields_per_document`. | [optional] **FormFieldsPerDocument** | [**List<SubFormFieldsPerDocumentBase>**](SubFormFieldsPerDocumentBase.md) | The fields that should appear on the document, expressed as an array of objects. (For more details you can read about it here: [Using Form Fields per Document](/docs/openapi/form-fields-per-document).)

**NOTE:** Fields like **text**, **dropdown**, **checkbox**, **radio**, and **hyperlink** have additional required and optional parameters. Check out the list of [additional parameters](/api/reference/constants/#form-fields-per-document) for these field types.

* Text Field use `SubFormFieldsPerDocumentText`
* Dropdown Field use `SubFormFieldsPerDocumentDropdown`
* Hyperlink Field use `SubFormFieldsPerDocumentHyperlink`
* Checkbox Field use `SubFormFieldsPerDocumentCheckbox`
* Radio Field use `SubFormFieldsPerDocumentRadio`
* Signature Field use `SubFormFieldsPerDocumentSignature`
* Date Signed Field use `SubFormFieldsPerDocumentDateSigned`
* Initials Field use `SubFormFieldsPerDocumentInitials`
* Text Merge Field use `SubFormFieldsPerDocumentTextMerge`
* Checkbox Merge Field use `SubFormFieldsPerDocumentCheckboxMerge` | [optional] **HideTextTags** | **bool** | Enables automatic Text Tag removal when set to true.

**NOTE:** Removing text tags this way can cause unwanted clipping. We recommend leaving this setting on `false` and instead hiding your text tags using white text or a similar approach. See the [Text Tags Walkthrough](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) for more information. | [optional] [default to false]**IsEid** | **bool** | Send with a value of `true` if you wish to enable [electronic identification (eID)](https://www.hellosign.com/features/electronic-id), which requires the signer to verify their identity with an eID provider to sign a document.<br>
**NOTE:** eID is only available on the Premium API plan. Cannot be used in `test_mode`. Only works on requests with one signer. | [optional] [default to false]**Message** | **string** | The custom message in the email that will be sent to the signers. | [optional] **Metadata** | **Dictionary<string, Object>** | Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request.

Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. | [optional] **SigningOptions** | [**SubSigningOptions**](SubSigningOptions.md) | | [optional] **SigningRedirectUrl** | **string** | The URL you want signers redirected to after they successfully sign. | [optional] **Subject** | **string** | The subject in the email that will be sent to the signers. | [optional] **TestMode** | **bool** | Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`. | [optional] [default to false]**Title** | **string** | The title you want to assign to the SignatureRequest. | [optional] **UseTextTags** | **bool** | Send with a value of `true` if you wish to enable [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) parsing in your document. Defaults to disabled, or `false`. | [optional] [default to false]**ExpiresAt** | **int?** | When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/SignatureRequestEditWithTemplateRequest.md b/docs/SignatureRequestEditWithTemplateRequest.md new file mode 100644 index 0000000..d9ac882 --- /dev/null +++ b/docs/SignatureRequestEditWithTemplateRequest.md @@ -0,0 +1,10 @@ +# Dropbox.Sign.Model.SignatureRequestEditWithTemplateRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**TemplateIds** | **List<string>** | Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the template will be used. | **Signers** | [**List<SubSignatureRequestTemplateSigner>**](SubSignatureRequestTemplateSigner.md) | Add Signers to your Templated-based Signature Request. | **AllowDecline** | **bool** | Allows signers to decline to sign a document if `true`. Defaults to `false`. | [optional] [default to false]**Ccs** | [**List<SubCC>**](SubCC.md) | Add CC email recipients. Required when a CC role exists for the Template. | [optional] **ClientId** | **string** | Client id of the app to associate with the signature request. Used to apply the branding and callback url defined for the app. | [optional] **CustomFields** | [**List<SubCustomField>**](SubCustomField.md) | An array defining values and options for custom fields. Required when a custom field exists in the Template. | [optional] **Files** | **List<System.IO.Stream>** | Use `files[]` to indicate the uploaded file(s) to send for signature.

This endpoint requires either **files** or **file_urls[]**, but not both. | [optional] **FileUrls** | **List<string>** | Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature.

This endpoint requires either **files** or **file_urls[]**, but not both. | [optional] **IsEid** | **bool** | Send with a value of `true` if you wish to enable [electronic identification (eID)](https://www.hellosign.com/features/electronic-id), which requires the signer to verify their identity with an eID provider to sign a document.<br>
**NOTE:** eID is only available on the Premium API plan. Cannot be used in `test_mode`. Only works on requests with one signer. | [optional] [default to false]**Message** | **string** | The custom message in the email that will be sent to the signers. | [optional] **Metadata** | **Dictionary<string, Object>** | Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request.

Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. | [optional] **SigningOptions** | [**SubSigningOptions**](SubSigningOptions.md) | | [optional] **SigningRedirectUrl** | **string** | The URL you want signers redirected to after they successfully sign. | [optional] **Subject** | **string** | The subject in the email that will be sent to the signers. | [optional] **TestMode** | **bool** | Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`. | [optional] [default to false]**Title** | **string** | The title you want to assign to the SignatureRequest. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/TeamApi.md b/docs/TeamApi.md index 64d8dd5..2e5e878 100644 --- a/docs/TeamApi.md +++ b/docs/TeamApi.md @@ -27,35 +27,39 @@ Invites a user (specified using the `email_address` parameter) to your Team. If ```csharp using System; using System.Collections.Generic; +using System.IO; +using System.Text.Json; + using Dropbox.Sign.Api; using Dropbox.Sign.Client; using Dropbox.Sign.Model; -public class Example +namespace Dropbox.SignSandbox; + +public class TeamAddMemberExample { - public static void Main() + public static void Run() { var config = new Configuration(); - // Configure HTTP basic authorization: api_key config.Username = "YOUR_API_KEY"; + // config.AccessToken = "YOUR_ACCESS_TOKEN"; - // or, configure Bearer (JWT) authorization: oauth2 - // config.AccessToken = "YOUR_BEARER_TOKEN"; - - var teamApi = new TeamApi(config); - - var data = new TeamAddMemberRequest( + var teamAddMemberRequest = new TeamAddMemberRequest( emailAddress: "george@example.com" ); try { - var result = teamApi.TeamAddMember(data); - Console.WriteLine(result); + var response = new TeamApi(config).TeamAddMember( + teamAddMemberRequest: teamAddMemberRequest, + teamId: "4fea99bfcf2b26bfccf6cea3e127fb8bb74d8d9c" + ); + + Console.WriteLine(response); } catch (ApiException e) { - Console.WriteLine("Exception when calling Dropbox Sign API: " + e.Message); + Console.WriteLine("Exception when calling TeamApi#TeamAddMember: " + e.Message); Console.WriteLine("Status Code: " + e.ErrorCode); Console.WriteLine(e.StackTrace); } @@ -125,35 +129,38 @@ Creates a new Team and makes you a member. You must not currently belong to a Te ```csharp using System; using System.Collections.Generic; +using System.IO; +using System.Text.Json; + using Dropbox.Sign.Api; using Dropbox.Sign.Client; using Dropbox.Sign.Model; -public class Example +namespace Dropbox.SignSandbox; + +public class TeamCreateExample { - public static void Main() + public static void Run() { var config = new Configuration(); - // Configure HTTP basic authorization: api_key config.Username = "YOUR_API_KEY"; + // config.AccessToken = "YOUR_ACCESS_TOKEN"; - // or, configure Bearer (JWT) authorization: oauth2 - // config.AccessToken = "YOUR_BEARER_TOKEN"; - - var teamApi = new TeamApi(config); - - var data = new TeamCreateRequest( + var teamCreateRequest = new TeamCreateRequest( name: "New Team Name" ); try { - var result = teamApi.TeamCreate(data); - Console.WriteLine(result); + var response = new TeamApi(config).TeamCreate( + teamCreateRequest: teamCreateRequest + ); + + Console.WriteLine(response); } catch (ApiException e) { - Console.WriteLine("Exception when calling Dropbox Sign API: " + e.Message); + Console.WriteLine("Exception when calling TeamApi#TeamCreate: " + e.Message); Console.WriteLine("Status Code: " + e.ErrorCode); Console.WriteLine(e.StackTrace); } @@ -222,30 +229,30 @@ Deletes your Team. Can only be invoked when you have a Team with only one member ```csharp using System; using System.Collections.Generic; +using System.IO; +using System.Text.Json; + using Dropbox.Sign.Api; using Dropbox.Sign.Client; using Dropbox.Sign.Model; -public class Example +namespace Dropbox.SignSandbox; + +public class TeamDeleteExample { - public static void Main() + public static void Run() { var config = new Configuration(); - // Configure HTTP basic authorization: api_key config.Username = "YOUR_API_KEY"; - - // or, configure Bearer (JWT) authorization: oauth2 - // config.AccessToken = "YOUR_BEARER_TOKEN"; - - var teamApi = new TeamApi(config); + // config.AccessToken = "YOUR_ACCESS_TOKEN"; try { - teamApi.TeamDelete(); + new TeamApi(config).TeamDelete(); } catch (ApiException e) { - Console.WriteLine("Exception when calling Dropbox Sign API: " + e.Message); + Console.WriteLine("Exception when calling TeamApi#TeamDelete: " + e.Message); Console.WriteLine("Status Code: " + e.ErrorCode); Console.WriteLine(e.StackTrace); } @@ -307,31 +314,32 @@ Returns information about your Team as well as a list of its members. If you do ```csharp using System; using System.Collections.Generic; +using System.IO; +using System.Text.Json; + using Dropbox.Sign.Api; using Dropbox.Sign.Client; using Dropbox.Sign.Model; -public class Example +namespace Dropbox.SignSandbox; + +public class TeamGetExample { - public static void Main() + public static void Run() { var config = new Configuration(); - // Configure HTTP basic authorization: api_key config.Username = "YOUR_API_KEY"; - - // or, configure Bearer (JWT) authorization: oauth2 - // config.AccessToken = "YOUR_BEARER_TOKEN"; - - var teamApi = new TeamApi(config); + // config.AccessToken = "YOUR_ACCESS_TOKEN"; try { - var result = teamApi.TeamGet(); - Console.WriteLine(result); + var response = new TeamApi(config).TeamGet(); + + Console.WriteLine(response); } catch (ApiException e) { - Console.WriteLine("Exception when calling Dropbox Sign API: " + e.Message); + Console.WriteLine("Exception when calling TeamApi#TeamGet: " + e.Message); Console.WriteLine("Status Code: " + e.ErrorCode); Console.WriteLine(e.StackTrace); } @@ -396,31 +404,34 @@ Provides information about a team. ```csharp using System; using System.Collections.Generic; +using System.IO; +using System.Text.Json; + using Dropbox.Sign.Api; using Dropbox.Sign.Client; using Dropbox.Sign.Model; -public class Example +namespace Dropbox.SignSandbox; + +public class TeamInfoExample { - public static void Main() + public static void Run() { var config = new Configuration(); - // Configure HTTP basic authorization: api_key config.Username = "YOUR_API_KEY"; - - // or, configure Bearer (JWT) authorization: oauth2 - // config.AccessToken = "YOUR_BEARER_TOKEN"; - - var teamApi = new TeamApi(config); + // config.AccessToken = "YOUR_ACCESS_TOKEN"; try { - var result = teamApi.TeamInfo(); - Console.WriteLine(result); + var response = new TeamApi(config).TeamInfo( + teamId: "4fea99bfcf2b26bfccf6cea3e127fb8bb74d8d9c" + ); + + Console.WriteLine(response); } catch (ApiException e) { - Console.WriteLine("Exception when calling Dropbox Sign API: " + e.Message); + Console.WriteLine("Exception when calling TeamApi#TeamInfo: " + e.Message); Console.WriteLine("Status Code: " + e.ErrorCode); Console.WriteLine(e.StackTrace); } @@ -489,32 +500,32 @@ Provides a list of team invites (and their roles). ```csharp using System; using System.Collections.Generic; +using System.IO; +using System.Text.Json; + using Dropbox.Sign.Api; using Dropbox.Sign.Client; using Dropbox.Sign.Model; -public class Example +namespace Dropbox.SignSandbox; + +public class TeamInvitesExample { - public static void Main() + public static void Run() { var config = new Configuration(); - // Configure HTTP basic authorization: api_key config.Username = "YOUR_API_KEY"; - - // or, configure Bearer (JWT) authorization: oauth2 - // config.AccessToken = "YOUR_BEARER_TOKEN"; - - var teamApi = new TeamApi(config); - var emailAddress = "user@dropboxsign.com"; + // config.AccessToken = "YOUR_ACCESS_TOKEN"; try { - var result = teamApi.TeamInvites(emailAddress); - Console.WriteLine(result); + var response = new TeamApi(config).TeamInvites(); + + Console.WriteLine(response); } catch (ApiException e) { - Console.WriteLine("Exception when calling Dropbox Sign API: " + e.Message); + Console.WriteLine("Exception when calling TeamApi#TeamInvites: " + e.Message); Console.WriteLine("Status Code: " + e.ErrorCode); Console.WriteLine(e.StackTrace); } @@ -583,32 +594,36 @@ Provides a paginated list of members (and their roles) that belong to a given te ```csharp using System; using System.Collections.Generic; +using System.IO; +using System.Text.Json; + using Dropbox.Sign.Api; using Dropbox.Sign.Client; using Dropbox.Sign.Model; -public class Example +namespace Dropbox.SignSandbox; + +public class TeamMembersExample { - public static void Main() + public static void Run() { var config = new Configuration(); - // Configure HTTP basic authorization: api_key config.Username = "YOUR_API_KEY"; - - // or, configure Bearer (JWT) authorization: oauth2 - // config.AccessToken = "YOUR_BEARER_TOKEN"; - - var teamApi = new TeamApi(config); - var teamId = "4fea99bfcf2b26bfccf6cea3e127fb8bb74d8d9c"; + // config.AccessToken = "YOUR_ACCESS_TOKEN"; try { - var result = teamApi.TeamMembers(teamId); - Console.WriteLine(result); + var response = new TeamApi(config).TeamMembers( + teamId: "4fea99bfcf2b26bfccf6cea3e127fb8bb74d8d9c", + page: 1, + pageSize: 20 + ); + + Console.WriteLine(response); } catch (ApiException e) { - Console.WriteLine("Exception when calling Dropbox Sign API: " + e.Message); + Console.WriteLine("Exception when calling TeamApi#TeamMembers: " + e.Message); Console.WriteLine("Status Code: " + e.ErrorCode); Console.WriteLine(e.StackTrace); } @@ -679,36 +694,39 @@ Removes the provided user Account from your Team. If the Account had an outstand ```csharp using System; using System.Collections.Generic; +using System.IO; +using System.Text.Json; + using Dropbox.Sign.Api; using Dropbox.Sign.Client; using Dropbox.Sign.Model; -public class Example +namespace Dropbox.SignSandbox; + +public class TeamRemoveMemberExample { - public static void Main() + public static void Run() { var config = new Configuration(); - // Configure HTTP basic authorization: api_key config.Username = "YOUR_API_KEY"; + // config.AccessToken = "YOUR_ACCESS_TOKEN"; - // or, configure Bearer (JWT) authorization: oauth2 - // config.AccessToken = "YOUR_BEARER_TOKEN"; - - var teamApi = new TeamApi(config); - - var data = new TeamRemoveMemberRequest( + var teamRemoveMemberRequest = new TeamRemoveMemberRequest( emailAddress: "teammate@dropboxsign.com", newOwnerEmailAddress: "new_teammate@dropboxsign.com" ); try { - var result = teamApi.TeamRemoveMember(data); - Console.WriteLine(result); + var response = new TeamApi(config).TeamRemoveMember( + teamRemoveMemberRequest: teamRemoveMemberRequest + ); + + Console.WriteLine(response); } catch (ApiException e) { - Console.WriteLine("Exception when calling Dropbox Sign API: " + e.Message); + Console.WriteLine("Exception when calling TeamApi#TeamRemoveMember: " + e.Message); Console.WriteLine("Status Code: " + e.ErrorCode); Console.WriteLine(e.StackTrace); } @@ -777,32 +795,36 @@ Provides a paginated list of sub teams that belong to a given team. ```csharp using System; using System.Collections.Generic; +using System.IO; +using System.Text.Json; + using Dropbox.Sign.Api; using Dropbox.Sign.Client; using Dropbox.Sign.Model; -public class Example +namespace Dropbox.SignSandbox; + +public class TeamSubTeamsExample { - public static void Main() + public static void Run() { var config = new Configuration(); - // Configure HTTP basic authorization: api_key config.Username = "YOUR_API_KEY"; - - // or, configure Bearer (JWT) authorization: oauth2 - // config.AccessToken = "YOUR_BEARER_TOKEN"; - - var teamApi = new TeamApi(config); - var teamId = "4fea99bfcf2b26bfccf6cea3e127fb8bb74d8d9c"; + // config.AccessToken = "YOUR_ACCESS_TOKEN"; try { - var result = teamApi.TeamSubTeams(teamId); - Console.WriteLine(result); + var response = new TeamApi(config).TeamSubTeams( + teamId: "4fea99bfcf2b26bfccf6cea3e127fb8bb74d8d9c", + page: 1, + pageSize: 20 + ); + + Console.WriteLine(response); } catch (ApiException e) { - Console.WriteLine("Exception when calling Dropbox Sign API: " + e.Message); + Console.WriteLine("Exception when calling TeamApi#TeamSubTeams: " + e.Message); Console.WriteLine("Status Code: " + e.ErrorCode); Console.WriteLine(e.StackTrace); } @@ -873,35 +895,38 @@ Updates the name of your Team. ```csharp using System; using System.Collections.Generic; +using System.IO; +using System.Text.Json; + using Dropbox.Sign.Api; using Dropbox.Sign.Client; using Dropbox.Sign.Model; -public class Example +namespace Dropbox.SignSandbox; + +public class TeamUpdateExample { - public static void Main() + public static void Run() { var config = new Configuration(); - // Configure HTTP basic authorization: api_key config.Username = "YOUR_API_KEY"; + // config.AccessToken = "YOUR_ACCESS_TOKEN"; - // or, configure Bearer (JWT) authorization: oauth2 - // config.AccessToken = "YOUR_BEARER_TOKEN"; - - var teamApi = new TeamApi(config); - - var data = new TeamUpdateRequest( + var teamUpdateRequest = new TeamUpdateRequest( name: "New Team Name" ); try { - var result = teamApi.TeamUpdate(data); - Console.WriteLine(result); + var response = new TeamApi(config).TeamUpdate( + teamUpdateRequest: teamUpdateRequest + ); + + Console.WriteLine(response); } catch (ApiException e) { - Console.WriteLine("Exception when calling Dropbox Sign API: " + e.Message); + Console.WriteLine("Exception when calling TeamApi#TeamUpdate: " + e.Message); Console.WriteLine("Status Code: " + e.ErrorCode); Console.WriteLine(e.StackTrace); } diff --git a/docs/TemplateApi.md b/docs/TemplateApi.md index c51decd..f9c66e1 100644 --- a/docs/TemplateApi.md +++ b/docs/TemplateApi.md @@ -28,37 +28,39 @@ Gives the specified Account access to the specified Template. The specified Acco ```csharp using System; using System.Collections.Generic; +using System.IO; +using System.Text.Json; + using Dropbox.Sign.Api; using Dropbox.Sign.Client; using Dropbox.Sign.Model; -public class Example +namespace Dropbox.SignSandbox; + +public class TemplateAddUserExample { - public static void Main() + public static void Run() { var config = new Configuration(); - // Configure HTTP basic authorization: api_key config.Username = "YOUR_API_KEY"; + // config.AccessToken = "YOUR_ACCESS_TOKEN"; - // or, configure Bearer (JWT) authorization: oauth2 - // config.AccessToken = "YOUR_BEARER_TOKEN"; - - var templateApi = new TemplateApi(config); - - var templateId = "f57db65d3f933b5316d398057a36176831451a35"; - - var data = new TemplateAddUserRequest( + var templateAddUserRequest = new TemplateAddUserRequest( emailAddress: "george@dropboxsign.com" ); try { - var result = templateApi.TemplateAddUser(templateId, data); - Console.WriteLine(result); + var response = new TemplateApi(config).TemplateAddUser( + templateId: "f57db65d3f933b5316d398057a36176831451a35", + templateAddUserRequest: templateAddUserRequest + ); + + Console.WriteLine(response); } catch (ApiException e) { - Console.WriteLine("Exception when calling Dropbox Sign API: " + e.Message); + Console.WriteLine("Exception when calling TemplateApi#TemplateAddUser: " + e.Message); Console.WriteLine("Status Code: " + e.ErrorCode); Console.WriteLine(e.StackTrace); } @@ -129,77 +131,127 @@ Creates a template that can then be used. using System; using System.Collections.Generic; using System.IO; +using System.Text.Json; + using Dropbox.Sign.Api; using Dropbox.Sign.Client; using Dropbox.Sign.Model; -public class Example +namespace Dropbox.SignSandbox; + +public class TemplateCreateExample { - public static void Main() + public static void Run() { var config = new Configuration(); - // Configure HTTP basic authorization: api_key config.Username = "YOUR_API_KEY"; + // config.AccessToken = "YOUR_ACCESS_TOKEN"; - // or, configure Bearer (JWT) authorization: oauth2 - // config.AccessToken = "YOUR_BEARER_TOKEN"; - - var templateApi = new TemplateApi(config); + var fieldOptions = new SubFieldOptions( + dateFormat: SubFieldOptions.DateFormatEnum.DD_MM_YYYY + ); - var role1 = new SubTemplateRole( + var signerRoles1 = new SubTemplateRole( name: "Client", order: 0 ); - var role2 = new SubTemplateRole( + var signerRoles2 = new SubTemplateRole( name: "Witness", order: 1 ); - var mergeField1 = new SubMergeField( + var signerRoles = new List + { + signerRoles1, + signerRoles2, + }; + + var formFieldsPerDocument1 = new SubFormFieldsPerDocumentText( + documentIndex: 0, + apiId: "uniqueIdHere_1", + type: "text", + required: true, + signer: "1", + width: 100, + height: 16, + x: 112, + y: 328, + name: "", + page: 1, + placeholder: "", + validationType: SubFormFieldsPerDocumentText.ValidationTypeEnum.NumbersOnly + ); + + var formFieldsPerDocument2 = new SubFormFieldsPerDocumentSignature( + documentIndex: 0, + apiId: "uniqueIdHere_2", + type: "signature", + required: true, + signer: "0", + width: 120, + height: 30, + x: 530, + y: 415, + name: "", + page: 1 + ); + + var formFieldsPerDocument = new List + { + formFieldsPerDocument1, + formFieldsPerDocument2, + }; + + var mergeFields1 = new SubMergeField( name: "Full Name", type: SubMergeField.TypeEnum.Text ); - var mergeField2 = new SubMergeField( + var mergeFields2 = new SubMergeField( name: "Is Registered?", type: SubMergeField.TypeEnum.Checkbox ); - var subFieldOptions = new SubFieldOptions( - dateFormat: SubFieldOptions.DateFormatEnum.DDMMYYYY - ); - - var files = new List { - new FileStream( - "./example_signature_request.pdf", - FileMode.Open, - FileAccess.Read, - FileShare.Read - ) + var mergeFields = new List + { + mergeFields1, + mergeFields2, }; - var data = new TemplateCreateRequest( + var templateCreateRequest = new TemplateCreateRequest( clientId: "37dee8d8440c66d54cfa05d92c160882", - files: files, - title: "Test Template", - subject: "Please sign this document", message: "For your approval", - signerRoles: new List(){role1, role2}, - ccRoles: new List(){"Manager"}, - mergeFields: new List(){mergeField1, mergeField2}, - fieldOptions: subFieldOptions, - testMode: true + subject: "Please sign this document", + testMode: true, + title: "Test Template", + ccRoles: [ + "Manager", + ], + files: new List + { + new FileStream( + path: "./example_signature_request.pdf", + mode: FileMode.Open + ), + }, + fieldOptions: fieldOptions, + signerRoles: signerRoles, + formFieldsPerDocument: formFieldsPerDocument, + mergeFields: mergeFields ); try { - var result = templateApi.TemplateCreate(data); - Console.WriteLine(result); + var response = new TemplateApi(config).TemplateCreate( + templateCreateRequest: templateCreateRequest + ); + + Console.WriteLine(response); } catch (ApiException e) { - Console.WriteLine("Exception when calling Dropbox Sign API: " + e.Message); + Console.WriteLine("Exception when calling TemplateApi#TemplateCreate: " + e.Message); Console.WriteLine("Status Code: " + e.ErrorCode); Console.WriteLine(e.StackTrace); } @@ -269,77 +321,90 @@ The first step in an embedded template workflow. Creates a draft template that c using System; using System.Collections.Generic; using System.IO; +using System.Text.Json; + using Dropbox.Sign.Api; using Dropbox.Sign.Client; using Dropbox.Sign.Model; -public class Example +namespace Dropbox.SignSandbox; + +public class TemplateCreateEmbeddedDraftExample { - public static void Main() + public static void Run() { var config = new Configuration(); - // Configure HTTP basic authorization: api_key config.Username = "YOUR_API_KEY"; + // config.AccessToken = "YOUR_ACCESS_TOKEN"; - // or, configure Bearer (JWT) authorization: oauth2 - // config.AccessToken = "YOUR_BEARER_TOKEN"; - - var templateApi = new TemplateApi(config); - - var role1 = new SubTemplateRole( - name: "Client", - order: 0 - ); - - var role2 = new SubTemplateRole( - name: "Witness", - order: 1 + var fieldOptions = new SubFieldOptions( + dateFormat: SubFieldOptions.DateFormatEnum.DD_MM_YYYY ); - var mergeField1 = new SubMergeField( + var mergeFields1 = new SubMergeField( name: "Full Name", type: SubMergeField.TypeEnum.Text ); - var mergeField2 = new SubMergeField( + var mergeFields2 = new SubMergeField( name: "Is Registered?", type: SubMergeField.TypeEnum.Checkbox ); - var subFieldOptions = new SubFieldOptions( - dateFormat: SubFieldOptions.DateFormatEnum.DDMMYYYY + var mergeFields = new List + { + mergeFields1, + mergeFields2, + }; + + var signerRoles1 = new SubTemplateRole( + name: "Client", + order: 0 + ); + + var signerRoles2 = new SubTemplateRole( + name: "Witness", + order: 1 ); - var files = new List { - new FileStream( - "./example_signature_request.pdf", - FileMode.Open, - FileAccess.Read, - FileShare.Read - ) + var signerRoles = new List + { + signerRoles1, + signerRoles2, }; - var data = new TemplateCreateEmbeddedDraftRequest( + var templateCreateEmbeddedDraftRequest = new TemplateCreateEmbeddedDraftRequest( clientId: "37dee8d8440c66d54cfa05d92c160882", - files: files, - title: "Test Template", - subject: "Please sign this document", message: "For your approval", - signerRoles: new List(){role1, role2}, - ccRoles: new List(){"Manager"}, - mergeFields: new List(){mergeField1, mergeField2}, - fieldOptions: subFieldOptions, - testMode: true + subject: "Please sign this document", + testMode: true, + title: "Test Template", + ccRoles: [ + "Manager", + ], + files: new List + { + new FileStream( + path: "./example_signature_request.pdf", + mode: FileMode.Open + ), + }, + fieldOptions: fieldOptions, + mergeFields: mergeFields, + signerRoles: signerRoles ); try { - var result = templateApi.TemplateCreateEmbeddedDraft(data); - Console.WriteLine(result); + var response = new TemplateApi(config).TemplateCreateEmbeddedDraft( + templateCreateEmbeddedDraftRequest: templateCreateEmbeddedDraftRequest + ); + + Console.WriteLine(response); } catch (ApiException e) { - Console.WriteLine("Exception when calling Dropbox Sign API: " + e.Message); + Console.WriteLine("Exception when calling TemplateApi#TemplateCreateEmbeddedDraft: " + e.Message); Console.WriteLine("Status Code: " + e.ErrorCode); Console.WriteLine(e.StackTrace); } @@ -408,32 +473,32 @@ Completely deletes the template specified from the account. ```csharp using System; using System.Collections.Generic; +using System.IO; +using System.Text.Json; + using Dropbox.Sign.Api; using Dropbox.Sign.Client; using Dropbox.Sign.Model; -public class Example +namespace Dropbox.SignSandbox; + +public class TemplateDeleteExample { - public static void Main() + public static void Run() { var config = new Configuration(); - // Configure HTTP basic authorization: api_key config.Username = "YOUR_API_KEY"; - - // or, configure Bearer (JWT) authorization: oauth2 - // config.AccessToken = "YOUR_BEARER_TOKEN"; - - var templateApi = new TemplateApi(config); - - var templateId = "f57db65d3f933b5316d398057a36176831451a35"; + // config.AccessToken = "YOUR_ACCESS_TOKEN"; try { - templateApi.TemplateDelete(templateId); + new TemplateApi(config).TemplateDelete( + templateId: "f57db65d3f933b5316d398057a36176831451a35" + ); } catch (ApiException e) { - Console.WriteLine("Exception when calling Dropbox Sign API: " + e.Message); + Console.WriteLine("Exception when calling TemplateApi#TemplateDelete: " + e.Message); Console.WriteLine("Status Code: " + e.ErrorCode); Console.WriteLine(e.StackTrace); } @@ -499,37 +564,36 @@ Obtain a copy of the current documents specified by the `template_id` parameter. ```csharp using System; using System.Collections.Generic; +using System.IO; +using System.Text.Json; + using Dropbox.Sign.Api; using Dropbox.Sign.Client; using Dropbox.Sign.Model; -public class Example +namespace Dropbox.SignSandbox; + +public class TemplateFilesExample { - public static void Main() + public static void Run() { var config = new Configuration(); - // Configure HTTP basic authorization: api_key config.Username = "YOUR_API_KEY"; - - // or, configure Bearer (JWT) authorization: oauth2 - // config.AccessToken = "YOUR_BEARER_TOKEN"; - - var templateApi = new TemplateApi(config); - - var templateId = "f57db65d3f933b5316d398057a36176831451a35"; + // config.AccessToken = "YOUR_ACCESS_TOKEN"; try { - var result = templateApi.TemplateFiles(templateId, "pdf"); - - var fileStream = File.Create("file_response.pdf"); - result.Seek(0, SeekOrigin.Begin); - result.CopyTo(fileStream); + var response = new TemplateApi(config).TemplateFiles( + templateId: "f57db65d3f933b5316d398057a36176831451a35" + ); + var fileStream = File.Create("./file_response"); + response.Seek(0, SeekOrigin.Begin); + response.CopyTo(fileStream); fileStream.Close(); } catch (ApiException e) { - Console.WriteLine("Exception when calling Dropbox Sign API: " + e.Message); + Console.WriteLine("Exception when calling TemplateApi#TemplateFiles: " + e.Message); Console.WriteLine("Status Code: " + e.ErrorCode); Console.WriteLine(e.StackTrace); } @@ -599,33 +663,34 @@ Obtain a copy of the current documents specified by the `template_id` parameter. ```csharp using System; using System.Collections.Generic; +using System.IO; +using System.Text.Json; + using Dropbox.Sign.Api; using Dropbox.Sign.Client; using Dropbox.Sign.Model; -public class Example +namespace Dropbox.SignSandbox; + +public class TemplateFilesAsDataUriExample { - public static void Main() + public static void Run() { var config = new Configuration(); - // Configure HTTP basic authorization: api_key config.Username = "YOUR_API_KEY"; - - // or, configure Bearer (JWT) authorization: oauth2 - // config.AccessToken = "YOUR_BEARER_TOKEN"; - - var templateApi = new TemplateApi(config); - - var templateId = "f57db65d3f933b5316d398057a36176831451a35"; + // config.AccessToken = "YOUR_ACCESS_TOKEN"; try { - var result = templateApi.TemplateFilesAsDataUri(templateId, "pdf", false, false); - Console.WriteLine(result); + var response = new TemplateApi(config).TemplateFilesAsDataUri( + templateId: "f57db65d3f933b5316d398057a36176831451a35" + ); + + Console.WriteLine(response); } catch (ApiException e) { - Console.WriteLine("Exception when calling Dropbox Sign API: " + e.Message); + Console.WriteLine("Exception when calling TemplateApi#TemplateFilesAsDataUri: " + e.Message); Console.WriteLine("Status Code: " + e.ErrorCode); Console.WriteLine(e.StackTrace); } @@ -694,33 +759,35 @@ Obtain a copy of the current documents specified by the `template_id` parameter. ```csharp using System; using System.Collections.Generic; +using System.IO; +using System.Text.Json; + using Dropbox.Sign.Api; using Dropbox.Sign.Client; using Dropbox.Sign.Model; -public class Example +namespace Dropbox.SignSandbox; + +public class TemplateFilesAsFileUrlExample { - public static void Main() + public static void Run() { var config = new Configuration(); - // Configure HTTP basic authorization: api_key config.Username = "YOUR_API_KEY"; - - // or, configure Bearer (JWT) authorization: oauth2 - // config.AccessToken = "YOUR_BEARER_TOKEN"; - - var templateApi = new TemplateApi(config); - - var templateId = "f57db65d3f933b5316d398057a36176831451a35"; + // config.AccessToken = "YOUR_ACCESS_TOKEN"; try { - var result = templateApi.TemplateFilesAsFileUrl(templateId, "pdf", false, false); - Console.WriteLine(result); + var response = new TemplateApi(config).TemplateFilesAsFileUrl( + templateId: "f57db65d3f933b5316d398057a36176831451a35", + forceDownload: 1 + ); + + Console.WriteLine(response); } catch (ApiException e) { - Console.WriteLine("Exception when calling Dropbox Sign API: " + e.Message); + Console.WriteLine("Exception when calling TemplateApi#TemplateFilesAsFileUrl: " + e.Message); Console.WriteLine("Status Code: " + e.ErrorCode); Console.WriteLine(e.StackTrace); } @@ -790,33 +857,34 @@ Returns the Template specified by the `template_id` parameter. ```csharp using System; using System.Collections.Generic; +using System.IO; +using System.Text.Json; + using Dropbox.Sign.Api; using Dropbox.Sign.Client; using Dropbox.Sign.Model; -public class Example +namespace Dropbox.SignSandbox; + +public class TemplateGetExample { - public static void Main() + public static void Run() { var config = new Configuration(); - // Configure HTTP basic authorization: api_key config.Username = "YOUR_API_KEY"; - - // or, configure Bearer (JWT) authorization: oauth2 - // config.AccessToken = "YOUR_BEARER_TOKEN"; - - var templateApi = new TemplateApi(config); - - var templateId = "f57db65d3f933b5316d398057a36176831451a35"; + // config.AccessToken = "YOUR_ACCESS_TOKEN"; try { - var result = templateApi.TemplateGet(templateId); - Console.WriteLine(result); + var response = new TemplateApi(config).TemplateGet( + templateId: "f57db65d3f933b5316d398057a36176831451a35" + ); + + Console.WriteLine(response); } catch (ApiException e) { - Console.WriteLine("Exception when calling Dropbox Sign API: " + e.Message); + Console.WriteLine("Exception when calling TemplateApi#TemplateGet: " + e.Message); Console.WriteLine("Status Code: " + e.ErrorCode); Console.WriteLine(e.StackTrace); } @@ -885,33 +953,35 @@ Returns a list of the Templates that are accessible by you. Take a look at our ```csharp using System; using System.Collections.Generic; +using System.IO; +using System.Text.Json; + using Dropbox.Sign.Api; using Dropbox.Sign.Client; using Dropbox.Sign.Model; -public class Example +namespace Dropbox.SignSandbox; + +public class TemplateListExample { - public static void Main() + public static void Run() { var config = new Configuration(); - // Configure HTTP basic authorization: api_key config.Username = "YOUR_API_KEY"; - - // or, configure Bearer (JWT) authorization: oauth2 - // config.AccessToken = "YOUR_BEARER_TOKEN"; - - var templateApi = new TemplateApi(config); - - var accountId = "f57db65d3f933b5316d398057a36176831451a35"; + // config.AccessToken = "YOUR_ACCESS_TOKEN"; try { - var result = templateApi.TemplateList(accountId, 1, 20, null); - Console.WriteLine(result); + var response = new TemplateApi(config).TemplateList( + page: 1, + pageSize: 20 + ); + + Console.WriteLine(response); } catch (ApiException e) { - Console.WriteLine("Exception when calling Dropbox Sign API: " + e.Message); + Console.WriteLine("Exception when calling TemplateApi#TemplateList: " + e.Message); Console.WriteLine("Status Code: " + e.ErrorCode); Console.WriteLine(e.StackTrace); } @@ -983,37 +1053,39 @@ Removes the specified Account's access to the specified Template. ```csharp using System; using System.Collections.Generic; +using System.IO; +using System.Text.Json; + using Dropbox.Sign.Api; using Dropbox.Sign.Client; using Dropbox.Sign.Model; -public class Example +namespace Dropbox.SignSandbox; + +public class TemplateRemoveUserExample { - public static void Main() + public static void Run() { var config = new Configuration(); - // Configure HTTP basic authorization: api_key config.Username = "YOUR_API_KEY"; + // config.AccessToken = "YOUR_ACCESS_TOKEN"; - // or, configure Bearer (JWT) authorization: oauth2 - // config.AccessToken = "YOUR_BEARER_TOKEN"; - - var templateApi = new TemplateApi(config); - - var data = new TemplateRemoveUserRequest( + var templateRemoveUserRequest = new TemplateRemoveUserRequest( emailAddress: "george@dropboxsign.com" ); - var templateId = "21f920ec2b7f4b6bb64d3ed79f26303843046536"; - try { - var result = templateApi.TemplateRemoveUser(templateId, data); - Console.WriteLine(result); + var response = new TemplateApi(config).TemplateRemoveUser( + templateId: "f57db65d3f933b5316d398057a36176831451a35", + templateRemoveUserRequest: templateRemoveUserRequest + ); + + Console.WriteLine(response); } catch (ApiException e) { - Console.WriteLine("Exception when calling Dropbox Sign API: " + e.Message); + Console.WriteLine("Exception when calling TemplateApi#TemplateRemoveUser: " + e.Message); Console.WriteLine("Status Code: " + e.ErrorCode); Console.WriteLine(e.StackTrace); } @@ -1084,46 +1156,44 @@ Overlays a new file with the overlay of an existing template. The new file(s) mu using System; using System.Collections.Generic; using System.IO; +using System.Text.Json; + using Dropbox.Sign.Api; using Dropbox.Sign.Client; using Dropbox.Sign.Model; -public class Example +namespace Dropbox.SignSandbox; + +public class TemplateUpdateFilesExample { - public static void Main() + public static void Run() { var config = new Configuration(); - // Configure HTTP basic authorization: api_key config.Username = "YOUR_API_KEY"; - - // or, configure Bearer (JWT) authorization: oauth2 - // config.AccessToken = "YOUR_BEARER_TOKEN"; - - var templateApi = new TemplateApi(config); - - var files = new List { - new FileStream( - "./example_signature_request.pdf", - FileMode.Open, - FileAccess.Read, - FileShare.Read - ) - }; - - var data = new TemplateUpdateFilesRequest( - files: files + // config.AccessToken = "YOUR_ACCESS_TOKEN"; + + var templateUpdateFilesRequest = new TemplateUpdateFilesRequest( + files: new List + { + new FileStream( + path: "./example_signature_request.pdf", + mode: FileMode.Open + ), + } ); - var templateId = "21f920ec2b7f4b6bb64d3ed79f26303843046536"; - try { - var result = templateApi.TemplateUpdateFiles(templateId, data); - Console.WriteLine(result); + var response = new TemplateApi(config).TemplateUpdateFiles( + templateId: "f57db65d3f933b5316d398057a36176831451a35", + templateUpdateFilesRequest: templateUpdateFilesRequest + ); + + Console.WriteLine(response); } catch (ApiException e) { - Console.WriteLine("Exception when calling Dropbox Sign API: " + e.Message); + Console.WriteLine("Exception when calling TemplateApi#TemplateUpdateFiles: " + e.Message); Console.WriteLine("Status Code: " + e.ErrorCode); Console.WriteLine(e.StackTrace); } diff --git a/docs/UnclaimedDraftApi.md b/docs/UnclaimedDraftApi.md index 7d5a0e1..3bd6eda 100644 --- a/docs/UnclaimedDraftApi.md +++ b/docs/UnclaimedDraftApi.md @@ -22,83 +22,57 @@ Creates a new Draft that can be claimed using the claim URL. The first authentic using System; using System.Collections.Generic; using System.IO; +using System.Text.Json; + using Dropbox.Sign.Api; using Dropbox.Sign.Client; using Dropbox.Sign.Model; -public class Example +namespace Dropbox.SignSandbox; + +public class UnclaimedDraftCreateExample { - public static void Main() + public static void Run() { var config = new Configuration(); - // Configure HTTP basic authorization: api_key config.Username = "YOUR_API_KEY"; + // config.AccessToken = "YOUR_ACCESS_TOKEN"; - // or, configure Bearer (JWT) authorization: oauth2 - // config.AccessToken = "YOUR_BEARER_TOKEN"; - - var unclaimedDraftApi = new UnclaimedDraftApi(config); - - var signer1 = new SubUnclaimedDraftSigner( - emailAddress: "jack@example.com", + var signers1 = new SubUnclaimedDraftSigner( name: "Jack", + emailAddress: "jack@example.com", order: 0 ); - var signer2 = new SubUnclaimedDraftSigner( - emailAddress: "jill@example.com", - name: "Jill", - order: 1 - ); - - var subSigningOptions = new SubSigningOptions( - draw: true, - type: true, - upload: true, - phone: false, - defaultType: SubSigningOptions.DefaultTypeEnum.Draw - ); - - var subFieldOptions = new SubFieldOptions( - dateFormat: SubFieldOptions.DateFormatEnum.DD_MM_YYYY - ); - - var metadata = new Dictionary() + var signers = new List { - ["custom_id"] = 1234, - ["custom_text"] = "NDA #9" - }; - - var files = new List { - new FileStream( - "./example_signature_request.pdf", - FileMode.Open, - FileAccess.Read, - FileShare.Read - ) + signers1, }; - var data = new UnclaimedDraftCreateRequest( - subject: "The NDA we talked about", + var unclaimedDraftCreateRequest = new UnclaimedDraftCreateRequest( type: UnclaimedDraftCreateRequest.TypeEnum.RequestSignature, - message: "Please sign this NDA and then we can discuss more. Let me know if you have any questions.", - signers: new List(){signer1, signer2}, - ccEmailAddresses: new List(){"lawyer1@dropboxsign.com", "lawyer2@dropboxsign.com"}, - files: files, - metadata: metadata, - signingOptions: subSigningOptions, - fieldOptions: subFieldOptions, - testMode: true + testMode: true, + files: new List + { + new FileStream( + path: "./example_signature_request.pdf", + mode: FileMode.Open + ), + }, + signers: signers ); try { - var result = unclaimedDraftApi.UnclaimedDraftCreate(data); - Console.WriteLine(result); + var response = new UnclaimedDraftApi(config).UnclaimedDraftCreate( + unclaimedDraftCreateRequest: unclaimedDraftCreateRequest + ); + + Console.WriteLine(response); } catch (ApiException e) { - Console.WriteLine("Exception when calling Dropbox Sign API: " + e.Message); + Console.WriteLine("Exception when calling UnclaimedDraftApi#UnclaimedDraftCreate: " + e.Message); Console.WriteLine("Status Code: " + e.ErrorCode); Console.WriteLine(e.StackTrace); } @@ -168,47 +142,46 @@ Creates a new Draft that can be claimed and used in an embedded iFrame. The firs using System; using System.Collections.Generic; using System.IO; +using System.Text.Json; + using Dropbox.Sign.Api; using Dropbox.Sign.Client; using Dropbox.Sign.Model; -public class Example +namespace Dropbox.SignSandbox; + +public class UnclaimedDraftCreateEmbeddedExample { - public static void Main() + public static void Run() { var config = new Configuration(); - // Configure HTTP basic authorization: api_key config.Username = "YOUR_API_KEY"; + // config.AccessToken = "YOUR_ACCESS_TOKEN"; - // or, configure Bearer (JWT) authorization: oauth2 - // config.AccessToken = "YOUR_BEARER_TOKEN"; - - var unclaimedDraftApi = new UnclaimedDraftApi(config); - - var files = new List { - new FileStream( - "./example_signature_request.pdf", - FileMode.Open, - FileAccess.Read, - FileShare.Read - ) - }; - - var data = new UnclaimedDraftCreateEmbeddedRequest( - clientId: "ec64a202072370a737edf4a0eb7f4437", - files: files, + var unclaimedDraftCreateEmbeddedRequest = new UnclaimedDraftCreateEmbeddedRequest( + clientId: "b6b8e7deaf8f0b95c029dca049356d4a2cf9710a", requesterEmailAddress: "jack@dropboxsign.com", - testMode: true + testMode: true, + files: new List + { + new FileStream( + path: "./example_signature_request.pdf", + mode: FileMode.Open + ), + } ); try { - var result = unclaimedDraftApi.UnclaimedDraftCreateEmbedded(data); - Console.WriteLine(result); + var response = new UnclaimedDraftApi(config).UnclaimedDraftCreateEmbedded( + unclaimedDraftCreateEmbeddedRequest: unclaimedDraftCreateEmbeddedRequest + ); + + Console.WriteLine(response); } catch (ApiException e) { - Console.WriteLine("Exception when calling Dropbox Sign API: " + e.Message); + Console.WriteLine("Exception when calling UnclaimedDraftApi#UnclaimedDraftCreateEmbedded: " + e.Message); Console.WriteLine("Status Code: " + e.ErrorCode); Console.WriteLine(e.StackTrace); } @@ -277,51 +250,66 @@ Creates a new Draft with a previously saved template(s) that can be claimed and ```csharp using System; using System.Collections.Generic; +using System.IO; +using System.Text.Json; + using Dropbox.Sign.Api; using Dropbox.Sign.Client; using Dropbox.Sign.Model; -public class Example +namespace Dropbox.SignSandbox; + +public class UnclaimedDraftCreateEmbeddedWithTemplateExample { - public static void Main() + public static void Run() { var config = new Configuration(); - // Configure HTTP basic authorization: api_key config.Username = "YOUR_API_KEY"; + // config.AccessToken = "YOUR_ACCESS_TOKEN"; - // or, configure Bearer (JWT) authorization: oauth2 - // config.AccessToken = "YOUR_BEARER_TOKEN"; + var ccs1 = new SubCC( + role: "Accounting", + emailAddress: "accounting@dropboxsign.com" + ); - var unclaimedDraftApi = new UnclaimedDraftApi(config); + var ccs = new List + { + ccs1, + }; - var signer = new SubUnclaimedDraftTemplateSigner( + var signers1 = new SubUnclaimedDraftTemplateSigner( role: "Client", name: "George", emailAddress: "george@example.com" ); - var cc1 = new SubCC( - role: "Accounting", - emailAddress: "accouting@email.com" - ); + var signers = new List + { + signers1, + }; - var data = new UnclaimedDraftCreateEmbeddedWithTemplateRequest( - clientId: "1a659d9ad95bccd307ecad78d72192f8", - templateIds: new List(){"c26b8a16784a872da37ea946b9ddec7c1e11dff6"}, + var unclaimedDraftCreateEmbeddedWithTemplateRequest = new UnclaimedDraftCreateEmbeddedWithTemplateRequest( + clientId: "b6b8e7deaf8f0b95c029dca049356d4a2cf9710a", requesterEmailAddress: "jack@dropboxsign.com", - signers: new List(){signer}, - ccs: new List(){cc1}, - testMode: true + templateIds: [ + "61a832ff0d8423f91d503e76bfbcc750f7417c78", + ], + testMode: false, + ccs: ccs, + signers: signers ); try { - var result = unclaimedDraftApi.UnclaimedDraftCreateEmbeddedWithTemplate(data); - Console.WriteLine(result); + var response = new UnclaimedDraftApi(config).UnclaimedDraftCreateEmbeddedWithTemplate( + unclaimedDraftCreateEmbeddedWithTemplateRequest: unclaimedDraftCreateEmbeddedWithTemplateRequest + ); + + Console.WriteLine(response); } catch (ApiException e) { - Console.WriteLine("Exception when calling Dropbox Sign API: " + e.Message); + Console.WriteLine("Exception when calling UnclaimedDraftApi#UnclaimedDraftCreateEmbeddedWithTemplate: " + e.Message); Console.WriteLine("Status Code: " + e.ErrorCode); Console.WriteLine(e.StackTrace); } @@ -390,38 +378,40 @@ Creates a new signature request from an embedded request that can be edited prio ```csharp using System; using System.Collections.Generic; +using System.IO; +using System.Text.Json; + using Dropbox.Sign.Api; using Dropbox.Sign.Client; using Dropbox.Sign.Model; -public class Example +namespace Dropbox.SignSandbox; + +public class UnclaimedDraftEditAndResendExample { - public static void Main() + public static void Run() { var config = new Configuration(); - // Configure HTTP basic authorization: api_key config.Username = "YOUR_API_KEY"; + // config.AccessToken = "YOUR_ACCESS_TOKEN"; - // or, configure Bearer (JWT) authorization: oauth2 - // config.AccessToken = "YOUR_BEARER_TOKEN"; - - var unclaimedDraftApi = new UnclaimedDraftApi(config); - - var data = new UnclaimedDraftEditAndResendRequest( - clientId: "1a659d9ad95bccd307ecad78d72192f8", - testMode: true + var unclaimedDraftEditAndResendRequest = new UnclaimedDraftEditAndResendRequest( + clientId: "b6b8e7deaf8f0b95c029dca049356d4a2cf9710a", + testMode: false ); - var signatureRequestId = "2f9781e1a83jdja934d808c153c2e1d3df6f8f2f"; - try { - var result = unclaimedDraftApi.UnclaimedDraftEditAndResend(signatureRequestId, data); - Console.WriteLine(result); + var response = new UnclaimedDraftApi(config).UnclaimedDraftEditAndResend( + signatureRequestId: "fa5c8a0b0f492d768749333ad6fcc214c111e967", + unclaimedDraftEditAndResendRequest: unclaimedDraftEditAndResendRequest + ); + + Console.WriteLine(response); } catch (ApiException e) { - Console.WriteLine("Exception when calling Dropbox Sign API: " + e.Message); + Console.WriteLine("Exception when calling UnclaimedDraftApi#UnclaimedDraftEditAndResend: " + e.Message); Console.WriteLine("Status Code: " + e.ErrorCode); Console.WriteLine(e.StackTrace); } diff --git a/examples/AccountCreate.cs b/examples/AccountCreate.cs deleted file mode 100644 index 360f775..0000000 --- a/examples/AccountCreate.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System; - -using Dropbox.Sign.Api; -using Dropbox.Sign.Client; -using Dropbox.Sign.Model; - -public class Example -{ - public static void Main() - { - var config = new Configuration(); - // Configure HTTP basic authorization: api_key - config.Username = "YOUR_API_KEY"; - - // or, configure Bearer (JWT) authorization: oauth2 - // config.AccessToken = "YOUR_BEARER_TOKEN"; - - var accountApi = new AccountApi(config); - - var data = new AccountCreateRequest( - emailAddress: "newuser@dropboxsign.com" - ); - - try - { - var result = accountApi.AccountCreate(data); - Console.WriteLine(result); - } - catch (ApiException e) - { - Console.WriteLine("Exception when calling Dropbox Sign API: " + e.Message); - Console.WriteLine("Status Code: " + e.ErrorCode); - Console.WriteLine(e.StackTrace); - } - } -} diff --git a/examples/AccountCreateExample.cs b/examples/AccountCreateExample.cs new file mode 100644 index 0000000..373d6a2 --- /dev/null +++ b/examples/AccountCreateExample.cs @@ -0,0 +1,39 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Text.Json; + +using Dropbox.Sign.Api; +using Dropbox.Sign.Client; +using Dropbox.Sign.Model; + +namespace Dropbox.SignSandbox; + +public class AccountCreateExample +{ + public static void Run() + { + var config = new Configuration(); + config.Username = "YOUR_API_KEY"; + // config.AccessToken = "YOUR_ACCESS_TOKEN"; + + var accountCreateRequest = new AccountCreateRequest( + emailAddress: "newuser@dropboxsign.com" + ); + + try + { + var response = new AccountApi(config).AccountCreate( + accountCreateRequest: accountCreateRequest + ); + + Console.WriteLine(response); + } + catch (ApiException e) + { + Console.WriteLine("Exception when calling AccountApi#AccountCreate: " + e.Message); + Console.WriteLine("Status Code: " + e.ErrorCode); + Console.WriteLine(e.StackTrace); + } + } +} diff --git a/examples/AccountCreateOauthExample.cs b/examples/AccountCreateOauthExample.cs new file mode 100644 index 0000000..1976cb1 --- /dev/null +++ b/examples/AccountCreateOauthExample.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Text.Json; + +using Dropbox.Sign.Api; +using Dropbox.Sign.Client; +using Dropbox.Sign.Model; + +namespace Dropbox.SignSandbox; + +public class AccountCreateOauthExample +{ + public static void Run() + { + var config = new Configuration(); + config.Username = "YOUR_API_KEY"; + // config.AccessToken = "YOUR_ACCESS_TOKEN"; + + var accountCreateRequest = new AccountCreateRequest( + emailAddress: "newuser@dropboxsign.com", + clientId: "cc91c61d00f8bb2ece1428035716b", + clientSecret: "1d14434088507ffa390e6f5528465" + ); + + try + { + var response = new AccountApi(config).AccountCreate( + accountCreateRequest: accountCreateRequest + ); + + Console.WriteLine(response); + } + catch (ApiException e) + { + Console.WriteLine("Exception when calling AccountApi#AccountCreate: " + e.Message); + Console.WriteLine("Status Code: " + e.ErrorCode); + Console.WriteLine(e.StackTrace); + } + } +} diff --git a/examples/AccountGet.cs b/examples/AccountGet.cs deleted file mode 100644 index e6e35af..0000000 --- a/examples/AccountGet.cs +++ /dev/null @@ -1,32 +0,0 @@ -using System; - -using Dropbox.Sign.Api; -using Dropbox.Sign.Client; -using Dropbox.Sign.Model; - -public class Example -{ - public static void Main() - { - var config = new Configuration(); - // Configure HTTP basic authorization: api_key - config.Username = "YOUR_API_KEY"; - - // or, configure Bearer (JWT) authorization: oauth2 - // config.AccessToken = "YOUR_BEARER_TOKEN"; - - var accountApi = new AccountApi(config); - - try - { - var result = accountApi.AccountGet(null, "jack@example.com"); - Console.WriteLine(result); - } - catch (ApiException e) - { - Console.WriteLine("Exception when calling Dropbox Sign API: " + e.Message); - Console.WriteLine("Status Code: " + e.ErrorCode); - Console.WriteLine(e.StackTrace); - } - } -} diff --git a/examples/AccountGetExample.cs b/examples/AccountGetExample.cs new file mode 100644 index 0000000..83d9471 --- /dev/null +++ b/examples/AccountGetExample.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Text.Json; + +using Dropbox.Sign.Api; +using Dropbox.Sign.Client; +using Dropbox.Sign.Model; + +namespace Dropbox.SignSandbox; + +public class AccountGetExample +{ + public static void Run() + { + var config = new Configuration(); + config.Username = "YOUR_API_KEY"; + // config.AccessToken = "YOUR_ACCESS_TOKEN"; + + try + { + var response = new AccountApi(config).AccountGet(); + + Console.WriteLine(response); + } + catch (ApiException e) + { + Console.WriteLine("Exception when calling AccountApi#AccountGet: " + e.Message); + Console.WriteLine("Status Code: " + e.ErrorCode); + Console.WriteLine(e.StackTrace); + } + } +} diff --git a/examples/AccountUpdate.cs b/examples/AccountUpdate.cs deleted file mode 100644 index 2261b47..0000000 --- a/examples/AccountUpdate.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System; - -using Dropbox.Sign.Api; -using Dropbox.Sign.Client; -using Dropbox.Sign.Model; - -public class Example -{ - public static void Main() - { - var config = new Configuration(); - // Configure HTTP basic authorization: api_key - config.Username = "YOUR_API_KEY"; - - // or, configure Bearer (JWT) authorization: oauth2 - // config.AccessToken = "YOUR_BEARER_TOKEN"; - - var accountApi = new AccountApi(config); - - var data = new AccountUpdateRequest( - callbackUrl: "https://www.example.com/callback" - ); - - try - { - var result = accountApi.AccountUpdate(data); - Console.WriteLine(result); - } - catch (ApiException e) - { - Console.WriteLine("Exception when calling Dropbox Sign API: " + e.Message); - Console.WriteLine("Status Code: " + e.ErrorCode); - Console.WriteLine(e.StackTrace); - } - } -} diff --git a/examples/AccountUpdateExample.cs b/examples/AccountUpdateExample.cs new file mode 100644 index 0000000..f62bb11 --- /dev/null +++ b/examples/AccountUpdateExample.cs @@ -0,0 +1,40 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Text.Json; + +using Dropbox.Sign.Api; +using Dropbox.Sign.Client; +using Dropbox.Sign.Model; + +namespace Dropbox.SignSandbox; + +public class AccountUpdateExample +{ + public static void Run() + { + var config = new Configuration(); + config.Username = "YOUR_API_KEY"; + // config.AccessToken = "YOUR_ACCESS_TOKEN"; + + var accountUpdateRequest = new AccountUpdateRequest( + callbackUrl: "https://www.example.com/callback", + locale: "en-US" + ); + + try + { + var response = new AccountApi(config).AccountUpdate( + accountUpdateRequest: accountUpdateRequest + ); + + Console.WriteLine(response); + } + catch (ApiException e) + { + Console.WriteLine("Exception when calling AccountApi#AccountUpdate: " + e.Message); + Console.WriteLine("Status Code: " + e.ErrorCode); + Console.WriteLine(e.StackTrace); + } + } +} diff --git a/examples/AccountVerify.cs b/examples/AccountVerify.cs deleted file mode 100644 index 36aacd0..0000000 --- a/examples/AccountVerify.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System; - -using Dropbox.Sign.Api; -using Dropbox.Sign.Client; -using Dropbox.Sign.Model; - -public class Example -{ - public static void Main() - { - var config = new Configuration(); - // Configure HTTP basic authorization: api_key - config.Username = "YOUR_API_KEY"; - - // or, configure Bearer (JWT) authorization: oauth2 - // config.AccessToken = "YOUR_BEARER_TOKEN"; - - var accountApi = new AccountApi(config); - - var data = new AccountVerifyRequest( - emailAddress: "some_user@dropboxsign.com" - ); - - try - { - var result = accountApi.AccountVerify(data); - Console.WriteLine(result); - } - catch (ApiException e) - { - Console.WriteLine("Exception when calling Dropbox Sign API: " + e.Message); - Console.WriteLine("Status Code: " + e.ErrorCode); - Console.WriteLine(e.StackTrace); - } - } -} diff --git a/examples/AccountVerifyExample.cs b/examples/AccountVerifyExample.cs new file mode 100644 index 0000000..cba5133 --- /dev/null +++ b/examples/AccountVerifyExample.cs @@ -0,0 +1,39 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Text.Json; + +using Dropbox.Sign.Api; +using Dropbox.Sign.Client; +using Dropbox.Sign.Model; + +namespace Dropbox.SignSandbox; + +public class AccountVerifyExample +{ + public static void Run() + { + var config = new Configuration(); + config.Username = "YOUR_API_KEY"; + // config.AccessToken = "YOUR_ACCESS_TOKEN"; + + var accountVerifyRequest = new AccountVerifyRequest( + emailAddress: "some_user@dropboxsign.com" + ); + + try + { + var response = new AccountApi(config).AccountVerify( + accountVerifyRequest: accountVerifyRequest + ); + + Console.WriteLine(response); + } + catch (ApiException e) + { + Console.WriteLine("Exception when calling AccountApi#AccountVerify: " + e.Message); + Console.WriteLine("Status Code: " + e.ErrorCode); + Console.WriteLine(e.StackTrace); + } + } +} diff --git a/examples/ApiAppCreate.cs b/examples/ApiAppCreate.cs deleted file mode 100644 index bc78c64..0000000 --- a/examples/ApiAppCreate.cs +++ /dev/null @@ -1,59 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using Dropbox.Sign.Api; -using Dropbox.Sign.Client; -using Dropbox.Sign.Model; - -public class Example -{ - public static void Main() - { - var config = new Configuration(); - // Configure HTTP basic authorization: api_key - config.Username = "YOUR_API_KEY"; - - // or, configure Bearer (JWT) authorization: oauth2 - // config.AccessToken = "YOUR_BEARER_TOKEN"; - - var apiAppApi = new ApiAppApi(config); - - var oauth = new SubOAuth( - callbackUrl: "https://example.com/oauth", - scopes: new List() { - SubOAuth.ScopesEnum.BasicAccountInfo, - SubOAuth.ScopesEnum.RequestSignature - } - ); - - var whiteLabelingOptions = new SubWhiteLabelingOptions( - primaryButtonColor: "#00b3e6", - primaryButtonTextColor: "#ffffff" - ); - - var customLogoFile = new FileStream( - "CustomLogoFile.png", - FileMode.Open - ); - - var data = new ApiAppCreateRequest( - name: "My Production App", - domains: new List(){"example.com"}, - oauth: oauth, - whiteLabelingOptions: whiteLabelingOptions, - customLogoFile: customLogoFile - ); - - try - { - var result = apiAppApi.ApiAppCreate(data); - Console.WriteLine(result); - } - catch (ApiException e) - { - Console.WriteLine("Exception when calling Dropbox Sign API: " + e.Message); - Console.WriteLine("Status Code: " + e.ErrorCode); - Console.WriteLine(e.StackTrace); - } - } -} diff --git a/examples/ApiAppCreateExample.cs b/examples/ApiAppCreateExample.cs new file mode 100644 index 0000000..277e401 --- /dev/null +++ b/examples/ApiAppCreateExample.cs @@ -0,0 +1,61 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Text.Json; + +using Dropbox.Sign.Api; +using Dropbox.Sign.Client; +using Dropbox.Sign.Model; + +namespace Dropbox.SignSandbox; + +public class ApiAppCreateExample +{ + public static void Run() + { + var config = new Configuration(); + config.Username = "YOUR_API_KEY"; + // config.AccessToken = "YOUR_ACCESS_TOKEN"; + + var oauth = new SubOAuth( + callbackUrl: "https://example.com/oauth", + scopes: [ + SubOAuth.ScopesEnum.BasicAccountInfo, + SubOAuth.ScopesEnum.RequestSignature, + ] + ); + + var whiteLabelingOptions = new SubWhiteLabelingOptions( + primaryButtonColor: "#00b3e6", + primaryButtonTextColor: "#ffffff" + ); + + var apiAppCreateRequest = new ApiAppCreateRequest( + name: "My Production App", + domains: [ + "example.com", + ], + customLogoFile: new FileStream( + path: "CustomLogoFile.png", + mode: FileMode.Open + ), + oauth: oauth, + whiteLabelingOptions: whiteLabelingOptions + ); + + try + { + var response = new ApiAppApi(config).ApiAppCreate( + apiAppCreateRequest: apiAppCreateRequest + ); + + Console.WriteLine(response); + } + catch (ApiException e) + { + Console.WriteLine("Exception when calling ApiAppApi#ApiAppCreate: " + e.Message); + Console.WriteLine("Status Code: " + e.ErrorCode); + Console.WriteLine(e.StackTrace); + } + } +} diff --git a/examples/ApiAppDelete.cs b/examples/ApiAppDelete.cs deleted file mode 100644 index 540adfe..0000000 --- a/examples/ApiAppDelete.cs +++ /dev/null @@ -1,34 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using Dropbox.Sign.Api; -using Dropbox.Sign.Client; -using Dropbox.Sign.Model; - -public class Example -{ - public static void Main() - { - var config = new Configuration(); - // Configure HTTP basic authorization: api_key - config.Username = "YOUR_API_KEY"; - - // or, configure Bearer (JWT) authorization: oauth2 - // config.AccessToken = "YOUR_BEARER_TOKEN"; - - var apiAppApi = new ApiAppApi(config); - - var clientId = "0dd3b823a682527788c4e40cb7b6f7e9"; - - try - { - apiAppApi.ApiAppDelete(clientId); - } - catch (ApiException e) - { - Console.WriteLine("Exception when calling Dropbox Sign API: " + e.Message); - Console.WriteLine("Status Code: " + e.ErrorCode); - Console.WriteLine(e.StackTrace); - } - } -} diff --git a/examples/ApiAppDeleteExample.cs b/examples/ApiAppDeleteExample.cs new file mode 100644 index 0000000..87235a6 --- /dev/null +++ b/examples/ApiAppDeleteExample.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Text.Json; + +using Dropbox.Sign.Api; +using Dropbox.Sign.Client; +using Dropbox.Sign.Model; + +namespace Dropbox.SignSandbox; + +public class ApiAppDeleteExample +{ + public static void Run() + { + var config = new Configuration(); + config.Username = "YOUR_API_KEY"; + // config.AccessToken = "YOUR_ACCESS_TOKEN"; + + try + { + new ApiAppApi(config).ApiAppDelete( + clientId: "0dd3b823a682527788c4e40cb7b6f7e9" + ); + } + catch (ApiException e) + { + Console.WriteLine("Exception when calling ApiAppApi#ApiAppDelete: " + e.Message); + Console.WriteLine("Status Code: " + e.ErrorCode); + Console.WriteLine(e.StackTrace); + } + } +} diff --git a/examples/ApiAppGet.cs b/examples/ApiAppGet.cs deleted file mode 100644 index 260e507..0000000 --- a/examples/ApiAppGet.cs +++ /dev/null @@ -1,34 +0,0 @@ -using System; - -using Dropbox.Sign.Api; -using Dropbox.Sign.Client; -using Dropbox.Sign.Model; - -public class Example -{ - public static void Main() - { - var config = new Configuration(); - // Configure HTTP basic authorization: api_key - config.Username = "YOUR_API_KEY"; - - // or, configure Bearer (JWT) authorization: oauth2 - // config.AccessToken = "YOUR_BEARER_TOKEN"; - - var apiAppApi = new ApiAppApi(config); - - var clientId = "0dd3b823a682527788c4e40cb7b6f7e9"; - - try - { - var result = apiAppApi.ApiAppGet(clientId); - Console.WriteLine(result); - } - catch (ApiException e) - { - Console.WriteLine("Exception when calling Dropbox Sign API: " + e.Message); - Console.WriteLine("Status Code: " + e.ErrorCode); - Console.WriteLine(e.StackTrace); - } - } -} diff --git a/examples/ApiAppGetExample.cs b/examples/ApiAppGetExample.cs new file mode 100644 index 0000000..8bbf80a --- /dev/null +++ b/examples/ApiAppGetExample.cs @@ -0,0 +1,35 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Text.Json; + +using Dropbox.Sign.Api; +using Dropbox.Sign.Client; +using Dropbox.Sign.Model; + +namespace Dropbox.SignSandbox; + +public class ApiAppGetExample +{ + public static void Run() + { + var config = new Configuration(); + config.Username = "YOUR_API_KEY"; + // config.AccessToken = "YOUR_ACCESS_TOKEN"; + + try + { + var response = new ApiAppApi(config).ApiAppGet( + clientId: "0dd3b823a682527788c4e40cb7b6f7e9" + ); + + Console.WriteLine(response); + } + catch (ApiException e) + { + Console.WriteLine("Exception when calling ApiAppApi#ApiAppGet: " + e.Message); + Console.WriteLine("Status Code: " + e.ErrorCode); + Console.WriteLine(e.StackTrace); + } + } +} diff --git a/examples/ApiAppList.cs b/examples/ApiAppList.cs deleted file mode 100644 index 094fb3b..0000000 --- a/examples/ApiAppList.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System; - -using Dropbox.Sign.Api; -using Dropbox.Sign.Client; -using Dropbox.Sign.Model; - -public class Example -{ - public static void Main() - { - var config = new Configuration(); - // Configure HTTP basic authorization: api_key - config.Username = "YOUR_API_KEY"; - - // or, configure Bearer (JWT) authorization: oauth2 - // config.AccessToken = "YOUR_BEARER_TOKEN"; - - var apiAppApi = new ApiAppApi(config); - - var page = 1; - var pageSize = 2; - - try - { - var result = apiAppApi.ApiAppList(page, pageSize); - Console.WriteLine(result); - } - catch (ApiException e) - { - Console.WriteLine("Exception when calling Dropbox Sign API: " + e.Message); - Console.WriteLine("Status Code: " + e.ErrorCode); - Console.WriteLine(e.StackTrace); - } - } -} diff --git a/examples/ApiAppListExample.cs b/examples/ApiAppListExample.cs new file mode 100644 index 0000000..be90602 --- /dev/null +++ b/examples/ApiAppListExample.cs @@ -0,0 +1,36 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Text.Json; + +using Dropbox.Sign.Api; +using Dropbox.Sign.Client; +using Dropbox.Sign.Model; + +namespace Dropbox.SignSandbox; + +public class ApiAppListExample +{ + public static void Run() + { + var config = new Configuration(); + config.Username = "YOUR_API_KEY"; + // config.AccessToken = "YOUR_ACCESS_TOKEN"; + + try + { + var response = new ApiAppApi(config).ApiAppList( + page: 1, + pageSize: 20 + ); + + Console.WriteLine(response); + } + catch (ApiException e) + { + Console.WriteLine("Exception when calling ApiAppApi#ApiAppList: " + e.Message); + Console.WriteLine("Status Code: " + e.ErrorCode); + Console.WriteLine(e.StackTrace); + } + } +} diff --git a/examples/ApiAppUpdate.cs b/examples/ApiAppUpdate.cs deleted file mode 100644 index 4bca7cc..0000000 --- a/examples/ApiAppUpdate.cs +++ /dev/null @@ -1,61 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using Dropbox.Sign.Api; -using Dropbox.Sign.Client; -using Dropbox.Sign.Model; - -public class Example -{ - public static void Main() - { - var config = new Configuration(); - // Configure HTTP basic authorization: api_key - config.Username = "YOUR_API_KEY"; - - // or, configure Bearer (JWT) authorization: oauth2 - // config.AccessToken = "YOUR_BEARER_TOKEN"; - - var apiAppApi = new ApiAppApi(config); - - var oauth = new SubOAuth( - callbackUrl: "https://example.com/oauth", - scopes: new List() { - SubOAuth.ScopesEnum.BasicAccountInfo, - SubOAuth.ScopesEnum.RequestSignature - } - ); - - var whiteLabelingOptions = new SubWhiteLabelingOptions( - primaryButtonColor: "#00b3e6", - primaryButtonTextColor: "#ffffff" - ); - - var customLogoFile = new FileStream( - "CustomLogoFile.png", - FileMode.Open - ); - - var data = new ApiAppUpdateRequest( - name: "My Production App", - domains: new List(){"example.com"}, - oauth: oauth, - whiteLabelingOptions: whiteLabelingOptions, - customLogoFile: customLogoFile - ); - - var clientId = "0dd3b823a682527788c4e40cb7b6f7e9"; - - try - { - var result = apiAppApi.ApiAppUpdate(clientId, data); - Console.WriteLine(result); - } - catch (ApiException e) - { - Console.WriteLine("Exception when calling Dropbox Sign API: " + e.Message); - Console.WriteLine("Status Code: " + e.ErrorCode); - Console.WriteLine(e.StackTrace); - } - } -} diff --git a/examples/ApiAppUpdateExample.cs b/examples/ApiAppUpdateExample.cs new file mode 100644 index 0000000..3eb03a1 --- /dev/null +++ b/examples/ApiAppUpdateExample.cs @@ -0,0 +1,63 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Text.Json; + +using Dropbox.Sign.Api; +using Dropbox.Sign.Client; +using Dropbox.Sign.Model; + +namespace Dropbox.SignSandbox; + +public class ApiAppUpdateExample +{ + public static void Run() + { + var config = new Configuration(); + config.Username = "YOUR_API_KEY"; + // config.AccessToken = "YOUR_ACCESS_TOKEN"; + + var oauth = new SubOAuth( + callbackUrl: "https://example.com/oauth", + scopes: [ + SubOAuth.ScopesEnum.BasicAccountInfo, + SubOAuth.ScopesEnum.RequestSignature, + ] + ); + + var whiteLabelingOptions = new SubWhiteLabelingOptions( + primaryButtonColor: "#00b3e6", + primaryButtonTextColor: "#ffffff" + ); + + var apiAppUpdateRequest = new ApiAppUpdateRequest( + callbackUrl: "https://example.com/dropboxsign", + name: "New Name", + domains: [ + "example.com", + ], + customLogoFile: new FileStream( + path: "CustomLogoFile.png", + mode: FileMode.Open + ), + oauth: oauth, + whiteLabelingOptions: whiteLabelingOptions + ); + + try + { + var response = new ApiAppApi(config).ApiAppUpdate( + clientId: "0dd3b823a682527788c4e40cb7b6f7e9", + apiAppUpdateRequest: apiAppUpdateRequest + ); + + Console.WriteLine(response); + } + catch (ApiException e) + { + Console.WriteLine("Exception when calling ApiAppApi#ApiAppUpdate: " + e.Message); + Console.WriteLine("Status Code: " + e.ErrorCode); + Console.WriteLine(e.StackTrace); + } + } +} diff --git a/examples/BulkSendJobGet.cs b/examples/BulkSendJobGet.cs deleted file mode 100644 index 42a805c..0000000 --- a/examples/BulkSendJobGet.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using Dropbox.Sign.Api; -using Dropbox.Sign.Client; -using Dropbox.Sign.Model; - -public class Example -{ - public static void Main() - { - var config = new Configuration(); - // Configure HTTP basic authorization: api_key - config.Username = "YOUR_API_KEY"; - - // or, configure Bearer (JWT) authorization: oauth2 - // config.AccessToken = "YOUR_BEARER_TOKEN"; - - var bulkSendJobApi = new BulkSendJobApi(config); - - var bulkSendJobId = "6e683bc0369ba3d5b6f43c2c22a8031dbf6bd174"; - - try - { - var result = bulkSendJobApi.BulkSendJobGet(bulkSendJobId); - Console.WriteLine(result); - } - catch (ApiException e) - { - Console.WriteLine("Exception when calling Dropbox Sign API: " + e.Message); - Console.WriteLine("Status Code: " + e.ErrorCode); - Console.WriteLine(e.StackTrace); - } - } -} diff --git a/examples/BulkSendJobGetExample.cs b/examples/BulkSendJobGetExample.cs new file mode 100644 index 0000000..baa383c --- /dev/null +++ b/examples/BulkSendJobGetExample.cs @@ -0,0 +1,37 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Text.Json; + +using Dropbox.Sign.Api; +using Dropbox.Sign.Client; +using Dropbox.Sign.Model; + +namespace Dropbox.SignSandbox; + +public class BulkSendJobGetExample +{ + public static void Run() + { + var config = new Configuration(); + config.Username = "YOUR_API_KEY"; + // config.AccessToken = "YOUR_ACCESS_TOKEN"; + + try + { + var response = new BulkSendJobApi(config).BulkSendJobGet( + bulkSendJobId: "6e683bc0369ba3d5b6f43c2c22a8031dbf6bd174", + page: 1, + pageSize: 20 + ); + + Console.WriteLine(response); + } + catch (ApiException e) + { + Console.WriteLine("Exception when calling BulkSendJobApi#BulkSendJobGet: " + e.Message); + Console.WriteLine("Status Code: " + e.ErrorCode); + Console.WriteLine(e.StackTrace); + } + } +} diff --git a/examples/BulkSendJobList.cs b/examples/BulkSendJobList.cs deleted file mode 100644 index 4bdbb0b..0000000 --- a/examples/BulkSendJobList.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using Dropbox.Sign.Api; -using Dropbox.Sign.Client; -using Dropbox.Sign.Model; - -public class Example -{ - public static void Main() - { - var config = new Configuration(); - // Configure HTTP basic authorization: api_key - config.Username = "YOUR_API_KEY"; - - // or, configure Bearer (JWT) authorization: oauth2 - // config.AccessToken = "YOUR_BEARER_TOKEN"; - - var bulkSendJobApi = new BulkSendJobApi(config); - - var page = 1; - var pageSize = 20; - - try - { - var result = bulkSendJobApi.BulkSendJobList(page, pageSize); - Console.WriteLine(result); - } - catch (ApiException e) - { - Console.WriteLine("Exception when calling Dropbox Sign API: " + e.Message); - Console.WriteLine("Status Code: " + e.ErrorCode); - Console.WriteLine(e.StackTrace); - } - } -} diff --git a/examples/BulkSendJobListExample.cs b/examples/BulkSendJobListExample.cs new file mode 100644 index 0000000..d84e42e --- /dev/null +++ b/examples/BulkSendJobListExample.cs @@ -0,0 +1,36 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Text.Json; + +using Dropbox.Sign.Api; +using Dropbox.Sign.Client; +using Dropbox.Sign.Model; + +namespace Dropbox.SignSandbox; + +public class BulkSendJobListExample +{ + public static void Run() + { + var config = new Configuration(); + config.Username = "YOUR_API_KEY"; + // config.AccessToken = "YOUR_ACCESS_TOKEN"; + + try + { + var response = new BulkSendJobApi(config).BulkSendJobList( + page: 1, + pageSize: 20 + ); + + Console.WriteLine(response); + } + catch (ApiException e) + { + Console.WriteLine("Exception when calling BulkSendJobApi#BulkSendJobList: " + e.Message); + Console.WriteLine("Status Code: " + e.ErrorCode); + Console.WriteLine(e.StackTrace); + } + } +} diff --git a/examples/EmbeddedEditUrl.cs b/examples/EmbeddedEditUrl.cs deleted file mode 100644 index 8747912..0000000 --- a/examples/EmbeddedEditUrl.cs +++ /dev/null @@ -1,40 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using Dropbox.Sign.Api; -using Dropbox.Sign.Client; -using Dropbox.Sign.Model; - -public class Example -{ - public static void Main() - { - var config = new Configuration(); - // Configure HTTP basic authorization: api_key - config.Username = "YOUR_API_KEY"; - - // or, configure Bearer (JWT) authorization: oauth2 - // config.AccessToken = "YOUR_BEARER_TOKEN"; - - var embeddedApi = new EmbeddedApi(config); - - var data = new EmbeddedEditUrlRequest( - ccRoles: new List(){""}, - mergeFields: new List() - ); - - var templateId = "5de8179668f2033afac48da1868d0093bf133266"; - - try - { - var result = embeddedApi.EmbeddedEditUrl(templateId, data); - Console.WriteLine(result); - } - catch (ApiException e) - { - Console.WriteLine("Exception when calling Dropbox Sign API: " + e.Message); - Console.WriteLine("Status Code: " + e.ErrorCode); - Console.WriteLine(e.StackTrace); - } - } -} diff --git a/examples/EmbeddedEditUrlExample.cs b/examples/EmbeddedEditUrlExample.cs new file mode 100644 index 0000000..f951e17 --- /dev/null +++ b/examples/EmbeddedEditUrlExample.cs @@ -0,0 +1,45 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Text.Json; + +using Dropbox.Sign.Api; +using Dropbox.Sign.Client; +using Dropbox.Sign.Model; + +namespace Dropbox.SignSandbox; + +public class EmbeddedEditUrlExample +{ + public static void Run() + { + var config = new Configuration(); + config.Username = "YOUR_API_KEY"; + // config.AccessToken = "YOUR_ACCESS_TOKEN"; + + var mergeFields = new List(); + + var embeddedEditUrlRequest = new EmbeddedEditUrlRequest( + ccRoles: [ + "", + ], + mergeFields: mergeFields + ); + + try + { + var response = new EmbeddedApi(config).EmbeddedEditUrl( + templateId: "f57db65d3f933b5316d398057a36176831451a35", + embeddedEditUrlRequest: embeddedEditUrlRequest + ); + + Console.WriteLine(response); + } + catch (ApiException e) + { + Console.WriteLine("Exception when calling EmbeddedApi#EmbeddedEditUrl: " + e.Message); + Console.WriteLine("Status Code: " + e.ErrorCode); + Console.WriteLine(e.StackTrace); + } + } +} diff --git a/examples/EmbeddedSignUrl.cs b/examples/EmbeddedSignUrl.cs deleted file mode 100644 index d8197bf..0000000 --- a/examples/EmbeddedSignUrl.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using Dropbox.Sign.Api; -using Dropbox.Sign.Client; -using Dropbox.Sign.Model; - -public class Example -{ - public static void Main() - { - var config = new Configuration(); - // Configure HTTP basic authorization: api_key - config.Username = "YOUR_API_KEY"; - - // or, configure Bearer (JWT) authorization: oauth2 - // config.AccessToken = "YOUR_BEARER_TOKEN"; - - var embeddedApi = new EmbeddedApi(config); - - var signatureId = "50e3542f738adfa7ddd4cbd4c00d2a8ab6e4194b"; - - try - { - var result = embeddedApi.EmbeddedSignUrl(signatureId); - Console.WriteLine(result); - } - catch (ApiException e) - { - Console.WriteLine("Exception when calling Dropbox Sign API: " + e.Message); - Console.WriteLine("Status Code: " + e.ErrorCode); - Console.WriteLine(e.StackTrace); - } - } -} diff --git a/examples/EmbeddedSignUrlExample.cs b/examples/EmbeddedSignUrlExample.cs new file mode 100644 index 0000000..a800f0b --- /dev/null +++ b/examples/EmbeddedSignUrlExample.cs @@ -0,0 +1,35 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Text.Json; + +using Dropbox.Sign.Api; +using Dropbox.Sign.Client; +using Dropbox.Sign.Model; + +namespace Dropbox.SignSandbox; + +public class EmbeddedSignUrlExample +{ + public static void Run() + { + var config = new Configuration(); + config.Username = "YOUR_API_KEY"; + // config.AccessToken = "YOUR_ACCESS_TOKEN"; + + try + { + var response = new EmbeddedApi(config).EmbeddedSignUrl( + signatureId: "50e3542f738adfa7ddd4cbd4c00d2a8ab6e4194b" + ); + + Console.WriteLine(response); + } + catch (ApiException e) + { + Console.WriteLine("Exception when calling EmbeddedApi#EmbeddedSignUrl: " + e.Message); + Console.WriteLine("Status Code: " + e.ErrorCode); + Console.WriteLine(e.StackTrace); + } + } +} diff --git a/examples/EventCallback.cs b/examples/EventCallbackExample.cs similarity index 91% rename from examples/EventCallback.cs rename to examples/EventCallbackExample.cs index bc287ff..c8610a8 100644 --- a/examples/EventCallback.cs +++ b/examples/EventCallbackExample.cs @@ -1,10 +1,13 @@ +using System.Collections.Generic; using Newtonsoft.Json; using Dropbox.Sign.Model; using Dropbox.Sign; -public class Example +namespace Dropbox.SignSandbox; + +public class EventCallbackExample { - public static void Main() + public static void Run() { // use your API key var apiKey = "324e3b0840f065eb51f3fd63231d0d33daa35d4ed10d27718839e81737065782"; diff --git a/examples/FaxLineDelete.cs b/examples/FaxDeleteExample.cs similarity index 57% rename from examples/FaxLineDelete.cs rename to examples/FaxDeleteExample.cs index 810e268..aa39f49 100644 --- a/examples/FaxLineDelete.cs +++ b/examples/FaxDeleteExample.cs @@ -1,30 +1,30 @@ using System; using System.Collections.Generic; using System.IO; +using System.Text.Json; + using Dropbox.Sign.Api; using Dropbox.Sign.Client; using Dropbox.Sign.Model; -public class Example +namespace Dropbox.SignSandbox; + +public class FaxDeleteExample { - public static void Main() + public static void Run() { var config = new Configuration(); config.Username = "YOUR_API_KEY"; - var faxLineApi = new FaxLineApi(config); - - var data = new FaxLineDeleteRequest( - number: "[FAX_NUMBER]" - ); - try { - faxLineApi.FaxLineDelete(data); + new FaxApi(config).FaxDelete( + faxId: "fa5c8a0b0f492d768749333ad6fcc214c111e967" + ); } catch (ApiException e) { - Console.WriteLine("Exception when calling Dropbox Sign API: " + e.Message); + Console.WriteLine("Exception when calling FaxApi#FaxDelete: " + e.Message); Console.WriteLine("Status Code: " + e.ErrorCode); Console.WriteLine(e.StackTrace); } diff --git a/examples/FaxFiles.cs b/examples/FaxFiles.cs deleted file mode 100644 index fbaf416..0000000 --- a/examples/FaxFiles.cs +++ /dev/null @@ -1,34 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using Dropbox.Sign.Api; -using Dropbox.Sign.Client; -using Dropbox.Sign.Model; - -public class Example -{ - public static void Main() - { - var config = new Configuration(); - config.Username = "YOUR_API_KEY"; - - var faxApi = new FaxApi(config); - - var faxId = "fa5c8a0b0f492d768749333ad6fcc214c111e967"; - - try - { - var result = faxApi.FaxFiles(faxId); - var fileStream = File.Create("file_response.pdf"); - result.Seek(0, SeekOrigin.Begin); - result.CopyTo(fileStream); - fileStream.Close(); - } - catch (ApiException e) - { - Console.WriteLine("Exception when calling Dropbox Sign API: " + e.Message); - Console.WriteLine("Status Code: " + e.ErrorCode); - Console.WriteLine(e.StackTrace); - } - } -} diff --git a/examples/FaxFilesExample.cs b/examples/FaxFilesExample.cs new file mode 100644 index 0000000..278b90f --- /dev/null +++ b/examples/FaxFilesExample.cs @@ -0,0 +1,36 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Text.Json; + +using Dropbox.Sign.Api; +using Dropbox.Sign.Client; +using Dropbox.Sign.Model; + +namespace Dropbox.SignSandbox; + +public class FaxFilesExample +{ + public static void Run() + { + var config = new Configuration(); + config.Username = "YOUR_API_KEY"; + + try + { + var response = new FaxApi(config).FaxFiles( + faxId: "fa5c8a0b0f492d768749333ad6fcc214c111e967" + ); + var fileStream = File.Create("./file_response"); + response.Seek(0, SeekOrigin.Begin); + response.CopyTo(fileStream); + fileStream.Close(); + } + catch (ApiException e) + { + Console.WriteLine("Exception when calling FaxApi#FaxFiles: " + e.Message); + Console.WriteLine("Status Code: " + e.ErrorCode); + Console.WriteLine(e.StackTrace); + } + } +} diff --git a/examples/FaxGet.cs b/examples/FaxGet.cs deleted file mode 100644 index 6396e0c..0000000 --- a/examples/FaxGet.cs +++ /dev/null @@ -1,31 +0,0 @@ -using System; - -using Dropbox.Sign.Api; -using Dropbox.Sign.Client; -using Dropbox.Sign.Model; - -public class Example -{ - public static void Main() - { - var config = new Configuration(); - // Configure HTTP basic authorization: api_key - config.Username = "YOUR_API_KEY"; - - var faxApi = new FaxApi(config); - - var faxId = "fa5c8a0b0f492d768749333ad6fcc214c111e967"; - - try - { - var result = faxApi.FaxGet(faxId); - Console.WriteLine(result); - } - catch (ApiException e) - { - Console.WriteLine("Exception when calling Dropbox Sign API: " + e.Message); - Console.WriteLine("Status Code: " + e.ErrorCode); - Console.WriteLine(e.StackTrace); - } - } -} diff --git a/examples/FaxGetExample.cs b/examples/FaxGetExample.cs new file mode 100644 index 0000000..8a15843 --- /dev/null +++ b/examples/FaxGetExample.cs @@ -0,0 +1,34 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Text.Json; + +using Dropbox.Sign.Api; +using Dropbox.Sign.Client; +using Dropbox.Sign.Model; + +namespace Dropbox.SignSandbox; + +public class FaxGetExample +{ + public static void Run() + { + var config = new Configuration(); + config.Username = "YOUR_API_KEY"; + + try + { + var response = new FaxApi(config).FaxGet( + faxId: "fa5c8a0b0f492d768749333ad6fcc214c111e967" + ); + + Console.WriteLine(response); + } + catch (ApiException e) + { + Console.WriteLine("Exception when calling FaxApi#FaxGet: " + e.Message); + Console.WriteLine("Status Code: " + e.ErrorCode); + Console.WriteLine(e.StackTrace); + } + } +} diff --git a/examples/FaxLineAddUser.cs b/examples/FaxLineAddUserExample.cs similarity index 53% rename from examples/FaxLineAddUser.cs rename to examples/FaxLineAddUserExample.cs index de22f45..cb9c642 100644 --- a/examples/FaxLineAddUser.cs +++ b/examples/FaxLineAddUserExample.cs @@ -1,32 +1,37 @@ using System; using System.Collections.Generic; using System.IO; +using System.Text.Json; + using Dropbox.Sign.Api; using Dropbox.Sign.Client; using Dropbox.Sign.Model; -public class Example +namespace Dropbox.SignSandbox; + +public class FaxLineAddUserExample { - public static void Main() + public static void Run() { var config = new Configuration(); config.Username = "YOUR_API_KEY"; - var faxLineApi = new FaxLineApi(config); - - var data = new FaxLineAddUserRequest( + var faxLineAddUserRequest = new FaxLineAddUserRequest( number: "[FAX_NUMBER]", emailAddress: "member@dropboxsign.com" ); try { - var result = faxLineApi.FaxLineAddUser(data); - Console.WriteLine(result); + var response = new FaxLineApi(config).FaxLineAddUser( + faxLineAddUserRequest: faxLineAddUserRequest + ); + + Console.WriteLine(response); } catch (ApiException e) { - Console.WriteLine("Exception when calling Dropbox Sign API: " + e.Message); + Console.WriteLine("Exception when calling FaxLineApi#FaxLineAddUser: " + e.Message); Console.WriteLine("Status Code: " + e.ErrorCode); Console.WriteLine(e.StackTrace); } diff --git a/examples/FaxLineAreaCodeGetExample.cs b/examples/FaxLineAreaCodeGetExample.cs new file mode 100644 index 0000000..4035919 --- /dev/null +++ b/examples/FaxLineAreaCodeGetExample.cs @@ -0,0 +1,34 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Text.Json; + +using Dropbox.Sign.Api; +using Dropbox.Sign.Client; +using Dropbox.Sign.Model; + +namespace Dropbox.SignSandbox; + +public class FaxLineAreaCodeGetExample +{ + public static void Run() + { + var config = new Configuration(); + config.Username = "YOUR_API_KEY"; + + try + { + var response = new FaxLineApi(config).FaxLineAreaCodeGet( + country: "US" + ); + + Console.WriteLine(response); + } + catch (ApiException e) + { + Console.WriteLine("Exception when calling FaxLineApi#FaxLineAreaCodeGet: " + e.Message); + Console.WriteLine("Status Code: " + e.ErrorCode); + Console.WriteLine(e.StackTrace); + } + } +} diff --git a/examples/FaxLineCreateExample.cs b/examples/FaxLineCreateExample.cs new file mode 100644 index 0000000..802ea40 --- /dev/null +++ b/examples/FaxLineCreateExample.cs @@ -0,0 +1,39 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Text.Json; + +using Dropbox.Sign.Api; +using Dropbox.Sign.Client; +using Dropbox.Sign.Model; + +namespace Dropbox.SignSandbox; + +public class FaxLineCreateExample +{ + public static void Run() + { + var config = new Configuration(); + config.Username = "YOUR_API_KEY"; + + var faxLineCreateRequest = new FaxLineCreateRequest( + areaCode: 209, + country: FaxLineCreateRequest.CountryEnum.US + ); + + try + { + var response = new FaxLineApi(config).FaxLineCreate( + faxLineCreateRequest: faxLineCreateRequest + ); + + Console.WriteLine(response); + } + catch (ApiException e) + { + Console.WriteLine("Exception when calling FaxLineApi#FaxLineCreate: " + e.Message); + Console.WriteLine("Status Code: " + e.ErrorCode); + Console.WriteLine(e.StackTrace); + } + } +} diff --git a/examples/FaxLineDeleteExample.cs b/examples/FaxLineDeleteExample.cs new file mode 100644 index 0000000..42faed2 --- /dev/null +++ b/examples/FaxLineDeleteExample.cs @@ -0,0 +1,36 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Text.Json; + +using Dropbox.Sign.Api; +using Dropbox.Sign.Client; +using Dropbox.Sign.Model; + +namespace Dropbox.SignSandbox; + +public class FaxLineDeleteExample +{ + public static void Run() + { + var config = new Configuration(); + config.Username = "YOUR_API_KEY"; + + var faxLineDeleteRequest = new FaxLineDeleteRequest( + number: "[FAX_NUMBER]" + ); + + try + { + new FaxLineApi(config).FaxLineDelete( + faxLineDeleteRequest: faxLineDeleteRequest + ); + } + catch (ApiException e) + { + Console.WriteLine("Exception when calling FaxLineApi#FaxLineDelete: " + e.Message); + Console.WriteLine("Status Code: " + e.ErrorCode); + Console.WriteLine(e.StackTrace); + } + } +} diff --git a/examples/FaxLineGetExample.cs b/examples/FaxLineGetExample.cs new file mode 100644 index 0000000..690a653 --- /dev/null +++ b/examples/FaxLineGetExample.cs @@ -0,0 +1,34 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Text.Json; + +using Dropbox.Sign.Api; +using Dropbox.Sign.Client; +using Dropbox.Sign.Model; + +namespace Dropbox.SignSandbox; + +public class FaxLineGetExample +{ + public static void Run() + { + var config = new Configuration(); + config.Username = "YOUR_API_KEY"; + + try + { + var response = new FaxLineApi(config).FaxLineGet( + number: "123-123-1234" + ); + + Console.WriteLine(response); + } + catch (ApiException e) + { + Console.WriteLine("Exception when calling FaxLineApi#FaxLineGet: " + e.Message); + Console.WriteLine("Status Code: " + e.ErrorCode); + Console.WriteLine(e.StackTrace); + } + } +} diff --git a/examples/FaxLineList.cs b/examples/FaxLineList.cs deleted file mode 100644 index 96d7f0c..0000000 --- a/examples/FaxLineList.cs +++ /dev/null @@ -1,29 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using Dropbox.Sign.Api; -using Dropbox.Sign.Client; -using Dropbox.Sign.Model; - -public class Example -{ - public static void Main() - { - var config = new Configuration(); - config.Username = "YOUR_API_KEY"; - - var faxLineApi = new FaxLineApi(config); - - try - { - var result = faxLineApi.FaxLineList(); - Console.WriteLine(result); - } - catch (ApiException e) - { - Console.WriteLine("Exception when calling Dropbox Sign API: " + e.Message); - Console.WriteLine("Status Code: " + e.ErrorCode); - Console.WriteLine(e.StackTrace); - } - } -} diff --git a/examples/FaxLineListExample.cs b/examples/FaxLineListExample.cs new file mode 100644 index 0000000..278eeea --- /dev/null +++ b/examples/FaxLineListExample.cs @@ -0,0 +1,36 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Text.Json; + +using Dropbox.Sign.Api; +using Dropbox.Sign.Client; +using Dropbox.Sign.Model; + +namespace Dropbox.SignSandbox; + +public class FaxLineListExample +{ + public static void Run() + { + var config = new Configuration(); + config.Username = "YOUR_API_KEY"; + + try + { + var response = new FaxLineApi(config).FaxLineList( + accountId: "ab55cd14a97219e36b5ff5fe23f2f9329b0c1e97", + page: 1, + pageSize: 20 + ); + + Console.WriteLine(response); + } + catch (ApiException e) + { + Console.WriteLine("Exception when calling FaxLineApi#FaxLineList: " + e.Message); + Console.WriteLine("Status Code: " + e.ErrorCode); + Console.WriteLine(e.StackTrace); + } + } +} diff --git a/examples/FaxLineRemoveUser.cs b/examples/FaxLineRemoveUserExample.cs similarity index 52% rename from examples/FaxLineRemoveUser.cs rename to examples/FaxLineRemoveUserExample.cs index 1dd562e..809b89a 100644 --- a/examples/FaxLineRemoveUser.cs +++ b/examples/FaxLineRemoveUserExample.cs @@ -1,32 +1,37 @@ using System; using System.Collections.Generic; using System.IO; +using System.Text.Json; + using Dropbox.Sign.Api; using Dropbox.Sign.Client; using Dropbox.Sign.Model; -public class Example +namespace Dropbox.SignSandbox; + +public class FaxLineRemoveUserExample { - public static void Main() + public static void Run() { var config = new Configuration(); config.Username = "YOUR_API_KEY"; - var faxLineApi = new FaxLineApi(config); - - var data = new FaxLineRemoveUserRequest( + var faxLineRemoveUserRequest = new FaxLineRemoveUserRequest( number: "[FAX_NUMBER]", emailAddress: "member@dropboxsign.com" ); try { - var result = faxLineApi.FaxLineRemoveUser(data); - Console.WriteLine(result); + var response = new FaxLineApi(config).FaxLineRemoveUser( + faxLineRemoveUserRequest: faxLineRemoveUserRequest + ); + + Console.WriteLine(response); } catch (ApiException e) { - Console.WriteLine("Exception when calling Dropbox Sign API: " + e.Message); + Console.WriteLine("Exception when calling FaxLineApi#FaxLineRemoveUser: " + e.Message); Console.WriteLine("Status Code: " + e.ErrorCode); Console.WriteLine(e.StackTrace); } diff --git a/examples/FaxList.cs b/examples/FaxList.cs deleted file mode 100644 index f87d9b8..0000000 --- a/examples/FaxList.cs +++ /dev/null @@ -1,32 +0,0 @@ -using System; - -using Dropbox.Sign.Api; -using Dropbox.Sign.Client; -using Dropbox.Sign.Model; - -public class Example -{ - public static void Main() - { - var config = new Configuration(); - // Configure HTTP basic authorization: api_key - config.Username = "YOUR_API_KEY"; - - var faxApi = new FaxApi(config); - - var page = 1; - var pageSize = 2; - - try - { - var result = faxApi.FaxList(page, pageSize); - Console.WriteLine(result); - } - catch (ApiException e) - { - Console.WriteLine("Exception when calling Dropbox Sign API: " + e.Message); - Console.WriteLine("Status Code: " + e.ErrorCode); - Console.WriteLine(e.StackTrace); - } - } -} diff --git a/examples/FaxDelete.cs b/examples/FaxListExample.cs similarity index 54% rename from examples/FaxDelete.cs rename to examples/FaxListExample.cs index 88a6ed0..6445061 100644 --- a/examples/FaxDelete.cs +++ b/examples/FaxListExample.cs @@ -1,26 +1,33 @@ using System; using System.Collections.Generic; using System.IO; +using System.Text.Json; + using Dropbox.Sign.Api; using Dropbox.Sign.Client; using Dropbox.Sign.Model; -public class Example +namespace Dropbox.SignSandbox; + +public class FaxListExample { - public static void Main() + public static void Run() { var config = new Configuration(); config.Username = "YOUR_API_KEY"; - var faxApi = new FaxApi(config); - try { - faxApi.FaxDelete("fa5c8a0b0f492d768749333ad6fcc214c111e967"); + var response = new FaxApi(config).FaxList( + page: 1, + pageSize: 20 + ); + + Console.WriteLine(response); } catch (ApiException e) { - Console.WriteLine("Exception when calling Dropbox Sign API: " + e.Message); + Console.WriteLine("Exception when calling FaxApi#FaxList: " + e.Message); Console.WriteLine("Status Code: " + e.ErrorCode); Console.WriteLine(e.StackTrace); } diff --git a/examples/FaxSend.cs b/examples/FaxSendExample.cs similarity index 54% rename from examples/FaxSend.cs rename to examples/FaxSendExample.cs index 8e72a4f..e6a2270 100644 --- a/examples/FaxSend.cs +++ b/examples/FaxSendExample.cs @@ -1,47 +1,49 @@ using System; using System.Collections.Generic; using System.IO; +using System.Text.Json; + using Dropbox.Sign.Api; using Dropbox.Sign.Client; using Dropbox.Sign.Model; -public class Example +namespace Dropbox.SignSandbox; + +public class FaxSendExample { - public static void Main() + public static void Run() { var config = new Configuration(); config.Username = "YOUR_API_KEY"; - var faxApi = new FaxApi(config); - - var files = new List { - new FileStream( - "./example_fax.pdf", - FileMode.Open, - FileAccess.Read, - FileShare.Read - ) - }; - - var data = new FaxSendRequest( - files: files, - testMode: true, + var faxSendRequest = new FaxSendRequest( recipient: "16690000001", sender: "16690000000", + testMode: true, coverPageTo: "Jill Fax", - coverPageMessage: "I'm sending you a fax!", coverPageFrom: "Faxer Faxerson", + coverPageMessage: "I'm sending you a fax!", title: "This is what the fax is about!", + files: new List + { + new FileStream( + path: "./example_fax.pdf", + mode: FileMode.Open + ), + } ); try { - var result = faxApi.FaxSend(data); - Console.WriteLine(result); + var response = new FaxApi(config).FaxSend( + faxSendRequest: faxSendRequest + ); + + Console.WriteLine(response); } catch (ApiException e) { - Console.WriteLine("Exception when calling Dropbox Sign API: " + e.Message); + Console.WriteLine("Exception when calling FaxApi#FaxSend: " + e.Message); Console.WriteLine("Status Code: " + e.ErrorCode); Console.WriteLine(e.StackTrace); } diff --git a/examples/OauthTokenGenerate.cs b/examples/OauthTokenGenerate.cs deleted file mode 100644 index f76153b..0000000 --- a/examples/OauthTokenGenerate.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using Dropbox.Sign.Api; -using Dropbox.Sign.Client; -using Dropbox.Sign.Model; - -public class Example -{ - public static void Main() - { - var config = new Configuration(); - - var oAuthApi = new OAuthApi(config); - - var data = new OAuthTokenGenerateRequest( - state: "900e06e2", - code: "1b0d28d90c86c141", - clientId: "cc91c61d00f8bb2ece1428035716b", - clientSecret: "1d14434088507ffa390e6f5528465" - ); - - try - { - var result = oAuthApi.OauthTokenGenerate(data); - Console.WriteLine(result); - } - catch (ApiException e) - { - Console.WriteLine("Exception when calling Dropbox Sign API: " + e.Message); - Console.WriteLine("Status Code: " + e.ErrorCode); - Console.WriteLine(e.StackTrace); - } - } -} diff --git a/examples/OauthTokenGenerateExample.cs b/examples/OauthTokenGenerateExample.cs new file mode 100644 index 0000000..7d8da2f --- /dev/null +++ b/examples/OauthTokenGenerateExample.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Text.Json; + +using Dropbox.Sign.Api; +using Dropbox.Sign.Client; +using Dropbox.Sign.Model; + +namespace Dropbox.SignSandbox; + +public class OauthTokenGenerateExample +{ + public static void Run() + { + var config = new Configuration(); + + var oAuthTokenGenerateRequest = new OAuthTokenGenerateRequest( + clientId: "cc91c61d00f8bb2ece1428035716b", + clientSecret: "1d14434088507ffa390e6f5528465", + code: "1b0d28d90c86c141", + state: "900e06e2", + grantType: "authorization_code" + ); + + try + { + var response = new OAuthApi(config).OauthTokenGenerate( + oAuthTokenGenerateRequest: oAuthTokenGenerateRequest + ); + + Console.WriteLine(response); + } + catch (ApiException e) + { + Console.WriteLine("Exception when calling OAuthApi#OauthTokenGenerate: " + e.Message); + Console.WriteLine("Status Code: " + e.ErrorCode); + Console.WriteLine(e.StackTrace); + } + } +} diff --git a/examples/OauthTokenRefresh.cs b/examples/OauthTokenRefresh.cs deleted file mode 100644 index 41f3235..0000000 --- a/examples/OauthTokenRefresh.cs +++ /dev/null @@ -1,32 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using Dropbox.Sign.Api; -using Dropbox.Sign.Client; -using Dropbox.Sign.Model; - -public class Example -{ - public static void Main() - { - var config = new Configuration(); - - var oAuthApi = new OAuthApi(config); - - var data = new OAuthTokenRefreshRequest( - refreshToken: "hNTI2MTFmM2VmZDQxZTZjOWRmZmFjZmVmMGMyNGFjMzI2MGI5YzgzNmE3" - ); - - try - { - var result = oAuthApi.OauthTokenRefresh(data); - Console.WriteLine(result); - } - catch (ApiException e) - { - Console.WriteLine("Exception when calling Dropbox Sign API: " + e.Message); - Console.WriteLine("Status Code: " + e.ErrorCode); - Console.WriteLine(e.StackTrace); - } - } -} diff --git a/examples/OauthTokenRefreshExample.cs b/examples/OauthTokenRefreshExample.cs new file mode 100644 index 0000000..21c40d1 --- /dev/null +++ b/examples/OauthTokenRefreshExample.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Text.Json; + +using Dropbox.Sign.Api; +using Dropbox.Sign.Client; +using Dropbox.Sign.Model; + +namespace Dropbox.SignSandbox; + +public class OauthTokenRefreshExample +{ + public static void Run() + { + var config = new Configuration(); + + var oAuthTokenRefreshRequest = new OAuthTokenRefreshRequest( + grantType: "refresh_token", + refreshToken: "hNTI2MTFmM2VmZDQxZTZjOWRmZmFjZmVmMGMyNGFjMzI2MGI5YzgzNmE3" + ); + + try + { + var response = new OAuthApi(config).OauthTokenRefresh( + oAuthTokenRefreshRequest: oAuthTokenRefreshRequest + ); + + Console.WriteLine(response); + } + catch (ApiException e) + { + Console.WriteLine("Exception when calling OAuthApi#OauthTokenRefresh: " + e.Message); + Console.WriteLine("Status Code: " + e.ErrorCode); + Console.WriteLine(e.StackTrace); + } + } +} diff --git a/examples/ReportCreate.cs b/examples/ReportCreateExample.cs similarity index 53% rename from examples/ReportCreate.cs rename to examples/ReportCreateExample.cs index 994169a..769bd3a 100644 --- a/examples/ReportCreate.cs +++ b/examples/ReportCreateExample.cs @@ -1,40 +1,41 @@ using System; using System.Collections.Generic; using System.IO; +using System.Text.Json; + using Dropbox.Sign.Api; using Dropbox.Sign.Client; using Dropbox.Sign.Model; -public class Example +namespace Dropbox.SignSandbox; + +public class ReportCreateExample { - public static void Main() + public static void Run() { var config = new Configuration(); - // Configure HTTP basic authorization: api_key config.Username = "YOUR_API_KEY"; - // or, configure Bearer (JWT) authorization: oauth2 - // config.AccessToken = "YOUR_BEARER_TOKEN"; - - var reportApi = new ReportApi(config); - - var data = new ReportCreateRequest( + var reportCreateRequest = new ReportCreateRequest( startDate: "09/01/2020", endDate: "09/01/2020", - reportType: new List() { + reportType: [ ReportCreateRequest.ReportTypeEnum.UserActivity, ReportCreateRequest.ReportTypeEnum.DocumentStatus, - } + ] ); try { - var result = reportApi.OauthCreate(data); - Console.WriteLine(result); + var response = new ReportApi(config).ReportCreate( + reportCreateRequest: reportCreateRequest + ); + + Console.WriteLine(response); } catch (ApiException e) { - Console.WriteLine("Exception when calling Dropbox Sign API: " + e.Message); + Console.WriteLine("Exception when calling ReportApi#ReportCreate: " + e.Message); Console.WriteLine("Status Code: " + e.ErrorCode); Console.WriteLine(e.StackTrace); } diff --git a/examples/SignatureRequestBulkCreateEmbeddedWithTemplate.cs b/examples/SignatureRequestBulkCreateEmbeddedWithTemplate.cs deleted file mode 100644 index d87fd12..0000000 --- a/examples/SignatureRequestBulkCreateEmbeddedWithTemplate.cs +++ /dev/null @@ -1,82 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using Dropbox.Sign.Api; -using Dropbox.Sign.Client; -using Dropbox.Sign.Model; - -public class Example -{ - public static void Main() - { - var config = new Configuration(); - // Configure HTTP basic authorization: api_key - config.Username = "YOUR_API_KEY"; - - // or, configure Bearer (JWT) authorization: oauth2 - // config.AccessToken = "YOUR_BEARER_TOKEN"; - - var signatureRequestApi = new SignatureRequestApi(config); - - var signerList1Signer = new SubSignatureRequestTemplateSigner( - role: "Client", - name: "George", - emailAddress: "george@example.com", - pin: "d79a3td" - ); - - var signerList1CustomFields = new SubBulkSignerListCustomField( - name: "company", - value: "ABC Corp" - ); - - var signerList1 = new SubBulkSignerList( - signers: new List(){signerList1Signer}, - customFields: new List(){signerList1CustomFields} - ); - - var signerList2Signer = new SubSignatureRequestTemplateSigner( - role: "Client", - name: "Mary", - emailAddress: "mary@example.com", - pin: "gd9as5b" - ); - - var signerList2CustomFields = new SubBulkSignerListCustomField( - name: "company", - value: "123 Corp" - ); - - var signerList2 = new SubBulkSignerList( - signers: new List(){signerList2Signer}, - customFields: new List(){signerList2CustomFields} - ); - - var cc1 = new SubCC( - role: "Accounting", - emailAddress: "accouting@email.com" - ); - - var data = new SignatureRequestBulkCreateEmbeddedWithTemplateRequest( - clientId: "1a659d9ad95bccd307ecad78d72192f8", - templateIds: new List(){"c26b8a16784a872da37ea946b9ddec7c1e11dff6"}, - subject: "Purchase Order", - message: "Glad we could come to an agreement.", - signerList: new List(){signerList1, signerList2}, - ccs: new List(){cc1}, - testMode: true - ); - - try - { - var result = signatureRequestApi.SignatureRequestBulkCreateEmbeddedWithTemplate(data); - Console.WriteLine(result); - } - catch (ApiException e) - { - Console.WriteLine("Exception when calling Dropbox Sign API: " + e.Message); - Console.WriteLine("Status Code: " + e.ErrorCode); - Console.WriteLine(e.StackTrace); - } - } -} diff --git a/examples/SignatureRequestBulkCreateEmbeddedWithTemplateExample.cs b/examples/SignatureRequestBulkCreateEmbeddedWithTemplateExample.cs new file mode 100644 index 0000000..9fd344a --- /dev/null +++ b/examples/SignatureRequestBulkCreateEmbeddedWithTemplateExample.cs @@ -0,0 +1,116 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Text.Json; + +using Dropbox.Sign.Api; +using Dropbox.Sign.Client; +using Dropbox.Sign.Model; + +namespace Dropbox.SignSandbox; + +public class SignatureRequestBulkCreateEmbeddedWithTemplateExample +{ + public static void Run() + { + var config = new Configuration(); + config.Username = "YOUR_API_KEY"; + + var signerList2CustomFields1 = new SubBulkSignerListCustomField( + name: "company", + value: "123 LLC" + ); + + var signerList2CustomFields = new List + { + signerList2CustomFields1, + }; + + var signerList2Signers1 = new SubSignatureRequestTemplateSigner( + role: "Client", + name: "Mary", + emailAddress: "mary@example.com", + pin: "gd9as5b" + ); + + var signerList2Signers = new List + { + signerList2Signers1, + }; + + var signerList1CustomFields1 = new SubBulkSignerListCustomField( + name: "company", + value: "ABC Corp" + ); + + var signerList1CustomFields = new List + { + signerList1CustomFields1, + }; + + var signerList1Signers1 = new SubSignatureRequestTemplateSigner( + role: "Client", + name: "George", + emailAddress: "george@example.com", + pin: "d79a3td" + ); + + var signerList1Signers = new List + { + signerList1Signers1, + }; + + var signerList1 = new SubBulkSignerList( + customFields: signerList1CustomFields, + signers: signerList1Signers + ); + + var signerList2 = new SubBulkSignerList( + customFields: signerList2CustomFields, + signers: signerList2Signers + ); + + var signerList = new List + { + signerList1, + signerList2, + }; + + var ccs1 = new SubCC( + role: "Accounting", + emailAddress: "accounting@example.com" + ); + + var ccs = new List + { + ccs1, + }; + + var signatureRequestBulkCreateEmbeddedWithTemplateRequest = new SignatureRequestBulkCreateEmbeddedWithTemplateRequest( + clientId: "1a659d9ad95bccd307ecad78d72192f8", + templateIds: [ + "c26b8a16784a872da37ea946b9ddec7c1e11dff6", + ], + message: "Glad we could come to an agreement.", + subject: "Purchase Order", + testMode: true, + signerList: signerList, + ccs: ccs + ); + + try + { + var response = new SignatureRequestApi(config).SignatureRequestBulkCreateEmbeddedWithTemplate( + signatureRequestBulkCreateEmbeddedWithTemplateRequest: signatureRequestBulkCreateEmbeddedWithTemplateRequest + ); + + Console.WriteLine(response); + } + catch (ApiException e) + { + Console.WriteLine("Exception when calling SignatureRequestApi#SignatureRequestBulkCreateEmbeddedWithTemplate: " + e.Message); + Console.WriteLine("Status Code: " + e.ErrorCode); + Console.WriteLine(e.StackTrace); + } + } +} diff --git a/examples/SignatureRequestBulkSendWithTemplate.cs b/examples/SignatureRequestBulkSendWithTemplate.cs deleted file mode 100644 index bf1851b..0000000 --- a/examples/SignatureRequestBulkSendWithTemplate.cs +++ /dev/null @@ -1,81 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using Dropbox.Sign.Api; -using Dropbox.Sign.Client; -using Dropbox.Sign.Model; - -public class Example -{ - public static void Main() - { - var config = new Configuration(); - // Configure HTTP basic authorization: api_key - config.Username = "YOUR_API_KEY"; - - // or, configure Bearer (JWT) authorization: oauth2 - // config.AccessToken = "YOUR_BEARER_TOKEN"; - - var signatureRequestApi = new SignatureRequestApi(config); - - var signerList1Signer = new SubSignatureRequestTemplateSigner( - role: "Client", - name: "George", - emailAddress: "george@example.com", - pin: "d79a3td" - ); - - var signerList1CustomFields = new SubBulkSignerListCustomField( - name: "company", - value: "ABC Corp" - ); - - var signerList1 = new SubBulkSignerList( - signers: new List(){signerList1Signer}, - customFields: new List(){signerList1CustomFields} - ); - - var signerList2Signer = new SubSignatureRequestTemplateSigner( - role: "Client", - name: "Mary", - emailAddress: "mary@example.com", - pin: "gd9as5b" - ); - - var signerList2CustomFields = new SubBulkSignerListCustomField( - name: "company", - value: "123 Corp" - ); - - var signerList2 = new SubBulkSignerList( - signers: new List(){signerList2Signer}, - customFields: new List(){signerList2CustomFields} - ); - - var cc1 = new SubCC( - role: "Accounting", - emailAddress: "accouting@email.com" - ); - - var data = new SignatureRequestBulkSendWithTemplateRequest( - templateIds: new List(){"c26b8a16784a872da37ea946b9ddec7c1e11dff6"}, - subject: "Purchase Order", - message: "Glad we could come to an agreement.", - signerList: new List(){signerList1, signerList2}, - ccs: new List(){cc1}, - testMode: true - ); - - try - { - var result = signatureRequestApi.SignatureRequestBulkSendWithTemplate(data); - Console.WriteLine(result); - } - catch (ApiException e) - { - Console.WriteLine("Exception when calling Dropbox Sign API: " + e.Message); - Console.WriteLine("Status Code: " + e.ErrorCode); - Console.WriteLine(e.StackTrace); - } - } -} diff --git a/examples/SignatureRequestBulkSendWithTemplateExample.cs b/examples/SignatureRequestBulkSendWithTemplateExample.cs new file mode 100644 index 0000000..3c95fdb --- /dev/null +++ b/examples/SignatureRequestBulkSendWithTemplateExample.cs @@ -0,0 +1,116 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Text.Json; + +using Dropbox.Sign.Api; +using Dropbox.Sign.Client; +using Dropbox.Sign.Model; + +namespace Dropbox.SignSandbox; + +public class SignatureRequestBulkSendWithTemplateExample +{ + public static void Run() + { + var config = new Configuration(); + config.Username = "YOUR_API_KEY"; + // config.AccessToken = "YOUR_ACCESS_TOKEN"; + + var signerList2CustomFields1 = new SubBulkSignerListCustomField( + name: "company", + value: "123 LLC" + ); + + var signerList2CustomFields = new List + { + signerList2CustomFields1, + }; + + var signerList2Signers1 = new SubSignatureRequestTemplateSigner( + role: "Client", + name: "Mary", + emailAddress: "mary@example.com", + pin: "gd9as5b" + ); + + var signerList2Signers = new List + { + signerList2Signers1, + }; + + var signerList1CustomFields1 = new SubBulkSignerListCustomField( + name: "company", + value: "ABC Corp" + ); + + var signerList1CustomFields = new List + { + signerList1CustomFields1, + }; + + var signerList1Signers1 = new SubSignatureRequestTemplateSigner( + role: "Client", + name: "George", + emailAddress: "george@example.com", + pin: "d79a3td" + ); + + var signerList1Signers = new List + { + signerList1Signers1, + }; + + var signerList1 = new SubBulkSignerList( + customFields: signerList1CustomFields, + signers: signerList1Signers + ); + + var signerList2 = new SubBulkSignerList( + customFields: signerList2CustomFields, + signers: signerList2Signers + ); + + var signerList = new List + { + signerList1, + signerList2, + }; + + var ccs1 = new SubCC( + role: "Accounting", + emailAddress: "accounting@example.com" + ); + + var ccs = new List + { + ccs1, + }; + + var signatureRequestBulkSendWithTemplateRequest = new SignatureRequestBulkSendWithTemplateRequest( + templateIds: [ + "c26b8a16784a872da37ea946b9ddec7c1e11dff6", + ], + message: "Glad we could come to an agreement.", + subject: "Purchase Order", + testMode: true, + signerList: signerList, + ccs: ccs + ); + + try + { + var response = new SignatureRequestApi(config).SignatureRequestBulkSendWithTemplate( + signatureRequestBulkSendWithTemplateRequest: signatureRequestBulkSendWithTemplateRequest + ); + + Console.WriteLine(response); + } + catch (ApiException e) + { + Console.WriteLine("Exception when calling SignatureRequestApi#SignatureRequestBulkSendWithTemplate: " + e.Message); + Console.WriteLine("Status Code: " + e.ErrorCode); + Console.WriteLine(e.StackTrace); + } + } +} diff --git a/examples/SignatureRequestCancel.cs b/examples/SignatureRequestCancel.cs deleted file mode 100644 index cb9549f..0000000 --- a/examples/SignatureRequestCancel.cs +++ /dev/null @@ -1,34 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using Dropbox.Sign.Api; -using Dropbox.Sign.Client; -using Dropbox.Sign.Model; - -public class Example -{ - public static void Main() - { - var config = new Configuration(); - // Configure HTTP basic authorization: api_key - config.Username = "YOUR_API_KEY"; - - // or, configure Bearer (JWT) authorization: oauth2 - // config.AccessToken = "YOUR_BEARER_TOKEN"; - - var signatureRequestApi = new SignatureRequestApi(config); - - var signatureRequestId = "2f9781e1a8e2045224d808c153c2e1d3df6f8f2f"; - - try - { - signatureRequestApi.SignatureRequestCancel(signatureRequestId); - } - catch (ApiException e) - { - Console.WriteLine("Exception when calling Dropbox Sign API: " + e.Message); - Console.WriteLine("Status Code: " + e.ErrorCode); - Console.WriteLine(e.StackTrace); - } - } -} diff --git a/examples/SignatureRequestCancelExample.cs b/examples/SignatureRequestCancelExample.cs new file mode 100644 index 0000000..4d18209 --- /dev/null +++ b/examples/SignatureRequestCancelExample.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Text.Json; + +using Dropbox.Sign.Api; +using Dropbox.Sign.Client; +using Dropbox.Sign.Model; + +namespace Dropbox.SignSandbox; + +public class SignatureRequestCancelExample +{ + public static void Run() + { + var config = new Configuration(); + config.Username = "YOUR_API_KEY"; + // config.AccessToken = "YOUR_ACCESS_TOKEN"; + + try + { + new SignatureRequestApi(config).SignatureRequestCancel( + signatureRequestId: "fa5c8a0b0f492d768749333ad6fcc214c111e967" + ); + } + catch (ApiException e) + { + Console.WriteLine("Exception when calling SignatureRequestApi#SignatureRequestCancel: " + e.Message); + Console.WriteLine("Status Code: " + e.ErrorCode); + Console.WriteLine(e.StackTrace); + } + } +} diff --git a/examples/SignatureRequestCreateEmbedded.cs b/examples/SignatureRequestCreateEmbedded.cs deleted file mode 100644 index 1f587c9..0000000 --- a/examples/SignatureRequestCreateEmbedded.cs +++ /dev/null @@ -1,74 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using Dropbox.Sign.Api; -using Dropbox.Sign.Client; -using Dropbox.Sign.Model; - -public class Example -{ - public static void Main() - { - var config = new Configuration(); - // Configure HTTP basic authorization: api_key - config.Username = "YOUR_API_KEY"; - - // or, configure Bearer (JWT) authorization: oauth2 - // config.AccessToken = "YOUR_BEARER_TOKEN"; - - var signatureRequestApi = new SignatureRequestApi(config); - - var signer1 = new SubSignatureRequestSigner( - emailAddress: "jack@example.com", - name: "Jack", - order: 0 - ); - - var signer2 = new SubSignatureRequestSigner( - emailAddress: "jill@example.com", - name: "Jill", - order: 1 - ); - - var signingOptions = new SubSigningOptions( - draw: true, - type: true, - upload: true, - phone: true, - defaultType: SubSigningOptions.DefaultTypeEnum.Draw - ); - - var files = new List { - new FileStream( - "./example_signature_request.pdf", - FileMode.Open, - FileAccess.Read, - FileShare.Read - ) - }; - - var data = new SignatureRequestCreateEmbeddedRequest( - clientId: "ec64a202072370a737edf4a0eb7f4437", - title: "NDA with Acme Co.", - subject: "The NDA we talked about", - message: "Please sign this NDA and then we can discuss more. Let me know if you have any questions.", - signers: new List(){signer1, signer2}, - ccEmailAddresses: new List(){"lawyer1@dropboxsign.com", "lawyer2@dropboxsign.com"}, - files: files, - signingOptions: signingOptions, - testMode: true - ); - - try - { - var result = signatureRequestApi.SignatureRequestCreateEmbedded(data); - Console.WriteLine(result); - } - catch (ApiException e) - { - Console.WriteLine("Exception when calling Dropbox Sign API: " + e.Message); - Console.WriteLine("Status Code: " + e.ErrorCode); - Console.WriteLine(e.StackTrace); - } - } -} diff --git a/examples/SignatureRequestCreateEmbeddedExample.cs b/examples/SignatureRequestCreateEmbeddedExample.cs new file mode 100644 index 0000000..7f9786c --- /dev/null +++ b/examples/SignatureRequestCreateEmbeddedExample.cs @@ -0,0 +1,82 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Text.Json; + +using Dropbox.Sign.Api; +using Dropbox.Sign.Client; +using Dropbox.Sign.Model; + +namespace Dropbox.SignSandbox; + +public class SignatureRequestCreateEmbeddedExample +{ + public static void Run() + { + var config = new Configuration(); + config.Username = "YOUR_API_KEY"; + // config.AccessToken = "YOUR_ACCESS_TOKEN"; + + var signingOptions = new SubSigningOptions( + defaultType: SubSigningOptions.DefaultTypeEnum.Draw, + draw: true, + phone: false, + type: true, + upload: true + ); + + var signers1 = new SubSignatureRequestSigner( + name: "Jack", + emailAddress: "jack@example.com", + order: 0 + ); + + var signers2 = new SubSignatureRequestSigner( + name: "Jill", + emailAddress: "jill@example.com", + order: 1 + ); + + var signers = new List + { + signers1, + signers2, + }; + + var signatureRequestCreateEmbeddedRequest = new SignatureRequestCreateEmbeddedRequest( + clientId: "b6b8e7deaf8f0b95c029dca049356d4a2cf9710a", + message: "Please sign this NDA and then we can discuss more. Let me know if you\nhave any questions.", + subject: "The NDA we talked about", + testMode: true, + title: "NDA with Acme Co.", + ccEmailAddresses: [ + "lawyer1@dropboxsign.com", + "lawyer2@dropboxsign.com", + ], + files: new List + { + new FileStream( + path: "./example_signature_request.pdf", + mode: FileMode.Open + ), + }, + signingOptions: signingOptions, + signers: signers + ); + + try + { + var response = new SignatureRequestApi(config).SignatureRequestCreateEmbedded( + signatureRequestCreateEmbeddedRequest: signatureRequestCreateEmbeddedRequest + ); + + Console.WriteLine(response); + } + catch (ApiException e) + { + Console.WriteLine("Exception when calling SignatureRequestApi#SignatureRequestCreateEmbedded: " + e.Message); + Console.WriteLine("Status Code: " + e.ErrorCode); + Console.WriteLine(e.StackTrace); + } + } +} diff --git a/examples/SignatureRequestCreateEmbeddedGroupedSignersExample.cs b/examples/SignatureRequestCreateEmbeddedGroupedSignersExample.cs new file mode 100644 index 0000000..40cbcbc --- /dev/null +++ b/examples/SignatureRequestCreateEmbeddedGroupedSignersExample.cs @@ -0,0 +1,110 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Text.Json; + +using Dropbox.Sign.Api; +using Dropbox.Sign.Client; +using Dropbox.Sign.Model; + +namespace Dropbox.SignSandbox; + +public class SignatureRequestCreateEmbeddedGroupedSignersExample +{ + public static void Run() + { + var config = new Configuration(); + config.Username = "YOUR_API_KEY"; + // config.AccessToken = "YOUR_ACCESS_TOKEN"; + + var groupedSigners2Signers1 = new SubSignatureRequestSigner( + name: "Bob", + emailAddress: "bob@example.com" + ); + + var groupedSigners2Signers2 = new SubSignatureRequestSigner( + name: "Charlie", + emailAddress: "charlie@example.com" + ); + + var groupedSigners2Signers = new List + { + groupedSigners2Signers1, + groupedSigners2Signers2, + }; + + var groupedSigners1Signers1 = new SubSignatureRequestSigner( + name: "Jack", + emailAddress: "jack@example.com" + ); + + var groupedSigners1Signers2 = new SubSignatureRequestSigner( + name: "Jill", + emailAddress: "jill@example.com" + ); + + var groupedSigners1Signers = new List + { + groupedSigners1Signers1, + groupedSigners1Signers2, + }; + + var signingOptions = new SubSigningOptions( + defaultType: SubSigningOptions.DefaultTypeEnum.Draw, + draw: true, + phone: false, + type: true, + upload: true + ); + + var groupedSigners1 = new SubSignatureRequestGroupedSigners( + group: "Group #1", + order: 0, + signers: groupedSigners1Signers + ); + + var groupedSigners2 = new SubSignatureRequestGroupedSigners( + group: "Group #2", + order: 1, + signers: groupedSigners2Signers + ); + + var groupedSigners = new List + { + groupedSigners1, + groupedSigners2, + }; + + var signatureRequestCreateEmbeddedRequest = new SignatureRequestCreateEmbeddedRequest( + clientId: "b6b8e7deaf8f0b95c029dca049356d4a2cf9710a", + message: "Please sign this NDA and then we can discuss more. Let me know if you\nhave any questions.", + subject: "The NDA we talked about", + testMode: true, + title: "NDA with Acme Co.", + fileUrls: [ + "https://www.dropbox.com/s/ad9qnhbrjjn64tu/mutual-NDA-example.pdf?dl=1", + ], + ccEmailAddresses: [ + "lawyer1@dropboxsign.com", + "lawyer2@dropboxsign.com", + ], + signingOptions: signingOptions, + groupedSigners: groupedSigners + ); + + try + { + var response = new SignatureRequestApi(config).SignatureRequestCreateEmbedded( + signatureRequestCreateEmbeddedRequest: signatureRequestCreateEmbeddedRequest + ); + + Console.WriteLine(response); + } + catch (ApiException e) + { + Console.WriteLine("Exception when calling SignatureRequestApi#SignatureRequestCreateEmbedded: " + e.Message); + Console.WriteLine("Status Code: " + e.ErrorCode); + Console.WriteLine(e.StackTrace); + } + } +} diff --git a/examples/SignatureRequestCreateEmbeddedWithTemplate.cs b/examples/SignatureRequestCreateEmbeddedWithTemplate.cs deleted file mode 100644 index ff9da4a..0000000 --- a/examples/SignatureRequestCreateEmbeddedWithTemplate.cs +++ /dev/null @@ -1,55 +0,0 @@ -using System; -using System.Collections.Generic; -using Dropbox.Sign.Api; -using Dropbox.Sign.Client; -using Dropbox.Sign.Model; - -public class Example -{ - public static void Main() - { - var config = new Configuration(); - // Configure HTTP basic authorization: api_key - config.Username = "YOUR_API_KEY"; - - // or, configure Bearer (JWT) authorization: oauth2 - // config.AccessToken = "YOUR_BEARER_TOKEN"; - - var signatureRequestApi = new SignatureRequestApi(config); - - var signer1 = new SubSignatureRequestTemplateSigner( - role: "Client", - name: "George" - ); - - var subSigningOptions = new SubSigningOptions( - draw: true, - type: true, - upload: true, - phone: false, - defaultType: SubSigningOptions.DefaultTypeEnum.Draw - ); - - var data = new SignatureRequestCreateEmbeddedWithTemplateRequest( - clientId: "ec64a202072370a737edf4a0eb7f4437", - templateIds: new List(){"c26b8a16784a872da37ea946b9ddec7c1e11dff6"}, - subject: "Purchase Order", - message: "Glad we could come to an agreement.", - signers: new List(){signer1}, - signingOptions: subSigningOptions, - testMode: true - ); - - try - { - var result = signatureRequestApi.SignatureRequestCreateEmbeddedWithTemplate(data); - Console.WriteLine(result); - } - catch (ApiException e) - { - Console.WriteLine("Exception when calling Dropbox Sign API: " + e.Message); - Console.WriteLine("Status Code: " + e.ErrorCode); - Console.WriteLine(e.StackTrace); - } - } -} diff --git a/examples/SignatureRequestCreateEmbeddedWithTemplateExample.cs b/examples/SignatureRequestCreateEmbeddedWithTemplateExample.cs new file mode 100644 index 0000000..d40f342 --- /dev/null +++ b/examples/SignatureRequestCreateEmbeddedWithTemplateExample.cs @@ -0,0 +1,66 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Text.Json; + +using Dropbox.Sign.Api; +using Dropbox.Sign.Client; +using Dropbox.Sign.Model; + +namespace Dropbox.SignSandbox; + +public class SignatureRequestCreateEmbeddedWithTemplateExample +{ + public static void Run() + { + var config = new Configuration(); + config.Username = "YOUR_API_KEY"; + // config.AccessToken = "YOUR_ACCESS_TOKEN"; + + var signingOptions = new SubSigningOptions( + defaultType: SubSigningOptions.DefaultTypeEnum.Draw, + draw: true, + phone: false, + type: true, + upload: true + ); + + var signers1 = new SubSignatureRequestTemplateSigner( + role: "Client", + name: "George", + emailAddress: "george@example.com" + ); + + var signers = new List + { + signers1, + }; + + var signatureRequestCreateEmbeddedWithTemplateRequest = new SignatureRequestCreateEmbeddedWithTemplateRequest( + clientId: "b6b8e7deaf8f0b95c029dca049356d4a2cf9710a", + templateIds: [ + "c26b8a16784a872da37ea946b9ddec7c1e11dff6", + ], + message: "Glad we could come to an agreement.", + subject: "Purchase Order", + testMode: true, + signingOptions: signingOptions, + signers: signers + ); + + try + { + var response = new SignatureRequestApi(config).SignatureRequestCreateEmbeddedWithTemplate( + signatureRequestCreateEmbeddedWithTemplateRequest: signatureRequestCreateEmbeddedWithTemplateRequest + ); + + Console.WriteLine(response); + } + catch (ApiException e) + { + Console.WriteLine("Exception when calling SignatureRequestApi#SignatureRequestCreateEmbeddedWithTemplate: " + e.Message); + Console.WriteLine("Status Code: " + e.ErrorCode); + Console.WriteLine(e.StackTrace); + } + } +} diff --git a/examples/SignatureRequestEdit.cs b/examples/SignatureRequestEdit.cs deleted file mode 100644 index 02c197f..0000000 --- a/examples/SignatureRequestEdit.cs +++ /dev/null @@ -1,87 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using Dropbox.Sign.Api; -using Dropbox.Sign.Client; -using Dropbox.Sign.Model; - -public class Example -{ - public static void Main() - { - var config = new Configuration(); - // Configure HTTP basic authorization: api_key - config.Username = "YOUR_API_KEY"; - - // or, configure Bearer (JWT) authorization: oauth2 - // config.AccessToken = "YOUR_BEARER_TOKEN"; - - var signatureRequestApi = new SignatureRequestApi(config); - - var signer1 = new SubSignatureRequestSigner( - emailAddress: "jack@example.com", - name: "Jack", - order: 0 - ); - - var signer2 = new SubSignatureRequestSigner( - emailAddress: "jill@example.com", - name: "Jill", - order: 1 - ); - - var signingOptions = new SubSigningOptions( - draw: true, - type: true, - upload: true, - phone: true, - defaultType: SubSigningOptions.DefaultTypeEnum.Draw - ); - - var subFieldOptions = new SubFieldOptions( - dateFormat: SubFieldOptions.DateFormatEnum.DDMMYYYY - ); - - var metadata = new Dictionary() - { - ["custom_id"] = 1234, - ["custom_text"] = "NDA #9" - }; - - var files = new List { - new FileStream( - "./example_signature_request.pdf", - FileMode.Open, - FileAccess.Read, - FileShare.Read - ) - }; - - var data = new SignatureRequestEditRequest( - title: "NDA with Acme Co.", - subject: "The NDA we talked about", - message: "Please sign this NDA and then we can discuss more. Let me know if you have any questions.", - signers: new List(){signer1, signer2}, - ccEmailAddresses: new List(){"lawyer1@dropboxsign.com", "lawyer2@dropboxsign.com"}, - files: files, - metadata: metadata, - signingOptions: signingOptions, - fieldOptions: subFieldOptions, - testMode: true - ); - - var signatureRequestId = "2f9781e1a8e2045224d808c153c2e1d3df6f8f2f"; - - try - { - var result = signatureRequestApi.SignatureRequestEdit(signatureRequestId, data); - Console.WriteLine(result); - } - catch (ApiException e) - { - Console.WriteLine("Exception when calling Dropbox Sign API: " + e.Message); - Console.WriteLine("Status Code: " + e.ErrorCode); - Console.WriteLine(e.StackTrace); - } - } -} diff --git a/examples/SignatureRequestEditEmbedded.cs b/examples/SignatureRequestEditEmbedded.cs deleted file mode 100644 index 87d7d73..0000000 --- a/examples/SignatureRequestEditEmbedded.cs +++ /dev/null @@ -1,79 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using Dropbox.Sign.Api; -using Dropbox.Sign.Client; -using Dropbox.Sign.Model; - -public class Example -{ - public static void Main() - { - var config = new Configuration(); - // Configure HTTP basic authorization: api_key - config.Username = "YOUR_API_KEY"; - - // or, configure Bearer (JWT) authorization: oauth2 - // config.AccessToken = "YOUR_BEARER_TOKEN"; - - var signatureRequestApi = new SignatureRequestApi(config); - - var signer1 = new SubSignatureRequestSigner( - emailAddress: "jack@example.com", - name: "Jack", - order: 0 - ); - - var signer2 = new SubSignatureRequestSigner( - emailAddress: "jill@example.com", - name: "Jill", - order: 1 - ); - - var signingOptions = new SubSigningOptions( - draw: true, - type: true, - upload: true, - phone: true, - defaultType: SubSigningOptions.DefaultTypeEnum.Draw - ); - - var files = new List { - new FileStream( - "./example_signature_request.pdf", - FileMode.Open, - FileAccess.Read, - FileShare.Read - ) - }; - - var data = new SignatureRequestEditEmbeddedRequest( - clientId: "ec64a202072370a737edf4a0eb7f4437", - title: "NDA with Acme Co.", - subject: "The NDA we talked about", - message: "Please sign this NDA and then we can discuss more. Let me know if you have any questions.", - signers: new List(){signer1, signer2}, - ccEmailAddresses: new List(){"lawyer1@dropboxsign.com", "lawyer2@dropboxsign.com"}, - files: files, - signingOptions: signingOptions, - testMode: true - ); - - var signatureRequestId = "2f9781e1a8e2045224d808c153c2e1d3df6f8f2f"; - - try - { - var result = signatureRequestApi.SignatureRequestEditEmbedded( - signatureRequestId, - data - ); - Console.WriteLine(result); - } - catch (ApiException e) - { - Console.WriteLine("Exception when calling Dropbox Sign API: " + e.Message); - Console.WriteLine("Status Code: " + e.ErrorCode); - Console.WriteLine(e.StackTrace); - } - } -} diff --git a/examples/SignatureRequestEditEmbeddedExample.cs b/examples/SignatureRequestEditEmbeddedExample.cs new file mode 100644 index 0000000..356603b --- /dev/null +++ b/examples/SignatureRequestEditEmbeddedExample.cs @@ -0,0 +1,83 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Text.Json; + +using Dropbox.Sign.Api; +using Dropbox.Sign.Client; +using Dropbox.Sign.Model; + +namespace Dropbox.SignSandbox; + +public class SignatureRequestEditEmbeddedExample +{ + public static void Run() + { + var config = new Configuration(); + config.Username = "YOUR_API_KEY"; + // config.AccessToken = "YOUR_ACCESS_TOKEN"; + + var signingOptions = new SubSigningOptions( + defaultType: SubSigningOptions.DefaultTypeEnum.Draw, + draw: true, + phone: false, + type: true, + upload: true + ); + + var signers1 = new SubSignatureRequestSigner( + name: "Jack", + emailAddress: "jack@example.com", + order: 0 + ); + + var signers2 = new SubSignatureRequestSigner( + name: "Jill", + emailAddress: "jill@example.com", + order: 1 + ); + + var signers = new List + { + signers1, + signers2, + }; + + var signatureRequestEditEmbeddedRequest = new SignatureRequestEditEmbeddedRequest( + clientId: "b6b8e7deaf8f0b95c029dca049356d4a2cf9710a", + message: "Please sign this NDA and then we can discuss more. Let me know if you\nhave any questions.", + subject: "The NDA we talked about", + testMode: true, + title: "NDA with Acme Co.", + ccEmailAddresses: [ + "lawyer1@dropboxsign.com", + "lawyer2@dropboxsign.com", + ], + files: new List + { + new FileStream( + path: "./example_signature_request.pdf", + mode: FileMode.Open + ), + }, + signingOptions: signingOptions, + signers: signers + ); + + try + { + var response = new SignatureRequestApi(config).SignatureRequestEditEmbedded( + signatureRequestId: "fa5c8a0b0f492d768749333ad6fcc214c111e967", + signatureRequestEditEmbeddedRequest: signatureRequestEditEmbeddedRequest + ); + + Console.WriteLine(response); + } + catch (ApiException e) + { + Console.WriteLine("Exception when calling SignatureRequestApi#SignatureRequestEditEmbedded: " + e.Message); + Console.WriteLine("Status Code: " + e.ErrorCode); + Console.WriteLine(e.StackTrace); + } + } +} diff --git a/examples/SignatureRequestEditEmbeddedGroupedSignersExample.cs b/examples/SignatureRequestEditEmbeddedGroupedSignersExample.cs new file mode 100644 index 0000000..3be9c81 --- /dev/null +++ b/examples/SignatureRequestEditEmbeddedGroupedSignersExample.cs @@ -0,0 +1,111 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Text.Json; + +using Dropbox.Sign.Api; +using Dropbox.Sign.Client; +using Dropbox.Sign.Model; + +namespace Dropbox.SignSandbox; + +public class SignatureRequestEditEmbeddedGroupedSignersExample +{ + public static void Run() + { + var config = new Configuration(); + config.Username = "YOUR_API_KEY"; + // config.AccessToken = "YOUR_ACCESS_TOKEN"; + + var groupedSigners2Signers1 = new SubSignatureRequestSigner( + name: "Bob", + emailAddress: "bob@example.com" + ); + + var groupedSigners2Signers2 = new SubSignatureRequestSigner( + name: "Charlie", + emailAddress: "charlie@example.com" + ); + + var groupedSigners2Signers = new List + { + groupedSigners2Signers1, + groupedSigners2Signers2, + }; + + var groupedSigners1Signers1 = new SubSignatureRequestSigner( + name: "Jack", + emailAddress: "jack@example.com" + ); + + var groupedSigners1Signers2 = new SubSignatureRequestSigner( + name: "Jill", + emailAddress: "jill@example.com" + ); + + var groupedSigners1Signers = new List + { + groupedSigners1Signers1, + groupedSigners1Signers2, + }; + + var signingOptions = new SubSigningOptions( + defaultType: SubSigningOptions.DefaultTypeEnum.Draw, + draw: true, + phone: false, + type: true, + upload: true + ); + + var groupedSigners1 = new SubSignatureRequestGroupedSigners( + group: "Group #1", + order: 0, + signers: groupedSigners1Signers + ); + + var groupedSigners2 = new SubSignatureRequestGroupedSigners( + group: "Group #2", + order: 1, + signers: groupedSigners2Signers + ); + + var groupedSigners = new List + { + groupedSigners1, + groupedSigners2, + }; + + var signatureRequestEditEmbeddedRequest = new SignatureRequestEditEmbeddedRequest( + clientId: "b6b8e7deaf8f0b95c029dca049356d4a2cf9710a", + message: "Please sign this NDA and then we can discuss more. Let me know if you\nhave any questions.", + subject: "The NDA we talked about", + testMode: true, + title: "NDA with Acme Co.", + fileUrls: [ + "https://www.dropbox.com/s/ad9qnhbrjjn64tu/mutual-NDA-example.pdf?dl=1", + ], + ccEmailAddresses: [ + "lawyer1@dropboxsign.com", + "lawyer2@dropboxsign.com", + ], + signingOptions: signingOptions, + groupedSigners: groupedSigners + ); + + try + { + var response = new SignatureRequestApi(config).SignatureRequestEditEmbedded( + signatureRequestId: "fa5c8a0b0f492d768749333ad6fcc214c111e967", + signatureRequestEditEmbeddedRequest: signatureRequestEditEmbeddedRequest + ); + + Console.WriteLine(response); + } + catch (ApiException e) + { + Console.WriteLine("Exception when calling SignatureRequestApi#SignatureRequestEditEmbedded: " + e.Message); + Console.WriteLine("Status Code: " + e.ErrorCode); + Console.WriteLine(e.StackTrace); + } + } +} diff --git a/examples/SignatureRequestEditEmbeddedWithTemplate.cs b/examples/SignatureRequestEditEmbeddedWithTemplate.cs deleted file mode 100644 index 12a591d..0000000 --- a/examples/SignatureRequestEditEmbeddedWithTemplate.cs +++ /dev/null @@ -1,60 +0,0 @@ -using System; -using System.Collections.Generic; -using Dropbox.Sign.Api; -using Dropbox.Sign.Client; -using Dropbox.Sign.Model; - -public class Example -{ - public static void Main() - { - var config = new Configuration(); - // Configure HTTP basic authorization: api_key - config.Username = "YOUR_API_KEY"; - - // or, configure Bearer (JWT) authorization: oauth2 - // config.AccessToken = "YOUR_BEARER_TOKEN"; - - var signatureRequestApi = new SignatureRequestApi(config); - - var signer1 = new SubSignatureRequestTemplateSigner( - role: "Client", - name: "George" - ); - - var subSigningOptions = new SubSigningOptions( - draw: true, - type: true, - upload: true, - phone: false, - defaultType: SubSigningOptions.DefaultTypeEnum.Draw - ); - - var data = new SignatureRequestEditEmbeddedWithTemplateRequest( - clientId: "ec64a202072370a737edf4a0eb7f4437", - templateIds: new List(){"c26b8a16784a872da37ea946b9ddec7c1e11dff6"}, - subject: "Purchase Order", - message: "Glad we could come to an agreement.", - signers: new List(){signer1}, - signingOptions: subSigningOptions, - testMode: true - ); - - var signatureRequestId = "2f9781e1a8e2045224d808c153c2e1d3df6f8f2f"; - - try - { - var result = signatureRequestApi.SignatureRequestEditEmbeddedWithTemplate( - signatureRequestId, - data - ); - Console.WriteLine(result); - } - catch (ApiException e) - { - Console.WriteLine("Exception when calling Dropbox Sign API: " + e.Message); - Console.WriteLine("Status Code: " + e.ErrorCode); - Console.WriteLine(e.StackTrace); - } - } -} diff --git a/examples/SignatureRequestEditEmbeddedWithTemplateExample.cs b/examples/SignatureRequestEditEmbeddedWithTemplateExample.cs new file mode 100644 index 0000000..fff755e --- /dev/null +++ b/examples/SignatureRequestEditEmbeddedWithTemplateExample.cs @@ -0,0 +1,67 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Text.Json; + +using Dropbox.Sign.Api; +using Dropbox.Sign.Client; +using Dropbox.Sign.Model; + +namespace Dropbox.SignSandbox; + +public class SignatureRequestEditEmbeddedWithTemplateExample +{ + public static void Run() + { + var config = new Configuration(); + config.Username = "YOUR_API_KEY"; + // config.AccessToken = "YOUR_ACCESS_TOKEN"; + + var signingOptions = new SubSigningOptions( + defaultType: SubSigningOptions.DefaultTypeEnum.Draw, + draw: true, + phone: false, + type: true, + upload: true + ); + + var signers1 = new SubSignatureRequestTemplateSigner( + role: "Client", + name: "George", + emailAddress: "george@example.com" + ); + + var signers = new List + { + signers1, + }; + + var signatureRequestEditEmbeddedWithTemplateRequest = new SignatureRequestEditEmbeddedWithTemplateRequest( + clientId: "b6b8e7deaf8f0b95c029dca049356d4a2cf9710a", + templateIds: [ + "c26b8a16784a872da37ea946b9ddec7c1e11dff6", + ], + message: "Glad we could come to an agreement.", + subject: "Purchase Order", + testMode: true, + signingOptions: signingOptions, + signers: signers + ); + + try + { + var response = new SignatureRequestApi(config).SignatureRequestEditEmbeddedWithTemplate( + signatureRequestId: "fa5c8a0b0f492d768749333ad6fcc214c111e967", + signatureRequestEditEmbeddedWithTemplateRequest: signatureRequestEditEmbeddedWithTemplateRequest + ); + + Console.WriteLine(response); + } + catch (ApiException e) + { + Console.WriteLine("Exception when calling SignatureRequestApi#SignatureRequestEditEmbeddedWithTemplate: " + e.Message); + Console.WriteLine("Status Code: " + e.ErrorCode); + Console.WriteLine(e.StackTrace); + } + } +} diff --git a/examples/SignatureRequestEditExample.cs b/examples/SignatureRequestEditExample.cs new file mode 100644 index 0000000..b3542b7 --- /dev/null +++ b/examples/SignatureRequestEditExample.cs @@ -0,0 +1,93 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Text.Json; + +using Dropbox.Sign.Api; +using Dropbox.Sign.Client; +using Dropbox.Sign.Model; + +namespace Dropbox.SignSandbox; + +public class SignatureRequestEditExample +{ + public static void Run() + { + var config = new Configuration(); + config.Username = "YOUR_API_KEY"; + // config.AccessToken = "YOUR_ACCESS_TOKEN"; + + var fieldOptions = new SubFieldOptions( + dateFormat: SubFieldOptions.DateFormatEnum.DD_MM_YYYY + ); + + var signingOptions = new SubSigningOptions( + defaultType: SubSigningOptions.DefaultTypeEnum.Draw, + draw: true, + phone: false, + type: true, + upload: true + ); + + var signers1 = new SubSignatureRequestSigner( + name: "Jack", + emailAddress: "jack@example.com", + order: 0 + ); + + var signers2 = new SubSignatureRequestSigner( + name: "Jill", + emailAddress: "jill@example.com", + order: 1 + ); + + var signers = new List + { + signers1, + signers2, + }; + + var signatureRequestEditRequest = new SignatureRequestEditRequest( + message: "Please sign this NDA and then we can discuss more. Let me know if you\nhave any questions.", + subject: "The NDA we talked about", + testMode: true, + title: "NDA with Acme Co.", + ccEmailAddresses: [ + "lawyer1@dropboxsign.com", + "lawyer2@dropboxsign.com", + ], + files: new List + { + new FileStream( + path: "./example_signature_request.pdf", + mode: FileMode.Open + ), + }, + metadata: JsonSerializer.Deserialize>(""" + { + "custom_id": 1234, + "custom_text": "NDA #9" + } + """), + fieldOptions: fieldOptions, + signingOptions: signingOptions, + signers: signers + ); + + try + { + var response = new SignatureRequestApi(config).SignatureRequestEdit( + signatureRequestId: "fa5c8a0b0f492d768749333ad6fcc214c111e967", + signatureRequestEditRequest: signatureRequestEditRequest + ); + + Console.WriteLine(response); + } + catch (ApiException e) + { + Console.WriteLine("Exception when calling SignatureRequestApi#SignatureRequestEdit: " + e.Message); + Console.WriteLine("Status Code: " + e.ErrorCode); + Console.WriteLine(e.StackTrace); + } + } +} diff --git a/examples/SignatureRequestEditGroupedSignersExample.cs b/examples/SignatureRequestEditGroupedSignersExample.cs new file mode 100644 index 0000000..35a41af --- /dev/null +++ b/examples/SignatureRequestEditGroupedSignersExample.cs @@ -0,0 +1,121 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Text.Json; + +using Dropbox.Sign.Api; +using Dropbox.Sign.Client; +using Dropbox.Sign.Model; + +namespace Dropbox.SignSandbox; + +public class SignatureRequestEditGroupedSignersExample +{ + public static void Run() + { + var config = new Configuration(); + config.Username = "YOUR_API_KEY"; + // config.AccessToken = "YOUR_ACCESS_TOKEN"; + + var groupedSigners2Signers1 = new SubSignatureRequestSigner( + name: "Bob", + emailAddress: "bob@example.com" + ); + + var groupedSigners2Signers2 = new SubSignatureRequestSigner( + name: "Charlie", + emailAddress: "charlie@example.com" + ); + + var groupedSigners2Signers = new List + { + groupedSigners2Signers1, + groupedSigners2Signers2, + }; + + var groupedSigners1Signers1 = new SubSignatureRequestSigner( + name: "Jack", + emailAddress: "jack@example.com" + ); + + var groupedSigners1Signers2 = new SubSignatureRequestSigner( + name: "Jill", + emailAddress: "jill@example.com" + ); + + var groupedSigners1Signers = new List + { + groupedSigners1Signers1, + groupedSigners1Signers2, + }; + + var fieldOptions = new SubFieldOptions( + dateFormat: SubFieldOptions.DateFormatEnum.DD_MM_YYYY + ); + + var signingOptions = new SubSigningOptions( + defaultType: SubSigningOptions.DefaultTypeEnum.Draw, + draw: true, + phone: false, + type: true, + upload: true + ); + + var groupedSigners1 = new SubSignatureRequestGroupedSigners( + group: "Group #1", + order: 0, + signers: groupedSigners1Signers + ); + + var groupedSigners2 = new SubSignatureRequestGroupedSigners( + group: "Group #2", + order: 1, + signers: groupedSigners2Signers + ); + + var groupedSigners = new List + { + groupedSigners1, + groupedSigners2, + }; + + var signatureRequestEditRequest = new SignatureRequestEditRequest( + message: "Please sign this NDA and then we can discuss more. Let me know if you\nhave any questions.", + subject: "The NDA we talked about", + testMode: true, + title: "NDA with Acme Co.", + fileUrls: [ + "https://www.dropbox.com/s/ad9qnhbrjjn64tu/mutual-NDA-example.pdf?dl=1", + ], + ccEmailAddresses: [ + "lawyer1@dropboxsign.com", + "lawyer2@dropboxsign.com", + ], + metadata: JsonSerializer.Deserialize>(""" + { + "custom_id": 1234, + "custom_text": "NDA #9" + } + """), + fieldOptions: fieldOptions, + signingOptions: signingOptions, + groupedSigners: groupedSigners + ); + + try + { + var response = new SignatureRequestApi(config).SignatureRequestEdit( + signatureRequestId: "fa5c8a0b0f492d768749333ad6fcc214c111e967", + signatureRequestEditRequest: signatureRequestEditRequest + ); + + Console.WriteLine(response); + } + catch (ApiException e) + { + Console.WriteLine("Exception when calling SignatureRequestApi#SignatureRequestEdit: " + e.Message); + Console.WriteLine("Status Code: " + e.ErrorCode); + Console.WriteLine(e.StackTrace); + } + } +} diff --git a/examples/SignatureRequestEditWithTemplate.cs b/examples/SignatureRequestEditWithTemplate.cs deleted file mode 100644 index 22038ee..0000000 --- a/examples/SignatureRequestEditWithTemplate.cs +++ /dev/null @@ -1,71 +0,0 @@ -using System; -using System.Collections.Generic; -using Dropbox.Sign.Api; -using Dropbox.Sign.Client; -using Dropbox.Sign.Model; - -public class Example -{ - public static void Main() - { - var config = new Configuration(); - // Configure HTTP basic authorization: api_key - config.Username = "YOUR_API_KEY"; - - // or, configure Bearer (JWT) authorization: oauth2 - // config.AccessToken = "YOUR_BEARER_TOKEN"; - - var signatureRequestApi = new SignatureRequestApi(config); - - var signer1 = new SubSignatureRequestTemplateSigner( - role: "Client", - emailAddress: "george@example.com", - name: "George" - ); - - var cc1 = new SubCC( - role: "Accounting", - emailAddress: "accouting@emaple.com" - ); - - var customField1 = new SubCustomField( - name: "Cost", - value: "$20,000", - editor: "Client", - required: true - ); - - var signingOptions = new SubSigningOptions( - draw: true, - type: true, - upload: true, - phone: false, - defaultType: SubSigningOptions.DefaultTypeEnum.Draw - ); - - var data = new SignatureRequestEditWithTemplateRequest( - templateIds: new List(){"c26b8a16784a872da37ea946b9ddec7c1e11dff6"}, - subject: "Purchase Order", - message: "Glad we could come to an agreement.", - signers: new List(){signer1}, - ccs: new List(){cc1}, - customFields: new List(){customField1}, - signingOptions: signingOptions, - testMode: true - ); - - var signatureRequestId = "2f9781e1a8e2045224d808c153c2e1d3df6f8f2f"; - - try - { - var result = signatureRequestApi.SignatureRequestEditWithTemplate(signatureRequestId, data); - Console.WriteLine(result); - } - catch (ApiException e) - { - Console.WriteLine("Exception when calling Dropbox Sign API: " + e.Message); - Console.WriteLine("Status Code: " + e.ErrorCode); - Console.WriteLine(e.StackTrace); - } - } -} diff --git a/examples/SignatureRequestEditWithTemplateExample.cs b/examples/SignatureRequestEditWithTemplateExample.cs new file mode 100644 index 0000000..172f24b --- /dev/null +++ b/examples/SignatureRequestEditWithTemplateExample.cs @@ -0,0 +1,90 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Text.Json; + +using Dropbox.Sign.Api; +using Dropbox.Sign.Client; +using Dropbox.Sign.Model; + +namespace Dropbox.SignSandbox; + +public class SignatureRequestEditWithTemplateExample +{ + public static void Run() + { + var config = new Configuration(); + config.Username = "YOUR_API_KEY"; + // config.AccessToken = "YOUR_ACCESS_TOKEN"; + + var signingOptions = new SubSigningOptions( + defaultType: SubSigningOptions.DefaultTypeEnum.Draw, + draw: true, + phone: false, + type: true, + upload: true + ); + + var signers1 = new SubSignatureRequestTemplateSigner( + role: "Client", + name: "George", + emailAddress: "george@example.com" + ); + + var signers = new List + { + signers1, + }; + + var ccs1 = new SubCC( + role: "Accounting", + emailAddress: "accounting@example.com" + ); + + var ccs = new List + { + ccs1, + }; + + var customFields1 = new SubCustomField( + name: "Cost", + editor: "Client", + required: true, + value: "$20,000" + ); + + var customFields = new List + { + customFields1, + }; + + var signatureRequestEditWithTemplateRequest = new SignatureRequestEditWithTemplateRequest( + templateIds: [ + "61a832ff0d8423f91d503e76bfbcc750f7417c78", + ], + message: "Glad we could come to an agreement.", + subject: "Purchase Order", + testMode: true, + signingOptions: signingOptions, + signers: signers, + ccs: ccs, + customFields: customFields + ); + + try + { + var response = new SignatureRequestApi(config).SignatureRequestEditWithTemplate( + signatureRequestId: "fa5c8a0b0f492d768749333ad6fcc214c111e967", + signatureRequestEditWithTemplateRequest: signatureRequestEditWithTemplateRequest + ); + + Console.WriteLine(response); + } + catch (ApiException e) + { + Console.WriteLine("Exception when calling SignatureRequestApi#SignatureRequestEditWithTemplate: " + e.Message); + Console.WriteLine("Status Code: " + e.ErrorCode); + Console.WriteLine(e.StackTrace); + } + } +} diff --git a/examples/SignatureRequestFiles.cs b/examples/SignatureRequestFiles.cs deleted file mode 100644 index d9ceb40..0000000 --- a/examples/SignatureRequestFiles.cs +++ /dev/null @@ -1,38 +0,0 @@ -using System; -using System.Collections.Generic; -using Dropbox.Sign.Api; -using Dropbox.Sign.Client; -using Dropbox.Sign.Model; - -public class Example -{ - public static void Main() - { - var config = new Configuration(); - // Configure HTTP basic authorization: api_key - config.Username = "YOUR_API_KEY"; - - // or, configure Bearer (JWT) authorization: oauth2 - // config.AccessToken = "YOUR_BEARER_TOKEN"; - - var signatureRequestApi = new SignatureRequestApi(config); - - var signatureRequestId = "fa5c8a0b0f492d768749333ad6fcc214c111e967"; - - try - { - var result = signatureRequestApi.SignatureRequestFiles(signatureRequestId, "pdf"); - - var fileStream = File.Create("file_response.pdf"); - result.Seek(0, SeekOrigin.Begin); - result.CopyTo(fileStream); - fileStream.Close(); - } - catch (ApiException e) - { - Console.WriteLine("Exception when calling Dropbox Sign API: " + e.Message); - Console.WriteLine("Status Code: " + e.ErrorCode); - Console.WriteLine(e.StackTrace); - } - } -} diff --git a/examples/SignatureRequestFilesAsDataUri.cs b/examples/SignatureRequestFilesAsDataUri.cs deleted file mode 100644 index 5ca7ca5..0000000 --- a/examples/SignatureRequestFilesAsDataUri.cs +++ /dev/null @@ -1,34 +0,0 @@ -using System; -using System.Collections.Generic; -using Dropbox.Sign.Api; -using Dropbox.Sign.Client; -using Dropbox.Sign.Model; - -public class Example -{ - public static void Main() - { - var config = new Configuration(); - // Configure HTTP basic authorization: api_key - config.Username = "YOUR_API_KEY"; - - // or, configure Bearer (JWT) authorization: oauth2 - // config.AccessToken = "YOUR_BEARER_TOKEN"; - - var signatureRequestApi = new SignatureRequestApi(config); - - var signatureRequestId = "fa5c8a0b0f492d768749333ad6fcc214c111e967"; - - try - { - var result = signatureRequestApi.SignatureRequestFilesAsDataUri(signatureRequestId); - Console.WriteLine(result); - } - catch (ApiException e) - { - Console.WriteLine("Exception when calling Dropbox Sign API: " + e.Message); - Console.WriteLine("Status Code: " + e.ErrorCode); - Console.WriteLine(e.StackTrace); - } - } -} diff --git a/examples/SignatureRequestFilesAsDataUriExample.cs b/examples/SignatureRequestFilesAsDataUriExample.cs new file mode 100644 index 0000000..60f8370 --- /dev/null +++ b/examples/SignatureRequestFilesAsDataUriExample.cs @@ -0,0 +1,35 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Text.Json; + +using Dropbox.Sign.Api; +using Dropbox.Sign.Client; +using Dropbox.Sign.Model; + +namespace Dropbox.SignSandbox; + +public class SignatureRequestFilesAsDataUriExample +{ + public static void Run() + { + var config = new Configuration(); + config.Username = "YOUR_API_KEY"; + // config.AccessToken = "YOUR_ACCESS_TOKEN"; + + try + { + var response = new SignatureRequestApi(config).SignatureRequestFilesAsDataUri( + signatureRequestId: "fa5c8a0b0f492d768749333ad6fcc214c111e967" + ); + + Console.WriteLine(response); + } + catch (ApiException e) + { + Console.WriteLine("Exception when calling SignatureRequestApi#SignatureRequestFilesAsDataUri: " + e.Message); + Console.WriteLine("Status Code: " + e.ErrorCode); + Console.WriteLine(e.StackTrace); + } + } +} diff --git a/examples/SignatureRequestFilesAsFileUrl.cs b/examples/SignatureRequestFilesAsFileUrl.cs deleted file mode 100644 index b3e92ef..0000000 --- a/examples/SignatureRequestFilesAsFileUrl.cs +++ /dev/null @@ -1,34 +0,0 @@ -using System; -using System.Collections.Generic; -using Dropbox.Sign.Api; -using Dropbox.Sign.Client; -using Dropbox.Sign.Model; - -public class Example -{ - public static void Main() - { - var config = new Configuration(); - // Configure HTTP basic authorization: api_key - config.Username = "YOUR_API_KEY"; - - // or, configure Bearer (JWT) authorization: oauth2 - // config.AccessToken = "YOUR_BEARER_TOKEN"; - - var signatureRequestApi = new SignatureRequestApi(config); - - var signatureRequestId = "fa5c8a0b0f492d768749333ad6fcc214c111e967"; - - try - { - var result = signatureRequestApi.SignatureRequestFilesAsFileUrl(signatureRequestId); - Console.WriteLine(result); - } - catch (ApiException e) - { - Console.WriteLine("Exception when calling Dropbox Sign API: " + e.Message); - Console.WriteLine("Status Code: " + e.ErrorCode); - Console.WriteLine(e.StackTrace); - } - } -} diff --git a/examples/SignatureRequestFilesAsFileUrlExample.cs b/examples/SignatureRequestFilesAsFileUrlExample.cs new file mode 100644 index 0000000..f3bfe66 --- /dev/null +++ b/examples/SignatureRequestFilesAsFileUrlExample.cs @@ -0,0 +1,36 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Text.Json; + +using Dropbox.Sign.Api; +using Dropbox.Sign.Client; +using Dropbox.Sign.Model; + +namespace Dropbox.SignSandbox; + +public class SignatureRequestFilesAsFileUrlExample +{ + public static void Run() + { + var config = new Configuration(); + config.Username = "YOUR_API_KEY"; + // config.AccessToken = "YOUR_ACCESS_TOKEN"; + + try + { + var response = new SignatureRequestApi(config).SignatureRequestFilesAsFileUrl( + signatureRequestId: "fa5c8a0b0f492d768749333ad6fcc214c111e967", + forceDownload: 1 + ); + + Console.WriteLine(response); + } + catch (ApiException e) + { + Console.WriteLine("Exception when calling SignatureRequestApi#SignatureRequestFilesAsFileUrl: " + e.Message); + Console.WriteLine("Status Code: " + e.ErrorCode); + Console.WriteLine(e.StackTrace); + } + } +} diff --git a/examples/SignatureRequestFilesExample.cs b/examples/SignatureRequestFilesExample.cs new file mode 100644 index 0000000..879127e --- /dev/null +++ b/examples/SignatureRequestFilesExample.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Text.Json; + +using Dropbox.Sign.Api; +using Dropbox.Sign.Client; +using Dropbox.Sign.Model; + +namespace Dropbox.SignSandbox; + +public class SignatureRequestFilesExample +{ + public static void Run() + { + var config = new Configuration(); + config.Username = "YOUR_API_KEY"; + // config.AccessToken = "YOUR_ACCESS_TOKEN"; + + try + { + var response = new SignatureRequestApi(config).SignatureRequestFiles( + signatureRequestId: "fa5c8a0b0f492d768749333ad6fcc214c111e967", + fileType: "pdf" + ); + var fileStream = File.Create("./file_response"); + response.Seek(0, SeekOrigin.Begin); + response.CopyTo(fileStream); + fileStream.Close(); + } + catch (ApiException e) + { + Console.WriteLine("Exception when calling SignatureRequestApi#SignatureRequestFiles: " + e.Message); + Console.WriteLine("Status Code: " + e.ErrorCode); + Console.WriteLine(e.StackTrace); + } + } +} diff --git a/examples/SignatureRequestGet.cs b/examples/SignatureRequestGet.cs deleted file mode 100644 index 33425be..0000000 --- a/examples/SignatureRequestGet.cs +++ /dev/null @@ -1,34 +0,0 @@ -using System; -using System.Collections.Generic; -using Dropbox.Sign.Api; -using Dropbox.Sign.Client; -using Dropbox.Sign.Model; - -public class Example -{ - public static void Main() - { - var config = new Configuration(); - // Configure HTTP basic authorization: api_key - config.Username = "YOUR_API_KEY"; - - // or, configure Bearer (JWT) authorization: oauth2 - // config.AccessToken = "YOUR_BEARER_TOKEN"; - - var signatureRequestApi = new SignatureRequestApi(config); - - var signatureRequestId = "fa5c8a0b0f492d768749333ad6fcc214c111e967"; - - try - { - var result = signatureRequestApi.SignatureRequestGet(signatureRequestId); - Console.WriteLine(result); - } - catch (ApiException e) - { - Console.WriteLine("Exception when calling Dropbox Sign API: " + e.Message); - Console.WriteLine("Status Code: " + e.ErrorCode); - Console.WriteLine(e.StackTrace); - } - } -} diff --git a/examples/SignatureRequestGetExample.cs b/examples/SignatureRequestGetExample.cs new file mode 100644 index 0000000..388861f --- /dev/null +++ b/examples/SignatureRequestGetExample.cs @@ -0,0 +1,35 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Text.Json; + +using Dropbox.Sign.Api; +using Dropbox.Sign.Client; +using Dropbox.Sign.Model; + +namespace Dropbox.SignSandbox; + +public class SignatureRequestGetExample +{ + public static void Run() + { + var config = new Configuration(); + config.Username = "YOUR_API_KEY"; + // config.AccessToken = "YOUR_ACCESS_TOKEN"; + + try + { + var response = new SignatureRequestApi(config).SignatureRequestGet( + signatureRequestId: "fa5c8a0b0f492d768749333ad6fcc214c111e967" + ); + + Console.WriteLine(response); + } + catch (ApiException e) + { + Console.WriteLine("Exception when calling SignatureRequestApi#SignatureRequestGet: " + e.Message); + Console.WriteLine("Status Code: " + e.ErrorCode); + Console.WriteLine(e.StackTrace); + } + } +} diff --git a/examples/SignatureRequestList.cs b/examples/SignatureRequestList.cs deleted file mode 100644 index 5612947..0000000 --- a/examples/SignatureRequestList.cs +++ /dev/null @@ -1,34 +0,0 @@ -using System; -using System.Collections.Generic; -using Dropbox.Sign.Api; -using Dropbox.Sign.Client; -using Dropbox.Sign.Model; - -public class Example -{ - public static void Main() - { - var config = new Configuration(); - // Configure HTTP basic authorization: api_key - config.Username = "YOUR_API_KEY"; - - // or, configure Bearer (JWT) authorization: oauth2 - // config.AccessToken = "YOUR_BEARER_TOKEN"; - - var signatureRequestApi = new SignatureRequestApi(config); - - var accountId = "accountId"; - - try - { - var result = signatureRequestApi.SignatureRequestList(accountId); - Console.WriteLine(result); - } - catch (ApiException e) - { - Console.WriteLine("Exception when calling Dropbox Sign API: " + e.Message); - Console.WriteLine("Status Code: " + e.ErrorCode); - Console.WriteLine(e.StackTrace); - } - } -} diff --git a/examples/SignatureRequestListExample.cs b/examples/SignatureRequestListExample.cs new file mode 100644 index 0000000..8092e53 --- /dev/null +++ b/examples/SignatureRequestListExample.cs @@ -0,0 +1,36 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Text.Json; + +using Dropbox.Sign.Api; +using Dropbox.Sign.Client; +using Dropbox.Sign.Model; + +namespace Dropbox.SignSandbox; + +public class SignatureRequestListExample +{ + public static void Run() + { + var config = new Configuration(); + config.Username = "YOUR_API_KEY"; + // config.AccessToken = "YOUR_ACCESS_TOKEN"; + + try + { + var response = new SignatureRequestApi(config).SignatureRequestList( + page: 1, + pageSize: 20 + ); + + Console.WriteLine(response); + } + catch (ApiException e) + { + Console.WriteLine("Exception when calling SignatureRequestApi#SignatureRequestList: " + e.Message); + Console.WriteLine("Status Code: " + e.ErrorCode); + Console.WriteLine(e.StackTrace); + } + } +} diff --git a/examples/SignatureRequestReleaseHold.cs b/examples/SignatureRequestReleaseHold.cs deleted file mode 100644 index 5819bb9..0000000 --- a/examples/SignatureRequestReleaseHold.cs +++ /dev/null @@ -1,34 +0,0 @@ -using System; -using System.Collections.Generic; -using Dropbox.Sign.Api; -using Dropbox.Sign.Client; -using Dropbox.Sign.Model; - -public class Example -{ - public static void Main() - { - var config = new Configuration(); - // Configure HTTP basic authorization: api_key - config.Username = "YOUR_API_KEY"; - - // or, configure Bearer (JWT) authorization: oauth2 - // config.AccessToken = "YOUR_BEARER_TOKEN"; - - var signatureRequestApi = new SignatureRequestApi(config); - - var signatureRequestId = "2f9781e1a8e2045224d808c153c2e1d3df6f8f2f"; - - try - { - var result = signatureRequestApi.SignatureRequestReleaseHold(signatureRequestId); - Console.WriteLine(result); - } - catch (ApiException e) - { - Console.WriteLine("Exception when calling Dropbox Sign API: " + e.Message); - Console.WriteLine("Status Code: " + e.ErrorCode); - Console.WriteLine(e.StackTrace); - } - } -} diff --git a/examples/SignatureRequestReleaseHoldExample.cs b/examples/SignatureRequestReleaseHoldExample.cs new file mode 100644 index 0000000..9b64cd7 --- /dev/null +++ b/examples/SignatureRequestReleaseHoldExample.cs @@ -0,0 +1,35 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Text.Json; + +using Dropbox.Sign.Api; +using Dropbox.Sign.Client; +using Dropbox.Sign.Model; + +namespace Dropbox.SignSandbox; + +public class SignatureRequestReleaseHoldExample +{ + public static void Run() + { + var config = new Configuration(); + config.Username = "YOUR_API_KEY"; + // config.AccessToken = "YOUR_ACCESS_TOKEN"; + + try + { + var response = new SignatureRequestApi(config).SignatureRequestReleaseHold( + signatureRequestId: "fa5c8a0b0f492d768749333ad6fcc214c111e967" + ); + + Console.WriteLine(response); + } + catch (ApiException e) + { + Console.WriteLine("Exception when calling SignatureRequestApi#SignatureRequestReleaseHold: " + e.Message); + Console.WriteLine("Status Code: " + e.ErrorCode); + Console.WriteLine(e.StackTrace); + } + } +} diff --git a/examples/SignatureRequestRemind.cs b/examples/SignatureRequestRemind.cs deleted file mode 100644 index 1dc8f6d..0000000 --- a/examples/SignatureRequestRemind.cs +++ /dev/null @@ -1,38 +0,0 @@ -using System; -using System.Collections.Generic; -using Dropbox.Sign.Api; -using Dropbox.Sign.Client; -using Dropbox.Sign.Model; - -public class Example -{ - public static void Main() - { - var config = new Configuration(); - // Configure HTTP basic authorization: api_key - config.Username = "YOUR_API_KEY"; - - // or, configure Bearer (JWT) authorization: oauth2 - // config.AccessToken = "YOUR_BEARER_TOKEN"; - - var signatureRequestApi = new SignatureRequestApi(config); - - var data = new SignatureRequestRemindRequest( - emailAddress: "john@example.com" - ); - - var signatureRequestId = "2f9781e1a8e2045224d808c153c2e1d3df6f8f2f"; - - try - { - var result = signatureRequestApi.SignatureRequestRemind(signatureRequestId, data); - Console.WriteLine(result); - } - catch (ApiException e) - { - Console.WriteLine("Exception when calling Dropbox Sign API: " + e.Message); - Console.WriteLine("Status Code: " + e.ErrorCode); - Console.WriteLine(e.StackTrace); - } - } -} diff --git a/examples/SignatureRequestRemindExample.cs b/examples/SignatureRequestRemindExample.cs new file mode 100644 index 0000000..bef1acb --- /dev/null +++ b/examples/SignatureRequestRemindExample.cs @@ -0,0 +1,40 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Text.Json; + +using Dropbox.Sign.Api; +using Dropbox.Sign.Client; +using Dropbox.Sign.Model; + +namespace Dropbox.SignSandbox; + +public class SignatureRequestRemindExample +{ + public static void Run() + { + var config = new Configuration(); + config.Username = "YOUR_API_KEY"; + // config.AccessToken = "YOUR_ACCESS_TOKEN"; + + var signatureRequestRemindRequest = new SignatureRequestRemindRequest( + emailAddress: "john@example.com" + ); + + try + { + var response = new SignatureRequestApi(config).SignatureRequestRemind( + signatureRequestId: "fa5c8a0b0f492d768749333ad6fcc214c111e967", + signatureRequestRemindRequest: signatureRequestRemindRequest + ); + + Console.WriteLine(response); + } + catch (ApiException e) + { + Console.WriteLine("Exception when calling SignatureRequestApi#SignatureRequestRemind: " + e.Message); + Console.WriteLine("Status Code: " + e.ErrorCode); + Console.WriteLine(e.StackTrace); + } + } +} diff --git a/examples/SignatureRequestRemove.cs b/examples/SignatureRequestRemove.cs deleted file mode 100644 index f609683..0000000 --- a/examples/SignatureRequestRemove.cs +++ /dev/null @@ -1,33 +0,0 @@ -using System; -using System.Collections.Generic; -using Dropbox.Sign.Api; -using Dropbox.Sign.Client; -using Dropbox.Sign.Model; - -public class Example -{ - public static void Main() - { - var config = new Configuration(); - // Configure HTTP basic authorization: api_key - config.Username = "YOUR_API_KEY"; - - // or, configure Bearer (JWT) authorization: oauth2 - // config.AccessToken = "YOUR_BEARER_TOKEN"; - - var signatureRequestApi = new SignatureRequestApi(config); - - var signatureRequestId = "2f9781e1a8e2045224d808c153c2e1d3df6f8f2f"; - - try - { - signatureRequestApi.SignatureRequestRemove(signatureRequestId); - } - catch (ApiException e) - { - Console.WriteLine("Exception when calling Dropbox Sign API: " + e.Message); - Console.WriteLine("Status Code: " + e.ErrorCode); - Console.WriteLine(e.StackTrace); - } - } -} diff --git a/examples/FaxLineCreate.cs b/examples/SignatureRequestRemoveExample.cs similarity index 53% rename from examples/FaxLineCreate.cs rename to examples/SignatureRequestRemoveExample.cs index 4d96ae5..f0b9cf8 100644 --- a/examples/FaxLineCreate.cs +++ b/examples/SignatureRequestRemoveExample.cs @@ -1,32 +1,30 @@ using System; using System.Collections.Generic; using System.IO; +using System.Text.Json; + using Dropbox.Sign.Api; using Dropbox.Sign.Client; using Dropbox.Sign.Model; -public class Example +namespace Dropbox.SignSandbox; + +public class SignatureRequestRemoveExample { - public static void Main() + public static void Run() { var config = new Configuration(); config.Username = "YOUR_API_KEY"; - var faxLineApi = new FaxLineApi(config); - - var data = new FaxLineCreateRequest( - areaCode: 209, - country: "US" - ); - try { - var result = faxLineApi.FaxLineCreate(data); - Console.WriteLine(result); + new SignatureRequestApi(config).SignatureRequestRemove( + signatureRequestId: "fa5c8a0b0f492d768749333ad6fcc214c111e967" + ); } catch (ApiException e) { - Console.WriteLine("Exception when calling Dropbox Sign API: " + e.Message); + Console.WriteLine("Exception when calling SignatureRequestApi#SignatureRequestRemove: " + e.Message); Console.WriteLine("Status Code: " + e.ErrorCode); Console.WriteLine(e.StackTrace); } diff --git a/examples/SignatureRequestSend.cs b/examples/SignatureRequestSend.cs deleted file mode 100644 index c1d45d1..0000000 --- a/examples/SignatureRequestSend.cs +++ /dev/null @@ -1,85 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using Dropbox.Sign.Api; -using Dropbox.Sign.Client; -using Dropbox.Sign.Model; - -public class Example -{ - public static void Main() - { - var config = new Configuration(); - // Configure HTTP basic authorization: api_key - config.Username = "YOUR_API_KEY"; - - // or, configure Bearer (JWT) authorization: oauth2 - // config.AccessToken = "YOUR_BEARER_TOKEN"; - - var signatureRequestApi = new SignatureRequestApi(config); - - var signer1 = new SubSignatureRequestSigner( - emailAddress: "jack@example.com", - name: "Jack", - order: 0 - ); - - var signer2 = new SubSignatureRequestSigner( - emailAddress: "jill@example.com", - name: "Jill", - order: 1 - ); - - var signingOptions = new SubSigningOptions( - draw: true, - type: true, - upload: true, - phone: true, - defaultType: SubSigningOptions.DefaultTypeEnum.Draw - ); - - var subFieldOptions = new SubFieldOptions( - dateFormat: SubFieldOptions.DateFormatEnum.DDMMYYYY - ); - - var metadata = new Dictionary() - { - ["custom_id"] = 1234, - ["custom_text"] = "NDA #9" - }; - - var files = new List { - new FileStream( - "./example_signature_request.pdf", - FileMode.Open, - FileAccess.Read, - FileShare.Read - ) - }; - - var data = new SignatureRequestSendRequest( - title: "NDA with Acme Co.", - subject: "The NDA we talked about", - message: "Please sign this NDA and then we can discuss more. Let me know if you have any questions.", - signers: new List(){signer1, signer2}, - ccEmailAddresses: new List(){"lawyer1@dropboxsign.com", "lawyer2@dropboxsign.com"}, - files: files, - metadata: metadata, - signingOptions: signingOptions, - fieldOptions: subFieldOptions, - testMode: true - ); - - try - { - var result = signatureRequestApi.SignatureRequestSend(data); - Console.WriteLine(result); - } - catch (ApiException e) - { - Console.WriteLine("Exception when calling Dropbox Sign API: " + e.Message); - Console.WriteLine("Status Code: " + e.ErrorCode); - Console.WriteLine(e.StackTrace); - } - } -} diff --git a/examples/SignatureRequestSendExample.cs b/examples/SignatureRequestSendExample.cs new file mode 100644 index 0000000..2958c26 --- /dev/null +++ b/examples/SignatureRequestSendExample.cs @@ -0,0 +1,92 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Text.Json; + +using Dropbox.Sign.Api; +using Dropbox.Sign.Client; +using Dropbox.Sign.Model; + +namespace Dropbox.SignSandbox; + +public class SignatureRequestSendExample +{ + public static void Run() + { + var config = new Configuration(); + config.Username = "YOUR_API_KEY"; + // config.AccessToken = "YOUR_ACCESS_TOKEN"; + + var fieldOptions = new SubFieldOptions( + dateFormat: SubFieldOptions.DateFormatEnum.DD_MM_YYYY + ); + + var signingOptions = new SubSigningOptions( + defaultType: SubSigningOptions.DefaultTypeEnum.Draw, + draw: true, + phone: false, + type: true, + upload: true + ); + + var signers1 = new SubSignatureRequestSigner( + name: "Jack", + emailAddress: "jack@example.com", + order: 0 + ); + + var signers2 = new SubSignatureRequestSigner( + name: "Jill", + emailAddress: "jill@example.com", + order: 1 + ); + + var signers = new List + { + signers1, + signers2, + }; + + var signatureRequestSendRequest = new SignatureRequestSendRequest( + message: "Please sign this NDA and then we can discuss more. Let me know if you\nhave any questions.", + subject: "The NDA we talked about", + testMode: true, + title: "NDA with Acme Co.", + ccEmailAddresses: [ + "lawyer1@dropboxsign.com", + "lawyer2@dropboxsign.com", + ], + files: new List + { + new FileStream( + path: "./example_signature_request.pdf", + mode: FileMode.Open + ), + }, + metadata: JsonSerializer.Deserialize>(""" + { + "custom_id": 1234, + "custom_text": "NDA #9" + } + """), + fieldOptions: fieldOptions, + signingOptions: signingOptions, + signers: signers + ); + + try + { + var response = new SignatureRequestApi(config).SignatureRequestSend( + signatureRequestSendRequest: signatureRequestSendRequest + ); + + Console.WriteLine(response); + } + catch (ApiException e) + { + Console.WriteLine("Exception when calling SignatureRequestApi#SignatureRequestSend: " + e.Message); + Console.WriteLine("Status Code: " + e.ErrorCode); + Console.WriteLine(e.StackTrace); + } + } +} diff --git a/examples/SignatureRequestSendGroupedSignersExample.cs b/examples/SignatureRequestSendGroupedSignersExample.cs new file mode 100644 index 0000000..8263d91 --- /dev/null +++ b/examples/SignatureRequestSendGroupedSignersExample.cs @@ -0,0 +1,120 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Text.Json; + +using Dropbox.Sign.Api; +using Dropbox.Sign.Client; +using Dropbox.Sign.Model; + +namespace Dropbox.SignSandbox; + +public class SignatureRequestSendGroupedSignersExample +{ + public static void Run() + { + var config = new Configuration(); + config.Username = "YOUR_API_KEY"; + // config.AccessToken = "YOUR_ACCESS_TOKEN"; + + var groupedSigners2Signers1 = new SubSignatureRequestSigner( + name: "Bob", + emailAddress: "bob@example.com" + ); + + var groupedSigners2Signers2 = new SubSignatureRequestSigner( + name: "Charlie", + emailAddress: "charlie@example.com" + ); + + var groupedSigners2Signers = new List + { + groupedSigners2Signers1, + groupedSigners2Signers2, + }; + + var groupedSigners1Signers1 = new SubSignatureRequestSigner( + name: "Jack", + emailAddress: "jack@example.com" + ); + + var groupedSigners1Signers2 = new SubSignatureRequestSigner( + name: "Jill", + emailAddress: "jill@example.com" + ); + + var groupedSigners1Signers = new List + { + groupedSigners1Signers1, + groupedSigners1Signers2, + }; + + var fieldOptions = new SubFieldOptions( + dateFormat: SubFieldOptions.DateFormatEnum.DD_MM_YYYY + ); + + var signingOptions = new SubSigningOptions( + defaultType: SubSigningOptions.DefaultTypeEnum.Draw, + draw: true, + phone: false, + type: true, + upload: true + ); + + var groupedSigners1 = new SubSignatureRequestGroupedSigners( + group: "Group #1", + order: 0, + signers: groupedSigners1Signers + ); + + var groupedSigners2 = new SubSignatureRequestGroupedSigners( + group: "Group #2", + order: 1, + signers: groupedSigners2Signers + ); + + var groupedSigners = new List + { + groupedSigners1, + groupedSigners2, + }; + + var signatureRequestSendRequest = new SignatureRequestSendRequest( + message: "Please sign this NDA and then we can discuss more. Let me know if you\nhave any questions.", + subject: "The NDA we talked about", + testMode: true, + title: "NDA with Acme Co.", + fileUrls: [ + "https://www.dropbox.com/s/ad9qnhbrjjn64tu/mutual-NDA-example.pdf?dl=1", + ], + ccEmailAddresses: [ + "lawyer1@dropboxsign.com", + "lawyer2@dropboxsign.com", + ], + metadata: JsonSerializer.Deserialize>(""" + { + "custom_id": 1234, + "custom_text": "NDA #9" + } + """), + fieldOptions: fieldOptions, + signingOptions: signingOptions, + groupedSigners: groupedSigners + ); + + try + { + var response = new SignatureRequestApi(config).SignatureRequestSend( + signatureRequestSendRequest: signatureRequestSendRequest + ); + + Console.WriteLine(response); + } + catch (ApiException e) + { + Console.WriteLine("Exception when calling SignatureRequestApi#SignatureRequestSend: " + e.Message); + Console.WriteLine("Status Code: " + e.ErrorCode); + Console.WriteLine(e.StackTrace); + } + } +} diff --git a/examples/SignatureRequestSendWithTemplate.cs b/examples/SignatureRequestSendWithTemplate.cs deleted file mode 100644 index 7c78edc..0000000 --- a/examples/SignatureRequestSendWithTemplate.cs +++ /dev/null @@ -1,69 +0,0 @@ -using System; -using System.Collections.Generic; -using Dropbox.Sign.Api; -using Dropbox.Sign.Client; -using Dropbox.Sign.Model; - -public class Example -{ - public static void Main() - { - var config = new Configuration(); - // Configure HTTP basic authorization: api_key - config.Username = "YOUR_API_KEY"; - - // or, configure Bearer (JWT) authorization: oauth2 - // config.AccessToken = "YOUR_BEARER_TOKEN"; - - var signatureRequestApi = new SignatureRequestApi(config); - - var signer1 = new SubSignatureRequestTemplateSigner( - role: "Client", - emailAddress: "george@example.com", - name: "George" - ); - - var cc1 = new SubCC( - role: "Accounting", - emailAddress: "accouting@emaple.com" - ); - - var customField1 = new SubCustomField( - name: "Cost", - value: "$20,000", - editor: "Client", - required: true - ); - - var signingOptions = new SubSigningOptions( - draw: true, - type: true, - upload: true, - phone: false, - defaultType: SubSigningOptions.DefaultTypeEnum.Draw - ); - - var data = new SignatureRequestSendWithTemplateRequest( - templateIds: new List(){"c26b8a16784a872da37ea946b9ddec7c1e11dff6"}, - subject: "Purchase Order", - message: "Glad we could come to an agreement.", - signers: new List(){signer1}, - ccs: new List(){cc1}, - customFields: new List(){customField1}, - signingOptions: signingOptions, - testMode: true - ); - - try - { - var result = signatureRequestApi.SignatureRequestSendWithTemplate(data); - Console.WriteLine(result); - } - catch (ApiException e) - { - Console.WriteLine("Exception when calling Dropbox Sign API: " + e.Message); - Console.WriteLine("Status Code: " + e.ErrorCode); - Console.WriteLine(e.StackTrace); - } - } -} diff --git a/examples/SignatureRequestSendWithTemplateExample.cs b/examples/SignatureRequestSendWithTemplateExample.cs new file mode 100644 index 0000000..024b92c --- /dev/null +++ b/examples/SignatureRequestSendWithTemplateExample.cs @@ -0,0 +1,89 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Text.Json; + +using Dropbox.Sign.Api; +using Dropbox.Sign.Client; +using Dropbox.Sign.Model; + +namespace Dropbox.SignSandbox; + +public class SignatureRequestSendWithTemplateExample +{ + public static void Run() + { + var config = new Configuration(); + config.Username = "YOUR_API_KEY"; + // config.AccessToken = "YOUR_ACCESS_TOKEN"; + + var signingOptions = new SubSigningOptions( + defaultType: SubSigningOptions.DefaultTypeEnum.Draw, + draw: true, + phone: false, + type: true, + upload: true + ); + + var signers1 = new SubSignatureRequestTemplateSigner( + role: "Client", + name: "George", + emailAddress: "george@example.com" + ); + + var signers = new List + { + signers1, + }; + + var ccs1 = new SubCC( + role: "Accounting", + emailAddress: "accounting@example.com" + ); + + var ccs = new List + { + ccs1, + }; + + var customFields1 = new SubCustomField( + name: "Cost", + editor: "Client", + required: true, + value: "$20,000" + ); + + var customFields = new List + { + customFields1, + }; + + var signatureRequestSendWithTemplateRequest = new SignatureRequestSendWithTemplateRequest( + templateIds: [ + "61a832ff0d8423f91d503e76bfbcc750f7417c78", + ], + message: "Glad we could come to an agreement.", + subject: "Purchase Order", + testMode: true, + signingOptions: signingOptions, + signers: signers, + ccs: ccs, + customFields: customFields + ); + + try + { + var response = new SignatureRequestApi(config).SignatureRequestSendWithTemplate( + signatureRequestSendWithTemplateRequest: signatureRequestSendWithTemplateRequest + ); + + Console.WriteLine(response); + } + catch (ApiException e) + { + Console.WriteLine("Exception when calling SignatureRequestApi#SignatureRequestSendWithTemplate: " + e.Message); + Console.WriteLine("Status Code: " + e.ErrorCode); + Console.WriteLine(e.StackTrace); + } + } +} diff --git a/examples/SignatureRequestUpdate.cs b/examples/SignatureRequestUpdate.cs deleted file mode 100644 index b8d73b2..0000000 --- a/examples/SignatureRequestUpdate.cs +++ /dev/null @@ -1,39 +0,0 @@ -using System; -using System.Collections.Generic; -using Dropbox.Sign.Api; -using Dropbox.Sign.Client; -using Dropbox.Sign.Model; - -public class Example -{ - public static void Main() - { - var config = new Configuration(); - // Configure HTTP basic authorization: api_key - config.Username = "YOUR_API_KEY"; - - // or, configure Bearer (JWT) authorization: oauth2 - // config.AccessToken = "YOUR_BEARER_TOKEN"; - - var signatureRequestApi = new SignatureRequestApi(config); - - var signatureRequestId = "2f9781e1a8e2045224d808c153c2e1d3df6f8f2f"; - - var data = new SignatureRequestUpdateRequest( - emailAddress: "john@example.com", - signatureId: "78caf2a1d01cd39cea2bc1cbb340dac3" - ); - - try - { - var result = signatureRequestApi.SignatureRequestUpdate(signatureRequestId, data); - Console.WriteLine(result); - } - catch (ApiException e) - { - Console.WriteLine("Exception when calling Dropbox Sign API: " + e.Message); - Console.WriteLine("Status Code: " + e.ErrorCode); - Console.WriteLine(e.StackTrace); - } - } -} diff --git a/examples/SignatureRequestUpdateExample.cs b/examples/SignatureRequestUpdateExample.cs new file mode 100644 index 0000000..7d95516 --- /dev/null +++ b/examples/SignatureRequestUpdateExample.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Text.Json; + +using Dropbox.Sign.Api; +using Dropbox.Sign.Client; +using Dropbox.Sign.Model; + +namespace Dropbox.SignSandbox; + +public class SignatureRequestUpdateExample +{ + public static void Run() + { + var config = new Configuration(); + config.Username = "YOUR_API_KEY"; + // config.AccessToken = "YOUR_ACCESS_TOKEN"; + + var signatureRequestUpdateRequest = new SignatureRequestUpdateRequest( + signatureId: "2f9781e1a8e2045224d808c153c2e1d3df6f8f2f", + emailAddress: "john@example.com" + ); + + try + { + var response = new SignatureRequestApi(config).SignatureRequestUpdate( + signatureRequestId: "fa5c8a0b0f492d768749333ad6fcc214c111e967", + signatureRequestUpdateRequest: signatureRequestUpdateRequest + ); + + Console.WriteLine(response); + } + catch (ApiException e) + { + Console.WriteLine("Exception when calling SignatureRequestApi#SignatureRequestUpdate: " + e.Message); + Console.WriteLine("Status Code: " + e.ErrorCode); + Console.WriteLine(e.StackTrace); + } + } +} diff --git a/examples/TeamAddMember.cs b/examples/TeamAddMember.cs deleted file mode 100644 index 515014d..0000000 --- a/examples/TeamAddMember.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System; -using System.Collections.Generic; -using Dropbox.Sign.Api; -using Dropbox.Sign.Client; -using Dropbox.Sign.Model; - -public class Example -{ - public static void Main() - { - var config = new Configuration(); - // Configure HTTP basic authorization: api_key - config.Username = "YOUR_API_KEY"; - - // or, configure Bearer (JWT) authorization: oauth2 - // config.AccessToken = "YOUR_BEARER_TOKEN"; - - var teamApi = new TeamApi(config); - - var data = new TeamAddMemberRequest( - emailAddress: "george@example.com" - ); - - try - { - var result = teamApi.TeamAddMember(data); - Console.WriteLine(result); - } - catch (ApiException e) - { - Console.WriteLine("Exception when calling Dropbox Sign API: " + e.Message); - Console.WriteLine("Status Code: " + e.ErrorCode); - Console.WriteLine(e.StackTrace); - } - } -} diff --git a/examples/TeamAddMemberAccountIdExample.cs b/examples/TeamAddMemberAccountIdExample.cs new file mode 100644 index 0000000..fe700fc --- /dev/null +++ b/examples/TeamAddMemberAccountIdExample.cs @@ -0,0 +1,40 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Text.Json; + +using Dropbox.Sign.Api; +using Dropbox.Sign.Client; +using Dropbox.Sign.Model; + +namespace Dropbox.SignSandbox; + +public class TeamAddMemberAccountIdExample +{ + public static void Run() + { + var config = new Configuration(); + config.Username = "YOUR_API_KEY"; + // config.AccessToken = "YOUR_ACCESS_TOKEN"; + + var teamAddMemberRequest = new TeamAddMemberRequest( + accountId: "f57db65d3f933b5316d398057a36176831451a35" + ); + + try + { + var response = new TeamApi(config).TeamAddMember( + teamAddMemberRequest: teamAddMemberRequest, + teamId: "4fea99bfcf2b26bfccf6cea3e127fb8bb74d8d9c" + ); + + Console.WriteLine(response); + } + catch (ApiException e) + { + Console.WriteLine("Exception when calling TeamApi#TeamAddMember: " + e.Message); + Console.WriteLine("Status Code: " + e.ErrorCode); + Console.WriteLine(e.StackTrace); + } + } +} diff --git a/examples/TeamAddMemberExample.cs b/examples/TeamAddMemberExample.cs new file mode 100644 index 0000000..3529c6e --- /dev/null +++ b/examples/TeamAddMemberExample.cs @@ -0,0 +1,40 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Text.Json; + +using Dropbox.Sign.Api; +using Dropbox.Sign.Client; +using Dropbox.Sign.Model; + +namespace Dropbox.SignSandbox; + +public class TeamAddMemberExample +{ + public static void Run() + { + var config = new Configuration(); + config.Username = "YOUR_API_KEY"; + // config.AccessToken = "YOUR_ACCESS_TOKEN"; + + var teamAddMemberRequest = new TeamAddMemberRequest( + emailAddress: "george@example.com" + ); + + try + { + var response = new TeamApi(config).TeamAddMember( + teamAddMemberRequest: teamAddMemberRequest, + teamId: "4fea99bfcf2b26bfccf6cea3e127fb8bb74d8d9c" + ); + + Console.WriteLine(response); + } + catch (ApiException e) + { + Console.WriteLine("Exception when calling TeamApi#TeamAddMember: " + e.Message); + Console.WriteLine("Status Code: " + e.ErrorCode); + Console.WriteLine(e.StackTrace); + } + } +} diff --git a/examples/TeamCreate.cs b/examples/TeamCreate.cs deleted file mode 100644 index 78d0768..0000000 --- a/examples/TeamCreate.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System; -using System.Collections.Generic; -using Dropbox.Sign.Api; -using Dropbox.Sign.Client; -using Dropbox.Sign.Model; - -public class Example -{ - public static void Main() - { - var config = new Configuration(); - // Configure HTTP basic authorization: api_key - config.Username = "YOUR_API_KEY"; - - // or, configure Bearer (JWT) authorization: oauth2 - // config.AccessToken = "YOUR_BEARER_TOKEN"; - - var teamApi = new TeamApi(config); - - var data = new TeamCreateRequest( - name: "New Team Name" - ); - - try - { - var result = teamApi.TeamCreate(data); - Console.WriteLine(result); - } - catch (ApiException e) - { - Console.WriteLine("Exception when calling Dropbox Sign API: " + e.Message); - Console.WriteLine("Status Code: " + e.ErrorCode); - Console.WriteLine(e.StackTrace); - } - } -} diff --git a/examples/TeamCreateExample.cs b/examples/TeamCreateExample.cs new file mode 100644 index 0000000..794c462 --- /dev/null +++ b/examples/TeamCreateExample.cs @@ -0,0 +1,39 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Text.Json; + +using Dropbox.Sign.Api; +using Dropbox.Sign.Client; +using Dropbox.Sign.Model; + +namespace Dropbox.SignSandbox; + +public class TeamCreateExample +{ + public static void Run() + { + var config = new Configuration(); + config.Username = "YOUR_API_KEY"; + // config.AccessToken = "YOUR_ACCESS_TOKEN"; + + var teamCreateRequest = new TeamCreateRequest( + name: "New Team Name" + ); + + try + { + var response = new TeamApi(config).TeamCreate( + teamCreateRequest: teamCreateRequest + ); + + Console.WriteLine(response); + } + catch (ApiException e) + { + Console.WriteLine("Exception when calling TeamApi#TeamCreate: " + e.Message); + Console.WriteLine("Status Code: " + e.ErrorCode); + Console.WriteLine(e.StackTrace); + } + } +} diff --git a/examples/TeamDelete.cs b/examples/TeamDelete.cs deleted file mode 100644 index 35eca42..0000000 --- a/examples/TeamDelete.cs +++ /dev/null @@ -1,31 +0,0 @@ -using System; -using System.Collections.Generic; -using Dropbox.Sign.Api; -using Dropbox.Sign.Client; -using Dropbox.Sign.Model; - -public class Example -{ - public static void Main() - { - var config = new Configuration(); - // Configure HTTP basic authorization: api_key - config.Username = "YOUR_API_KEY"; - - // or, configure Bearer (JWT) authorization: oauth2 - // config.AccessToken = "YOUR_BEARER_TOKEN"; - - var teamApi = new TeamApi(config); - - try - { - teamApi.TeamDelete(); - } - catch (ApiException e) - { - Console.WriteLine("Exception when calling Dropbox Sign API: " + e.Message); - Console.WriteLine("Status Code: " + e.ErrorCode); - Console.WriteLine(e.StackTrace); - } - } -} diff --git a/examples/FaxLineGet.cs b/examples/TeamDeleteExample.cs similarity index 58% rename from examples/FaxLineGet.cs rename to examples/TeamDeleteExample.cs index d18c82f..b5c7a83 100644 --- a/examples/FaxLineGet.cs +++ b/examples/TeamDeleteExample.cs @@ -1,27 +1,29 @@ using System; using System.Collections.Generic; using System.IO; +using System.Text.Json; + using Dropbox.Sign.Api; using Dropbox.Sign.Client; using Dropbox.Sign.Model; -public class Example +namespace Dropbox.SignSandbox; + +public class TeamDeleteExample { - public static void Main() + public static void Run() { var config = new Configuration(); config.Username = "YOUR_API_KEY"; - - var faxLineApi = new FaxLineApi(config); + // config.AccessToken = "YOUR_ACCESS_TOKEN"; try { - var result = faxLineApi.FaxLineGet("[FAX_NUMBER]"); - Console.WriteLine(result); + new TeamApi(config).TeamDelete(); } catch (ApiException e) { - Console.WriteLine("Exception when calling Dropbox Sign API: " + e.Message); + Console.WriteLine("Exception when calling TeamApi#TeamDelete: " + e.Message); Console.WriteLine("Status Code: " + e.ErrorCode); Console.WriteLine(e.StackTrace); } diff --git a/examples/TeamGet.cs b/examples/TeamGet.cs deleted file mode 100644 index f1984f5..0000000 --- a/examples/TeamGet.cs +++ /dev/null @@ -1,32 +0,0 @@ -using System; -using System.Collections.Generic; -using Dropbox.Sign.Api; -using Dropbox.Sign.Client; -using Dropbox.Sign.Model; - -public class Example -{ - public static void Main() - { - var config = new Configuration(); - // Configure HTTP basic authorization: api_key - config.Username = "YOUR_API_KEY"; - - // or, configure Bearer (JWT) authorization: oauth2 - // config.AccessToken = "YOUR_BEARER_TOKEN"; - - var teamApi = new TeamApi(config); - - try - { - var result = teamApi.TeamGet(); - Console.WriteLine(result); - } - catch (ApiException e) - { - Console.WriteLine("Exception when calling Dropbox Sign API: " + e.Message); - Console.WriteLine("Status Code: " + e.ErrorCode); - Console.WriteLine(e.StackTrace); - } - } -} diff --git a/examples/FaxLineAreaCodeGet.cs b/examples/TeamGetExample.cs similarity index 55% rename from examples/FaxLineAreaCodeGet.cs rename to examples/TeamGetExample.cs index 3beedfe..3a79cd2 100644 --- a/examples/FaxLineAreaCodeGet.cs +++ b/examples/TeamGetExample.cs @@ -1,27 +1,31 @@ using System; using System.Collections.Generic; using System.IO; +using System.Text.Json; + using Dropbox.Sign.Api; using Dropbox.Sign.Client; using Dropbox.Sign.Model; -public class Example +namespace Dropbox.SignSandbox; + +public class TeamGetExample { - public static void Main() + public static void Run() { var config = new Configuration(); config.Username = "YOUR_API_KEY"; - - var faxLineApi = new FaxLineApi(config); + // config.AccessToken = "YOUR_ACCESS_TOKEN"; try { - var result = faxLineApi.FaxLineAreaCodeGet("US", "CA"); - Console.WriteLine(result); + var response = new TeamApi(config).TeamGet(); + + Console.WriteLine(response); } catch (ApiException e) { - Console.WriteLine("Exception when calling Dropbox Sign API: " + e.Message); + Console.WriteLine("Exception when calling TeamApi#TeamGet: " + e.Message); Console.WriteLine("Status Code: " + e.ErrorCode); Console.WriteLine(e.StackTrace); } diff --git a/examples/TeamInfo.cs b/examples/TeamInfo.cs deleted file mode 100644 index 284dcdf..0000000 --- a/examples/TeamInfo.cs +++ /dev/null @@ -1,32 +0,0 @@ -using System; -using System.Collections.Generic; -using Dropbox.Sign.Api; -using Dropbox.Sign.Client; -using Dropbox.Sign.Model; - -public class Example -{ - public static void Main() - { - var config = new Configuration(); - // Configure HTTP basic authorization: api_key - config.Username = "YOUR_API_KEY"; - - // or, configure Bearer (JWT) authorization: oauth2 - // config.AccessToken = "YOUR_BEARER_TOKEN"; - - var teamApi = new TeamApi(config); - - try - { - var result = teamApi.TeamInfo(); - Console.WriteLine(result); - } - catch (ApiException e) - { - Console.WriteLine("Exception when calling Dropbox Sign API: " + e.Message); - Console.WriteLine("Status Code: " + e.ErrorCode); - Console.WriteLine(e.StackTrace); - } - } -} diff --git a/examples/TeamInfoExample.cs b/examples/TeamInfoExample.cs new file mode 100644 index 0000000..a761bce --- /dev/null +++ b/examples/TeamInfoExample.cs @@ -0,0 +1,35 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Text.Json; + +using Dropbox.Sign.Api; +using Dropbox.Sign.Client; +using Dropbox.Sign.Model; + +namespace Dropbox.SignSandbox; + +public class TeamInfoExample +{ + public static void Run() + { + var config = new Configuration(); + config.Username = "YOUR_API_KEY"; + // config.AccessToken = "YOUR_ACCESS_TOKEN"; + + try + { + var response = new TeamApi(config).TeamInfo( + teamId: "4fea99bfcf2b26bfccf6cea3e127fb8bb74d8d9c" + ); + + Console.WriteLine(response); + } + catch (ApiException e) + { + Console.WriteLine("Exception when calling TeamApi#TeamInfo: " + e.Message); + Console.WriteLine("Status Code: " + e.ErrorCode); + Console.WriteLine(e.StackTrace); + } + } +} diff --git a/examples/TeamInvites.cs b/examples/TeamInvites.cs deleted file mode 100644 index b52c3b1..0000000 --- a/examples/TeamInvites.cs +++ /dev/null @@ -1,33 +0,0 @@ -using System; -using System.Collections.Generic; -using Dropbox.Sign.Api; -using Dropbox.Sign.Client; -using Dropbox.Sign.Model; - -public class Example -{ - public static void Main() - { - var config = new Configuration(); - // Configure HTTP basic authorization: api_key - config.Username = "YOUR_API_KEY"; - - // or, configure Bearer (JWT) authorization: oauth2 - // config.AccessToken = "YOUR_BEARER_TOKEN"; - - var teamApi = new TeamApi(config); - var emailAddress = "user@dropboxsign.com"; - - try - { - var result = teamApi.TeamInvites(emailAddress); - Console.WriteLine(result); - } - catch (ApiException e) - { - Console.WriteLine("Exception when calling Dropbox Sign API: " + e.Message); - Console.WriteLine("Status Code: " + e.ErrorCode); - Console.WriteLine(e.StackTrace); - } - } -} diff --git a/examples/TeamInvitesExample.cs b/examples/TeamInvitesExample.cs new file mode 100644 index 0000000..90454cb --- /dev/null +++ b/examples/TeamInvitesExample.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Text.Json; + +using Dropbox.Sign.Api; +using Dropbox.Sign.Client; +using Dropbox.Sign.Model; + +namespace Dropbox.SignSandbox; + +public class TeamInvitesExample +{ + public static void Run() + { + var config = new Configuration(); + config.Username = "YOUR_API_KEY"; + // config.AccessToken = "YOUR_ACCESS_TOKEN"; + + try + { + var response = new TeamApi(config).TeamInvites(); + + Console.WriteLine(response); + } + catch (ApiException e) + { + Console.WriteLine("Exception when calling TeamApi#TeamInvites: " + e.Message); + Console.WriteLine("Status Code: " + e.ErrorCode); + Console.WriteLine(e.StackTrace); + } + } +} diff --git a/examples/TeamMembers.cs b/examples/TeamMembers.cs deleted file mode 100644 index 3426971..0000000 --- a/examples/TeamMembers.cs +++ /dev/null @@ -1,33 +0,0 @@ -using System; -using System.Collections.Generic; -using Dropbox.Sign.Api; -using Dropbox.Sign.Client; -using Dropbox.Sign.Model; - -public class Example -{ - public static void Main() - { - var config = new Configuration(); - // Configure HTTP basic authorization: api_key - config.Username = "YOUR_API_KEY"; - - // or, configure Bearer (JWT) authorization: oauth2 - // config.AccessToken = "YOUR_BEARER_TOKEN"; - - var teamApi = new TeamApi(config); - var teamId = "4fea99bfcf2b26bfccf6cea3e127fb8bb74d8d9c"; - - try - { - var result = teamApi.TeamMembers(teamId); - Console.WriteLine(result); - } - catch (ApiException e) - { - Console.WriteLine("Exception when calling Dropbox Sign API: " + e.Message); - Console.WriteLine("Status Code: " + e.ErrorCode); - Console.WriteLine(e.StackTrace); - } - } -} diff --git a/examples/TeamMembersExample.cs b/examples/TeamMembersExample.cs new file mode 100644 index 0000000..72213f8 --- /dev/null +++ b/examples/TeamMembersExample.cs @@ -0,0 +1,37 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Text.Json; + +using Dropbox.Sign.Api; +using Dropbox.Sign.Client; +using Dropbox.Sign.Model; + +namespace Dropbox.SignSandbox; + +public class TeamMembersExample +{ + public static void Run() + { + var config = new Configuration(); + config.Username = "YOUR_API_KEY"; + // config.AccessToken = "YOUR_ACCESS_TOKEN"; + + try + { + var response = new TeamApi(config).TeamMembers( + teamId: "4fea99bfcf2b26bfccf6cea3e127fb8bb74d8d9c", + page: 1, + pageSize: 20 + ); + + Console.WriteLine(response); + } + catch (ApiException e) + { + Console.WriteLine("Exception when calling TeamApi#TeamMembers: " + e.Message); + Console.WriteLine("Status Code: " + e.ErrorCode); + Console.WriteLine(e.StackTrace); + } + } +} diff --git a/examples/TeamRemoveMemberAccountIdExample.cs b/examples/TeamRemoveMemberAccountIdExample.cs new file mode 100644 index 0000000..0c6ae21 --- /dev/null +++ b/examples/TeamRemoveMemberAccountIdExample.cs @@ -0,0 +1,39 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Text.Json; + +using Dropbox.Sign.Api; +using Dropbox.Sign.Client; +using Dropbox.Sign.Model; + +namespace Dropbox.SignSandbox; + +public class TeamRemoveMemberAccountIdExample +{ + public static void Run() + { + var config = new Configuration(); + config.Username = "YOUR_API_KEY"; + // config.AccessToken = "YOUR_ACCESS_TOKEN"; + + var teamRemoveMemberRequest = new TeamRemoveMemberRequest( + accountId: "f57db65d3f933b5316d398057a36176831451a35" + ); + + try + { + var response = new TeamApi(config).TeamRemoveMember( + teamRemoveMemberRequest: teamRemoveMemberRequest + ); + + Console.WriteLine(response); + } + catch (ApiException e) + { + Console.WriteLine("Exception when calling TeamApi#TeamRemoveMember: " + e.Message); + Console.WriteLine("Status Code: " + e.ErrorCode); + Console.WriteLine(e.StackTrace); + } + } +} diff --git a/examples/TeamRemoveMember.cs b/examples/TeamRemoveMemberExample.cs similarity index 50% rename from examples/TeamRemoveMember.cs rename to examples/TeamRemoveMemberExample.cs index c4051b6..23aeff1 100644 --- a/examples/TeamRemoveMember.cs +++ b/examples/TeamRemoveMemberExample.cs @@ -1,35 +1,38 @@ using System; using System.Collections.Generic; +using System.IO; +using System.Text.Json; + using Dropbox.Sign.Api; using Dropbox.Sign.Client; using Dropbox.Sign.Model; -public class Example +namespace Dropbox.SignSandbox; + +public class TeamRemoveMemberExample { - public static void Main() + public static void Run() { var config = new Configuration(); - // Configure HTTP basic authorization: api_key config.Username = "YOUR_API_KEY"; + // config.AccessToken = "YOUR_ACCESS_TOKEN"; - // or, configure Bearer (JWT) authorization: oauth2 - // config.AccessToken = "YOUR_BEARER_TOKEN"; - - var teamApi = new TeamApi(config); - - var data = new TeamRemoveMemberRequest( + var teamRemoveMemberRequest = new TeamRemoveMemberRequest( emailAddress: "teammate@dropboxsign.com", newOwnerEmailAddress: "new_teammate@dropboxsign.com" ); try { - var result = teamApi.TeamRemoveMember(data); - Console.WriteLine(result); + var response = new TeamApi(config).TeamRemoveMember( + teamRemoveMemberRequest: teamRemoveMemberRequest + ); + + Console.WriteLine(response); } catch (ApiException e) { - Console.WriteLine("Exception when calling Dropbox Sign API: " + e.Message); + Console.WriteLine("Exception when calling TeamApi#TeamRemoveMember: " + e.Message); Console.WriteLine("Status Code: " + e.ErrorCode); Console.WriteLine(e.StackTrace); } diff --git a/examples/TeamSubTeams.cs b/examples/TeamSubTeams.cs deleted file mode 100644 index cab5c69..0000000 --- a/examples/TeamSubTeams.cs +++ /dev/null @@ -1,33 +0,0 @@ -using System; -using System.Collections.Generic; -using Dropbox.Sign.Api; -using Dropbox.Sign.Client; -using Dropbox.Sign.Model; - -public class Example -{ - public static void Main() - { - var config = new Configuration(); - // Configure HTTP basic authorization: api_key - config.Username = "YOUR_API_KEY"; - - // or, configure Bearer (JWT) authorization: oauth2 - // config.AccessToken = "YOUR_BEARER_TOKEN"; - - var teamApi = new TeamApi(config); - var teamId = "4fea99bfcf2b26bfccf6cea3e127fb8bb74d8d9c"; - - try - { - var result = teamApi.TeamSubTeams(teamId); - Console.WriteLine(result); - } - catch (ApiException e) - { - Console.WriteLine("Exception when calling Dropbox Sign API: " + e.Message); - Console.WriteLine("Status Code: " + e.ErrorCode); - Console.WriteLine(e.StackTrace); - } - } -} diff --git a/examples/TeamSubTeamsExample.cs b/examples/TeamSubTeamsExample.cs new file mode 100644 index 0000000..1760310 --- /dev/null +++ b/examples/TeamSubTeamsExample.cs @@ -0,0 +1,37 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Text.Json; + +using Dropbox.Sign.Api; +using Dropbox.Sign.Client; +using Dropbox.Sign.Model; + +namespace Dropbox.SignSandbox; + +public class TeamSubTeamsExample +{ + public static void Run() + { + var config = new Configuration(); + config.Username = "YOUR_API_KEY"; + // config.AccessToken = "YOUR_ACCESS_TOKEN"; + + try + { + var response = new TeamApi(config).TeamSubTeams( + teamId: "4fea99bfcf2b26bfccf6cea3e127fb8bb74d8d9c", + page: 1, + pageSize: 20 + ); + + Console.WriteLine(response); + } + catch (ApiException e) + { + Console.WriteLine("Exception when calling TeamApi#TeamSubTeams: " + e.Message); + Console.WriteLine("Status Code: " + e.ErrorCode); + Console.WriteLine(e.StackTrace); + } + } +} diff --git a/examples/TeamUpdate.cs b/examples/TeamUpdate.cs deleted file mode 100644 index f31b538..0000000 --- a/examples/TeamUpdate.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System; -using System.Collections.Generic; -using Dropbox.Sign.Api; -using Dropbox.Sign.Client; -using Dropbox.Sign.Model; - -public class Example -{ - public static void Main() - { - var config = new Configuration(); - // Configure HTTP basic authorization: api_key - config.Username = "YOUR_API_KEY"; - - // or, configure Bearer (JWT) authorization: oauth2 - // config.AccessToken = "YOUR_BEARER_TOKEN"; - - var teamApi = new TeamApi(config); - - var data = new TeamUpdateRequest( - name: "New Team Name" - ); - - try - { - var result = teamApi.TeamUpdate(data); - Console.WriteLine(result); - } - catch (ApiException e) - { - Console.WriteLine("Exception when calling Dropbox Sign API: " + e.Message); - Console.WriteLine("Status Code: " + e.ErrorCode); - Console.WriteLine(e.StackTrace); - } - } -} diff --git a/examples/TeamUpdateExample.cs b/examples/TeamUpdateExample.cs new file mode 100644 index 0000000..355811e --- /dev/null +++ b/examples/TeamUpdateExample.cs @@ -0,0 +1,39 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Text.Json; + +using Dropbox.Sign.Api; +using Dropbox.Sign.Client; +using Dropbox.Sign.Model; + +namespace Dropbox.SignSandbox; + +public class TeamUpdateExample +{ + public static void Run() + { + var config = new Configuration(); + config.Username = "YOUR_API_KEY"; + // config.AccessToken = "YOUR_ACCESS_TOKEN"; + + var teamUpdateRequest = new TeamUpdateRequest( + name: "New Team Name" + ); + + try + { + var response = new TeamApi(config).TeamUpdate( + teamUpdateRequest: teamUpdateRequest + ); + + Console.WriteLine(response); + } + catch (ApiException e) + { + Console.WriteLine("Exception when calling TeamApi#TeamUpdate: " + e.Message); + Console.WriteLine("Status Code: " + e.ErrorCode); + Console.WriteLine(e.StackTrace); + } + } +} diff --git a/examples/TemplateAddUser.cs b/examples/TemplateAddUser.cs deleted file mode 100644 index 23d85c8..0000000 --- a/examples/TemplateAddUser.cs +++ /dev/null @@ -1,38 +0,0 @@ -using System; -using System.Collections.Generic; -using Dropbox.Sign.Api; -using Dropbox.Sign.Client; -using Dropbox.Sign.Model; - -public class Example -{ - public static void Main() - { - var config = new Configuration(); - // Configure HTTP basic authorization: api_key - config.Username = "YOUR_API_KEY"; - - // or, configure Bearer (JWT) authorization: oauth2 - // config.AccessToken = "YOUR_BEARER_TOKEN"; - - var templateApi = new TemplateApi(config); - - var templateId = "f57db65d3f933b5316d398057a36176831451a35"; - - var data = new TemplateAddUserRequest( - emailAddress: "george@dropboxsign.com" - ); - - try - { - var result = templateApi.TemplateAddUser(templateId, data); - Console.WriteLine(result); - } - catch (ApiException e) - { - Console.WriteLine("Exception when calling Dropbox Sign API: " + e.Message); - Console.WriteLine("Status Code: " + e.ErrorCode); - Console.WriteLine(e.StackTrace); - } - } -} diff --git a/examples/TemplateAddUserExample.cs b/examples/TemplateAddUserExample.cs new file mode 100644 index 0000000..dc4107a --- /dev/null +++ b/examples/TemplateAddUserExample.cs @@ -0,0 +1,40 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Text.Json; + +using Dropbox.Sign.Api; +using Dropbox.Sign.Client; +using Dropbox.Sign.Model; + +namespace Dropbox.SignSandbox; + +public class TemplateAddUserExample +{ + public static void Run() + { + var config = new Configuration(); + config.Username = "YOUR_API_KEY"; + // config.AccessToken = "YOUR_ACCESS_TOKEN"; + + var templateAddUserRequest = new TemplateAddUserRequest( + emailAddress: "george@dropboxsign.com" + ); + + try + { + var response = new TemplateApi(config).TemplateAddUser( + templateId: "f57db65d3f933b5316d398057a36176831451a35", + templateAddUserRequest: templateAddUserRequest + ); + + Console.WriteLine(response); + } + catch (ApiException e) + { + Console.WriteLine("Exception when calling TemplateApi#TemplateAddUser: " + e.Message); + Console.WriteLine("Status Code: " + e.ErrorCode); + Console.WriteLine(e.StackTrace); + } + } +} diff --git a/examples/TemplateCreate.cs b/examples/TemplateCreate.cs deleted file mode 100644 index cce7362..0000000 --- a/examples/TemplateCreate.cs +++ /dev/null @@ -1,79 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using Dropbox.Sign.Api; -using Dropbox.Sign.Client; -using Dropbox.Sign.Model; - -public class Example -{ - public static void Main() - { - var config = new Configuration(); - // Configure HTTP basic authorization: api_key - config.Username = "YOUR_API_KEY"; - - // or, configure Bearer (JWT) authorization: oauth2 - // config.AccessToken = "YOUR_BEARER_TOKEN"; - - var templateApi = new TemplateApi(config); - - var role1 = new SubTemplateRole( - name: "Client", - order: 0 - ); - - var role2 = new SubTemplateRole( - name: "Witness", - order: 1 - ); - - var mergeField1 = new SubMergeField( - name: "Full Name", - type: SubMergeField.TypeEnum.Text - ); - - var mergeField2 = new SubMergeField( - name: "Is Registered?", - type: SubMergeField.TypeEnum.Checkbox - ); - - var subFieldOptions = new SubFieldOptions( - dateFormat: SubFieldOptions.DateFormatEnum.DDMMYYYY - ); - - var files = new List { - new FileStream( - "./example_signature_request.pdf", - FileMode.Open, - FileAccess.Read, - FileShare.Read - ) - }; - - var data = new TemplateCreateRequest( - clientId: "37dee8d8440c66d54cfa05d92c160882", - files: files, - title: "Test Template", - subject: "Please sign this document", - message: "For your approval", - signerRoles: new List(){role1, role2}, - ccRoles: new List(){"Manager"}, - mergeFields: new List(){mergeField1, mergeField2}, - fieldOptions: subFieldOptions, - testMode: true - ); - - try - { - var result = templateApi.TemplateCreate(data); - Console.WriteLine(result); - } - catch (ApiException e) - { - Console.WriteLine("Exception when calling Dropbox Sign API: " + e.Message); - Console.WriteLine("Status Code: " + e.ErrorCode); - Console.WriteLine(e.StackTrace); - } - } -} diff --git a/examples/TemplateCreateEmbeddedDraft.cs b/examples/TemplateCreateEmbeddedDraft.cs deleted file mode 100644 index 42335ff..0000000 --- a/examples/TemplateCreateEmbeddedDraft.cs +++ /dev/null @@ -1,79 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using Dropbox.Sign.Api; -using Dropbox.Sign.Client; -using Dropbox.Sign.Model; - -public class Example -{ - public static void Main() - { - var config = new Configuration(); - // Configure HTTP basic authorization: api_key - config.Username = "YOUR_API_KEY"; - - // or, configure Bearer (JWT) authorization: oauth2 - // config.AccessToken = "YOUR_BEARER_TOKEN"; - - var templateApi = new TemplateApi(config); - - var role1 = new SubTemplateRole( - name: "Client", - order: 0 - ); - - var role2 = new SubTemplateRole( - name: "Witness", - order: 1 - ); - - var mergeField1 = new SubMergeField( - name: "Full Name", - type: SubMergeField.TypeEnum.Text - ); - - var mergeField2 = new SubMergeField( - name: "Is Registered?", - type: SubMergeField.TypeEnum.Checkbox - ); - - var subFieldOptions = new SubFieldOptions( - dateFormat: SubFieldOptions.DateFormatEnum.DDMMYYYY - ); - - var files = new List { - new FileStream( - "./example_signature_request.pdf", - FileMode.Open, - FileAccess.Read, - FileShare.Read - ) - }; - - var data = new TemplateCreateEmbeddedDraftRequest( - clientId: "37dee8d8440c66d54cfa05d92c160882", - files: files, - title: "Test Template", - subject: "Please sign this document", - message: "For your approval", - signerRoles: new List(){role1, role2}, - ccRoles: new List(){"Manager"}, - mergeFields: new List(){mergeField1, mergeField2}, - fieldOptions: subFieldOptions, - testMode: true - ); - - try - { - var result = templateApi.TemplateCreateEmbeddedDraft(data); - Console.WriteLine(result); - } - catch (ApiException e) - { - Console.WriteLine("Exception when calling Dropbox Sign API: " + e.Message); - Console.WriteLine("Status Code: " + e.ErrorCode); - Console.WriteLine(e.StackTrace); - } - } -} diff --git a/examples/TemplateCreateEmbeddedDraftExample.cs b/examples/TemplateCreateEmbeddedDraftExample.cs new file mode 100644 index 0000000..e26574c --- /dev/null +++ b/examples/TemplateCreateEmbeddedDraftExample.cs @@ -0,0 +1,92 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Text.Json; + +using Dropbox.Sign.Api; +using Dropbox.Sign.Client; +using Dropbox.Sign.Model; + +namespace Dropbox.SignSandbox; + +public class TemplateCreateEmbeddedDraftExample +{ + public static void Run() + { + var config = new Configuration(); + config.Username = "YOUR_API_KEY"; + // config.AccessToken = "YOUR_ACCESS_TOKEN"; + + var fieldOptions = new SubFieldOptions( + dateFormat: SubFieldOptions.DateFormatEnum.DD_MM_YYYY + ); + + var mergeFields1 = new SubMergeField( + name: "Full Name", + type: SubMergeField.TypeEnum.Text + ); + + var mergeFields2 = new SubMergeField( + name: "Is Registered?", + type: SubMergeField.TypeEnum.Checkbox + ); + + var mergeFields = new List + { + mergeFields1, + mergeFields2, + }; + + var signerRoles1 = new SubTemplateRole( + name: "Client", + order: 0 + ); + + var signerRoles2 = new SubTemplateRole( + name: "Witness", + order: 1 + ); + + var signerRoles = new List + { + signerRoles1, + signerRoles2, + }; + + var templateCreateEmbeddedDraftRequest = new TemplateCreateEmbeddedDraftRequest( + clientId: "37dee8d8440c66d54cfa05d92c160882", + message: "For your approval", + subject: "Please sign this document", + testMode: true, + title: "Test Template", + ccRoles: [ + "Manager", + ], + files: new List + { + new FileStream( + path: "./example_signature_request.pdf", + mode: FileMode.Open + ), + }, + fieldOptions: fieldOptions, + mergeFields: mergeFields, + signerRoles: signerRoles + ); + + try + { + var response = new TemplateApi(config).TemplateCreateEmbeddedDraft( + templateCreateEmbeddedDraftRequest: templateCreateEmbeddedDraftRequest + ); + + Console.WriteLine(response); + } + catch (ApiException e) + { + Console.WriteLine("Exception when calling TemplateApi#TemplateCreateEmbeddedDraft: " + e.Message); + Console.WriteLine("Status Code: " + e.ErrorCode); + Console.WriteLine(e.StackTrace); + } + } +} diff --git a/examples/TemplateCreateEmbeddedDraftFormFieldGroupsExample.cs b/examples/TemplateCreateEmbeddedDraftFormFieldGroupsExample.cs new file mode 100644 index 0000000..2603e2c --- /dev/null +++ b/examples/TemplateCreateEmbeddedDraftFormFieldGroupsExample.cs @@ -0,0 +1,139 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Text.Json; + +using Dropbox.Sign.Api; +using Dropbox.Sign.Client; +using Dropbox.Sign.Model; + +namespace Dropbox.SignSandbox; + +public class TemplateCreateEmbeddedDraftFormFieldGroupsExample +{ + public static void Run() + { + var config = new Configuration(); + config.Username = "YOUR_API_KEY"; + // config.AccessToken = "YOUR_ACCESS_TOKEN"; + + var fieldOptions = new SubFieldOptions( + dateFormat: SubFieldOptions.DateFormatEnum.DD_MM_YYYY + ); + + var formFieldGroups1 = new SubFormFieldGroup( + groupId: "RadioItemGroup1", + groupLabel: "Radio Item Group 1", + requirement: "require_0-1" + ); + + var formFieldGroups = new List + { + formFieldGroups1, + }; + + var formFieldsPerDocument1 = new SubFormFieldsPerDocumentRadio( + documentIndex: 0, + apiId: "uniqueIdHere_1", + type: "radio", + required: false, + signer: "0", + width: 18, + height: 18, + x: 112, + y: 328, + group: "RadioItemGroup1", + isChecked: true, + name: "", + page: 1 + ); + + var formFieldsPerDocument2 = new SubFormFieldsPerDocumentRadio( + documentIndex: 0, + apiId: "uniqueIdHere_2", + type: "radio", + required: false, + signer: "0", + width: 18, + height: 18, + x: 112, + y: 370, + group: "RadioItemGroup1", + isChecked: false, + name: "", + page: 1 + ); + + var formFieldsPerDocument = new List + { + formFieldsPerDocument1, + formFieldsPerDocument2, + }; + + var mergeFields1 = new SubMergeField( + name: "Full Name", + type: SubMergeField.TypeEnum.Text + ); + + var mergeFields2 = new SubMergeField( + name: "Is Registered?", + type: SubMergeField.TypeEnum.Checkbox + ); + + var mergeFields = new List + { + mergeFields1, + mergeFields2, + }; + + var signerRoles1 = new SubTemplateRole( + name: "Client", + order: 0 + ); + + var signerRoles2 = new SubTemplateRole( + name: "Witness", + order: 1 + ); + + var signerRoles = new List + { + signerRoles1, + signerRoles2, + }; + + var templateCreateEmbeddedDraftRequest = new TemplateCreateEmbeddedDraftRequest( + clientId: "37dee8d8440c66d54cfa05d92c160882", + message: "For your approval", + subject: "Please sign this document", + testMode: true, + title: "Test Template", + fileUrls: [ + "https://www.dropbox.com/s/ad9qnhbrjjn64tu/mutual-NDA-example.pdf?dl=1", + ], + ccRoles: [ + "Manager", + ], + fieldOptions: fieldOptions, + formFieldGroups: formFieldGroups, + formFieldsPerDocument: formFieldsPerDocument, + mergeFields: mergeFields, + signerRoles: signerRoles + ); + + try + { + var response = new TemplateApi(config).TemplateCreateEmbeddedDraft( + templateCreateEmbeddedDraftRequest: templateCreateEmbeddedDraftRequest + ); + + Console.WriteLine(response); + } + catch (ApiException e) + { + Console.WriteLine("Exception when calling TemplateApi#TemplateCreateEmbeddedDraft: " + e.Message); + Console.WriteLine("Status Code: " + e.ErrorCode); + Console.WriteLine(e.StackTrace); + } + } +} diff --git a/examples/TemplateCreateEmbeddedDraftFormFieldRulesExample.cs b/examples/TemplateCreateEmbeddedDraftFormFieldRulesExample.cs new file mode 100644 index 0000000..e4edd18 --- /dev/null +++ b/examples/TemplateCreateEmbeddedDraftFormFieldRulesExample.cs @@ -0,0 +1,159 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Text.Json; + +using Dropbox.Sign.Api; +using Dropbox.Sign.Client; +using Dropbox.Sign.Model; + +namespace Dropbox.SignSandbox; + +public class TemplateCreateEmbeddedDraftFormFieldRulesExample +{ + public static void Run() + { + var config = new Configuration(); + config.Username = "YOUR_API_KEY"; + // config.AccessToken = "YOUR_ACCESS_TOKEN"; + + var formFieldRules1Triggers1 = new SubFormFieldRuleTrigger( + id: "uniqueIdHere_1", + varOperator: SubFormFieldRuleTrigger.OperatorEnum.Is, + value: "foo" + ); + + var formFieldRules1Triggers = new List + { + formFieldRules1Triggers1, + }; + + var formFieldRules1Actions1 = new SubFormFieldRuleAction( + hidden: true, + type: SubFormFieldRuleAction.TypeEnum.ChangeFieldVisibility, + fieldId: "uniqueIdHere_2" + ); + + var formFieldRules1Actions = new List + { + formFieldRules1Actions1, + }; + + var fieldOptions = new SubFieldOptions( + dateFormat: SubFieldOptions.DateFormatEnum.DD_MM_YYYY + ); + + var formFieldRules1 = new SubFormFieldRule( + id: "rule_1", + triggerOperator: "AND", + triggers: formFieldRules1Triggers, + actions: formFieldRules1Actions + ); + + var formFieldRules = new List + { + formFieldRules1, + }; + + var formFieldsPerDocument1 = new SubFormFieldsPerDocumentText( + documentIndex: 0, + apiId: "uniqueIdHere_1", + type: "text", + required: true, + signer: "0", + width: 100, + height: 16, + x: 112, + y: 328, + name: "", + page: 1, + validationType: SubFormFieldsPerDocumentText.ValidationTypeEnum.NumbersOnly + ); + + var formFieldsPerDocument2 = new SubFormFieldsPerDocumentSignature( + documentIndex: 0, + apiId: "uniqueIdHere_2", + type: "signature", + required: true, + signer: "0", + width: 120, + height: 30, + x: 530, + y: 415, + name: "", + page: 1 + ); + + var formFieldsPerDocument = new List + { + formFieldsPerDocument1, + formFieldsPerDocument2, + }; + + var mergeFields1 = new SubMergeField( + name: "Full Name", + type: SubMergeField.TypeEnum.Text + ); + + var mergeFields2 = new SubMergeField( + name: "Is Registered?", + type: SubMergeField.TypeEnum.Checkbox + ); + + var mergeFields = new List + { + mergeFields1, + mergeFields2, + }; + + var signerRoles1 = new SubTemplateRole( + name: "Client", + order: 0 + ); + + var signerRoles2 = new SubTemplateRole( + name: "Witness", + order: 1 + ); + + var signerRoles = new List + { + signerRoles1, + signerRoles2, + }; + + var templateCreateEmbeddedDraftRequest = new TemplateCreateEmbeddedDraftRequest( + clientId: "37dee8d8440c66d54cfa05d92c160882", + message: "For your approval", + subject: "Please sign this document", + testMode: true, + title: "Test Template", + fileUrls: [ + "https://www.dropbox.com/s/ad9qnhbrjjn64tu/mutual-NDA-example.pdf?dl=1", + ], + ccRoles: [ + "Manager", + ], + fieldOptions: fieldOptions, + formFieldRules: formFieldRules, + formFieldsPerDocument: formFieldsPerDocument, + mergeFields: mergeFields, + signerRoles: signerRoles + ); + + try + { + var response = new TemplateApi(config).TemplateCreateEmbeddedDraft( + templateCreateEmbeddedDraftRequest: templateCreateEmbeddedDraftRequest + ); + + Console.WriteLine(response); + } + catch (ApiException e) + { + Console.WriteLine("Exception when calling TemplateApi#TemplateCreateEmbeddedDraft: " + e.Message); + Console.WriteLine("Status Code: " + e.ErrorCode); + Console.WriteLine(e.StackTrace); + } + } +} diff --git a/examples/TemplateCreateEmbeddedDraftFormFieldsPerDocumentExample.cs b/examples/TemplateCreateEmbeddedDraftFormFieldsPerDocumentExample.cs new file mode 100644 index 0000000..cb3fd77 --- /dev/null +++ b/examples/TemplateCreateEmbeddedDraftFormFieldsPerDocumentExample.cs @@ -0,0 +1,125 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Text.Json; + +using Dropbox.Sign.Api; +using Dropbox.Sign.Client; +using Dropbox.Sign.Model; + +namespace Dropbox.SignSandbox; + +public class TemplateCreateEmbeddedDraftFormFieldsPerDocumentExample +{ + public static void Run() + { + var config = new Configuration(); + config.Username = "YOUR_API_KEY"; + // config.AccessToken = "YOUR_ACCESS_TOKEN"; + + var fieldOptions = new SubFieldOptions( + dateFormat: SubFieldOptions.DateFormatEnum.DD_MM_YYYY + ); + + var formFieldsPerDocument1 = new SubFormFieldsPerDocumentText( + documentIndex: 0, + apiId: "uniqueIdHere_1", + type: "text", + required: true, + signer: "1", + width: 100, + height: 16, + x: 112, + y: 328, + name: "", + page: 1, + placeholder: "", + validationType: SubFormFieldsPerDocumentText.ValidationTypeEnum.NumbersOnly + ); + + var formFieldsPerDocument2 = new SubFormFieldsPerDocumentSignature( + documentIndex: 0, + apiId: "uniqueIdHere_2", + type: "signature", + required: true, + signer: "0", + width: 120, + height: 30, + x: 530, + y: 415, + name: "", + page: 1 + ); + + var formFieldsPerDocument = new List + { + formFieldsPerDocument1, + formFieldsPerDocument2, + }; + + var mergeFields1 = new SubMergeField( + name: "Full Name", + type: SubMergeField.TypeEnum.Text + ); + + var mergeFields2 = new SubMergeField( + name: "Is Registered?", + type: SubMergeField.TypeEnum.Checkbox + ); + + var mergeFields = new List + { + mergeFields1, + mergeFields2, + }; + + var signerRoles1 = new SubTemplateRole( + name: "Client", + order: 0 + ); + + var signerRoles2 = new SubTemplateRole( + name: "Witness", + order: 1 + ); + + var signerRoles = new List + { + signerRoles1, + signerRoles2, + }; + + var templateCreateEmbeddedDraftRequest = new TemplateCreateEmbeddedDraftRequest( + clientId: "37dee8d8440c66d54cfa05d92c160882", + message: "For your approval", + subject: "Please sign this document", + testMode: true, + title: "Test Template", + fileUrls: [ + "https://www.dropbox.com/s/ad9qnhbrjjn64tu/mutual-NDA-example.pdf?dl=1", + ], + ccRoles: [ + "Manager", + ], + fieldOptions: fieldOptions, + formFieldsPerDocument: formFieldsPerDocument, + mergeFields: mergeFields, + signerRoles: signerRoles + ); + + try + { + var response = new TemplateApi(config).TemplateCreateEmbeddedDraft( + templateCreateEmbeddedDraftRequest: templateCreateEmbeddedDraftRequest + ); + + Console.WriteLine(response); + } + catch (ApiException e) + { + Console.WriteLine("Exception when calling TemplateApi#TemplateCreateEmbeddedDraft: " + e.Message); + Console.WriteLine("Status Code: " + e.ErrorCode); + Console.WriteLine(e.StackTrace); + } + } +} diff --git a/examples/TemplateCreateExample.cs b/examples/TemplateCreateExample.cs new file mode 100644 index 0000000..09fad4b --- /dev/null +++ b/examples/TemplateCreateExample.cs @@ -0,0 +1,129 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Text.Json; + +using Dropbox.Sign.Api; +using Dropbox.Sign.Client; +using Dropbox.Sign.Model; + +namespace Dropbox.SignSandbox; + +public class TemplateCreateExample +{ + public static void Run() + { + var config = new Configuration(); + config.Username = "YOUR_API_KEY"; + // config.AccessToken = "YOUR_ACCESS_TOKEN"; + + var fieldOptions = new SubFieldOptions( + dateFormat: SubFieldOptions.DateFormatEnum.DD_MM_YYYY + ); + + var signerRoles1 = new SubTemplateRole( + name: "Client", + order: 0 + ); + + var signerRoles2 = new SubTemplateRole( + name: "Witness", + order: 1 + ); + + var signerRoles = new List + { + signerRoles1, + signerRoles2, + }; + + var formFieldsPerDocument1 = new SubFormFieldsPerDocumentText( + documentIndex: 0, + apiId: "uniqueIdHere_1", + type: "text", + required: true, + signer: "1", + width: 100, + height: 16, + x: 112, + y: 328, + name: "", + page: 1, + placeholder: "", + validationType: SubFormFieldsPerDocumentText.ValidationTypeEnum.NumbersOnly + ); + + var formFieldsPerDocument2 = new SubFormFieldsPerDocumentSignature( + documentIndex: 0, + apiId: "uniqueIdHere_2", + type: "signature", + required: true, + signer: "0", + width: 120, + height: 30, + x: 530, + y: 415, + name: "", + page: 1 + ); + + var formFieldsPerDocument = new List + { + formFieldsPerDocument1, + formFieldsPerDocument2, + }; + + var mergeFields1 = new SubMergeField( + name: "Full Name", + type: SubMergeField.TypeEnum.Text + ); + + var mergeFields2 = new SubMergeField( + name: "Is Registered?", + type: SubMergeField.TypeEnum.Checkbox + ); + + var mergeFields = new List + { + mergeFields1, + mergeFields2, + }; + + var templateCreateRequest = new TemplateCreateRequest( + clientId: "37dee8d8440c66d54cfa05d92c160882", + message: "For your approval", + subject: "Please sign this document", + testMode: true, + title: "Test Template", + ccRoles: [ + "Manager", + ], + files: new List + { + new FileStream( + path: "./example_signature_request.pdf", + mode: FileMode.Open + ), + }, + fieldOptions: fieldOptions, + signerRoles: signerRoles, + formFieldsPerDocument: formFieldsPerDocument, + mergeFields: mergeFields + ); + + try + { + var response = new TemplateApi(config).TemplateCreate( + templateCreateRequest: templateCreateRequest + ); + + Console.WriteLine(response); + } + catch (ApiException e) + { + Console.WriteLine("Exception when calling TemplateApi#TemplateCreate: " + e.Message); + Console.WriteLine("Status Code: " + e.ErrorCode); + Console.WriteLine(e.StackTrace); + } + } +} diff --git a/examples/TemplateCreateFormFieldGroupsExample.cs b/examples/TemplateCreateFormFieldGroupsExample.cs new file mode 100644 index 0000000..b8c56e7 --- /dev/null +++ b/examples/TemplateCreateFormFieldGroupsExample.cs @@ -0,0 +1,139 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Text.Json; + +using Dropbox.Sign.Api; +using Dropbox.Sign.Client; +using Dropbox.Sign.Model; + +namespace Dropbox.SignSandbox; + +public class TemplateCreateFormFieldGroupsExample +{ + public static void Run() + { + var config = new Configuration(); + config.Username = "YOUR_API_KEY"; + // config.AccessToken = "YOUR_ACCESS_TOKEN"; + + var fieldOptions = new SubFieldOptions( + dateFormat: SubFieldOptions.DateFormatEnum.DD_MM_YYYY + ); + + var signerRoles1 = new SubTemplateRole( + name: "Client", + order: 0 + ); + + var signerRoles2 = new SubTemplateRole( + name: "Witness", + order: 1 + ); + + var signerRoles = new List + { + signerRoles1, + signerRoles2, + }; + + var formFieldsPerDocument1 = new SubFormFieldsPerDocumentRadio( + documentIndex: 0, + apiId: "uniqueIdHere_1", + type: "radio", + required: false, + signer: "0", + width: 18, + height: 18, + x: 112, + y: 328, + group: "RadioItemGroup1", + isChecked: true, + name: "", + page: 1 + ); + + var formFieldsPerDocument2 = new SubFormFieldsPerDocumentRadio( + documentIndex: 0, + apiId: "uniqueIdHere_2", + type: "radio", + required: false, + signer: "0", + width: 18, + height: 18, + x: 112, + y: 370, + group: "RadioItemGroup1", + isChecked: false, + name: "", + page: 1 + ); + + var formFieldsPerDocument = new List + { + formFieldsPerDocument1, + formFieldsPerDocument2, + }; + + var formFieldGroups1 = new SubFormFieldGroup( + groupId: "RadioItemGroup1", + groupLabel: "Radio Item Group 1", + requirement: "require_0-1" + ); + + var formFieldGroups = new List + { + formFieldGroups1, + }; + + var mergeFields1 = new SubMergeField( + name: "Full Name", + type: SubMergeField.TypeEnum.Text + ); + + var mergeFields2 = new SubMergeField( + name: "Is Registered?", + type: SubMergeField.TypeEnum.Checkbox + ); + + var mergeFields = new List + { + mergeFields1, + mergeFields2, + }; + + var templateCreateRequest = new TemplateCreateRequest( + clientId: "37dee8d8440c66d54cfa05d92c160882", + message: "For your approval", + subject: "Please sign this document", + testMode: true, + title: "Test Template", + fileUrls: [ + "https://www.dropbox.com/s/ad9qnhbrjjn64tu/mutual-NDA-example.pdf?dl=1", + ], + ccRoles: [ + "Manager", + ], + fieldOptions: fieldOptions, + signerRoles: signerRoles, + formFieldsPerDocument: formFieldsPerDocument, + formFieldGroups: formFieldGroups, + mergeFields: mergeFields + ); + + try + { + var response = new TemplateApi(config).TemplateCreate( + templateCreateRequest: templateCreateRequest + ); + + Console.WriteLine(response); + } + catch (ApiException e) + { + Console.WriteLine("Exception when calling TemplateApi#TemplateCreate: " + e.Message); + Console.WriteLine("Status Code: " + e.ErrorCode); + Console.WriteLine(e.StackTrace); + } + } +} diff --git a/examples/TemplateCreateFormFieldRulesExample.cs b/examples/TemplateCreateFormFieldRulesExample.cs new file mode 100644 index 0000000..9b3fcf1 --- /dev/null +++ b/examples/TemplateCreateFormFieldRulesExample.cs @@ -0,0 +1,159 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Text.Json; + +using Dropbox.Sign.Api; +using Dropbox.Sign.Client; +using Dropbox.Sign.Model; + +namespace Dropbox.SignSandbox; + +public class TemplateCreateFormFieldRulesExample +{ + public static void Run() + { + var config = new Configuration(); + config.Username = "YOUR_API_KEY"; + // config.AccessToken = "YOUR_ACCESS_TOKEN"; + + var formFieldRules1Triggers1 = new SubFormFieldRuleTrigger( + id: "uniqueIdHere_1", + varOperator: SubFormFieldRuleTrigger.OperatorEnum.Is, + value: "foo" + ); + + var formFieldRules1Triggers = new List + { + formFieldRules1Triggers1, + }; + + var formFieldRules1Actions1 = new SubFormFieldRuleAction( + hidden: true, + type: SubFormFieldRuleAction.TypeEnum.ChangeFieldVisibility, + fieldId: "uniqueIdHere_2" + ); + + var formFieldRules1Actions = new List + { + formFieldRules1Actions1, + }; + + var fieldOptions = new SubFieldOptions( + dateFormat: SubFieldOptions.DateFormatEnum.DD_MM_YYYY + ); + + var signerRoles1 = new SubTemplateRole( + name: "Client", + order: 0 + ); + + var signerRoles2 = new SubTemplateRole( + name: "Witness", + order: 1 + ); + + var signerRoles = new List + { + signerRoles1, + signerRoles2, + }; + + var formFieldsPerDocument1 = new SubFormFieldsPerDocumentText( + documentIndex: 0, + apiId: "uniqueIdHere_1", + type: "text", + required: true, + signer: "0", + width: 100, + height: 16, + x: 112, + y: 328, + name: "", + page: 1, + validationType: SubFormFieldsPerDocumentText.ValidationTypeEnum.NumbersOnly + ); + + var formFieldsPerDocument2 = new SubFormFieldsPerDocumentSignature( + documentIndex: 0, + apiId: "uniqueIdHere_2", + type: "signature", + required: true, + signer: "0", + width: 120, + height: 30, + x: 530, + y: 415, + name: "", + page: 1 + ); + + var formFieldsPerDocument = new List + { + formFieldsPerDocument1, + formFieldsPerDocument2, + }; + + var formFieldRules1 = new SubFormFieldRule( + id: "rule_1", + triggerOperator: "AND", + triggers: formFieldRules1Triggers, + actions: formFieldRules1Actions + ); + + var formFieldRules = new List + { + formFieldRules1, + }; + + var mergeFields1 = new SubMergeField( + name: "Full Name", + type: SubMergeField.TypeEnum.Text + ); + + var mergeFields2 = new SubMergeField( + name: "Is Registered?", + type: SubMergeField.TypeEnum.Checkbox + ); + + var mergeFields = new List + { + mergeFields1, + mergeFields2, + }; + + var templateCreateRequest = new TemplateCreateRequest( + clientId: "37dee8d8440c66d54cfa05d92c160882", + message: "For your approval", + subject: "Please sign this document", + testMode: true, + title: "Test Template", + fileUrls: [ + "https://www.dropbox.com/s/ad9qnhbrjjn64tu/mutual-NDA-example.pdf?dl=1", + ], + ccRoles: [ + "Manager", + ], + fieldOptions: fieldOptions, + signerRoles: signerRoles, + formFieldsPerDocument: formFieldsPerDocument, + formFieldRules: formFieldRules, + mergeFields: mergeFields + ); + + try + { + var response = new TemplateApi(config).TemplateCreate( + templateCreateRequest: templateCreateRequest + ); + + Console.WriteLine(response); + } + catch (ApiException e) + { + Console.WriteLine("Exception when calling TemplateApi#TemplateCreate: " + e.Message); + Console.WriteLine("Status Code: " + e.ErrorCode); + Console.WriteLine(e.StackTrace); + } + } +} diff --git a/examples/TemplateCreateFormFieldsPerDocumentExample.cs b/examples/TemplateCreateFormFieldsPerDocumentExample.cs new file mode 100644 index 0000000..503e806 --- /dev/null +++ b/examples/TemplateCreateFormFieldsPerDocumentExample.cs @@ -0,0 +1,125 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Text.Json; + +using Dropbox.Sign.Api; +using Dropbox.Sign.Client; +using Dropbox.Sign.Model; + +namespace Dropbox.SignSandbox; + +public class TemplateCreateFormFieldsPerDocumentExample +{ + public static void Run() + { + var config = new Configuration(); + config.Username = "YOUR_API_KEY"; + // config.AccessToken = "YOUR_ACCESS_TOKEN"; + + var fieldOptions = new SubFieldOptions( + dateFormat: SubFieldOptions.DateFormatEnum.DD_MM_YYYY + ); + + var signerRoles1 = new SubTemplateRole( + name: "Client", + order: 0 + ); + + var signerRoles2 = new SubTemplateRole( + name: "Witness", + order: 1 + ); + + var signerRoles = new List + { + signerRoles1, + signerRoles2, + }; + + var formFieldsPerDocument1 = new SubFormFieldsPerDocumentText( + documentIndex: 0, + apiId: "uniqueIdHere_1", + type: "text", + required: true, + signer: "1", + width: 100, + height: 16, + x: 112, + y: 328, + name: "", + page: 1, + placeholder: "", + validationType: SubFormFieldsPerDocumentText.ValidationTypeEnum.NumbersOnly + ); + + var formFieldsPerDocument2 = new SubFormFieldsPerDocumentSignature( + documentIndex: 0, + apiId: "uniqueIdHere_2", + type: "signature", + required: true, + signer: "0", + width: 120, + height: 30, + x: 530, + y: 415, + name: "", + page: 1 + ); + + var formFieldsPerDocument = new List + { + formFieldsPerDocument1, + formFieldsPerDocument2, + }; + + var mergeFields1 = new SubMergeField( + name: "Full Name", + type: SubMergeField.TypeEnum.Text + ); + + var mergeFields2 = new SubMergeField( + name: "Is Registered?", + type: SubMergeField.TypeEnum.Checkbox + ); + + var mergeFields = new List + { + mergeFields1, + mergeFields2, + }; + + var templateCreateRequest = new TemplateCreateRequest( + clientId: "37dee8d8440c66d54cfa05d92c160882", + message: "For your approval", + subject: "Please sign this document", + testMode: true, + title: "Test Template", + fileUrls: [ + "https://www.dropbox.com/s/ad9qnhbrjjn64tu/mutual-NDA-example.pdf?dl=1", + ], + ccRoles: [ + "Manager", + ], + fieldOptions: fieldOptions, + signerRoles: signerRoles, + formFieldsPerDocument: formFieldsPerDocument, + mergeFields: mergeFields + ); + + try + { + var response = new TemplateApi(config).TemplateCreate( + templateCreateRequest: templateCreateRequest + ); + + Console.WriteLine(response); + } + catch (ApiException e) + { + Console.WriteLine("Exception when calling TemplateApi#TemplateCreate: " + e.Message); + Console.WriteLine("Status Code: " + e.ErrorCode); + Console.WriteLine(e.StackTrace); + } + } +} diff --git a/examples/TemplateDelete.cs b/examples/TemplateDelete.cs deleted file mode 100644 index 2740496..0000000 --- a/examples/TemplateDelete.cs +++ /dev/null @@ -1,33 +0,0 @@ -using System; -using System.Collections.Generic; -using Dropbox.Sign.Api; -using Dropbox.Sign.Client; -using Dropbox.Sign.Model; - -public class Example -{ - public static void Main() - { - var config = new Configuration(); - // Configure HTTP basic authorization: api_key - config.Username = "YOUR_API_KEY"; - - // or, configure Bearer (JWT) authorization: oauth2 - // config.AccessToken = "YOUR_BEARER_TOKEN"; - - var templateApi = new TemplateApi(config); - - var templateId = "f57db65d3f933b5316d398057a36176831451a35"; - - try - { - templateApi.TemplateDelete(templateId); - } - catch (ApiException e) - { - Console.WriteLine("Exception when calling Dropbox Sign API: " + e.Message); - Console.WriteLine("Status Code: " + e.ErrorCode); - Console.WriteLine(e.StackTrace); - } - } -} diff --git a/examples/TemplateDeleteExample.cs b/examples/TemplateDeleteExample.cs new file mode 100644 index 0000000..5a49ea0 --- /dev/null +++ b/examples/TemplateDeleteExample.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Text.Json; + +using Dropbox.Sign.Api; +using Dropbox.Sign.Client; +using Dropbox.Sign.Model; + +namespace Dropbox.SignSandbox; + +public class TemplateDeleteExample +{ + public static void Run() + { + var config = new Configuration(); + config.Username = "YOUR_API_KEY"; + // config.AccessToken = "YOUR_ACCESS_TOKEN"; + + try + { + new TemplateApi(config).TemplateDelete( + templateId: "f57db65d3f933b5316d398057a36176831451a35" + ); + } + catch (ApiException e) + { + Console.WriteLine("Exception when calling TemplateApi#TemplateDelete: " + e.Message); + Console.WriteLine("Status Code: " + e.ErrorCode); + Console.WriteLine(e.StackTrace); + } + } +} diff --git a/examples/TemplateFiles.cs b/examples/TemplateFiles.cs deleted file mode 100644 index db4d641..0000000 --- a/examples/TemplateFiles.cs +++ /dev/null @@ -1,38 +0,0 @@ -using System; -using System.Collections.Generic; -using Dropbox.Sign.Api; -using Dropbox.Sign.Client; -using Dropbox.Sign.Model; - -public class Example -{ - public static void Main() - { - var config = new Configuration(); - // Configure HTTP basic authorization: api_key - config.Username = "YOUR_API_KEY"; - - // or, configure Bearer (JWT) authorization: oauth2 - // config.AccessToken = "YOUR_BEARER_TOKEN"; - - var templateApi = new TemplateApi(config); - - var templateId = "f57db65d3f933b5316d398057a36176831451a35"; - - try - { - var result = templateApi.TemplateFiles(templateId, "pdf"); - - var fileStream = File.Create("file_response.pdf"); - result.Seek(0, SeekOrigin.Begin); - result.CopyTo(fileStream); - fileStream.Close(); - } - catch (ApiException e) - { - Console.WriteLine("Exception when calling Dropbox Sign API: " + e.Message); - Console.WriteLine("Status Code: " + e.ErrorCode); - Console.WriteLine(e.StackTrace); - } - } -} diff --git a/examples/TemplateFilesAsDataUri.cs b/examples/TemplateFilesAsDataUri.cs deleted file mode 100644 index 0d999f5..0000000 --- a/examples/TemplateFilesAsDataUri.cs +++ /dev/null @@ -1,34 +0,0 @@ -using System; -using System.Collections.Generic; -using Dropbox.Sign.Api; -using Dropbox.Sign.Client; -using Dropbox.Sign.Model; - -public class Example -{ - public static void Main() - { - var config = new Configuration(); - // Configure HTTP basic authorization: api_key - config.Username = "YOUR_API_KEY"; - - // or, configure Bearer (JWT) authorization: oauth2 - // config.AccessToken = "YOUR_BEARER_TOKEN"; - - var templateApi = new TemplateApi(config); - - var templateId = "f57db65d3f933b5316d398057a36176831451a35"; - - try - { - var result = templateApi.TemplateFilesAsDataUri(templateId, "pdf", false, false); - Console.WriteLine(result); - } - catch (ApiException e) - { - Console.WriteLine("Exception when calling Dropbox Sign API: " + e.Message); - Console.WriteLine("Status Code: " + e.ErrorCode); - Console.WriteLine(e.StackTrace); - } - } -} diff --git a/examples/TemplateFilesAsDataUriExample.cs b/examples/TemplateFilesAsDataUriExample.cs new file mode 100644 index 0000000..5c946b8 --- /dev/null +++ b/examples/TemplateFilesAsDataUriExample.cs @@ -0,0 +1,35 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Text.Json; + +using Dropbox.Sign.Api; +using Dropbox.Sign.Client; +using Dropbox.Sign.Model; + +namespace Dropbox.SignSandbox; + +public class TemplateFilesAsDataUriExample +{ + public static void Run() + { + var config = new Configuration(); + config.Username = "YOUR_API_KEY"; + // config.AccessToken = "YOUR_ACCESS_TOKEN"; + + try + { + var response = new TemplateApi(config).TemplateFilesAsDataUri( + templateId: "f57db65d3f933b5316d398057a36176831451a35" + ); + + Console.WriteLine(response); + } + catch (ApiException e) + { + Console.WriteLine("Exception when calling TemplateApi#TemplateFilesAsDataUri: " + e.Message); + Console.WriteLine("Status Code: " + e.ErrorCode); + Console.WriteLine(e.StackTrace); + } + } +} diff --git a/examples/TemplateFilesAsFileUrl.cs b/examples/TemplateFilesAsFileUrl.cs deleted file mode 100644 index 4bdc39d..0000000 --- a/examples/TemplateFilesAsFileUrl.cs +++ /dev/null @@ -1,34 +0,0 @@ -using System; -using System.Collections.Generic; -using Dropbox.Sign.Api; -using Dropbox.Sign.Client; -using Dropbox.Sign.Model; - -public class Example -{ - public static void Main() - { - var config = new Configuration(); - // Configure HTTP basic authorization: api_key - config.Username = "YOUR_API_KEY"; - - // or, configure Bearer (JWT) authorization: oauth2 - // config.AccessToken = "YOUR_BEARER_TOKEN"; - - var templateApi = new TemplateApi(config); - - var templateId = "f57db65d3f933b5316d398057a36176831451a35"; - - try - { - var result = templateApi.TemplateFilesAsFileUrl(templateId, "pdf", false, false); - Console.WriteLine(result); - } - catch (ApiException e) - { - Console.WriteLine("Exception when calling Dropbox Sign API: " + e.Message); - Console.WriteLine("Status Code: " + e.ErrorCode); - Console.WriteLine(e.StackTrace); - } - } -} diff --git a/examples/TemplateFilesAsFileUrlExample.cs b/examples/TemplateFilesAsFileUrlExample.cs new file mode 100644 index 0000000..3b5bc98 --- /dev/null +++ b/examples/TemplateFilesAsFileUrlExample.cs @@ -0,0 +1,36 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Text.Json; + +using Dropbox.Sign.Api; +using Dropbox.Sign.Client; +using Dropbox.Sign.Model; + +namespace Dropbox.SignSandbox; + +public class TemplateFilesAsFileUrlExample +{ + public static void Run() + { + var config = new Configuration(); + config.Username = "YOUR_API_KEY"; + // config.AccessToken = "YOUR_ACCESS_TOKEN"; + + try + { + var response = new TemplateApi(config).TemplateFilesAsFileUrl( + templateId: "f57db65d3f933b5316d398057a36176831451a35", + forceDownload: 1 + ); + + Console.WriteLine(response); + } + catch (ApiException e) + { + Console.WriteLine("Exception when calling TemplateApi#TemplateFilesAsFileUrl: " + e.Message); + Console.WriteLine("Status Code: " + e.ErrorCode); + Console.WriteLine(e.StackTrace); + } + } +} diff --git a/examples/TemplateFilesExample.cs b/examples/TemplateFilesExample.cs new file mode 100644 index 0000000..0cf55f3 --- /dev/null +++ b/examples/TemplateFilesExample.cs @@ -0,0 +1,37 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Text.Json; + +using Dropbox.Sign.Api; +using Dropbox.Sign.Client; +using Dropbox.Sign.Model; + +namespace Dropbox.SignSandbox; + +public class TemplateFilesExample +{ + public static void Run() + { + var config = new Configuration(); + config.Username = "YOUR_API_KEY"; + // config.AccessToken = "YOUR_ACCESS_TOKEN"; + + try + { + var response = new TemplateApi(config).TemplateFiles( + templateId: "f57db65d3f933b5316d398057a36176831451a35" + ); + var fileStream = File.Create("./file_response"); + response.Seek(0, SeekOrigin.Begin); + response.CopyTo(fileStream); + fileStream.Close(); + } + catch (ApiException e) + { + Console.WriteLine("Exception when calling TemplateApi#TemplateFiles: " + e.Message); + Console.WriteLine("Status Code: " + e.ErrorCode); + Console.WriteLine(e.StackTrace); + } + } +} diff --git a/examples/TemplateGet.cs b/examples/TemplateGet.cs deleted file mode 100644 index 8354820..0000000 --- a/examples/TemplateGet.cs +++ /dev/null @@ -1,34 +0,0 @@ -using System; -using System.Collections.Generic; -using Dropbox.Sign.Api; -using Dropbox.Sign.Client; -using Dropbox.Sign.Model; - -public class Example -{ - public static void Main() - { - var config = new Configuration(); - // Configure HTTP basic authorization: api_key - config.Username = "YOUR_API_KEY"; - - // or, configure Bearer (JWT) authorization: oauth2 - // config.AccessToken = "YOUR_BEARER_TOKEN"; - - var templateApi = new TemplateApi(config); - - var templateId = "f57db65d3f933b5316d398057a36176831451a35"; - - try - { - var result = templateApi.TemplateGet(templateId); - Console.WriteLine(result); - } - catch (ApiException e) - { - Console.WriteLine("Exception when calling Dropbox Sign API: " + e.Message); - Console.WriteLine("Status Code: " + e.ErrorCode); - Console.WriteLine(e.StackTrace); - } - } -} diff --git a/examples/TemplateGetExample.cs b/examples/TemplateGetExample.cs new file mode 100644 index 0000000..0673000 --- /dev/null +++ b/examples/TemplateGetExample.cs @@ -0,0 +1,35 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Text.Json; + +using Dropbox.Sign.Api; +using Dropbox.Sign.Client; +using Dropbox.Sign.Model; + +namespace Dropbox.SignSandbox; + +public class TemplateGetExample +{ + public static void Run() + { + var config = new Configuration(); + config.Username = "YOUR_API_KEY"; + // config.AccessToken = "YOUR_ACCESS_TOKEN"; + + try + { + var response = new TemplateApi(config).TemplateGet( + templateId: "f57db65d3f933b5316d398057a36176831451a35" + ); + + Console.WriteLine(response); + } + catch (ApiException e) + { + Console.WriteLine("Exception when calling TemplateApi#TemplateGet: " + e.Message); + Console.WriteLine("Status Code: " + e.ErrorCode); + Console.WriteLine(e.StackTrace); + } + } +} diff --git a/examples/TemplateList.cs b/examples/TemplateList.cs deleted file mode 100644 index b6cb40d..0000000 --- a/examples/TemplateList.cs +++ /dev/null @@ -1,34 +0,0 @@ -using System; -using System.Collections.Generic; -using Dropbox.Sign.Api; -using Dropbox.Sign.Client; -using Dropbox.Sign.Model; - -public class Example -{ - public static void Main() - { - var config = new Configuration(); - // Configure HTTP basic authorization: api_key - config.Username = "YOUR_API_KEY"; - - // or, configure Bearer (JWT) authorization: oauth2 - // config.AccessToken = "YOUR_BEARER_TOKEN"; - - var templateApi = new TemplateApi(config); - - var accountId = "f57db65d3f933b5316d398057a36176831451a35"; - - try - { - var result = templateApi.TemplateList(accountId, 1, 20, null); - Console.WriteLine(result); - } - catch (ApiException e) - { - Console.WriteLine("Exception when calling Dropbox Sign API: " + e.Message); - Console.WriteLine("Status Code: " + e.ErrorCode); - Console.WriteLine(e.StackTrace); - } - } -} diff --git a/examples/TemplateListExample.cs b/examples/TemplateListExample.cs new file mode 100644 index 0000000..4d0b900 --- /dev/null +++ b/examples/TemplateListExample.cs @@ -0,0 +1,36 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Text.Json; + +using Dropbox.Sign.Api; +using Dropbox.Sign.Client; +using Dropbox.Sign.Model; + +namespace Dropbox.SignSandbox; + +public class TemplateListExample +{ + public static void Run() + { + var config = new Configuration(); + config.Username = "YOUR_API_KEY"; + // config.AccessToken = "YOUR_ACCESS_TOKEN"; + + try + { + var response = new TemplateApi(config).TemplateList( + page: 1, + pageSize: 20 + ); + + Console.WriteLine(response); + } + catch (ApiException e) + { + Console.WriteLine("Exception when calling TemplateApi#TemplateList: " + e.Message); + Console.WriteLine("Status Code: " + e.ErrorCode); + Console.WriteLine(e.StackTrace); + } + } +} diff --git a/examples/TemplateRemoveUser.cs b/examples/TemplateRemoveUser.cs deleted file mode 100644 index da93c4c..0000000 --- a/examples/TemplateRemoveUser.cs +++ /dev/null @@ -1,38 +0,0 @@ -using System; -using System.Collections.Generic; -using Dropbox.Sign.Api; -using Dropbox.Sign.Client; -using Dropbox.Sign.Model; - -public class Example -{ - public static void Main() - { - var config = new Configuration(); - // Configure HTTP basic authorization: api_key - config.Username = "YOUR_API_KEY"; - - // or, configure Bearer (JWT) authorization: oauth2 - // config.AccessToken = "YOUR_BEARER_TOKEN"; - - var templateApi = new TemplateApi(config); - - var data = new TemplateRemoveUserRequest( - emailAddress: "george@dropboxsign.com" - ); - - var templateId = "21f920ec2b7f4b6bb64d3ed79f26303843046536"; - - try - { - var result = templateApi.TemplateRemoveUser(templateId, data); - Console.WriteLine(result); - } - catch (ApiException e) - { - Console.WriteLine("Exception when calling Dropbox Sign API: " + e.Message); - Console.WriteLine("Status Code: " + e.ErrorCode); - Console.WriteLine(e.StackTrace); - } - } -} diff --git a/examples/TemplateRemoveUserExample.cs b/examples/TemplateRemoveUserExample.cs new file mode 100644 index 0000000..66bcbfe --- /dev/null +++ b/examples/TemplateRemoveUserExample.cs @@ -0,0 +1,40 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Text.Json; + +using Dropbox.Sign.Api; +using Dropbox.Sign.Client; +using Dropbox.Sign.Model; + +namespace Dropbox.SignSandbox; + +public class TemplateRemoveUserExample +{ + public static void Run() + { + var config = new Configuration(); + config.Username = "YOUR_API_KEY"; + // config.AccessToken = "YOUR_ACCESS_TOKEN"; + + var templateRemoveUserRequest = new TemplateRemoveUserRequest( + emailAddress: "george@dropboxsign.com" + ); + + try + { + var response = new TemplateApi(config).TemplateRemoveUser( + templateId: "f57db65d3f933b5316d398057a36176831451a35", + templateRemoveUserRequest: templateRemoveUserRequest + ); + + Console.WriteLine(response); + } + catch (ApiException e) + { + Console.WriteLine("Exception when calling TemplateApi#TemplateRemoveUser: " + e.Message); + Console.WriteLine("Status Code: " + e.ErrorCode); + Console.WriteLine(e.StackTrace); + } + } +} diff --git a/examples/TemplateUpdateFiles.cs b/examples/TemplateUpdateFiles.cs deleted file mode 100644 index 1ac81ef..0000000 --- a/examples/TemplateUpdateFiles.cs +++ /dev/null @@ -1,48 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using Dropbox.Sign.Api; -using Dropbox.Sign.Client; -using Dropbox.Sign.Model; - -public class Example -{ - public static void Main() - { - var config = new Configuration(); - // Configure HTTP basic authorization: api_key - config.Username = "YOUR_API_KEY"; - - // or, configure Bearer (JWT) authorization: oauth2 - // config.AccessToken = "YOUR_BEARER_TOKEN"; - - var templateApi = new TemplateApi(config); - - var files = new List { - new FileStream( - "./example_signature_request.pdf", - FileMode.Open, - FileAccess.Read, - FileShare.Read - ) - }; - - var data = new TemplateUpdateFilesRequest( - files: files - ); - - var templateId = "21f920ec2b7f4b6bb64d3ed79f26303843046536"; - - try - { - var result = templateApi.TemplateUpdateFiles(templateId, data); - Console.WriteLine(result); - } - catch (ApiException e) - { - Console.WriteLine("Exception when calling Dropbox Sign API: " + e.Message); - Console.WriteLine("Status Code: " + e.ErrorCode); - Console.WriteLine(e.StackTrace); - } - } -} diff --git a/examples/TemplateUpdateFilesExample.cs b/examples/TemplateUpdateFilesExample.cs new file mode 100644 index 0000000..1fe2ccf --- /dev/null +++ b/examples/TemplateUpdateFilesExample.cs @@ -0,0 +1,46 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Text.Json; + +using Dropbox.Sign.Api; +using Dropbox.Sign.Client; +using Dropbox.Sign.Model; + +namespace Dropbox.SignSandbox; + +public class TemplateUpdateFilesExample +{ + public static void Run() + { + var config = new Configuration(); + config.Username = "YOUR_API_KEY"; + // config.AccessToken = "YOUR_ACCESS_TOKEN"; + + var templateUpdateFilesRequest = new TemplateUpdateFilesRequest( + files: new List + { + new FileStream( + path: "./example_signature_request.pdf", + mode: FileMode.Open + ), + } + ); + + try + { + var response = new TemplateApi(config).TemplateUpdateFiles( + templateId: "f57db65d3f933b5316d398057a36176831451a35", + templateUpdateFilesRequest: templateUpdateFilesRequest + ); + + Console.WriteLine(response); + } + catch (ApiException e) + { + Console.WriteLine("Exception when calling TemplateApi#TemplateUpdateFiles: " + e.Message); + Console.WriteLine("Status Code: " + e.ErrorCode); + Console.WriteLine(e.StackTrace); + } + } +} diff --git a/examples/UnclaimedDraftCreate.cs b/examples/UnclaimedDraftCreate.cs deleted file mode 100644 index b645322..0000000 --- a/examples/UnclaimedDraftCreate.cs +++ /dev/null @@ -1,85 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using Dropbox.Sign.Api; -using Dropbox.Sign.Client; -using Dropbox.Sign.Model; - -public class Example -{ - public static void Main() - { - var config = new Configuration(); - // Configure HTTP basic authorization: api_key - config.Username = "YOUR_API_KEY"; - - // or, configure Bearer (JWT) authorization: oauth2 - // config.AccessToken = "YOUR_BEARER_TOKEN"; - - var unclaimedDraftApi = new UnclaimedDraftApi(config); - - var signer1 = new SubUnclaimedDraftSigner( - emailAddress: "jack@example.com", - name: "Jack", - order: 0 - ); - - var signer2 = new SubUnclaimedDraftSigner( - emailAddress: "jill@example.com", - name: "Jill", - order: 1 - ); - - var subSigningOptions = new SubSigningOptions( - draw: true, - type: true, - upload: true, - phone: false, - defaultType: SubSigningOptions.DefaultTypeEnum.Draw - ); - - var subFieldOptions = new SubFieldOptions( - dateFormat: SubFieldOptions.DateFormatEnum.DD_MM_YYYY - ); - - var metadata = new Dictionary() - { - ["custom_id"] = 1234, - ["custom_text"] = "NDA #9" - }; - - var files = new List { - new FileStream( - "./example_signature_request.pdf", - FileMode.Open, - FileAccess.Read, - FileShare.Read - ) - }; - - var data = new UnclaimedDraftCreateRequest( - subject: "The NDA we talked about", - type: UnclaimedDraftCreateRequest.TypeEnum.RequestSignature, - message: "Please sign this NDA and then we can discuss more. Let me know if you have any questions.", - signers: new List(){signer1, signer2}, - ccEmailAddresses: new List(){"lawyer1@dropboxsign.com", "lawyer2@dropboxsign.com"}, - files: files, - metadata: metadata, - signingOptions: subSigningOptions, - fieldOptions: subFieldOptions, - testMode: true - ); - - try - { - var result = unclaimedDraftApi.UnclaimedDraftCreate(data); - Console.WriteLine(result); - } - catch (ApiException e) - { - Console.WriteLine("Exception when calling Dropbox Sign API: " + e.Message); - Console.WriteLine("Status Code: " + e.ErrorCode); - Console.WriteLine(e.StackTrace); - } - } -} diff --git a/examples/UnclaimedDraftCreateEmbedded.cs b/examples/UnclaimedDraftCreateEmbedded.cs deleted file mode 100644 index 2946630..0000000 --- a/examples/UnclaimedDraftCreateEmbedded.cs +++ /dev/null @@ -1,49 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using Dropbox.Sign.Api; -using Dropbox.Sign.Client; -using Dropbox.Sign.Model; - -public class Example -{ - public static void Main() - { - var config = new Configuration(); - // Configure HTTP basic authorization: api_key - config.Username = "YOUR_API_KEY"; - - // or, configure Bearer (JWT) authorization: oauth2 - // config.AccessToken = "YOUR_BEARER_TOKEN"; - - var unclaimedDraftApi = new UnclaimedDraftApi(config); - - var files = new List { - new FileStream( - "./example_signature_request.pdf", - FileMode.Open, - FileAccess.Read, - FileShare.Read - ) - }; - - var data = new UnclaimedDraftCreateEmbeddedRequest( - clientId: "ec64a202072370a737edf4a0eb7f4437", - files: files, - requesterEmailAddress: "jack@dropboxsign.com", - testMode: true - ); - - try - { - var result = unclaimedDraftApi.UnclaimedDraftCreateEmbedded(data); - Console.WriteLine(result); - } - catch (ApiException e) - { - Console.WriteLine("Exception when calling Dropbox Sign API: " + e.Message); - Console.WriteLine("Status Code: " + e.ErrorCode); - Console.WriteLine(e.StackTrace); - } - } -} diff --git a/examples/UnclaimedDraftCreateEmbeddedExample.cs b/examples/UnclaimedDraftCreateEmbeddedExample.cs new file mode 100644 index 0000000..4637922 --- /dev/null +++ b/examples/UnclaimedDraftCreateEmbeddedExample.cs @@ -0,0 +1,48 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Text.Json; + +using Dropbox.Sign.Api; +using Dropbox.Sign.Client; +using Dropbox.Sign.Model; + +namespace Dropbox.SignSandbox; + +public class UnclaimedDraftCreateEmbeddedExample +{ + public static void Run() + { + var config = new Configuration(); + config.Username = "YOUR_API_KEY"; + // config.AccessToken = "YOUR_ACCESS_TOKEN"; + + var unclaimedDraftCreateEmbeddedRequest = new UnclaimedDraftCreateEmbeddedRequest( + clientId: "b6b8e7deaf8f0b95c029dca049356d4a2cf9710a", + requesterEmailAddress: "jack@dropboxsign.com", + testMode: true, + files: new List + { + new FileStream( + path: "./example_signature_request.pdf", + mode: FileMode.Open + ), + } + ); + + try + { + var response = new UnclaimedDraftApi(config).UnclaimedDraftCreateEmbedded( + unclaimedDraftCreateEmbeddedRequest: unclaimedDraftCreateEmbeddedRequest + ); + + Console.WriteLine(response); + } + catch (ApiException e) + { + Console.WriteLine("Exception when calling UnclaimedDraftApi#UnclaimedDraftCreateEmbedded: " + e.Message); + Console.WriteLine("Status Code: " + e.ErrorCode); + Console.WriteLine(e.StackTrace); + } + } +} diff --git a/examples/UnclaimedDraftCreateEmbeddedFormFieldGroupsExample.cs b/examples/UnclaimedDraftCreateEmbeddedFormFieldGroupsExample.cs new file mode 100644 index 0000000..58e77d1 --- /dev/null +++ b/examples/UnclaimedDraftCreateEmbeddedFormFieldGroupsExample.cs @@ -0,0 +1,95 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Text.Json; + +using Dropbox.Sign.Api; +using Dropbox.Sign.Client; +using Dropbox.Sign.Model; + +namespace Dropbox.SignSandbox; + +public class UnclaimedDraftCreateEmbeddedFormFieldGroupsExample +{ + public static void Run() + { + var config = new Configuration(); + config.Username = "YOUR_API_KEY"; + // config.AccessToken = "YOUR_ACCESS_TOKEN"; + + var formFieldGroups1 = new SubFormFieldGroup( + groupId: "RadioItemGroup1", + groupLabel: "Radio Item Group 1", + requirement: "require_0-1" + ); + + var formFieldGroups = new List + { + formFieldGroups1, + }; + + var formFieldsPerDocument1 = new SubFormFieldsPerDocumentRadio( + documentIndex: 0, + apiId: "uniqueIdHere_1", + type: "radio", + required: false, + signer: "0", + width: 18, + height: 18, + x: 112, + y: 328, + group: "RadioItemGroup1", + isChecked: true, + name: "", + page: 1 + ); + + var formFieldsPerDocument2 = new SubFormFieldsPerDocumentRadio( + documentIndex: 0, + apiId: "uniqueIdHere_2", + type: "radio", + required: false, + signer: "0", + width: 18, + height: 18, + x: 112, + y: 370, + group: "RadioItemGroup1", + isChecked: false, + name: "", + page: 1 + ); + + var formFieldsPerDocument = new List + { + formFieldsPerDocument1, + formFieldsPerDocument2, + }; + + var unclaimedDraftCreateEmbeddedRequest = new UnclaimedDraftCreateEmbeddedRequest( + clientId: "b6b8e7deaf8f0b95c029dca049356d4a2cf9710a", + requesterEmailAddress: "jack@dropboxsign.com", + testMode: false, + fileUrls: [ + "https://www.dropbox.com/s/ad9qnhbrjjn64tu/mutual-NDA-example.pdf?dl=1", + ], + formFieldGroups: formFieldGroups, + formFieldsPerDocument: formFieldsPerDocument + ); + + try + { + var response = new UnclaimedDraftApi(config).UnclaimedDraftCreateEmbedded( + unclaimedDraftCreateEmbeddedRequest: unclaimedDraftCreateEmbeddedRequest + ); + + Console.WriteLine(response); + } + catch (ApiException e) + { + Console.WriteLine("Exception when calling UnclaimedDraftApi#UnclaimedDraftCreateEmbedded: " + e.Message); + Console.WriteLine("Status Code: " + e.ErrorCode); + Console.WriteLine(e.StackTrace); + } + } +} diff --git a/examples/UnclaimedDraftCreateEmbeddedFormFieldRulesExample.cs b/examples/UnclaimedDraftCreateEmbeddedFormFieldRulesExample.cs new file mode 100644 index 0000000..84dd527 --- /dev/null +++ b/examples/UnclaimedDraftCreateEmbeddedFormFieldRulesExample.cs @@ -0,0 +1,115 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Text.Json; + +using Dropbox.Sign.Api; +using Dropbox.Sign.Client; +using Dropbox.Sign.Model; + +namespace Dropbox.SignSandbox; + +public class UnclaimedDraftCreateEmbeddedFormFieldRulesExample +{ + public static void Run() + { + var config = new Configuration(); + config.Username = "YOUR_API_KEY"; + // config.AccessToken = "YOUR_ACCESS_TOKEN"; + + var formFieldRules1Triggers1 = new SubFormFieldRuleTrigger( + id: "uniqueIdHere_1", + varOperator: SubFormFieldRuleTrigger.OperatorEnum.Is, + value: "foo" + ); + + var formFieldRules1Triggers = new List + { + formFieldRules1Triggers1, + }; + + var formFieldRules1Actions1 = new SubFormFieldRuleAction( + hidden: true, + type: SubFormFieldRuleAction.TypeEnum.ChangeFieldVisibility, + fieldId: "uniqueIdHere_2" + ); + + var formFieldRules1Actions = new List + { + formFieldRules1Actions1, + }; + + var formFieldRules1 = new SubFormFieldRule( + id: "rule_1", + triggerOperator: "AND", + triggers: formFieldRules1Triggers, + actions: formFieldRules1Actions + ); + + var formFieldRules = new List + { + formFieldRules1, + }; + + var formFieldsPerDocument1 = new SubFormFieldsPerDocumentText( + documentIndex: 0, + apiId: "uniqueIdHere_1", + type: "text", + required: true, + signer: "0", + width: 100, + height: 16, + x: 112, + y: 328, + name: "", + page: 1, + validationType: SubFormFieldsPerDocumentText.ValidationTypeEnum.NumbersOnly + ); + + var formFieldsPerDocument2 = new SubFormFieldsPerDocumentSignature( + documentIndex: 0, + apiId: "uniqueIdHere_2", + type: "signature", + required: true, + signer: "0", + width: 120, + height: 30, + x: 530, + y: 415, + name: "", + page: 1 + ); + + var formFieldsPerDocument = new List + { + formFieldsPerDocument1, + formFieldsPerDocument2, + }; + + var unclaimedDraftCreateEmbeddedRequest = new UnclaimedDraftCreateEmbeddedRequest( + clientId: "b6b8e7deaf8f0b95c029dca049356d4a2cf9710a", + requesterEmailAddress: "jack@dropboxsign.com", + testMode: false, + fileUrls: [ + "https://www.dropbox.com/s/ad9qnhbrjjn64tu/mutual-NDA-example.pdf?dl=1", + ], + formFieldRules: formFieldRules, + formFieldsPerDocument: formFieldsPerDocument + ); + + try + { + var response = new UnclaimedDraftApi(config).UnclaimedDraftCreateEmbedded( + unclaimedDraftCreateEmbeddedRequest: unclaimedDraftCreateEmbeddedRequest + ); + + Console.WriteLine(response); + } + catch (ApiException e) + { + Console.WriteLine("Exception when calling UnclaimedDraftApi#UnclaimedDraftCreateEmbedded: " + e.Message); + Console.WriteLine("Status Code: " + e.ErrorCode); + Console.WriteLine(e.StackTrace); + } + } +} diff --git a/examples/UnclaimedDraftCreateEmbeddedFormFieldsPerDocumentExample.cs b/examples/UnclaimedDraftCreateEmbeddedFormFieldsPerDocumentExample.cs new file mode 100644 index 0000000..f9b29f0 --- /dev/null +++ b/examples/UnclaimedDraftCreateEmbeddedFormFieldsPerDocumentExample.cs @@ -0,0 +1,81 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Text.Json; + +using Dropbox.Sign.Api; +using Dropbox.Sign.Client; +using Dropbox.Sign.Model; + +namespace Dropbox.SignSandbox; + +public class UnclaimedDraftCreateEmbeddedFormFieldsPerDocumentExample +{ + public static void Run() + { + var config = new Configuration(); + config.Username = "YOUR_API_KEY"; + // config.AccessToken = "YOUR_ACCESS_TOKEN"; + + var formFieldsPerDocument1 = new SubFormFieldsPerDocumentText( + documentIndex: 0, + apiId: "uniqueIdHere_1", + type: "text", + required: true, + signer: "1", + width: 100, + height: 16, + x: 112, + y: 328, + name: "", + page: 1, + placeholder: "", + validationType: SubFormFieldsPerDocumentText.ValidationTypeEnum.NumbersOnly + ); + + var formFieldsPerDocument2 = new SubFormFieldsPerDocumentSignature( + documentIndex: 0, + apiId: "uniqueIdHere_2", + type: "signature", + required: true, + signer: "0", + width: 120, + height: 30, + x: 530, + y: 415, + name: "", + page: 1 + ); + + var formFieldsPerDocument = new List + { + formFieldsPerDocument1, + formFieldsPerDocument2, + }; + + var unclaimedDraftCreateEmbeddedRequest = new UnclaimedDraftCreateEmbeddedRequest( + clientId: "b6b8e7deaf8f0b95c029dca049356d4a2cf9710a", + requesterEmailAddress: "jack@dropboxsign.com", + testMode: false, + fileUrls: [ + "https://www.dropbox.com/s/ad9qnhbrjjn64tu/mutual-NDA-example.pdf?dl=1", + ], + formFieldsPerDocument: formFieldsPerDocument + ); + + try + { + var response = new UnclaimedDraftApi(config).UnclaimedDraftCreateEmbedded( + unclaimedDraftCreateEmbeddedRequest: unclaimedDraftCreateEmbeddedRequest + ); + + Console.WriteLine(response); + } + catch (ApiException e) + { + Console.WriteLine("Exception when calling UnclaimedDraftApi#UnclaimedDraftCreateEmbedded: " + e.Message); + Console.WriteLine("Status Code: " + e.ErrorCode); + Console.WriteLine(e.StackTrace); + } + } +} diff --git a/examples/UnclaimedDraftCreateEmbeddedWithTemplate.cs b/examples/UnclaimedDraftCreateEmbeddedWithTemplate.cs deleted file mode 100644 index 775c421..0000000 --- a/examples/UnclaimedDraftCreateEmbeddedWithTemplate.cs +++ /dev/null @@ -1,52 +0,0 @@ -using System; -using System.Collections.Generic; -using Dropbox.Sign.Api; -using Dropbox.Sign.Client; -using Dropbox.Sign.Model; - -public class Example -{ - public static void Main() - { - var config = new Configuration(); - // Configure HTTP basic authorization: api_key - config.Username = "YOUR_API_KEY"; - - // or, configure Bearer (JWT) authorization: oauth2 - // config.AccessToken = "YOUR_BEARER_TOKEN"; - - var unclaimedDraftApi = new UnclaimedDraftApi(config); - - var signer = new SubUnclaimedDraftTemplateSigner( - role: "Client", - name: "George", - emailAddress: "george@example.com" - ); - - var cc1 = new SubCC( - role: "Accounting", - emailAddress: "accouting@email.com" - ); - - var data = new UnclaimedDraftCreateEmbeddedWithTemplateRequest( - clientId: "1a659d9ad95bccd307ecad78d72192f8", - templateIds: new List(){"c26b8a16784a872da37ea946b9ddec7c1e11dff6"}, - requesterEmailAddress: "jack@dropboxsign.com", - signers: new List(){signer}, - ccs: new List(){cc1}, - testMode: true - ); - - try - { - var result = unclaimedDraftApi.UnclaimedDraftCreateEmbeddedWithTemplate(data); - Console.WriteLine(result); - } - catch (ApiException e) - { - Console.WriteLine("Exception when calling Dropbox Sign API: " + e.Message); - Console.WriteLine("Status Code: " + e.ErrorCode); - Console.WriteLine(e.StackTrace); - } - } -} diff --git a/examples/UnclaimedDraftCreateEmbeddedWithTemplateExample.cs b/examples/UnclaimedDraftCreateEmbeddedWithTemplateExample.cs new file mode 100644 index 0000000..2fea6ff --- /dev/null +++ b/examples/UnclaimedDraftCreateEmbeddedWithTemplateExample.cs @@ -0,0 +1,67 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Text.Json; + +using Dropbox.Sign.Api; +using Dropbox.Sign.Client; +using Dropbox.Sign.Model; + +namespace Dropbox.SignSandbox; + +public class UnclaimedDraftCreateEmbeddedWithTemplateExample +{ + public static void Run() + { + var config = new Configuration(); + config.Username = "YOUR_API_KEY"; + // config.AccessToken = "YOUR_ACCESS_TOKEN"; + + var ccs1 = new SubCC( + role: "Accounting", + emailAddress: "accounting@dropboxsign.com" + ); + + var ccs = new List + { + ccs1, + }; + + var signers1 = new SubUnclaimedDraftTemplateSigner( + role: "Client", + name: "George", + emailAddress: "george@example.com" + ); + + var signers = new List + { + signers1, + }; + + var unclaimedDraftCreateEmbeddedWithTemplateRequest = new UnclaimedDraftCreateEmbeddedWithTemplateRequest( + clientId: "b6b8e7deaf8f0b95c029dca049356d4a2cf9710a", + requesterEmailAddress: "jack@dropboxsign.com", + templateIds: [ + "61a832ff0d8423f91d503e76bfbcc750f7417c78", + ], + testMode: false, + ccs: ccs, + signers: signers + ); + + try + { + var response = new UnclaimedDraftApi(config).UnclaimedDraftCreateEmbeddedWithTemplate( + unclaimedDraftCreateEmbeddedWithTemplateRequest: unclaimedDraftCreateEmbeddedWithTemplateRequest + ); + + Console.WriteLine(response); + } + catch (ApiException e) + { + Console.WriteLine("Exception when calling UnclaimedDraftApi#UnclaimedDraftCreateEmbeddedWithTemplate: " + e.Message); + Console.WriteLine("Status Code: " + e.ErrorCode); + Console.WriteLine(e.StackTrace); + } + } +} diff --git a/examples/UnclaimedDraftCreateExample.cs b/examples/UnclaimedDraftCreateExample.cs new file mode 100644 index 0000000..e5080a6 --- /dev/null +++ b/examples/UnclaimedDraftCreateExample.cs @@ -0,0 +1,59 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Text.Json; + +using Dropbox.Sign.Api; +using Dropbox.Sign.Client; +using Dropbox.Sign.Model; + +namespace Dropbox.SignSandbox; + +public class UnclaimedDraftCreateExample +{ + public static void Run() + { + var config = new Configuration(); + config.Username = "YOUR_API_KEY"; + // config.AccessToken = "YOUR_ACCESS_TOKEN"; + + var signers1 = new SubUnclaimedDraftSigner( + name: "Jack", + emailAddress: "jack@example.com", + order: 0 + ); + + var signers = new List + { + signers1, + }; + + var unclaimedDraftCreateRequest = new UnclaimedDraftCreateRequest( + type: UnclaimedDraftCreateRequest.TypeEnum.RequestSignature, + testMode: true, + files: new List + { + new FileStream( + path: "./example_signature_request.pdf", + mode: FileMode.Open + ), + }, + signers: signers + ); + + try + { + var response = new UnclaimedDraftApi(config).UnclaimedDraftCreate( + unclaimedDraftCreateRequest: unclaimedDraftCreateRequest + ); + + Console.WriteLine(response); + } + catch (ApiException e) + { + Console.WriteLine("Exception when calling UnclaimedDraftApi#UnclaimedDraftCreate: " + e.Message); + Console.WriteLine("Status Code: " + e.ErrorCode); + Console.WriteLine(e.StackTrace); + } + } +} diff --git a/examples/UnclaimedDraftCreateFormFieldGroupsExample.cs b/examples/UnclaimedDraftCreateFormFieldGroupsExample.cs new file mode 100644 index 0000000..b5ae359 --- /dev/null +++ b/examples/UnclaimedDraftCreateFormFieldGroupsExample.cs @@ -0,0 +1,94 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Text.Json; + +using Dropbox.Sign.Api; +using Dropbox.Sign.Client; +using Dropbox.Sign.Model; + +namespace Dropbox.SignSandbox; + +public class UnclaimedDraftCreateFormFieldGroupsExample +{ + public static void Run() + { + var config = new Configuration(); + config.Username = "YOUR_API_KEY"; + // config.AccessToken = "YOUR_ACCESS_TOKEN"; + + var formFieldGroups1 = new SubFormFieldGroup( + groupId: "RadioItemGroup1", + groupLabel: "Radio Item Group 1", + requirement: "require_0-1" + ); + + var formFieldGroups = new List + { + formFieldGroups1, + }; + + var formFieldsPerDocument1 = new SubFormFieldsPerDocumentRadio( + documentIndex: 0, + apiId: "uniqueIdHere_1", + type: "radio", + required: false, + signer: "0", + width: 18, + height: 18, + x: 112, + y: 328, + group: "RadioItemGroup1", + isChecked: true, + name: "", + page: 1 + ); + + var formFieldsPerDocument2 = new SubFormFieldsPerDocumentRadio( + documentIndex: 0, + apiId: "uniqueIdHere_2", + type: "radio", + required: false, + signer: "0", + width: 18, + height: 18, + x: 112, + y: 370, + group: "RadioItemGroup1", + isChecked: false, + name: "", + page: 1 + ); + + var formFieldsPerDocument = new List + { + formFieldsPerDocument1, + formFieldsPerDocument2, + }; + + var unclaimedDraftCreateRequest = new UnclaimedDraftCreateRequest( + type: UnclaimedDraftCreateRequest.TypeEnum.RequestSignature, + testMode: false, + fileUrls: [ + "https://www.dropbox.com/s/ad9qnhbrjjn64tu/mutual-NDA-example.pdf?dl=1", + ], + formFieldGroups: formFieldGroups, + formFieldsPerDocument: formFieldsPerDocument + ); + + try + { + var response = new UnclaimedDraftApi(config).UnclaimedDraftCreate( + unclaimedDraftCreateRequest: unclaimedDraftCreateRequest + ); + + Console.WriteLine(response); + } + catch (ApiException e) + { + Console.WriteLine("Exception when calling UnclaimedDraftApi#UnclaimedDraftCreate: " + e.Message); + Console.WriteLine("Status Code: " + e.ErrorCode); + Console.WriteLine(e.StackTrace); + } + } +} diff --git a/examples/UnclaimedDraftCreateFormFieldRulesExample.cs b/examples/UnclaimedDraftCreateFormFieldRulesExample.cs new file mode 100644 index 0000000..b376900 --- /dev/null +++ b/examples/UnclaimedDraftCreateFormFieldRulesExample.cs @@ -0,0 +1,114 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Text.Json; + +using Dropbox.Sign.Api; +using Dropbox.Sign.Client; +using Dropbox.Sign.Model; + +namespace Dropbox.SignSandbox; + +public class UnclaimedDraftCreateFormFieldRulesExample +{ + public static void Run() + { + var config = new Configuration(); + config.Username = "YOUR_API_KEY"; + // config.AccessToken = "YOUR_ACCESS_TOKEN"; + + var formFieldRules1Triggers1 = new SubFormFieldRuleTrigger( + id: "uniqueIdHere_1", + varOperator: SubFormFieldRuleTrigger.OperatorEnum.Is, + value: "foo" + ); + + var formFieldRules1Triggers = new List + { + formFieldRules1Triggers1, + }; + + var formFieldRules1Actions1 = new SubFormFieldRuleAction( + hidden: true, + type: SubFormFieldRuleAction.TypeEnum.ChangeFieldVisibility, + fieldId: "uniqueIdHere_2" + ); + + var formFieldRules1Actions = new List + { + formFieldRules1Actions1, + }; + + var formFieldRules1 = new SubFormFieldRule( + id: "rule_1", + triggerOperator: "AND", + triggers: formFieldRules1Triggers, + actions: formFieldRules1Actions + ); + + var formFieldRules = new List + { + formFieldRules1, + }; + + var formFieldsPerDocument1 = new SubFormFieldsPerDocumentText( + documentIndex: 0, + apiId: "uniqueIdHere_1", + type: "text", + required: true, + signer: "0", + width: 100, + height: 16, + x: 112, + y: 328, + name: "", + page: 1, + validationType: SubFormFieldsPerDocumentText.ValidationTypeEnum.NumbersOnly + ); + + var formFieldsPerDocument2 = new SubFormFieldsPerDocumentSignature( + documentIndex: 0, + apiId: "uniqueIdHere_2", + type: "signature", + required: true, + signer: "0", + width: 120, + height: 30, + x: 530, + y: 415, + name: "", + page: 1 + ); + + var formFieldsPerDocument = new List + { + formFieldsPerDocument1, + formFieldsPerDocument2, + }; + + var unclaimedDraftCreateRequest = new UnclaimedDraftCreateRequest( + type: UnclaimedDraftCreateRequest.TypeEnum.RequestSignature, + testMode: false, + fileUrls: [ + "https://www.dropbox.com/s/ad9qnhbrjjn64tu/mutual-NDA-example.pdf?dl=1", + ], + formFieldRules: formFieldRules, + formFieldsPerDocument: formFieldsPerDocument + ); + + try + { + var response = new UnclaimedDraftApi(config).UnclaimedDraftCreate( + unclaimedDraftCreateRequest: unclaimedDraftCreateRequest + ); + + Console.WriteLine(response); + } + catch (ApiException e) + { + Console.WriteLine("Exception when calling UnclaimedDraftApi#UnclaimedDraftCreate: " + e.Message); + Console.WriteLine("Status Code: " + e.ErrorCode); + Console.WriteLine(e.StackTrace); + } + } +} diff --git a/examples/UnclaimedDraftCreateFormFieldsPerDocumentExample.cs b/examples/UnclaimedDraftCreateFormFieldsPerDocumentExample.cs new file mode 100644 index 0000000..86eae8a --- /dev/null +++ b/examples/UnclaimedDraftCreateFormFieldsPerDocumentExample.cs @@ -0,0 +1,80 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Text.Json; + +using Dropbox.Sign.Api; +using Dropbox.Sign.Client; +using Dropbox.Sign.Model; + +namespace Dropbox.SignSandbox; + +public class UnclaimedDraftCreateFormFieldsPerDocumentExample +{ + public static void Run() + { + var config = new Configuration(); + config.Username = "YOUR_API_KEY"; + // config.AccessToken = "YOUR_ACCESS_TOKEN"; + + var formFieldsPerDocument1 = new SubFormFieldsPerDocumentText( + documentIndex: 0, + apiId: "uniqueIdHere_1", + type: "text", + required: true, + signer: "1", + width: 100, + height: 16, + x: 112, + y: 328, + name: "", + page: 1, + placeholder: "", + validationType: SubFormFieldsPerDocumentText.ValidationTypeEnum.NumbersOnly + ); + + var formFieldsPerDocument2 = new SubFormFieldsPerDocumentSignature( + documentIndex: 0, + apiId: "uniqueIdHere_2", + type: "signature", + required: true, + signer: "0", + width: 120, + height: 30, + x: 530, + y: 415, + name: "", + page: 1 + ); + + var formFieldsPerDocument = new List + { + formFieldsPerDocument1, + formFieldsPerDocument2, + }; + + var unclaimedDraftCreateRequest = new UnclaimedDraftCreateRequest( + type: UnclaimedDraftCreateRequest.TypeEnum.RequestSignature, + testMode: false, + fileUrls: [ + "https://www.dropbox.com/s/ad9qnhbrjjn64tu/mutual-NDA-example.pdf?dl=1", + ], + formFieldsPerDocument: formFieldsPerDocument + ); + + try + { + var response = new UnclaimedDraftApi(config).UnclaimedDraftCreate( + unclaimedDraftCreateRequest: unclaimedDraftCreateRequest + ); + + Console.WriteLine(response); + } + catch (ApiException e) + { + Console.WriteLine("Exception when calling UnclaimedDraftApi#UnclaimedDraftCreate: " + e.Message); + Console.WriteLine("Status Code: " + e.ErrorCode); + Console.WriteLine(e.StackTrace); + } + } +} diff --git a/examples/UnclaimedDraftEditAndResend.cs b/examples/UnclaimedDraftEditAndResend.cs deleted file mode 100644 index cfbb370..0000000 --- a/examples/UnclaimedDraftEditAndResend.cs +++ /dev/null @@ -1,39 +0,0 @@ -using System; -using System.Collections.Generic; -using Dropbox.Sign.Api; -using Dropbox.Sign.Client; -using Dropbox.Sign.Model; - -public class Example -{ - public static void Main() - { - var config = new Configuration(); - // Configure HTTP basic authorization: api_key - config.Username = "YOUR_API_KEY"; - - // or, configure Bearer (JWT) authorization: oauth2 - // config.AccessToken = "YOUR_BEARER_TOKEN"; - - var unclaimedDraftApi = new UnclaimedDraftApi(config); - - var data = new UnclaimedDraftEditAndResendRequest( - clientId: "1a659d9ad95bccd307ecad78d72192f8", - testMode: true - ); - - var signatureRequestId = "2f9781e1a83jdja934d808c153c2e1d3df6f8f2f"; - - try - { - var result = unclaimedDraftApi.UnclaimedDraftEditAndResend(signatureRequestId, data); - Console.WriteLine(result); - } - catch (ApiException e) - { - Console.WriteLine("Exception when calling Dropbox Sign API: " + e.Message); - Console.WriteLine("Status Code: " + e.ErrorCode); - Console.WriteLine(e.StackTrace); - } - } -} diff --git a/examples/UnclaimedDraftEditAndResendExample.cs b/examples/UnclaimedDraftEditAndResendExample.cs new file mode 100644 index 0000000..459364b --- /dev/null +++ b/examples/UnclaimedDraftEditAndResendExample.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Text.Json; + +using Dropbox.Sign.Api; +using Dropbox.Sign.Client; +using Dropbox.Sign.Model; + +namespace Dropbox.SignSandbox; + +public class UnclaimedDraftEditAndResendExample +{ + public static void Run() + { + var config = new Configuration(); + config.Username = "YOUR_API_KEY"; + // config.AccessToken = "YOUR_ACCESS_TOKEN"; + + var unclaimedDraftEditAndResendRequest = new UnclaimedDraftEditAndResendRequest( + clientId: "b6b8e7deaf8f0b95c029dca049356d4a2cf9710a", + testMode: false + ); + + try + { + var response = new UnclaimedDraftApi(config).UnclaimedDraftEditAndResend( + signatureRequestId: "fa5c8a0b0f492d768749333ad6fcc214c111e967", + unclaimedDraftEditAndResendRequest: unclaimedDraftEditAndResendRequest + ); + + Console.WriteLine(response); + } + catch (ApiException e) + { + Console.WriteLine("Exception when calling UnclaimedDraftApi#UnclaimedDraftEditAndResend: " + e.Message); + Console.WriteLine("Status Code: " + e.ErrorCode); + Console.WriteLine(e.StackTrace); + } + } +} diff --git a/openapi-config.yaml b/openapi-config.yaml index 2cdc7d0..9e1d7f9 100644 --- a/openapi-config.yaml +++ b/openapi-config.yaml @@ -6,15 +6,20 @@ additionalProperties: packageCompany: Dropbox Sign API Team packageCopyright: Dropbox 2024 packageDescription: Client library for using the Dropbox Sign API - packageVersion: 1.8.0 + packageVersion: 2.0.0 packageTitle: Dropbox Sign .Net SDK sortModelPropertiesByRequiredFlag: true optionalEmitDefaultValues: true - targetFramework: net6.0 + targetFramework: net8.0 + library: restsharp packageGuid: "{F8C8232D-7020-4603-8E04-18D060AE530B}" legacyDiscriminatorBehavior: true useCustomTemplateCode: true licenseCopyrightYear: 2024 + oseg.namespace: Dropbox.SignSandbox + oseg.packageGuid: "{7045D429-F203-4317-A29F-FB9FD34B7FF9}" + oseg.security.api_key.username: YOUR_API_KEY + oseg.security.oauth2.access_token: YOUR_ACCESS_TOKEN files: dropbox-EventCallbackHelper.cs: templateType: SupportingFiles diff --git a/openapi-sdk.yaml b/openapi-sdk.yaml index 608b57d..c832450 100644 --- a/openapi-sdk.yaml +++ b/openapi-sdk.yaml @@ -27,12 +27,12 @@ paths: schema: $ref: '#/components/schemas/AccountCreateRequest' examples: - default_example: - $ref: '#/components/examples/AccountCreateRequestDefaultExample' - oauth: - $ref: '#/components/examples/AccountCreateRequestOAuthExample' + example: + $ref: '#/components/examples/AccountCreateRequest' + oauth_example: + $ref: '#/components/examples/AccountCreateRequestOAuth' responses: - 200: + '200': description: 'successful operation' headers: X-RateLimit-Limit: @@ -46,11 +46,11 @@ paths: schema: $ref: '#/components/schemas/AccountCreateResponse' examples: - default_example: - $ref: '#/components/examples/AccountCreateResponseExample' - oauth: - $ref: '#/components/examples/AccountCreateOAuthResponseExample' - 4XX: + example: + $ref: '#/components/examples/AccountCreateResponse' + oauth_example: + $ref: '#/components/examples/AccountCreateOAuthResponse' + '4XX': description: failed_operation content: application/json: @@ -58,15 +58,15 @@ paths: $ref: '#/components/schemas/ErrorResponse' examples: 400_example: - $ref: '#/components/examples/Error400ResponseExample' + $ref: '#/components/examples/Error400Response' 401_example: - $ref: '#/components/examples/Error401ResponseExample' + $ref: '#/components/examples/Error401Response' 402_example: - $ref: '#/components/examples/Error402ResponseExample' + $ref: '#/components/examples/Error402Response' 403_example: - $ref: '#/components/examples/Error403ResponseExample' + $ref: '#/components/examples/Error403Response' 4XX_example: - $ref: '#/components/examples/Error4XXResponseExample' + $ref: '#/components/examples/Error4XXResponse' security: - api_key: [] @@ -78,42 +78,37 @@ paths: lang: PHP label: PHP source: - $ref: examples/AccountCreate.php + $ref: examples/AccountCreateExample.php - lang: 'C#' label: 'C#' source: - $ref: examples/AccountCreate.cs - - - lang: JavaScript - label: JavaScript - source: - $ref: examples/AccountCreate.js + $ref: examples/AccountCreateExample.cs - lang: TypeScript label: TypeScript source: - $ref: examples/AccountCreate.ts + $ref: examples/AccountCreateExample.ts - lang: Java label: Java source: - $ref: examples/AccountCreate.java + $ref: examples/AccountCreateExample.java - lang: Ruby label: Ruby source: - $ref: examples/AccountCreate.rb + $ref: examples/AccountCreateExample.rb - lang: Python label: Python source: - $ref: examples/AccountCreate.py + $ref: examples/AccountCreateExample.py - lang: cURL label: cURL source: - $ref: examples/AccountCreate.sh + $ref: examples/AccountCreateExample.sh x-meta: seo: title: 'Create Account | API Documentation | Dropbox Sign for Developers' @@ -147,7 +142,7 @@ paths: schema: type: string responses: - 200: + '200': description: 'successful operation' headers: X-RateLimit-Limit: @@ -161,9 +156,9 @@ paths: schema: $ref: '#/components/schemas/AccountGetResponse' examples: - default_example: - $ref: '#/components/examples/AccountGetResponseExample' - 4XX: + example: + $ref: '#/components/examples/AccountGetResponse' + '4XX': description: failed_operation content: application/json: @@ -171,15 +166,15 @@ paths: $ref: '#/components/schemas/ErrorResponse' examples: 400_example: - $ref: '#/components/examples/Error400ResponseExample' + $ref: '#/components/examples/Error400Response' 401_example: - $ref: '#/components/examples/Error401ResponseExample' + $ref: '#/components/examples/Error401Response' 402_example: - $ref: '#/components/examples/Error402ResponseExample' + $ref: '#/components/examples/Error402Response' 403_example: - $ref: '#/components/examples/Error403ResponseExample' + $ref: '#/components/examples/Error403Response' 4XX_example: - $ref: '#/components/examples/Error4XXResponseExample' + $ref: '#/components/examples/Error4XXResponse' security: - api_key: [] @@ -192,42 +187,37 @@ paths: lang: PHP label: PHP source: - $ref: examples/AccountGet.php + $ref: examples/AccountGetExample.php - lang: 'C#' label: 'C#' source: - $ref: examples/AccountGet.cs - - - lang: JavaScript - label: JavaScript - source: - $ref: examples/AccountGet.js + $ref: examples/AccountGetExample.cs - lang: TypeScript label: TypeScript source: - $ref: examples/AccountGet.ts + $ref: examples/AccountGetExample.ts - lang: Java label: Java source: - $ref: examples/AccountGet.java + $ref: examples/AccountGetExample.java - lang: Ruby label: Ruby source: - $ref: examples/AccountGet.rb + $ref: examples/AccountGetExample.rb - lang: Python label: Python source: - $ref: examples/AccountGet.py + $ref: examples/AccountGetExample.py - lang: cURL label: cURL source: - $ref: examples/AccountGet.sh + $ref: examples/AccountGetExample.sh x-meta: seo: title: 'Get Account | API Documentation | Dropbox Sign for Developers' @@ -245,10 +235,10 @@ paths: schema: $ref: '#/components/schemas/AccountUpdateRequest' examples: - default_example: - $ref: '#/components/examples/AccountUpdateRequestDefaultExample' + example: + $ref: '#/components/examples/AccountUpdateRequest' responses: - 200: + '200': description: 'successful operation' headers: X-RateLimit-Limit: @@ -262,9 +252,9 @@ paths: schema: $ref: '#/components/schemas/AccountGetResponse' examples: - default_example: - $ref: '#/components/examples/AccountUpdateResponseExample' - 4XX: + example: + $ref: '#/components/examples/AccountUpdateResponse' + '4XX': description: failed_operation content: application/json: @@ -272,17 +262,17 @@ paths: $ref: '#/components/schemas/ErrorResponse' examples: 400_example: - $ref: '#/components/examples/Error400ResponseExample' + $ref: '#/components/examples/Error400Response' 401_example: - $ref: '#/components/examples/Error401ResponseExample' + $ref: '#/components/examples/Error401Response' 402_example: - $ref: '#/components/examples/Error402ResponseExample' + $ref: '#/components/examples/Error402Response' 403_example: - $ref: '#/components/examples/Error403ResponseExample' + $ref: '#/components/examples/Error403Response' 409_example: - $ref: '#/components/examples/Error409ResponseExample' + $ref: '#/components/examples/Error409Response' 4XX_example: - $ref: '#/components/examples/Error4XXResponseExample' + $ref: '#/components/examples/Error4XXResponse' security: - api_key: [] @@ -294,42 +284,37 @@ paths: lang: PHP label: PHP source: - $ref: examples/AccountUpdate.php + $ref: examples/AccountUpdateExample.php - lang: 'C#' label: 'C#' source: - $ref: examples/AccountUpdate.cs - - - lang: JavaScript - label: JavaScript - source: - $ref: examples/AccountUpdate.js + $ref: examples/AccountUpdateExample.cs - lang: TypeScript label: TypeScript source: - $ref: examples/AccountUpdate.ts + $ref: examples/AccountUpdateExample.ts - lang: Java label: Java source: - $ref: examples/AccountUpdate.java + $ref: examples/AccountUpdateExample.java - lang: Ruby label: Ruby source: - $ref: examples/AccountUpdate.rb + $ref: examples/AccountUpdateExample.rb - lang: Python label: Python source: - $ref: examples/AccountUpdate.py + $ref: examples/AccountUpdateExample.py - lang: cURL label: cURL source: - $ref: examples/AccountUpdate.sh + $ref: examples/AccountUpdateExample.sh x-meta: seo: title: 'Update Account | API Documentation | Dropbox Sign for Developers' @@ -348,10 +333,10 @@ paths: schema: $ref: '#/components/schemas/AccountVerifyRequest' examples: - default_example: - $ref: '#/components/examples/AccountVerifyRequestDefaultExample' + example: + $ref: '#/components/examples/AccountVerifyRequest' responses: - 200: + '200': description: 'successful operation' headers: X-RateLimit-Limit: @@ -365,11 +350,11 @@ paths: schema: $ref: '#/components/schemas/AccountVerifyResponse' examples: - default_example: - $ref: '#/components/examples/AccountVerifyFoundResponseExample' - not_found: - $ref: '#/components/examples/AccountVerifyNotFoundResponseExample' - 4XX: + example: + $ref: '#/components/examples/AccountVerifyFoundResponse' + not_found_example: + $ref: '#/components/examples/AccountVerifyNotFoundResponse' + '4XX': description: failed_operation content: application/json: @@ -377,15 +362,15 @@ paths: $ref: '#/components/schemas/ErrorResponse' examples: 400_example: - $ref: '#/components/examples/Error400ResponseExample' + $ref: '#/components/examples/Error400Response' 401_example: - $ref: '#/components/examples/Error401ResponseExample' + $ref: '#/components/examples/Error401Response' 402_example: - $ref: '#/components/examples/Error402ResponseExample' + $ref: '#/components/examples/Error402Response' 403_example: - $ref: '#/components/examples/Error403ResponseExample' + $ref: '#/components/examples/Error403Response' 4XX_example: - $ref: '#/components/examples/Error4XXResponseExample' + $ref: '#/components/examples/Error4XXResponse' security: - api_key: [] @@ -397,42 +382,37 @@ paths: lang: PHP label: PHP source: - $ref: examples/AccountVerify.php + $ref: examples/AccountVerifyExample.php - lang: 'C#' label: 'C#' source: - $ref: examples/AccountVerify.cs - - - lang: JavaScript - label: JavaScript - source: - $ref: examples/AccountVerify.js + $ref: examples/AccountVerifyExample.cs - lang: TypeScript label: TypeScript source: - $ref: examples/AccountVerify.ts + $ref: examples/AccountVerifyExample.ts - lang: Java label: Java source: - $ref: examples/AccountVerify.java + $ref: examples/AccountVerifyExample.java - lang: Ruby label: Ruby source: - $ref: examples/AccountVerify.rb + $ref: examples/AccountVerifyExample.rb - lang: Python label: Python source: - $ref: examples/AccountVerify.py + $ref: examples/AccountVerifyExample.py - lang: cURL label: cURL source: - $ref: examples/AccountVerify.sh + $ref: examples/AccountVerifyExample.sh x-meta: seo: title: 'Verify Account | API Documentation | Dropbox Sign for Developers' @@ -451,13 +431,13 @@ paths: schema: $ref: '#/components/schemas/ApiAppCreateRequest' examples: - default_example: - $ref: '#/components/examples/ApiAppCreateRequestDefaultExample' + example: + $ref: '#/components/examples/ApiAppCreateRequest' multipart/form-data: schema: $ref: '#/components/schemas/ApiAppCreateRequest' responses: - 201: + '201': description: 'successful operation' headers: X-RateLimit-Limit: @@ -471,9 +451,9 @@ paths: schema: $ref: '#/components/schemas/ApiAppGetResponse' examples: - default_example: - $ref: '#/components/examples/ApiAppCreateResponseExample' - 4XX: + example: + $ref: '#/components/examples/ApiAppCreateResponse' + '4XX': description: failed_operation content: application/json: @@ -481,17 +461,17 @@ paths: $ref: '#/components/schemas/ErrorResponse' examples: 400_example: - $ref: '#/components/examples/Error400ResponseExample' + $ref: '#/components/examples/Error400Response' 401_example: - $ref: '#/components/examples/Error401ResponseExample' + $ref: '#/components/examples/Error401Response' 402_example: - $ref: '#/components/examples/Error402ResponseExample' + $ref: '#/components/examples/Error402Response' 403_example: - $ref: '#/components/examples/Error403ResponseExample' + $ref: '#/components/examples/Error403Response' 404_example: - $ref: '#/components/examples/Error404ResponseExample' + $ref: '#/components/examples/Error404Response' 4XX_example: - $ref: '#/components/examples/Error4XXResponseExample' + $ref: '#/components/examples/Error4XXResponse' security: - api_key: [] @@ -503,42 +483,37 @@ paths: lang: PHP label: PHP source: - $ref: examples/ApiAppCreate.php + $ref: examples/ApiAppCreateExample.php - lang: 'C#' label: 'C#' source: - $ref: examples/ApiAppCreate.cs - - - lang: JavaScript - label: JavaScript - source: - $ref: examples/ApiAppCreate.js + $ref: examples/ApiAppCreateExample.cs - lang: TypeScript label: TypeScript source: - $ref: examples/ApiAppCreate.ts + $ref: examples/ApiAppCreateExample.ts - lang: Java label: Java source: - $ref: examples/ApiAppCreate.java + $ref: examples/ApiAppCreateExample.java - lang: Ruby label: Ruby source: - $ref: examples/ApiAppCreate.rb + $ref: examples/ApiAppCreateExample.rb - lang: Python label: Python source: - $ref: examples/ApiAppCreate.py + $ref: examples/ApiAppCreateExample.py - lang: cURL label: cURL source: - $ref: examples/ApiAppCreate.sh + $ref: examples/ApiAppCreateExample.sh x-meta: seo: title: 'Create API App | API Documentation | Dropbox Sign for Developers' @@ -560,7 +535,7 @@ paths: type: string example: 0dd3b823a682527788c4e40cb7b6f7e9 responses: - 200: + '200': description: 'successful operation' headers: X-RateLimit-Limit: @@ -574,9 +549,9 @@ paths: schema: $ref: '#/components/schemas/ApiAppGetResponse' examples: - default_example: - $ref: '#/components/examples/ApiAppGetResponseExample' - 4XX: + example: + $ref: '#/components/examples/ApiAppGetResponse' + '4XX': description: failed_operation content: application/json: @@ -584,19 +559,19 @@ paths: $ref: '#/components/schemas/ErrorResponse' examples: 400_example: - $ref: '#/components/examples/Error400ResponseExample' + $ref: '#/components/examples/Error400Response' 401_example: - $ref: '#/components/examples/Error401ResponseExample' + $ref: '#/components/examples/Error401Response' 402_example: - $ref: '#/components/examples/Error402ResponseExample' + $ref: '#/components/examples/Error402Response' 403_example: - $ref: '#/components/examples/Error403ResponseExample' + $ref: '#/components/examples/Error403Response' 404_example: - $ref: '#/components/examples/Error404ResponseExample' + $ref: '#/components/examples/Error404Response' 429_example: - $ref: '#/components/examples/Error429ResponseExample' + $ref: '#/components/examples/Error429Response' 4XX_example: - $ref: '#/components/examples/Error4XXResponseExample' + $ref: '#/components/examples/Error4XXResponse' security: - api_key: [] @@ -608,42 +583,37 @@ paths: lang: PHP label: PHP source: - $ref: examples/ApiAppGet.php + $ref: examples/ApiAppGetExample.php - lang: 'C#' label: 'C#' source: - $ref: examples/ApiAppGet.cs - - - lang: JavaScript - label: JavaScript - source: - $ref: examples/ApiAppGet.js + $ref: examples/ApiAppGetExample.cs - lang: TypeScript label: TypeScript source: - $ref: examples/ApiAppGet.ts + $ref: examples/ApiAppGetExample.ts - lang: Java label: Java source: - $ref: examples/ApiAppGet.java + $ref: examples/ApiAppGetExample.java - lang: Ruby label: Ruby source: - $ref: examples/ApiAppGet.rb + $ref: examples/ApiAppGetExample.rb - lang: Python label: Python source: - $ref: examples/ApiAppGet.py + $ref: examples/ApiAppGetExample.py - lang: cURL label: cURL source: - $ref: examples/ApiAppGet.sh + $ref: examples/ApiAppGetExample.sh x-meta: seo: title: 'Get API App | API Documentation | Dropbox Sign for Developers' @@ -670,13 +640,13 @@ paths: schema: $ref: '#/components/schemas/ApiAppUpdateRequest' examples: - default_example: - $ref: '#/components/examples/ApiAppUpdateRequestDefaultExample' + example: + $ref: '#/components/examples/ApiAppUpdateRequest' multipart/form-data: schema: $ref: '#/components/schemas/ApiAppUpdateRequest' responses: - 200: + '200': description: 'successful operation' headers: X-RateLimit-Limit: @@ -690,9 +660,9 @@ paths: schema: $ref: '#/components/schemas/ApiAppGetResponse' examples: - default_example: - $ref: '#/components/examples/ApiAppUpdateResponseExample' - 4XX: + example: + $ref: '#/components/examples/ApiAppUpdateResponse' + '4XX': description: failed_operation content: application/json: @@ -700,19 +670,19 @@ paths: $ref: '#/components/schemas/ErrorResponse' examples: 400_example: - $ref: '#/components/examples/Error400ResponseExample' + $ref: '#/components/examples/Error400Response' 401_example: - $ref: '#/components/examples/Error401ResponseExample' + $ref: '#/components/examples/Error401Response' 402_example: - $ref: '#/components/examples/Error402ResponseExample' + $ref: '#/components/examples/Error402Response' 403_example: - $ref: '#/components/examples/Error403ResponseExample' + $ref: '#/components/examples/Error403Response' 409_example: - $ref: '#/components/examples/Error409ResponseExample' + $ref: '#/components/examples/Error409Response' 429_example: - $ref: '#/components/examples/Error429ResponseExample' + $ref: '#/components/examples/Error429Response' 4XX_example: - $ref: '#/components/examples/Error4XXResponseExample' + $ref: '#/components/examples/Error4XXResponse' security: - api_key: [] @@ -724,42 +694,37 @@ paths: lang: PHP label: PHP source: - $ref: examples/ApiAppUpdate.php + $ref: examples/ApiAppUpdateExample.php - lang: 'C#' label: 'C#' source: - $ref: examples/ApiAppUpdate.cs - - - lang: JavaScript - label: JavaScript - source: - $ref: examples/ApiAppUpdate.js + $ref: examples/ApiAppUpdateExample.cs - lang: TypeScript label: TypeScript source: - $ref: examples/ApiAppUpdate.ts + $ref: examples/ApiAppUpdateExample.ts - lang: Java label: Java source: - $ref: examples/ApiAppUpdate.java + $ref: examples/ApiAppUpdateExample.java - lang: Ruby label: Ruby source: - $ref: examples/ApiAppUpdate.rb + $ref: examples/ApiAppUpdateExample.rb - lang: Python label: Python source: - $ref: examples/ApiAppUpdate.py + $ref: examples/ApiAppUpdateExample.py - lang: cURL label: cURL source: - $ref: examples/ApiAppUpdate.sh + $ref: examples/ApiAppUpdateExample.sh x-meta: seo: title: 'Update API App | API Documentation | Dropbox Sign for Developers' @@ -780,7 +745,7 @@ paths: type: string example: 0dd3b823a682527788c4e40cb7b6f7e9 responses: - 204: + '204': description: 'successful operation' headers: X-RateLimit-Limit: @@ -789,7 +754,7 @@ paths: $ref: '#/components/headers/X-RateLimit-Remaining' X-Ratelimit-Reset: $ref: '#/components/headers/X-Ratelimit-Reset' - 4XX: + '4XX': description: failed_operation content: application/json: @@ -797,17 +762,17 @@ paths: $ref: '#/components/schemas/ErrorResponse' examples: 400_example: - $ref: '#/components/examples/Error400ResponseExample' + $ref: '#/components/examples/Error400Response' 401_example: - $ref: '#/components/examples/Error401ResponseExample' + $ref: '#/components/examples/Error401Response' 402_example: - $ref: '#/components/examples/Error402ResponseExample' + $ref: '#/components/examples/Error402Response' 403_example: - $ref: '#/components/examples/Error403ResponseExample' + $ref: '#/components/examples/Error403Response' 404_example: - $ref: '#/components/examples/Error404ResponseExample' + $ref: '#/components/examples/Error404Response' 4XX_example: - $ref: '#/components/examples/Error4XXResponseExample' + $ref: '#/components/examples/Error4XXResponse' security: - api_key: [] @@ -819,42 +784,37 @@ paths: lang: PHP label: PHP source: - $ref: examples/ApiAppDelete.php + $ref: examples/ApiAppDeleteExample.php - lang: 'C#' label: 'C#' source: - $ref: examples/ApiAppDelete.cs - - - lang: JavaScript - label: JavaScript - source: - $ref: examples/ApiAppDelete.js + $ref: examples/ApiAppDeleteExample.cs - lang: TypeScript label: TypeScript source: - $ref: examples/ApiAppDelete.ts + $ref: examples/ApiAppDeleteExample.ts - lang: Java label: Java source: - $ref: examples/ApiAppDelete.java + $ref: examples/ApiAppDeleteExample.java - lang: Ruby label: Ruby source: - $ref: examples/ApiAppDelete.rb + $ref: examples/ApiAppDeleteExample.rb - lang: Python label: Python source: - $ref: examples/ApiAppDelete.py + $ref: examples/ApiAppDeleteExample.py - lang: cURL label: cURL source: - $ref: examples/ApiAppDelete.sh + $ref: examples/ApiAppDeleteExample.sh x-meta: seo: title: 'Delete API App | API Documentation | Dropbox Sign for Developers' @@ -882,7 +842,7 @@ paths: type: integer default: 20 responses: - 200: + '200': description: 'successful operation' headers: X-RateLimit-Limit: @@ -896,9 +856,9 @@ paths: schema: $ref: '#/components/schemas/ApiAppListResponse' examples: - default_example: - $ref: '#/components/examples/ApiAppListResponseExample' - 4XX: + example: + $ref: '#/components/examples/ApiAppListResponse' + '4XX': description: failed_operation content: application/json: @@ -906,15 +866,15 @@ paths: $ref: '#/components/schemas/ErrorResponse' examples: 400_example: - $ref: '#/components/examples/Error400ResponseExample' + $ref: '#/components/examples/Error400Response' 401_example: - $ref: '#/components/examples/Error401ResponseExample' + $ref: '#/components/examples/Error401Response' 402_example: - $ref: '#/components/examples/Error402ResponseExample' + $ref: '#/components/examples/Error402Response' 403_example: - $ref: '#/components/examples/Error403ResponseExample' + $ref: '#/components/examples/Error403Response' 4XX_example: - $ref: '#/components/examples/Error4XXResponseExample' + $ref: '#/components/examples/Error4XXResponse' security: - api_key: [] @@ -926,42 +886,37 @@ paths: lang: PHP label: PHP source: - $ref: examples/ApiAppList.php + $ref: examples/ApiAppListExample.php - lang: 'C#' label: 'C#' source: - $ref: examples/ApiAppList.cs - - - lang: JavaScript - label: JavaScript - source: - $ref: examples/ApiAppList.js + $ref: examples/ApiAppListExample.cs - lang: TypeScript label: TypeScript source: - $ref: examples/ApiAppList.ts + $ref: examples/ApiAppListExample.ts - lang: Java label: Java source: - $ref: examples/ApiAppList.java + $ref: examples/ApiAppListExample.java - lang: Ruby label: Ruby source: - $ref: examples/ApiAppList.rb + $ref: examples/ApiAppListExample.rb - lang: Python label: Python source: - $ref: examples/ApiAppList.py + $ref: examples/ApiAppListExample.py - lang: cURL label: cURL source: - $ref: examples/ApiAppList.sh + $ref: examples/ApiAppListExample.sh x-meta: seo: title: 'List API Apps | API Documentation | Dropbox Sign for Developers' @@ -997,7 +952,7 @@ paths: type: integer default: 20 responses: - 200: + '200': description: 'successful operation' headers: X-RateLimit-Limit: @@ -1011,9 +966,9 @@ paths: schema: $ref: '#/components/schemas/BulkSendJobGetResponse' examples: - default_example: - $ref: '#/components/examples/BulkSendJobGetResponseExample' - 4XX: + example: + $ref: '#/components/examples/BulkSendJobGetResponse' + '4XX': description: failed_operation content: application/json: @@ -1021,15 +976,15 @@ paths: $ref: '#/components/schemas/ErrorResponse' examples: 400_example: - $ref: '#/components/examples/Error400ResponseExample' + $ref: '#/components/examples/Error400Response' 401_example: - $ref: '#/components/examples/Error401ResponseExample' + $ref: '#/components/examples/Error401Response' 402_example: - $ref: '#/components/examples/Error402ResponseExample' + $ref: '#/components/examples/Error402Response' 403_example: - $ref: '#/components/examples/Error403ResponseExample' + $ref: '#/components/examples/Error403Response' 4XX_example: - $ref: '#/components/examples/Error4XXResponseExample' + $ref: '#/components/examples/Error4XXResponse' security: - api_key: [] @@ -1042,42 +997,37 @@ paths: lang: PHP label: PHP source: - $ref: examples/BulkSendJobGet.php + $ref: examples/BulkSendJobGetExample.php - lang: 'C#' label: 'C#' source: - $ref: examples/BulkSendJobGet.cs - - - lang: JavaScript - label: JavaScript - source: - $ref: examples/BulkSendJobGet.js + $ref: examples/BulkSendJobGetExample.cs - lang: TypeScript label: TypeScript source: - $ref: examples/BulkSendJobGet.ts + $ref: examples/BulkSendJobGetExample.ts - lang: Java label: Java source: - $ref: examples/BulkSendJobGet.java + $ref: examples/BulkSendJobGetExample.java - lang: Ruby label: Ruby source: - $ref: examples/BulkSendJobGet.rb + $ref: examples/BulkSendJobGetExample.rb - lang: Python label: Python source: - $ref: examples/BulkSendJobGet.py + $ref: examples/BulkSendJobGetExample.py - lang: cURL label: cURL source: - $ref: examples/BulkSendJobGet.sh + $ref: examples/BulkSendJobGetExample.sh x-meta: seo: title: 'Get Bulk Send Job | API Documentation | Dropbox Sign for Developers' @@ -1105,7 +1055,7 @@ paths: type: integer default: 20 responses: - 200: + '200': description: 'successful operation' headers: X-RateLimit-Limit: @@ -1119,9 +1069,9 @@ paths: schema: $ref: '#/components/schemas/BulkSendJobListResponse' examples: - default_example: - $ref: '#/components/examples/BulkSendJobListResponseExample' - 4XX: + example: + $ref: '#/components/examples/BulkSendJobListResponse' + '4XX': description: failed_operation content: application/json: @@ -1129,15 +1079,15 @@ paths: $ref: '#/components/schemas/ErrorResponse' examples: 400_example: - $ref: '#/components/examples/Error400ResponseExample' + $ref: '#/components/examples/Error400Response' 401_example: - $ref: '#/components/examples/Error401ResponseExample' + $ref: '#/components/examples/Error401Response' 402_example: - $ref: '#/components/examples/Error402ResponseExample' + $ref: '#/components/examples/Error402Response' 403_example: - $ref: '#/components/examples/Error403ResponseExample' + $ref: '#/components/examples/Error403Response' 4XX_example: - $ref: '#/components/examples/Error4XXResponseExample' + $ref: '#/components/examples/Error4XXResponse' security: - api_key: [] @@ -1150,42 +1100,37 @@ paths: lang: PHP label: PHP source: - $ref: examples/BulkSendJobList.php + $ref: examples/BulkSendJobListExample.php - lang: 'C#' label: 'C#' source: - $ref: examples/BulkSendJobList.cs - - - lang: JavaScript - label: JavaScript - source: - $ref: examples/BulkSendJobList.js + $ref: examples/BulkSendJobListExample.cs - lang: TypeScript label: TypeScript source: - $ref: examples/BulkSendJobList.ts + $ref: examples/BulkSendJobListExample.ts - lang: Java label: Java source: - $ref: examples/BulkSendJobList.java + $ref: examples/BulkSendJobListExample.java - lang: Ruby label: Ruby source: - $ref: examples/BulkSendJobList.rb + $ref: examples/BulkSendJobListExample.rb - lang: Python label: Python source: - $ref: examples/BulkSendJobList.py + $ref: examples/BulkSendJobListExample.py - lang: cURL label: cURL source: - $ref: examples/BulkSendJobList.sh + $ref: examples/BulkSendJobListExample.sh x-meta: seo: title: 'List Bulk Send Jobs | Documentation | Dropbox Sign for Developers' @@ -1213,10 +1158,10 @@ paths: schema: $ref: '#/components/schemas/EmbeddedEditUrlRequest' examples: - default_example: - $ref: '#/components/examples/EmbeddedEditUrlRequestDefaultExample' + example: + $ref: '#/components/examples/EmbeddedEditUrlRequest' responses: - 200: + '200': description: 'successful operation' headers: X-RateLimit-Limit: @@ -1230,9 +1175,9 @@ paths: schema: $ref: '#/components/schemas/EmbeddedEditUrlResponse' examples: - default_example: - $ref: '#/components/examples/EmbeddedEditUrlResponseExample' - 4XX: + example: + $ref: '#/components/examples/EmbeddedEditUrlResponse' + '4XX': description: failed_operation content: application/json: @@ -1240,17 +1185,17 @@ paths: $ref: '#/components/schemas/ErrorResponse' examples: 400_example: - $ref: '#/components/examples/Error400ResponseExample' + $ref: '#/components/examples/Error400Response' 401_example: - $ref: '#/components/examples/Error401ResponseExample' + $ref: '#/components/examples/Error401Response' 402_example: - $ref: '#/components/examples/Error402ResponseExample' + $ref: '#/components/examples/Error402Response' 403_example: - $ref: '#/components/examples/Error403ResponseExample' + $ref: '#/components/examples/Error403Response' 404_example: - $ref: '#/components/examples/Error404ResponseExample' + $ref: '#/components/examples/Error404Response' 4XX_example: - $ref: '#/components/examples/Error4XXResponseExample' + $ref: '#/components/examples/Error4XXResponse' security: - api_key: [] @@ -1262,42 +1207,37 @@ paths: lang: PHP label: PHP source: - $ref: examples/EmbeddedEditUrl.php + $ref: examples/EmbeddedEditUrlExample.php - lang: 'C#' label: 'C#' source: - $ref: examples/EmbeddedEditUrl.cs - - - lang: JavaScript - label: JavaScript - source: - $ref: examples/EmbeddedEditUrl.js + $ref: examples/EmbeddedEditUrlExample.cs - lang: TypeScript label: TypeScript source: - $ref: examples/EmbeddedEditUrl.ts + $ref: examples/EmbeddedEditUrlExample.ts - lang: Java label: Java source: - $ref: examples/EmbeddedEditUrl.java + $ref: examples/EmbeddedEditUrlExample.java - lang: Ruby label: Ruby source: - $ref: examples/EmbeddedEditUrl.rb + $ref: examples/EmbeddedEditUrlExample.rb - lang: Python label: Python source: - $ref: examples/EmbeddedEditUrl.py + $ref: examples/EmbeddedEditUrlExample.py - lang: cURL label: cURL source: - $ref: examples/EmbeddedEditUrl.sh + $ref: examples/EmbeddedEditUrlExample.sh x-meta: seo: title: 'Get Embedded Template URL | iFrame | Dropbox Sign for Developers' @@ -1319,7 +1259,7 @@ paths: type: string example: 50e3542f738adfa7ddd4cbd4c00d2a8ab6e4194b responses: - 200: + '200': description: 'successful operation' headers: X-RateLimit-Limit: @@ -1333,9 +1273,9 @@ paths: schema: $ref: '#/components/schemas/EmbeddedSignUrlResponse' examples: - default_example: - $ref: '#/components/examples/EmbeddedSignUrlResponseExample' - 4XX: + example: + $ref: '#/components/examples/EmbeddedSignUrlResponse' + '4XX': description: failed_operation content: application/json: @@ -1343,21 +1283,21 @@ paths: $ref: '#/components/schemas/ErrorResponse' examples: 400_example: - $ref: '#/components/examples/Error400ResponseExample' + $ref: '#/components/examples/Error400Response' 401_example: - $ref: '#/components/examples/Error401ResponseExample' + $ref: '#/components/examples/Error401Response' 402_example: - $ref: '#/components/examples/Error402ResponseExample' + $ref: '#/components/examples/Error402Response' 403_example: - $ref: '#/components/examples/Error403ResponseExample' + $ref: '#/components/examples/Error403Response' 404_example: - $ref: '#/components/examples/Error404ResponseExample' + $ref: '#/components/examples/Error404Response' 409_example: - $ref: '#/components/examples/Error409ResponseExample' + $ref: '#/components/examples/Error409Response' 429_example: - $ref: '#/components/examples/Error429ResponseExample' + $ref: '#/components/examples/Error429Response' 4XX_example: - $ref: '#/components/examples/Error4XXResponseExample' + $ref: '#/components/examples/Error4XXResponse' security: - api_key: [] @@ -1369,42 +1309,37 @@ paths: lang: PHP label: PHP source: - $ref: examples/EmbeddedSignUrl.php + $ref: examples/EmbeddedSignUrlExample.php - lang: 'C#' label: 'C#' source: - $ref: examples/EmbeddedSignUrl.cs - - - lang: JavaScript - label: JavaScript - source: - $ref: examples/EmbeddedSignUrl.js + $ref: examples/EmbeddedSignUrlExample.cs - lang: TypeScript label: TypeScript source: - $ref: examples/EmbeddedSignUrl.ts + $ref: examples/EmbeddedSignUrlExample.ts - lang: Java label: Java source: - $ref: examples/EmbeddedSignUrl.java + $ref: examples/EmbeddedSignUrlExample.java - lang: Ruby label: Ruby source: - $ref: examples/EmbeddedSignUrl.rb + $ref: examples/EmbeddedSignUrlExample.rb - lang: Python label: Python source: - $ref: examples/EmbeddedSignUrl.py + $ref: examples/EmbeddedSignUrlExample.py - lang: cURL label: cURL source: - $ref: examples/EmbeddedSignUrl.sh + $ref: examples/EmbeddedSignUrlExample.sh x-meta: seo: title: 'Get Embedded Sign URL | iFrame | Dropbox Sign for Developers' @@ -1414,7 +1349,7 @@ paths: tags: - Fax summary: 'Get Fax' - description: 'Returns information about fax' + description: 'Returns information about a Fax' operationId: faxGet parameters: - @@ -1426,7 +1361,7 @@ paths: type: string example: fa5c8a0b0f492d768749333ad6fcc214c111e967 responses: - 200: + '200': description: 'successful operation' headers: X-RateLimit-Limit: @@ -1440,9 +1375,9 @@ paths: schema: $ref: '#/components/schemas/FaxGetResponse' examples: - default_example: - $ref: '#/components/examples/FaxGetResponseExample' - 4XX: + example: + $ref: '#/components/examples/FaxGetResponse' + '4XX': description: failed_operation content: application/json: @@ -1450,19 +1385,19 @@ paths: $ref: '#/components/schemas/ErrorResponse' examples: 400_example: - $ref: '#/components/examples/Error400ResponseExample' + $ref: '#/components/examples/Error400Response' 401_example: - $ref: '#/components/examples/Error401ResponseExample' + $ref: '#/components/examples/Error401Response' 402_example: - $ref: '#/components/examples/Error402ResponseExample' + $ref: '#/components/examples/Error402Response' 403_example: - $ref: '#/components/examples/Error403ResponseExample' + $ref: '#/components/examples/Error403Response' 404_example: - $ref: '#/components/examples/Error404ResponseExample' + $ref: '#/components/examples/Error404Response' 429_example: - $ref: '#/components/examples/Error429ResponseExample' + $ref: '#/components/examples/Error429Response' 4XX_example: - $ref: '#/components/examples/Error4XXResponseExample' + $ref: '#/components/examples/Error4XXResponse' security: - api_key: [] @@ -1471,51 +1406,46 @@ paths: lang: PHP label: PHP source: - $ref: examples/FaxGet.php + $ref: examples/FaxGetExample.php - lang: 'C#' label: 'C#' source: - $ref: examples/FaxGet.cs - - - lang: JavaScript - label: JavaScript - source: - $ref: examples/FaxGet.js + $ref: examples/FaxGetExample.cs - lang: TypeScript label: TypeScript source: - $ref: examples/FaxGet.ts + $ref: examples/FaxGetExample.ts - lang: Java label: Java source: - $ref: examples/FaxGet.java + $ref: examples/FaxGetExample.java - lang: Ruby label: Ruby source: - $ref: examples/FaxGet.rb + $ref: examples/FaxGetExample.rb - lang: Python label: Python source: - $ref: examples/FaxGet.py + $ref: examples/FaxGetExample.py - lang: cURL label: cURL source: - $ref: examples/FaxGet.sh + $ref: examples/FaxGetExample.sh x-meta: seo: title: 'Get Fax | API Documentation | Dropbox Fax for Developers' - description: 'The Dropbox Fax API allows you to build custom integrations. To find out how to retrieve a fax, click here.' + description: 'The Dropbox Fax API allows you to build custom integrations. To find out how to retrieve properties of a fax, click here.' delete: tags: - Fax summary: 'Delete Fax' - description: 'Deletes the specified Fax from the system.' + description: 'Deletes the specified Fax from the system' operationId: faxDelete parameters: - @@ -1527,7 +1457,7 @@ paths: type: string example: fa5c8a0b0f492d768749333ad6fcc214c111e967 responses: - 204: + '204': description: 'successful operation' headers: X-RateLimit-Limit: @@ -1536,7 +1466,7 @@ paths: $ref: '#/components/headers/X-RateLimit-Remaining' X-Ratelimit-Reset: $ref: '#/components/headers/X-Ratelimit-Reset' - 4XX: + '4XX': description: failed_operation content: application/json: @@ -1544,19 +1474,19 @@ paths: $ref: '#/components/schemas/ErrorResponse' examples: 400_example: - $ref: '#/components/examples/Error400ResponseExample' + $ref: '#/components/examples/Error400Response' 401_example: - $ref: '#/components/examples/Error401ResponseExample' + $ref: '#/components/examples/Error401Response' 402_example: - $ref: '#/components/examples/Error402ResponseExample' + $ref: '#/components/examples/Error402Response' 403_example: - $ref: '#/components/examples/Error403ResponseExample' + $ref: '#/components/examples/Error403Response' 404_example: - $ref: '#/components/examples/Error404ResponseExample' + $ref: '#/components/examples/Error404Response' 429_example: - $ref: '#/components/examples/Error429ResponseExample' + $ref: '#/components/examples/Error429Response' 4XX_example: - $ref: '#/components/examples/Error4XXResponseExample' + $ref: '#/components/examples/Error4XXResponse' security: - api_key: [] @@ -1565,42 +1495,37 @@ paths: lang: PHP label: PHP source: - $ref: examples/FaxDelete.php + $ref: examples/FaxDeleteExample.php - lang: 'C#' label: 'C#' source: - $ref: examples/FaxDelete.cs - - - lang: JavaScript - label: JavaScript - source: - $ref: examples/FaxDelete.js + $ref: examples/FaxDeleteExample.cs - lang: TypeScript label: TypeScript source: - $ref: examples/FaxDelete.ts + $ref: examples/FaxDeleteExample.ts - lang: Java label: Java source: - $ref: examples/FaxDelete.java + $ref: examples/FaxDeleteExample.java - lang: Ruby label: Ruby source: - $ref: examples/FaxDelete.rb + $ref: examples/FaxDeleteExample.rb - lang: Python label: Python source: - $ref: examples/FaxDelete.py + $ref: examples/FaxDeleteExample.py - lang: cURL label: cURL source: - $ref: examples/FaxDelete.sh + $ref: examples/FaxDeleteExample.sh x-meta: seo: title: 'Delete Fax | API Documentation | Dropbox Fax for Developers' @@ -1609,8 +1534,8 @@ paths: get: tags: - Fax - summary: 'List Fax Files' - description: 'Returns list of fax files' + summary: 'Download Fax Files' + description: 'Downloads files associated with a Fax' operationId: faxFiles parameters: - @@ -1622,7 +1547,7 @@ paths: type: string example: fa5c8a0b0f492d768749333ad6fcc214c111e967 responses: - 200: + '200': description: 'successful operation' headers: X-RateLimit-Limit: @@ -1636,7 +1561,7 @@ paths: schema: type: string format: binary - 4XX: + '4XX': description: failed_operation content: application/json: @@ -1644,21 +1569,21 @@ paths: $ref: '#/components/schemas/ErrorResponse' examples: 400_example: - $ref: '#/components/examples/Error400ResponseExample' + $ref: '#/components/examples/Error400Response' 401_example: - $ref: '#/components/examples/Error401ResponseExample' + $ref: '#/components/examples/Error401Response' 402_example: - $ref: '#/components/examples/Error402ResponseExample' + $ref: '#/components/examples/Error402Response' 403_example: - $ref: '#/components/examples/Error403ResponseExample' + $ref: '#/components/examples/Error403Response' 404_example: - $ref: '#/components/examples/Error404ResponseExample' + $ref: '#/components/examples/Error404Response' 410_example: - $ref: '#/components/examples/Error410ResponseExample' + $ref: '#/components/examples/Error410Response' 429_example: - $ref: '#/components/examples/Error429ResponseExample' + $ref: '#/components/examples/Error429Response' 4XX_example: - $ref: '#/components/examples/Error4XXResponseExample' + $ref: '#/components/examples/Error4XXResponse' security: - api_key: [] @@ -1667,46 +1592,41 @@ paths: lang: PHP label: PHP source: - $ref: examples/FaxFiles.php + $ref: examples/FaxFilesExample.php - lang: 'C#' label: 'C#' source: - $ref: examples/FaxFiles.cs - - - lang: JavaScript - label: JavaScript - source: - $ref: examples/FaxFiles.js + $ref: examples/FaxFilesExample.cs - lang: TypeScript label: TypeScript source: - $ref: examples/FaxFiles.ts + $ref: examples/FaxFilesExample.ts - lang: Java label: Java source: - $ref: examples/FaxFiles.java + $ref: examples/FaxFilesExample.java - lang: Ruby label: Ruby source: - $ref: examples/FaxFiles.rb + $ref: examples/FaxFilesExample.rb - lang: Python label: Python source: - $ref: examples/FaxFiles.py + $ref: examples/FaxFilesExample.py - lang: cURL label: cURL source: - $ref: examples/FaxFiles.sh + $ref: examples/FaxFilesExample.sh x-meta: seo: title: 'Fax Files | API Documentation | Dropbox Fax for Developers' - description: 'The Dropbox Fax API allows you to build custom integrations. To find out how to list fax files, click here.' + description: 'The Dropbox Fax API allows you to build custom integrations. To find out how to list the files of a fax, click here.' /fax_line/add_user: put: tags: @@ -1721,10 +1641,10 @@ paths: schema: $ref: '#/components/schemas/FaxLineAddUserRequest' examples: - default_example: - $ref: '#/components/examples/FaxLineAddUserRequestExample' + example: + $ref: '#/components/examples/FaxLineAddUserRequest' responses: - 200: + '200': description: 'successful operation' headers: X-RateLimit-Limit: @@ -1738,9 +1658,9 @@ paths: schema: $ref: '#/components/schemas/FaxLineResponse' examples: - default_example: - $ref: '#/components/examples/FaxLineResponseExample' - 4XX: + example: + $ref: '#/components/examples/FaxLineResponse' + '4XX': description: failed_operation content: application/json: @@ -1748,17 +1668,17 @@ paths: $ref: '#/components/schemas/ErrorResponse' examples: 400_example: - $ref: '#/components/examples/Error400ResponseExample' + $ref: '#/components/examples/Error400Response' 401_example: - $ref: '#/components/examples/Error401ResponseExample' + $ref: '#/components/examples/Error401Response' 402_example: - $ref: '#/components/examples/Error402ResponseExample' + $ref: '#/components/examples/Error402Response' 403_example: - $ref: '#/components/examples/Error403ResponseExample' + $ref: '#/components/examples/Error403Response' 404_example: - $ref: '#/components/examples/Error404ResponseExample' + $ref: '#/components/examples/Error404Response' 4XX_example: - $ref: '#/components/examples/Error4XXResponseExample' + $ref: '#/components/examples/Error4XXResponse' security: - api_key: [] @@ -1767,42 +1687,37 @@ paths: lang: PHP label: PHP source: - $ref: examples/FaxLineAddUser.php + $ref: examples/FaxLineAddUserExample.php - lang: 'C#' label: 'C#' source: - $ref: examples/FaxLineAddUser.cs - - - lang: JavaScript - label: JavaScript - source: - $ref: examples/FaxLineAddUser.js + $ref: examples/FaxLineAddUserExample.cs - lang: TypeScript label: TypeScript source: - $ref: examples/FaxLineAddUser.ts + $ref: examples/FaxLineAddUserExample.ts - lang: Java label: Java source: - $ref: examples/FaxLineAddUser.java + $ref: examples/FaxLineAddUserExample.java - lang: Ruby label: Ruby source: - $ref: examples/FaxLineAddUser.rb + $ref: examples/FaxLineAddUserExample.rb - lang: Python label: Python source: - $ref: examples/FaxLineAddUser.py + $ref: examples/FaxLineAddUserExample.py - lang: cURL label: cURL source: - $ref: examples/FaxLineAddUser.sh + $ref: examples/FaxLineAddUserExample.sh x-meta: seo: title: 'Fax Line Add User | API Documentation | Dropbox Fax for Developers' @@ -1812,13 +1727,13 @@ paths: tags: - 'Fax Line' summary: 'Get Available Fax Line Area Codes' - description: 'Returns a response with the area codes available for a given state/provice and city.' + description: 'Returns a list of available area codes for a given state/province and city' operationId: faxLineAreaCodeGet parameters: - name: country in: query - description: 'Filter area codes by country.' + description: 'Filter area codes by country' required: true schema: type: string @@ -1826,10 +1741,11 @@ paths: - CA - US - UK + example: US - name: state in: query - description: 'Filter area codes by state.' + description: 'Filter area codes by state' schema: type: string enum: @@ -1887,7 +1803,7 @@ paths: - name: province in: query - description: 'Filter area codes by province.' + description: 'Filter area codes by province' schema: type: string enum: @@ -1907,11 +1823,11 @@ paths: - name: city in: query - description: 'Filter area codes by city.' + description: 'Filter area codes by city' schema: type: string responses: - 200: + '200': description: 'successful operation' headers: X-RateLimit-Limit: @@ -1925,9 +1841,9 @@ paths: schema: $ref: '#/components/schemas/FaxLineAreaCodeGetResponse' examples: - default_example: - $ref: '#/components/examples/FaxLineAreaCodeGetResponseExample' - 4XX: + example: + $ref: '#/components/examples/FaxLineAreaCodeGetResponse' + '4XX': description: failed_operation content: application/json: @@ -1935,15 +1851,15 @@ paths: $ref: '#/components/schemas/ErrorResponse' examples: 400_example: - $ref: '#/components/examples/Error400ResponseExample' + $ref: '#/components/examples/Error400Response' 401_example: - $ref: '#/components/examples/Error401ResponseExample' + $ref: '#/components/examples/Error401Response' 402_example: - $ref: '#/components/examples/Error402ResponseExample' + $ref: '#/components/examples/Error402Response' 403_example: - $ref: '#/components/examples/Error403ResponseExample' + $ref: '#/components/examples/Error403Response' 4XX_example: - $ref: '#/components/examples/Error4XXResponseExample' + $ref: '#/components/examples/Error4XXResponse' security: - api_key: [] @@ -1952,52 +1868,47 @@ paths: lang: PHP label: PHP source: - $ref: examples/FaxLineAreaCodeGet.php + $ref: examples/FaxLineAreaCodeGetExample.php - lang: 'C#' label: 'C#' source: - $ref: examples/FaxLineAreaCodeGet.cs - - - lang: JavaScript - label: JavaScript - source: - $ref: examples/FaxLineAreaCodeGet.js + $ref: examples/FaxLineAreaCodeGetExample.cs - lang: TypeScript label: TypeScript source: - $ref: examples/FaxLineAreaCodeGet.ts + $ref: examples/FaxLineAreaCodeGetExample.ts - lang: Java label: Java source: - $ref: examples/FaxLineAreaCodeGet.java + $ref: examples/FaxLineAreaCodeGetExample.java - lang: Ruby label: Ruby source: - $ref: examples/FaxLineAreaCodeGet.rb + $ref: examples/FaxLineAreaCodeGetExample.rb - lang: Python label: Python source: - $ref: examples/FaxLineAreaCodeGet.py + $ref: examples/FaxLineAreaCodeGetExample.py - lang: cURL label: cURL source: - $ref: examples/FaxLineAreaCodeGet.sh + $ref: examples/FaxLineAreaCodeGetExample.sh x-meta: seo: title: 'Fax Line Get Area Codes | API Documentation | Dropbox Fax for Developers' - description: 'The Dropbox Fax API allows you to build custom integrations. To find out how to purchase a new fax line, click here.' + description: 'The Dropbox Fax API allows you to build custom integrations. To find out what area codes are available, click here.' /fax_line/create: post: tags: - 'Fax Line' summary: 'Purchase Fax Line' - description: 'Purchases a new Fax Line.' + description: 'Purchases a new Fax Line' operationId: faxLineCreate requestBody: required: true @@ -2006,10 +1917,10 @@ paths: schema: $ref: '#/components/schemas/FaxLineCreateRequest' examples: - default_example: - $ref: '#/components/examples/FaxLineCreateRequestExample' + example: + $ref: '#/components/examples/FaxLineCreateRequest' responses: - 200: + '200': description: 'successful operation' headers: X-RateLimit-Limit: @@ -2023,9 +1934,9 @@ paths: schema: $ref: '#/components/schemas/FaxLineResponse' examples: - default_example: - $ref: '#/components/examples/FaxLineResponseExample' - 4XX: + example: + $ref: '#/components/examples/FaxLineResponse' + '4XX': description: failed_operation content: application/json: @@ -2033,17 +1944,17 @@ paths: $ref: '#/components/schemas/ErrorResponse' examples: 400_example: - $ref: '#/components/examples/Error400ResponseExample' + $ref: '#/components/examples/Error400Response' 401_example: - $ref: '#/components/examples/Error401ResponseExample' + $ref: '#/components/examples/Error401Response' 402_example: - $ref: '#/components/examples/Error402ResponseExample' + $ref: '#/components/examples/Error402Response' 403_example: - $ref: '#/components/examples/Error403ResponseExample' + $ref: '#/components/examples/Error403Response' 404_example: - $ref: '#/components/examples/Error404ResponseExample' + $ref: '#/components/examples/Error404Response' 4XX_example: - $ref: '#/components/examples/Error4XXResponseExample' + $ref: '#/components/examples/Error4XXResponse' security: - api_key: [] @@ -2052,42 +1963,37 @@ paths: lang: PHP label: PHP source: - $ref: examples/FaxLineCreate.php + $ref: examples/FaxLineCreateExample.php - lang: 'C#' label: 'C#' source: - $ref: examples/FaxLineCreate.cs - - - lang: JavaScript - label: JavaScript - source: - $ref: examples/FaxLineCreate.js + $ref: examples/FaxLineCreateExample.cs - lang: TypeScript label: TypeScript source: - $ref: examples/FaxLineCreate.ts + $ref: examples/FaxLineCreateExample.ts - lang: Java label: Java source: - $ref: examples/FaxLineCreate.java + $ref: examples/FaxLineCreateExample.java - lang: Ruby label: Ruby source: - $ref: examples/FaxLineCreate.rb + $ref: examples/FaxLineCreateExample.rb - lang: Python label: Python source: - $ref: examples/FaxLineCreate.py + $ref: examples/FaxLineCreateExample.py - lang: cURL label: cURL source: - $ref: examples/FaxLineCreate.sh + $ref: examples/FaxLineCreateExample.sh x-meta: seo: title: 'Purchase Fax Line | API Documentation | Dropbox Fax for Developers' @@ -2103,12 +2009,13 @@ paths: - name: number in: query - description: 'The Fax Line number.' + description: 'The Fax Line number' required: true schema: type: string + example: 123-123-1234 responses: - 200: + '200': description: 'successful operation' headers: X-RateLimit-Limit: @@ -2122,9 +2029,9 @@ paths: schema: $ref: '#/components/schemas/FaxLineResponse' examples: - default_example: - $ref: '#/components/examples/FaxLineResponseExample' - 4XX: + example: + $ref: '#/components/examples/FaxLineResponse' + '4XX': description: failed_operation content: application/json: @@ -2132,17 +2039,17 @@ paths: $ref: '#/components/schemas/ErrorResponse' examples: 400_example: - $ref: '#/components/examples/Error400ResponseExample' + $ref: '#/components/examples/Error400Response' 401_example: - $ref: '#/components/examples/Error401ResponseExample' + $ref: '#/components/examples/Error401Response' 402_example: - $ref: '#/components/examples/Error402ResponseExample' + $ref: '#/components/examples/Error402Response' 403_example: - $ref: '#/components/examples/Error403ResponseExample' + $ref: '#/components/examples/Error403Response' 404_example: - $ref: '#/components/examples/Error404ResponseExample' + $ref: '#/components/examples/Error404Response' 4XX_example: - $ref: '#/components/examples/Error4XXResponseExample' + $ref: '#/components/examples/Error4XXResponse' security: - api_key: [] @@ -2151,46 +2058,41 @@ paths: lang: PHP label: PHP source: - $ref: examples/FaxLineGet.php + $ref: examples/FaxLineGetExample.php - lang: 'C#' label: 'C#' source: - $ref: examples/FaxLineGet.cs - - - lang: JavaScript - label: JavaScript - source: - $ref: examples/FaxLineGet.js + $ref: examples/FaxLineGetExample.cs - lang: TypeScript label: TypeScript source: - $ref: examples/FaxLineGet.ts + $ref: examples/FaxLineGetExample.ts - lang: Java label: Java source: - $ref: examples/FaxLineGet.java + $ref: examples/FaxLineGetExample.java - lang: Ruby label: Ruby source: - $ref: examples/FaxLineGet.rb + $ref: examples/FaxLineGetExample.rb - lang: Python label: Python source: - $ref: examples/FaxLineGet.py + $ref: examples/FaxLineGetExample.py - lang: cURL label: cURL source: - $ref: examples/FaxLineGet.sh + $ref: examples/FaxLineGetExample.sh x-meta: seo: title: 'Get Fax Line | API Documentation | Dropbox Fax for Developers' - description: 'The Dropbox Fax API allows you to build custom integrations. To find out how to retrieve a fax line, click here.' + description: 'The Dropbox Fax API allows you to build custom integrations. To find out how to retrieve the properties of a fax line, click here.' delete: tags: - 'Fax Line' @@ -2204,10 +2106,10 @@ paths: schema: $ref: '#/components/schemas/FaxLineDeleteRequest' examples: - default_example: - $ref: '#/components/examples/FaxLineDeleteRequestExample' + example: + $ref: '#/components/examples/FaxLineDeleteRequest' responses: - 200: + '200': description: 'successful operation' headers: X-RateLimit-Limit: @@ -2218,7 +2120,7 @@ paths: $ref: '#/components/headers/X-Ratelimit-Reset' content: application/json: {} - 4XX: + '4XX': description: failed_operation content: application/json: @@ -2226,17 +2128,17 @@ paths: $ref: '#/components/schemas/ErrorResponse' examples: 400_example: - $ref: '#/components/examples/Error400ResponseExample' + $ref: '#/components/examples/Error400Response' 401_example: - $ref: '#/components/examples/Error401ResponseExample' + $ref: '#/components/examples/Error401Response' 402_example: - $ref: '#/components/examples/Error402ResponseExample' + $ref: '#/components/examples/Error402Response' 403_example: - $ref: '#/components/examples/Error403ResponseExample' + $ref: '#/components/examples/Error403Response' 404_example: - $ref: '#/components/examples/Error404ResponseExample' + $ref: '#/components/examples/Error404Response' 4XX_example: - $ref: '#/components/examples/Error4XXResponseExample' + $ref: '#/components/examples/Error4XXResponse' security: - api_key: [] @@ -2245,42 +2147,37 @@ paths: lang: PHP label: PHP source: - $ref: examples/FaxLineDelete.php + $ref: examples/FaxLineDeleteExample.php - lang: 'C#' label: 'C#' source: - $ref: examples/FaxLineDelete.cs - - - lang: JavaScript - label: JavaScript - source: - $ref: examples/FaxLineDelete.js + $ref: examples/FaxLineDeleteExample.cs - lang: TypeScript label: TypeScript source: - $ref: examples/FaxLineDelete.ts + $ref: examples/FaxLineDeleteExample.ts - lang: Java label: Java source: - $ref: examples/FaxLineDelete.java + $ref: examples/FaxLineDeleteExample.java - lang: Ruby label: Ruby source: - $ref: examples/FaxLineDelete.rb + $ref: examples/FaxLineDeleteExample.rb - lang: Python label: Python source: - $ref: examples/FaxLineDelete.py + $ref: examples/FaxLineDeleteExample.py - lang: cURL label: cURL source: - $ref: examples/FaxLineDelete.sh + $ref: examples/FaxLineDeleteExample.sh x-meta: seo: title: 'Delete Fax Line | API Documentation | Dropbox Fax for Developers' @@ -2299,31 +2196,31 @@ paths: description: 'Account ID' schema: type: string - example: ab55cd14a97219e36b5ff5fe23f2f9329b0c1e97 + example: ab55cd14a97219e36b5ff5fe23f2f9329b0c1e97 - name: page in: query - description: Page + description: 'Which page number of the Fax Line List to return. Defaults to `1`.' schema: type: integer default: 1 - example: 1 + example: 1 - name: page_size in: query - description: 'Page size' + description: 'Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`.' schema: type: integer default: 20 - example: 20 + example: 20 - name: show_team_lines in: query - description: 'Show team lines' + description: 'Include Fax Lines belonging to team members in the list' schema: type: boolean responses: - 200: + '200': description: 'successful operation' headers: X-RateLimit-Limit: @@ -2337,9 +2234,9 @@ paths: schema: $ref: '#/components/schemas/FaxLineListResponse' examples: - default_example: - $ref: '#/components/examples/FaxLineListResponseExample' - 4XX: + example: + $ref: '#/components/examples/FaxLineListResponse' + '4XX': description: failed_operation content: application/json: @@ -2347,15 +2244,15 @@ paths: $ref: '#/components/schemas/ErrorResponse' examples: 400_example: - $ref: '#/components/examples/Error400ResponseExample' + $ref: '#/components/examples/Error400Response' 401_example: - $ref: '#/components/examples/Error401ResponseExample' + $ref: '#/components/examples/Error401Response' 402_example: - $ref: '#/components/examples/Error402ResponseExample' + $ref: '#/components/examples/Error402Response' 403_example: - $ref: '#/components/examples/Error403ResponseExample' + $ref: '#/components/examples/Error403Response' 4XX_example: - $ref: '#/components/examples/Error4XXResponseExample' + $ref: '#/components/examples/Error4XXResponse' security: - api_key: [] @@ -2364,42 +2261,37 @@ paths: lang: PHP label: PHP source: - $ref: examples/FaxLineList.php + $ref: examples/FaxLineListExample.php - lang: 'C#' label: 'C#' source: - $ref: examples/FaxLineList.cs - - - lang: JavaScript - label: JavaScript - source: - $ref: examples/FaxLineList.js + $ref: examples/FaxLineListExample.cs - lang: TypeScript label: TypeScript source: - $ref: examples/FaxLineList.ts + $ref: examples/FaxLineListExample.ts - lang: Java label: Java source: - $ref: examples/FaxLineList.java + $ref: examples/FaxLineListExample.java - lang: Ruby label: Ruby source: - $ref: examples/FaxLineList.rb + $ref: examples/FaxLineListExample.rb - lang: Python label: Python source: - $ref: examples/FaxLineList.py + $ref: examples/FaxLineListExample.py - lang: cURL label: cURL source: - $ref: examples/FaxLineList.sh + $ref: examples/FaxLineListExample.sh x-meta: seo: title: 'List Fax Lines | API Documentation | Dropbox Fax for Developers' @@ -2409,7 +2301,7 @@ paths: tags: - 'Fax Line' summary: 'Remove Fax Line Access' - description: 'Removes a user''s access to the specified Fax Line.' + description: 'Removes a user''s access to the specified Fax Line' operationId: faxLineRemoveUser requestBody: required: true @@ -2418,10 +2310,10 @@ paths: schema: $ref: '#/components/schemas/FaxLineRemoveUserRequest' examples: - default_example: - $ref: '#/components/examples/FaxLineRemoveUserRequestExample' + example: + $ref: '#/components/examples/FaxLineRemoveUserRequest' responses: - 200: + '200': description: 'successful operation' headers: X-RateLimit-Limit: @@ -2435,9 +2327,9 @@ paths: schema: $ref: '#/components/schemas/FaxLineResponse' examples: - default_example: - $ref: '#/components/examples/FaxLineResponseExample' - 4XX: + example: + $ref: '#/components/examples/FaxLineResponse' + '4XX': description: failed_operation content: application/json: @@ -2445,17 +2337,17 @@ paths: $ref: '#/components/schemas/ErrorResponse' examples: 400_example: - $ref: '#/components/examples/Error400ResponseExample' + $ref: '#/components/examples/Error400Response' 401_example: - $ref: '#/components/examples/Error401ResponseExample' + $ref: '#/components/examples/Error401Response' 402_example: - $ref: '#/components/examples/Error402ResponseExample' + $ref: '#/components/examples/Error402Response' 403_example: - $ref: '#/components/examples/Error403ResponseExample' + $ref: '#/components/examples/Error403Response' 404_example: - $ref: '#/components/examples/Error404ResponseExample' + $ref: '#/components/examples/Error404Response' 4XX_example: - $ref: '#/components/examples/Error4XXResponseExample' + $ref: '#/components/examples/Error4XXResponse' security: - api_key: [] @@ -2464,42 +2356,37 @@ paths: lang: PHP label: PHP source: - $ref: examples/FaxLineRemoveUser.php + $ref: examples/FaxLineRemoveUserExample.php - lang: 'C#' label: 'C#' source: - $ref: examples/FaxLineRemoveUser.cs - - - lang: JavaScript - label: JavaScript - source: - $ref: examples/FaxLineRemoveUser.js + $ref: examples/FaxLineRemoveUserExample.cs - lang: TypeScript label: TypeScript source: - $ref: examples/FaxLineRemoveUser.ts + $ref: examples/FaxLineRemoveUserExample.ts - lang: Java label: Java source: - $ref: examples/FaxLineRemoveUser.java + $ref: examples/FaxLineRemoveUserExample.java - lang: Ruby label: Ruby source: - $ref: examples/FaxLineRemoveUser.rb + $ref: examples/FaxLineRemoveUserExample.rb - lang: Python label: Python source: - $ref: examples/FaxLineRemoveUser.py + $ref: examples/FaxLineRemoveUserExample.py - lang: cURL label: cURL source: - $ref: examples/FaxLineRemoveUser.sh + $ref: examples/FaxLineRemoveUserExample.sh x-meta: seo: title: 'Fax Line Remove User | API Documentation | Dropbox Fax for Developers' @@ -2509,13 +2396,13 @@ paths: tags: - Fax summary: 'Lists Faxes' - description: 'Returns properties of multiple faxes' + description: 'Returns properties of multiple Faxes' operationId: faxList parameters: - name: page in: query - description: Page + description: 'Which page number of the Fax List to return. Defaults to `1`.' schema: type: integer default: 1 @@ -2524,7 +2411,7 @@ paths: - name: page_size in: query - description: 'Page size' + description: 'Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`.' schema: type: integer default: 20 @@ -2532,7 +2419,7 @@ paths: minimum: 1 example: 20 responses: - 200: + '200': description: 'successful operation' headers: X-RateLimit-Limit: @@ -2546,9 +2433,9 @@ paths: schema: $ref: '#/components/schemas/FaxListResponse' examples: - default_example: - $ref: '#/components/examples/FaxListResponseExample' - 4XX: + example: + $ref: '#/components/examples/FaxListResponse' + '4XX': description: failed_operation content: application/json: @@ -2556,15 +2443,15 @@ paths: $ref: '#/components/schemas/ErrorResponse' examples: 400_example: - $ref: '#/components/examples/Error400ResponseExample' + $ref: '#/components/examples/Error400Response' 401_example: - $ref: '#/components/examples/Error401ResponseExample' + $ref: '#/components/examples/Error401Response' 402_example: - $ref: '#/components/examples/Error402ResponseExample' + $ref: '#/components/examples/Error402Response' 403_example: - $ref: '#/components/examples/Error403ResponseExample' + $ref: '#/components/examples/Error403Response' 4XX_example: - $ref: '#/components/examples/Error4XXResponseExample' + $ref: '#/components/examples/Error4XXResponse' security: - api_key: [] @@ -2573,42 +2460,37 @@ paths: lang: PHP label: PHP source: - $ref: examples/FaxList.php + $ref: examples/FaxListExample.php - lang: 'C#' label: 'C#' source: - $ref: examples/FaxList.cs - - - lang: JavaScript - label: JavaScript - source: - $ref: examples/FaxList.js + $ref: examples/FaxListExample.cs - lang: TypeScript label: TypeScript source: - $ref: examples/FaxList.ts + $ref: examples/FaxListExample.ts - lang: Java label: Java source: - $ref: examples/FaxList.java + $ref: examples/FaxListExample.java - lang: Ruby label: Ruby source: - $ref: examples/FaxList.rb + $ref: examples/FaxListExample.rb - lang: Python label: Python source: - $ref: examples/FaxList.py + $ref: examples/FaxListExample.py - lang: cURL label: cURL source: - $ref: examples/FaxList.sh + $ref: examples/FaxListExample.sh x-meta: seo: title: 'List Faxes | API Documentation | Dropbox Fax for Developers' @@ -2618,7 +2500,7 @@ paths: tags: - Fax summary: 'Send Fax' - description: 'Action to prepare and send a fax' + description: 'Creates and sends a new Fax with the submitted file(s)' operationId: faxSend requestBody: required: true @@ -2627,13 +2509,13 @@ paths: schema: $ref: '#/components/schemas/FaxSendRequest' examples: - default_example: - $ref: '#/components/examples/FaxSendRequestExample' + example: + $ref: '#/components/examples/FaxSendRequest' multipart/form-data: schema: $ref: '#/components/schemas/FaxSendRequest' responses: - 200: + '200': description: 'successful operation' headers: X-RateLimit-Limit: @@ -2647,9 +2529,9 @@ paths: schema: $ref: '#/components/schemas/FaxGetResponse' examples: - default_example: - $ref: '#/components/examples/FaxGetResponseExample' - 4XX: + example: + $ref: '#/components/examples/FaxGetResponse' + '4XX': description: failed_operation content: application/json: @@ -2657,19 +2539,19 @@ paths: $ref: '#/components/schemas/ErrorResponse' examples: 400_example: - $ref: '#/components/examples/Error400ResponseExample' + $ref: '#/components/examples/Error400Response' 401_example: - $ref: '#/components/examples/Error401ResponseExample' + $ref: '#/components/examples/Error401Response' 402_example: - $ref: '#/components/examples/Error402ResponseExample' + $ref: '#/components/examples/Error402Response' 403_example: - $ref: '#/components/examples/Error403ResponseExample' + $ref: '#/components/examples/Error403Response' 404_example: - $ref: '#/components/examples/Error404ResponseExample' + $ref: '#/components/examples/Error404Response' 429_example: - $ref: '#/components/examples/Error429ResponseExample' + $ref: '#/components/examples/Error429Response' 4XX_example: - $ref: '#/components/examples/Error4XXResponseExample' + $ref: '#/components/examples/Error4XXResponse' security: - api_key: [] @@ -2678,45 +2560,40 @@ paths: lang: PHP label: PHP source: - $ref: examples/FaxSend.php + $ref: examples/FaxSendExample.php - lang: 'C#' label: 'C#' source: - $ref: examples/FaxSend.cs - - - lang: JavaScript - label: JavaScript - source: - $ref: examples/FaxSend.js + $ref: examples/FaxSendExample.cs - lang: TypeScript label: TypeScript source: - $ref: examples/FaxSend.ts + $ref: examples/FaxSendExample.ts - lang: Java label: Java source: - $ref: examples/FaxSend.java + $ref: examples/FaxSendExample.java - lang: Ruby label: Ruby source: - $ref: examples/FaxSend.rb + $ref: examples/FaxSendExample.rb - lang: Python label: Python source: - $ref: examples/FaxSend.py + $ref: examples/FaxSendExample.py - lang: cURL label: cURL source: - $ref: examples/FaxSend.sh + $ref: examples/FaxSendExample.sh x-meta: seo: - title: 'Send Fax| API Documentation | Dropbox Fax for Developers' + title: 'Send Fax | API Documentation | Dropbox Fax for Developers' description: 'The Dropbox Fax API allows you to build custom integrations. To find out how to send a fax, click here.' /oauth/token: post: @@ -2732,10 +2609,10 @@ paths: schema: $ref: '#/components/schemas/OAuthTokenGenerateRequest' examples: - default_example: - $ref: '#/components/examples/OAuthTokenGenerateRequestExample' + example: + $ref: '#/components/examples/OAuthTokenGenerateRequest' responses: - 200: + '200': description: 'successful operation' headers: X-RateLimit-Limit: @@ -2749,9 +2626,9 @@ paths: schema: $ref: '#/components/schemas/OAuthTokenResponse' examples: - default_example: - $ref: '#/components/examples/OAuthTokenGenerateResponseExample' - 4XX: + example: + $ref: '#/components/examples/OAuthTokenGenerateResponse' + '4XX': description: failed_operation content: application/json: @@ -2759,15 +2636,15 @@ paths: $ref: '#/components/schemas/ErrorResponse' examples: 400_example: - $ref: '#/components/examples/Error400ResponseExample' + $ref: '#/components/examples/Error400Response' 401_example: - $ref: '#/components/examples/Error401ResponseExample' + $ref: '#/components/examples/Error401Response' 402_example: - $ref: '#/components/examples/Error402ResponseExample' + $ref: '#/components/examples/Error402Response' 403_example: - $ref: '#/components/examples/Error403ResponseExample' + $ref: '#/components/examples/Error403Response' 4XX_example: - $ref: '#/components/examples/Error4XXResponseExample' + $ref: '#/components/examples/Error4XXResponse' security: [] servers: - @@ -2777,42 +2654,37 @@ paths: lang: PHP label: PHP source: - $ref: examples/OauthTokenGenerate.php + $ref: examples/OauthTokenGenerateExample.php - lang: 'C#' label: 'C#' source: - $ref: examples/OauthTokenGenerate.cs - - - lang: JavaScript - label: JavaScript - source: - $ref: examples/OauthTokenGenerate.js + $ref: examples/OauthTokenGenerateExample.cs - lang: TypeScript label: TypeScript source: - $ref: examples/OauthTokenGenerate.ts + $ref: examples/OauthTokenGenerateExample.ts - lang: Java label: Java source: - $ref: examples/OauthTokenGenerate.java + $ref: examples/OauthTokenGenerateExample.java - lang: Ruby label: Ruby source: - $ref: examples/OauthTokenGenerate.rb + $ref: examples/OauthTokenGenerateExample.rb - lang: Python label: Python source: - $ref: examples/OauthTokenGenerate.py + $ref: examples/OauthTokenGenerateExample.py - lang: cURL label: cURL source: - $ref: examples/OauthTokenGenerate.sh + $ref: examples/OauthTokenGenerateExample.sh x-meta: seo: title: 'Generate OAuth Token | Documentation | Dropbox Sign for Developers' @@ -2832,10 +2704,10 @@ paths: schema: $ref: '#/components/schemas/OAuthTokenRefreshRequest' examples: - default_example: - $ref: '#/components/examples/OAuthTokenRefreshRequestExample' + example: + $ref: '#/components/examples/OAuthTokenRefreshRequest' responses: - 200: + '200': description: 'successful operation' headers: X-RateLimit-Limit: @@ -2849,9 +2721,9 @@ paths: schema: $ref: '#/components/schemas/OAuthTokenResponse' examples: - default_example: - $ref: '#/components/examples/OAuthTokenRefreshResponseExample' - 4XX: + example: + $ref: '#/components/examples/OAuthTokenRefreshResponse' + '4XX': description: failed_operation content: application/json: @@ -2859,15 +2731,15 @@ paths: $ref: '#/components/schemas/ErrorResponse' examples: 400_example: - $ref: '#/components/examples/Error400ResponseExample' + $ref: '#/components/examples/Error400Response' 401_example: - $ref: '#/components/examples/Error401ResponseExample' + $ref: '#/components/examples/Error401Response' 402_example: - $ref: '#/components/examples/Error402ResponseExample' + $ref: '#/components/examples/Error402Response' 403_example: - $ref: '#/components/examples/Error403ResponseExample' + $ref: '#/components/examples/Error403Response' 4XX_example: - $ref: '#/components/examples/Error4XXResponseExample' + $ref: '#/components/examples/Error4XXResponse' security: [] servers: - @@ -2877,42 +2749,37 @@ paths: lang: PHP label: PHP source: - $ref: examples/OauthTokenRefresh.php + $ref: examples/OauthTokenRefreshExample.php - lang: 'C#' label: 'C#' source: - $ref: examples/OauthTokenRefresh.cs - - - lang: JavaScript - label: JavaScript - source: - $ref: examples/OauthTokenRefresh.js + $ref: examples/OauthTokenRefreshExample.cs - lang: TypeScript label: TypeScript source: - $ref: examples/OauthTokenRefresh.ts + $ref: examples/OauthTokenRefreshExample.ts - lang: Java label: Java source: - $ref: examples/OauthTokenRefresh.java + $ref: examples/OauthTokenRefreshExample.java - lang: Ruby label: Ruby source: - $ref: examples/OauthTokenRefresh.rb + $ref: examples/OauthTokenRefreshExample.rb - lang: Python label: Python source: - $ref: examples/OauthTokenRefresh.py + $ref: examples/OauthTokenRefreshExample.py - lang: cURL label: cURL source: - $ref: examples/OauthTokenRefresh.sh + $ref: examples/OauthTokenRefreshExample.sh x-meta: seo: title: 'OAuth Token Refresh | Documentation | Dropbox Sign for Developers' @@ -2935,10 +2802,10 @@ paths: schema: $ref: '#/components/schemas/ReportCreateRequest' examples: - default_example: - $ref: '#/components/examples/ReportCreateRequestDefaultExample' + example: + $ref: '#/components/examples/ReportCreateRequest' responses: - 200: + '200': description: 'successful operation' headers: X-RateLimit-Limit: @@ -2952,9 +2819,9 @@ paths: schema: $ref: '#/components/schemas/ReportCreateResponse' examples: - default_example: - $ref: '#/components/examples/ReportCreateResponseExample' - 4XX: + example: + $ref: '#/components/examples/ReportCreateResponse' + '4XX': description: failed_operation content: application/json: @@ -2962,15 +2829,15 @@ paths: $ref: '#/components/schemas/ErrorResponse' examples: 400_example: - $ref: '#/components/examples/Error400ResponseExample' + $ref: '#/components/examples/Error400Response' 401_example: - $ref: '#/components/examples/Error401ResponseExample' + $ref: '#/components/examples/Error401Response' 402_example: - $ref: '#/components/examples/Error402ResponseExample' + $ref: '#/components/examples/Error402Response' 403_example: - $ref: '#/components/examples/Error403ResponseExample' + $ref: '#/components/examples/Error403Response' 4XX_example: - $ref: '#/components/examples/Error4XXResponseExample' + $ref: '#/components/examples/Error4XXResponse' security: - api_key: [] @@ -2979,42 +2846,37 @@ paths: lang: PHP label: PHP source: - $ref: examples/ReportCreate.php + $ref: examples/ReportCreateExample.php - lang: 'C#' label: 'C#' source: - $ref: examples/ReportCreate.cs - - - lang: JavaScript - label: JavaScript - source: - $ref: examples/ReportCreate.js + $ref: examples/ReportCreateExample.cs - lang: TypeScript label: TypeScript source: - $ref: examples/ReportCreate.ts + $ref: examples/ReportCreateExample.ts - lang: Java label: Java source: - $ref: examples/ReportCreate.java + $ref: examples/ReportCreateExample.java - lang: Ruby label: Ruby source: - $ref: examples/ReportCreate.rb + $ref: examples/ReportCreateExample.rb - lang: Python label: Python source: - $ref: examples/ReportCreate.py + $ref: examples/ReportCreateExample.py - lang: cURL label: cURL source: - $ref: examples/ReportCreate.sh + $ref: examples/ReportCreateExample.sh x-meta: seo: title: 'Create Report | API Documentation | Dropbox Sign for Developers' @@ -3036,13 +2898,13 @@ paths: schema: $ref: '#/components/schemas/SignatureRequestBulkCreateEmbeddedWithTemplateRequest' examples: - default_example: - $ref: '#/components/examples/SignatureRequestBulkCreateEmbeddedWithTemplateRequestDefaultExample' + example: + $ref: '#/components/examples/SignatureRequestBulkCreateEmbeddedWithTemplateRequest' multipart/form-data: schema: $ref: '#/components/schemas/SignatureRequestBulkCreateEmbeddedWithTemplateRequest' responses: - 200: + '200': description: 'successful operation' headers: X-RateLimit-Limit: @@ -3056,9 +2918,9 @@ paths: schema: $ref: '#/components/schemas/BulkSendJobSendResponse' examples: - default_example: - $ref: '#/components/examples/SignatureRequestBulkCreateEmbeddedWithTemplateResponseExample' - 4XX: + example: + $ref: '#/components/examples/SignatureRequestBulkCreateEmbeddedWithTemplateResponse' + '4XX': description: failed_operation content: application/json: @@ -3066,21 +2928,21 @@ paths: $ref: '#/components/schemas/ErrorResponse' examples: 400_example: - $ref: '#/components/examples/Error400ResponseExample' + $ref: '#/components/examples/Error400Response' 401_example: - $ref: '#/components/examples/Error401ResponseExample' + $ref: '#/components/examples/Error401Response' 402_example: - $ref: '#/components/examples/Error402ResponseExample' + $ref: '#/components/examples/Error402Response' 403_example: - $ref: '#/components/examples/Error403ResponseExample' + $ref: '#/components/examples/Error403Response' 404_example: - $ref: '#/components/examples/Error404ResponseExample' + $ref: '#/components/examples/Error404Response' 409_example: - $ref: '#/components/examples/Error409ResponseExample' + $ref: '#/components/examples/Error409Response' 429_example: - $ref: '#/components/examples/Error429ResponseExample' + $ref: '#/components/examples/Error429Response' 4XX_example: - $ref: '#/components/examples/Error4XXResponseExample' + $ref: '#/components/examples/Error4XXResponse' security: - api_key: [] @@ -3089,42 +2951,37 @@ paths: lang: PHP label: PHP source: - $ref: examples/SignatureRequestBulkCreateEmbeddedWithTemplate.php + $ref: examples/SignatureRequestBulkCreateEmbeddedWithTemplateExample.php - lang: 'C#' label: 'C#' source: - $ref: examples/SignatureRequestBulkCreateEmbeddedWithTemplate.cs - - - lang: JavaScript - label: JavaScript - source: - $ref: examples/SignatureRequestBulkCreateEmbeddedWithTemplate.js + $ref: examples/SignatureRequestBulkCreateEmbeddedWithTemplateExample.cs - lang: TypeScript label: TypeScript source: - $ref: examples/SignatureRequestBulkCreateEmbeddedWithTemplate.ts + $ref: examples/SignatureRequestBulkCreateEmbeddedWithTemplateExample.ts - lang: Java label: Java source: - $ref: examples/SignatureRequestBulkCreateEmbeddedWithTemplate.java + $ref: examples/SignatureRequestBulkCreateEmbeddedWithTemplateExample.java - lang: Ruby label: Ruby source: - $ref: examples/SignatureRequestBulkCreateEmbeddedWithTemplate.rb + $ref: examples/SignatureRequestBulkCreateEmbeddedWithTemplateExample.rb - lang: Python label: Python source: - $ref: examples/SignatureRequestBulkCreateEmbeddedWithTemplate.py + $ref: examples/SignatureRequestBulkCreateEmbeddedWithTemplateExample.py - lang: cURL label: cURL source: - $ref: examples/SignatureRequestBulkCreateEmbeddedWithTemplate.sh + $ref: examples/SignatureRequestBulkCreateEmbeddedWithTemplateExample.sh x-meta: seo: title: 'Embedded Bulk Send with Template | Dropbox Sign for Developers' @@ -3146,13 +3003,13 @@ paths: schema: $ref: '#/components/schemas/SignatureRequestBulkSendWithTemplateRequest' examples: - default_example: - $ref: '#/components/examples/SignatureRequestBulkSendWithTemplateRequestDefaultExample' + example: + $ref: '#/components/examples/SignatureRequestBulkSendWithTemplateRequest' multipart/form-data: schema: $ref: '#/components/schemas/SignatureRequestBulkSendWithTemplateRequest' responses: - 200: + '200': description: 'successful operation' headers: X-RateLimit-Limit: @@ -3166,9 +3023,9 @@ paths: schema: $ref: '#/components/schemas/BulkSendJobSendResponse' examples: - default_example: - $ref: '#/components/examples/SignatureRequestBulkSendWithTemplateResponseExample' - 4XX: + example: + $ref: '#/components/examples/SignatureRequestBulkSendWithTemplateResponse' + '4XX': description: failed_operation content: application/json: @@ -3176,17 +3033,17 @@ paths: $ref: '#/components/schemas/ErrorResponse' examples: 400_example: - $ref: '#/components/examples/Error400ResponseExample' + $ref: '#/components/examples/Error400Response' 401_example: - $ref: '#/components/examples/Error401ResponseExample' + $ref: '#/components/examples/Error401Response' 402_example: - $ref: '#/components/examples/Error402ResponseExample' + $ref: '#/components/examples/Error402Response' 403_example: - $ref: '#/components/examples/Error403ResponseExample' + $ref: '#/components/examples/Error403Response' 404_example: - $ref: '#/components/examples/Error404ResponseExample' + $ref: '#/components/examples/Error404Response' 4XX_example: - $ref: '#/components/examples/Error4XXResponseExample' + $ref: '#/components/examples/Error4XXResponse' security: - api_key: [] @@ -3199,42 +3056,37 @@ paths: lang: PHP label: PHP source: - $ref: examples/SignatureRequestBulkSendWithTemplate.php + $ref: examples/SignatureRequestBulkSendWithTemplateExample.php - lang: 'C#' label: 'C#' source: - $ref: examples/SignatureRequestBulkSendWithTemplate.cs - - - lang: JavaScript - label: JavaScript - source: - $ref: examples/SignatureRequestBulkSendWithTemplate.js + $ref: examples/SignatureRequestBulkSendWithTemplateExample.cs - lang: TypeScript label: TypeScript source: - $ref: examples/SignatureRequestBulkSendWithTemplate.ts + $ref: examples/SignatureRequestBulkSendWithTemplateExample.ts - lang: Java label: Java source: - $ref: examples/SignatureRequestBulkSendWithTemplate.java + $ref: examples/SignatureRequestBulkSendWithTemplateExample.java - lang: Ruby label: Ruby source: - $ref: examples/SignatureRequestBulkSendWithTemplate.rb + $ref: examples/SignatureRequestBulkSendWithTemplateExample.rb - lang: Python label: Python source: - $ref: examples/SignatureRequestBulkSendWithTemplate.py + $ref: examples/SignatureRequestBulkSendWithTemplateExample.py - lang: cURL label: cURL source: - $ref: examples/SignatureRequestBulkSendWithTemplate.sh + $ref: examples/SignatureRequestBulkSendWithTemplateExample.sh x-meta: seo: title: 'Bulk Send with Template | REST API | Dropbox Sign for Developers' @@ -3265,7 +3117,7 @@ paths: type: string example: fa5c8a0b0f492d768749333ad6fcc214c111e967 responses: - 200: + '200': description: 'successful operation' headers: X-RateLimit-Limit: @@ -3276,7 +3128,7 @@ paths: $ref: '#/components/headers/X-Ratelimit-Reset' content: application/json: {} - 4XX: + '4XX': description: failed_operation content: application/json: @@ -3284,21 +3136,21 @@ paths: $ref: '#/components/schemas/ErrorResponse' examples: 400_example: - $ref: '#/components/examples/Error400ResponseExample' + $ref: '#/components/examples/Error400Response' 401_example: - $ref: '#/components/examples/Error401ResponseExample' + $ref: '#/components/examples/Error401Response' 402_example: - $ref: '#/components/examples/Error402ResponseExample' + $ref: '#/components/examples/Error402Response' 403_example: - $ref: '#/components/examples/Error403ResponseExample' + $ref: '#/components/examples/Error403Response' 404_example: - $ref: '#/components/examples/Error404ResponseExample' + $ref: '#/components/examples/Error404Response' 409_example: - $ref: '#/components/examples/Error409ResponseExample' + $ref: '#/components/examples/Error409Response' 410_example: - $ref: '#/components/examples/Error410ResponseExample' + $ref: '#/components/examples/Error410Response' 4XX_example: - $ref: '#/components/examples/Error4XXResponseExample' + $ref: '#/components/examples/Error4XXResponse' security: - api_key: [] @@ -3311,42 +3163,37 @@ paths: lang: PHP label: PHP source: - $ref: examples/SignatureRequestCancel.php + $ref: examples/SignatureRequestCancelExample.php - lang: 'C#' label: 'C#' source: - $ref: examples/SignatureRequestCancel.cs - - - lang: JavaScript - label: JavaScript - source: - $ref: examples/SignatureRequestCancel.js + $ref: examples/SignatureRequestCancelExample.cs - lang: TypeScript label: TypeScript source: - $ref: examples/SignatureRequestCancel.ts + $ref: examples/SignatureRequestCancelExample.ts - lang: Java label: Java source: - $ref: examples/SignatureRequestCancel.java + $ref: examples/SignatureRequestCancelExample.java - lang: Ruby label: Ruby source: - $ref: examples/SignatureRequestCancel.rb + $ref: examples/SignatureRequestCancelExample.rb - lang: Python label: Python source: - $ref: examples/SignatureRequestCancel.py + $ref: examples/SignatureRequestCancelExample.py - lang: cURL label: cURL source: - $ref: examples/SignatureRequestCancel.sh + $ref: examples/SignatureRequestCancelExample.sh x-meta: seo: title: 'Cancel Incomplete Signature Request | Dropbox Sign for Developers' @@ -3365,15 +3212,15 @@ paths: schema: $ref: '#/components/schemas/SignatureRequestCreateEmbeddedRequest' examples: - default_example: - $ref: '#/components/examples/SignatureRequestCreateEmbeddedRequestDefaultExample' + example: + $ref: '#/components/examples/SignatureRequestCreateEmbeddedRequest' grouped_signers_example: - $ref: '#/components/examples/SignatureRequestCreateEmbeddedRequestGroupedSignersExample' + $ref: '#/components/examples/SignatureRequestCreateEmbeddedRequestGroupedSigners' multipart/form-data: schema: $ref: '#/components/schemas/SignatureRequestCreateEmbeddedRequest' responses: - 200: + '200': description: 'successful operation' headers: X-RateLimit-Limit: @@ -3387,9 +3234,9 @@ paths: schema: $ref: '#/components/schemas/SignatureRequestGetResponse' examples: - default_example: - $ref: '#/components/examples/SignatureRequestCreateEmbeddedResponseExample' - 4XX: + example: + $ref: '#/components/examples/SignatureRequestCreateEmbeddedResponse' + '4XX': description: failed_operation content: application/json: @@ -3397,19 +3244,19 @@ paths: $ref: '#/components/schemas/ErrorResponse' examples: 400_example: - $ref: '#/components/examples/Error400ResponseExample' + $ref: '#/components/examples/Error400Response' 401_example: - $ref: '#/components/examples/Error401ResponseExample' + $ref: '#/components/examples/Error401Response' 402_example: - $ref: '#/components/examples/Error402ResponseExample' + $ref: '#/components/examples/Error402Response' 403_example: - $ref: '#/components/examples/Error403ResponseExample' + $ref: '#/components/examples/Error403Response' 409_example: - $ref: '#/components/examples/Error409ResponseExample' + $ref: '#/components/examples/Error409Response' 429_example: - $ref: '#/components/examples/Error429ResponseExample' + $ref: '#/components/examples/Error429Response' 4XX_example: - $ref: '#/components/examples/Error4XXResponseExample' + $ref: '#/components/examples/Error4XXResponse' security: - api_key: [] @@ -3421,42 +3268,37 @@ paths: lang: PHP label: PHP source: - $ref: examples/SignatureRequestCreateEmbedded.php + $ref: examples/SignatureRequestCreateEmbeddedExample.php - lang: 'C#' label: 'C#' source: - $ref: examples/SignatureRequestCreateEmbedded.cs - - - lang: JavaScript - label: JavaScript - source: - $ref: examples/SignatureRequestCreateEmbedded.js + $ref: examples/SignatureRequestCreateEmbeddedExample.cs - lang: TypeScript label: TypeScript source: - $ref: examples/SignatureRequestCreateEmbedded.ts + $ref: examples/SignatureRequestCreateEmbeddedExample.ts - lang: Java label: Java source: - $ref: examples/SignatureRequestCreateEmbedded.java + $ref: examples/SignatureRequestCreateEmbeddedExample.java - lang: Ruby label: Ruby source: - $ref: examples/SignatureRequestCreateEmbedded.rb + $ref: examples/SignatureRequestCreateEmbeddedExample.rb - lang: Python label: Python source: - $ref: examples/SignatureRequestCreateEmbedded.py + $ref: examples/SignatureRequestCreateEmbeddedExample.py - lang: cURL label: cURL source: - $ref: examples/SignatureRequestCreateEmbedded.sh + $ref: examples/SignatureRequestCreateEmbeddedExample.sh x-meta: seo: title: 'Create Embedded Signature Request | Dropbox Sign for Developers' @@ -3475,13 +3317,13 @@ paths: schema: $ref: '#/components/schemas/SignatureRequestCreateEmbeddedWithTemplateRequest' examples: - default_example: - $ref: '#/components/examples/SignatureRequestCreateEmbeddedWithTemplateRequestDefaultExample' + example: + $ref: '#/components/examples/SignatureRequestCreateEmbeddedWithTemplateRequest' multipart/form-data: schema: $ref: '#/components/schemas/SignatureRequestCreateEmbeddedWithTemplateRequest' responses: - 200: + '200': description: 'successful operation' headers: X-RateLimit-Limit: @@ -3495,9 +3337,9 @@ paths: schema: $ref: '#/components/schemas/SignatureRequestGetResponse' examples: - default_example: - $ref: '#/components/examples/SignatureRequestCreateEmbeddedWithTemplateResponseExample' - 4XX: + example: + $ref: '#/components/examples/SignatureRequestCreateEmbeddedWithTemplateResponse' + '4XX': description: failed_operation content: application/json: @@ -3505,19 +3347,19 @@ paths: $ref: '#/components/schemas/ErrorResponse' examples: 400_example: - $ref: '#/components/examples/Error400ResponseExample' + $ref: '#/components/examples/Error400Response' 401_example: - $ref: '#/components/examples/Error401ResponseExample' + $ref: '#/components/examples/Error401Response' 402_example: - $ref: '#/components/examples/Error402ResponseExample' + $ref: '#/components/examples/Error402Response' 403_example: - $ref: '#/components/examples/Error403ResponseExample' + $ref: '#/components/examples/Error403Response' 409_example: - $ref: '#/components/examples/Error409ResponseExample' + $ref: '#/components/examples/Error409Response' 429_example: - $ref: '#/components/examples/Error429ResponseExample' + $ref: '#/components/examples/Error429Response' 4XX_example: - $ref: '#/components/examples/Error4XXResponseExample' + $ref: '#/components/examples/Error4XXResponse' security: - api_key: [] @@ -3529,77 +3371,76 @@ paths: lang: PHP label: PHP source: - $ref: examples/SignatureRequestCreateEmbeddedWithTemplate.php + $ref: examples/SignatureRequestCreateEmbeddedWithTemplateExample.php - lang: 'C#' label: 'C#' source: - $ref: examples/SignatureRequestCreateEmbeddedWithTemplate.cs - - - lang: JavaScript - label: JavaScript - source: - $ref: examples/SignatureRequestCreateEmbeddedWithTemplate.js + $ref: examples/SignatureRequestCreateEmbeddedWithTemplateExample.cs - lang: TypeScript label: TypeScript source: - $ref: examples/SignatureRequestCreateEmbeddedWithTemplate.ts + $ref: examples/SignatureRequestCreateEmbeddedWithTemplateExample.ts - lang: Java label: Java source: - $ref: examples/SignatureRequestCreateEmbeddedWithTemplate.java + $ref: examples/SignatureRequestCreateEmbeddedWithTemplateExample.java - lang: Ruby label: Ruby source: - $ref: examples/SignatureRequestCreateEmbeddedWithTemplate.rb + $ref: examples/SignatureRequestCreateEmbeddedWithTemplateExample.rb - lang: Python label: Python source: - $ref: examples/SignatureRequestCreateEmbeddedWithTemplate.py + $ref: examples/SignatureRequestCreateEmbeddedWithTemplateExample.py - lang: cURL label: cURL source: - $ref: examples/SignatureRequestCreateEmbeddedWithTemplate.sh + $ref: examples/SignatureRequestCreateEmbeddedWithTemplateExample.sh x-meta: seo: title: 'Signature Request with Template | Dropbox Sign for Developers' description: 'The Dropbox Sign API allows you to build custom integrations. To find out how to create a new SignatureRequest based on the given Template, click here.' - '/signature_request/files/{signature_request_id}': - get: + '/signature_request/edit/{signature_request_id}': + put: tags: - 'Signature Request' - summary: 'Download Files' + summary: 'Edit Signature Request' description: |- - Obtain a copy of the current documents specified by the `signature_request_id` parameter. Returns a PDF or ZIP file. + Edits and sends a SignatureRequest with the submitted documents. If `form_fields_per_document` is not specified, a signature page will be affixed where all signers will be required to add their signature, signifying their agreement to all contained documents. - If the files are currently being prepared, a status code of `409` will be returned instead. - operationId: signatureRequestFiles + **NOTE:** Edit and resend *will* deduct your signature request quota. + operationId: signatureRequestEdit parameters: - name: signature_request_id in: path - description: 'The id of the SignatureRequest to retrieve.' + description: 'The id of the SignatureRequest to edit.' required: true schema: type: string example: fa5c8a0b0f492d768749333ad6fcc214c111e967 - - - name: file_type - in: query - description: 'Set to `pdf` for a single merged document or `zip` for a collection of individual documents.' - schema: - type: string - default: pdf - enum: - - pdf - - zip + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/SignatureRequestEditRequest' + examples: + example: + $ref: '#/components/examples/SignatureRequestEditRequest' + grouped_signers_example: + $ref: '#/components/examples/SignatureRequestEditRequestGroupedSigners' + multipart/form-data: + schema: + $ref: '#/components/schemas/SignatureRequestEditRequest' responses: - 200: + '200': description: 'successful operation' headers: X-RateLimit-Limit: @@ -3609,15 +3450,13 @@ paths: X-Ratelimit-Reset: $ref: '#/components/headers/X-Ratelimit-Reset' content: - application/pdf: - schema: - type: string - format: binary - application/zip: + application/json: schema: - type: string - format: binary - 4XX: + $ref: '#/components/schemas/SignatureRequestGetResponse' + examples: + example: + $ref: '#/components/examples/SignatureRequestSendResponse' + '4XX': description: failed_operation content: application/json: @@ -3625,23 +3464,21 @@ paths: $ref: '#/components/schemas/ErrorResponse' examples: 400_example: - $ref: '#/components/examples/Error400ResponseExample' + $ref: '#/components/examples/Error400Response' 401_example: - $ref: '#/components/examples/Error401ResponseExample' + $ref: '#/components/examples/Error401Response' 402_example: - $ref: '#/components/examples/Error402ResponseExample' + $ref: '#/components/examples/Error402Response' 403_example: - $ref: '#/components/examples/Error403ResponseExample' + $ref: '#/components/examples/Error403Response' 404_example: - $ref: '#/components/examples/Error404ResponseExample' + $ref: '#/components/examples/Error404Response' 409_example: - $ref: '#/components/examples/Error409ResponseExample' - 410_example: - $ref: '#/components/examples/Error410ResponseExample' + $ref: '#/components/examples/Error409Response' 429_example: - $ref: '#/components/examples/Error429ResponseExample' + $ref: '#/components/examples/Error429Response' 4XX_example: - $ref: '#/components/examples/Error4XXResponseExample' + $ref: '#/components/examples/Error4XXResponse' security: - api_key: [] @@ -3654,67 +3491,76 @@ paths: lang: PHP label: PHP source: - $ref: examples/SignatureRequestFiles.php + $ref: examples/SignatureRequestEditExample.php - lang: 'C#' label: 'C#' source: - $ref: examples/SignatureRequestFiles.cs - - - lang: JavaScript - label: JavaScript - source: - $ref: examples/SignatureRequestFiles.js + $ref: examples/SignatureRequestEditExample.cs - lang: TypeScript label: TypeScript source: - $ref: examples/SignatureRequestFiles.ts + $ref: examples/SignatureRequestEditExample.ts - lang: Java label: Java source: - $ref: examples/SignatureRequestFiles.java + $ref: examples/SignatureRequestEditExample.java - lang: Ruby label: Ruby source: - $ref: examples/SignatureRequestFiles.rb + $ref: examples/SignatureRequestEditExample.rb - lang: Python label: Python source: - $ref: examples/SignatureRequestFiles.py + $ref: examples/SignatureRequestEditExample.py - lang: cURL label: cURL source: - $ref: examples/SignatureRequestFiles.sh + $ref: examples/SignatureRequestEditExample.sh x-meta: seo: - title: 'Download Files | API Documentation | Dropbox Sign for Developers' - description: 'The RESTful Dropbox Sign API allows you to build custom integrations. To find out how to get the current documents specified by the parameters, click here' - '/signature_request/files_as_data_uri/{signature_request_id}': - get: + title: 'Edit Signature Request | REST API | Dropbox Sign for Developers' + description: 'Dropbox Sign API allows you to build custom integrations. To find out how to edit a SignatureRequest with the submitted documents, click here.' + '/signature_request/edit_embedded/{signature_request_id}': + put: tags: - 'Signature Request' - summary: 'Download Files as Data Uri' + summary: 'Edit Embedded Signature Request' description: |- - Obtain a copy of the current documents specified by the `signature_request_id` parameter. Returns a JSON object with a `data_uri` representing the base64 encoded file (PDFs only). + Edits a SignatureRequest with the submitted documents to be signed in an embedded iFrame. If form_fields_per_document is not specified, a signature page will be affixed where all signers will be required to add their signature, signifying their agreement to all contained documents. Note that embedded signature requests can only be signed in embedded iFrames whereas normal signature requests can only be signed on Dropbox Sign. - If the files are currently being prepared, a status code of `409` will be returned instead. - operationId: signatureRequestFilesAsDataUri + **NOTE:** Edit and resend *will* deduct your signature request quota. + operationId: signatureRequestEditEmbedded parameters: - name: signature_request_id in: path - description: 'The id of the SignatureRequest to retrieve.' + description: 'The id of the SignatureRequest to edit.' required: true schema: type: string example: fa5c8a0b0f492d768749333ad6fcc214c111e967 + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/SignatureRequestEditEmbeddedRequest' + examples: + example: + $ref: '#/components/examples/SignatureRequestEditEmbeddedRequest' + grouped_signers_example: + $ref: '#/components/examples/SignatureRequestEditEmbeddedRequestGroupedSigners' + multipart/form-data: + schema: + $ref: '#/components/schemas/SignatureRequestEditEmbeddedRequest' responses: - 200: + '200': description: 'successful operation' headers: X-RateLimit-Limit: @@ -3726,11 +3572,11 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/FileResponseDataUri' + $ref: '#/components/schemas/SignatureRequestGetResponse' examples: - default_example: - $ref: '#/components/examples/SignatureRequestFilesResponseExample' - 4XX: + example: + $ref: '#/components/examples/SignatureRequestCreateEmbeddedResponse' + '4XX': description: failed_operation content: application/json: @@ -3738,103 +3584,100 @@ paths: $ref: '#/components/schemas/ErrorResponse' examples: 400_example: - $ref: '#/components/examples/Error400ResponseExample' + $ref: '#/components/examples/Error400Response' 401_example: - $ref: '#/components/examples/Error401ResponseExample' + $ref: '#/components/examples/Error401Response' 402_example: - $ref: '#/components/examples/Error402ResponseExample' + $ref: '#/components/examples/Error402Response' 403_example: - $ref: '#/components/examples/Error403ResponseExample' + $ref: '#/components/examples/Error403Response' 404_example: - $ref: '#/components/examples/Error404ResponseExample' + $ref: '#/components/examples/Error404Response' 409_example: - $ref: '#/components/examples/Error409ResponseExample' - 410_example: - $ref: '#/components/examples/Error410ResponseExample' + $ref: '#/components/examples/Error409Response' 429_example: - $ref: '#/components/examples/Error429ResponseExample' + $ref: '#/components/examples/Error429Response' 4XX_example: - $ref: '#/components/examples/Error4XXResponseExample' + $ref: '#/components/examples/Error4XXResponse' security: - api_key: [] - oauth2: - - request_signature - signature_request_access x-codeSamples: - lang: PHP label: PHP source: - $ref: examples/SignatureRequestFilesAsDataUri.php + $ref: examples/SignatureRequestEditEmbeddedExample.php - lang: 'C#' label: 'C#' source: - $ref: examples/SignatureRequestFilesAsDataUri.cs - - - lang: JavaScript - label: JavaScript - source: - $ref: examples/SignatureRequestFilesAsDataUri.js + $ref: examples/SignatureRequestEditEmbeddedExample.cs - lang: TypeScript label: TypeScript source: - $ref: examples/SignatureRequestFilesAsDataUri.ts + $ref: examples/SignatureRequestEditEmbeddedExample.ts - lang: Java label: Java source: - $ref: examples/SignatureRequestFilesAsDataUri.java + $ref: examples/SignatureRequestEditEmbeddedExample.java - lang: Ruby label: Ruby source: - $ref: examples/SignatureRequestFilesAsDataUri.rb + $ref: examples/SignatureRequestEditEmbeddedExample.rb - lang: Python label: Python source: - $ref: examples/SignatureRequestFilesAsDataUri.py + $ref: examples/SignatureRequestEditEmbeddedExample.py - lang: cURL label: cURL source: - $ref: examples/SignatureRequestFilesAsDataUri.sh + $ref: examples/SignatureRequestEditEmbeddedExample.sh x-meta: seo: - title: 'Download Files | API Documentation | Dropbox Sign for Developers' - description: 'The RESTful Dropbox Sign API allows you to build custom integrations. To find out how to get the current documents specified by the parameters, click here' - '/signature_request/files_as_file_url/{signature_request_id}': - get: + title: 'Edit Embedded Signature Request | Dropbox Sign for Developers' + description: 'The RESTful Dropbox Sign API easily allows you to build custom integrations. To find out how to edit a SignatureRequest in an iFrame, click here.' + '/signature_request/edit_embedded_with_template/{signature_request_id}': + put: tags: - 'Signature Request' - summary: 'Download Files as File Url' + summary: 'Edit Embedded Signature Request with Template' description: |- - Obtain a copy of the current documents specified by the `signature_request_id` parameter. Returns a JSON object with a url to the file (PDFs only). + Edits a SignatureRequest based on the given Template(s) to be signed in an embedded iFrame. Note that embedded signature requests can only be signed in embedded iFrames whereas normal signature requests can only be signed on Dropbox Sign. - If the files are currently being prepared, a status code of `409` will be returned instead. - operationId: signatureRequestFilesAsFileUrl + **NOTE:** Edit and resend *will* deduct your signature request quota. + operationId: signatureRequestEditEmbeddedWithTemplate parameters: - name: signature_request_id in: path - description: 'The id of the SignatureRequest to retrieve.' + description: 'The id of the SignatureRequest to edit.' required: true schema: type: string example: fa5c8a0b0f492d768749333ad6fcc214c111e967 - - - name: force_download - in: query - description: 'By default when opening the `file_url` a browser will download the PDF and save it locally. When set to `0` the PDF file will be displayed in the browser.' - schema: - type: integer - default: 1 + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/SignatureRequestEditEmbeddedWithTemplateRequest' + examples: + example: + $ref: '#/components/examples/SignatureRequestEditEmbeddedWithTemplateRequest' + multipart/form-data: + schema: + $ref: '#/components/schemas/SignatureRequestEditEmbeddedWithTemplateRequest' responses: - 200: + '200': description: 'successful operation' headers: X-RateLimit-Limit: @@ -3846,11 +3689,11 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/FileResponse' + $ref: '#/components/schemas/SignatureRequestGetResponse' examples: - default_example: - $ref: '#/components/examples/SignatureRequestFilesResponseExample' - 4XX: + example: + $ref: '#/components/examples/SignatureRequestCreateEmbeddedWithTemplateResponse' + '4XX': description: failed_operation content: application/json: @@ -3858,93 +3701,100 @@ paths: $ref: '#/components/schemas/ErrorResponse' examples: 400_example: - $ref: '#/components/examples/Error400ResponseExample' + $ref: '#/components/examples/Error400Response' 401_example: - $ref: '#/components/examples/Error401ResponseExample' + $ref: '#/components/examples/Error401Response' 402_example: - $ref: '#/components/examples/Error402ResponseExample' + $ref: '#/components/examples/Error402Response' 403_example: - $ref: '#/components/examples/Error403ResponseExample' + $ref: '#/components/examples/Error403Response' 404_example: - $ref: '#/components/examples/Error404ResponseExample' + $ref: '#/components/examples/Error404Response' 409_example: - $ref: '#/components/examples/Error409ResponseExample' - 410_example: - $ref: '#/components/examples/Error410ResponseExample' + $ref: '#/components/examples/Error409Response' 429_example: - $ref: '#/components/examples/Error429ResponseExample' + $ref: '#/components/examples/Error429Response' 4XX_example: - $ref: '#/components/examples/Error4XXResponseExample' + $ref: '#/components/examples/Error4XXResponse' security: - api_key: [] - oauth2: - - request_signature - signature_request_access x-codeSamples: - lang: PHP label: PHP source: - $ref: examples/SignatureRequestFilesAsFileUrl.php + $ref: examples/SignatureRequestEditEmbeddedWithTemplateExample.php - lang: 'C#' label: 'C#' source: - $ref: examples/SignatureRequestFilesAsFileUrl.cs - - - lang: JavaScript - label: JavaScript - source: - $ref: examples/SignatureRequestFilesAsFileUrl.js + $ref: examples/SignatureRequestEditEmbeddedWithTemplateExample.cs - lang: TypeScript label: TypeScript source: - $ref: examples/SignatureRequestFilesAsFileUrl.ts + $ref: examples/SignatureRequestEditEmbeddedWithTemplateExample.ts - lang: Java label: Java source: - $ref: examples/SignatureRequestFilesAsFileUrl.java + $ref: examples/SignatureRequestEditEmbeddedWithTemplateExample.java - lang: Ruby label: Ruby source: - $ref: examples/SignatureRequestFilesAsFileUrl.rb + $ref: examples/SignatureRequestEditEmbeddedWithTemplateExample.rb - lang: Python label: Python source: - $ref: examples/SignatureRequestFilesAsFileUrl.py + $ref: examples/SignatureRequestEditEmbeddedWithTemplateExample.py - lang: cURL label: cURL source: - $ref: examples/SignatureRequestFilesAsFileUrl.sh + $ref: examples/SignatureRequestEditEmbeddedWithTemplateExample.sh x-meta: seo: - title: 'Download Files | API Documentation | Dropbox Sign for Developers' - description: 'The RESTful Dropbox Sign API allows you to build custom integrations. To find out how to get the current documents specified by the parameters, click here' - '/signature_request/{signature_request_id}': - get: + title: 'Signature Request with Template | Dropbox Sign for Developers' + description: 'The Dropbox Sign API allows you to build custom integrations. To find out how to edit a SignatureRequest based on the given Template, click here.' + '/signature_request/edit_with_template/{signature_request_id}': + put: tags: - 'Signature Request' - summary: 'Get Signature Request' - description: 'Returns the status of the SignatureRequest specified by the `signature_request_id` parameter.' - operationId: signatureRequestGet + summary: 'Edit Signature Request With Template' + description: |- + Edits and sends a SignatureRequest based off of the Template(s) specified with the template_ids parameter. + + **NOTE:** Edit and resend *will* deduct your signature request quota. + operationId: signatureRequestEditWithTemplate parameters: - name: signature_request_id in: path - description: 'The id of the SignatureRequest to retrieve.' + description: 'The id of the SignatureRequest to edit.' required: true schema: type: string example: fa5c8a0b0f492d768749333ad6fcc214c111e967 + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/SignatureRequestEditWithTemplateRequest' + examples: + example: + $ref: '#/components/examples/SignatureRequestEditWithTemplateRequest' + multipart/form-data: + schema: + $ref: '#/components/schemas/SignatureRequestEditWithTemplateRequest' responses: - 200: + '200': description: 'successful operation' headers: X-RateLimit-Limit: @@ -3958,9 +3808,9 @@ paths: schema: $ref: '#/components/schemas/SignatureRequestGetResponse' examples: - default_example: - $ref: '#/components/examples/SignatureRequestGetResponseExample' - 4XX: + example: + $ref: '#/components/examples/SignatureRequestSendWithTemplateResponse' + '4XX': description: failed_operation content: application/json: @@ -3968,19 +3818,21 @@ paths: $ref: '#/components/schemas/ErrorResponse' examples: 400_example: - $ref: '#/components/examples/Error400ResponseExample' + $ref: '#/components/examples/Error400Response' 401_example: - $ref: '#/components/examples/Error401ResponseExample' + $ref: '#/components/examples/Error401Response' 402_example: - $ref: '#/components/examples/Error402ResponseExample' + $ref: '#/components/examples/Error402Response' 403_example: - $ref: '#/components/examples/Error403ResponseExample' + $ref: '#/components/examples/Error403Response' 404_example: - $ref: '#/components/examples/Error404ResponseExample' - 410_example: - $ref: '#/components/examples/Error410ResponseExample' + $ref: '#/components/examples/Error404Response' + 409_example: + $ref: '#/components/examples/Error409Response' + 429_example: + $ref: '#/components/examples/Error429Response' 4XX_example: - $ref: '#/components/examples/Error4XXResponseExample' + $ref: '#/components/examples/Error4XXResponse' security: - api_key: [] @@ -3993,86 +3845,72 @@ paths: lang: PHP label: PHP source: - $ref: examples/SignatureRequestGet.php + $ref: examples/SignatureRequestEditWithTemplateExample.php - lang: 'C#' label: 'C#' source: - $ref: examples/SignatureRequestGet.cs - - - lang: JavaScript - label: JavaScript - source: - $ref: examples/SignatureRequestGet.js + $ref: examples/SignatureRequestEditWithTemplateExample.cs - lang: TypeScript label: TypeScript source: - $ref: examples/SignatureRequestGet.ts + $ref: examples/SignatureRequestEditWithTemplateExample.ts - lang: Java label: Java source: - $ref: examples/SignatureRequestGet.java + $ref: examples/SignatureRequestEditWithTemplateExample.java - lang: Ruby label: Ruby source: - $ref: examples/SignatureRequestGet.rb + $ref: examples/SignatureRequestEditWithTemplateExample.rb - lang: Python label: Python source: - $ref: examples/SignatureRequestGet.py + $ref: examples/SignatureRequestEditWithTemplateExample.py - lang: cURL label: cURL source: - $ref: examples/SignatureRequestGet.sh + $ref: examples/SignatureRequestEditWithTemplateExample.sh x-meta: seo: - title: 'Get Signature Request | Documentation | Dropbox Sign for Developers' - description: 'The Dropbox Sign API allows you to build custom integrations. To find out how to return the status of SignatureRequest specified by the parameters, click here.' - /signature_request/list: + title: 'Edit Signature Request with Template | API Documentation | Dropbox Sign for Developers' + description: 'Dropbox Sign API allows you to build custom integrations. To find out how to edit a SignatureRequest based off of the Template, click here.' + '/signature_request/files/{signature_request_id}': get: tags: - 'Signature Request' - summary: 'List Signature Requests' + summary: 'Download Files' description: |- - Returns a list of SignatureRequests that you can access. This includes SignatureRequests you have sent as well as received, but not ones that you have been CCed on. + Obtain a copy of the current documents specified by the `signature_request_id` parameter. Returns a PDF or ZIP file. - Take a look at our [search guide](/api/reference/search/) to learn more about querying signature requests. - operationId: signatureRequestList + If the files are currently being prepared, a status code of `409` will be returned instead. + operationId: signatureRequestFiles parameters: - - name: account_id - in: query - description: 'Which account to return SignatureRequests for. Must be a team member. Use `all` to indicate all team members. Defaults to your account.' + name: signature_request_id + in: path + description: 'The id of the SignatureRequest to retrieve.' + required: true schema: type: string + example: fa5c8a0b0f492d768749333ad6fcc214c111e967 - - name: page + name: file_type in: query - description: 'Which page number of the SignatureRequest List to return. Defaults to `1`.' - schema: - type: integer - default: 1 - example: 1 - - - name: page_size - in: query - description: 'Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`.' - schema: - type: integer - default: 20 - - - name: query - in: query - description: 'String that includes search terms and/or fields to be used to filter the SignatureRequest objects.' + description: 'Set to `pdf` for a single merged document or `zip` for a collection of individual documents.' schema: type: string + default: pdf + enum: + - pdf + - zip responses: - 200: + '200': description: 'successful operation' headers: X-RateLimit-Limit: @@ -4082,13 +3920,15 @@ paths: X-Ratelimit-Reset: $ref: '#/components/headers/X-Ratelimit-Reset' content: - application/json: + application/pdf: schema: - $ref: '#/components/schemas/SignatureRequestListResponse' - examples: - default_example: - $ref: '#/components/examples/SignatureRequestListResponseExample' - 4XX: + type: string + format: binary + application/zip: + schema: + type: string + format: binary + '4XX': description: failed_operation content: application/json: @@ -4096,17 +3936,23 @@ paths: $ref: '#/components/schemas/ErrorResponse' examples: 400_example: - $ref: '#/components/examples/Error400ResponseExample' + $ref: '#/components/examples/Error400Response' 401_example: - $ref: '#/components/examples/Error401ResponseExample' + $ref: '#/components/examples/Error401Response' 402_example: - $ref: '#/components/examples/Error402ResponseExample' + $ref: '#/components/examples/Error402Response' 403_example: - $ref: '#/components/examples/Error403ResponseExample' + $ref: '#/components/examples/Error403Response' + 404_example: + $ref: '#/components/examples/Error404Response' 409_example: - $ref: '#/components/examples/Error409ResponseExample' + $ref: '#/components/examples/Error409Response' + 410_example: + $ref: '#/components/examples/Error410Response' + 429_example: + $ref: '#/components/examples/Error429Response' 4XX_example: - $ref: '#/components/examples/Error4XXResponseExample' + $ref: '#/components/examples/Error4XXResponse' security: - api_key: [] @@ -4119,64 +3965,62 @@ paths: lang: PHP label: PHP source: - $ref: examples/SignatureRequestList.php + $ref: examples/SignatureRequestFilesExample.php - lang: 'C#' label: 'C#' source: - $ref: examples/SignatureRequestList.cs - - - lang: JavaScript - label: JavaScript - source: - $ref: examples/SignatureRequestList.js + $ref: examples/SignatureRequestFilesExample.cs - lang: TypeScript label: TypeScript source: - $ref: examples/SignatureRequestList.ts + $ref: examples/SignatureRequestFilesExample.ts - lang: Java label: Java source: - $ref: examples/SignatureRequestList.java + $ref: examples/SignatureRequestFilesExample.java - lang: Ruby label: Ruby source: - $ref: examples/SignatureRequestList.rb + $ref: examples/SignatureRequestFilesExample.rb - lang: Python label: Python source: - $ref: examples/SignatureRequestList.py + $ref: examples/SignatureRequestFilesExample.py - lang: cURL label: cURL source: - $ref: examples/SignatureRequestList.sh + $ref: examples/SignatureRequestFilesExample.sh x-meta: seo: - title: 'List Signature Requests | REST API | Dropbox Sign for Developers' - description: 'The Dropbox Sign API allows you to build custom integrations. To find out how to return a list of SignatureRequests that you can access, click here.' - '/signature_request/release_hold/{signature_request_id}': - post: + title: 'Download Files | API Documentation | Dropbox Sign for Developers' + description: 'The RESTful Dropbox Sign API allows you to build custom integrations. To find out how to get the current documents specified by the parameters, click here' + '/signature_request/files_as_data_uri/{signature_request_id}': + get: tags: - 'Signature Request' - summary: 'Release On-Hold Signature Request' - description: 'Releases a held SignatureRequest that was claimed and prepared from an [UnclaimedDraft](/api/reference/tag/Unclaimed-Draft). The owner of the Draft must indicate at Draft creation that the SignatureRequest created from the Draft should be held. Releasing the SignatureRequest will send requests to all signers.' - operationId: signatureRequestReleaseHold + summary: 'Download Files as Data Uri' + description: |- + Obtain a copy of the current documents specified by the `signature_request_id` parameter. Returns a JSON object with a `data_uri` representing the base64 encoded file (PDFs only). + + If the files are currently being prepared, a status code of `409` will be returned instead. + operationId: signatureRequestFilesAsDataUri parameters: - name: signature_request_id in: path - description: 'The id of the SignatureRequest to release.' + description: 'The id of the SignatureRequest to retrieve.' required: true schema: type: string example: fa5c8a0b0f492d768749333ad6fcc214c111e967 responses: - 200: + '200': description: 'successful operation' headers: X-RateLimit-Limit: @@ -4188,11 +4032,11 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/SignatureRequestGetResponse' + $ref: '#/components/schemas/FileResponseDataUri' examples: - default_example: - $ref: '#/components/examples/SignatureRequestReleaseHoldResponseExample' - 4XX: + example: + $ref: '#/components/examples/SignatureRequestFilesResponse' + '4XX': description: failed_operation content: application/json: @@ -4200,98 +4044,98 @@ paths: $ref: '#/components/schemas/ErrorResponse' examples: 400_example: - $ref: '#/components/examples/Error400ResponseExample' + $ref: '#/components/examples/Error400Response' 401_example: - $ref: '#/components/examples/Error401ResponseExample' + $ref: '#/components/examples/Error401Response' 402_example: - $ref: '#/components/examples/Error402ResponseExample' + $ref: '#/components/examples/Error402Response' 403_example: - $ref: '#/components/examples/Error403ResponseExample' + $ref: '#/components/examples/Error403Response' 404_example: - $ref: '#/components/examples/Error404ResponseExample' + $ref: '#/components/examples/Error404Response' + 409_example: + $ref: '#/components/examples/Error409Response' + 410_example: + $ref: '#/components/examples/Error410Response' + 429_example: + $ref: '#/components/examples/Error429Response' 4XX_example: - $ref: '#/components/examples/Error4XXResponseExample' + $ref: '#/components/examples/Error4XXResponse' security: - api_key: [] - oauth2: + - request_signature - signature_request_access x-codeSamples: - lang: PHP label: PHP source: - $ref: examples/SignatureRequestReleaseHold.php + $ref: examples/SignatureRequestFilesAsDataUriExample.php - lang: 'C#' label: 'C#' source: - $ref: examples/SignatureRequestReleaseHold.cs - - - lang: JavaScript - label: JavaScript - source: - $ref: examples/SignatureRequestReleaseHold.js + $ref: examples/SignatureRequestFilesAsDataUriExample.cs - lang: TypeScript label: TypeScript source: - $ref: examples/SignatureRequestReleaseHold.ts + $ref: examples/SignatureRequestFilesAsDataUriExample.ts - lang: Java label: Java source: - $ref: examples/SignatureRequestReleaseHold.java + $ref: examples/SignatureRequestFilesAsDataUriExample.java - lang: Ruby label: Ruby source: - $ref: examples/SignatureRequestReleaseHold.rb + $ref: examples/SignatureRequestFilesAsDataUriExample.rb - lang: Python label: Python source: - $ref: examples/SignatureRequestReleaseHold.py + $ref: examples/SignatureRequestFilesAsDataUriExample.py - lang: cURL label: cURL source: - $ref: examples/SignatureRequestReleaseHold.sh + $ref: examples/SignatureRequestFilesAsDataUriExample.sh x-meta: seo: - title: 'Release On-Hold Signature Request | Dropbox Sign for Developers' - description: 'The RESTful Dropbox Sign API allows you to build custom eSign integrations. To find out how to release an on-hold SignatureRequest, click here.' - '/signature_request/remind/{signature_request_id}': - post: + title: 'Download Files | API Documentation | Dropbox Sign for Developers' + description: 'The RESTful Dropbox Sign API allows you to build custom integrations. To find out how to get the current documents specified by the parameters, click here' + '/signature_request/files_as_file_url/{signature_request_id}': + get: tags: - 'Signature Request' - summary: 'Send Request Reminder' + summary: 'Download Files as File Url' description: |- - Sends an email to the signer reminding them to sign the signature request. You cannot send a reminder within 1 hour of the last reminder that was sent. This includes manual AND automatic reminders. + Obtain a copy of the current documents specified by the `signature_request_id` parameter. Returns a JSON object with a url to the file (PDFs only). - **NOTE:** This action can **not** be used with embedded signature requests. - operationId: signatureRequestRemind + If the files are currently being prepared, a status code of `409` will be returned instead. + operationId: signatureRequestFilesAsFileUrl parameters: - name: signature_request_id in: path - description: 'The id of the SignatureRequest to send a reminder for.' + description: 'The id of the SignatureRequest to retrieve.' required: true schema: type: string example: fa5c8a0b0f492d768749333ad6fcc214c111e967 - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/SignatureRequestRemindRequest' - examples: - default_example: - $ref: '#/components/examples/SignatureRequestRemindRequestDefaultExample' + - + name: force_download + in: query + description: 'By default when opening the `file_url` a browser will download the PDF and save it locally. When set to `0` the PDF file will be displayed in the browser.' + schema: + type: integer + default: 1 responses: - 200: + '200': description: 'successful operation' headers: X-RateLimit-Limit: @@ -4303,11 +4147,11 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/SignatureRequestGetResponse' + $ref: '#/components/schemas/FileResponse' examples: - default_example: - $ref: '#/components/examples/SignatureRequestRemindResponseExample' - 4XX: + example: + $ref: '#/components/examples/SignatureRequestFilesResponse' + '4XX': description: failed_operation content: application/json: @@ -4315,23 +4159,23 @@ paths: $ref: '#/components/schemas/ErrorResponse' examples: 400_example: - $ref: '#/components/examples/Error400ResponseExample' + $ref: '#/components/examples/Error400Response' 401_example: - $ref: '#/components/examples/Error401ResponseExample' + $ref: '#/components/examples/Error401Response' 402_example: - $ref: '#/components/examples/Error402ResponseExample' + $ref: '#/components/examples/Error402Response' 403_example: - $ref: '#/components/examples/Error403ResponseExample' + $ref: '#/components/examples/Error403Response' 404_example: - $ref: '#/components/examples/Error404ResponseExample' + $ref: '#/components/examples/Error404Response' 409_example: - $ref: '#/components/examples/Error409ResponseExample' + $ref: '#/components/examples/Error409Response' 410_example: - $ref: '#/components/examples/Error410ResponseExample' + $ref: '#/components/examples/Error410Response' 429_example: - $ref: '#/components/examples/Error429ResponseExample' + $ref: '#/components/examples/Error429Response' 4XX_example: - $ref: '#/components/examples/Error4XXResponseExample' + $ref: '#/components/examples/Error4XXResponse' security: - api_key: [] @@ -4344,69 +4188,59 @@ paths: lang: PHP label: PHP source: - $ref: examples/SignatureRequestRemind.php + $ref: examples/SignatureRequestFilesAsFileUrlExample.php - lang: 'C#' label: 'C#' source: - $ref: examples/SignatureRequestRemind.cs - - - lang: JavaScript - label: JavaScript - source: - $ref: examples/SignatureRequestRemind.js + $ref: examples/SignatureRequestFilesAsFileUrlExample.cs - lang: TypeScript label: TypeScript source: - $ref: examples/SignatureRequestRemind.ts + $ref: examples/SignatureRequestFilesAsFileUrlExample.ts - lang: Java label: Java source: - $ref: examples/SignatureRequestRemind.java + $ref: examples/SignatureRequestFilesAsFileUrlExample.java - lang: Ruby label: Ruby source: - $ref: examples/SignatureRequestRemind.rb + $ref: examples/SignatureRequestFilesAsFileUrlExample.rb - lang: Python label: Python source: - $ref: examples/SignatureRequestRemind.py + $ref: examples/SignatureRequestFilesAsFileUrlExample.py - lang: cURL label: cURL source: - $ref: examples/SignatureRequestRemind.sh + $ref: examples/SignatureRequestFilesAsFileUrlExample.sh x-meta: seo: - title: 'Send Request Reminder | REST API | Dropbox Sign for Developers' - description: 'The RESTful Dropbox Sign API allows you to build custom eSign integrations. To find out how to send an email reminder to the signer, click here.' - '/signature_request/remove/{signature_request_id}': - post: + title: 'Download Files | API Documentation | Dropbox Sign for Developers' + description: 'The RESTful Dropbox Sign API allows you to build custom integrations. To find out how to get the current documents specified by the parameters, click here' + '/signature_request/{signature_request_id}': + get: tags: - 'Signature Request' - summary: 'Remove Signature Request Access' - description: |- - Removes your access to a completed signature request. This action is **not reversible**. - - The signature request must be fully executed by all parties (signed or declined to sign). Other parties will continue to maintain access to the completed signature request document(s). - - Unlike /signature_request/cancel, this endpoint is synchronous and your access will be immediately removed. Upon successful removal, this endpoint will return a 200 OK response. - operationId: signatureRequestRemove + summary: 'Get Signature Request' + description: 'Returns the status of the SignatureRequest specified by the `signature_request_id` parameter.' + operationId: signatureRequestGet parameters: - name: signature_request_id in: path - description: 'The id of the SignatureRequest to remove.' + description: 'The id of the SignatureRequest to retrieve.' required: true schema: type: string example: fa5c8a0b0f492d768749333ad6fcc214c111e967 responses: - 200: + '200': description: 'successful operation' headers: X-RateLimit-Limit: @@ -4416,8 +4250,13 @@ paths: X-Ratelimit-Reset: $ref: '#/components/headers/X-Ratelimit-Reset' content: - application/json: {} - 4XX: + application/json: + schema: + $ref: '#/components/schemas/SignatureRequestGetResponse' + examples: + example: + $ref: '#/components/examples/SignatureRequestGetResponse' + '4XX': description: failed_operation content: application/json: @@ -4425,92 +4264,106 @@ paths: $ref: '#/components/schemas/ErrorResponse' examples: 400_example: - $ref: '#/components/examples/Error400ResponseExample' + $ref: '#/components/examples/Error400Response' 401_example: - $ref: '#/components/examples/Error401ResponseExample' + $ref: '#/components/examples/Error401Response' 402_example: - $ref: '#/components/examples/Error402ResponseExample' + $ref: '#/components/examples/Error402Response' 403_example: - $ref: '#/components/examples/Error403ResponseExample' + $ref: '#/components/examples/Error403Response' 404_example: - $ref: '#/components/examples/Error404ResponseExample' - 409_example: - $ref: '#/components/examples/Error409ResponseExample' + $ref: '#/components/examples/Error404Response' 410_example: - $ref: '#/components/examples/Error410ResponseExample' + $ref: '#/components/examples/Error410Response' 4XX_example: - $ref: '#/components/examples/Error4XXResponseExample' + $ref: '#/components/examples/Error4XXResponse' security: - api_key: [] + - + oauth2: + - request_signature + - signature_request_access x-codeSamples: - lang: PHP label: PHP source: - $ref: examples/SignatureRequestRemove.php + $ref: examples/SignatureRequestGetExample.php - lang: 'C#' label: 'C#' source: - $ref: examples/SignatureRequestRemove.cs - - - lang: JavaScript - label: JavaScript - source: - $ref: examples/SignatureRequestRemove.js + $ref: examples/SignatureRequestGetExample.cs - lang: TypeScript label: TypeScript source: - $ref: examples/SignatureRequestRemove.ts + $ref: examples/SignatureRequestGetExample.ts - lang: Java label: Java source: - $ref: examples/SignatureRequestRemove.java + $ref: examples/SignatureRequestGetExample.java - lang: Ruby label: Ruby source: - $ref: examples/SignatureRequestRemove.rb + $ref: examples/SignatureRequestGetExample.rb - lang: Python label: Python source: - $ref: examples/SignatureRequestRemove.py + $ref: examples/SignatureRequestGetExample.py - lang: cURL label: cURL source: - $ref: examples/SignatureRequestRemove.sh + $ref: examples/SignatureRequestGetExample.sh x-meta: seo: - title: 'Remove Signature Request Access | Dropbox Sign for Developers' - description: 'The RESTful Dropbox Sign API allows you to build custom integrations. To find out how to remove your access to a completed signature request, click here.' - /signature_request/send: - post: + title: 'Get Signature Request | Documentation | Dropbox Sign for Developers' + description: 'The Dropbox Sign API allows you to build custom integrations. To find out how to return the status of SignatureRequest specified by the parameters, click here.' + /signature_request/list: + get: tags: - 'Signature Request' - summary: 'Send Signature Request' - description: 'Creates and sends a new SignatureRequest with the submitted documents. If `form_fields_per_document` is not specified, a signature page will be affixed where all signers will be required to add their signature, signifying their agreement to all contained documents.' - operationId: signatureRequestSend - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/SignatureRequestSendRequest' - examples: - default_example: - $ref: '#/components/examples/SignatureRequestSendRequestDefaultExample' - grouped_signers_example: - $ref: '#/components/examples/SignatureRequestSendRequestGroupedSignersExample' - multipart/form-data: - schema: - $ref: '#/components/schemas/SignatureRequestSendRequest' + summary: 'List Signature Requests' + description: |- + Returns a list of SignatureRequests that you can access. This includes SignatureRequests you have sent as well as received, but not ones that you have been CCed on. + + Take a look at our [search guide](/api/reference/search/) to learn more about querying signature requests. + operationId: signatureRequestList + parameters: + - + name: account_id + in: query + description: 'Which account to return SignatureRequests for. Must be a team member. Use `all` to indicate all team members. Defaults to your account.' + schema: + type: string + - + name: page + in: query + description: 'Which page number of the SignatureRequest List to return. Defaults to `1`.' + schema: + type: integer + default: 1 + example: 1 + - + name: page_size + in: query + description: 'Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`.' + schema: + type: integer + default: 20 + - + name: query + in: query + description: 'String that includes search terms and/or fields to be used to filter the SignatureRequest objects.' + schema: + type: string responses: - 200: + '200': description: 'successful operation' headers: X-RateLimit-Limit: @@ -4522,11 +4375,11 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/SignatureRequestGetResponse' + $ref: '#/components/schemas/SignatureRequestListResponse' examples: - default_example: - $ref: '#/components/examples/SignatureRequestSendResponseExample' - 4XX: + example: + $ref: '#/components/examples/SignatureRequestListResponse' + '4XX': description: failed_operation content: application/json: @@ -4534,19 +4387,17 @@ paths: $ref: '#/components/schemas/ErrorResponse' examples: 400_example: - $ref: '#/components/examples/Error400ResponseExample' + $ref: '#/components/examples/Error400Response' 401_example: - $ref: '#/components/examples/Error401ResponseExample' + $ref: '#/components/examples/Error401Response' 402_example: - $ref: '#/components/examples/Error402ResponseExample' + $ref: '#/components/examples/Error402Response' 403_example: - $ref: '#/components/examples/Error403ResponseExample' + $ref: '#/components/examples/Error403Response' 409_example: - $ref: '#/components/examples/Error409ResponseExample' - 429_example: - $ref: '#/components/examples/Error429ResponseExample' + $ref: '#/components/examples/Error409Response' 4XX_example: - $ref: '#/components/examples/Error4XXResponseExample' + $ref: '#/components/examples/Error4XXResponse' security: - api_key: [] @@ -4559,67 +4410,59 @@ paths: lang: PHP label: PHP source: - $ref: examples/SignatureRequestSend.php + $ref: examples/SignatureRequestListExample.php - lang: 'C#' label: 'C#' source: - $ref: examples/SignatureRequestSend.cs - - - lang: JavaScript - label: JavaScript - source: - $ref: examples/SignatureRequestSend.js + $ref: examples/SignatureRequestListExample.cs - lang: TypeScript label: TypeScript source: - $ref: examples/SignatureRequestSend.ts + $ref: examples/SignatureRequestListExample.ts - lang: Java label: Java source: - $ref: examples/SignatureRequestSend.java + $ref: examples/SignatureRequestListExample.java - lang: Ruby label: Ruby source: - $ref: examples/SignatureRequestSend.rb + $ref: examples/SignatureRequestListExample.rb - lang: Python label: Python source: - $ref: examples/SignatureRequestSend.py + $ref: examples/SignatureRequestListExample.py - lang: cURL label: cURL source: - $ref: examples/SignatureRequestSend.sh + $ref: examples/SignatureRequestListExample.sh x-meta: seo: - title: 'Send Signature Request | REST API | Dropbox Sign for Developers' - description: 'Dropbox Sign API allows you to build custom integrations. To find out how to create and send new SignatureRequest with the submitted documents, click here.' - /signature_request/send_with_template: + title: 'List Signature Requests | REST API | Dropbox Sign for Developers' + description: 'The Dropbox Sign API allows you to build custom integrations. To find out how to return a list of SignatureRequests that you can access, click here.' + '/signature_request/release_hold/{signature_request_id}': post: tags: - 'Signature Request' - summary: 'Send with Template' - description: 'Creates and sends a new SignatureRequest based off of the Template(s) specified with the `template_ids` parameter.' - operationId: signatureRequestSendWithTemplate - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/SignatureRequestSendWithTemplateRequest' - examples: - default_example: - $ref: '#/components/examples/SignatureRequestSendWithTemplateRequestDefaultExample' - multipart/form-data: - schema: - $ref: '#/components/schemas/SignatureRequestSendWithTemplateRequest' + summary: 'Release On-Hold Signature Request' + description: 'Releases a held SignatureRequest that was claimed and prepared from an [UnclaimedDraft](/api/reference/tag/Unclaimed-Draft). The owner of the Draft must indicate at Draft creation that the SignatureRequest created from the Draft should be held. Releasing the SignatureRequest will send requests to all signers.' + operationId: signatureRequestReleaseHold + parameters: + - + name: signature_request_id + in: path + description: 'The id of the SignatureRequest to release.' + required: true + schema: + type: string + example: fa5c8a0b0f492d768749333ad6fcc214c111e967 responses: - 200: + '200': description: 'successful operation' headers: X-RateLimit-Limit: @@ -4633,9 +4476,9 @@ paths: schema: $ref: '#/components/schemas/SignatureRequestGetResponse' examples: - default_example: - $ref: '#/components/examples/SignatureRequestSendWithTemplateResponseExample' - 4XX: + example: + $ref: '#/components/examples/SignatureRequestReleaseHoldResponse' + '4XX': description: failed_operation content: application/json: @@ -4643,86 +4486,78 @@ paths: $ref: '#/components/schemas/ErrorResponse' examples: 400_example: - $ref: '#/components/examples/Error400ResponseExample' + $ref: '#/components/examples/Error400Response' 401_example: - $ref: '#/components/examples/Error401ResponseExample' + $ref: '#/components/examples/Error401Response' 402_example: - $ref: '#/components/examples/Error402ResponseExample' + $ref: '#/components/examples/Error402Response' 403_example: - $ref: '#/components/examples/Error403ResponseExample' - 429_example: - $ref: '#/components/examples/Error429ResponseExample' + $ref: '#/components/examples/Error403Response' + 404_example: + $ref: '#/components/examples/Error404Response' 4XX_example: - $ref: '#/components/examples/Error4XXResponseExample' + $ref: '#/components/examples/Error4XXResponse' security: - api_key: [] - oauth2: - - request_signature - signature_request_access x-codeSamples: - lang: PHP label: PHP source: - $ref: examples/SignatureRequestSendWithTemplate.php + $ref: examples/SignatureRequestReleaseHoldExample.php - lang: 'C#' label: 'C#' source: - $ref: examples/SignatureRequestSendWithTemplate.cs - - - lang: JavaScript - label: JavaScript - source: - $ref: examples/SignatureRequestSendWithTemplate.js + $ref: examples/SignatureRequestReleaseHoldExample.cs - lang: TypeScript label: TypeScript source: - $ref: examples/SignatureRequestSendWithTemplate.ts + $ref: examples/SignatureRequestReleaseHoldExample.ts - lang: Java label: Java source: - $ref: examples/SignatureRequestSendWithTemplate.java + $ref: examples/SignatureRequestReleaseHoldExample.java - lang: Ruby label: Ruby source: - $ref: examples/SignatureRequestSendWithTemplate.rb + $ref: examples/SignatureRequestReleaseHoldExample.rb - lang: Python label: Python source: - $ref: examples/SignatureRequestSendWithTemplate.py + $ref: examples/SignatureRequestReleaseHoldExample.py - lang: cURL label: cURL source: - $ref: examples/SignatureRequestSendWithTemplate.sh + $ref: examples/SignatureRequestReleaseHoldExample.sh x-meta: seo: - title: 'Send with Template | API Documentation | Dropbox Sign for Developers' - description: 'Dropbox Sign API allows you to build custom integrations. To find out how to create and send a new SignatureRequest based off of the Template, click here.' - '/signature_request/update/{signature_request_id}': + title: 'Release On-Hold Signature Request | Dropbox Sign for Developers' + description: 'The RESTful Dropbox Sign API allows you to build custom eSign integrations. To find out how to release an on-hold SignatureRequest, click here.' + '/signature_request/remind/{signature_request_id}': post: tags: - 'Signature Request' - summary: 'Update Signature Request' + summary: 'Send Request Reminder' description: |- - Updates the email address and/or the name for a given signer on a signature request. You can listen for the `signature_request_email_bounce` event on your app or account to detect bounced emails, and respond with this method. - - Updating the email address of a signer will generate a new `signature_id` value. + Sends an email to the signer reminding them to sign the signature request. You cannot send a reminder within 1 hour of the last reminder that was sent. This includes manual AND automatic reminders. - **NOTE:** This action cannot be performed on a signature request with an appended signature page. - operationId: signatureRequestUpdate + **NOTE:** This action can **not** be used with embedded signature requests. + operationId: signatureRequestRemind parameters: - name: signature_request_id in: path - description: 'The id of the SignatureRequest to update.' + description: 'The id of the SignatureRequest to send a reminder for.' required: true schema: type: string @@ -4732,12 +4567,12 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/SignatureRequestUpdateRequest' + $ref: '#/components/schemas/SignatureRequestRemindRequest' examples: - default_example: - $ref: '#/components/examples/SignatureRequestUpdateRequestDefaultExample' + example: + $ref: '#/components/examples/SignatureRequestRemindRequest' responses: - 200: + '200': description: 'successful operation' headers: X-RateLimit-Limit: @@ -4751,9 +4586,9 @@ paths: schema: $ref: '#/components/schemas/SignatureRequestGetResponse' examples: - default_example: - $ref: '#/components/examples/SignatureRequestUpdateResponseExample' - 4XX: + example: + $ref: '#/components/examples/SignatureRequestRemindResponse' + '4XX': description: failed_operation content: application/json: @@ -4761,97 +4596,93 @@ paths: $ref: '#/components/schemas/ErrorResponse' examples: 400_example: - $ref: '#/components/examples/Error400ResponseExample' + $ref: '#/components/examples/Error400Response' 401_example: - $ref: '#/components/examples/Error401ResponseExample' + $ref: '#/components/examples/Error401Response' 402_example: - $ref: '#/components/examples/Error402ResponseExample' + $ref: '#/components/examples/Error402Response' 403_example: - $ref: '#/components/examples/Error403ResponseExample' + $ref: '#/components/examples/Error403Response' 404_example: - $ref: '#/components/examples/Error404ResponseExample' + $ref: '#/components/examples/Error404Response' + 409_example: + $ref: '#/components/examples/Error409Response' + 410_example: + $ref: '#/components/examples/Error410Response' + 429_example: + $ref: '#/components/examples/Error429Response' 4XX_example: - $ref: '#/components/examples/Error4XXResponseExample' + $ref: '#/components/examples/Error4XXResponse' security: - api_key: [] - oauth2: + - request_signature - signature_request_access x-codeSamples: - lang: PHP label: PHP source: - $ref: examples/SignatureRequestUpdate.php + $ref: examples/SignatureRequestRemindExample.php - lang: 'C#' label: 'C#' source: - $ref: examples/SignatureRequestUpdate.cs - - - lang: JavaScript - label: JavaScript - source: - $ref: examples/SignatureRequestUpdate.js + $ref: examples/SignatureRequestRemindExample.cs - lang: TypeScript label: TypeScript source: - $ref: examples/SignatureRequestUpdate.ts + $ref: examples/SignatureRequestRemindExample.ts - lang: Java label: Java source: - $ref: examples/SignatureRequestUpdate.java + $ref: examples/SignatureRequestRemindExample.java - lang: Ruby label: Ruby source: - $ref: examples/SignatureRequestUpdate.rb + $ref: examples/SignatureRequestRemindExample.rb - lang: Python label: Python source: - $ref: examples/SignatureRequestUpdate.py + $ref: examples/SignatureRequestRemindExample.py - lang: cURL label: cURL source: - $ref: examples/SignatureRequestUpdate.sh + $ref: examples/SignatureRequestRemindExample.sh x-meta: seo: - title: 'Update Signature Request | REST API | Dropbox Sign for Developers' - description: 'Dropbox Sign API allows you to build custom integrations. To find out how to update the email address/name for a signer on a signature request, click here.' - /team/add_member: - put: + title: 'Send Request Reminder | REST API | Dropbox Sign for Developers' + description: 'The RESTful Dropbox Sign API allows you to build custom eSign integrations. To find out how to send an email reminder to the signer, click here.' + '/signature_request/remove/{signature_request_id}': + post: tags: - - Team - summary: 'Add User to Team' - description: 'Invites a user (specified using the `email_address` parameter) to your Team. If the user does not currently have a Dropbox Sign Account, a new one will be created for them. If a user is already a part of another Team, a `team_invite_failed` error will be returned.' - operationId: teamAddMember + - 'Signature Request' + summary: 'Remove Signature Request Access' + description: |- + Removes your access to a completed signature request. This action is **not reversible**. + + The signature request must be fully executed by all parties (signed or declined to sign). Other parties will continue to maintain access to the completed signature request document(s). + + Unlike /signature_request/cancel, this endpoint is synchronous and your access will be immediately removed. Upon successful removal, this endpoint will return a 200 OK response. + operationId: signatureRequestRemove parameters: - - name: team_id - in: query - description: 'The id of the team.' - required: false + name: signature_request_id + in: path + description: 'The id of the SignatureRequest to remove.' + required: true schema: type: string - example: 4fea99bfcf2b26bfccf6cea3e127fb8bb74d8d9c - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/TeamAddMemberRequest' - examples: - email_address: - $ref: '#/components/examples/TeamAddMemberRequestEmailAddressExample' - account_id: - $ref: '#/components/examples/TeamAddMemberRequestAccountIdExample' + example: fa5c8a0b0f492d768749333ad6fcc214c111e967 responses: - 200: + '200': description: 'successful operation' headers: X-RateLimit-Limit: @@ -4861,13 +4692,8 @@ paths: X-Ratelimit-Reset: $ref: '#/components/headers/X-Ratelimit-Reset' content: - application/json: - schema: - $ref: '#/components/schemas/TeamGetResponse' - examples: - default_example: - $ref: '#/components/examples/TeamAddMemberResponseExample' - 4XX: + application/json: {} + '4XX': description: failed_operation content: application/json: @@ -4875,86 +4701,87 @@ paths: $ref: '#/components/schemas/ErrorResponse' examples: 400_example: - $ref: '#/components/examples/Error400ResponseExample' + $ref: '#/components/examples/Error400Response' 401_example: - $ref: '#/components/examples/Error401ResponseExample' + $ref: '#/components/examples/Error401Response' 402_example: - $ref: '#/components/examples/Error402ResponseExample' + $ref: '#/components/examples/Error402Response' 403_example: - $ref: '#/components/examples/Error403ResponseExample' + $ref: '#/components/examples/Error403Response' 404_example: - $ref: '#/components/examples/Error404ResponseExample' + $ref: '#/components/examples/Error404Response' + 409_example: + $ref: '#/components/examples/Error409Response' + 410_example: + $ref: '#/components/examples/Error410Response' 4XX_example: - $ref: '#/components/examples/Error4XXResponseExample' + $ref: '#/components/examples/Error4XXResponse' security: - api_key: [] - - - oauth2: - - team_access x-codeSamples: - lang: PHP label: PHP source: - $ref: examples/TeamAddMember.php + $ref: examples/SignatureRequestRemoveExample.php - lang: 'C#' label: 'C#' source: - $ref: examples/TeamAddMember.cs - - - lang: JavaScript - label: JavaScript - source: - $ref: examples/TeamAddMember.js + $ref: examples/SignatureRequestRemoveExample.cs - lang: TypeScript label: TypeScript source: - $ref: examples/TeamAddMember.ts + $ref: examples/SignatureRequestRemoveExample.ts - lang: Java label: Java source: - $ref: examples/TeamAddMember.java + $ref: examples/SignatureRequestRemoveExample.java - lang: Ruby label: Ruby source: - $ref: examples/TeamAddMember.rb + $ref: examples/SignatureRequestRemoveExample.rb - lang: Python label: Python source: - $ref: examples/TeamAddMember.py + $ref: examples/SignatureRequestRemoveExample.py - lang: cURL label: cURL source: - $ref: examples/TeamAddMember.sh + $ref: examples/SignatureRequestRemoveExample.sh x-meta: seo: - title: 'Add User to Team | API Documentation | Dropbox Sign for Developers' - description: 'The RESTful Dropbox Sign API easily allows you to build custom eSign integrations. To find out how to invite a specified user to your Team, click here.' - /team/create: + title: 'Remove Signature Request Access | Dropbox Sign for Developers' + description: 'The RESTful Dropbox Sign API allows you to build custom integrations. To find out how to remove your access to a completed signature request, click here.' + /signature_request/send: post: tags: - - Team - summary: 'Create Team' - description: 'Creates a new Team and makes you a member. You must not currently belong to a Team to invoke.' - operationId: teamCreate + - 'Signature Request' + summary: 'Send Signature Request' + description: 'Creates and sends a new SignatureRequest with the submitted documents. If `form_fields_per_document` is not specified, a signature page will be affixed where all signers will be required to add their signature, signifying their agreement to all contained documents.' + operationId: signatureRequestSend requestBody: required: true content: application/json: schema: - $ref: '#/components/schemas/TeamCreateRequest' + $ref: '#/components/schemas/SignatureRequestSendRequest' examples: - default_example: - $ref: '#/components/examples/TeamCreateRequestDefaultExample' + example: + $ref: '#/components/examples/SignatureRequestSendRequest' + grouped_signers_example: + $ref: '#/components/examples/SignatureRequestSendRequestGroupedSigners' + multipart/form-data: + schema: + $ref: '#/components/schemas/SignatureRequestSendRequest' responses: - 200: + '200': description: 'successful operation' headers: X-RateLimit-Limit: @@ -4966,11 +4793,11 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/TeamGetResponse' + $ref: '#/components/schemas/SignatureRequestGetResponse' examples: - default_example: - $ref: '#/components/examples/TeamCreateResponseExample' - 4XX: + example: + $ref: '#/components/examples/SignatureRequestSendResponse' + '4XX': description: failed_operation content: application/json: @@ -4978,75 +4805,87 @@ paths: $ref: '#/components/schemas/ErrorResponse' examples: 400_example: - $ref: '#/components/examples/Error400ResponseExample' + $ref: '#/components/examples/Error400Response' 401_example: - $ref: '#/components/examples/Error401ResponseExample' + $ref: '#/components/examples/Error401Response' 402_example: - $ref: '#/components/examples/Error402ResponseExample' + $ref: '#/components/examples/Error402Response' 403_example: - $ref: '#/components/examples/Error403ResponseExample' + $ref: '#/components/examples/Error403Response' + 409_example: + $ref: '#/components/examples/Error409Response' + 429_example: + $ref: '#/components/examples/Error429Response' 4XX_example: - $ref: '#/components/examples/Error4XXResponseExample' + $ref: '#/components/examples/Error4XXResponse' security: - api_key: [] - oauth2: - - team_access + - request_signature + - signature_request_access x-codeSamples: - lang: PHP label: PHP source: - $ref: examples/TeamCreate.php + $ref: examples/SignatureRequestSendExample.php - lang: 'C#' label: 'C#' source: - $ref: examples/TeamCreate.cs - - - lang: JavaScript - label: JavaScript - source: - $ref: examples/TeamCreate.js + $ref: examples/SignatureRequestSendExample.cs - lang: TypeScript label: TypeScript source: - $ref: examples/TeamCreate.ts + $ref: examples/SignatureRequestSendExample.ts - lang: Java label: Java source: - $ref: examples/TeamCreate.java + $ref: examples/SignatureRequestSendExample.java - lang: Ruby label: Ruby source: - $ref: examples/TeamCreate.rb + $ref: examples/SignatureRequestSendExample.rb - lang: Python label: Python source: - $ref: examples/TeamCreate.py + $ref: examples/SignatureRequestSendExample.py - lang: cURL label: cURL source: - $ref: examples/TeamCreate.sh + $ref: examples/SignatureRequestSendExample.sh x-meta: seo: - title: 'Create Team | REST API Documentation | Dropbox Sign for Developers' - description: 'The RESTful Dropbox Sign API allows you to build custom eSign integrations. To find out how to create a new team and make yourself a member, click here.' - /team/destroy: - delete: + title: 'Send Signature Request | REST API | Dropbox Sign for Developers' + description: 'Dropbox Sign API allows you to build custom integrations. To find out how to create and send new SignatureRequest with the submitted documents, click here.' + /signature_request/send_with_template: + post: tags: - - Team - summary: 'Delete Team' - description: 'Deletes your Team. Can only be invoked when you have a Team with only one member (yourself).' - operationId: teamDelete + - 'Signature Request' + summary: 'Send with Template' + description: 'Creates and sends a new SignatureRequest based off of the Template(s) specified with the `template_ids` parameter.' + operationId: signatureRequestSendWithTemplate + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/SignatureRequestSendWithTemplateRequest' + examples: + example: + $ref: '#/components/examples/SignatureRequestSendWithTemplateRequest' + multipart/form-data: + schema: + $ref: '#/components/schemas/SignatureRequestSendWithTemplateRequest' responses: - 200: + '200': description: 'successful operation' headers: X-RateLimit-Limit: @@ -5055,7 +4894,14 @@ paths: $ref: '#/components/headers/X-RateLimit-Remaining' X-Ratelimit-Reset: $ref: '#/components/headers/X-Ratelimit-Reset' - 4XX: + content: + application/json: + schema: + $ref: '#/components/schemas/SignatureRequestGetResponse' + examples: + example: + $ref: '#/components/examples/SignatureRequestSendWithTemplateResponse' + '4XX': description: failed_operation content: application/json: @@ -5063,75 +4909,96 @@ paths: $ref: '#/components/schemas/ErrorResponse' examples: 400_example: - $ref: '#/components/examples/Error400ResponseExample' + $ref: '#/components/examples/Error400Response' 401_example: - $ref: '#/components/examples/Error401ResponseExample' + $ref: '#/components/examples/Error401Response' 402_example: - $ref: '#/components/examples/Error402ResponseExample' + $ref: '#/components/examples/Error402Response' 403_example: - $ref: '#/components/examples/Error403ResponseExample' + $ref: '#/components/examples/Error403Response' + 429_example: + $ref: '#/components/examples/Error429Response' 4XX_example: - $ref: '#/components/examples/Error4XXResponseExample' + $ref: '#/components/examples/Error4XXResponse' security: - api_key: [] - oauth2: - - team_access + - request_signature + - signature_request_access x-codeSamples: - lang: PHP label: PHP source: - $ref: examples/TeamDelete.php + $ref: examples/SignatureRequestSendWithTemplateExample.php - lang: 'C#' label: 'C#' source: - $ref: examples/TeamDelete.cs - - - lang: JavaScript - label: JavaScript - source: - $ref: examples/TeamDelete.js + $ref: examples/SignatureRequestSendWithTemplateExample.cs - lang: TypeScript label: TypeScript source: - $ref: examples/TeamDelete.ts + $ref: examples/SignatureRequestSendWithTemplateExample.ts - lang: Java label: Java source: - $ref: examples/TeamDelete.java + $ref: examples/SignatureRequestSendWithTemplateExample.java - lang: Ruby label: Ruby source: - $ref: examples/TeamDelete.rb + $ref: examples/SignatureRequestSendWithTemplateExample.rb - lang: Python label: Python source: - $ref: examples/TeamDelete.py + $ref: examples/SignatureRequestSendWithTemplateExample.py - lang: cURL label: cURL source: - $ref: examples/TeamDelete.sh + $ref: examples/SignatureRequestSendWithTemplateExample.sh x-meta: seo: - title: 'Delete Team | REST API Documentation | Dropbox Sign for Developers' - description: 'The RESTful Dropbox Sign API easily allows you to build custom eSign integrations. To find out how to delete a team you are a member of, click here.' - /team: - get: + title: 'Send with Template | API Documentation | Dropbox Sign for Developers' + description: 'Dropbox Sign API allows you to build custom integrations. To find out how to create and send a new SignatureRequest based off of the Template, click here.' + '/signature_request/update/{signature_request_id}': + post: tags: - - Team - summary: 'Get Team' - description: 'Returns information about your Team as well as a list of its members. If you do not belong to a Team, a 404 error with an error_name of "not_found" will be returned.' - operationId: teamGet + - 'Signature Request' + summary: 'Update Signature Request' + description: |- + Updates the email address and/or the name for a given signer on a signature request. You can listen for the `signature_request_email_bounce` event on your app or account to detect bounced emails, and respond with this method. + + Updating the email address of a signer will generate a new `signature_id` value. + + **NOTE:** This action cannot be performed on a signature request with an appended signature page. + operationId: signatureRequestUpdate + parameters: + - + name: signature_request_id + in: path + description: 'The id of the SignatureRequest to update.' + required: true + schema: + type: string + example: fa5c8a0b0f492d768749333ad6fcc214c111e967 + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/SignatureRequestUpdateRequest' + examples: + example: + $ref: '#/components/examples/SignatureRequestUpdateRequest' responses: - 200: + '200': description: 'successful operation' headers: X-RateLimit-Limit: @@ -5143,11 +5010,11 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/TeamGetResponse' + $ref: '#/components/schemas/SignatureRequestGetResponse' examples: - default_example: - $ref: '#/components/examples/TeamGetResponseExample' - 4XX: + example: + $ref: '#/components/examples/SignatureRequestUpdateResponse' + '4XX': description: failed_operation content: application/json: @@ -5155,85 +5022,92 @@ paths: $ref: '#/components/schemas/ErrorResponse' examples: 400_example: - $ref: '#/components/examples/Error400ResponseExample' + $ref: '#/components/examples/Error400Response' 401_example: - $ref: '#/components/examples/Error401ResponseExample' + $ref: '#/components/examples/Error401Response' 402_example: - $ref: '#/components/examples/Error402ResponseExample' + $ref: '#/components/examples/Error402Response' 403_example: - $ref: '#/components/examples/Error403ResponseExample' + $ref: '#/components/examples/Error403Response' 404_example: - $ref: '#/components/examples/Error404ResponseExample' + $ref: '#/components/examples/Error404Response' 4XX_example: - $ref: '#/components/examples/Error4XXResponseExample' + $ref: '#/components/examples/Error4XXResponse' security: - api_key: [] - oauth2: - - team_access + - signature_request_access x-codeSamples: - lang: PHP label: PHP source: - $ref: examples/TeamGet.php + $ref: examples/SignatureRequestUpdateExample.php - lang: 'C#' label: 'C#' source: - $ref: examples/TeamGet.cs - - - lang: JavaScript - label: JavaScript - source: - $ref: examples/TeamGet.js + $ref: examples/SignatureRequestUpdateExample.cs - lang: TypeScript label: TypeScript source: - $ref: examples/TeamGet.ts + $ref: examples/SignatureRequestUpdateExample.ts - lang: Java label: Java source: - $ref: examples/TeamGet.java + $ref: examples/SignatureRequestUpdateExample.java - lang: Ruby label: Ruby source: - $ref: examples/TeamGet.rb + $ref: examples/SignatureRequestUpdateExample.rb - lang: Python label: Python source: - $ref: examples/TeamGet.py + $ref: examples/SignatureRequestUpdateExample.py - lang: cURL label: cURL source: - $ref: examples/TeamGet.sh + $ref: examples/SignatureRequestUpdateExample.sh x-meta: seo: - title: 'Get Team | REST API Documentation | Dropbox Sign for Developers' - description: 'The RESTful Dropbox Sign API easily allows you to build custom eSign integrations. To find out how to return information about your Team, click here.' + title: 'Update Signature Request | REST API | Dropbox Sign for Developers' + description: 'Dropbox Sign API allows you to build custom integrations. To find out how to update the email address/name for a signer on a signature request, click here.' + /team/add_member: put: tags: - Team - summary: 'Update Team' - description: 'Updates the name of your Team.' - operationId: teamUpdate + summary: 'Add User to Team' + description: 'Invites a user (specified using the `email_address` parameter) to your Team. If the user does not currently have a Dropbox Sign Account, a new one will be created for them. If a user is already a part of another Team, a `team_invite_failed` error will be returned.' + operationId: teamAddMember + parameters: + - + name: team_id + in: query + description: 'The id of the team.' + required: false + schema: + type: string + example: 4fea99bfcf2b26bfccf6cea3e127fb8bb74d8d9c requestBody: required: true content: application/json: schema: - $ref: '#/components/schemas/TeamUpdateRequest' + $ref: '#/components/schemas/TeamAddMemberRequest' examples: - default_example: - $ref: '#/components/examples/TeamUpdateRequestDefaultExample' + example: + $ref: '#/components/examples/TeamAddMemberRequest' + account_id_example: + $ref: '#/components/examples/TeamAddMemberRequestAccountId' responses: - 200: + '200': description: 'successful operation' headers: X-RateLimit-Limit: @@ -5247,9 +5121,9 @@ paths: schema: $ref: '#/components/schemas/TeamGetResponse' examples: - default_example: - $ref: '#/components/examples/TeamUpdateResponseExample' - 4XX: + example: + $ref: '#/components/examples/TeamAddMemberResponse' + '4XX': description: failed_operation content: application/json: @@ -5257,15 +5131,17 @@ paths: $ref: '#/components/schemas/ErrorResponse' examples: 400_example: - $ref: '#/components/examples/Error400ResponseExample' + $ref: '#/components/examples/Error400Response' 401_example: - $ref: '#/components/examples/Error401ResponseExample' + $ref: '#/components/examples/Error401Response' 402_example: - $ref: '#/components/examples/Error402ResponseExample' + $ref: '#/components/examples/Error402Response' 403_example: - $ref: '#/components/examples/Error403ResponseExample' + $ref: '#/components/examples/Error403Response' + 404_example: + $ref: '#/components/examples/Error404Response' 4XX_example: - $ref: '#/components/examples/Error4XXResponseExample' + $ref: '#/components/examples/Error4XXResponse' security: - api_key: [] @@ -5277,64 +5153,59 @@ paths: lang: PHP label: PHP source: - $ref: examples/TeamUpdate.php + $ref: examples/TeamAddMemberExample.php - lang: 'C#' label: 'C#' source: - $ref: examples/TeamUpdate.cs - - - lang: JavaScript - label: JavaScript - source: - $ref: examples/TeamUpdate.js + $ref: examples/TeamAddMemberExample.cs - lang: TypeScript label: TypeScript source: - $ref: examples/TeamUpdate.ts + $ref: examples/TeamAddMemberExample.ts - lang: Java label: Java source: - $ref: examples/TeamUpdate.java + $ref: examples/TeamAddMemberExample.java - lang: Ruby label: Ruby source: - $ref: examples/TeamUpdate.rb + $ref: examples/TeamAddMemberExample.rb - lang: Python label: Python source: - $ref: examples/TeamUpdate.py + $ref: examples/TeamAddMemberExample.py - lang: cURL label: cURL source: - $ref: examples/TeamUpdate.sh + $ref: examples/TeamAddMemberExample.sh x-meta: seo: - title: 'Update Team | API Documentation | Dropbox Sign for Developers' - description: 'The RESTful Dropbox Sign API easily allows you to build custom eSign integrations. To find out how to update the name of your team, click here.' - /team/info: - get: + title: 'Add User to Team | API Documentation | Dropbox Sign for Developers' + description: 'The RESTful Dropbox Sign API easily allows you to build custom eSign integrations. To find out how to invite a specified user to your Team, click here.' + /team/create: + post: tags: - Team - summary: 'Get Team Info' - description: 'Provides information about a team.' - operationId: teamInfo - parameters: - - - name: team_id - in: query - description: 'The id of the team.' - required: false - schema: - type: string - example: 4fea99bfcf2b26bfccf6cea3e127fb8bb74d8d9c + summary: 'Create Team' + description: 'Creates a new Team and makes you a member. You must not currently belong to a Team to invoke.' + operationId: teamCreate + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/TeamCreateRequest' + examples: + example: + $ref: '#/components/examples/TeamCreateRequest' responses: - 200: + '200': description: 'successful operation' headers: X-RateLimit-Limit: @@ -5346,11 +5217,11 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/TeamGetInfoResponse' + $ref: '#/components/schemas/TeamGetResponse' examples: - default_example: - $ref: '#/components/examples/TeamGetInfoResponseExample' - 4XX: + example: + $ref: '#/components/examples/TeamCreateResponse' + '4XX': description: failed_operation content: application/json: @@ -5358,19 +5229,15 @@ paths: $ref: '#/components/schemas/ErrorResponse' examples: 400_example: - $ref: '#/components/examples/Error400ResponseExample' + $ref: '#/components/examples/Error400Response' 401_example: - $ref: '#/components/examples/Error401ResponseExample' + $ref: '#/components/examples/Error401Response' 402_example: - $ref: '#/components/examples/Error402ResponseExample' + $ref: '#/components/examples/Error402Response' 403_example: - $ref: '#/components/examples/Error403ResponseExample' - 409_example: - $ref: '#/components/examples/Error409ResponseExample' - 429_example: - $ref: '#/components/examples/Error429ResponseExample' + $ref: '#/components/examples/Error403Response' 4XX_example: - $ref: '#/components/examples/Error4XXResponseExample' + $ref: '#/components/examples/Error4XXResponse' security: - api_key: [] @@ -5382,63 +5249,50 @@ paths: lang: PHP label: PHP source: - $ref: examples/TeamInfo.php + $ref: examples/TeamCreateExample.php - lang: 'C#' label: 'C#' source: - $ref: examples/TeamInfo.cs - - - lang: JavaScript - label: JavaScript - source: - $ref: examples/TeamInfo.js + $ref: examples/TeamCreateExample.cs - lang: TypeScript label: TypeScript source: - $ref: examples/TeamInfo.ts + $ref: examples/TeamCreateExample.ts - lang: Java label: Java source: - $ref: examples/TeamInfo.java + $ref: examples/TeamCreateExample.java - lang: Ruby label: Ruby source: - $ref: examples/TeamInfo.rb + $ref: examples/TeamCreateExample.rb - lang: Python label: Python source: - $ref: examples/TeamInfo.py + $ref: examples/TeamCreateExample.py - lang: cURL label: cURL source: - $ref: examples/TeamInfo.sh + $ref: examples/TeamCreateExample.sh x-meta: seo: - title: 'Get Team Info | Dropbox Sign for Developers' - description: 'The Dropbox Sign API allows you automate your team management. To find out how to get information about a specific team, click here.' - /team/invites: - get: + title: 'Create Team | REST API Documentation | Dropbox Sign for Developers' + description: 'The RESTful Dropbox Sign API allows you to build custom eSign integrations. To find out how to create a new team and make yourself a member, click here.' + /team/destroy: + delete: tags: - Team - summary: 'List Team Invites' - description: 'Provides a list of team invites (and their roles).' - operationId: teamInvites - parameters: - - - name: email_address - in: query - description: 'The email address for which to display the team invites.' - required: false - schema: - type: string + summary: 'Delete Team' + description: 'Deletes your Team. Can only be invoked when you have a Team with only one member (yourself).' + operationId: teamDelete responses: - 200: + '200': description: 'successful operation' headers: X-RateLimit-Limit: @@ -5447,14 +5301,7 @@ paths: $ref: '#/components/headers/X-RateLimit-Remaining' X-Ratelimit-Reset: $ref: '#/components/headers/X-Ratelimit-Reset' - content: - application/json: - schema: - $ref: '#/components/schemas/TeamInvitesResponse' - examples: - default_example: - $ref: '#/components/examples/TeamInvitesResponseExample' - 4XX: + '4XX': description: failed_operation content: application/json: @@ -5462,101 +5309,70 @@ paths: $ref: '#/components/schemas/ErrorResponse' examples: 400_example: - $ref: '#/components/examples/Error400ResponseExample' + $ref: '#/components/examples/Error400Response' 401_example: - $ref: '#/components/examples/Error401ResponseExample' + $ref: '#/components/examples/Error401Response' 402_example: - $ref: '#/components/examples/Error402ResponseExample' + $ref: '#/components/examples/Error402Response' 403_example: - $ref: '#/components/examples/Error403ResponseExample' + $ref: '#/components/examples/Error403Response' 4XX_example: - $ref: '#/components/examples/Error4XXResponseExample' + $ref: '#/components/examples/Error4XXResponse' security: - api_key: [] - oauth2: - - account_access - - basic_account_info + - team_access x-codeSamples: - lang: PHP label: PHP source: - $ref: examples/TeamInvites.php + $ref: examples/TeamDeleteExample.php - lang: 'C#' label: 'C#' source: - $ref: examples/TeamInvites.cs - - - lang: JavaScript - label: JavaScript - source: - $ref: examples/TeamInvites.js + $ref: examples/TeamDeleteExample.cs - lang: TypeScript label: TypeScript source: - $ref: examples/TeamInvites.ts + $ref: examples/TeamDeleteExample.ts - lang: Java label: Java source: - $ref: examples/TeamInvites.java + $ref: examples/TeamDeleteExample.java - lang: Ruby label: Ruby source: - $ref: examples/TeamInvites.rb + $ref: examples/TeamDeleteExample.rb - lang: Python label: Python source: - $ref: examples/TeamInvites.py + $ref: examples/TeamDeleteExample.py - lang: cURL label: cURL source: - $ref: examples/TeamInvites.sh + $ref: examples/TeamDeleteExample.sh x-meta: seo: - title: 'List Team Invites | Dropbox Sign for Developers' - description: 'The Dropbox Sign API allows you automate your team management. To find out how to get a list of team invites (and their roles), click here.' - '/team/members/{team_id}': + title: 'Delete Team | REST API Documentation | Dropbox Sign for Developers' + description: 'The RESTful Dropbox Sign API easily allows you to build custom eSign integrations. To find out how to delete a team you are a member of, click here.' + /team: get: tags: - Team - summary: 'List Team Members' - description: 'Provides a paginated list of members (and their roles) that belong to a given team.' - operationId: teamMembers - parameters: - - - name: team_id - in: path - description: 'The id of the team that a member list is being requested from.' - required: true - schema: - type: string - example: 4fea99bfcf2b26bfccf6cea3e127fb8bb74d8d9c - - - name: page - in: query - description: 'Which page number of the team member list to return. Defaults to `1`.' - schema: - type: integer - default: 1 - - - name: page_size - in: query - description: 'Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`.' - schema: - type: integer - default: 20 - maximum: 100 - minimum: 1 + summary: 'Get Team' + description: 'Returns information about your Team as well as a list of its members. If you do not belong to a Team, a 404 error with an error_name of "not_found" will be returned.' + operationId: teamGet responses: - 200: + '200': description: 'successful operation' headers: X-RateLimit-Limit: @@ -5568,11 +5384,11 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/TeamMembersResponse' + $ref: '#/components/schemas/TeamGetResponse' examples: - default_example: - $ref: '#/components/examples/TeamMembersResponseExample' - 4XX: + example: + $ref: '#/components/examples/TeamGetResponse' + '4XX': description: failed_operation content: application/json: @@ -5580,19 +5396,17 @@ paths: $ref: '#/components/schemas/ErrorResponse' examples: 400_example: - $ref: '#/components/examples/Error400ResponseExample' + $ref: '#/components/examples/Error400Response' 401_example: - $ref: '#/components/examples/Error401ResponseExample' + $ref: '#/components/examples/Error401Response' 402_example: - $ref: '#/components/examples/Error402ResponseExample' + $ref: '#/components/examples/Error402Response' 403_example: - $ref: '#/components/examples/Error403ResponseExample' - 409_example: - $ref: '#/components/examples/Error409ResponseExample' - 429_example: - $ref: '#/components/examples/Error429ResponseExample' + $ref: '#/components/examples/Error403Response' + 404_example: + $ref: '#/components/examples/Error404Response' 4XX_example: - $ref: '#/components/examples/Error4XXResponseExample' + $ref: '#/components/examples/Error4XXResponse' security: - api_key: [] @@ -5604,66 +5418,58 @@ paths: lang: PHP label: PHP source: - $ref: examples/TeamMembers.php + $ref: examples/TeamGetExample.php - lang: 'C#' label: 'C#' source: - $ref: examples/TeamMembers.cs - - - lang: JavaScript - label: JavaScript - source: - $ref: examples/TeamMembers.js + $ref: examples/TeamGetExample.cs - lang: TypeScript label: TypeScript source: - $ref: examples/TeamMembers.ts + $ref: examples/TeamGetExample.ts - lang: Java label: Java source: - $ref: examples/TeamMembers.java + $ref: examples/TeamGetExample.java - lang: Ruby label: Ruby source: - $ref: examples/TeamMembers.rb + $ref: examples/TeamGetExample.rb - lang: Python label: Python source: - $ref: examples/TeamMembers.py + $ref: examples/TeamGetExample.py - lang: cURL label: cURL source: - $ref: examples/TeamMembers.sh + $ref: examples/TeamGetExample.sh x-meta: seo: - title: 'List Team Members | Dropbox Sign for Developers' - description: 'The Dropbox Sign API allows you automate your team management. To find out how to get a list of team members and their roles for a specific team, click here.' - /team/remove_member: - post: + title: 'Get Team | REST API Documentation | Dropbox Sign for Developers' + description: 'The RESTful Dropbox Sign API easily allows you to build custom eSign integrations. To find out how to return information about your Team, click here.' + put: tags: - Team - summary: 'Remove User from Team' - description: 'Removes the provided user Account from your Team. If the Account had an outstanding invitation to your Team, the invitation will be expired. If you choose to transfer documents from the removed Account to an Account provided in the `new_owner_email_address` parameter (available only for Enterprise plans), the response status code will be 201, which indicates that your request has been queued but not fully executed.' - operationId: teamRemoveMember + summary: 'Update Team' + description: 'Updates the name of your Team.' + operationId: teamUpdate requestBody: required: true content: application/json: schema: - $ref: '#/components/schemas/TeamRemoveMemberRequest' + $ref: '#/components/schemas/TeamUpdateRequest' examples: - email_address: - $ref: '#/components/examples/TeamRemoveMemberRequestEmailAddressExample' - account_id: - $ref: '#/components/examples/TeamRemoveMemberRequestAccountIdExample' + example: + $ref: '#/components/examples/TeamUpdateRequest' responses: - 201: + '200': description: 'successful operation' headers: X-RateLimit-Limit: @@ -5677,9 +5483,9 @@ paths: schema: $ref: '#/components/schemas/TeamGetResponse' examples: - default_example: - $ref: '#/components/examples/TeamRemoveMemberResponseExample' - 4XX: + example: + $ref: '#/components/examples/TeamUpdateResponse' + '4XX': description: failed_operation content: application/json: @@ -5687,17 +5493,15 @@ paths: $ref: '#/components/schemas/ErrorResponse' examples: 400_example: - $ref: '#/components/examples/Error400ResponseExample' + $ref: '#/components/examples/Error400Response' 401_example: - $ref: '#/components/examples/Error401ResponseExample' + $ref: '#/components/examples/Error401Response' 402_example: - $ref: '#/components/examples/Error402ResponseExample' + $ref: '#/components/examples/Error402Response' 403_example: - $ref: '#/components/examples/Error403ResponseExample' - 404_example: - $ref: '#/components/examples/Error404ResponseExample' + $ref: '#/components/examples/Error403Response' 4XX_example: - $ref: '#/components/examples/Error4XXResponseExample' + $ref: '#/components/examples/Error4XXResponse' security: - api_key: [] @@ -5709,80 +5513,59 @@ paths: lang: PHP label: PHP source: - $ref: examples/TeamRemoveMember.php + $ref: examples/TeamUpdateExample.php - lang: 'C#' label: 'C#' source: - $ref: examples/TeamRemoveMember.cs - - - lang: JavaScript - label: JavaScript - source: - $ref: examples/TeamRemoveMember.js + $ref: examples/TeamUpdateExample.cs - lang: TypeScript label: TypeScript source: - $ref: examples/TeamRemoveMember.ts + $ref: examples/TeamUpdateExample.ts - lang: Java label: Java source: - $ref: examples/TeamRemoveMember.java + $ref: examples/TeamUpdateExample.java - lang: Ruby label: Ruby source: - $ref: examples/TeamRemoveMember.rb + $ref: examples/TeamUpdateExample.rb - lang: Python label: Python source: - $ref: examples/TeamRemoveMember.py + $ref: examples/TeamUpdateExample.py - lang: cURL label: cURL source: - $ref: examples/TeamRemoveMember.sh + $ref: examples/TeamUpdateExample.sh x-meta: seo: - title: 'Remove User from Team | REST API | Dropbox Sign for Developers' - description: 'The RESTful Dropbox Sign API easily allows you to build custom eSign integrations. To find out how to remove a user Account from your Team, click here.' - '/team/sub_teams/{team_id}': + title: 'Update Team | API Documentation | Dropbox Sign for Developers' + description: 'The RESTful Dropbox Sign API easily allows you to build custom eSign integrations. To find out how to update the name of your team, click here.' + /team/info: get: tags: - Team - summary: 'List Sub Teams' - description: 'Provides a paginated list of sub teams that belong to a given team.' - operationId: teamSubTeams + summary: 'Get Team Info' + description: 'Provides information about a team.' + operationId: teamInfo parameters: - name: team_id - in: path - description: 'The id of the parent Team.' - required: true + in: query + description: 'The id of the team.' + required: false schema: type: string example: 4fea99bfcf2b26bfccf6cea3e127fb8bb74d8d9c - - - name: page - in: query - description: 'Which page number of the SubTeam List to return. Defaults to `1`.' - schema: - type: integer - default: 1 - - - name: page_size - in: query - description: 'Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`.' - schema: - type: integer - default: 20 - maximum: 100 - minimum: 1 responses: - 200: + '200': description: 'successful operation' headers: X-RateLimit-Limit: @@ -5794,11 +5577,11 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/TeamSubTeamsResponse' + $ref: '#/components/schemas/TeamGetInfoResponse' examples: - default_example: - $ref: '#/components/examples/TeamSubTeamsResponseExample' - 4XX: + example: + $ref: '#/components/examples/TeamGetInfoResponse' + '4XX': description: failed_operation content: application/json: @@ -5806,19 +5589,19 @@ paths: $ref: '#/components/schemas/ErrorResponse' examples: 400_example: - $ref: '#/components/examples/Error400ResponseExample' + $ref: '#/components/examples/Error400Response' 401_example: - $ref: '#/components/examples/Error401ResponseExample' + $ref: '#/components/examples/Error401Response' 402_example: - $ref: '#/components/examples/Error402ResponseExample' + $ref: '#/components/examples/Error402Response' 403_example: - $ref: '#/components/examples/Error403ResponseExample' + $ref: '#/components/examples/Error403Response' 409_example: - $ref: '#/components/examples/Error409ResponseExample' + $ref: '#/components/examples/Error409Response' 429_example: - $ref: '#/components/examples/Error429ResponseExample' + $ref: '#/components/examples/Error429Response' 4XX_example: - $ref: '#/components/examples/Error4XXResponseExample' + $ref: '#/components/examples/Error4XXResponse' security: - api_key: [] @@ -5830,73 +5613,58 @@ paths: lang: PHP label: PHP source: - $ref: examples/TeamSubTeams.php + $ref: examples/TeamInfoExample.php - lang: 'C#' label: 'C#' source: - $ref: examples/TeamSubTeams.cs - - - lang: JavaScript - label: JavaScript - source: - $ref: examples/TeamSubTeams.js + $ref: examples/TeamInfoExample.cs - lang: TypeScript label: TypeScript source: - $ref: examples/TeamSubTeams.ts + $ref: examples/TeamInfoExample.ts - lang: Java label: Java source: - $ref: examples/TeamSubTeams.java + $ref: examples/TeamInfoExample.java - lang: Ruby label: Ruby source: - $ref: examples/TeamSubTeams.rb + $ref: examples/TeamInfoExample.rb - lang: Python label: Python source: - $ref: examples/TeamSubTeams.py + $ref: examples/TeamInfoExample.py - lang: cURL label: cURL source: - $ref: examples/TeamSubTeams.sh + $ref: examples/TeamInfoExample.sh x-meta: seo: - title: 'List Sub Teams | Dropbox Sign for Developers' - description: 'The Dropbox Sign API allows you automate your team management. To find out how to get a list of sub teams that exist for a given team, click here.' - '/template/add_user/{template_id}': - post: + title: 'Get Team Info | Dropbox Sign for Developers' + description: 'The Dropbox Sign API allows you automate your team management. To find out how to get information about a specific team, click here.' + /team/invites: + get: tags: - - Template - summary: 'Add User to Template' - description: 'Gives the specified Account access to the specified Template. The specified Account must be a part of your Team.' - operationId: templateAddUser + - Team + summary: 'List Team Invites' + description: 'Provides a list of team invites (and their roles).' + operationId: teamInvites parameters: - - name: template_id - in: path - description: 'The id of the Template to give the Account access to.' - required: true + name: email_address + in: query + description: 'The email address for which to display the team invites.' + required: false schema: type: string - example: f57db65d3f933b5316d398057a36176831451a35 - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/TemplateAddUserRequest' - examples: - default_example: - $ref: '#/components/examples/TemplateAddUserRequestDefaultExample' responses: - 200: + '200': description: 'successful operation' headers: X-RateLimit-Limit: @@ -5908,11 +5676,11 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/TemplateGetResponse' + $ref: '#/components/schemas/TeamInvitesResponse' examples: - default_example: - $ref: '#/components/examples/TemplateAddUserResponseExample' - 4XX: + example: + $ref: '#/components/examples/TeamInvitesResponse' + '4XX': description: failed_operation content: application/json: @@ -5920,95 +5688,96 @@ paths: $ref: '#/components/schemas/ErrorResponse' examples: 400_example: - $ref: '#/components/examples/Error400ResponseExample' + $ref: '#/components/examples/Error400Response' 401_example: - $ref: '#/components/examples/Error401ResponseExample' + $ref: '#/components/examples/Error401Response' 402_example: - $ref: '#/components/examples/Error402ResponseExample' + $ref: '#/components/examples/Error402Response' 403_example: - $ref: '#/components/examples/Error403ResponseExample' - 404_example: - $ref: '#/components/examples/Error404ResponseExample' + $ref: '#/components/examples/Error403Response' 4XX_example: - $ref: '#/components/examples/Error4XXResponseExample' + $ref: '#/components/examples/Error4XXResponse' security: - api_key: [] - oauth2: - - template_access + - account_access + - basic_account_info x-codeSamples: - lang: PHP label: PHP source: - $ref: examples/TemplateAddUser.php + $ref: examples/TeamInvitesExample.php - lang: 'C#' label: 'C#' source: - $ref: examples/TemplateAddUser.cs - - - lang: JavaScript - label: JavaScript - source: - $ref: examples/TemplateAddUser.js + $ref: examples/TeamInvitesExample.cs - lang: TypeScript label: TypeScript source: - $ref: examples/TemplateAddUser.ts + $ref: examples/TeamInvitesExample.ts - lang: Java label: Java source: - $ref: examples/TemplateAddUser.java + $ref: examples/TeamInvitesExample.java - lang: Ruby label: Ruby source: - $ref: examples/TemplateAddUser.rb + $ref: examples/TeamInvitesExample.rb - lang: Python label: Python source: - $ref: examples/TemplateAddUser.py + $ref: examples/TeamInvitesExample.py - lang: cURL label: cURL source: - $ref: examples/TemplateAddUser.sh + $ref: examples/TeamInvitesExample.sh x-meta: seo: - title: 'Add User to Template | REST API | Dropbox Sign for Developers' - description: 'The RESTful Dropbox Sign API easily allows you to build custom eSign integrations. To find out how to give an Account access to a Template, click here.' - /template/create: - post: + title: 'List Team Invites | Dropbox Sign for Developers' + description: 'The Dropbox Sign API allows you automate your team management. To find out how to get a list of team invites (and their roles), click here.' + '/team/members/{team_id}': + get: tags: - - Template - summary: 'Create Template' - description: 'Creates a template that can then be used.' - operationId: templateCreate - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/TemplateCreateRequest' - examples: - default_example: - $ref: '#/components/examples/TemplateCreateRequestDefaultExample' - form_fields_per_document: - $ref: '#/components/examples/TemplateCreateRequestFormFieldsPerDocumentExample' - form_field_groups: - $ref: '#/components/examples/TemplateCreateRequestFormFieldGroupsExample' - form_field_rules: - $ref: '#/components/examples/TemplateCreateRequestFormFieldRulesExample' - multipart/form-data: - schema: - $ref: '#/components/schemas/TemplateCreateRequest' + - Team + summary: 'List Team Members' + description: 'Provides a paginated list of members (and their roles) that belong to a given team.' + operationId: teamMembers + parameters: + - + name: team_id + in: path + description: 'The id of the team that a member list is being requested from.' + required: true + schema: + type: string + example: 4fea99bfcf2b26bfccf6cea3e127fb8bb74d8d9c + - + name: page + in: query + description: 'Which page number of the team member list to return. Defaults to `1`.' + schema: + type: integer + default: 1 + - + name: page_size + in: query + description: 'Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`.' + schema: + type: integer + default: 20 + maximum: 100 + minimum: 1 responses: - 200: + '200': description: 'successful operation' headers: X-RateLimit-Limit: @@ -6020,11 +5789,11 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/TemplateCreateResponse' + $ref: '#/components/schemas/TeamMembersResponse' examples: - default_example: - $ref: '#/components/examples/TemplateCreateResponseExample' - 4XX: + example: + $ref: '#/components/examples/TeamMembersResponse' + '4XX': description: failed_operation content: application/json: @@ -6032,97 +5801,85 @@ paths: $ref: '#/components/schemas/ErrorResponse' examples: 400_example: - $ref: '#/components/examples/Error400ResponseExample' + $ref: '#/components/examples/Error400Response' 401_example: - $ref: '#/components/examples/Error401ResponseExample' + $ref: '#/components/examples/Error401Response' 402_example: - $ref: '#/components/examples/Error402ResponseExample' + $ref: '#/components/examples/Error402Response' 403_example: - $ref: '#/components/examples/Error403ResponseExample' - 404_example: - $ref: '#/components/examples/Error404ResponseExample' + $ref: '#/components/examples/Error403Response' 409_example: - $ref: '#/components/examples/Error409ResponseExample' + $ref: '#/components/examples/Error409Response' + 429_example: + $ref: '#/components/examples/Error429Response' 4XX_example: - $ref: '#/components/examples/Error4XXResponseExample' + $ref: '#/components/examples/Error4XXResponse' security: - api_key: [] - oauth2: - - template_access + - team_access x-codeSamples: - lang: PHP label: PHP source: - $ref: examples/TemplateCreate.php + $ref: examples/TeamMembersExample.php - lang: 'C#' label: 'C#' source: - $ref: examples/TemplateCreate.cs - - - lang: JavaScript - label: JavaScript - source: - $ref: examples/TemplateCreate.js + $ref: examples/TeamMembersExample.cs - lang: TypeScript label: TypeScript source: - $ref: examples/TemplateCreate.ts + $ref: examples/TeamMembersExample.ts - lang: Java label: Java source: - $ref: examples/TemplateCreate.java + $ref: examples/TeamMembersExample.java - lang: Ruby label: Ruby source: - $ref: examples/TemplateCreate.rb + $ref: examples/TeamMembersExample.rb - lang: Python label: Python source: - $ref: examples/TemplateCreate.py + $ref: examples/TeamMembersExample.py - lang: cURL label: cURL source: - $ref: examples/TemplateCreate.sh + $ref: examples/TeamMembersExample.sh x-meta: seo: - title: 'Create Template | Dropbox Sign for Developers' - description: 'The RESTful Dropbox Sign API easily allows you to build custom eSign integrations. To find out how to create an template, click here.' - /template/create_embedded_draft: + title: 'List Team Members | Dropbox Sign for Developers' + description: 'The Dropbox Sign API allows you automate your team management. To find out how to get a list of team members and their roles for a specific team, click here.' + /team/remove_member: post: tags: - - Template - summary: 'Create Embedded Template Draft' - description: 'The first step in an embedded template workflow. Creates a draft template that can then be further set up in the template ''edit'' stage.' - operationId: templateCreateEmbeddedDraft + - Team + summary: 'Remove User from Team' + description: 'Removes the provided user Account from your Team. If the Account had an outstanding invitation to your Team, the invitation will be expired. If you choose to transfer documents from the removed Account to an Account provided in the `new_owner_email_address` parameter (available only for Enterprise plans), the response status code will be 201, which indicates that your request has been queued but not fully executed.' + operationId: teamRemoveMember requestBody: required: true content: application/json: schema: - $ref: '#/components/schemas/TemplateCreateEmbeddedDraftRequest' + $ref: '#/components/schemas/TeamRemoveMemberRequest' examples: - default_example: - $ref: '#/components/examples/TemplateCreateEmbeddedDraftRequestDefaultExample' - form_fields_per_document: - $ref: '#/components/examples/TemplateCreateEmbeddedDraftRequestFormFieldsPerDocumentExample' - form_field_groups: - $ref: '#/components/examples/TemplateCreateEmbeddedDraftRequestFormFieldGroupsExample' - form_field_rules: - $ref: '#/components/examples/TemplateCreateEmbeddedDraftRequestFormFieldRulesExample' - multipart/form-data: - schema: - $ref: '#/components/schemas/TemplateCreateEmbeddedDraftRequest' + example: + $ref: '#/components/examples/TeamRemoveMemberRequest' + account_id_example: + $ref: '#/components/examples/TeamRemoveMemberRequestAccountId' responses: - 200: + '201': description: 'successful operation' headers: X-RateLimit-Limit: @@ -6134,11 +5891,11 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/TemplateCreateEmbeddedDraftResponse' + $ref: '#/components/schemas/TeamGetResponse' examples: - default_example: - $ref: '#/components/examples/TemplateCreateEmbeddedDraftResponseExample' - 4XX: + example: + $ref: '#/components/examples/TeamRemoveMemberResponse' + '4XX': description: failed_operation content: application/json: @@ -6146,88 +5903,97 @@ paths: $ref: '#/components/schemas/ErrorResponse' examples: 400_example: - $ref: '#/components/examples/Error400ResponseExample' + $ref: '#/components/examples/Error400Response' 401_example: - $ref: '#/components/examples/Error401ResponseExample' + $ref: '#/components/examples/Error401Response' 402_example: - $ref: '#/components/examples/Error402ResponseExample' + $ref: '#/components/examples/Error402Response' 403_example: - $ref: '#/components/examples/Error403ResponseExample' + $ref: '#/components/examples/Error403Response' 404_example: - $ref: '#/components/examples/Error404ResponseExample' - 409_example: - $ref: '#/components/examples/Error409ResponseExample' + $ref: '#/components/examples/Error404Response' 4XX_example: - $ref: '#/components/examples/Error4XXResponseExample' + $ref: '#/components/examples/Error4XXResponse' security: - api_key: [] - oauth2: - - template_access + - team_access x-codeSamples: - lang: PHP label: PHP source: - $ref: examples/TemplateCreateEmbeddedDraft.php + $ref: examples/TeamRemoveMemberExample.php - lang: 'C#' label: 'C#' source: - $ref: examples/TemplateCreateEmbeddedDraft.cs - - - lang: JavaScript - label: JavaScript - source: - $ref: examples/TemplateCreateEmbeddedDraft.js + $ref: examples/TeamRemoveMemberExample.cs - lang: TypeScript label: TypeScript source: - $ref: examples/TemplateCreateEmbeddedDraft.ts + $ref: examples/TeamRemoveMemberExample.ts - lang: Java label: Java source: - $ref: examples/TemplateCreateEmbeddedDraft.java + $ref: examples/TeamRemoveMemberExample.java - lang: Ruby label: Ruby source: - $ref: examples/TemplateCreateEmbeddedDraft.rb + $ref: examples/TeamRemoveMemberExample.rb - lang: Python label: Python source: - $ref: examples/TemplateCreateEmbeddedDraft.py + $ref: examples/TeamRemoveMemberExample.py - lang: cURL label: cURL source: - $ref: examples/TemplateCreateEmbeddedDraft.sh + $ref: examples/TeamRemoveMemberExample.sh x-meta: seo: - title: 'Create Embedded Template Draft | Dropbox Sign for Developers' - description: 'The RESTful Dropbox Sign API easily allows you to build custom eSign integrations. To find out how to create an embedded draft template, click here.' - '/template/delete/{template_id}': - post: + title: 'Remove User from Team | REST API | Dropbox Sign for Developers' + description: 'The RESTful Dropbox Sign API easily allows you to build custom eSign integrations. To find out how to remove a user Account from your Team, click here.' + '/team/sub_teams/{team_id}': + get: tags: - - Template - summary: 'Delete Template' - description: 'Completely deletes the template specified from the account.' - operationId: templateDelete + - Team + summary: 'List Sub Teams' + description: 'Provides a paginated list of sub teams that belong to a given team.' + operationId: teamSubTeams parameters: - - name: template_id + name: team_id in: path - description: 'The id of the Template to delete.' + description: 'The id of the parent Team.' required: true schema: type: string - example: f57db65d3f933b5316d398057a36176831451a35 - responses: - 200: + example: 4fea99bfcf2b26bfccf6cea3e127fb8bb74d8d9c + - + name: page + in: query + description: 'Which page number of the SubTeam List to return. Defaults to `1`.' + schema: + type: integer + default: 1 + - + name: page_size + in: query + description: 'Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`.' + schema: + type: integer + default: 20 + maximum: 100 + minimum: 1 + responses: + '200': description: 'successful operation' headers: X-RateLimit-Limit: @@ -6237,8 +6003,13 @@ paths: X-Ratelimit-Reset: $ref: '#/components/headers/X-Ratelimit-Reset' content: - application/json: {} - 4XX: + application/json: + schema: + $ref: '#/components/schemas/TeamSubTeamsResponse' + examples: + example: + $ref: '#/components/examples/TeamSubTeamsResponse' + '4XX': description: failed_operation content: application/json: @@ -6246,100 +6017,92 @@ paths: $ref: '#/components/schemas/ErrorResponse' examples: 400_example: - $ref: '#/components/examples/Error400ResponseExample' + $ref: '#/components/examples/Error400Response' 401_example: - $ref: '#/components/examples/Error401ResponseExample' + $ref: '#/components/examples/Error401Response' 402_example: - $ref: '#/components/examples/Error402ResponseExample' + $ref: '#/components/examples/Error402Response' 403_example: - $ref: '#/components/examples/Error403ResponseExample' - 404_example: - $ref: '#/components/examples/Error404ResponseExample' + $ref: '#/components/examples/Error403Response' 409_example: - $ref: '#/components/examples/Error409ResponseExample' + $ref: '#/components/examples/Error409Response' + 429_example: + $ref: '#/components/examples/Error429Response' 4XX_example: - $ref: '#/components/examples/Error4XXResponseExample' + $ref: '#/components/examples/Error4XXResponse' security: - api_key: [] - oauth2: - - template_access + - team_access x-codeSamples: - lang: PHP label: PHP source: - $ref: examples/TemplateDelete.php + $ref: examples/TeamSubTeamsExample.php - lang: 'C#' label: 'C#' source: - $ref: examples/TemplateDelete.cs - - - lang: JavaScript - label: JavaScript - source: - $ref: examples/TemplateDelete.js + $ref: examples/TeamSubTeamsExample.cs - lang: TypeScript label: TypeScript source: - $ref: examples/TemplateDelete.ts + $ref: examples/TeamSubTeamsExample.ts - lang: Java label: Java source: - $ref: examples/TemplateDelete.java + $ref: examples/TeamSubTeamsExample.java - lang: Ruby label: Ruby source: - $ref: examples/TemplateDelete.rb + $ref: examples/TeamSubTeamsExample.rb - lang: Python label: Python source: - $ref: examples/TemplateDelete.py + $ref: examples/TeamSubTeamsExample.py - lang: cURL label: cURL source: - $ref: examples/TemplateDelete.sh + $ref: examples/TeamSubTeamsExample.sh x-meta: seo: - title: 'Delete Template | API Documentation | Dropbox Sign for Developers' - description: 'The RESTful Dropbox Sign API easily allows you to build custom integrations. To find out how to completely delete a template from the account, click here.' - '/template/files/{template_id}': - get: + title: 'List Sub Teams | Dropbox Sign for Developers' + description: 'The Dropbox Sign API allows you automate your team management. To find out how to get a list of sub teams that exist for a given team, click here.' + '/template/add_user/{template_id}': + post: tags: - Template - summary: 'Get Template Files' - description: |- - Obtain a copy of the current documents specified by the `template_id` parameter. Returns a PDF or ZIP file. - - If the files are currently being prepared, a status code of `409` will be returned instead. In this case please wait for the `template_created` callback event. - operationId: templateFiles + summary: 'Add User to Template' + description: 'Gives the specified Account access to the specified Template. The specified Account must be a part of your Team.' + operationId: templateAddUser parameters: - name: template_id in: path - description: 'The id of the template files to retrieve.' + description: 'The id of the Template to give the Account access to.' required: true schema: type: string example: f57db65d3f933b5316d398057a36176831451a35 - - - name: file_type - in: query - description: 'Set to `pdf` for a single merged document or `zip` for a collection of individual documents.' - schema: - type: string - enum: - - pdf - - zip + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/TemplateAddUserRequest' + examples: + example: + $ref: '#/components/examples/TemplateAddUserRequest' responses: - 200: + '200': description: 'successful operation' headers: X-RateLimit-Limit: @@ -6349,15 +6112,13 @@ paths: X-Ratelimit-Reset: $ref: '#/components/headers/X-Ratelimit-Reset' content: - application/pdf: - schema: - type: string - format: binary - application/zip: + application/json: schema: - type: string - format: binary - 4XX: + $ref: '#/components/schemas/TemplateGetResponse' + examples: + example: + $ref: '#/components/examples/TemplateAddUserResponse' + '4XX': description: failed_operation content: application/json: @@ -6365,23 +6126,17 @@ paths: $ref: '#/components/schemas/ErrorResponse' examples: 400_example: - $ref: '#/components/examples/Error400ResponseExample' + $ref: '#/components/examples/Error400Response' 401_example: - $ref: '#/components/examples/Error401ResponseExample' + $ref: '#/components/examples/Error401Response' 402_example: - $ref: '#/components/examples/Error402ResponseExample' + $ref: '#/components/examples/Error402Response' 403_example: - $ref: '#/components/examples/Error403ResponseExample' + $ref: '#/components/examples/Error403Response' 404_example: - $ref: '#/components/examples/Error404ResponseExample' - 409_example: - $ref: '#/components/examples/Error409ResponseExample' - 422_example: - $ref: '#/components/examples/Error422ResponseExample' - 429_example: - $ref: '#/components/examples/Error429ResponseExample' + $ref: '#/components/examples/Error404Response' 4XX_example: - $ref: '#/components/examples/Error4XXResponseExample' + $ref: '#/components/examples/Error4XXResponse' security: - api_key: [] @@ -6393,67 +6148,68 @@ paths: lang: PHP label: PHP source: - $ref: examples/TemplateFiles.php + $ref: examples/TemplateAddUserExample.php - lang: 'C#' label: 'C#' source: - $ref: examples/TemplateFiles.cs - - - lang: JavaScript - label: JavaScript - source: - $ref: examples/TemplateFiles.js + $ref: examples/TemplateAddUserExample.cs - lang: TypeScript label: TypeScript source: - $ref: examples/TemplateFiles.ts + $ref: examples/TemplateAddUserExample.ts - lang: Java label: Java source: - $ref: examples/TemplateFiles.java + $ref: examples/TemplateAddUserExample.java - lang: Ruby label: Ruby source: - $ref: examples/TemplateFiles.rb + $ref: examples/TemplateAddUserExample.rb - lang: Python label: Python source: - $ref: examples/TemplateFiles.py + $ref: examples/TemplateAddUserExample.py - lang: cURL label: cURL source: - $ref: examples/TemplateFiles.sh + $ref: examples/TemplateAddUserExample.sh x-meta: seo: - title: 'Get Template Files | API Documentation | Dropbox Sign for Developers' - description: 'The RESTful Dropbox Sign API easily allows you to build custom integrations. To find out how to get a copy of the current specified documents, click here.' - '/template/files_as_data_uri/{template_id}': - get: + title: 'Add User to Template | REST API | Dropbox Sign for Developers' + description: 'The RESTful Dropbox Sign API easily allows you to build custom eSign integrations. To find out how to give an Account access to a Template, click here.' + /template/create: + post: tags: - Template - summary: 'Get Template Files as Data Uri' - description: |- - Obtain a copy of the current documents specified by the `template_id` parameter. Returns a JSON object with a `data_uri` representing the base64 encoded file (PDFs only). - - If the files are currently being prepared, a status code of `409` will be returned instead. In this case please wait for the `template_created` callback event. - operationId: templateFilesAsDataUri - parameters: - - - name: template_id - in: path - description: 'The id of the template files to retrieve.' - required: true - schema: - type: string - example: f57db65d3f933b5316d398057a36176831451a35 + summary: 'Create Template' + description: 'Creates a template that can then be used.' + operationId: templateCreate + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/TemplateCreateRequest' + examples: + example: + $ref: '#/components/examples/TemplateCreateRequest' + form_fields_per_document_example: + $ref: '#/components/examples/TemplateCreateRequestFormFieldsPerDocument' + form_field_groups_example: + $ref: '#/components/examples/TemplateCreateRequestFormFieldGroups' + form_field_rules_example: + $ref: '#/components/examples/TemplateCreateRequestFormFieldRules' + multipart/form-data: + schema: + $ref: '#/components/schemas/TemplateCreateRequest' responses: - 200: + '200': description: 'successful operation' headers: X-RateLimit-Limit: @@ -6465,11 +6221,11 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/FileResponseDataUri' + $ref: '#/components/schemas/TemplateCreateResponse' examples: - default_example: - $ref: '#/components/examples/TemplateFilesResponseExample' - 4XX: + example: + $ref: '#/components/examples/TemplateCreateResponse' + '4XX': description: failed_operation content: application/json: @@ -6477,23 +6233,19 @@ paths: $ref: '#/components/schemas/ErrorResponse' examples: 400_example: - $ref: '#/components/examples/Error400ResponseExample' + $ref: '#/components/examples/Error400Response' 401_example: - $ref: '#/components/examples/Error401ResponseExample' + $ref: '#/components/examples/Error401Response' 402_example: - $ref: '#/components/examples/Error402ResponseExample' + $ref: '#/components/examples/Error402Response' 403_example: - $ref: '#/components/examples/Error403ResponseExample' + $ref: '#/components/examples/Error403Response' 404_example: - $ref: '#/components/examples/Error404ResponseExample' + $ref: '#/components/examples/Error404Response' 409_example: - $ref: '#/components/examples/Error409ResponseExample' - 422_example: - $ref: '#/components/examples/Error422ResponseExample' - 429_example: - $ref: '#/components/examples/Error429ResponseExample' + $ref: '#/components/examples/Error409Response' 4XX_example: - $ref: '#/components/examples/Error4XXResponseExample' + $ref: '#/components/examples/Error4XXResponse' security: - api_key: [] @@ -6505,74 +6257,68 @@ paths: lang: PHP label: PHP source: - $ref: examples/TemplateFilesAsDataUri.php + $ref: examples/TemplateCreateExample.php - lang: 'C#' label: 'C#' source: - $ref: examples/TemplateFilesAsDataUri.cs - - - lang: JavaScript - label: JavaScript - source: - $ref: examples/TemplateFilesAsDataUri.js + $ref: examples/TemplateCreateExample.cs - lang: TypeScript label: TypeScript source: - $ref: examples/TemplateFilesAsDataUri.ts + $ref: examples/TemplateCreateExample.ts - lang: Java label: Java source: - $ref: examples/TemplateFilesAsDataUri.java + $ref: examples/TemplateCreateExample.java - lang: Ruby label: Ruby source: - $ref: examples/TemplateFilesAsDataUri.rb + $ref: examples/TemplateCreateExample.rb - lang: Python label: Python source: - $ref: examples/TemplateFilesAsDataUri.py + $ref: examples/TemplateCreateExample.py - lang: cURL label: cURL source: - $ref: examples/TemplateFilesAsDataUri.sh + $ref: examples/TemplateCreateExample.sh x-meta: seo: - title: 'Get Template Files | API Documentation | Dropbox Sign for Developers' - description: 'The RESTful Dropbox Sign API easily allows you to build custom integrations. To find out how to get a copy of the current specified documents, click here.' - '/template/files_as_file_url/{template_id}': - get: + title: 'Create Template | Dropbox Sign for Developers' + description: 'The RESTful Dropbox Sign API easily allows you to build custom eSign integrations. To find out how to create an template, click here.' + /template/create_embedded_draft: + post: tags: - Template - summary: 'Get Template Files as File Url' - description: |- - Obtain a copy of the current documents specified by the `template_id` parameter. Returns a JSON object with a url to the file (PDFs only). - - If the files are currently being prepared, a status code of `409` will be returned instead. In this case please wait for the `template_created` callback event. - operationId: templateFilesAsFileUrl - parameters: - - - name: template_id - in: path - description: 'The id of the template files to retrieve.' - required: true - schema: - type: string - example: f57db65d3f933b5316d398057a36176831451a35 - - - name: force_download - in: query - description: 'By default when opening the `file_url` a browser will download the PDF and save it locally. When set to `0` the PDF file will be displayed in the browser.' - schema: - type: integer - default: 1 + summary: 'Create Embedded Template Draft' + description: 'The first step in an embedded template workflow. Creates a draft template that can then be further set up in the template ''edit'' stage.' + operationId: templateCreateEmbeddedDraft + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/TemplateCreateEmbeddedDraftRequest' + examples: + example: + $ref: '#/components/examples/TemplateCreateEmbeddedDraftRequest' + form_fields_per_document_example: + $ref: '#/components/examples/TemplateCreateEmbeddedDraftRequestFormFieldsPerDocument' + form_field_groups_example: + $ref: '#/components/examples/TemplateCreateEmbeddedDraftRequestFormFieldGroups' + form_field_rules_example: + $ref: '#/components/examples/TemplateCreateEmbeddedDraftRequestFormFieldRules' + multipart/form-data: + schema: + $ref: '#/components/schemas/TemplateCreateEmbeddedDraftRequest' responses: - 200: + '200': description: 'successful operation' headers: X-RateLimit-Limit: @@ -6584,11 +6330,11 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/FileResponse' + $ref: '#/components/schemas/TemplateCreateEmbeddedDraftResponse' examples: - default_example: - $ref: '#/components/examples/TemplateFilesResponseExample' - 4XX: + example: + $ref: '#/components/examples/TemplateCreateEmbeddedDraftResponse' + '4XX': description: failed_operation content: application/json: @@ -6596,23 +6342,19 @@ paths: $ref: '#/components/schemas/ErrorResponse' examples: 400_example: - $ref: '#/components/examples/Error400ResponseExample' + $ref: '#/components/examples/Error400Response' 401_example: - $ref: '#/components/examples/Error401ResponseExample' + $ref: '#/components/examples/Error401Response' 402_example: - $ref: '#/components/examples/Error402ResponseExample' + $ref: '#/components/examples/Error402Response' 403_example: - $ref: '#/components/examples/Error403ResponseExample' + $ref: '#/components/examples/Error403Response' 404_example: - $ref: '#/components/examples/Error404ResponseExample' + $ref: '#/components/examples/Error404Response' 409_example: - $ref: '#/components/examples/Error409ResponseExample' - 422_example: - $ref: '#/components/examples/Error422ResponseExample' - 429_example: - $ref: '#/components/examples/Error429ResponseExample' + $ref: '#/components/examples/Error409Response' 4XX_example: - $ref: '#/components/examples/Error4XXResponseExample' + $ref: '#/components/examples/Error4XXResponse' security: - api_key: [] @@ -6624,64 +6366,59 @@ paths: lang: PHP label: PHP source: - $ref: examples/TemplateFilesAsFileUrl.php + $ref: examples/TemplateCreateEmbeddedDraftExample.php - lang: 'C#' label: 'C#' source: - $ref: examples/TemplateFilesAsFileUrl.cs - - - lang: JavaScript - label: JavaScript - source: - $ref: examples/TemplateFilesAsFileUrl.js + $ref: examples/TemplateCreateEmbeddedDraftExample.cs - lang: TypeScript label: TypeScript source: - $ref: examples/TemplateFilesAsFileUrl.ts + $ref: examples/TemplateCreateEmbeddedDraftExample.ts - lang: Java label: Java source: - $ref: examples/TemplateFilesAsFileUrl.java + $ref: examples/TemplateCreateEmbeddedDraftExample.java - lang: Ruby label: Ruby source: - $ref: examples/TemplateFilesAsFileUrl.rb + $ref: examples/TemplateCreateEmbeddedDraftExample.rb - lang: Python label: Python source: - $ref: examples/TemplateFilesAsFileUrl.py + $ref: examples/TemplateCreateEmbeddedDraftExample.py - lang: cURL label: cURL source: - $ref: examples/TemplateFilesAsFileUrl.sh + $ref: examples/TemplateCreateEmbeddedDraftExample.sh x-meta: seo: - title: 'Get Template Files | API Documentation | Dropbox Sign for Developers' - description: 'The RESTful Dropbox Sign API easily allows you to build custom integrations. To find out how to get a copy of the current specified documents, click here.' - '/template/{template_id}': - get: + title: 'Create Embedded Template Draft | Dropbox Sign for Developers' + description: 'The RESTful Dropbox Sign API easily allows you to build custom eSign integrations. To find out how to create an embedded draft template, click here.' + '/template/delete/{template_id}': + post: tags: - Template - summary: 'Get Template' - description: 'Returns the Template specified by the `template_id` parameter.' - operationId: templateGet + summary: 'Delete Template' + description: 'Completely deletes the template specified from the account.' + operationId: templateDelete parameters: - name: template_id in: path - description: 'The id of the Template to retrieve.' + description: 'The id of the Template to delete.' required: true schema: type: string example: f57db65d3f933b5316d398057a36176831451a35 responses: - 200: + '200': description: 'successful operation' headers: X-RateLimit-Limit: @@ -6691,13 +6428,8 @@ paths: X-Ratelimit-Reset: $ref: '#/components/headers/X-Ratelimit-Reset' content: - application/json: - schema: - $ref: '#/components/schemas/TemplateGetResponse' - examples: - default_example: - $ref: '#/components/examples/TemplateGetResponseExample' - 4XX: + application/json: {} + '4XX': description: failed_operation content: application/json: @@ -6705,19 +6437,19 @@ paths: $ref: '#/components/schemas/ErrorResponse' examples: 400_example: - $ref: '#/components/examples/Error400ResponseExample' + $ref: '#/components/examples/Error400Response' 401_example: - $ref: '#/components/examples/Error401ResponseExample' + $ref: '#/components/examples/Error401Response' 402_example: - $ref: '#/components/examples/Error402ResponseExample' + $ref: '#/components/examples/Error402Response' 403_example: - $ref: '#/components/examples/Error403ResponseExample' + $ref: '#/components/examples/Error403Response' 404_example: - $ref: '#/components/examples/Error404ResponseExample' - 429_example: - $ref: '#/components/examples/Error429ResponseExample' + $ref: '#/components/examples/Error404Response' + 409_example: + $ref: '#/components/examples/Error409Response' 4XX_example: - $ref: '#/components/examples/Error4XXResponseExample' + $ref: '#/components/examples/Error4XXResponse' security: - api_key: [] @@ -6729,87 +6461,71 @@ paths: lang: PHP label: PHP source: - $ref: examples/TemplateGet.php + $ref: examples/TemplateDeleteExample.php - lang: 'C#' label: 'C#' source: - $ref: examples/TemplateGet.cs - - - lang: JavaScript - label: JavaScript - source: - $ref: examples/TemplateGet.js + $ref: examples/TemplateDeleteExample.cs - lang: TypeScript label: TypeScript source: - $ref: examples/TemplateGet.ts + $ref: examples/TemplateDeleteExample.ts - lang: Java label: Java source: - $ref: examples/TemplateGet.java + $ref: examples/TemplateDeleteExample.java - lang: Ruby label: Ruby source: - $ref: examples/TemplateGet.rb + $ref: examples/TemplateDeleteExample.rb - lang: Python label: Python source: - $ref: examples/TemplateGet.py + $ref: examples/TemplateDeleteExample.py - lang: cURL label: cURL source: - $ref: examples/TemplateGet.sh + $ref: examples/TemplateDeleteExample.sh x-meta: seo: - title: 'Get Template | API Documentation | Dropbox Sign for Developers' - description: 'The RESTful Dropbox Sign API easily allows you to build custom integrations. To find out how to return the Template specified by the `template_id` parameter, click here.' - /template/list: + title: 'Delete Template | API Documentation | Dropbox Sign for Developers' + description: 'The RESTful Dropbox Sign API easily allows you to build custom integrations. To find out how to completely delete a template from the account, click here.' + '/template/files/{template_id}': get: tags: - Template - summary: 'List Templates' + summary: 'Get Template Files' description: |- - Returns a list of the Templates that are accessible by you. + Obtain a copy of the current documents specified by the `template_id` parameter. Returns a PDF or ZIP file. - Take a look at our [search guide](/api/reference/search/) to learn more about querying templates. - operationId: templateList + If the files are currently being prepared, a status code of `409` will be returned instead. In this case please wait for the `template_created` callback event. + operationId: templateFiles parameters: - - name: account_id - in: query - description: 'Which account to return Templates for. Must be a team member. Use `all` to indicate all team members. Defaults to your account.' + name: template_id + in: path + description: 'The id of the template files to retrieve.' + required: true schema: type: string + example: f57db65d3f933b5316d398057a36176831451a35 - - name: page - in: query - description: 'Which page number of the Template List to return. Defaults to `1`.' - schema: - type: integer - default: 1 - - - name: page_size - in: query - description: 'Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`.' - schema: - type: integer - default: 20 - maximum: 100 - minimum: 1 - - - name: query + name: file_type in: query - description: 'String that includes search terms and/or fields to be used to filter the Template objects.' + description: 'Set to `pdf` for a single merged document or `zip` for a collection of individual documents.' schema: type: string + enum: + - pdf + - zip responses: - 200: + '200': description: 'successful operation' headers: X-RateLimit-Limit: @@ -6819,13 +6535,15 @@ paths: X-Ratelimit-Reset: $ref: '#/components/headers/X-Ratelimit-Reset' content: - application/json: + application/pdf: schema: - $ref: '#/components/schemas/TemplateListResponse' - examples: - default_example: - $ref: '#/components/examples/TemplateListResponseExample' - 4XX: + type: string + format: binary + application/zip: + schema: + type: string + format: binary + '4XX': description: failed_operation content: application/json: @@ -6833,19 +6551,23 @@ paths: $ref: '#/components/schemas/ErrorResponse' examples: 400_example: - $ref: '#/components/examples/Error400ResponseExample' + $ref: '#/components/examples/Error400Response' 401_example: - $ref: '#/components/examples/Error401ResponseExample' + $ref: '#/components/examples/Error401Response' 402_example: - $ref: '#/components/examples/Error402ResponseExample' + $ref: '#/components/examples/Error402Response' 403_example: - $ref: '#/components/examples/Error403ResponseExample' + $ref: '#/components/examples/Error403Response' + 404_example: + $ref: '#/components/examples/Error404Response' 409_example: - $ref: '#/components/examples/Error409ResponseExample' + $ref: '#/components/examples/Error409Response' + 422_example: + $ref: '#/components/examples/Error422Response' 429_example: - $ref: '#/components/examples/Error429ResponseExample' + $ref: '#/components/examples/Error429Response' 4XX_example: - $ref: '#/components/examples/Error4XXResponseExample' + $ref: '#/components/examples/Error4XXResponse' security: - api_key: [] @@ -6857,73 +6579,62 @@ paths: lang: PHP label: PHP source: - $ref: examples/TemplateList.php + $ref: examples/TemplateFilesExample.php - lang: 'C#' label: 'C#' source: - $ref: examples/TemplateList.cs - - - lang: JavaScript - label: JavaScript - source: - $ref: examples/TemplateList.js + $ref: examples/TemplateFilesExample.cs - lang: TypeScript label: TypeScript source: - $ref: examples/TemplateList.ts + $ref: examples/TemplateFilesExample.ts - lang: Java label: Java source: - $ref: examples/TemplateList.java + $ref: examples/TemplateFilesExample.java - lang: Ruby label: Ruby source: - $ref: examples/TemplateList.rb + $ref: examples/TemplateFilesExample.rb - lang: Python label: Python source: - $ref: examples/TemplateList.py + $ref: examples/TemplateFilesExample.py - lang: cURL label: cURL source: - $ref: examples/TemplateList.sh + $ref: examples/TemplateFilesExample.sh x-meta: seo: - title: 'List Templates | API Documentation | Dropbox Sign for Developers' - description: 'The Dropbox Sign API easily allows you to build custom integrations. To find out how to return a list of the Templates that can be accessed by you, click here.' - '/template/remove_user/{template_id}': - post: + title: 'Get Template Files | API Documentation | Dropbox Sign for Developers' + description: 'The RESTful Dropbox Sign API easily allows you to build custom integrations. To find out how to get a copy of the current specified documents, click here.' + '/template/files_as_data_uri/{template_id}': + get: tags: - Template - summary: 'Remove User from Template' - description: 'Removes the specified Account''s access to the specified Template.' - operationId: templateRemoveUser + summary: 'Get Template Files as Data Uri' + description: |- + Obtain a copy of the current documents specified by the `template_id` parameter. Returns a JSON object with a `data_uri` representing the base64 encoded file (PDFs only). + + If the files are currently being prepared, a status code of `409` will be returned instead. In this case please wait for the `template_created` callback event. + operationId: templateFilesAsDataUri parameters: - name: template_id in: path - description: 'The id of the Template to remove the Account''s access to.' + description: 'The id of the template files to retrieve.' required: true schema: type: string example: f57db65d3f933b5316d398057a36176831451a35 - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/TemplateRemoveUserRequest' - examples: - default_example: - $ref: '#/components/examples/TemplateRemoveUserRequestDefaultExample' responses: - 200: + '200': description: 'successful operation' headers: X-RateLimit-Limit: @@ -6935,11 +6646,11 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/TemplateGetResponse' + $ref: '#/components/schemas/FileResponseDataUri' examples: - default_example: - $ref: '#/components/examples/TemplateRemoveUserResponseExample' - 4XX: + example: + $ref: '#/components/examples/TemplateFilesResponse' + '4XX': description: failed_operation content: application/json: @@ -6947,17 +6658,23 @@ paths: $ref: '#/components/schemas/ErrorResponse' examples: 400_example: - $ref: '#/components/examples/Error400ResponseExample' + $ref: '#/components/examples/Error400Response' 401_example: - $ref: '#/components/examples/Error401ResponseExample' + $ref: '#/components/examples/Error401Response' 402_example: - $ref: '#/components/examples/Error402ResponseExample' + $ref: '#/components/examples/Error402Response' 403_example: - $ref: '#/components/examples/Error403ResponseExample' + $ref: '#/components/examples/Error403Response' 404_example: - $ref: '#/components/examples/Error404ResponseExample' + $ref: '#/components/examples/Error404Response' + 409_example: + $ref: '#/components/examples/Error409Response' + 422_example: + $ref: '#/components/examples/Error422Response' + 429_example: + $ref: '#/components/examples/Error429Response' 4XX_example: - $ref: '#/components/examples/Error4XXResponseExample' + $ref: '#/components/examples/Error4XXResponse' security: - api_key: [] @@ -6969,88 +6686,69 @@ paths: lang: PHP label: PHP source: - $ref: examples/TemplateRemoveUser.php + $ref: examples/TemplateFilesAsDataUriExample.php - lang: 'C#' label: 'C#' source: - $ref: examples/TemplateRemoveUser.cs - - - lang: JavaScript - label: JavaScript - source: - $ref: examples/TemplateRemoveUser.js + $ref: examples/TemplateFilesAsDataUriExample.cs - lang: TypeScript label: TypeScript source: - $ref: examples/TemplateRemoveUser.ts + $ref: examples/TemplateFilesAsDataUriExample.ts - lang: Java label: Java source: - $ref: examples/TemplateRemoveUser.java + $ref: examples/TemplateFilesAsDataUriExample.java - lang: Ruby label: Ruby source: - $ref: examples/TemplateRemoveUser.rb + $ref: examples/TemplateFilesAsDataUriExample.rb - lang: Python label: Python source: - $ref: examples/TemplateRemoveUser.py + $ref: examples/TemplateFilesAsDataUriExample.py - lang: cURL label: cURL source: - $ref: examples/TemplateRemoveUser.sh + $ref: examples/TemplateFilesAsDataUriExample.sh x-meta: seo: - title: 'Remove User from Template | REST API | Dropbox Sign for Developers' - description: 'The Dropbox Sign API easily allows you to build custom integrations. To find out how to remove a specified Account''s access to a Template, click here.' - '/template/update_files/{template_id}': - post: + title: 'Get Template Files | API Documentation | Dropbox Sign for Developers' + description: 'The RESTful Dropbox Sign API easily allows you to build custom integrations. To find out how to get a copy of the current specified documents, click here.' + '/template/files_as_file_url/{template_id}': + get: tags: - Template - summary: 'Update Template Files' + summary: 'Get Template Files as File Url' description: |- - Overlays a new file with the overlay of an existing template. The new file(s) must: - - 1. have the same or higher page count - 2. the same orientation as the file(s) being replaced. - - This will not overwrite or in any way affect the existing template. Both the existing template and new template will be available for use after executing this endpoint. Also note that this will decrement your template quota. - - Overlaying new files is asynchronous and a successful call to this endpoint will return 200 OK response if the request passes initial validation checks. - - It is recommended that a callback be implemented to listen for the callback event. A `template_created` event will be sent when the files are updated or a `template_error` event will be sent if there was a problem while updating the files. If a callback handler has been configured and the event has not been received within 60 minutes of making the call, check the status of the request in the API dashboard and retry the request if necessary. + Obtain a copy of the current documents specified by the `template_id` parameter. Returns a JSON object with a url to the file (PDFs only). - If the page orientation or page count is different from the original template document, we will notify you with a `template_error` [callback event](https://app.hellosign.com/api/eventsAndCallbacksWalkthrough). - operationId: templateUpdateFiles + If the files are currently being prepared, a status code of `409` will be returned instead. In this case please wait for the `template_created` callback event. + operationId: templateFilesAsFileUrl parameters: - name: template_id in: path - description: 'The ID of the template whose files to update.' + description: 'The id of the template files to retrieve.' required: true schema: type: string example: f57db65d3f933b5316d398057a36176831451a35 - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/TemplateUpdateFilesRequest' - examples: - default_example: - $ref: '#/components/examples/TemplateUpdateFilesRequestDefaultExample' - multipart/form-data: - schema: - $ref: '#/components/schemas/TemplateUpdateFilesRequest' + - + name: force_download + in: query + description: 'By default when opening the `file_url` a browser will download the PDF and save it locally. When set to `0` the PDF file will be displayed in the browser.' + schema: + type: integer + default: 1 responses: - 200: + '200': description: 'successful operation' headers: X-RateLimit-Limit: @@ -7062,11 +6760,11 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/TemplateUpdateFilesResponse' + $ref: '#/components/schemas/FileResponse' examples: - default_example: - $ref: '#/components/examples/TemplateUpdateFilesResponseExample' - 4XX: + example: + $ref: '#/components/examples/TemplateFilesResponse' + '4XX': description: failed_operation content: application/json: @@ -7074,21 +6772,23 @@ paths: $ref: '#/components/schemas/ErrorResponse' examples: 400_example: - $ref: '#/components/examples/Error400ResponseExample' + $ref: '#/components/examples/Error400Response' 401_example: - $ref: '#/components/examples/Error401ResponseExample' + $ref: '#/components/examples/Error401Response' 402_example: - $ref: '#/components/examples/Error402ResponseExample' + $ref: '#/components/examples/Error402Response' 403_example: - $ref: '#/components/examples/Error403ResponseExample' + $ref: '#/components/examples/Error403Response' 404_example: - $ref: '#/components/examples/Error404ResponseExample' + $ref: '#/components/examples/Error404Response' 409_example: - $ref: '#/components/examples/Error409ResponseExample' + $ref: '#/components/examples/Error409Response' + 422_example: + $ref: '#/components/examples/Error422Response' 429_example: - $ref: '#/components/examples/Error429ResponseExample' + $ref: '#/components/examples/Error429Response' 4XX_example: - $ref: '#/components/examples/Error4XXResponseExample' + $ref: '#/components/examples/Error4XXResponse' security: - api_key: [] @@ -7100,73 +6800,59 @@ paths: lang: PHP label: PHP source: - $ref: examples/TemplateUpdateFiles.php + $ref: examples/TemplateFilesAsFileUrlExample.php - lang: 'C#' label: 'C#' source: - $ref: examples/TemplateUpdateFiles.cs - - - lang: JavaScript - label: JavaScript - source: - $ref: examples/TemplateUpdateFiles.js + $ref: examples/TemplateFilesAsFileUrlExample.cs - lang: TypeScript label: TypeScript source: - $ref: examples/TemplateUpdateFiles.ts + $ref: examples/TemplateFilesAsFileUrlExample.ts - lang: Java label: Java source: - $ref: examples/TemplateUpdateFiles.java + $ref: examples/TemplateFilesAsFileUrlExample.java - lang: Ruby label: Ruby source: - $ref: examples/TemplateUpdateFiles.rb + $ref: examples/TemplateFilesAsFileUrlExample.rb - lang: Python label: Python source: - $ref: examples/TemplateUpdateFiles.py + $ref: examples/TemplateFilesAsFileUrlExample.py - lang: cURL label: cURL source: - $ref: examples/TemplateUpdateFiles.sh + $ref: examples/TemplateFilesAsFileUrlExample.sh x-meta: seo: - title: 'Update Template Files | REST API | Dropbox Sign for Developers' - description: 'Overlays a new file with the overlay of an existing template' - /unclaimed_draft/create: - post: + title: 'Get Template Files | API Documentation | Dropbox Sign for Developers' + description: 'The RESTful Dropbox Sign API easily allows you to build custom integrations. To find out how to get a copy of the current specified documents, click here.' + '/template/{template_id}': + get: tags: - - 'Unclaimed Draft' - summary: 'Create Unclaimed Draft' - description: 'Creates a new Draft that can be claimed using the claim URL. The first authenticated user to access the URL will claim the Draft and will be shown either the "Sign and send" or the "Request signature" page with the Draft loaded. Subsequent access to the claim URL will result in a 404.' - operationId: unclaimedDraftCreate - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/UnclaimedDraftCreateRequest' - examples: - default_example: - $ref: '#/components/examples/UnclaimedDraftCreateRequestDefaultExample' - form_fields_per_document: - $ref: '#/components/examples/UnclaimedDraftCreateRequestFormFieldsPerDocumentExample' - form_field_groups: - $ref: '#/components/examples/UnclaimedDraftCreateRequestFormFieldGroupsExample' - form_field_rules: - $ref: '#/components/examples/UnclaimedDraftCreateRequestFormFieldRulesExample' - multipart/form-data: - schema: - $ref: '#/components/schemas/UnclaimedDraftCreateRequest' + - Template + summary: 'Get Template' + description: 'Returns the Template specified by the `template_id` parameter.' + operationId: templateGet + parameters: + - + name: template_id + in: path + description: 'The id of the Template to retrieve.' + required: true + schema: + type: string + example: f57db65d3f933b5316d398057a36176831451a35 responses: - 200: + '200': description: 'successful operation' headers: X-RateLimit-Limit: @@ -7178,11 +6864,11 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/UnclaimedDraftCreateResponse' + $ref: '#/components/schemas/TemplateGetResponse' examples: - default_example: - $ref: '#/components/examples/UnclaimedDraftCreateResponseExample' - 4XX: + example: + $ref: '#/components/examples/TemplateGetResponse' + '4XX': description: failed_operation content: application/json: @@ -7190,96 +6876,106 @@ paths: $ref: '#/components/schemas/ErrorResponse' examples: 400_example: - $ref: '#/components/examples/Error400ResponseExample' + $ref: '#/components/examples/Error400Response' 401_example: - $ref: '#/components/examples/Error401ResponseExample' + $ref: '#/components/examples/Error401Response' 402_example: - $ref: '#/components/examples/Error402ResponseExample' + $ref: '#/components/examples/Error402Response' 403_example: - $ref: '#/components/examples/Error403ResponseExample' + $ref: '#/components/examples/Error403Response' + 404_example: + $ref: '#/components/examples/Error404Response' + 429_example: + $ref: '#/components/examples/Error429Response' 4XX_example: - $ref: '#/components/examples/Error4XXResponseExample' + $ref: '#/components/examples/Error4XXResponse' security: - api_key: [] - oauth2: - - signature_request_access + - template_access x-codeSamples: - lang: PHP label: PHP source: - $ref: examples/UnclaimedDraftCreate.php + $ref: examples/TemplateGetExample.php - lang: 'C#' label: 'C#' source: - $ref: examples/UnclaimedDraftCreate.cs - - - lang: JavaScript - label: JavaScript - source: - $ref: examples/UnclaimedDraftCreate.js + $ref: examples/TemplateGetExample.cs - lang: TypeScript label: TypeScript source: - $ref: examples/UnclaimedDraftCreate.ts + $ref: examples/TemplateGetExample.ts - lang: Java label: Java source: - $ref: examples/UnclaimedDraftCreate.java + $ref: examples/TemplateGetExample.java - lang: Ruby label: Ruby source: - $ref: examples/UnclaimedDraftCreate.rb + $ref: examples/TemplateGetExample.rb - lang: Python label: Python source: - $ref: examples/UnclaimedDraftCreate.py + $ref: examples/TemplateGetExample.py - lang: cURL label: cURL source: - $ref: examples/UnclaimedDraftCreate.sh + $ref: examples/TemplateGetExample.sh x-meta: seo: - title: 'Create Unclaimed Draft | REST API | Dropbox Sign for Developers' - description: 'The Dropbox Sign API allows you to build eSign integrations. To find out how to create a new Signature Request Draft that can be claimed using the claim URL, click here.' - /unclaimed_draft/create_embedded: - post: + title: 'Get Template | API Documentation | Dropbox Sign for Developers' + description: 'The RESTful Dropbox Sign API easily allows you to build custom integrations. To find out how to return the Template specified by the `template_id` parameter, click here.' + /template/list: + get: tags: - - 'Unclaimed Draft' - summary: 'Create Embedded Unclaimed Draft' + - Template + summary: 'List Templates' description: |- - Creates a new Draft that can be claimed and used in an embedded iFrame. The first authenticated user to access the URL will claim the Draft and will be shown the "Request signature" page with the Draft loaded. Subsequent access to the claim URL will result in a `404`. For this embedded endpoint the `requester_email_address` parameter is required. + Returns a list of the Templates that are accessible by you. - **NOTE:** Embedded unclaimed drafts can only be accessed in embedded iFrames whereas normal drafts can be used and accessed on Dropbox Sign. - operationId: unclaimedDraftCreateEmbedded - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/UnclaimedDraftCreateEmbeddedRequest' - examples: - default_example: - $ref: '#/components/examples/UnclaimedDraftCreateEmbeddedRequestDefaultExample' - form_fields_per_document: - $ref: '#/components/examples/UnclaimedDraftCreateEmbeddedRequestFormFieldsPerDocumentExample' - form_field_groups: - $ref: '#/components/examples/UnclaimedDraftCreateEmbeddedRequestFormFieldGroupsExample' - form_field_rules: - $ref: '#/components/examples/UnclaimedDraftCreateEmbeddedRequestFormFieldRulesExample' - multipart/form-data: - schema: - $ref: '#/components/schemas/UnclaimedDraftCreateEmbeddedRequest' + Take a look at our [search guide](/api/reference/search/) to learn more about querying templates. + operationId: templateList + parameters: + - + name: account_id + in: query + description: 'Which account to return Templates for. Must be a team member. Use `all` to indicate all team members. Defaults to your account.' + schema: + type: string + - + name: page + in: query + description: 'Which page number of the Template List to return. Defaults to `1`.' + schema: + type: integer + default: 1 + - + name: page_size + in: query + description: 'Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`.' + schema: + type: integer + default: 20 + maximum: 100 + minimum: 1 + - + name: query + in: query + description: 'String that includes search terms and/or fields to be used to filter the Template objects.' + schema: + type: string responses: - 200: + '200': description: 'successful operation' headers: X-RateLimit-Limit: @@ -7291,11 +6987,11 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/UnclaimedDraftCreateResponse' + $ref: '#/components/schemas/TemplateListResponse' examples: - default_example: - $ref: '#/components/examples/UnclaimedDraftCreateEmbeddedResponseExample' - 4XX: + example: + $ref: '#/components/examples/TemplateListResponse' + '4XX': description: failed_operation content: application/json: @@ -7303,95 +6999,92 @@ paths: $ref: '#/components/schemas/ErrorResponse' examples: 400_example: - $ref: '#/components/examples/Error400ResponseExample' + $ref: '#/components/examples/Error400Response' 401_example: - $ref: '#/components/examples/Error401ResponseExample' + $ref: '#/components/examples/Error401Response' 402_example: - $ref: '#/components/examples/Error402ResponseExample' + $ref: '#/components/examples/Error402Response' 403_example: - $ref: '#/components/examples/Error403ResponseExample' - 404_example: - $ref: '#/components/examples/Error404ResponseExample' + $ref: '#/components/examples/Error403Response' 409_example: - $ref: '#/components/examples/Error409ResponseExample' + $ref: '#/components/examples/Error409Response' + 429_example: + $ref: '#/components/examples/Error429Response' 4XX_example: - $ref: '#/components/examples/Error4XXResponseExample' + $ref: '#/components/examples/Error4XXResponse' security: - api_key: [] - oauth2: - - request_signature - - signature_request_access + - template_access x-codeSamples: - lang: PHP label: PHP source: - $ref: examples/UnclaimedDraftCreateEmbedded.php + $ref: examples/TemplateListExample.php - lang: 'C#' label: 'C#' source: - $ref: examples/UnclaimedDraftCreateEmbedded.cs - - - lang: JavaScript - label: JavaScript - source: - $ref: examples/UnclaimedDraftCreateEmbedded.js + $ref: examples/TemplateListExample.cs - lang: TypeScript label: TypeScript source: - $ref: examples/UnclaimedDraftCreateEmbedded.ts + $ref: examples/TemplateListExample.ts - lang: Java label: Java source: - $ref: examples/UnclaimedDraftCreateEmbedded.java + $ref: examples/TemplateListExample.java - lang: Ruby label: Ruby source: - $ref: examples/UnclaimedDraftCreateEmbedded.rb + $ref: examples/TemplateListExample.rb - lang: Python label: Python source: - $ref: examples/UnclaimedDraftCreateEmbedded.py + $ref: examples/TemplateListExample.py - lang: cURL label: cURL source: - $ref: examples/UnclaimedDraftCreateEmbedded.sh + $ref: examples/TemplateListExample.sh x-meta: seo: - title: 'Create Embedded Unclaimed Draft | Dropbox Sign for Developers' - description: 'The Dropbox Sign API allows you to build custom integrations. To find out how to create and embed a the creation of a Signature Request in an iFrame, click here.' - /unclaimed_draft/create_embedded_with_template: + title: 'List Templates | API Documentation | Dropbox Sign for Developers' + description: 'The Dropbox Sign API easily allows you to build custom integrations. To find out how to return a list of the Templates that can be accessed by you, click here.' + '/template/remove_user/{template_id}': post: tags: - - 'Unclaimed Draft' - summary: 'Create Embedded Unclaimed Draft with Template' - description: |- - Creates a new Draft with a previously saved template(s) that can be claimed and used in an embedded iFrame. The first authenticated user to access the URL will claim the Draft and will be shown the "Request signature" page with the Draft loaded. Subsequent access to the claim URL will result in a `404`. For this embedded endpoint the `requester_email_address` parameter is required. - - **NOTE:** Embedded unclaimed drafts can only be accessed in embedded iFrames whereas normal drafts can be used and accessed on Dropbox Sign. - operationId: unclaimedDraftCreateEmbeddedWithTemplate + - Template + summary: 'Remove User from Template' + description: 'Removes the specified Account''s access to the specified Template.' + operationId: templateRemoveUser + parameters: + - + name: template_id + in: path + description: 'The id of the Template to remove the Account''s access to.' + required: true + schema: + type: string + example: f57db65d3f933b5316d398057a36176831451a35 requestBody: required: true content: application/json: schema: - $ref: '#/components/schemas/UnclaimedDraftCreateEmbeddedWithTemplateRequest' + $ref: '#/components/schemas/TemplateRemoveUserRequest' examples: - default_example: - $ref: '#/components/examples/UnclaimedDraftCreateEmbeddedWithTemplateRequestDefaultExample' - multipart/form-data: - schema: - $ref: '#/components/schemas/UnclaimedDraftCreateEmbeddedWithTemplateRequest' + example: + $ref: '#/components/examples/TemplateRemoveUserRequest' responses: - 200: + '200': description: 'successful operation' headers: X-RateLimit-Limit: @@ -7403,11 +7096,11 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/UnclaimedDraftCreateResponse' + $ref: '#/components/schemas/TemplateGetResponse' examples: - default_example: - $ref: '#/components/examples/UnclaimedDraftCreateEmbeddedWithTemplateResponseExample' - 4XX: + example: + $ref: '#/components/examples/TemplateRemoveUserResponse' + '4XX': description: failed_operation content: application/json: @@ -7415,102 +7108,105 @@ paths: $ref: '#/components/schemas/ErrorResponse' examples: 400_example: - $ref: '#/components/examples/Error400ResponseExample' + $ref: '#/components/examples/Error400Response' 401_example: - $ref: '#/components/examples/Error401ResponseExample' + $ref: '#/components/examples/Error401Response' 402_example: - $ref: '#/components/examples/Error402ResponseExample' + $ref: '#/components/examples/Error402Response' 403_example: - $ref: '#/components/examples/Error403ResponseExample' + $ref: '#/components/examples/Error403Response' 404_example: - $ref: '#/components/examples/Error404ResponseExample' - 409_example: - $ref: '#/components/examples/Error409ResponseExample' - 429_example: - $ref: '#/components/examples/Error429ResponseExample' + $ref: '#/components/examples/Error404Response' 4XX_example: - $ref: '#/components/examples/Error4XXResponseExample' + $ref: '#/components/examples/Error4XXResponse' security: - api_key: [] - oauth2: - - signature_request_access + - template_access x-codeSamples: - lang: PHP label: PHP source: - $ref: examples/UnclaimedDraftCreateEmbeddedWithTemplate.php + $ref: examples/TemplateRemoveUserExample.php - lang: 'C#' label: 'C#' source: - $ref: examples/UnclaimedDraftCreateEmbeddedWithTemplate.cs - - - lang: JavaScript - label: JavaScript - source: - $ref: examples/UnclaimedDraftCreateEmbeddedWithTemplate.js + $ref: examples/TemplateRemoveUserExample.cs - lang: TypeScript label: TypeScript source: - $ref: examples/UnclaimedDraftCreateEmbeddedWithTemplate.ts + $ref: examples/TemplateRemoveUserExample.ts - lang: Java label: Java source: - $ref: examples/UnclaimedDraftCreateEmbeddedWithTemplate.java + $ref: examples/TemplateRemoveUserExample.java - lang: Ruby label: Ruby source: - $ref: examples/UnclaimedDraftCreateEmbeddedWithTemplate.rb + $ref: examples/TemplateRemoveUserExample.rb - lang: Python label: Python source: - $ref: examples/UnclaimedDraftCreateEmbeddedWithTemplate.py + $ref: examples/TemplateRemoveUserExample.py - lang: cURL label: cURL source: - $ref: examples/UnclaimedDraftCreateEmbeddedWithTemplate.sh + $ref: examples/TemplateRemoveUserExample.sh x-meta: seo: - title: 'Embed Unclaimed Draft with Template | Dropbox Sign for Developers' - description: 'The Dropbox Sign API easily allows you to build custom integrations. To find out how to create a new Draft with a previously saved template, click here.' - '/unclaimed_draft/edit_and_resend/{signature_request_id}': + title: 'Remove User from Template | REST API | Dropbox Sign for Developers' + description: 'The Dropbox Sign API easily allows you to build custom integrations. To find out how to remove a specified Account''s access to a Template, click here.' + '/template/update_files/{template_id}': post: tags: - - 'Unclaimed Draft' - summary: 'Edit and Resend Unclaimed Draft' + - Template + summary: 'Update Template Files' description: |- - Creates a new signature request from an embedded request that can be edited prior to being sent to the recipients. Parameter `test_mode` can be edited prior to request. Signers can be edited in embedded editor. Requester's email address will remain unchanged if `requester_email_address` parameter is not set. + Overlays a new file with the overlay of an existing template. The new file(s) must: - **NOTE:** Embedded unclaimed drafts can only be accessed in embedded iFrames whereas normal drafts can be used and accessed on Dropbox Sign. - operationId: unclaimedDraftEditAndResend - parameters: - - - name: signature_request_id - in: path - description: 'The ID of the signature request to edit and resend.' + 1. have the same or higher page count + 2. the same orientation as the file(s) being replaced. + + This will not overwrite or in any way affect the existing template. Both the existing template and new template will be available for use after executing this endpoint. Also note that this will decrement your template quota. + + Overlaying new files is asynchronous and a successful call to this endpoint will return 200 OK response if the request passes initial validation checks. + + It is recommended that a callback be implemented to listen for the callback event. A `template_created` event will be sent when the files are updated or a `template_error` event will be sent if there was a problem while updating the files. If a callback handler has been configured and the event has not been received within 60 minutes of making the call, check the status of the request in the API dashboard and retry the request if necessary. + + If the page orientation or page count is different from the original template document, we will notify you with a `template_error` [callback event](https://app.hellosign.com/api/eventsAndCallbacksWalkthrough). + operationId: templateUpdateFiles + parameters: + - + name: template_id + in: path + description: 'The ID of the template whose files to update.' required: true schema: type: string - example: fa5c8a0b0f492d768749333ad6fcc214c111e967 + example: f57db65d3f933b5316d398057a36176831451a35 requestBody: required: true content: application/json: schema: - $ref: '#/components/schemas/UnclaimedDraftEditAndResendRequest' + $ref: '#/components/schemas/TemplateUpdateFilesRequest' examples: - default_example: - $ref: '#/components/examples/UnclaimedDraftEditAndResendRequestDefaultExample' + example: + $ref: '#/components/examples/TemplateUpdateFilesRequest' + multipart/form-data: + schema: + $ref: '#/components/schemas/TemplateUpdateFilesRequest' responses: - 200: + '200': description: 'successful operation' headers: X-RateLimit-Limit: @@ -7522,11 +7218,11 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/UnclaimedDraftCreateResponse' + $ref: '#/components/schemas/TemplateUpdateFilesResponse' examples: - default_example: - $ref: '#/components/examples/UnclaimedDraftEditAndResendExample' - 4XX: + example: + $ref: '#/components/examples/TemplateUpdateFilesResponse' + '4XX': description: failed_operation content: application/json: @@ -7534,123 +7230,558 @@ paths: $ref: '#/components/schemas/ErrorResponse' examples: 400_example: - $ref: '#/components/examples/Error400ResponseExample' + $ref: '#/components/examples/Error400Response' 401_example: - $ref: '#/components/examples/Error401ResponseExample' + $ref: '#/components/examples/Error401Response' 402_example: - $ref: '#/components/examples/Error402ResponseExample' + $ref: '#/components/examples/Error402Response' 403_example: - $ref: '#/components/examples/Error403ResponseExample' + $ref: '#/components/examples/Error403Response' 404_example: - $ref: '#/components/examples/Error404ResponseExample' + $ref: '#/components/examples/Error404Response' 409_example: - $ref: '#/components/examples/Error409ResponseExample' - 410_example: - $ref: '#/components/examples/Error410ResponseExample' + $ref: '#/components/examples/Error409Response' + 429_example: + $ref: '#/components/examples/Error429Response' 4XX_example: - $ref: '#/components/examples/Error4XXResponseExample' + $ref: '#/components/examples/Error4XXResponse' security: - api_key: [] - oauth2: - - request_signature - - signature_request_access + - template_access x-codeSamples: - lang: PHP label: PHP source: - $ref: examples/UnclaimedDraftEditAndResend.php + $ref: examples/TemplateUpdateFilesExample.php - lang: 'C#' label: 'C#' source: - $ref: examples/UnclaimedDraftEditAndResend.cs + $ref: examples/TemplateUpdateFilesExample.cs + - + lang: TypeScript + label: TypeScript + source: + $ref: examples/TemplateUpdateFilesExample.ts + - + lang: Java + label: Java + source: + $ref: examples/TemplateUpdateFilesExample.java + - + lang: Ruby + label: Ruby + source: + $ref: examples/TemplateUpdateFilesExample.rb + - + lang: Python + label: Python + source: + $ref: examples/TemplateUpdateFilesExample.py + - + lang: cURL + label: cURL + source: + $ref: examples/TemplateUpdateFilesExample.sh + x-meta: + seo: + title: 'Update Template Files | REST API | Dropbox Sign for Developers' + description: 'Overlays a new file with the overlay of an existing template' + /unclaimed_draft/create: + post: + tags: + - 'Unclaimed Draft' + summary: 'Create Unclaimed Draft' + description: 'Creates a new Draft that can be claimed using the claim URL. The first authenticated user to access the URL will claim the Draft and will be shown either the "Sign and send" or the "Request signature" page with the Draft loaded. Subsequent access to the claim URL will result in a 404.' + operationId: unclaimedDraftCreate + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/UnclaimedDraftCreateRequest' + examples: + example: + $ref: '#/components/examples/UnclaimedDraftCreateRequest' + form_fields_per_document_example: + $ref: '#/components/examples/UnclaimedDraftCreateRequestFormFieldsPerDocument' + form_field_groups_example: + $ref: '#/components/examples/UnclaimedDraftCreateRequestFormFieldGroups' + form_field_rules_example: + $ref: '#/components/examples/UnclaimedDraftCreateRequestFormFieldRules' + multipart/form-data: + schema: + $ref: '#/components/schemas/UnclaimedDraftCreateRequest' + responses: + '200': + description: 'successful operation' + headers: + X-RateLimit-Limit: + $ref: '#/components/headers/X-RateLimit-Limit' + X-RateLimit-Remaining: + $ref: '#/components/headers/X-RateLimit-Remaining' + X-Ratelimit-Reset: + $ref: '#/components/headers/X-Ratelimit-Reset' + content: + application/json: + schema: + $ref: '#/components/schemas/UnclaimedDraftCreateResponse' + examples: + example: + $ref: '#/components/examples/UnclaimedDraftCreateResponse' + '4XX': + description: failed_operation + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + 400_example: + $ref: '#/components/examples/Error400Response' + 401_example: + $ref: '#/components/examples/Error401Response' + 402_example: + $ref: '#/components/examples/Error402Response' + 403_example: + $ref: '#/components/examples/Error403Response' + 4XX_example: + $ref: '#/components/examples/Error4XXResponse' + security: + - + api_key: [] + - + oauth2: + - signature_request_access + x-codeSamples: + - + lang: PHP + label: PHP + source: + $ref: examples/UnclaimedDraftCreateExample.php - - lang: JavaScript - label: JavaScript + lang: 'C#' + label: 'C#' source: - $ref: examples/UnclaimedDraftEditAndResend.js + $ref: examples/UnclaimedDraftCreateExample.cs - lang: TypeScript label: TypeScript source: - $ref: examples/UnclaimedDraftEditAndResend.ts + $ref: examples/UnclaimedDraftCreateExample.ts - lang: Java label: Java source: - $ref: examples/UnclaimedDraftEditAndResend.java + $ref: examples/UnclaimedDraftCreateExample.java - lang: Ruby label: Ruby source: - $ref: examples/UnclaimedDraftEditAndResend.rb + $ref: examples/UnclaimedDraftCreateExample.rb - lang: Python label: Python source: - $ref: examples/UnclaimedDraftEditAndResend.py + $ref: examples/UnclaimedDraftCreateExample.py - lang: cURL label: cURL source: - $ref: examples/UnclaimedDraftEditAndResend.sh + $ref: examples/UnclaimedDraftCreateExample.sh x-meta: seo: - title: 'Edit and Resend Unclaimed Draft | Dropbox Sign for Developers' - description: 'The Dropbox Sign API easily allows you to build custom integrations. To find out how to create a new signature request from an embedded request, click here.' -components: - schemas: - AccountCreateRequest: - required: - - email_address - properties: - client_id: - description: |- - Used when creating a new account with OAuth authorization. + title: 'Create Unclaimed Draft | REST API | Dropbox Sign for Developers' + description: 'The Dropbox Sign API allows you to build eSign integrations. To find out how to create a new Signature Request Draft that can be claimed using the claim URL, click here.' + /unclaimed_draft/create_embedded: + post: + tags: + - 'Unclaimed Draft' + summary: 'Create Embedded Unclaimed Draft' + description: |- + Creates a new Draft that can be claimed and used in an embedded iFrame. The first authenticated user to access the URL will claim the Draft and will be shown the "Request signature" page with the Draft loaded. Subsequent access to the claim URL will result in a `404`. For this embedded endpoint the `requester_email_address` parameter is required. - See [OAuth 2.0 Authorization](https://app.hellosign.com/api/oauthWalkthrough#OAuthAuthorization) - type: string - client_secret: - description: |- - Used when creating a new account with OAuth authorization. + **NOTE:** Embedded unclaimed drafts can only be accessed in embedded iFrames whereas normal drafts can be used and accessed on Dropbox Sign. + operationId: unclaimedDraftCreateEmbedded + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/UnclaimedDraftCreateEmbeddedRequest' + examples: + example: + $ref: '#/components/examples/UnclaimedDraftCreateEmbeddedRequest' + form_fields_per_document_example: + $ref: '#/components/examples/UnclaimedDraftCreateEmbeddedRequestFormFieldsPerDocument' + form_field_groups_example: + $ref: '#/components/examples/UnclaimedDraftCreateEmbeddedRequestFormFieldGroups' + form_field_rules_example: + $ref: '#/components/examples/UnclaimedDraftCreateEmbeddedRequestFormFieldRules' + multipart/form-data: + schema: + $ref: '#/components/schemas/UnclaimedDraftCreateEmbeddedRequest' + responses: + '200': + description: 'successful operation' + headers: + X-RateLimit-Limit: + $ref: '#/components/headers/X-RateLimit-Limit' + X-RateLimit-Remaining: + $ref: '#/components/headers/X-RateLimit-Remaining' + X-Ratelimit-Reset: + $ref: '#/components/headers/X-Ratelimit-Reset' + content: + application/json: + schema: + $ref: '#/components/schemas/UnclaimedDraftCreateResponse' + examples: + example: + $ref: '#/components/examples/UnclaimedDraftCreateEmbeddedResponse' + '4XX': + description: failed_operation + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + 400_example: + $ref: '#/components/examples/Error400Response' + 401_example: + $ref: '#/components/examples/Error401Response' + 402_example: + $ref: '#/components/examples/Error402Response' + 403_example: + $ref: '#/components/examples/Error403Response' + 404_example: + $ref: '#/components/examples/Error404Response' + 409_example: + $ref: '#/components/examples/Error409Response' + 4XX_example: + $ref: '#/components/examples/Error4XXResponse' + security: + - + api_key: [] + - + oauth2: + - request_signature + - signature_request_access + x-codeSamples: + - + lang: PHP + label: PHP + source: + $ref: examples/UnclaimedDraftCreateEmbeddedExample.php + - + lang: 'C#' + label: 'C#' + source: + $ref: examples/UnclaimedDraftCreateEmbeddedExample.cs + - + lang: TypeScript + label: TypeScript + source: + $ref: examples/UnclaimedDraftCreateEmbeddedExample.ts + - + lang: Java + label: Java + source: + $ref: examples/UnclaimedDraftCreateEmbeddedExample.java + - + lang: Ruby + label: Ruby + source: + $ref: examples/UnclaimedDraftCreateEmbeddedExample.rb + - + lang: Python + label: Python + source: + $ref: examples/UnclaimedDraftCreateEmbeddedExample.py + - + lang: cURL + label: cURL + source: + $ref: examples/UnclaimedDraftCreateEmbeddedExample.sh + x-meta: + seo: + title: 'Create Embedded Unclaimed Draft | Dropbox Sign for Developers' + description: 'The Dropbox Sign API allows you to build custom integrations. To find out how to create and embed a the creation of a Signature Request in an iFrame, click here.' + /unclaimed_draft/create_embedded_with_template: + post: + tags: + - 'Unclaimed Draft' + summary: 'Create Embedded Unclaimed Draft with Template' + description: |- + Creates a new Draft with a previously saved template(s) that can be claimed and used in an embedded iFrame. The first authenticated user to access the URL will claim the Draft and will be shown the "Request signature" page with the Draft loaded. Subsequent access to the claim URL will result in a `404`. For this embedded endpoint the `requester_email_address` parameter is required. - See [OAuth 2.0 Authorization](https://app.hellosign.com/api/oauthWalkthrough#OAuthAuthorization) - type: string - email_address: - description: 'The email address which will be associated with the new Account.' - type: string - format: email - locale: - description: 'The locale used in this Account. Check out the list of [supported locales](/api/reference/constants/#supported-locales) to learn more about the possible values.' - type: string - type: object - AccountUpdateRequest: - properties: - account_id: - description: 'The ID of the Account' - type: string - nullable: true - callback_url: - description: 'The URL that Dropbox Sign should POST events to.' - type: string - locale: - description: 'The locale used in this Account. Check out the list of [supported locales](/api/reference/constants/#supported-locales) to learn more about the possible values.' - type: string - type: object - AccountVerifyRequest: - required: - - email_address - properties: - email_address: - description: 'Email address to run the verification for.' - type: string - format: email - type: object - ApiAppCreateRequest: - required: + **NOTE:** Embedded unclaimed drafts can only be accessed in embedded iFrames whereas normal drafts can be used and accessed on Dropbox Sign. + operationId: unclaimedDraftCreateEmbeddedWithTemplate + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/UnclaimedDraftCreateEmbeddedWithTemplateRequest' + examples: + example: + $ref: '#/components/examples/UnclaimedDraftCreateEmbeddedWithTemplateRequest' + multipart/form-data: + schema: + $ref: '#/components/schemas/UnclaimedDraftCreateEmbeddedWithTemplateRequest' + responses: + '200': + description: 'successful operation' + headers: + X-RateLimit-Limit: + $ref: '#/components/headers/X-RateLimit-Limit' + X-RateLimit-Remaining: + $ref: '#/components/headers/X-RateLimit-Remaining' + X-Ratelimit-Reset: + $ref: '#/components/headers/X-Ratelimit-Reset' + content: + application/json: + schema: + $ref: '#/components/schemas/UnclaimedDraftCreateResponse' + examples: + example: + $ref: '#/components/examples/UnclaimedDraftCreateEmbeddedWithTemplateResponse' + '4XX': + description: failed_operation + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + 400_example: + $ref: '#/components/examples/Error400Response' + 401_example: + $ref: '#/components/examples/Error401Response' + 402_example: + $ref: '#/components/examples/Error402Response' + 403_example: + $ref: '#/components/examples/Error403Response' + 404_example: + $ref: '#/components/examples/Error404Response' + 409_example: + $ref: '#/components/examples/Error409Response' + 429_example: + $ref: '#/components/examples/Error429Response' + 4XX_example: + $ref: '#/components/examples/Error4XXResponse' + security: + - + api_key: [] + - + oauth2: + - signature_request_access + x-codeSamples: + - + lang: PHP + label: PHP + source: + $ref: examples/UnclaimedDraftCreateEmbeddedWithTemplateExample.php + - + lang: 'C#' + label: 'C#' + source: + $ref: examples/UnclaimedDraftCreateEmbeddedWithTemplateExample.cs + - + lang: TypeScript + label: TypeScript + source: + $ref: examples/UnclaimedDraftCreateEmbeddedWithTemplateExample.ts + - + lang: Java + label: Java + source: + $ref: examples/UnclaimedDraftCreateEmbeddedWithTemplateExample.java + - + lang: Ruby + label: Ruby + source: + $ref: examples/UnclaimedDraftCreateEmbeddedWithTemplateExample.rb + - + lang: Python + label: Python + source: + $ref: examples/UnclaimedDraftCreateEmbeddedWithTemplateExample.py + - + lang: cURL + label: cURL + source: + $ref: examples/UnclaimedDraftCreateEmbeddedWithTemplateExample.sh + x-meta: + seo: + title: 'Embed Unclaimed Draft with Template | Dropbox Sign for Developers' + description: 'The Dropbox Sign API easily allows you to build custom integrations. To find out how to create a new Draft with a previously saved template, click here.' + '/unclaimed_draft/edit_and_resend/{signature_request_id}': + post: + tags: + - 'Unclaimed Draft' + summary: 'Edit and Resend Unclaimed Draft' + description: |- + Creates a new signature request from an embedded request that can be edited prior to being sent to the recipients. Parameter `test_mode` can be edited prior to request. Signers can be edited in embedded editor. Requester's email address will remain unchanged if `requester_email_address` parameter is not set. + + **NOTE:** Embedded unclaimed drafts can only be accessed in embedded iFrames whereas normal drafts can be used and accessed on Dropbox Sign. + operationId: unclaimedDraftEditAndResend + parameters: + - + name: signature_request_id + in: path + description: 'The ID of the signature request to edit and resend.' + required: true + schema: + type: string + example: fa5c8a0b0f492d768749333ad6fcc214c111e967 + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/UnclaimedDraftEditAndResendRequest' + examples: + example: + $ref: '#/components/examples/UnclaimedDraftEditAndResendRequest' + responses: + '200': + description: 'successful operation' + headers: + X-RateLimit-Limit: + $ref: '#/components/headers/X-RateLimit-Limit' + X-RateLimit-Remaining: + $ref: '#/components/headers/X-RateLimit-Remaining' + X-Ratelimit-Reset: + $ref: '#/components/headers/X-Ratelimit-Reset' + content: + application/json: + schema: + $ref: '#/components/schemas/UnclaimedDraftCreateResponse' + examples: + example: + $ref: '#/components/examples/UnclaimedDraftEditAndResend' + '4XX': + description: failed_operation + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + 400_example: + $ref: '#/components/examples/Error400Response' + 401_example: + $ref: '#/components/examples/Error401Response' + 402_example: + $ref: '#/components/examples/Error402Response' + 403_example: + $ref: '#/components/examples/Error403Response' + 404_example: + $ref: '#/components/examples/Error404Response' + 409_example: + $ref: '#/components/examples/Error409Response' + 410_example: + $ref: '#/components/examples/Error410Response' + 4XX_example: + $ref: '#/components/examples/Error4XXResponse' + security: + - + api_key: [] + - + oauth2: + - request_signature + - signature_request_access + x-codeSamples: + - + lang: PHP + label: PHP + source: + $ref: examples/UnclaimedDraftEditAndResendExample.php + - + lang: 'C#' + label: 'C#' + source: + $ref: examples/UnclaimedDraftEditAndResendExample.cs + - + lang: TypeScript + label: TypeScript + source: + $ref: examples/UnclaimedDraftEditAndResendExample.ts + - + lang: Java + label: Java + source: + $ref: examples/UnclaimedDraftEditAndResendExample.java + - + lang: Ruby + label: Ruby + source: + $ref: examples/UnclaimedDraftEditAndResendExample.rb + - + lang: Python + label: Python + source: + $ref: examples/UnclaimedDraftEditAndResendExample.py + - + lang: cURL + label: cURL + source: + $ref: examples/UnclaimedDraftEditAndResendExample.sh + x-meta: + seo: + title: 'Edit and Resend Unclaimed Draft | Dropbox Sign for Developers' + description: 'The Dropbox Sign API easily allows you to build custom integrations. To find out how to create a new signature request from an embedded request, click here.' +components: + schemas: + AccountCreateRequest: + required: + - email_address + properties: + client_id: + description: |- + Used when creating a new account with OAuth authorization. + + See [OAuth 2.0 Authorization](https://app.hellosign.com/api/oauthWalkthrough#OAuthAuthorization) + type: string + client_secret: + description: |- + Used when creating a new account with OAuth authorization. + + See [OAuth 2.0 Authorization](https://app.hellosign.com/api/oauthWalkthrough#OAuthAuthorization) + type: string + email_address: + description: 'The email address which will be associated with the new Account.' + type: string + format: email + locale: + description: 'The locale used in this Account. Check out the list of [supported locales](/api/reference/constants/#supported-locales) to learn more about the possible values.' + type: string + type: object + AccountUpdateRequest: + properties: + account_id: + description: 'The ID of the Account' + type: string + nullable: true + callback_url: + description: 'The URL that Dropbox Sign should POST events to.' + type: string + locale: + description: 'The locale used in this Account. Check out the list of [supported locales](/api/reference/constants/#supported-locales) to learn more about the possible values.' + type: string + type: object + AccountVerifyRequest: + required: + - email_address + properties: + email_address: + description: 'Email address to run the verification for.' + type: string + format: email + type: object + ApiAppCreateRequest: + required: - name - domains properties: @@ -7757,7 +7888,7 @@ components: - number properties: number: - description: 'The Fax Line number.' + description: 'The Fax Line number' type: string account_id: description: 'Account ID' @@ -7850,20 +7981,20 @@ components: - country properties: area_code: - description: 'Area code' + description: 'Area code of the new Fax Line' type: integer country: - description: Country + description: 'Country of the area code' type: string enum: - CA - US - UK city: - description: City + description: 'City of the area code' type: string account_id: - description: 'Account ID' + description: 'Account ID of the account that will be assigned this new Fax Line' type: string example: ab55cd14a97219e36b5ff5fe23f2f9329b0c1e97 type: object @@ -7872,7 +8003,7 @@ components: - number properties: number: - description: 'The Fax Line number.' + description: 'The Fax Line number' type: string type: object FaxLineRemoveUserRequest: @@ -7880,14 +8011,14 @@ components: - number properties: number: - description: 'The Fax Line number.' + description: 'The Fax Line number' type: string account_id: - description: 'Account ID' + description: 'Account ID of the user to remove access' type: string example: ab55cd14a97219e36b5ff5fe23f2f9329b0c1e97 email_address: - description: 'Email address' + description: 'Email address of the user to remove access' type: string format: email type: object @@ -7896,7 +8027,9 @@ components: - recipient properties: recipient: - description: 'Fax Send To Recipient' + description: |- + Recipient of the fax + Can be a phone number in E.164 format or email address type: string example: recipient@example.com sender: @@ -7904,13 +8037,19 @@ components: type: string example: sender@example.com files: - description: 'Fax File to Send' + description: |- + Use `files[]` to indicate the uploaded file(s) to fax + + This endpoint requires either **files** or **file_urls[]**, but not both. type: array items: type: string format: binary file_urls: - description: 'Fax File URL to Send' + description: |- + Use `file_urls[]` to have Dropbox Fax download the file(s) to fax + + This endpoint requires either **files** or **file_urls[]**, but not both. type: array items: type: string @@ -7919,11 +8058,11 @@ components: type: boolean default: false cover_page_to: - description: 'Fax Cover Page for Recipient' + description: 'Fax cover page recipient information' type: string example: 'Recipient Name' cover_page_from: - description: 'Fax Cover Page for Sender' + description: 'Fax cover page sender information' type: string example: 'Sender Name' cover_page_message: @@ -8119,27 +8258,361 @@ components: Example CSV: - ``` - name, email_address, pin, company_field - George, george@example.com, d79a3td, ABC Corp - Mary, mary@example.com, gd9as5b, 123 LLC - ``` - type: string - format: binary - signer_list: - description: '`signer_list` is an array defining values and options for signer fields. Required unless a `signer_file` is used, you may not use both.' + ``` + name, email_address, pin, company_field + George, george@example.com, d79a3td, ABC Corp + Mary, mary@example.com, gd9as5b, 123 LLC + ``` + type: string + format: binary + signer_list: + description: '`signer_list` is an array defining values and options for signer fields. Required unless a `signer_file` is used, you may not use both.' + type: array + items: + $ref: '#/components/schemas/SubBulkSignerList' + allow_decline: + description: 'Allows signers to decline to sign a document if `true`. Defaults to `false`.' + type: boolean + default: false + ccs: + description: 'Add CC email recipients. Required when a CC role exists for the Template.' + type: array + items: + $ref: '#/components/schemas/SubCC' + client_id: + description: 'The client id of the API App you want to associate with this request. Used to apply the branding and callback url defined for the app.' + type: string + custom_fields: + description: |- + When used together with merge fields, `custom_fields` allows users to add pre-filled data to their signature requests. + + Pre-filled data can be used with "send-once" signature requests by adding merge fields with `form_fields_per_document` or [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) while passing values back with `custom_fields` together in one API call. + + For using pre-filled on repeatable signature requests, merge fields are added to templates in the Dropbox Sign UI or by calling [/template/create_embedded_draft](/api/reference/operation/templateCreateEmbeddedDraft) and then passing `custom_fields` on subsequent signature requests referencing that template. + type: array + items: + $ref: '#/components/schemas/SubCustomField' + message: + description: 'The custom message in the email that will be sent to the signers.' + type: string + maxLength: 5000 + metadata: + description: |- + Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. + + Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. + type: object + maxItems: 10 + additionalProperties: {} + signing_redirect_url: + description: 'The URL you want signers redirected to after they successfully sign.' + type: string + subject: + description: 'The subject in the email that will be sent to the signers.' + type: string + maxLength: 255 + test_mode: + description: 'Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`.' + type: boolean + default: false + title: + description: 'The title you want to assign to the SignatureRequest.' + type: string + maxLength: 255 + type: object + SignatureRequestCreateEmbeddedRequest: + required: + - client_id + properties: + files: + description: |- + Use `files[]` to indicate the uploaded file(s) to send for signature. + + This endpoint requires either **files** or **file_urls[]**, but not both. + type: array + items: + type: string + format: binary + file_urls: + description: |- + Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. + + This endpoint requires either **files** or **file_urls[]**, but not both. + type: array + items: + type: string + signers: + description: |- + Add Signers to your Signature Request. + + This endpoint requires either **signers** or **grouped_signers**, but not both. + type: array + items: + $ref: '#/components/schemas/SubSignatureRequestSigner' + grouped_signers: + description: |- + Add Grouped Signers to your Signature Request. + + This endpoint requires either **signers** or **grouped_signers**, but not both. + type: array + items: + $ref: '#/components/schemas/SubSignatureRequestGroupedSigners' + allow_decline: + description: 'Allows signers to decline to sign a document if `true`. Defaults to `false`.' + type: boolean + default: false + allow_reassign: + description: |- + Allows signers to reassign their signature requests to other signers if set to `true`. Defaults to `false`. + + **NOTE:** Only available for Premium plan. + type: boolean + default: false + attachments: + description: 'A list describing the attachments' + type: array + items: + $ref: '#/components/schemas/SubAttachment' + cc_email_addresses: + description: 'The email addresses that should be CCed.' + type: array + items: + type: string + format: email + client_id: + description: 'Client id of the app you''re using to create this embedded signature request. Used for security purposes.' + type: string + custom_fields: + description: |- + When used together with merge fields, `custom_fields` allows users to add pre-filled data to their signature requests. + + Pre-filled data can be used with "send-once" signature requests by adding merge fields with `form_fields_per_document` or [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) while passing values back with `custom_fields` together in one API call. + + For using pre-filled on repeatable signature requests, merge fields are added to templates in the Dropbox Sign UI or by calling [/template/create_embedded_draft](/api/reference/operation/templateCreateEmbeddedDraft) and then passing `custom_fields` on subsequent signature requests referencing that template. + type: array + items: + $ref: '#/components/schemas/SubCustomField' + field_options: + $ref: '#/components/schemas/SubFieldOptions' + form_field_groups: + description: 'Group information for fields defined in `form_fields_per_document`. String-indexed JSON array with `group_label` and `requirement` keys. `form_fields_per_document` must contain fields referencing a group defined in `form_field_groups`.' + type: array + items: + $ref: '#/components/schemas/SubFormFieldGroup' + form_field_rules: + description: 'Conditional Logic rules for fields defined in `form_fields_per_document`.' + type: array + items: + $ref: '#/components/schemas/SubFormFieldRule' + form_fields_per_document: + description: |- + The fields that should appear on the document, expressed as an array of objects. (For more details you can read about it here: [Using Form Fields per Document](/docs/openapi/form-fields-per-document).) + + **NOTE:** Fields like **text**, **dropdown**, **checkbox**, **radio**, and **hyperlink** have additional required and optional parameters. Check out the list of [additional parameters](/api/reference/constants/#form-fields-per-document) for these field types. + + * Text Field use `SubFormFieldsPerDocumentText` + * Dropdown Field use `SubFormFieldsPerDocumentDropdown` + * Hyperlink Field use `SubFormFieldsPerDocumentHyperlink` + * Checkbox Field use `SubFormFieldsPerDocumentCheckbox` + * Radio Field use `SubFormFieldsPerDocumentRadio` + * Signature Field use `SubFormFieldsPerDocumentSignature` + * Date Signed Field use `SubFormFieldsPerDocumentDateSigned` + * Initials Field use `SubFormFieldsPerDocumentInitials` + * Text Merge Field use `SubFormFieldsPerDocumentTextMerge` + * Checkbox Merge Field use `SubFormFieldsPerDocumentCheckboxMerge` + type: array + items: + $ref: '#/components/schemas/SubFormFieldsPerDocumentBase' + hide_text_tags: + description: |- + Enables automatic Text Tag removal when set to true. + + **NOTE:** Removing text tags this way can cause unwanted clipping. We recommend leaving this setting on `false` and instead hiding your text tags using white text or a similar approach. See the [Text Tags Walkthrough](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) for more information. + type: boolean + default: false + message: + description: 'The custom message in the email that will be sent to the signers.' + type: string + maxLength: 5000 + metadata: + description: |- + Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. + + Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. + type: object + maxItems: 10 + additionalProperties: {} + signing_options: + $ref: '#/components/schemas/SubSigningOptions' + subject: + description: 'The subject in the email that will be sent to the signers.' + type: string + maxLength: 255 + test_mode: + description: 'Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`.' + type: boolean + default: false + title: + description: 'The title you want to assign to the SignatureRequest.' + type: string + maxLength: 255 + use_text_tags: + description: 'Send with a value of `true` if you wish to enable [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) parsing in your document. Defaults to disabled, or `false`.' + type: boolean + default: false + populate_auto_fill_fields: + description: |- + Controls whether [auto fill fields](https://faq.hellosign.com/hc/en-us/articles/360051467511-Auto-Fill-Fields) can automatically populate a signer's information during signing. + + **NOTE:** Keep your signer's information safe by ensuring that the _signer on your signature request is the intended party_ before using this feature. + type: boolean + default: false + expires_at: + description: 'When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details.' + type: integer + nullable: true + type: object + SignatureRequestCreateEmbeddedWithTemplateRequest: + required: + - client_id + - template_ids + - signers + properties: + template_ids: + description: 'Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the template will be used.' + type: array + items: + type: string + allow_decline: + description: 'Allows signers to decline to sign a document if `true`. Defaults to `false`.' + type: boolean + default: false + ccs: + description: 'Add CC email recipients. Required when a CC role exists for the Template.' + type: array + items: + $ref: '#/components/schemas/SubCC' + client_id: + description: 'Client id of the app you''re using to create this embedded signature request. Used for security purposes.' + type: string + custom_fields: + description: 'An array defining values and options for custom fields. Required when a custom field exists in the Template.' + type: array + items: + $ref: '#/components/schemas/SubCustomField' + files: + description: |- + Use `files[]` to indicate the uploaded file(s) to send for signature. + + This endpoint requires either **files** or **file_urls[]**, but not both. + type: array + items: + type: string + format: binary + file_urls: + description: |- + Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. + + This endpoint requires either **files** or **file_urls[]**, but not both. + type: array + items: + type: string + message: + description: 'The custom message in the email that will be sent to the signers.' + type: string + maxLength: 5000 + metadata: + description: |- + Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. + + Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. + type: object + maxItems: 10 + additionalProperties: {} + signers: + description: 'Add Signers to your Templated-based Signature Request.' + type: array + items: + $ref: '#/components/schemas/SubSignatureRequestTemplateSigner' + signing_options: + $ref: '#/components/schemas/SubSigningOptions' + subject: + description: 'The subject in the email that will be sent to the signers.' + type: string + maxLength: 255 + test_mode: + description: 'Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`.' + type: boolean + default: false + title: + description: 'The title you want to assign to the SignatureRequest.' + type: string + maxLength: 255 + populate_auto_fill_fields: + description: |- + Controls whether [auto fill fields](https://faq.hellosign.com/hc/en-us/articles/360051467511-Auto-Fill-Fields) can automatically populate a signer's information during signing. + + **NOTE:** Keep your signer's information safe by ensuring that the _signer on your signature request is the intended party_ before using this feature. + type: boolean + default: false + type: object + SignatureRequestEditRequest: + properties: + files: + description: |- + Use `files[]` to indicate the uploaded file(s) to send for signature. + + This endpoint requires either **files** or **file_urls[]**, but not both. + type: array + items: + type: string + format: binary + file_urls: + description: |- + Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. + + This endpoint requires either **files** or **file_urls[]**, but not both. + type: array + items: + type: string + signers: + description: |- + Add Signers to your Signature Request. + + This endpoint requires either **signers** or **grouped_signers**, but not both. + type: array + items: + $ref: '#/components/schemas/SubSignatureRequestSigner' + grouped_signers: + description: |- + Add Grouped Signers to your Signature Request. + + This endpoint requires either **signers** or **grouped_signers**, but not both. type: array items: - $ref: '#/components/schemas/SubBulkSignerList' + $ref: '#/components/schemas/SubSignatureRequestGroupedSigners' allow_decline: description: 'Allows signers to decline to sign a document if `true`. Defaults to `false`.' type: boolean default: false - ccs: - description: 'Add CC email recipients. Required when a CC role exists for the Template.' + allow_reassign: + description: |- + Allows signers to reassign their signature requests to other signers if set to `true`. Defaults to `false`. + + **NOTE:** Only available for Premium plan and higher. + type: boolean + default: false + attachments: + description: 'A list describing the attachments' type: array items: - $ref: '#/components/schemas/SubCC' + $ref: '#/components/schemas/SubAttachment' + cc_email_addresses: + description: 'The email addresses that should be CCed.' + type: array + items: + type: string + format: email client_id: description: 'The client id of the API App you want to associate with this request. Used to apply the branding and callback url defined for the app.' type: string @@ -8153,6 +8626,52 @@ components: type: array items: $ref: '#/components/schemas/SubCustomField' + field_options: + $ref: '#/components/schemas/SubFieldOptions' + form_field_groups: + description: 'Group information for fields defined in `form_fields_per_document`. String-indexed JSON array with `group_label` and `requirement` keys. `form_fields_per_document` must contain fields referencing a group defined in `form_field_groups`.' + type: array + items: + $ref: '#/components/schemas/SubFormFieldGroup' + form_field_rules: + description: 'Conditional Logic rules for fields defined in `form_fields_per_document`.' + type: array + items: + $ref: '#/components/schemas/SubFormFieldRule' + form_fields_per_document: + description: |- + The fields that should appear on the document, expressed as an array of objects. (For more details you can read about it here: [Using Form Fields per Document](/docs/openapi/form-fields-per-document).) + + **NOTE:** Fields like **text**, **dropdown**, **checkbox**, **radio**, and **hyperlink** have additional required and optional parameters. Check out the list of [additional parameters](/api/reference/constants/#form-fields-per-document) for these field types. + + * Text Field use `SubFormFieldsPerDocumentText` + * Dropdown Field use `SubFormFieldsPerDocumentDropdown` + * Hyperlink Field use `SubFormFieldsPerDocumentHyperlink` + * Checkbox Field use `SubFormFieldsPerDocumentCheckbox` + * Radio Field use `SubFormFieldsPerDocumentRadio` + * Signature Field use `SubFormFieldsPerDocumentSignature` + * Date Signed Field use `SubFormFieldsPerDocumentDateSigned` + * Initials Field use `SubFormFieldsPerDocumentInitials` + * Text Merge Field use `SubFormFieldsPerDocumentTextMerge` + * Checkbox Merge Field use `SubFormFieldsPerDocumentCheckboxMerge` + type: array + items: + $ref: '#/components/schemas/SubFormFieldsPerDocumentBase' + hide_text_tags: + description: |- + Enables automatic Text Tag removal when set to true. + + **NOTE:** Removing text tags this way can cause unwanted clipping. We recommend leaving this setting on `false` and instead hiding your text tags using white text or a similar approach. See the [Text Tags Walkthrough](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) for more information. + type: boolean + default: false + is_eid: + description: |- + Send with a value of `true` if you wish to enable + [electronic identification (eID)](https://www.hellosign.com/features/electronic-id), + which requires the signer to verify their identity with an eID provider to sign a document.
+ **NOTE:** eID is only available on the Premium API plan. Cannot be used in `test_mode`. Only works on requests with one signer. + type: boolean + default: false message: description: 'The custom message in the email that will be sent to the signers.' type: string @@ -8165,6 +8684,8 @@ components: type: object maxItems: 10 additionalProperties: {} + signing_options: + $ref: '#/components/schemas/SubSigningOptions' signing_redirect_url: description: 'The URL you want signers redirected to after they successfully sign.' type: string @@ -8180,8 +8701,16 @@ components: description: 'The title you want to assign to the SignatureRequest.' type: string maxLength: 255 + use_text_tags: + description: 'Send with a value of `true` if you wish to enable [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) parsing in your document. Defaults to disabled, or `false`.' + type: boolean + default: false + expires_at: + description: 'When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details.' + type: integer + nullable: true type: object - SignatureRequestCreateEmbeddedRequest: + SignatureRequestEditEmbeddedRequest: required: - client_id properties: @@ -8333,7 +8862,7 @@ components: type: integer nullable: true type: object - SignatureRequestCreateEmbeddedWithTemplateRequest: + SignatureRequestEditEmbeddedWithTemplateRequest: required: - client_id - template_ids @@ -8417,6 +8946,94 @@ components: type: boolean default: false type: object + SignatureRequestEditWithTemplateRequest: + description: '' + required: + - signers + - template_ids + properties: + template_ids: + description: 'Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the template will be used.' + type: array + items: + type: string + allow_decline: + description: 'Allows signers to decline to sign a document if `true`. Defaults to `false`.' + type: boolean + default: false + ccs: + description: 'Add CC email recipients. Required when a CC role exists for the Template.' + type: array + items: + $ref: '#/components/schemas/SubCC' + client_id: + description: 'Client id of the app to associate with the signature request. Used to apply the branding and callback url defined for the app.' + type: string + custom_fields: + description: 'An array defining values and options for custom fields. Required when a custom field exists in the Template.' + type: array + items: + $ref: '#/components/schemas/SubCustomField' + files: + description: |- + Use `files[]` to indicate the uploaded file(s) to send for signature. + + This endpoint requires either **files** or **file_urls[]**, but not both. + type: array + items: + type: string + format: binary + file_urls: + description: |- + Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. + + This endpoint requires either **files** or **file_urls[]**, but not both. + type: array + items: + type: string + is_eid: + description: |- + Send with a value of `true` if you wish to enable + [electronic identification (eID)](https://www.hellosign.com/features/electronic-id), + which requires the signer to verify their identity with an eID provider to sign a document.
+ **NOTE:** eID is only available on the Premium API plan. Cannot be used in `test_mode`. Only works on requests with one signer. + type: boolean + default: false + message: + description: 'The custom message in the email that will be sent to the signers.' + type: string + maxLength: 5000 + metadata: + description: |- + Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. + + Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. + type: object + maxItems: 10 + additionalProperties: {} + signers: + description: 'Add Signers to your Templated-based Signature Request.' + type: array + items: + $ref: '#/components/schemas/SubSignatureRequestTemplateSigner' + signing_options: + $ref: '#/components/schemas/SubSigningOptions' + signing_redirect_url: + description: 'The URL you want signers redirected to after they successfully sign.' + type: string + subject: + description: 'The subject in the email that will be sent to the signers.' + type: string + maxLength: 255 + test_mode: + description: 'Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`.' + type: boolean + default: false + title: + description: 'The title you want to assign to the SignatureRequest.' + type: string + maxLength: 255 + type: object SignatureRequestRemindRequest: required: - email_address @@ -13085,498 +13702,522 @@ components: type: string default: 'Hello API Event Received' examples: - AccountCreateRequestDefaultExample: + AccountCreateRequest: summary: 'Default Example' value: - $ref: examples/json/AccountCreateRequestDefaultExample.json - AccountCreateRequestOAuthExample: + $ref: examples/json/AccountCreateRequest.json + AccountCreateRequestOAuth: summary: 'OAuth Example' value: - $ref: examples/json/AccountCreateRequestOAuthExample.json - AccountUpdateRequestDefaultExample: + $ref: examples/json/AccountCreateRequestOAuth.json + AccountUpdateRequest: summary: 'Default Example' value: - $ref: examples/json/AccountUpdateRequestDefaultExample.json - AccountVerifyRequestDefaultExample: + $ref: examples/json/AccountUpdateRequest.json + AccountVerifyRequest: summary: 'Default Example' value: - $ref: examples/json/AccountVerifyRequestDefaultExample.json - ApiAppCreateRequestDefaultExample: + $ref: examples/json/AccountVerifyRequest.json + ApiAppCreateRequest: summary: 'Default Example' value: - $ref: examples/json/ApiAppCreateRequestDefaultExample.json - ApiAppUpdateRequestDefaultExample: + $ref: examples/json/ApiAppCreateRequest.json + ApiAppUpdateRequest: summary: 'Default Example' value: - $ref: examples/json/ApiAppUpdateRequestDefaultExample.json - EmbeddedEditUrlRequestDefaultExample: + $ref: examples/json/ApiAppUpdateRequest.json + EmbeddedEditUrlRequest: summary: 'Default Example' value: - $ref: examples/json/EmbeddedEditUrlRequestDefaultExample.json - FaxLineAddUserRequestExample: + $ref: examples/json/EmbeddedEditUrlRequest.json + FaxLineAddUserRequest: summary: 'Default Example' value: - $ref: examples/json/FaxLineAddUserRequestExample.json - FaxLineCreateRequestExample: + $ref: examples/json/FaxLineAddUserRequest.json + FaxLineCreateRequest: summary: 'Default Example' value: - $ref: examples/json/FaxLineCreateRequestExample.json - FaxLineDeleteRequestExample: + $ref: examples/json/FaxLineCreateRequest.json + FaxLineDeleteRequest: summary: 'Default Example' value: - $ref: examples/json/FaxLineDeleteRequestExample.json - FaxLineRemoveUserRequestExample: + $ref: examples/json/FaxLineDeleteRequest.json + FaxLineRemoveUserRequest: summary: 'Default Example' value: - $ref: examples/json/FaxLineRemoveUserRequestExample.json - FaxSendRequestExample: + $ref: examples/json/FaxLineRemoveUserRequest.json + FaxSendRequest: summary: 'Default Example' value: - $ref: examples/json/FaxSendRequestExample.json - OAuthTokenGenerateRequestExample: + $ref: examples/json/FaxSendRequest.json + OAuthTokenGenerateRequest: summary: 'OAuth Token Generate Example' value: - $ref: examples/json/OAuthTokenGenerateRequestExample.json - OAuthTokenRefreshRequestExample: + $ref: examples/json/OAuthTokenGenerateRequest.json + OAuthTokenRefreshRequest: summary: 'OAuth Token Refresh Example' value: - $ref: examples/json/OAuthTokenRefreshRequestExample.json - ReportCreateRequestDefaultExample: + $ref: examples/json/OAuthTokenRefreshRequest.json + ReportCreateRequest: + summary: 'Default Example' + value: + $ref: examples/json/ReportCreateRequest.json + SignatureRequestBulkCreateEmbeddedWithTemplateRequest: + summary: 'Default Example' + value: + $ref: examples/json/SignatureRequestBulkCreateEmbeddedWithTemplateRequest.json + SignatureRequestBulkSendWithTemplateRequest: + summary: 'Default Example' + value: + $ref: examples/json/SignatureRequestBulkSendWithTemplateRequest.json + SignatureRequestCreateEmbeddedRequest: summary: 'Default Example' value: - $ref: examples/json/ReportCreateRequestDefaultExample.json - SignatureRequestBulkCreateEmbeddedWithTemplateRequestDefaultExample: + $ref: examples/json/SignatureRequestCreateEmbeddedRequest.json + SignatureRequestCreateEmbeddedRequestGroupedSigners: + summary: 'Grouped Signers Example' + value: + $ref: examples/json/SignatureRequestCreateEmbeddedRequestGroupedSigners.json + SignatureRequestCreateEmbeddedWithTemplateRequest: summary: 'Default Example' value: - $ref: examples/json/SignatureRequestBulkCreateEmbeddedWithTemplateRequestDefaultExample.json - SignatureRequestBulkSendWithTemplateRequestDefaultExample: + $ref: examples/json/SignatureRequestCreateEmbeddedWithTemplateRequest.json + SignatureRequestEditRequest: summary: 'Default Example' value: - $ref: examples/json/SignatureRequestBulkSendWithTemplateRequestDefaultExample.json - SignatureRequestCreateEmbeddedRequestDefaultExample: + $ref: examples/json/SignatureRequestEditRequest.json + SignatureRequestEditRequestGroupedSigners: + summary: 'Grouped Signers Example' + value: + $ref: examples/json/SignatureRequestEditRequestGroupedSigners.json + SignatureRequestEditEmbeddedRequest: summary: 'Default Example' value: - $ref: examples/json/SignatureRequestCreateEmbeddedRequestDefaultExample.json - SignatureRequestCreateEmbeddedRequestGroupedSignersExample: + $ref: examples/json/SignatureRequestEditEmbeddedRequest.json + SignatureRequestEditEmbeddedRequestGroupedSigners: summary: 'Grouped Signers Example' value: - $ref: examples/json/SignatureRequestCreateEmbeddedRequestGroupedSignersExample.json - SignatureRequestCreateEmbeddedWithTemplateRequestDefaultExample: + $ref: examples/json/SignatureRequestEditEmbeddedRequestGroupedSigners.json + SignatureRequestEditEmbeddedWithTemplateRequest: + summary: 'Default Example' + value: + $ref: examples/json/SignatureRequestEditEmbeddedWithTemplateRequest.json + SignatureRequestEditWithTemplateRequest: summary: 'Default Example' value: - $ref: examples/json/SignatureRequestCreateEmbeddedWithTemplateRequestDefaultExample.json - SignatureRequestRemindRequestDefaultExample: + $ref: examples/json/SignatureRequestEditWithTemplateRequest.json + SignatureRequestRemindRequest: summary: 'Default Example' value: - $ref: examples/json/SignatureRequestRemindRequestDefaultExample.json - SignatureRequestSendRequestDefaultExample: + $ref: examples/json/SignatureRequestRemindRequest.json + SignatureRequestSendRequest: summary: 'Default Example' value: - $ref: examples/json/SignatureRequestSendRequestDefaultExample.json - SignatureRequestSendRequestGroupedSignersExample: + $ref: examples/json/SignatureRequestSendRequest.json + SignatureRequestSendRequestGroupedSigners: summary: 'Grouped Signers Example' value: - $ref: examples/json/SignatureRequestSendRequestGroupedSignersExample.json - SignatureRequestSendWithTemplateRequestDefaultExample: + $ref: examples/json/SignatureRequestSendRequestGroupedSigners.json + SignatureRequestSendWithTemplateRequest: summary: 'Default Example' value: - $ref: examples/json/SignatureRequestSendWithTemplateRequestDefaultExample.json - SignatureRequestUpdateRequestDefaultExample: + $ref: examples/json/SignatureRequestSendWithTemplateRequest.json + SignatureRequestUpdateRequest: summary: 'Default Example' value: - $ref: examples/json/SignatureRequestUpdateRequestDefaultExample.json - TeamAddMemberRequestEmailAddressExample: + $ref: examples/json/SignatureRequestUpdateRequest.json + TeamAddMemberRequest: summary: 'Email Address Example' value: - $ref: examples/json/TeamAddMemberRequestEmailAddressExample.json - TeamAddMemberRequestAccountIdExample: + $ref: examples/json/TeamAddMemberRequest.json + TeamAddMemberRequestAccountId: summary: 'Account ID Example' value: - $ref: examples/json/TeamAddMemberRequestAccountIdExample.json - TeamCreateRequestDefaultExample: + $ref: examples/json/TeamAddMemberRequestAccountId.json + TeamCreateRequest: summary: 'Default Example' value: - $ref: examples/json/TeamCreateRequestDefaultExample.json - TeamRemoveMemberRequestEmailAddressExample: + $ref: examples/json/TeamCreateRequest.json + TeamRemoveMemberRequest: summary: 'Email Address Example' value: - $ref: examples/json/TeamRemoveMemberRequestEmailAddressExample.json - TeamRemoveMemberRequestAccountIdExample: + $ref: examples/json/TeamRemoveMemberRequest.json + TeamRemoveMemberRequestAccountId: summary: 'Account ID Example' value: - $ref: examples/json/TeamRemoveMemberRequestAccountIdExample.json - TeamUpdateRequestDefaultExample: + $ref: examples/json/TeamRemoveMemberRequestAccountId.json + TeamUpdateRequest: summary: 'Default Example' value: - $ref: examples/json/TeamUpdateRequestDefaultExample.json - TemplateAddUserRequestDefaultExample: + $ref: examples/json/TeamUpdateRequest.json + TemplateAddUserRequest: summary: 'Default Example' value: - $ref: examples/json/TemplateAddUserRequestDefaultExample.json - TemplateCreateRequestDefaultExample: + $ref: examples/json/TemplateAddUserRequest.json + TemplateCreateRequest: summary: 'Default Example' value: - $ref: examples/json/TemplateCreateRequestDefaultExample.json - TemplateCreateRequestFormFieldsPerDocumentExample: + $ref: examples/json/TemplateCreateRequest.json + TemplateCreateRequestFormFieldsPerDocument: summary: 'Form Fields Per Document Example' value: - $ref: examples/json/TemplateCreateRequestFormFieldsPerDocumentExample.json - TemplateCreateRequestFormFieldGroupsExample: + $ref: examples/json/TemplateCreateRequestFormFieldsPerDocument.json + TemplateCreateRequestFormFieldGroups: summary: 'Form Fields Per Document and Groups Example' value: - $ref: examples/json/TemplateCreateRequestFormFieldGroupsExample.json - TemplateCreateRequestFormFieldRulesExample: + $ref: examples/json/TemplateCreateRequestFormFieldGroups.json + TemplateCreateRequestFormFieldRules: summary: 'Form Fields Per Document and Rules Example' value: - $ref: examples/json/TemplateCreateRequestFormFieldRulesExample.json - TemplateCreateEmbeddedDraftRequestDefaultExample: + $ref: examples/json/TemplateCreateRequestFormFieldRules.json + TemplateCreateEmbeddedDraftRequest: summary: 'Default Example' value: - $ref: examples/json/TemplateCreateEmbeddedDraftRequestDefaultExample.json - TemplateCreateEmbeddedDraftRequestFormFieldsPerDocumentExample: + $ref: examples/json/TemplateCreateEmbeddedDraftRequest.json + TemplateCreateEmbeddedDraftRequestFormFieldsPerDocument: summary: 'Form Fields Per Document Example' value: - $ref: examples/json/TemplateCreateEmbeddedDraftRequestFormFieldsPerDocumentExample.json - TemplateCreateEmbeddedDraftRequestFormFieldGroupsExample: + $ref: examples/json/TemplateCreateEmbeddedDraftRequestFormFieldsPerDocument.json + TemplateCreateEmbeddedDraftRequestFormFieldGroups: summary: 'Form Fields Per Document and Groups Example' value: - $ref: examples/json/TemplateCreateEmbeddedDraftRequestFormFieldGroupsExample.json - TemplateCreateEmbeddedDraftRequestFormFieldRulesExample: + $ref: examples/json/TemplateCreateEmbeddedDraftRequestFormFieldGroups.json + TemplateCreateEmbeddedDraftRequestFormFieldRules: summary: 'Form Fields Per Document and Rules Example' value: - $ref: examples/json/TemplateCreateEmbeddedDraftRequestFormFieldRulesExample.json - TemplateRemoveUserRequestDefaultExample: + $ref: examples/json/TemplateCreateEmbeddedDraftRequestFormFieldRules.json + TemplateRemoveUserRequest: summary: 'Default Example' value: - $ref: examples/json/TemplateRemoveUserRequestDefaultExample.json - TemplateUpdateFilesRequestDefaultExample: + $ref: examples/json/TemplateRemoveUserRequest.json + TemplateUpdateFilesRequest: summary: 'Default Example' value: - $ref: examples/json/TemplateUpdateFilesRequestDefaultExample.json - UnclaimedDraftCreateRequestDefaultExample: + $ref: examples/json/TemplateUpdateFilesRequest.json + UnclaimedDraftCreateRequest: summary: 'Default Example' value: - $ref: examples/json/UnclaimedDraftCreateRequestDefaultExample.json - UnclaimedDraftCreateRequestFormFieldsPerDocumentExample: + $ref: examples/json/UnclaimedDraftCreateRequest.json + UnclaimedDraftCreateRequestFormFieldsPerDocument: summary: 'Form Fields Per Document Example' value: - $ref: examples/json/UnclaimedDraftCreateRequestFormFieldsPerDocumentExample.json - UnclaimedDraftCreateRequestFormFieldGroupsExample: + $ref: examples/json/UnclaimedDraftCreateRequestFormFieldsPerDocument.json + UnclaimedDraftCreateRequestFormFieldGroups: summary: 'Form Fields Per Document and Groups Example' value: - $ref: examples/json/UnclaimedDraftCreateRequestFormFieldGroupsExample.json - UnclaimedDraftCreateRequestFormFieldRulesExample: + $ref: examples/json/UnclaimedDraftCreateRequestFormFieldGroups.json + UnclaimedDraftCreateRequestFormFieldRules: summary: 'Form Fields Per Document and Rules Example' value: - $ref: examples/json/UnclaimedDraftCreateRequestFormFieldRulesExample.json - UnclaimedDraftCreateEmbeddedRequestDefaultExample: + $ref: examples/json/UnclaimedDraftCreateRequestFormFieldRules.json + UnclaimedDraftCreateEmbeddedRequest: summary: 'Default Example' value: - $ref: examples/json/UnclaimedDraftCreateEmbeddedRequestDefaultExample.json - UnclaimedDraftCreateEmbeddedRequestFormFieldsPerDocumentExample: + $ref: examples/json/UnclaimedDraftCreateEmbeddedRequest.json + UnclaimedDraftCreateEmbeddedRequestFormFieldsPerDocument: summary: 'Form Fields Per Document Example' value: - $ref: examples/json/UnclaimedDraftCreateEmbeddedRequestFormFieldsPerDocumentExample.json - UnclaimedDraftCreateEmbeddedRequestFormFieldGroupsExample: + $ref: examples/json/UnclaimedDraftCreateEmbeddedRequestFormFieldsPerDocument.json + UnclaimedDraftCreateEmbeddedRequestFormFieldGroups: summary: 'Form Fields Per Document and Groups Example' value: - $ref: examples/json/UnclaimedDraftCreateEmbeddedRequestFormFieldGroupsExample.json - UnclaimedDraftCreateEmbeddedRequestFormFieldRulesExample: + $ref: examples/json/UnclaimedDraftCreateEmbeddedRequestFormFieldGroups.json + UnclaimedDraftCreateEmbeddedRequestFormFieldRules: summary: 'Form Fields Per Document and Rules Example' value: - $ref: examples/json/UnclaimedDraftCreateEmbeddedRequestFormFieldRulesExample.json - UnclaimedDraftCreateEmbeddedWithTemplateRequestDefaultExample: + $ref: examples/json/UnclaimedDraftCreateEmbeddedRequestFormFieldRules.json + UnclaimedDraftCreateEmbeddedWithTemplateRequest: summary: 'Default Example' value: - $ref: examples/json/UnclaimedDraftCreateEmbeddedWithTemplateRequestDefaultExample.json - UnclaimedDraftEditAndResendRequestDefaultExample: + $ref: examples/json/UnclaimedDraftCreateEmbeddedWithTemplateRequest.json + UnclaimedDraftEditAndResendRequest: summary: 'Default Example' value: - $ref: examples/json/UnclaimedDraftEditAndResendRequestDefaultExample.json - AccountCreateResponseExample: + $ref: examples/json/UnclaimedDraftEditAndResendRequest.json + AccountCreateResponse: summary: 'Account Create' value: - $ref: examples/json/AccountCreateResponseExample.json - AccountCreateOAuthResponseExample: + $ref: examples/json/AccountCreateResponse.json + AccountCreateOAuthResponse: summary: 'Account Create with OAuth Authorization' value: - $ref: examples/json/AccountCreateOAuthResponseExample.json - AccountGetResponseExample: + $ref: examples/json/AccountCreateOAuthResponse.json + AccountGetResponse: summary: 'Account Get' value: - $ref: examples/json/AccountGetResponseExample.json - AccountVerifyFoundResponseExample: + $ref: examples/json/AccountGetResponse.json + AccountVerifyFoundResponse: summary: 'Account Found' value: - $ref: examples/json/AccountVerifyFoundResponseExample.json - AccountVerifyNotFoundResponseExample: + $ref: examples/json/AccountVerifyFoundResponse.json + AccountVerifyNotFoundResponse: summary: 'Account Not Found' value: - $ref: examples/json/AccountVerifyNotFoundResponseExample.json - ApiAppGetResponseExample: + $ref: examples/json/AccountVerifyNotFoundResponse.json + ApiAppGetResponse: summary: 'API App' value: - $ref: examples/json/ApiAppGetResponseExample.json - ApiAppListResponseExample: + $ref: examples/json/ApiAppGetResponse.json + ApiAppListResponse: summary: 'API App List' value: - $ref: examples/json/ApiAppListResponseExample.json - BulkSendJobGetResponseExample: + $ref: examples/json/ApiAppListResponse.json + BulkSendJobGetResponse: summary: 'Bulk Send Job' value: - $ref: examples/json/BulkSendJobGetResponseExample.json - BulkSendJobListResponseExample: + $ref: examples/json/BulkSendJobGetResponse.json + BulkSendJobListResponse: summary: 'Bulk Send Job List' value: - $ref: examples/json/BulkSendJobListResponseExample.json - EmbeddedEditUrlResponseExample: + $ref: examples/json/BulkSendJobListResponse.json + EmbeddedEditUrlResponse: summary: 'Embedded Edit URL' value: - $ref: examples/json/EmbeddedEditUrlResponseExample.json - EmbeddedSignUrlResponseExample: + $ref: examples/json/EmbeddedEditUrlResponse.json + EmbeddedSignUrlResponse: summary: 'Embedded Sign URL' value: - $ref: examples/json/EmbeddedSignUrlResponseExample.json - Error400ResponseExample: + $ref: examples/json/EmbeddedSignUrlResponse.json + Error400Response: summary: 'Error 400 bad_request' value: - $ref: examples/json/Error400ResponseExample.json - Error401ResponseExample: + $ref: examples/json/Error400Response.json + Error401Response: summary: 'Error 401 unauthorized' value: - $ref: examples/json/Error401ResponseExample.json - Error402ResponseExample: + $ref: examples/json/Error401Response.json + Error402Response: summary: 'Error 402 payment_required' value: - $ref: examples/json/Error402ResponseExample.json - Error403ResponseExample: + $ref: examples/json/Error402Response.json + Error403Response: summary: 'Error 403 forbidden' value: - $ref: examples/json/Error403ResponseExample.json - Error404ResponseExample: + $ref: examples/json/Error403Response.json + Error404Response: summary: 'Error 404 not_found' value: - $ref: examples/json/Error404ResponseExample.json - Error409ResponseExample: + $ref: examples/json/Error404Response.json + Error409Response: summary: 'Error 409 conflict' value: - $ref: examples/json/Error409ResponseExample.json - Error410ResponseExample: + $ref: examples/json/Error409Response.json + Error410Response: summary: 'Error 410 deleted' value: - $ref: examples/json/Error410ResponseExample.json - Error422ResponseExample: + $ref: examples/json/Error410Response.json + Error422Response: summary: 'Error 422 unprocessable_entity' value: - $ref: examples/json/Error422ResponseExample.json - Error429ResponseExample: + $ref: examples/json/Error422Response.json + Error429Response: summary: 'Error 429 exceeded_rate' value: - $ref: examples/json/Error429ResponseExample.json - Error4XXResponseExample: + $ref: examples/json/Error429Response.json + Error4XXResponse: summary: 'Error 4XX failed_operation' value: - $ref: examples/json/Error4XXResponseExample.json - FaxGetResponseExample: + $ref: examples/json/Error4XXResponse.json + FaxGetResponse: summary: 'Fax Response' value: - $ref: examples/json/FaxGetResponseExample.json - FaxLineResponseExample: + $ref: examples/json/FaxGetResponse.json + FaxLineResponse: summary: 'Sample Fax Line Response' value: - $ref: examples/json/FaxLineResponseExample.json - FaxLineAreaCodeGetResponseExample: + $ref: examples/json/FaxLineResponse.json + FaxLineAreaCodeGetResponse: summary: 'Sample Area Code Response' value: - $ref: examples/json/FaxLineAreaCodeGetResponseExample.json - FaxLineListResponseExample: + $ref: examples/json/FaxLineAreaCodeGetResponse.json + FaxLineListResponse: summary: 'Sample Fax Line List Response' value: - $ref: examples/json/FaxLineListResponseExample.json - FaxListResponseExample: - summary: 'Returns the properties and settings of multiple Faxes.' + $ref: examples/json/FaxLineListResponse.json + FaxListResponse: + summary: 'Returns the properties and settings of multiple Faxes' value: - $ref: examples/json/FaxListResponseExample.json - ReportCreateResponseExample: + $ref: examples/json/FaxListResponse.json + ReportCreateResponse: summary: Report value: - $ref: examples/json/ReportCreateResponseExample.json - SignatureRequestGetResponseExample: + $ref: examples/json/ReportCreateResponse.json + SignatureRequestGetResponse: summary: 'Get Signature Request' value: - $ref: examples/json/SignatureRequestGetResponseExample.json - SignatureRequestListResponseExample: + $ref: examples/json/SignatureRequestGetResponse.json + SignatureRequestListResponse: summary: 'List Signature Requests' value: - $ref: examples/json/SignatureRequestListResponseExample.json - AccountUpdateResponseExample: + $ref: examples/json/SignatureRequestListResponse.json + AccountUpdateResponse: summary: 'Account Update' value: - $ref: examples/json/AccountUpdateResponseExample.json - OAuthTokenGenerateResponseExample: + $ref: examples/json/AccountUpdateResponse.json + OAuthTokenGenerateResponse: summary: 'Retrieving the OAuth token' value: - $ref: examples/json/OAuthTokenGenerateResponseExample.json - OAuthTokenRefreshResponseExample: + $ref: examples/json/OAuthTokenGenerateResponse.json + OAuthTokenRefreshResponse: summary: 'Refresh an existing OAuth token' value: - $ref: examples/json/OAuthTokenRefreshResponseExample.json - ApiAppCreateResponseExample: + $ref: examples/json/OAuthTokenRefreshResponse.json + ApiAppCreateResponse: summary: 'API App' value: - $ref: examples/json/ApiAppCreateResponseExample.json - ApiAppUpdateResponseExample: + $ref: examples/json/ApiAppCreateResponse.json + ApiAppUpdateResponse: summary: 'API App Update' value: - $ref: examples/json/ApiAppUpdateResponseExample.json - SignatureRequestCreateEmbeddedResponseExample: + $ref: examples/json/ApiAppUpdateResponse.json + SignatureRequestCreateEmbeddedResponse: summary: 'Create Embedded Signature Request' value: - $ref: examples/json/SignatureRequestCreateEmbeddedResponseExample.json - SignatureRequestCreateEmbeddedWithTemplateResponseExample: + $ref: examples/json/SignatureRequestCreateEmbeddedResponse.json + SignatureRequestCreateEmbeddedWithTemplateResponse: summary: 'Create Embedded Signature Request With Template' value: - $ref: examples/json/SignatureRequestCreateEmbeddedWithTemplateResponseExample.json - SignatureRequestFilesResponseExample: + $ref: examples/json/SignatureRequestCreateEmbeddedWithTemplateResponse.json + SignatureRequestFilesResponse: summary: 'Signature Requests Files' value: - $ref: examples/json/SignatureRequestFilesResponseExample.json - SignatureRequestReleaseHoldResponseExample: + $ref: examples/json/SignatureRequestFilesResponse.json + SignatureRequestReleaseHoldResponse: summary: 'Send Signature Release Hold' value: - $ref: examples/json/SignatureRequestReleaseHoldResponseExample.json - SignatureRequestRemindResponseExample: + $ref: examples/json/SignatureRequestReleaseHoldResponse.json + SignatureRequestRemindResponse: summary: 'Send Signature Request Reminder' value: - $ref: examples/json/SignatureRequestRemindResponseExample.json - SignatureRequestSendResponseExample: + $ref: examples/json/SignatureRequestRemindResponse.json + SignatureRequestSendResponse: summary: 'Send Signature Request' value: - $ref: examples/json/SignatureRequestSendResponseExample.json - SignatureRequestSendWithTemplateResponseExample: + $ref: examples/json/SignatureRequestSendResponse.json + SignatureRequestSendWithTemplateResponse: summary: 'Send Signature Request With Template' value: - $ref: examples/json/SignatureRequestSendWithTemplateResponseExample.json - SignatureRequestUpdateResponseExample: + $ref: examples/json/SignatureRequestSendWithTemplateResponse.json + SignatureRequestUpdateResponse: summary: 'Signature Request Update' value: - $ref: examples/json/SignatureRequestUpdateResponseExample.json - SignatureRequestBulkSendWithTemplateResponseExample: + $ref: examples/json/SignatureRequestUpdateResponse.json + SignatureRequestBulkSendWithTemplateResponse: summary: 'Send Signature Request With Template' value: - $ref: examples/json/SignatureRequestBulkSendWithTemplateResponseExample.json - SignatureRequestBulkCreateEmbeddedWithTemplateResponseExample: + $ref: examples/json/SignatureRequestBulkSendWithTemplateResponse.json + SignatureRequestBulkCreateEmbeddedWithTemplateResponse: summary: 'Bulk Send Create Embedded Signature Request With Template' value: - $ref: examples/json/SignatureRequestBulkCreateEmbeddedWithTemplateResponseExample.json - TeamCreateResponseExample: + $ref: examples/json/SignatureRequestBulkCreateEmbeddedWithTemplateResponse.json + TeamCreateResponse: summary: 'Team Create' value: - $ref: examples/json/TeamCreateResponseExample.json - TeamMembersResponseExample: + $ref: examples/json/TeamCreateResponse.json + TeamMembersResponse: summary: 'Team Members List' value: - $ref: examples/json/TeamMembersResponseExample.json - TeamRemoveMemberResponseExample: + $ref: examples/json/TeamMembersResponse.json + TeamRemoveMemberResponse: summary: 'Team Remove Member' value: - $ref: examples/json/TeamRemoveMemberResponseExample.json - TeamUpdateResponseExample: + $ref: examples/json/TeamRemoveMemberResponse.json + TeamUpdateResponse: summary: 'Team Update' value: - $ref: examples/json/TeamUpdateResponseExample.json - TeamDoesNotExistResponseExample: + $ref: examples/json/TeamUpdateResponse.json + TeamDoesNotExistResponse: summary: 'Team Does Not Exist' value: - $ref: examples/json/TeamDoesNotExistResponseExample.json - TemplateAddUserResponseExample: + $ref: examples/json/TeamDoesNotExistResponse.json + TemplateAddUserResponse: summary: 'Add User to Template' value: - $ref: examples/json/TemplateAddUserResponseExample.json - TemplateFilesResponseExample: + $ref: examples/json/TemplateAddUserResponse.json + TemplateFilesResponse: summary: 'Template Files' value: - $ref: examples/json/TemplateFilesResponseExample.json - TemplateRemoveUserResponseExample: + $ref: examples/json/TemplateFilesResponse.json + TemplateRemoveUserResponse: summary: 'Remove User from Template' value: - $ref: examples/json/TemplateRemoveUserResponseExample.json - UnclaimedDraftCreateEmbeddedResponseExample: + $ref: examples/json/TemplateRemoveUserResponse.json + UnclaimedDraftCreateEmbeddedResponse: summary: 'Unclaimed Draft Create Embedded' value: - $ref: examples/json/UnclaimedDraftCreateEmbeddedResponseExample.json - UnclaimedDraftCreateEmbeddedWithTemplateResponseExample: + $ref: examples/json/UnclaimedDraftCreateEmbeddedResponse.json + UnclaimedDraftCreateEmbeddedWithTemplateResponse: summary: 'Unclaimed Draft Create Embedded With Template' value: - $ref: examples/json/UnclaimedDraftCreateEmbeddedWithTemplateResponseExample.json - UnclaimedDraftEditAndResendExample: + $ref: examples/json/UnclaimedDraftCreateEmbeddedWithTemplateResponse.json + UnclaimedDraftEditAndResend: summary: 'Unclaimed Draft Edit and Resend' value: - $ref: examples/json/UnclaimedDraftEditAndResendExample.json - TeamGetResponseExample: + $ref: examples/json/UnclaimedDraftEditAndResend.json + TeamGetResponse: summary: 'Team Get' value: - $ref: examples/json/TeamGetResponseExample.json - TeamGetInfoResponseExample: + $ref: examples/json/TeamGetResponse.json + TeamGetInfoResponse: summary: 'Team Get Info' value: - $ref: examples/json/TeamGetInfoResponseExample.json - TeamInvitesResponseExample: + $ref: examples/json/TeamGetInfoResponse.json + TeamInvitesResponse: summary: 'Team Invites' value: - $ref: examples/json/TeamInvitesResponseExample.json - TeamAddMemberResponseExample: + $ref: examples/json/TeamInvitesResponse.json + TeamAddMemberResponse: summary: 'Team Add Member' value: - $ref: examples/json/TeamAddMemberResponseExample.json - TeamSubTeamsResponseExample: + $ref: examples/json/TeamAddMemberResponse.json + TeamSubTeamsResponse: summary: 'Team Sub Teams List' value: - $ref: examples/json/TeamSubTeamsResponseExample.json - TemplateCreateResponseExample: + $ref: examples/json/TeamSubTeamsResponse.json + TemplateCreateResponse: summary: 'Create Template' value: - $ref: examples/json/TemplateCreateResponseExample.json - TemplateCreateEmbeddedDraftResponseExample: + $ref: examples/json/TemplateCreateResponse.json + TemplateCreateEmbeddedDraftResponse: summary: 'Create Embedded Draft Template' value: - $ref: examples/json/TemplateCreateEmbeddedDraftResponseExample.json - TemplateGetResponseExample: + $ref: examples/json/TemplateCreateEmbeddedDraftResponse.json + TemplateGetResponse: summary: 'Get Template' value: - $ref: examples/json/TemplateGetResponseExample.json - TemplateListResponseExample: + $ref: examples/json/TemplateGetResponse.json + TemplateListResponse: summary: 'List Templates' value: - $ref: examples/json/TemplateListResponseExample.json - TemplateUpdateFilesResponseExample: + $ref: examples/json/TemplateListResponse.json + TemplateUpdateFilesResponse: summary: 'Update Template Files' value: - $ref: examples/json/TemplateUpdateFilesResponseExample.json - UnclaimedDraftCreateResponseExample: + $ref: examples/json/TemplateUpdateFilesResponse.json + UnclaimedDraftCreateResponse: summary: 'Unclaimed Draft Create' value: - $ref: examples/json/UnclaimedDraftCreateResponseExample.json - EventCallbackAccountSignatureRequestSentExample: + $ref: examples/json/UnclaimedDraftCreateResponse.json + EventCallbackAccountSignatureRequestSent: summary: 'Example: signature_request_sent' value: - $ref: examples/json/EventCallbackAccountSignatureRequestSentExample.json - EventCallbackAccountTemplateCreatedExample: + $ref: examples/json/EventCallbackAccountSignatureRequestSent.json + EventCallbackAccountTemplateCreated: summary: 'Example: template_created' value: - $ref: examples/json/EventCallbackAccountTemplateCreatedExample.json - EventCallbackAppAccountConfirmedExample: + $ref: examples/json/EventCallbackAccountTemplateCreated.json + EventCallbackAppAccountConfirmed: summary: 'Example: account_confirmed' value: - $ref: examples/json/EventCallbackAppAccountConfirmedExample.json - EventCallbackAppSignatureRequestSentExample: + $ref: examples/json/EventCallbackAppAccountConfirmed.json + EventCallbackAppSignatureRequestSent: summary: 'Example: signature_request_sent' value: - $ref: examples/json/EventCallbackAppSignatureRequestSentExample.json - EventCallbackAppTemplateCreatedExample: + $ref: examples/json/EventCallbackAppSignatureRequestSent.json + EventCallbackAppTemplateCreated: summary: 'Example: template_created' value: - $ref: examples/json/EventCallbackAppTemplateCreatedExample.json + $ref: examples/json/EventCallbackAppTemplateCreated.json requestBodies: EventCallbackAccountRequest: description: |- @@ -13588,9 +14229,9 @@ components: $ref: '#/components/schemas/EventCallbackRequest' examples: signature_request_sent_example: - $ref: '#/components/examples/EventCallbackAccountSignatureRequestSentExample' + $ref: '#/components/examples/EventCallbackAccountSignatureRequestSent' template_created_example: - $ref: '#/components/examples/EventCallbackAccountTemplateCreatedExample' + $ref: '#/components/examples/EventCallbackAccountTemplateCreated' EventCallbackAppRequest: description: |- **API App Callback Payloads --** @@ -13601,11 +14242,11 @@ components: $ref: '#/components/schemas/EventCallbackRequest' examples: account_confirmed_example: - $ref: '#/components/examples/EventCallbackAppAccountConfirmedExample' + $ref: '#/components/examples/EventCallbackAppAccountConfirmed' signature_request_sent_example: - $ref: '#/components/examples/EventCallbackAppSignatureRequestSentExample' + $ref: '#/components/examples/EventCallbackAppSignatureRequestSent' template_created_example: - $ref: '#/components/examples/EventCallbackAppTemplateCreatedExample' + $ref: '#/components/examples/EventCallbackAppTemplateCreated' headers: X-RateLimit-Limit: description: 'The maximum number of requests per hour that you can make.' @@ -13642,6 +14283,7 @@ components: security: - api_key: [] + - oauth2: - account_access - signature_request_access @@ -13669,37 +14311,32 @@ x-webhooks: lang: PHP label: PHP source: - $ref: examples/EventCallback.php + $ref: examples/EventCallbackExample.php - lang: 'C#' label: 'C#' source: - $ref: examples/EventCallback.cs - - - lang: JavaScript - label: JavaScript - source: - $ref: examples/EventCallback.js + $ref: examples/EventCallbackExample.cs - lang: TypeScript label: TypeScript source: - $ref: examples/EventCallback.ts + $ref: examples/EventCallbackExample.ts - lang: Java label: Java source: - $ref: examples/EventCallback.java + $ref: examples/EventCallbackExample.java - lang: Ruby label: Ruby source: - $ref: examples/EventCallback.rb + $ref: examples/EventCallbackExample.rb - lang: Python label: Python source: - $ref: examples/EventCallback.py + $ref: examples/EventCallbackExample.py tags: - 'Callbacks and Events' requestBody: @@ -13722,37 +14359,32 @@ x-webhooks: lang: PHP label: PHP source: - $ref: examples/EventCallback.php + $ref: examples/EventCallbackExample.php - lang: 'C#' label: 'C#' source: - $ref: examples/EventCallback.cs - - - lang: JavaScript - label: JavaScript - source: - $ref: examples/EventCallback.js + $ref: examples/EventCallbackExample.cs - lang: TypeScript label: TypeScript source: - $ref: examples/EventCallback.ts + $ref: examples/EventCallbackExample.ts - lang: Java label: Java source: - $ref: examples/EventCallback.java + $ref: examples/EventCallbackExample.java - lang: Ruby label: Ruby source: - $ref: examples/EventCallback.rb + $ref: examples/EventCallbackExample.rb - lang: Python label: Python source: - $ref: examples/EventCallback.py + $ref: examples/EventCallbackExample.py tags: - 'Callbacks and Events' requestBody: diff --git a/run-build b/run-build index 8a2332a..d65fff5 100755 --- a/run-build +++ b/run-build @@ -1,6 +1,6 @@ #!/usr/bin/env bash -# see https://github.com/OpenAPITools/openapi-generator/tree/v7.8.0/modules/openapi-generator/src/main/resources/csharp +# see https://github.com/OpenAPITools/openapi-generator/tree/v7.12.0/modules/openapi-generator/src/main/resources/csharp set -e @@ -18,7 +18,7 @@ rm -f "${DIR}/src/Dropbox.Sign/Model/"*.cs docker run --rm \ -v "${DIR}/:/local" \ - openapitools/openapi-generator-cli:v7.8.0 generate \ + openapitools/openapi-generator-cli:v7.12.0 generate \ -i "/local/openapi-sdk.yaml" \ -c "/local/openapi-config.yaml" \ -t "/local/templates" \ @@ -46,6 +46,9 @@ docker run --rm \ -w "${WORKING_DIR}" \ perl bash ./bin/scan_for +printf "Adding old-style constant names ...\n" +bash "${DIR}/bin/php" ./bin/copy-constants.php + # avoid docker messing with permissions if [[ -z "$GITHUB_ACTIONS" ]]; then chmod 644 "${DIR}/README.md" diff --git a/src/Dropbox.Sign.Test/Dropbox.Sign.Test.csproj b/src/Dropbox.Sign.Test/Dropbox.Sign.Test.csproj index 50c2bf7..3ea5d9d 100644 --- a/src/Dropbox.Sign.Test/Dropbox.Sign.Test.csproj +++ b/src/Dropbox.Sign.Test/Dropbox.Sign.Test.csproj @@ -3,7 +3,7 @@ Dropbox.Sign.Test Dropbox.Sign.Test - net6.0 + net8.0 false Dropbox.Sign.Test diff --git a/src/Dropbox.Sign/Api/FaxApi.cs b/src/Dropbox.Sign/Api/FaxApi.cs index b9819df..096d3bf 100644 --- a/src/Dropbox.Sign/Api/FaxApi.cs +++ b/src/Dropbox.Sign/Api/FaxApi.cs @@ -31,7 +31,7 @@ public interface IFaxApiSync : IApiAccessor /// Delete Fax /// /// - /// Deletes the specified Fax from the system. + /// Deletes the specified Fax from the system /// /// Thrown when fails to make API call /// Fax ID @@ -43,7 +43,7 @@ public interface IFaxApiSync : IApiAccessor /// Delete Fax /// /// - /// Deletes the specified Fax from the system. + /// Deletes the specified Fax from the system /// /// Thrown when fails to make API call /// Fax ID @@ -51,10 +51,10 @@ public interface IFaxApiSync : IApiAccessor /// ApiResponse of Object(void) ApiResponse FaxDeleteWithHttpInfo(string faxId, int operationIndex = 0); /// - /// List Fax Files + /// Download Fax Files /// /// - /// Returns list of fax files + /// Downloads files associated with a Fax /// /// Thrown when fails to make API call /// Fax ID @@ -63,10 +63,10 @@ public interface IFaxApiSync : IApiAccessor System.IO.Stream FaxFiles(string faxId, int operationIndex = 0); /// - /// List Fax Files + /// Download Fax Files /// /// - /// Returns list of fax files + /// Downloads files associated with a Fax /// /// Thrown when fails to make API call /// Fax ID @@ -77,7 +77,7 @@ public interface IFaxApiSync : IApiAccessor /// Get Fax /// /// - /// Returns information about fax + /// Returns information about a Fax /// /// Thrown when fails to make API call /// Fax ID @@ -89,7 +89,7 @@ public interface IFaxApiSync : IApiAccessor /// Get Fax /// /// - /// Returns information about fax + /// Returns information about a Fax /// /// Thrown when fails to make API call /// Fax ID @@ -100,11 +100,11 @@ public interface IFaxApiSync : IApiAccessor /// Lists Faxes /// /// - /// Returns properties of multiple faxes + /// Returns properties of multiple Faxes /// /// Thrown when fails to make API call - /// Page (optional, default to 1) - /// Page size (optional, default to 20) + /// Which page number of the Fax List to return. Defaults to `1`. (optional, default to 1) + /// Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) /// Index associated with the operation. /// FaxListResponse FaxListResponse FaxList(int? page = default(int?), int? pageSize = default(int?), int operationIndex = 0); @@ -113,11 +113,11 @@ public interface IFaxApiSync : IApiAccessor /// Lists Faxes /// /// - /// Returns properties of multiple faxes + /// Returns properties of multiple Faxes /// /// Thrown when fails to make API call - /// Page (optional, default to 1) - /// Page size (optional, default to 20) + /// Which page number of the Fax List to return. Defaults to `1`. (optional, default to 1) + /// Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) /// Index associated with the operation. /// ApiResponse of FaxListResponse ApiResponse FaxListWithHttpInfo(int? page = default(int?), int? pageSize = default(int?), int operationIndex = 0); @@ -125,7 +125,7 @@ public interface IFaxApiSync : IApiAccessor /// Send Fax /// /// - /// Action to prepare and send a fax + /// Creates and sends a new Fax with the submitted file(s) /// /// Thrown when fails to make API call /// @@ -137,7 +137,7 @@ public interface IFaxApiSync : IApiAccessor /// Send Fax /// /// - /// Action to prepare and send a fax + /// Creates and sends a new Fax with the submitted file(s) /// /// Thrown when fails to make API call /// @@ -157,7 +157,7 @@ public interface IFaxApiAsync : IApiAccessor /// Delete Fax /// /// - /// Deletes the specified Fax from the system. + /// Deletes the specified Fax from the system /// /// Thrown when fails to make API call /// Fax ID @@ -170,7 +170,7 @@ public interface IFaxApiAsync : IApiAccessor /// Delete Fax /// /// - /// Deletes the specified Fax from the system. + /// Deletes the specified Fax from the system /// /// Thrown when fails to make API call /// Fax ID @@ -179,10 +179,10 @@ public interface IFaxApiAsync : IApiAccessor /// Task of ApiResponse System.Threading.Tasks.Task> FaxDeleteWithHttpInfoAsync(string faxId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// - /// List Fax Files + /// Download Fax Files /// /// - /// Returns list of fax files + /// Downloads files associated with a Fax /// /// Thrown when fails to make API call /// Fax ID @@ -192,10 +192,10 @@ public interface IFaxApiAsync : IApiAccessor System.Threading.Tasks.Task FaxFilesAsync(string faxId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// - /// List Fax Files + /// Download Fax Files /// /// - /// Returns list of fax files + /// Downloads files associated with a Fax /// /// Thrown when fails to make API call /// Fax ID @@ -207,7 +207,7 @@ public interface IFaxApiAsync : IApiAccessor /// Get Fax /// /// - /// Returns information about fax + /// Returns information about a Fax /// /// Thrown when fails to make API call /// Fax ID @@ -220,7 +220,7 @@ public interface IFaxApiAsync : IApiAccessor /// Get Fax /// /// - /// Returns information about fax + /// Returns information about a Fax /// /// Thrown when fails to make API call /// Fax ID @@ -232,11 +232,11 @@ public interface IFaxApiAsync : IApiAccessor /// Lists Faxes /// /// - /// Returns properties of multiple faxes + /// Returns properties of multiple Faxes /// /// Thrown when fails to make API call - /// Page (optional, default to 1) - /// Page size (optional, default to 20) + /// Which page number of the Fax List to return. Defaults to `1`. (optional, default to 1) + /// Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of FaxListResponse @@ -246,11 +246,11 @@ public interface IFaxApiAsync : IApiAccessor /// Lists Faxes /// /// - /// Returns properties of multiple faxes + /// Returns properties of multiple Faxes /// /// Thrown when fails to make API call - /// Page (optional, default to 1) - /// Page size (optional, default to 20) + /// Which page number of the Fax List to return. Defaults to `1`. (optional, default to 1) + /// Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (FaxListResponse) @@ -259,7 +259,7 @@ public interface IFaxApiAsync : IApiAccessor /// Send Fax /// /// - /// Action to prepare and send a fax + /// Creates and sends a new Fax with the submitted file(s) /// /// Thrown when fails to make API call /// @@ -272,7 +272,7 @@ public interface IFaxApiAsync : IApiAccessor /// Send Fax /// /// - /// Action to prepare and send a fax + /// Creates and sends a new Fax with the submitted file(s) /// /// Thrown when fails to make API call /// @@ -401,7 +401,7 @@ public Dropbox.Sign.Client.ExceptionFactory ExceptionFactory } /// - /// Delete Fax Deletes the specified Fax from the system. + /// Delete Fax Deletes the specified Fax from the system /// /// Thrown when fails to make API call /// Fax ID @@ -413,7 +413,7 @@ public void FaxDelete(string faxId, int operationIndex = 0) } /// - /// Delete Fax Deletes the specified Fax from the system. + /// Delete Fax Deletes the specified Fax from the system /// /// Thrown when fails to make API call /// Fax ID @@ -476,7 +476,7 @@ public Dropbox.Sign.Client.ApiResponse FaxDeleteWithHttpInfo(string faxI } /// - /// Delete Fax Deletes the specified Fax from the system. + /// Delete Fax Deletes the specified Fax from the system /// /// Thrown when fails to make API call /// Fax ID @@ -489,7 +489,7 @@ public Dropbox.Sign.Client.ApiResponse FaxDeleteWithHttpInfo(string faxI } /// - /// Delete Fax Deletes the specified Fax from the system. + /// Delete Fax Deletes the specified Fax from the system /// /// Thrown when fails to make API call /// Fax ID @@ -555,7 +555,7 @@ public Dropbox.Sign.Client.ApiResponse FaxDeleteWithHttpInfo(string faxI } /// - /// List Fax Files Returns list of fax files + /// Download Fax Files Downloads files associated with a Fax /// /// Thrown when fails to make API call /// Fax ID @@ -568,7 +568,7 @@ public System.IO.Stream FaxFiles(string faxId, int operationIndex = 0) } /// - /// List Fax Files Returns list of fax files + /// Download Fax Files Downloads files associated with a Fax /// /// Thrown when fails to make API call /// Fax ID @@ -632,7 +632,7 @@ public System.IO.Stream FaxFiles(string faxId, int operationIndex = 0) } /// - /// List Fax Files Returns list of fax files + /// Download Fax Files Downloads files associated with a Fax /// /// Thrown when fails to make API call /// Fax ID @@ -646,7 +646,7 @@ public System.IO.Stream FaxFiles(string faxId, int operationIndex = 0) } /// - /// List Fax Files Returns list of fax files + /// Download Fax Files Downloads files associated with a Fax /// /// Thrown when fails to make API call /// Fax ID @@ -713,7 +713,7 @@ public System.IO.Stream FaxFiles(string faxId, int operationIndex = 0) } /// - /// Get Fax Returns information about fax + /// Get Fax Returns information about a Fax /// /// Thrown when fails to make API call /// Fax ID @@ -726,7 +726,7 @@ public FaxGetResponse FaxGet(string faxId, int operationIndex = 0) } /// - /// Get Fax Returns information about fax + /// Get Fax Returns information about a Fax /// /// Thrown when fails to make API call /// Fax ID @@ -789,7 +789,7 @@ public Dropbox.Sign.Client.ApiResponse FaxGetWithHttpInfo(string } /// - /// Get Fax Returns information about fax + /// Get Fax Returns information about a Fax /// /// Thrown when fails to make API call /// Fax ID @@ -803,7 +803,7 @@ public Dropbox.Sign.Client.ApiResponse FaxGetWithHttpInfo(string } /// - /// Get Fax Returns information about fax + /// Get Fax Returns information about a Fax /// /// Thrown when fails to make API call /// Fax ID @@ -869,11 +869,11 @@ public Dropbox.Sign.Client.ApiResponse FaxGetWithHttpInfo(string } /// - /// Lists Faxes Returns properties of multiple faxes + /// Lists Faxes Returns properties of multiple Faxes /// /// Thrown when fails to make API call - /// Page (optional, default to 1) - /// Page size (optional, default to 20) + /// Which page number of the Fax List to return. Defaults to `1`. (optional, default to 1) + /// Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) /// Index associated with the operation. /// FaxListResponse public FaxListResponse FaxList(int? page = default(int?), int? pageSize = default(int?), int operationIndex = 0) @@ -883,11 +883,11 @@ public Dropbox.Sign.Client.ApiResponse FaxGetWithHttpInfo(string } /// - /// Lists Faxes Returns properties of multiple faxes + /// Lists Faxes Returns properties of multiple Faxes /// /// Thrown when fails to make API call - /// Page (optional, default to 1) - /// Page size (optional, default to 20) + /// Which page number of the Fax List to return. Defaults to `1`. (optional, default to 1) + /// Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) /// Index associated with the operation. /// ApiResponse of FaxListResponse public Dropbox.Sign.Client.ApiResponse FaxListWithHttpInfo(int? page = default(int?), int? pageSize = default(int?), int operationIndex = 0) @@ -948,11 +948,11 @@ public Dropbox.Sign.Client.ApiResponse FaxGetWithHttpInfo(string } /// - /// Lists Faxes Returns properties of multiple faxes + /// Lists Faxes Returns properties of multiple Faxes /// /// Thrown when fails to make API call - /// Page (optional, default to 1) - /// Page size (optional, default to 20) + /// Which page number of the Fax List to return. Defaults to `1`. (optional, default to 1) + /// Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of FaxListResponse @@ -963,11 +963,11 @@ public Dropbox.Sign.Client.ApiResponse FaxGetWithHttpInfo(string } /// - /// Lists Faxes Returns properties of multiple faxes + /// Lists Faxes Returns properties of multiple Faxes /// /// Thrown when fails to make API call - /// Page (optional, default to 1) - /// Page size (optional, default to 20) + /// Which page number of the Fax List to return. Defaults to `1`. (optional, default to 1) + /// Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (FaxListResponse) @@ -1031,7 +1031,7 @@ public Dropbox.Sign.Client.ApiResponse FaxGetWithHttpInfo(string } /// - /// Send Fax Action to prepare and send a fax + /// Send Fax Creates and sends a new Fax with the submitted file(s) /// /// Thrown when fails to make API call /// @@ -1044,7 +1044,7 @@ public FaxGetResponse FaxSend(FaxSendRequest faxSendRequest, int operationIndex } /// - /// Send Fax Action to prepare and send a fax + /// Send Fax Creates and sends a new Fax with the submitted file(s) /// /// Thrown when fails to make API call /// @@ -1115,7 +1115,7 @@ public Dropbox.Sign.Client.ApiResponse FaxSendWithHttpInfo(FaxSe } /// - /// Send Fax Action to prepare and send a fax + /// Send Fax Creates and sends a new Fax with the submitted file(s) /// /// Thrown when fails to make API call /// @@ -1129,7 +1129,7 @@ public Dropbox.Sign.Client.ApiResponse FaxSendWithHttpInfo(FaxSe } /// - /// Send Fax Action to prepare and send a fax + /// Send Fax Creates and sends a new Fax with the submitted file(s) /// /// Thrown when fails to make API call /// diff --git a/src/Dropbox.Sign/Api/FaxLineApi.cs b/src/Dropbox.Sign/Api/FaxLineApi.cs index edb0eb5..127f2e4 100644 --- a/src/Dropbox.Sign/Api/FaxLineApi.cs +++ b/src/Dropbox.Sign/Api/FaxLineApi.cs @@ -54,13 +54,13 @@ public interface IFaxLineApiSync : IApiAccessor /// Get Available Fax Line Area Codes /// /// - /// Returns a response with the area codes available for a given state/provice and city. + /// Returns a list of available area codes for a given state/province and city /// /// Thrown when fails to make API call - /// Filter area codes by country. - /// Filter area codes by state. (optional) - /// Filter area codes by province. (optional) - /// Filter area codes by city. (optional) + /// Filter area codes by country + /// Filter area codes by state (optional) + /// Filter area codes by province (optional) + /// Filter area codes by city (optional) /// Index associated with the operation. /// FaxLineAreaCodeGetResponse FaxLineAreaCodeGetResponse FaxLineAreaCodeGet(string country, string? state = default(string?), string? province = default(string?), string? city = default(string?), int operationIndex = 0); @@ -69,13 +69,13 @@ public interface IFaxLineApiSync : IApiAccessor /// Get Available Fax Line Area Codes /// /// - /// Returns a response with the area codes available for a given state/provice and city. + /// Returns a list of available area codes for a given state/province and city /// /// Thrown when fails to make API call - /// Filter area codes by country. - /// Filter area codes by state. (optional) - /// Filter area codes by province. (optional) - /// Filter area codes by city. (optional) + /// Filter area codes by country + /// Filter area codes by state (optional) + /// Filter area codes by province (optional) + /// Filter area codes by city (optional) /// Index associated with the operation. /// ApiResponse of FaxLineAreaCodeGetResponse ApiResponse FaxLineAreaCodeGetWithHttpInfo(string country, string? state = default(string?), string? province = default(string?), string? city = default(string?), int operationIndex = 0); @@ -83,7 +83,7 @@ public interface IFaxLineApiSync : IApiAccessor /// Purchase Fax Line /// /// - /// Purchases a new Fax Line. + /// Purchases a new Fax Line /// /// Thrown when fails to make API call /// @@ -95,7 +95,7 @@ public interface IFaxLineApiSync : IApiAccessor /// Purchase Fax Line /// /// - /// Purchases a new Fax Line. + /// Purchases a new Fax Line /// /// Thrown when fails to make API call /// @@ -132,7 +132,7 @@ public interface IFaxLineApiSync : IApiAccessor /// Returns the properties and settings of a Fax Line. /// /// Thrown when fails to make API call - /// The Fax Line number. + /// The Fax Line number /// Index associated with the operation. /// FaxLineResponse FaxLineResponse FaxLineGet(string number, int operationIndex = 0); @@ -144,7 +144,7 @@ public interface IFaxLineApiSync : IApiAccessor /// Returns the properties and settings of a Fax Line. /// /// Thrown when fails to make API call - /// The Fax Line number. + /// The Fax Line number /// Index associated with the operation. /// ApiResponse of FaxLineResponse ApiResponse FaxLineGetWithHttpInfo(string number, int operationIndex = 0); @@ -156,9 +156,9 @@ public interface IFaxLineApiSync : IApiAccessor /// /// Thrown when fails to make API call /// Account ID (optional) - /// Page (optional, default to 1) - /// Page size (optional, default to 20) - /// Show team lines (optional) + /// Which page number of the Fax Line List to return. Defaults to `1`. (optional, default to 1) + /// Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) + /// Include Fax Lines belonging to team members in the list (optional) /// Index associated with the operation. /// FaxLineListResponse FaxLineListResponse FaxLineList(string? accountId = default(string?), int? page = default(int?), int? pageSize = default(int?), bool? showTeamLines = default(bool?), int operationIndex = 0); @@ -171,9 +171,9 @@ public interface IFaxLineApiSync : IApiAccessor /// /// Thrown when fails to make API call /// Account ID (optional) - /// Page (optional, default to 1) - /// Page size (optional, default to 20) - /// Show team lines (optional) + /// Which page number of the Fax Line List to return. Defaults to `1`. (optional, default to 1) + /// Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) + /// Include Fax Lines belonging to team members in the list (optional) /// Index associated with the operation. /// ApiResponse of FaxLineListResponse ApiResponse FaxLineListWithHttpInfo(string? accountId = default(string?), int? page = default(int?), int? pageSize = default(int?), bool? showTeamLines = default(bool?), int operationIndex = 0); @@ -181,7 +181,7 @@ public interface IFaxLineApiSync : IApiAccessor /// Remove Fax Line Access /// /// - /// Removes a user's access to the specified Fax Line. + /// Removes a user's access to the specified Fax Line /// /// Thrown when fails to make API call /// @@ -193,7 +193,7 @@ public interface IFaxLineApiSync : IApiAccessor /// Remove Fax Line Access /// /// - /// Removes a user's access to the specified Fax Line. + /// Removes a user's access to the specified Fax Line /// /// Thrown when fails to make API call /// @@ -238,13 +238,13 @@ public interface IFaxLineApiAsync : IApiAccessor /// Get Available Fax Line Area Codes /// /// - /// Returns a response with the area codes available for a given state/provice and city. + /// Returns a list of available area codes for a given state/province and city /// /// Thrown when fails to make API call - /// Filter area codes by country. - /// Filter area codes by state. (optional) - /// Filter area codes by province. (optional) - /// Filter area codes by city. (optional) + /// Filter area codes by country + /// Filter area codes by state (optional) + /// Filter area codes by province (optional) + /// Filter area codes by city (optional) /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of FaxLineAreaCodeGetResponse @@ -254,13 +254,13 @@ public interface IFaxLineApiAsync : IApiAccessor /// Get Available Fax Line Area Codes /// /// - /// Returns a response with the area codes available for a given state/provice and city. + /// Returns a list of available area codes for a given state/province and city /// /// Thrown when fails to make API call - /// Filter area codes by country. - /// Filter area codes by state. (optional) - /// Filter area codes by province. (optional) - /// Filter area codes by city. (optional) + /// Filter area codes by country + /// Filter area codes by state (optional) + /// Filter area codes by province (optional) + /// Filter area codes by city (optional) /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (FaxLineAreaCodeGetResponse) @@ -269,7 +269,7 @@ public interface IFaxLineApiAsync : IApiAccessor /// Purchase Fax Line /// /// - /// Purchases a new Fax Line. + /// Purchases a new Fax Line /// /// Thrown when fails to make API call /// @@ -282,7 +282,7 @@ public interface IFaxLineApiAsync : IApiAccessor /// Purchase Fax Line /// /// - /// Purchases a new Fax Line. + /// Purchases a new Fax Line /// /// Thrown when fails to make API call /// @@ -322,7 +322,7 @@ public interface IFaxLineApiAsync : IApiAccessor /// Returns the properties and settings of a Fax Line. /// /// Thrown when fails to make API call - /// The Fax Line number. + /// The Fax Line number /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of FaxLineResponse @@ -335,7 +335,7 @@ public interface IFaxLineApiAsync : IApiAccessor /// Returns the properties and settings of a Fax Line. /// /// Thrown when fails to make API call - /// The Fax Line number. + /// The Fax Line number /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (FaxLineResponse) @@ -348,9 +348,9 @@ public interface IFaxLineApiAsync : IApiAccessor /// /// Thrown when fails to make API call /// Account ID (optional) - /// Page (optional, default to 1) - /// Page size (optional, default to 20) - /// Show team lines (optional) + /// Which page number of the Fax Line List to return. Defaults to `1`. (optional, default to 1) + /// Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) + /// Include Fax Lines belonging to team members in the list (optional) /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of FaxLineListResponse @@ -364,9 +364,9 @@ public interface IFaxLineApiAsync : IApiAccessor /// /// Thrown when fails to make API call /// Account ID (optional) - /// Page (optional, default to 1) - /// Page size (optional, default to 20) - /// Show team lines (optional) + /// Which page number of the Fax Line List to return. Defaults to `1`. (optional, default to 1) + /// Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) + /// Include Fax Lines belonging to team members in the list (optional) /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (FaxLineListResponse) @@ -375,7 +375,7 @@ public interface IFaxLineApiAsync : IApiAccessor /// Remove Fax Line Access /// /// - /// Removes a user's access to the specified Fax Line. + /// Removes a user's access to the specified Fax Line /// /// Thrown when fails to make API call /// @@ -388,7 +388,7 @@ public interface IFaxLineApiAsync : IApiAccessor /// Remove Fax Line Access /// /// - /// Removes a user's access to the specified Fax Line. + /// Removes a user's access to the specified Fax Line /// /// Thrown when fails to make API call /// @@ -689,13 +689,13 @@ public Dropbox.Sign.Client.ApiResponse FaxLineAddUserWithHttpIn } /// - /// Get Available Fax Line Area Codes Returns a response with the area codes available for a given state/provice and city. + /// Get Available Fax Line Area Codes Returns a list of available area codes for a given state/province and city /// /// Thrown when fails to make API call - /// Filter area codes by country. - /// Filter area codes by state. (optional) - /// Filter area codes by province. (optional) - /// Filter area codes by city. (optional) + /// Filter area codes by country + /// Filter area codes by state (optional) + /// Filter area codes by province (optional) + /// Filter area codes by city (optional) /// Index associated with the operation. /// FaxLineAreaCodeGetResponse public FaxLineAreaCodeGetResponse FaxLineAreaCodeGet(string country, string? state = default(string?), string? province = default(string?), string? city = default(string?), int operationIndex = 0) @@ -705,13 +705,13 @@ public Dropbox.Sign.Client.ApiResponse FaxLineAddUserWithHttpIn } /// - /// Get Available Fax Line Area Codes Returns a response with the area codes available for a given state/provice and city. + /// Get Available Fax Line Area Codes Returns a list of available area codes for a given state/province and city /// /// Thrown when fails to make API call - /// Filter area codes by country. - /// Filter area codes by state. (optional) - /// Filter area codes by province. (optional) - /// Filter area codes by city. (optional) + /// Filter area codes by country + /// Filter area codes by state (optional) + /// Filter area codes by province (optional) + /// Filter area codes by city (optional) /// Index associated with the operation. /// ApiResponse of FaxLineAreaCodeGetResponse public Dropbox.Sign.Client.ApiResponse FaxLineAreaCodeGetWithHttpInfo(string country, string? state = default(string?), string? province = default(string?), string? city = default(string?), int operationIndex = 0) @@ -783,13 +783,13 @@ public Dropbox.Sign.Client.ApiResponse FaxLineAddUserWithHttpIn } /// - /// Get Available Fax Line Area Codes Returns a response with the area codes available for a given state/provice and city. + /// Get Available Fax Line Area Codes Returns a list of available area codes for a given state/province and city /// /// Thrown when fails to make API call - /// Filter area codes by country. - /// Filter area codes by state. (optional) - /// Filter area codes by province. (optional) - /// Filter area codes by city. (optional) + /// Filter area codes by country + /// Filter area codes by state (optional) + /// Filter area codes by province (optional) + /// Filter area codes by city (optional) /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of FaxLineAreaCodeGetResponse @@ -800,13 +800,13 @@ public Dropbox.Sign.Client.ApiResponse FaxLineAddUserWithHttpIn } /// - /// Get Available Fax Line Area Codes Returns a response with the area codes available for a given state/provice and city. + /// Get Available Fax Line Area Codes Returns a list of available area codes for a given state/province and city /// /// Thrown when fails to make API call - /// Filter area codes by country. - /// Filter area codes by state. (optional) - /// Filter area codes by province. (optional) - /// Filter area codes by city. (optional) + /// Filter area codes by country + /// Filter area codes by state (optional) + /// Filter area codes by province (optional) + /// Filter area codes by city (optional) /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (FaxLineAreaCodeGetResponse) @@ -881,7 +881,7 @@ public Dropbox.Sign.Client.ApiResponse FaxLineAddUserWithHttpIn } /// - /// Purchase Fax Line Purchases a new Fax Line. + /// Purchase Fax Line Purchases a new Fax Line /// /// Thrown when fails to make API call /// @@ -894,7 +894,7 @@ public FaxLineResponse FaxLineCreate(FaxLineCreateRequest faxLineCreateRequest, } /// - /// Purchase Fax Line Purchases a new Fax Line. + /// Purchase Fax Line Purchases a new Fax Line /// /// Thrown when fails to make API call /// @@ -965,7 +965,7 @@ public Dropbox.Sign.Client.ApiResponse FaxLineCreateWithHttpInf } /// - /// Purchase Fax Line Purchases a new Fax Line. + /// Purchase Fax Line Purchases a new Fax Line /// /// Thrown when fails to make API call /// @@ -979,7 +979,7 @@ public Dropbox.Sign.Client.ApiResponse FaxLineCreateWithHttpInf } /// - /// Purchase Fax Line Purchases a new Fax Line. + /// Purchase Fax Line Purchases a new Fax Line /// /// Thrown when fails to make API call /// @@ -1226,7 +1226,7 @@ public Dropbox.Sign.Client.ApiResponse FaxLineDeleteWithHttpInfo(FaxLine /// Get Fax Line Returns the properties and settings of a Fax Line. /// /// Thrown when fails to make API call - /// The Fax Line number. + /// The Fax Line number /// Index associated with the operation. /// FaxLineResponse public FaxLineResponse FaxLineGet(string number, int operationIndex = 0) @@ -1239,7 +1239,7 @@ public FaxLineResponse FaxLineGet(string number, int operationIndex = 0) /// Get Fax Line Returns the properties and settings of a Fax Line. /// /// Thrown when fails to make API call - /// The Fax Line number. + /// The Fax Line number /// Index associated with the operation. /// ApiResponse of FaxLineResponse public Dropbox.Sign.Client.ApiResponse FaxLineGetWithHttpInfo(string number, int operationIndex = 0) @@ -1302,7 +1302,7 @@ public Dropbox.Sign.Client.ApiResponse FaxLineGetWithHttpInfo(s /// Get Fax Line Returns the properties and settings of a Fax Line. /// /// Thrown when fails to make API call - /// The Fax Line number. + /// The Fax Line number /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of FaxLineResponse @@ -1316,7 +1316,7 @@ public Dropbox.Sign.Client.ApiResponse FaxLineGetWithHttpInfo(s /// Get Fax Line Returns the properties and settings of a Fax Line. /// /// Thrown when fails to make API call - /// The Fax Line number. + /// The Fax Line number /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (FaxLineResponse) @@ -1383,9 +1383,9 @@ public Dropbox.Sign.Client.ApiResponse FaxLineGetWithHttpInfo(s /// /// Thrown when fails to make API call /// Account ID (optional) - /// Page (optional, default to 1) - /// Page size (optional, default to 20) - /// Show team lines (optional) + /// Which page number of the Fax Line List to return. Defaults to `1`. (optional, default to 1) + /// Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) + /// Include Fax Lines belonging to team members in the list (optional) /// Index associated with the operation. /// FaxLineListResponse public FaxLineListResponse FaxLineList(string? accountId = default(string?), int? page = default(int?), int? pageSize = default(int?), bool? showTeamLines = default(bool?), int operationIndex = 0) @@ -1399,9 +1399,9 @@ public Dropbox.Sign.Client.ApiResponse FaxLineGetWithHttpInfo(s /// /// Thrown when fails to make API call /// Account ID (optional) - /// Page (optional, default to 1) - /// Page size (optional, default to 20) - /// Show team lines (optional) + /// Which page number of the Fax Line List to return. Defaults to `1`. (optional, default to 1) + /// Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) + /// Include Fax Lines belonging to team members in the list (optional) /// Index associated with the operation. /// ApiResponse of FaxLineListResponse public Dropbox.Sign.Client.ApiResponse FaxLineListWithHttpInfo(string? accountId = default(string?), int? page = default(int?), int? pageSize = default(int?), bool? showTeamLines = default(bool?), int operationIndex = 0) @@ -1474,9 +1474,9 @@ public Dropbox.Sign.Client.ApiResponse FaxLineGetWithHttpInfo(s /// /// Thrown when fails to make API call /// Account ID (optional) - /// Page (optional, default to 1) - /// Page size (optional, default to 20) - /// Show team lines (optional) + /// Which page number of the Fax Line List to return. Defaults to `1`. (optional, default to 1) + /// Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) + /// Include Fax Lines belonging to team members in the list (optional) /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of FaxLineListResponse @@ -1491,9 +1491,9 @@ public Dropbox.Sign.Client.ApiResponse FaxLineGetWithHttpInfo(s /// /// Thrown when fails to make API call /// Account ID (optional) - /// Page (optional, default to 1) - /// Page size (optional, default to 20) - /// Show team lines (optional) + /// Which page number of the Fax Line List to return. Defaults to `1`. (optional, default to 1) + /// Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) + /// Include Fax Lines belonging to team members in the list (optional) /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (FaxLineListResponse) @@ -1565,7 +1565,7 @@ public Dropbox.Sign.Client.ApiResponse FaxLineGetWithHttpInfo(s } /// - /// Remove Fax Line Access Removes a user's access to the specified Fax Line. + /// Remove Fax Line Access Removes a user's access to the specified Fax Line /// /// Thrown when fails to make API call /// @@ -1578,7 +1578,7 @@ public FaxLineResponse FaxLineRemoveUser(FaxLineRemoveUserRequest faxLineRemoveU } /// - /// Remove Fax Line Access Removes a user's access to the specified Fax Line. + /// Remove Fax Line Access Removes a user's access to the specified Fax Line /// /// Thrown when fails to make API call /// @@ -1649,7 +1649,7 @@ public Dropbox.Sign.Client.ApiResponse FaxLineRemoveUserWithHtt } /// - /// Remove Fax Line Access Removes a user's access to the specified Fax Line. + /// Remove Fax Line Access Removes a user's access to the specified Fax Line /// /// Thrown when fails to make API call /// @@ -1663,7 +1663,7 @@ public Dropbox.Sign.Client.ApiResponse FaxLineRemoveUserWithHtt } /// - /// Remove Fax Line Access Removes a user's access to the specified Fax Line. + /// Remove Fax Line Access Removes a user's access to the specified Fax Line /// /// Thrown when fails to make API call /// diff --git a/src/Dropbox.Sign/Api/SignatureRequestApi.cs b/src/Dropbox.Sign/Api/SignatureRequestApi.cs index 7671b57..f286221 100644 --- a/src/Dropbox.Sign/Api/SignatureRequestApi.cs +++ b/src/Dropbox.Sign/Api/SignatureRequestApi.cs @@ -143,6 +143,106 @@ public interface ISignatureRequestApiSync : IApiAccessor /// ApiResponse of SignatureRequestGetResponse ApiResponse SignatureRequestCreateEmbeddedWithTemplateWithHttpInfo(SignatureRequestCreateEmbeddedWithTemplateRequest signatureRequestCreateEmbeddedWithTemplateRequest, int operationIndex = 0); /// + /// Edit Signature Request + /// + /// + /// Edits and sends a SignatureRequest with the submitted documents. If `form_fields_per_document` is not specified, a signature page will be affixed where all signers will be required to add their signature, signifying their agreement to all contained documents. **NOTE:** Edit and resend *will* deduct your signature request quota. + /// + /// Thrown when fails to make API call + /// The id of the SignatureRequest to edit. + /// + /// Index associated with the operation. + /// SignatureRequestGetResponse + SignatureRequestGetResponse SignatureRequestEdit(string signatureRequestId, SignatureRequestEditRequest signatureRequestEditRequest, int operationIndex = 0); + + /// + /// Edit Signature Request + /// + /// + /// Edits and sends a SignatureRequest with the submitted documents. If `form_fields_per_document` is not specified, a signature page will be affixed where all signers will be required to add their signature, signifying their agreement to all contained documents. **NOTE:** Edit and resend *will* deduct your signature request quota. + /// + /// Thrown when fails to make API call + /// The id of the SignatureRequest to edit. + /// + /// Index associated with the operation. + /// ApiResponse of SignatureRequestGetResponse + ApiResponse SignatureRequestEditWithHttpInfo(string signatureRequestId, SignatureRequestEditRequest signatureRequestEditRequest, int operationIndex = 0); + /// + /// Edit Embedded Signature Request + /// + /// + /// Edits a SignatureRequest with the submitted documents to be signed in an embedded iFrame. If form_fields_per_document is not specified, a signature page will be affixed where all signers will be required to add their signature, signifying their agreement to all contained documents. Note that embedded signature requests can only be signed in embedded iFrames whereas normal signature requests can only be signed on Dropbox Sign. **NOTE:** Edit and resend *will* deduct your signature request quota. + /// + /// Thrown when fails to make API call + /// The id of the SignatureRequest to edit. + /// + /// Index associated with the operation. + /// SignatureRequestGetResponse + SignatureRequestGetResponse SignatureRequestEditEmbedded(string signatureRequestId, SignatureRequestEditEmbeddedRequest signatureRequestEditEmbeddedRequest, int operationIndex = 0); + + /// + /// Edit Embedded Signature Request + /// + /// + /// Edits a SignatureRequest with the submitted documents to be signed in an embedded iFrame. If form_fields_per_document is not specified, a signature page will be affixed where all signers will be required to add their signature, signifying their agreement to all contained documents. Note that embedded signature requests can only be signed in embedded iFrames whereas normal signature requests can only be signed on Dropbox Sign. **NOTE:** Edit and resend *will* deduct your signature request quota. + /// + /// Thrown when fails to make API call + /// The id of the SignatureRequest to edit. + /// + /// Index associated with the operation. + /// ApiResponse of SignatureRequestGetResponse + ApiResponse SignatureRequestEditEmbeddedWithHttpInfo(string signatureRequestId, SignatureRequestEditEmbeddedRequest signatureRequestEditEmbeddedRequest, int operationIndex = 0); + /// + /// Edit Embedded Signature Request with Template + /// + /// + /// Edits a SignatureRequest based on the given Template(s) to be signed in an embedded iFrame. Note that embedded signature requests can only be signed in embedded iFrames whereas normal signature requests can only be signed on Dropbox Sign. **NOTE:** Edit and resend *will* deduct your signature request quota. + /// + /// Thrown when fails to make API call + /// The id of the SignatureRequest to edit. + /// + /// Index associated with the operation. + /// SignatureRequestGetResponse + SignatureRequestGetResponse SignatureRequestEditEmbeddedWithTemplate(string signatureRequestId, SignatureRequestEditEmbeddedWithTemplateRequest signatureRequestEditEmbeddedWithTemplateRequest, int operationIndex = 0); + + /// + /// Edit Embedded Signature Request with Template + /// + /// + /// Edits a SignatureRequest based on the given Template(s) to be signed in an embedded iFrame. Note that embedded signature requests can only be signed in embedded iFrames whereas normal signature requests can only be signed on Dropbox Sign. **NOTE:** Edit and resend *will* deduct your signature request quota. + /// + /// Thrown when fails to make API call + /// The id of the SignatureRequest to edit. + /// + /// Index associated with the operation. + /// ApiResponse of SignatureRequestGetResponse + ApiResponse SignatureRequestEditEmbeddedWithTemplateWithHttpInfo(string signatureRequestId, SignatureRequestEditEmbeddedWithTemplateRequest signatureRequestEditEmbeddedWithTemplateRequest, int operationIndex = 0); + /// + /// Edit Signature Request With Template + /// + /// + /// Edits and sends a SignatureRequest based off of the Template(s) specified with the template_ids parameter. **NOTE:** Edit and resend *will* deduct your signature request quota. + /// + /// Thrown when fails to make API call + /// The id of the SignatureRequest to edit. + /// + /// Index associated with the operation. + /// SignatureRequestGetResponse + SignatureRequestGetResponse SignatureRequestEditWithTemplate(string signatureRequestId, SignatureRequestEditWithTemplateRequest signatureRequestEditWithTemplateRequest, int operationIndex = 0); + + /// + /// Edit Signature Request With Template + /// + /// + /// Edits and sends a SignatureRequest based off of the Template(s) specified with the template_ids parameter. **NOTE:** Edit and resend *will* deduct your signature request quota. + /// + /// Thrown when fails to make API call + /// The id of the SignatureRequest to edit. + /// + /// Index associated with the operation. + /// ApiResponse of SignatureRequestGetResponse + ApiResponse SignatureRequestEditWithTemplateWithHttpInfo(string signatureRequestId, SignatureRequestEditWithTemplateRequest signatureRequestEditWithTemplateRequest, int operationIndex = 0); + /// /// Download Files /// /// @@ -544,6 +644,114 @@ public interface ISignatureRequestApiAsync : IApiAccessor /// Task of ApiResponse (SignatureRequestGetResponse) System.Threading.Tasks.Task> SignatureRequestCreateEmbeddedWithTemplateWithHttpInfoAsync(SignatureRequestCreateEmbeddedWithTemplateRequest signatureRequestCreateEmbeddedWithTemplateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// + /// Edit Signature Request + /// + /// + /// Edits and sends a SignatureRequest with the submitted documents. If `form_fields_per_document` is not specified, a signature page will be affixed where all signers will be required to add their signature, signifying their agreement to all contained documents. **NOTE:** Edit and resend *will* deduct your signature request quota. + /// + /// Thrown when fails to make API call + /// The id of the SignatureRequest to edit. + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of SignatureRequestGetResponse + System.Threading.Tasks.Task SignatureRequestEditAsync(string signatureRequestId, SignatureRequestEditRequest signatureRequestEditRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + + /// + /// Edit Signature Request + /// + /// + /// Edits and sends a SignatureRequest with the submitted documents. If `form_fields_per_document` is not specified, a signature page will be affixed where all signers will be required to add their signature, signifying their agreement to all contained documents. **NOTE:** Edit and resend *will* deduct your signature request quota. + /// + /// Thrown when fails to make API call + /// The id of the SignatureRequest to edit. + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (SignatureRequestGetResponse) + System.Threading.Tasks.Task> SignatureRequestEditWithHttpInfoAsync(string signatureRequestId, SignatureRequestEditRequest signatureRequestEditRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + /// + /// Edit Embedded Signature Request + /// + /// + /// Edits a SignatureRequest with the submitted documents to be signed in an embedded iFrame. If form_fields_per_document is not specified, a signature page will be affixed where all signers will be required to add their signature, signifying their agreement to all contained documents. Note that embedded signature requests can only be signed in embedded iFrames whereas normal signature requests can only be signed on Dropbox Sign. **NOTE:** Edit and resend *will* deduct your signature request quota. + /// + /// Thrown when fails to make API call + /// The id of the SignatureRequest to edit. + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of SignatureRequestGetResponse + System.Threading.Tasks.Task SignatureRequestEditEmbeddedAsync(string signatureRequestId, SignatureRequestEditEmbeddedRequest signatureRequestEditEmbeddedRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + + /// + /// Edit Embedded Signature Request + /// + /// + /// Edits a SignatureRequest with the submitted documents to be signed in an embedded iFrame. If form_fields_per_document is not specified, a signature page will be affixed where all signers will be required to add their signature, signifying their agreement to all contained documents. Note that embedded signature requests can only be signed in embedded iFrames whereas normal signature requests can only be signed on Dropbox Sign. **NOTE:** Edit and resend *will* deduct your signature request quota. + /// + /// Thrown when fails to make API call + /// The id of the SignatureRequest to edit. + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (SignatureRequestGetResponse) + System.Threading.Tasks.Task> SignatureRequestEditEmbeddedWithHttpInfoAsync(string signatureRequestId, SignatureRequestEditEmbeddedRequest signatureRequestEditEmbeddedRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + /// + /// Edit Embedded Signature Request with Template + /// + /// + /// Edits a SignatureRequest based on the given Template(s) to be signed in an embedded iFrame. Note that embedded signature requests can only be signed in embedded iFrames whereas normal signature requests can only be signed on Dropbox Sign. **NOTE:** Edit and resend *will* deduct your signature request quota. + /// + /// Thrown when fails to make API call + /// The id of the SignatureRequest to edit. + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of SignatureRequestGetResponse + System.Threading.Tasks.Task SignatureRequestEditEmbeddedWithTemplateAsync(string signatureRequestId, SignatureRequestEditEmbeddedWithTemplateRequest signatureRequestEditEmbeddedWithTemplateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + + /// + /// Edit Embedded Signature Request with Template + /// + /// + /// Edits a SignatureRequest based on the given Template(s) to be signed in an embedded iFrame. Note that embedded signature requests can only be signed in embedded iFrames whereas normal signature requests can only be signed on Dropbox Sign. **NOTE:** Edit and resend *will* deduct your signature request quota. + /// + /// Thrown when fails to make API call + /// The id of the SignatureRequest to edit. + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (SignatureRequestGetResponse) + System.Threading.Tasks.Task> SignatureRequestEditEmbeddedWithTemplateWithHttpInfoAsync(string signatureRequestId, SignatureRequestEditEmbeddedWithTemplateRequest signatureRequestEditEmbeddedWithTemplateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + /// + /// Edit Signature Request With Template + /// + /// + /// Edits and sends a SignatureRequest based off of the Template(s) specified with the template_ids parameter. **NOTE:** Edit and resend *will* deduct your signature request quota. + /// + /// Thrown when fails to make API call + /// The id of the SignatureRequest to edit. + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of SignatureRequestGetResponse + System.Threading.Tasks.Task SignatureRequestEditWithTemplateAsync(string signatureRequestId, SignatureRequestEditWithTemplateRequest signatureRequestEditWithTemplateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + + /// + /// Edit Signature Request With Template + /// + /// + /// Edits and sends a SignatureRequest based off of the Template(s) specified with the template_ids parameter. **NOTE:** Edit and resend *will* deduct your signature request quota. + /// + /// Thrown when fails to make API call + /// The id of the SignatureRequest to edit. + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (SignatureRequestGetResponse) + System.Threading.Tasks.Task> SignatureRequestEditWithTemplateWithHttpInfoAsync(string signatureRequestId, SignatureRequestEditWithTemplateRequest signatureRequestEditWithTemplateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + /// /// Download Files /// /// @@ -1842,6 +2050,814 @@ public Dropbox.Sign.Client.ApiResponse SignatureReq return localVarResponse; } + /// + /// Edit Signature Request Edits and sends a SignatureRequest with the submitted documents. If `form_fields_per_document` is not specified, a signature page will be affixed where all signers will be required to add their signature, signifying their agreement to all contained documents. **NOTE:** Edit and resend *will* deduct your signature request quota. + /// + /// Thrown when fails to make API call + /// The id of the SignatureRequest to edit. + /// + /// Index associated with the operation. + /// SignatureRequestGetResponse + public SignatureRequestGetResponse SignatureRequestEdit(string signatureRequestId, SignatureRequestEditRequest signatureRequestEditRequest, int operationIndex = 0) + { + Dropbox.Sign.Client.ApiResponse localVarResponse = SignatureRequestEditWithHttpInfo(signatureRequestId, signatureRequestEditRequest); + return localVarResponse.Data; + } + + /// + /// Edit Signature Request Edits and sends a SignatureRequest with the submitted documents. If `form_fields_per_document` is not specified, a signature page will be affixed where all signers will be required to add their signature, signifying their agreement to all contained documents. **NOTE:** Edit and resend *will* deduct your signature request quota. + /// + /// Thrown when fails to make API call + /// The id of the SignatureRequest to edit. + /// + /// Index associated with the operation. + /// ApiResponse of SignatureRequestGetResponse + public Dropbox.Sign.Client.ApiResponse SignatureRequestEditWithHttpInfo(string signatureRequestId, SignatureRequestEditRequest signatureRequestEditRequest, int operationIndex = 0) + { + // verify the required parameter 'signatureRequestId' is set + if (signatureRequestId == null) + { + throw new Dropbox.Sign.Client.ApiException(400, "Missing required parameter 'signatureRequestId' when calling SignatureRequestApi->SignatureRequestEdit"); + } + + // verify the required parameter 'signatureRequestEditRequest' is set + if (signatureRequestEditRequest == null) + { + throw new Dropbox.Sign.Client.ApiException(400, "Missing required parameter 'signatureRequestEditRequest' when calling SignatureRequestApi->SignatureRequestEdit"); + } + + Dropbox.Sign.Client.RequestOptions localVarRequestOptions = new Dropbox.Sign.Client.RequestOptions(); + + var localVarContentType = ""; + var openApiTypes = signatureRequestEditRequest.GetOpenApiTypes(); + if (ClientUtils.HasFileType(openApiTypes)) + { + ClientUtils.SetFormData(localVarRequestOptions, openApiTypes); + localVarContentType = "multipart/form-data"; + } + else + { + localVarContentType = "application/json"; + localVarRequestOptions.Data = signatureRequestEditRequest; + } + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Dropbox.Sign.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("signature_request_id", Dropbox.Sign.Client.ClientUtils.ParameterToString(signatureRequestId)); // path parameter + + localVarRequestOptions.Operation = "SignatureRequestApi.SignatureRequestEdit"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (api_key) required + // http basic authentication required + if (!string.IsNullOrEmpty(this.Configuration.Username) || !string.IsNullOrEmpty(this.Configuration.Password) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Basic " + Dropbox.Sign.Client.ClientUtils.Base64Encode(this.Configuration.Username + ":" + this.Configuration.Password)); + } + // authentication (oauth2) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = this.Client.Put("/signature_request/edit/{signature_request_id}", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("SignatureRequestEdit", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Edit Signature Request Edits and sends a SignatureRequest with the submitted documents. If `form_fields_per_document` is not specified, a signature page will be affixed where all signers will be required to add their signature, signifying their agreement to all contained documents. **NOTE:** Edit and resend *will* deduct your signature request quota. + /// + /// Thrown when fails to make API call + /// The id of the SignatureRequest to edit. + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of SignatureRequestGetResponse + public async System.Threading.Tasks.Task SignatureRequestEditAsync(string signatureRequestId, SignatureRequestEditRequest signatureRequestEditRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + Dropbox.Sign.Client.ApiResponse localVarResponse = await SignatureRequestEditWithHttpInfoAsync(signatureRequestId, signatureRequestEditRequest, operationIndex, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Edit Signature Request Edits and sends a SignatureRequest with the submitted documents. If `form_fields_per_document` is not specified, a signature page will be affixed where all signers will be required to add their signature, signifying their agreement to all contained documents. **NOTE:** Edit and resend *will* deduct your signature request quota. + /// + /// Thrown when fails to make API call + /// The id of the SignatureRequest to edit. + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (SignatureRequestGetResponse) + public async System.Threading.Tasks.Task> SignatureRequestEditWithHttpInfoAsync(string signatureRequestId, SignatureRequestEditRequest signatureRequestEditRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + // verify the required parameter 'signatureRequestId' is set + if (signatureRequestId == null) + { + throw new Dropbox.Sign.Client.ApiException(400, "Missing required parameter 'signatureRequestId' when calling SignatureRequestApi->SignatureRequestEdit"); + } + + // verify the required parameter 'signatureRequestEditRequest' is set + if (signatureRequestEditRequest == null) + { + throw new Dropbox.Sign.Client.ApiException(400, "Missing required parameter 'signatureRequestEditRequest' when calling SignatureRequestApi->SignatureRequestEdit"); + } + + + Dropbox.Sign.Client.RequestOptions localVarRequestOptions = new Dropbox.Sign.Client.RequestOptions(); + + var localVarContentType = ""; + var openApiTypes = signatureRequestEditRequest.GetOpenApiTypes(); + if (ClientUtils.HasFileType(openApiTypes)) + { + ClientUtils.SetFormData(localVarRequestOptions, openApiTypes); + localVarContentType = "multipart/form-data"; + } + else + { + localVarContentType = "application/json"; + localVarRequestOptions.Data = signatureRequestEditRequest; + } + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Dropbox.Sign.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("signature_request_id", Dropbox.Sign.Client.ClientUtils.ParameterToString(signatureRequestId)); // path parameter + + localVarRequestOptions.Operation = "SignatureRequestApi.SignatureRequestEdit"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (api_key) required + // http basic authentication required + if (!string.IsNullOrEmpty(this.Configuration.Username) || !string.IsNullOrEmpty(this.Configuration.Password) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Basic " + Dropbox.Sign.Client.ClientUtils.Base64Encode(this.Configuration.Username + ":" + this.Configuration.Password)); + } + // authentication (oauth2) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.PutAsync("/signature_request/edit/{signature_request_id}", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("SignatureRequestEdit", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Edit Embedded Signature Request Edits a SignatureRequest with the submitted documents to be signed in an embedded iFrame. If form_fields_per_document is not specified, a signature page will be affixed where all signers will be required to add their signature, signifying their agreement to all contained documents. Note that embedded signature requests can only be signed in embedded iFrames whereas normal signature requests can only be signed on Dropbox Sign. **NOTE:** Edit and resend *will* deduct your signature request quota. + /// + /// Thrown when fails to make API call + /// The id of the SignatureRequest to edit. + /// + /// Index associated with the operation. + /// SignatureRequestGetResponse + public SignatureRequestGetResponse SignatureRequestEditEmbedded(string signatureRequestId, SignatureRequestEditEmbeddedRequest signatureRequestEditEmbeddedRequest, int operationIndex = 0) + { + Dropbox.Sign.Client.ApiResponse localVarResponse = SignatureRequestEditEmbeddedWithHttpInfo(signatureRequestId, signatureRequestEditEmbeddedRequest); + return localVarResponse.Data; + } + + /// + /// Edit Embedded Signature Request Edits a SignatureRequest with the submitted documents to be signed in an embedded iFrame. If form_fields_per_document is not specified, a signature page will be affixed where all signers will be required to add their signature, signifying their agreement to all contained documents. Note that embedded signature requests can only be signed in embedded iFrames whereas normal signature requests can only be signed on Dropbox Sign. **NOTE:** Edit and resend *will* deduct your signature request quota. + /// + /// Thrown when fails to make API call + /// The id of the SignatureRequest to edit. + /// + /// Index associated with the operation. + /// ApiResponse of SignatureRequestGetResponse + public Dropbox.Sign.Client.ApiResponse SignatureRequestEditEmbeddedWithHttpInfo(string signatureRequestId, SignatureRequestEditEmbeddedRequest signatureRequestEditEmbeddedRequest, int operationIndex = 0) + { + // verify the required parameter 'signatureRequestId' is set + if (signatureRequestId == null) + { + throw new Dropbox.Sign.Client.ApiException(400, "Missing required parameter 'signatureRequestId' when calling SignatureRequestApi->SignatureRequestEditEmbedded"); + } + + // verify the required parameter 'signatureRequestEditEmbeddedRequest' is set + if (signatureRequestEditEmbeddedRequest == null) + { + throw new Dropbox.Sign.Client.ApiException(400, "Missing required parameter 'signatureRequestEditEmbeddedRequest' when calling SignatureRequestApi->SignatureRequestEditEmbedded"); + } + + Dropbox.Sign.Client.RequestOptions localVarRequestOptions = new Dropbox.Sign.Client.RequestOptions(); + + var localVarContentType = ""; + var openApiTypes = signatureRequestEditEmbeddedRequest.GetOpenApiTypes(); + if (ClientUtils.HasFileType(openApiTypes)) + { + ClientUtils.SetFormData(localVarRequestOptions, openApiTypes); + localVarContentType = "multipart/form-data"; + } + else + { + localVarContentType = "application/json"; + localVarRequestOptions.Data = signatureRequestEditEmbeddedRequest; + } + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Dropbox.Sign.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("signature_request_id", Dropbox.Sign.Client.ClientUtils.ParameterToString(signatureRequestId)); // path parameter + + localVarRequestOptions.Operation = "SignatureRequestApi.SignatureRequestEditEmbedded"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (api_key) required + // http basic authentication required + if (!string.IsNullOrEmpty(this.Configuration.Username) || !string.IsNullOrEmpty(this.Configuration.Password) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Basic " + Dropbox.Sign.Client.ClientUtils.Base64Encode(this.Configuration.Username + ":" + this.Configuration.Password)); + } + // authentication (oauth2) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = this.Client.Put("/signature_request/edit_embedded/{signature_request_id}", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("SignatureRequestEditEmbedded", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Edit Embedded Signature Request Edits a SignatureRequest with the submitted documents to be signed in an embedded iFrame. If form_fields_per_document is not specified, a signature page will be affixed where all signers will be required to add their signature, signifying their agreement to all contained documents. Note that embedded signature requests can only be signed in embedded iFrames whereas normal signature requests can only be signed on Dropbox Sign. **NOTE:** Edit and resend *will* deduct your signature request quota. + /// + /// Thrown when fails to make API call + /// The id of the SignatureRequest to edit. + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of SignatureRequestGetResponse + public async System.Threading.Tasks.Task SignatureRequestEditEmbeddedAsync(string signatureRequestId, SignatureRequestEditEmbeddedRequest signatureRequestEditEmbeddedRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + Dropbox.Sign.Client.ApiResponse localVarResponse = await SignatureRequestEditEmbeddedWithHttpInfoAsync(signatureRequestId, signatureRequestEditEmbeddedRequest, operationIndex, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Edit Embedded Signature Request Edits a SignatureRequest with the submitted documents to be signed in an embedded iFrame. If form_fields_per_document is not specified, a signature page will be affixed where all signers will be required to add their signature, signifying their agreement to all contained documents. Note that embedded signature requests can only be signed in embedded iFrames whereas normal signature requests can only be signed on Dropbox Sign. **NOTE:** Edit and resend *will* deduct your signature request quota. + /// + /// Thrown when fails to make API call + /// The id of the SignatureRequest to edit. + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (SignatureRequestGetResponse) + public async System.Threading.Tasks.Task> SignatureRequestEditEmbeddedWithHttpInfoAsync(string signatureRequestId, SignatureRequestEditEmbeddedRequest signatureRequestEditEmbeddedRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + // verify the required parameter 'signatureRequestId' is set + if (signatureRequestId == null) + { + throw new Dropbox.Sign.Client.ApiException(400, "Missing required parameter 'signatureRequestId' when calling SignatureRequestApi->SignatureRequestEditEmbedded"); + } + + // verify the required parameter 'signatureRequestEditEmbeddedRequest' is set + if (signatureRequestEditEmbeddedRequest == null) + { + throw new Dropbox.Sign.Client.ApiException(400, "Missing required parameter 'signatureRequestEditEmbeddedRequest' when calling SignatureRequestApi->SignatureRequestEditEmbedded"); + } + + + Dropbox.Sign.Client.RequestOptions localVarRequestOptions = new Dropbox.Sign.Client.RequestOptions(); + + var localVarContentType = ""; + var openApiTypes = signatureRequestEditEmbeddedRequest.GetOpenApiTypes(); + if (ClientUtils.HasFileType(openApiTypes)) + { + ClientUtils.SetFormData(localVarRequestOptions, openApiTypes); + localVarContentType = "multipart/form-data"; + } + else + { + localVarContentType = "application/json"; + localVarRequestOptions.Data = signatureRequestEditEmbeddedRequest; + } + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Dropbox.Sign.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("signature_request_id", Dropbox.Sign.Client.ClientUtils.ParameterToString(signatureRequestId)); // path parameter + + localVarRequestOptions.Operation = "SignatureRequestApi.SignatureRequestEditEmbedded"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (api_key) required + // http basic authentication required + if (!string.IsNullOrEmpty(this.Configuration.Username) || !string.IsNullOrEmpty(this.Configuration.Password) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Basic " + Dropbox.Sign.Client.ClientUtils.Base64Encode(this.Configuration.Username + ":" + this.Configuration.Password)); + } + // authentication (oauth2) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.PutAsync("/signature_request/edit_embedded/{signature_request_id}", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("SignatureRequestEditEmbedded", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Edit Embedded Signature Request with Template Edits a SignatureRequest based on the given Template(s) to be signed in an embedded iFrame. Note that embedded signature requests can only be signed in embedded iFrames whereas normal signature requests can only be signed on Dropbox Sign. **NOTE:** Edit and resend *will* deduct your signature request quota. + /// + /// Thrown when fails to make API call + /// The id of the SignatureRequest to edit. + /// + /// Index associated with the operation. + /// SignatureRequestGetResponse + public SignatureRequestGetResponse SignatureRequestEditEmbeddedWithTemplate(string signatureRequestId, SignatureRequestEditEmbeddedWithTemplateRequest signatureRequestEditEmbeddedWithTemplateRequest, int operationIndex = 0) + { + Dropbox.Sign.Client.ApiResponse localVarResponse = SignatureRequestEditEmbeddedWithTemplateWithHttpInfo(signatureRequestId, signatureRequestEditEmbeddedWithTemplateRequest); + return localVarResponse.Data; + } + + /// + /// Edit Embedded Signature Request with Template Edits a SignatureRequest based on the given Template(s) to be signed in an embedded iFrame. Note that embedded signature requests can only be signed in embedded iFrames whereas normal signature requests can only be signed on Dropbox Sign. **NOTE:** Edit and resend *will* deduct your signature request quota. + /// + /// Thrown when fails to make API call + /// The id of the SignatureRequest to edit. + /// + /// Index associated with the operation. + /// ApiResponse of SignatureRequestGetResponse + public Dropbox.Sign.Client.ApiResponse SignatureRequestEditEmbeddedWithTemplateWithHttpInfo(string signatureRequestId, SignatureRequestEditEmbeddedWithTemplateRequest signatureRequestEditEmbeddedWithTemplateRequest, int operationIndex = 0) + { + // verify the required parameter 'signatureRequestId' is set + if (signatureRequestId == null) + { + throw new Dropbox.Sign.Client.ApiException(400, "Missing required parameter 'signatureRequestId' when calling SignatureRequestApi->SignatureRequestEditEmbeddedWithTemplate"); + } + + // verify the required parameter 'signatureRequestEditEmbeddedWithTemplateRequest' is set + if (signatureRequestEditEmbeddedWithTemplateRequest == null) + { + throw new Dropbox.Sign.Client.ApiException(400, "Missing required parameter 'signatureRequestEditEmbeddedWithTemplateRequest' when calling SignatureRequestApi->SignatureRequestEditEmbeddedWithTemplate"); + } + + Dropbox.Sign.Client.RequestOptions localVarRequestOptions = new Dropbox.Sign.Client.RequestOptions(); + + var localVarContentType = ""; + var openApiTypes = signatureRequestEditEmbeddedWithTemplateRequest.GetOpenApiTypes(); + if (ClientUtils.HasFileType(openApiTypes)) + { + ClientUtils.SetFormData(localVarRequestOptions, openApiTypes); + localVarContentType = "multipart/form-data"; + } + else + { + localVarContentType = "application/json"; + localVarRequestOptions.Data = signatureRequestEditEmbeddedWithTemplateRequest; + } + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Dropbox.Sign.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("signature_request_id", Dropbox.Sign.Client.ClientUtils.ParameterToString(signatureRequestId)); // path parameter + + localVarRequestOptions.Operation = "SignatureRequestApi.SignatureRequestEditEmbeddedWithTemplate"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (api_key) required + // http basic authentication required + if (!string.IsNullOrEmpty(this.Configuration.Username) || !string.IsNullOrEmpty(this.Configuration.Password) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Basic " + Dropbox.Sign.Client.ClientUtils.Base64Encode(this.Configuration.Username + ":" + this.Configuration.Password)); + } + // authentication (oauth2) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = this.Client.Put("/signature_request/edit_embedded_with_template/{signature_request_id}", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("SignatureRequestEditEmbeddedWithTemplate", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Edit Embedded Signature Request with Template Edits a SignatureRequest based on the given Template(s) to be signed in an embedded iFrame. Note that embedded signature requests can only be signed in embedded iFrames whereas normal signature requests can only be signed on Dropbox Sign. **NOTE:** Edit and resend *will* deduct your signature request quota. + /// + /// Thrown when fails to make API call + /// The id of the SignatureRequest to edit. + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of SignatureRequestGetResponse + public async System.Threading.Tasks.Task SignatureRequestEditEmbeddedWithTemplateAsync(string signatureRequestId, SignatureRequestEditEmbeddedWithTemplateRequest signatureRequestEditEmbeddedWithTemplateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + Dropbox.Sign.Client.ApiResponse localVarResponse = await SignatureRequestEditEmbeddedWithTemplateWithHttpInfoAsync(signatureRequestId, signatureRequestEditEmbeddedWithTemplateRequest, operationIndex, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Edit Embedded Signature Request with Template Edits a SignatureRequest based on the given Template(s) to be signed in an embedded iFrame. Note that embedded signature requests can only be signed in embedded iFrames whereas normal signature requests can only be signed on Dropbox Sign. **NOTE:** Edit and resend *will* deduct your signature request quota. + /// + /// Thrown when fails to make API call + /// The id of the SignatureRequest to edit. + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (SignatureRequestGetResponse) + public async System.Threading.Tasks.Task> SignatureRequestEditEmbeddedWithTemplateWithHttpInfoAsync(string signatureRequestId, SignatureRequestEditEmbeddedWithTemplateRequest signatureRequestEditEmbeddedWithTemplateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + // verify the required parameter 'signatureRequestId' is set + if (signatureRequestId == null) + { + throw new Dropbox.Sign.Client.ApiException(400, "Missing required parameter 'signatureRequestId' when calling SignatureRequestApi->SignatureRequestEditEmbeddedWithTemplate"); + } + + // verify the required parameter 'signatureRequestEditEmbeddedWithTemplateRequest' is set + if (signatureRequestEditEmbeddedWithTemplateRequest == null) + { + throw new Dropbox.Sign.Client.ApiException(400, "Missing required parameter 'signatureRequestEditEmbeddedWithTemplateRequest' when calling SignatureRequestApi->SignatureRequestEditEmbeddedWithTemplate"); + } + + + Dropbox.Sign.Client.RequestOptions localVarRequestOptions = new Dropbox.Sign.Client.RequestOptions(); + + var localVarContentType = ""; + var openApiTypes = signatureRequestEditEmbeddedWithTemplateRequest.GetOpenApiTypes(); + if (ClientUtils.HasFileType(openApiTypes)) + { + ClientUtils.SetFormData(localVarRequestOptions, openApiTypes); + localVarContentType = "multipart/form-data"; + } + else + { + localVarContentType = "application/json"; + localVarRequestOptions.Data = signatureRequestEditEmbeddedWithTemplateRequest; + } + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Dropbox.Sign.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("signature_request_id", Dropbox.Sign.Client.ClientUtils.ParameterToString(signatureRequestId)); // path parameter + + localVarRequestOptions.Operation = "SignatureRequestApi.SignatureRequestEditEmbeddedWithTemplate"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (api_key) required + // http basic authentication required + if (!string.IsNullOrEmpty(this.Configuration.Username) || !string.IsNullOrEmpty(this.Configuration.Password) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Basic " + Dropbox.Sign.Client.ClientUtils.Base64Encode(this.Configuration.Username + ":" + this.Configuration.Password)); + } + // authentication (oauth2) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.PutAsync("/signature_request/edit_embedded_with_template/{signature_request_id}", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("SignatureRequestEditEmbeddedWithTemplate", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Edit Signature Request With Template Edits and sends a SignatureRequest based off of the Template(s) specified with the template_ids parameter. **NOTE:** Edit and resend *will* deduct your signature request quota. + /// + /// Thrown when fails to make API call + /// The id of the SignatureRequest to edit. + /// + /// Index associated with the operation. + /// SignatureRequestGetResponse + public SignatureRequestGetResponse SignatureRequestEditWithTemplate(string signatureRequestId, SignatureRequestEditWithTemplateRequest signatureRequestEditWithTemplateRequest, int operationIndex = 0) + { + Dropbox.Sign.Client.ApiResponse localVarResponse = SignatureRequestEditWithTemplateWithHttpInfo(signatureRequestId, signatureRequestEditWithTemplateRequest); + return localVarResponse.Data; + } + + /// + /// Edit Signature Request With Template Edits and sends a SignatureRequest based off of the Template(s) specified with the template_ids parameter. **NOTE:** Edit and resend *will* deduct your signature request quota. + /// + /// Thrown when fails to make API call + /// The id of the SignatureRequest to edit. + /// + /// Index associated with the operation. + /// ApiResponse of SignatureRequestGetResponse + public Dropbox.Sign.Client.ApiResponse SignatureRequestEditWithTemplateWithHttpInfo(string signatureRequestId, SignatureRequestEditWithTemplateRequest signatureRequestEditWithTemplateRequest, int operationIndex = 0) + { + // verify the required parameter 'signatureRequestId' is set + if (signatureRequestId == null) + { + throw new Dropbox.Sign.Client.ApiException(400, "Missing required parameter 'signatureRequestId' when calling SignatureRequestApi->SignatureRequestEditWithTemplate"); + } + + // verify the required parameter 'signatureRequestEditWithTemplateRequest' is set + if (signatureRequestEditWithTemplateRequest == null) + { + throw new Dropbox.Sign.Client.ApiException(400, "Missing required parameter 'signatureRequestEditWithTemplateRequest' when calling SignatureRequestApi->SignatureRequestEditWithTemplate"); + } + + Dropbox.Sign.Client.RequestOptions localVarRequestOptions = new Dropbox.Sign.Client.RequestOptions(); + + var localVarContentType = ""; + var openApiTypes = signatureRequestEditWithTemplateRequest.GetOpenApiTypes(); + if (ClientUtils.HasFileType(openApiTypes)) + { + ClientUtils.SetFormData(localVarRequestOptions, openApiTypes); + localVarContentType = "multipart/form-data"; + } + else + { + localVarContentType = "application/json"; + localVarRequestOptions.Data = signatureRequestEditWithTemplateRequest; + } + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Dropbox.Sign.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("signature_request_id", Dropbox.Sign.Client.ClientUtils.ParameterToString(signatureRequestId)); // path parameter + + localVarRequestOptions.Operation = "SignatureRequestApi.SignatureRequestEditWithTemplate"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (api_key) required + // http basic authentication required + if (!string.IsNullOrEmpty(this.Configuration.Username) || !string.IsNullOrEmpty(this.Configuration.Password) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Basic " + Dropbox.Sign.Client.ClientUtils.Base64Encode(this.Configuration.Username + ":" + this.Configuration.Password)); + } + // authentication (oauth2) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = this.Client.Put("/signature_request/edit_with_template/{signature_request_id}", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("SignatureRequestEditWithTemplate", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Edit Signature Request With Template Edits and sends a SignatureRequest based off of the Template(s) specified with the template_ids parameter. **NOTE:** Edit and resend *will* deduct your signature request quota. + /// + /// Thrown when fails to make API call + /// The id of the SignatureRequest to edit. + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of SignatureRequestGetResponse + public async System.Threading.Tasks.Task SignatureRequestEditWithTemplateAsync(string signatureRequestId, SignatureRequestEditWithTemplateRequest signatureRequestEditWithTemplateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + Dropbox.Sign.Client.ApiResponse localVarResponse = await SignatureRequestEditWithTemplateWithHttpInfoAsync(signatureRequestId, signatureRequestEditWithTemplateRequest, operationIndex, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Edit Signature Request With Template Edits and sends a SignatureRequest based off of the Template(s) specified with the template_ids parameter. **NOTE:** Edit and resend *will* deduct your signature request quota. + /// + /// Thrown when fails to make API call + /// The id of the SignatureRequest to edit. + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (SignatureRequestGetResponse) + public async System.Threading.Tasks.Task> SignatureRequestEditWithTemplateWithHttpInfoAsync(string signatureRequestId, SignatureRequestEditWithTemplateRequest signatureRequestEditWithTemplateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + // verify the required parameter 'signatureRequestId' is set + if (signatureRequestId == null) + { + throw new Dropbox.Sign.Client.ApiException(400, "Missing required parameter 'signatureRequestId' when calling SignatureRequestApi->SignatureRequestEditWithTemplate"); + } + + // verify the required parameter 'signatureRequestEditWithTemplateRequest' is set + if (signatureRequestEditWithTemplateRequest == null) + { + throw new Dropbox.Sign.Client.ApiException(400, "Missing required parameter 'signatureRequestEditWithTemplateRequest' when calling SignatureRequestApi->SignatureRequestEditWithTemplate"); + } + + + Dropbox.Sign.Client.RequestOptions localVarRequestOptions = new Dropbox.Sign.Client.RequestOptions(); + + var localVarContentType = ""; + var openApiTypes = signatureRequestEditWithTemplateRequest.GetOpenApiTypes(); + if (ClientUtils.HasFileType(openApiTypes)) + { + ClientUtils.SetFormData(localVarRequestOptions, openApiTypes); + localVarContentType = "multipart/form-data"; + } + else + { + localVarContentType = "application/json"; + localVarRequestOptions.Data = signatureRequestEditWithTemplateRequest; + } + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Dropbox.Sign.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("signature_request_id", Dropbox.Sign.Client.ClientUtils.ParameterToString(signatureRequestId)); // path parameter + + localVarRequestOptions.Operation = "SignatureRequestApi.SignatureRequestEditWithTemplate"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (api_key) required + // http basic authentication required + if (!string.IsNullOrEmpty(this.Configuration.Username) || !string.IsNullOrEmpty(this.Configuration.Password) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Basic " + Dropbox.Sign.Client.ClientUtils.Base64Encode(this.Configuration.Username + ":" + this.Configuration.Password)); + } + // authentication (oauth2) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.PutAsync("/signature_request/edit_with_template/{signature_request_id}", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("SignatureRequestEditWithTemplate", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + /// /// Download Files Obtain a copy of the current documents specified by the `signature_request_id` parameter. Returns a PDF or ZIP file. If the files are currently being prepared, a status code of `409` will be returned instead. /// diff --git a/src/Dropbox.Sign/Client/ApiClient.cs b/src/Dropbox.Sign/Client/ApiClient.cs index d43d6f7..72c2663 100644 --- a/src/Dropbox.Sign/Client/ApiClient.cs +++ b/src/Dropbox.Sign/Client/ApiClient.cs @@ -110,7 +110,7 @@ internal object Deserialize(RestResponse response, Type type) if (response.Headers != null) { var filePath = string.IsNullOrEmpty(_configuration.TempFolderPath) - ? Path.GetTempPath() + ? global::System.IO.Path.GetTempPath() : _configuration.TempFolderPath; var regex = new Regex(@"Content-Disposition=.*filename=['""]?([^'""\s]+)['""]?$"); foreach (var header in response.Headers) @@ -334,7 +334,7 @@ private RestRequest NewRequest( { foreach (var value in headerParam.Value) { - request.AddHeader(headerParam.Key, value); + request.AddOrUpdateHeader(headerParam.Key, value); } } } @@ -394,13 +394,21 @@ private RestRequest NewRequest( var bytes = ClientUtils.ReadAsBytes(file); var fileStream = file as FileStream; if (fileStream != null) - request.AddFile(fileParam.Key, bytes, Path.GetFileName(fileStream.Name)); + request.AddFile(fileParam.Key, bytes, global::System.IO.Path.GetFileName(fileStream.Name)); else request.AddFile(fileParam.Key, bytes, "no_file_name_provided"); } } } + if (options.HeaderParameters != null) + { + if (options.HeaderParameters.TryGetValue("Content-Type", out var contentTypes) && contentTypes.Any(header => header.Contains("multipart/form-data"))) + { + request.AlwaysMultipartFormData = true; + } + } + return request; } @@ -472,7 +480,7 @@ private async Task> ExecClientAsync(Func> ExecClientAsync(Func DeserializeRestResponseFromPolicy(RestClient client, RestRequest request, PolicyResult policyResult) + private async Task> DeserializeRestResponseFromPolicyAsync(RestClient client, RestRequest request, PolicyResult policyResult, CancellationToken cancellationToken = default) { if (policyResult.Outcome == OutcomeType.Successful) { - return client.Deserialize(policyResult.Result); + return await client.Deserialize(policyResult.Result, cancellationToken); } else { @@ -594,7 +602,7 @@ private ApiResponse Exec(RestRequest request, RequestOptions options, IRea { var policy = RetryConfiguration.RetryPolicy; var policyResult = policy.ExecuteAndCapture(() => client.Execute(request)); - return Task.FromResult(DeserializeRestResponseFromPolicy(client, request, policyResult)); + return DeserializeRestResponseFromPolicyAsync(client, request, policyResult); } else { @@ -618,7 +626,7 @@ private ApiResponse Exec(RestRequest request, RequestOptions options, IRea { var policy = RetryConfiguration.AsyncRetryPolicy; var policyResult = await policy.ExecuteAndCaptureAsync((ct) => client.ExecuteAsync(request, ct), cancellationToken).ConfigureAwait(false); - return DeserializeRestResponseFromPolicy(client, request, policyResult); + return await DeserializeRestResponseFromPolicyAsync(client, request, policyResult, cancellationToken); } else { diff --git a/src/Dropbox.Sign/Client/ClientUtils.cs b/src/Dropbox.Sign/Client/ClientUtils.cs index 8fb7773..ec20198 100644 --- a/src/Dropbox.Sign/Client/ClientUtils.cs +++ b/src/Dropbox.Sign/Client/ClientUtils.cs @@ -105,6 +105,12 @@ public static string ParameterToString(object obj, IReadableConfiguration config // https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx#Anchor_8 // For example: 2009-06-15T13:45:30.0000000 return dateTimeOffset.ToString((configuration ?? GlobalConfiguration.Instance).DateTimeFormat); + if (obj is DateOnly dateOnly) + // Return a formatted date string - Can be customized with Configuration.DateTimeFormat + // Defaults to an ISO 8601, using the known as a Round-trip date/time pattern ("o") + // https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx#Anchor_8 + // For example: 2009-06-15 + return dateOnly.ToString((configuration ?? GlobalConfiguration.Instance).DateTimeFormat); if (obj is bool boolean) return boolean ? "true" : "false"; if (obj is ICollection collection) diff --git a/src/Dropbox.Sign/Client/Configuration.cs b/src/Dropbox.Sign/Client/Configuration.cs index 60d825f..25813c6 100644 --- a/src/Dropbox.Sign/Client/Configuration.cs +++ b/src/Dropbox.Sign/Client/Configuration.cs @@ -36,7 +36,7 @@ public class Configuration : IReadableConfiguration /// Version of the package. /// /// Version of the package. - public const string Version = "1.8.0"; + public const string Version = "2.0.0"; /// /// Identifier for ISO 8601 DateTime Format @@ -120,7 +120,7 @@ public class Configuration : IReadableConfiguration public Configuration() { Proxy = null; - UserAgent = WebUtility.UrlEncode("OpenAPI-Generator/1.8.0/csharp"); + UserAgent = WebUtility.UrlEncode("OpenAPI-Generator/2.0.0/csharp"); BasePath = "https://api.hellosign.com/v3"; DefaultHeaders = new ConcurrentDictionary(); ApiKey = new ConcurrentDictionary(); @@ -163,7 +163,7 @@ public Configuration() }; // Setting Timeout has side effects (forces ApiClient creation). - Timeout = 100000; + Timeout = TimeSpan.FromSeconds(100); } /// @@ -247,9 +247,9 @@ public virtual IDictionary DefaultHeader public virtual IDictionary DefaultHeaders { get; set; } /// - /// Gets or sets the HTTP timeout (milliseconds) of ApiClient. Default to 100000 milliseconds. + /// Gets or sets the HTTP timeout of ApiClient. Defaults to 100 seconds. /// - public virtual int Timeout { get; set; } + public virtual TimeSpan Timeout { get; set; } /// /// Gets or sets the proxy @@ -567,7 +567,7 @@ public static string ToDebugReport() report += " OS: " + System.Environment.OSVersion + "\n"; report += " .NET Framework Version: " + System.Environment.Version + "\n"; report += " Version of the API: 3.0.0\n"; - report += " SDK Package Version: 1.8.0\n"; + report += " SDK Package Version: 2.0.0\n"; return report; } diff --git a/src/Dropbox.Sign/Client/IReadableConfiguration.cs b/src/Dropbox.Sign/Client/IReadableConfiguration.cs index a4e493e..14469bb 100644 --- a/src/Dropbox.Sign/Client/IReadableConfiguration.cs +++ b/src/Dropbox.Sign/Client/IReadableConfiguration.cs @@ -72,10 +72,10 @@ public interface IReadableConfiguration string TempFolderPath { get; } /// - /// Gets the HTTP connection timeout (in milliseconds) + /// Gets the HTTP connection timeout. /// /// HTTP connection timeout. - int Timeout { get; } + TimeSpan Timeout { get; } /// /// Gets the proxy. diff --git a/src/Dropbox.Sign/Dropbox.Sign.csproj b/src/Dropbox.Sign/Dropbox.Sign.csproj index d3128aa..0ec27eb 100644 --- a/src/Dropbox.Sign/Dropbox.Sign.csproj +++ b/src/Dropbox.Sign/Dropbox.Sign.csproj @@ -2,7 +2,7 @@ false - net6.0 + net8.0 Dropbox.Sign Dropbox.Sign Library @@ -12,7 +12,7 @@ Client library for using the Dropbox Sign API Dropbox 2024 Dropbox.Sign - 1.8.0 + 2.0.0 bin\$(Configuration)\$(TargetFramework)\Dropbox.Sign.xml https://github.com/hellosign/dropbox-sign-dotnet.git git diff --git a/src/Dropbox.Sign/Model/FaxLineAddUserRequest.cs b/src/Dropbox.Sign/Model/FaxLineAddUserRequest.cs index 55509a4..fbbc708 100644 --- a/src/Dropbox.Sign/Model/FaxLineAddUserRequest.cs +++ b/src/Dropbox.Sign/Model/FaxLineAddUserRequest.cs @@ -41,7 +41,7 @@ protected FaxLineAddUserRequest() { } /// /// Initializes a new instance of the class. /// - /// The Fax Line number. (required). + /// The Fax Line number (required). /// Account ID. /// Email address. public FaxLineAddUserRequest(string number = default(string), string accountId = default(string), string emailAddress = default(string)) @@ -74,9 +74,9 @@ public static FaxLineAddUserRequest Init(string jsonData) } /// - /// The Fax Line number. + /// The Fax Line number /// - /// The Fax Line number. + /// The Fax Line number [DataMember(Name = "number", IsRequired = true, EmitDefaultValue = true)] public string Number { get; set; } diff --git a/src/Dropbox.Sign/Model/FaxLineCreateRequest.cs b/src/Dropbox.Sign/Model/FaxLineCreateRequest.cs index 733cab7..ad5c884 100644 --- a/src/Dropbox.Sign/Model/FaxLineCreateRequest.cs +++ b/src/Dropbox.Sign/Model/FaxLineCreateRequest.cs @@ -34,9 +34,9 @@ namespace Dropbox.Sign.Model public partial class FaxLineCreateRequest : IEquatable, IValidatableObject { /// - /// Country + /// Country of the area code /// - /// Country + /// Country of the area code [JsonConverter(typeof(StringEnumConverter))] public enum CountryEnum { @@ -61,9 +61,9 @@ public enum CountryEnum /// - /// Country + /// Country of the area code /// - /// Country + /// Country of the area code [DataMember(Name = "country", IsRequired = true, EmitDefaultValue = true)] public CountryEnum Country { get; set; } /// @@ -74,10 +74,10 @@ protected FaxLineCreateRequest() { } /// /// Initializes a new instance of the class. /// - /// Area code (required). - /// Country (required). - /// City. - /// Account ID. + /// Area code of the new Fax Line (required). + /// Country of the area code (required). + /// City of the area code. + /// Account ID of the account that will be assigned this new Fax Line. public FaxLineCreateRequest(int areaCode = default(int), CountryEnum country = default(CountryEnum), string city = default(string), string accountId = default(string)) { @@ -104,23 +104,23 @@ public static FaxLineCreateRequest Init(string jsonData) } /// - /// Area code + /// Area code of the new Fax Line /// - /// Area code + /// Area code of the new Fax Line [DataMember(Name = "area_code", IsRequired = true, EmitDefaultValue = true)] public int AreaCode { get; set; } /// - /// City + /// City of the area code /// - /// City + /// City of the area code [DataMember(Name = "city", EmitDefaultValue = true)] public string City { get; set; } /// - /// Account ID + /// Account ID of the account that will be assigned this new Fax Line /// - /// Account ID + /// Account ID of the account that will be assigned this new Fax Line /// ab55cd14a97219e36b5ff5fe23f2f9329b0c1e97 [DataMember(Name = "account_id", EmitDefaultValue = true)] public string AccountId { get; set; } diff --git a/src/Dropbox.Sign/Model/FaxLineDeleteRequest.cs b/src/Dropbox.Sign/Model/FaxLineDeleteRequest.cs index cb5a273..5bc3e96 100644 --- a/src/Dropbox.Sign/Model/FaxLineDeleteRequest.cs +++ b/src/Dropbox.Sign/Model/FaxLineDeleteRequest.cs @@ -41,7 +41,7 @@ protected FaxLineDeleteRequest() { } /// /// Initializes a new instance of the class. /// - /// The Fax Line number. (required). + /// The Fax Line number (required). public FaxLineDeleteRequest(string number = default(string)) { @@ -70,9 +70,9 @@ public static FaxLineDeleteRequest Init(string jsonData) } /// - /// The Fax Line number. + /// The Fax Line number /// - /// The Fax Line number. + /// The Fax Line number [DataMember(Name = "number", IsRequired = true, EmitDefaultValue = true)] public string Number { get; set; } diff --git a/src/Dropbox.Sign/Model/FaxLineRemoveUserRequest.cs b/src/Dropbox.Sign/Model/FaxLineRemoveUserRequest.cs index eed6d36..1347d82 100644 --- a/src/Dropbox.Sign/Model/FaxLineRemoveUserRequest.cs +++ b/src/Dropbox.Sign/Model/FaxLineRemoveUserRequest.cs @@ -41,9 +41,9 @@ protected FaxLineRemoveUserRequest() { } /// /// Initializes a new instance of the class. /// - /// The Fax Line number. (required). - /// Account ID. - /// Email address. + /// The Fax Line number (required). + /// Account ID of the user to remove access. + /// Email address of the user to remove access. public FaxLineRemoveUserRequest(string number = default(string), string accountId = default(string), string emailAddress = default(string)) { @@ -74,24 +74,24 @@ public static FaxLineRemoveUserRequest Init(string jsonData) } /// - /// The Fax Line number. + /// The Fax Line number /// - /// The Fax Line number. + /// The Fax Line number [DataMember(Name = "number", IsRequired = true, EmitDefaultValue = true)] public string Number { get; set; } /// - /// Account ID + /// Account ID of the user to remove access /// - /// Account ID + /// Account ID of the user to remove access /// ab55cd14a97219e36b5ff5fe23f2f9329b0c1e97 [DataMember(Name = "account_id", EmitDefaultValue = true)] public string AccountId { get; set; } /// - /// Email address + /// Email address of the user to remove access /// - /// Email address + /// Email address of the user to remove access [DataMember(Name = "email_address", EmitDefaultValue = true)] public string EmailAddress { get; set; } diff --git a/src/Dropbox.Sign/Model/FaxSendRequest.cs b/src/Dropbox.Sign/Model/FaxSendRequest.cs index e4d42e6..d5eddb1 100644 --- a/src/Dropbox.Sign/Model/FaxSendRequest.cs +++ b/src/Dropbox.Sign/Model/FaxSendRequest.cs @@ -41,13 +41,13 @@ protected FaxSendRequest() { } /// /// Initializes a new instance of the class. /// - /// Fax Send To Recipient (required). + /// Recipient of the fax Can be a phone number in E.164 format or email address (required). /// Fax Send From Sender (used only with fax number). - /// Fax File to Send. - /// Fax File URL to Send. + /// Use `files[]` to indicate the uploaded file(s) to fax This endpoint requires either **files** or **file_urls[]**, but not both.. + /// Use `file_urls[]` to have Dropbox Fax download the file(s) to fax This endpoint requires either **files** or **file_urls[]**, but not both.. /// API Test Mode Setting (default to false). - /// Fax Cover Page for Recipient. - /// Fax Cover Page for Sender. + /// Fax cover page recipient information. + /// Fax cover page sender information. /// Fax Cover Page Message. /// Fax Title. public FaxSendRequest(string recipient = default(string), string sender = default(string), List files = default(List), List fileUrls = default(List), bool testMode = false, string coverPageTo = default(string), string coverPageFrom = default(string), string coverPageMessage = default(string), string title = default(string)) @@ -86,9 +86,9 @@ public static FaxSendRequest Init(string jsonData) } /// - /// Fax Send To Recipient + /// Recipient of the fax Can be a phone number in E.164 format or email address /// - /// Fax Send To Recipient + /// Recipient of the fax Can be a phone number in E.164 format or email address /// recipient@example.com [DataMember(Name = "recipient", IsRequired = true, EmitDefaultValue = true)] public string Recipient { get; set; } @@ -102,16 +102,16 @@ public static FaxSendRequest Init(string jsonData) public string Sender { get; set; } /// - /// Fax File to Send + /// Use `files[]` to indicate the uploaded file(s) to fax This endpoint requires either **files** or **file_urls[]**, but not both. /// - /// Fax File to Send + /// Use `files[]` to indicate the uploaded file(s) to fax This endpoint requires either **files** or **file_urls[]**, but not both. [DataMember(Name = "files", EmitDefaultValue = true)] public List Files { get; set; } /// - /// Fax File URL to Send + /// Use `file_urls[]` to have Dropbox Fax download the file(s) to fax This endpoint requires either **files** or **file_urls[]**, but not both. /// - /// Fax File URL to Send + /// Use `file_urls[]` to have Dropbox Fax download the file(s) to fax This endpoint requires either **files** or **file_urls[]**, but not both. [DataMember(Name = "file_urls", EmitDefaultValue = true)] public List FileUrls { get; set; } @@ -123,17 +123,17 @@ public static FaxSendRequest Init(string jsonData) public bool TestMode { get; set; } /// - /// Fax Cover Page for Recipient + /// Fax cover page recipient information /// - /// Fax Cover Page for Recipient + /// Fax cover page recipient information /// Recipient Name [DataMember(Name = "cover_page_to", EmitDefaultValue = true)] public string CoverPageTo { get; set; } /// - /// Fax Cover Page for Sender + /// Fax cover page sender information /// - /// Fax Cover Page for Sender + /// Fax cover page sender information /// Sender Name [DataMember(Name = "cover_page_from", EmitDefaultValue = true)] public string CoverPageFrom { get; set; } diff --git a/src/Dropbox.Sign/Model/SignatureRequestEditEmbeddedRequest.cs b/src/Dropbox.Sign/Model/SignatureRequestEditEmbeddedRequest.cs new file mode 100644 index 0000000..68a0329 --- /dev/null +++ b/src/Dropbox.Sign/Model/SignatureRequestEditEmbeddedRequest.cs @@ -0,0 +1,772 @@ +/* + * Dropbox Sign API + * + * Dropbox Sign v3 API + * + * The version of the OpenAPI document: 3.0.0 + * Contact: apisupport@hellosign.com + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Dropbox.Sign.Client.OpenAPIDateConverter; + +namespace Dropbox.Sign.Model +{ + /// + /// SignatureRequestEditEmbeddedRequest + /// + [DataContract(Name = "SignatureRequestEditEmbeddedRequest")] + [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] + public partial class SignatureRequestEditEmbeddedRequest : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected SignatureRequestEditEmbeddedRequest() { } + /// + /// Initializes a new instance of the class. + /// + /// Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.. + /// Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.. + /// Add Signers to your Signature Request. This endpoint requires either **signers** or **grouped_signers**, but not both.. + /// Add Grouped Signers to your Signature Request. This endpoint requires either **signers** or **grouped_signers**, but not both.. + /// Allows signers to decline to sign a document if `true`. Defaults to `false`. (default to false). + /// Allows signers to reassign their signature requests to other signers if set to `true`. Defaults to `false`. **NOTE:** Only available for Premium plan. (default to false). + /// A list describing the attachments. + /// The email addresses that should be CCed.. + /// Client id of the app you're using to create this embedded signature request. Used for security purposes. (required). + /// When used together with merge fields, `custom_fields` allows users to add pre-filled data to their signature requests. Pre-filled data can be used with \"send-once\" signature requests by adding merge fields with `form_fields_per_document` or [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) while passing values back with `custom_fields` together in one API call. For using pre-filled on repeatable signature requests, merge fields are added to templates in the Dropbox Sign UI or by calling [/template/create_embedded_draft](/api/reference/operation/templateCreateEmbeddedDraft) and then passing `custom_fields` on subsequent signature requests referencing that template.. + /// fieldOptions. + /// Group information for fields defined in `form_fields_per_document`. String-indexed JSON array with `group_label` and `requirement` keys. `form_fields_per_document` must contain fields referencing a group defined in `form_field_groups`.. + /// Conditional Logic rules for fields defined in `form_fields_per_document`.. + /// The fields that should appear on the document, expressed as an array of objects. (For more details you can read about it here: [Using Form Fields per Document](/docs/openapi/form-fields-per-document).) **NOTE:** Fields like **text**, **dropdown**, **checkbox**, **radio**, and **hyperlink** have additional required and optional parameters. Check out the list of [additional parameters](/api/reference/constants/#form-fields-per-document) for these field types. * Text Field use `SubFormFieldsPerDocumentText` * Dropdown Field use `SubFormFieldsPerDocumentDropdown` * Hyperlink Field use `SubFormFieldsPerDocumentHyperlink` * Checkbox Field use `SubFormFieldsPerDocumentCheckbox` * Radio Field use `SubFormFieldsPerDocumentRadio` * Signature Field use `SubFormFieldsPerDocumentSignature` * Date Signed Field use `SubFormFieldsPerDocumentDateSigned` * Initials Field use `SubFormFieldsPerDocumentInitials` * Text Merge Field use `SubFormFieldsPerDocumentTextMerge` * Checkbox Merge Field use `SubFormFieldsPerDocumentCheckboxMerge`. + /// Enables automatic Text Tag removal when set to true. **NOTE:** Removing text tags this way can cause unwanted clipping. We recommend leaving this setting on `false` and instead hiding your text tags using white text or a similar approach. See the [Text Tags Walkthrough](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) for more information. (default to false). + /// The custom message in the email that will be sent to the signers.. + /// Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long.. + /// signingOptions. + /// The subject in the email that will be sent to the signers.. + /// Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`. (default to false). + /// The title you want to assign to the SignatureRequest.. + /// Send with a value of `true` if you wish to enable [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) parsing in your document. Defaults to disabled, or `false`. (default to false). + /// Controls whether [auto fill fields](https://faq.hellosign.com/hc/en-us/articles/360051467511-Auto-Fill-Fields) can automatically populate a signer's information during signing. **NOTE:** Keep your signer's information safe by ensuring that the _signer on your signature request is the intended party_ before using this feature. (default to false). + /// When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details.. + public SignatureRequestEditEmbeddedRequest(List files = default(List), List fileUrls = default(List), List signers = default(List), List groupedSigners = default(List), bool allowDecline = false, bool allowReassign = false, List attachments = default(List), List ccEmailAddresses = default(List), string clientId = default(string), List customFields = default(List), SubFieldOptions fieldOptions = default(SubFieldOptions), List formFieldGroups = default(List), List formFieldRules = default(List), List formFieldsPerDocument = default(List), bool hideTextTags = false, string message = default(string), Dictionary metadata = default(Dictionary), SubSigningOptions signingOptions = default(SubSigningOptions), string subject = default(string), bool testMode = false, string title = default(string), bool useTextTags = false, bool populateAutoFillFields = false, int? expiresAt = default(int?)) + { + + // to ensure "clientId" is required (not null) + if (clientId == null) + { + throw new ArgumentNullException("clientId is a required property for SignatureRequestEditEmbeddedRequest and cannot be null"); + } + this.ClientId = clientId; + this.Files = files; + this.FileUrls = fileUrls; + this.Signers = signers; + this.GroupedSigners = groupedSigners; + this.AllowDecline = allowDecline; + this.AllowReassign = allowReassign; + this.Attachments = attachments; + this.CcEmailAddresses = ccEmailAddresses; + this.CustomFields = customFields; + this.FieldOptions = fieldOptions; + this.FormFieldGroups = formFieldGroups; + this.FormFieldRules = formFieldRules; + this.FormFieldsPerDocument = formFieldsPerDocument; + this.HideTextTags = hideTextTags; + this.Message = message; + this.Metadata = metadata; + this.SigningOptions = signingOptions; + this.Subject = subject; + this.TestMode = testMode; + this.Title = title; + this.UseTextTags = useTextTags; + this.PopulateAutoFillFields = populateAutoFillFields; + this.ExpiresAt = expiresAt; + } + + /// + /// Attempt to instantiate and hydrate a new instance of this class + /// + /// String of JSON data representing target object + public static SignatureRequestEditEmbeddedRequest Init(string jsonData) + { + var obj = JsonConvert.DeserializeObject(jsonData); + + if (obj == null) + { + throw new Exception("Unable to deserialize JSON to instance of SignatureRequestEditEmbeddedRequest"); + } + + return obj; + } + + /// + /// Client id of the app you're using to create this embedded signature request. Used for security purposes. + /// + /// Client id of the app you're using to create this embedded signature request. Used for security purposes. + [DataMember(Name = "client_id", IsRequired = true, EmitDefaultValue = true)] + public string ClientId { get; set; } + + /// + /// Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. + /// + /// Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. + [DataMember(Name = "files", EmitDefaultValue = true)] + public List Files { get; set; } + + /// + /// Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. + /// + /// Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. + [DataMember(Name = "file_urls", EmitDefaultValue = true)] + public List FileUrls { get; set; } + + /// + /// Add Signers to your Signature Request. This endpoint requires either **signers** or **grouped_signers**, but not both. + /// + /// Add Signers to your Signature Request. This endpoint requires either **signers** or **grouped_signers**, but not both. + [DataMember(Name = "signers", EmitDefaultValue = true)] + public List Signers { get; set; } + + /// + /// Add Grouped Signers to your Signature Request. This endpoint requires either **signers** or **grouped_signers**, but not both. + /// + /// Add Grouped Signers to your Signature Request. This endpoint requires either **signers** or **grouped_signers**, but not both. + [DataMember(Name = "grouped_signers", EmitDefaultValue = true)] + public List GroupedSigners { get; set; } + + /// + /// Allows signers to decline to sign a document if `true`. Defaults to `false`. + /// + /// Allows signers to decline to sign a document if `true`. Defaults to `false`. + [DataMember(Name = "allow_decline", EmitDefaultValue = true)] + public bool AllowDecline { get; set; } + + /// + /// Allows signers to reassign their signature requests to other signers if set to `true`. Defaults to `false`. **NOTE:** Only available for Premium plan. + /// + /// Allows signers to reassign their signature requests to other signers if set to `true`. Defaults to `false`. **NOTE:** Only available for Premium plan. + [DataMember(Name = "allow_reassign", EmitDefaultValue = true)] + public bool AllowReassign { get; set; } + + /// + /// A list describing the attachments + /// + /// A list describing the attachments + [DataMember(Name = "attachments", EmitDefaultValue = true)] + public List Attachments { get; set; } + + /// + /// The email addresses that should be CCed. + /// + /// The email addresses that should be CCed. + [DataMember(Name = "cc_email_addresses", EmitDefaultValue = true)] + public List CcEmailAddresses { get; set; } + + /// + /// When used together with merge fields, `custom_fields` allows users to add pre-filled data to their signature requests. Pre-filled data can be used with \"send-once\" signature requests by adding merge fields with `form_fields_per_document` or [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) while passing values back with `custom_fields` together in one API call. For using pre-filled on repeatable signature requests, merge fields are added to templates in the Dropbox Sign UI or by calling [/template/create_embedded_draft](/api/reference/operation/templateCreateEmbeddedDraft) and then passing `custom_fields` on subsequent signature requests referencing that template. + /// + /// When used together with merge fields, `custom_fields` allows users to add pre-filled data to their signature requests. Pre-filled data can be used with \"send-once\" signature requests by adding merge fields with `form_fields_per_document` or [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) while passing values back with `custom_fields` together in one API call. For using pre-filled on repeatable signature requests, merge fields are added to templates in the Dropbox Sign UI or by calling [/template/create_embedded_draft](/api/reference/operation/templateCreateEmbeddedDraft) and then passing `custom_fields` on subsequent signature requests referencing that template. + [DataMember(Name = "custom_fields", EmitDefaultValue = true)] + public List CustomFields { get; set; } + + /// + /// Gets or Sets FieldOptions + /// + [DataMember(Name = "field_options", EmitDefaultValue = true)] + public SubFieldOptions FieldOptions { get; set; } + + /// + /// Group information for fields defined in `form_fields_per_document`. String-indexed JSON array with `group_label` and `requirement` keys. `form_fields_per_document` must contain fields referencing a group defined in `form_field_groups`. + /// + /// Group information for fields defined in `form_fields_per_document`. String-indexed JSON array with `group_label` and `requirement` keys. `form_fields_per_document` must contain fields referencing a group defined in `form_field_groups`. + [DataMember(Name = "form_field_groups", EmitDefaultValue = true)] + public List FormFieldGroups { get; set; } + + /// + /// Conditional Logic rules for fields defined in `form_fields_per_document`. + /// + /// Conditional Logic rules for fields defined in `form_fields_per_document`. + [DataMember(Name = "form_field_rules", EmitDefaultValue = true)] + public List FormFieldRules { get; set; } + + /// + /// The fields that should appear on the document, expressed as an array of objects. (For more details you can read about it here: [Using Form Fields per Document](/docs/openapi/form-fields-per-document).) **NOTE:** Fields like **text**, **dropdown**, **checkbox**, **radio**, and **hyperlink** have additional required and optional parameters. Check out the list of [additional parameters](/api/reference/constants/#form-fields-per-document) for these field types. * Text Field use `SubFormFieldsPerDocumentText` * Dropdown Field use `SubFormFieldsPerDocumentDropdown` * Hyperlink Field use `SubFormFieldsPerDocumentHyperlink` * Checkbox Field use `SubFormFieldsPerDocumentCheckbox` * Radio Field use `SubFormFieldsPerDocumentRadio` * Signature Field use `SubFormFieldsPerDocumentSignature` * Date Signed Field use `SubFormFieldsPerDocumentDateSigned` * Initials Field use `SubFormFieldsPerDocumentInitials` * Text Merge Field use `SubFormFieldsPerDocumentTextMerge` * Checkbox Merge Field use `SubFormFieldsPerDocumentCheckboxMerge` + /// + /// The fields that should appear on the document, expressed as an array of objects. (For more details you can read about it here: [Using Form Fields per Document](/docs/openapi/form-fields-per-document).) **NOTE:** Fields like **text**, **dropdown**, **checkbox**, **radio**, and **hyperlink** have additional required and optional parameters. Check out the list of [additional parameters](/api/reference/constants/#form-fields-per-document) for these field types. * Text Field use `SubFormFieldsPerDocumentText` * Dropdown Field use `SubFormFieldsPerDocumentDropdown` * Hyperlink Field use `SubFormFieldsPerDocumentHyperlink` * Checkbox Field use `SubFormFieldsPerDocumentCheckbox` * Radio Field use `SubFormFieldsPerDocumentRadio` * Signature Field use `SubFormFieldsPerDocumentSignature` * Date Signed Field use `SubFormFieldsPerDocumentDateSigned` * Initials Field use `SubFormFieldsPerDocumentInitials` * Text Merge Field use `SubFormFieldsPerDocumentTextMerge` * Checkbox Merge Field use `SubFormFieldsPerDocumentCheckboxMerge` + [DataMember(Name = "form_fields_per_document", EmitDefaultValue = true)] + public List FormFieldsPerDocument { get; set; } + + /// + /// Enables automatic Text Tag removal when set to true. **NOTE:** Removing text tags this way can cause unwanted clipping. We recommend leaving this setting on `false` and instead hiding your text tags using white text or a similar approach. See the [Text Tags Walkthrough](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) for more information. + /// + /// Enables automatic Text Tag removal when set to true. **NOTE:** Removing text tags this way can cause unwanted clipping. We recommend leaving this setting on `false` and instead hiding your text tags using white text or a similar approach. See the [Text Tags Walkthrough](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) for more information. + [DataMember(Name = "hide_text_tags", EmitDefaultValue = true)] + public bool HideTextTags { get; set; } + + /// + /// The custom message in the email that will be sent to the signers. + /// + /// The custom message in the email that will be sent to the signers. + [DataMember(Name = "message", EmitDefaultValue = true)] + public string Message { get; set; } + + /// + /// Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. + /// + /// Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. + [DataMember(Name = "metadata", EmitDefaultValue = true)] + public Dictionary Metadata { get; set; } + + /// + /// Gets or Sets SigningOptions + /// + [DataMember(Name = "signing_options", EmitDefaultValue = true)] + public SubSigningOptions SigningOptions { get; set; } + + /// + /// The subject in the email that will be sent to the signers. + /// + /// The subject in the email that will be sent to the signers. + [DataMember(Name = "subject", EmitDefaultValue = true)] + public string Subject { get; set; } + + /// + /// Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`. + /// + /// Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`. + [DataMember(Name = "test_mode", EmitDefaultValue = true)] + public bool TestMode { get; set; } + + /// + /// The title you want to assign to the SignatureRequest. + /// + /// The title you want to assign to the SignatureRequest. + [DataMember(Name = "title", EmitDefaultValue = true)] + public string Title { get; set; } + + /// + /// Send with a value of `true` if you wish to enable [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) parsing in your document. Defaults to disabled, or `false`. + /// + /// Send with a value of `true` if you wish to enable [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) parsing in your document. Defaults to disabled, or `false`. + [DataMember(Name = "use_text_tags", EmitDefaultValue = true)] + public bool UseTextTags { get; set; } + + /// + /// Controls whether [auto fill fields](https://faq.hellosign.com/hc/en-us/articles/360051467511-Auto-Fill-Fields) can automatically populate a signer's information during signing. **NOTE:** Keep your signer's information safe by ensuring that the _signer on your signature request is the intended party_ before using this feature. + /// + /// Controls whether [auto fill fields](https://faq.hellosign.com/hc/en-us/articles/360051467511-Auto-Fill-Fields) can automatically populate a signer's information during signing. **NOTE:** Keep your signer's information safe by ensuring that the _signer on your signature request is the intended party_ before using this feature. + [DataMember(Name = "populate_auto_fill_fields", EmitDefaultValue = true)] + public bool PopulateAutoFillFields { get; set; } + + /// + /// When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details. + /// + /// When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details. + [DataMember(Name = "expires_at", EmitDefaultValue = true)] + public int? ExpiresAt { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class SignatureRequestEditEmbeddedRequest {\n"); + sb.Append(" ClientId: ").Append(ClientId).Append("\n"); + sb.Append(" Files: ").Append(Files).Append("\n"); + sb.Append(" FileUrls: ").Append(FileUrls).Append("\n"); + sb.Append(" Signers: ").Append(Signers).Append("\n"); + sb.Append(" GroupedSigners: ").Append(GroupedSigners).Append("\n"); + sb.Append(" AllowDecline: ").Append(AllowDecline).Append("\n"); + sb.Append(" AllowReassign: ").Append(AllowReassign).Append("\n"); + sb.Append(" Attachments: ").Append(Attachments).Append("\n"); + sb.Append(" CcEmailAddresses: ").Append(CcEmailAddresses).Append("\n"); + sb.Append(" CustomFields: ").Append(CustomFields).Append("\n"); + sb.Append(" FieldOptions: ").Append(FieldOptions).Append("\n"); + sb.Append(" FormFieldGroups: ").Append(FormFieldGroups).Append("\n"); + sb.Append(" FormFieldRules: ").Append(FormFieldRules).Append("\n"); + sb.Append(" FormFieldsPerDocument: ").Append(FormFieldsPerDocument).Append("\n"); + sb.Append(" HideTextTags: ").Append(HideTextTags).Append("\n"); + sb.Append(" Message: ").Append(Message).Append("\n"); + sb.Append(" Metadata: ").Append(Metadata).Append("\n"); + sb.Append(" SigningOptions: ").Append(SigningOptions).Append("\n"); + sb.Append(" Subject: ").Append(Subject).Append("\n"); + sb.Append(" TestMode: ").Append(TestMode).Append("\n"); + sb.Append(" Title: ").Append(Title).Append("\n"); + sb.Append(" UseTextTags: ").Append(UseTextTags).Append("\n"); + sb.Append(" PopulateAutoFillFields: ").Append(PopulateAutoFillFields).Append("\n"); + sb.Append(" ExpiresAt: ").Append(ExpiresAt).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as SignatureRequestEditEmbeddedRequest); + } + + /// + /// Returns true if SignatureRequestEditEmbeddedRequest instances are equal + /// + /// Instance of SignatureRequestEditEmbeddedRequest to be compared + /// Boolean + public bool Equals(SignatureRequestEditEmbeddedRequest input) + { + if (input == null) + { + return false; + } + return + ( + this.ClientId == input.ClientId || + (this.ClientId != null && + this.ClientId.Equals(input.ClientId)) + ) && + ( + this.Files == input.Files || + this.Files != null && + input.Files != null && + this.Files.SequenceEqual(input.Files) + ) && + ( + this.FileUrls == input.FileUrls || + this.FileUrls != null && + input.FileUrls != null && + this.FileUrls.SequenceEqual(input.FileUrls) + ) && + ( + this.Signers == input.Signers || + this.Signers != null && + input.Signers != null && + this.Signers.SequenceEqual(input.Signers) + ) && + ( + this.GroupedSigners == input.GroupedSigners || + this.GroupedSigners != null && + input.GroupedSigners != null && + this.GroupedSigners.SequenceEqual(input.GroupedSigners) + ) && + ( + this.AllowDecline == input.AllowDecline || + this.AllowDecline.Equals(input.AllowDecline) + ) && + ( + this.AllowReassign == input.AllowReassign || + this.AllowReassign.Equals(input.AllowReassign) + ) && + ( + this.Attachments == input.Attachments || + this.Attachments != null && + input.Attachments != null && + this.Attachments.SequenceEqual(input.Attachments) + ) && + ( + this.CcEmailAddresses == input.CcEmailAddresses || + this.CcEmailAddresses != null && + input.CcEmailAddresses != null && + this.CcEmailAddresses.SequenceEqual(input.CcEmailAddresses) + ) && + ( + this.CustomFields == input.CustomFields || + this.CustomFields != null && + input.CustomFields != null && + this.CustomFields.SequenceEqual(input.CustomFields) + ) && + ( + this.FieldOptions == input.FieldOptions || + (this.FieldOptions != null && + this.FieldOptions.Equals(input.FieldOptions)) + ) && + ( + this.FormFieldGroups == input.FormFieldGroups || + this.FormFieldGroups != null && + input.FormFieldGroups != null && + this.FormFieldGroups.SequenceEqual(input.FormFieldGroups) + ) && + ( + this.FormFieldRules == input.FormFieldRules || + this.FormFieldRules != null && + input.FormFieldRules != null && + this.FormFieldRules.SequenceEqual(input.FormFieldRules) + ) && + ( + this.FormFieldsPerDocument == input.FormFieldsPerDocument || + this.FormFieldsPerDocument != null && + input.FormFieldsPerDocument != null && + this.FormFieldsPerDocument.SequenceEqual(input.FormFieldsPerDocument) + ) && + ( + this.HideTextTags == input.HideTextTags || + this.HideTextTags.Equals(input.HideTextTags) + ) && + ( + this.Message == input.Message || + (this.Message != null && + this.Message.Equals(input.Message)) + ) && + ( + this.Metadata == input.Metadata || + this.Metadata != null && + input.Metadata != null && + this.Metadata.SequenceEqual(input.Metadata) + ) && + ( + this.SigningOptions == input.SigningOptions || + (this.SigningOptions != null && + this.SigningOptions.Equals(input.SigningOptions)) + ) && + ( + this.Subject == input.Subject || + (this.Subject != null && + this.Subject.Equals(input.Subject)) + ) && + ( + this.TestMode == input.TestMode || + this.TestMode.Equals(input.TestMode) + ) && + ( + this.Title == input.Title || + (this.Title != null && + this.Title.Equals(input.Title)) + ) && + ( + this.UseTextTags == input.UseTextTags || + this.UseTextTags.Equals(input.UseTextTags) + ) && + ( + this.PopulateAutoFillFields == input.PopulateAutoFillFields || + this.PopulateAutoFillFields.Equals(input.PopulateAutoFillFields) + ) && + ( + this.ExpiresAt == input.ExpiresAt || + (this.ExpiresAt != null && + this.ExpiresAt.Equals(input.ExpiresAt)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.ClientId != null) + { + hashCode = (hashCode * 59) + this.ClientId.GetHashCode(); + } + if (this.Files != null) + { + hashCode = (hashCode * 59) + this.Files.GetHashCode(); + } + if (this.FileUrls != null) + { + hashCode = (hashCode * 59) + this.FileUrls.GetHashCode(); + } + if (this.Signers != null) + { + hashCode = (hashCode * 59) + this.Signers.GetHashCode(); + } + if (this.GroupedSigners != null) + { + hashCode = (hashCode * 59) + this.GroupedSigners.GetHashCode(); + } + hashCode = (hashCode * 59) + this.AllowDecline.GetHashCode(); + hashCode = (hashCode * 59) + this.AllowReassign.GetHashCode(); + if (this.Attachments != null) + { + hashCode = (hashCode * 59) + this.Attachments.GetHashCode(); + } + if (this.CcEmailAddresses != null) + { + hashCode = (hashCode * 59) + this.CcEmailAddresses.GetHashCode(); + } + if (this.CustomFields != null) + { + hashCode = (hashCode * 59) + this.CustomFields.GetHashCode(); + } + if (this.FieldOptions != null) + { + hashCode = (hashCode * 59) + this.FieldOptions.GetHashCode(); + } + if (this.FormFieldGroups != null) + { + hashCode = (hashCode * 59) + this.FormFieldGroups.GetHashCode(); + } + if (this.FormFieldRules != null) + { + hashCode = (hashCode * 59) + this.FormFieldRules.GetHashCode(); + } + if (this.FormFieldsPerDocument != null) + { + hashCode = (hashCode * 59) + this.FormFieldsPerDocument.GetHashCode(); + } + hashCode = (hashCode * 59) + this.HideTextTags.GetHashCode(); + if (this.Message != null) + { + hashCode = (hashCode * 59) + this.Message.GetHashCode(); + } + if (this.Metadata != null) + { + hashCode = (hashCode * 59) + this.Metadata.GetHashCode(); + } + if (this.SigningOptions != null) + { + hashCode = (hashCode * 59) + this.SigningOptions.GetHashCode(); + } + if (this.Subject != null) + { + hashCode = (hashCode * 59) + this.Subject.GetHashCode(); + } + hashCode = (hashCode * 59) + this.TestMode.GetHashCode(); + if (this.Title != null) + { + hashCode = (hashCode * 59) + this.Title.GetHashCode(); + } + hashCode = (hashCode * 59) + this.UseTextTags.GetHashCode(); + hashCode = (hashCode * 59) + this.PopulateAutoFillFields.GetHashCode(); + if (this.ExpiresAt != null) + { + hashCode = (hashCode * 59) + this.ExpiresAt.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + // Message (string) maxLength + if (this.Message != null && this.Message.Length > 5000) + { + yield return new ValidationResult("Invalid value for Message, length must be less than 5000.", new[] { "Message" }); + } + + // Subject (string) maxLength + if (this.Subject != null && this.Subject.Length > 255) + { + yield return new ValidationResult("Invalid value for Subject, length must be less than 255.", new[] { "Subject" }); + } + + // Title (string) maxLength + if (this.Title != null && this.Title.Length > 255) + { + yield return new ValidationResult("Invalid value for Title, length must be less than 255.", new[] { "Title" }); + } + + yield break; + } + public List GetOpenApiTypes() + { + var types = new List(); + types.Add(new OpenApiType() + { + Name = "client_id", + Property = "ClientId", + Type = "string", + Value = ClientId, + }); + types.Add(new OpenApiType() + { + Name = "files", + Property = "Files", + Type = "List", + Value = Files, + }); + types.Add(new OpenApiType() + { + Name = "file_urls", + Property = "FileUrls", + Type = "List", + Value = FileUrls, + }); + types.Add(new OpenApiType() + { + Name = "signers", + Property = "Signers", + Type = "List", + Value = Signers, + }); + types.Add(new OpenApiType() + { + Name = "grouped_signers", + Property = "GroupedSigners", + Type = "List", + Value = GroupedSigners, + }); + types.Add(new OpenApiType() + { + Name = "allow_decline", + Property = "AllowDecline", + Type = "bool", + Value = AllowDecline, + }); + types.Add(new OpenApiType() + { + Name = "allow_reassign", + Property = "AllowReassign", + Type = "bool", + Value = AllowReassign, + }); + types.Add(new OpenApiType() + { + Name = "attachments", + Property = "Attachments", + Type = "List", + Value = Attachments, + }); + types.Add(new OpenApiType() + { + Name = "cc_email_addresses", + Property = "CcEmailAddresses", + Type = "List", + Value = CcEmailAddresses, + }); + types.Add(new OpenApiType() + { + Name = "custom_fields", + Property = "CustomFields", + Type = "List", + Value = CustomFields, + }); + types.Add(new OpenApiType() + { + Name = "field_options", + Property = "FieldOptions", + Type = "SubFieldOptions", + Value = FieldOptions, + }); + types.Add(new OpenApiType() + { + Name = "form_field_groups", + Property = "FormFieldGroups", + Type = "List", + Value = FormFieldGroups, + }); + types.Add(new OpenApiType() + { + Name = "form_field_rules", + Property = "FormFieldRules", + Type = "List", + Value = FormFieldRules, + }); + types.Add(new OpenApiType() + { + Name = "form_fields_per_document", + Property = "FormFieldsPerDocument", + Type = "List", + Value = FormFieldsPerDocument, + }); + types.Add(new OpenApiType() + { + Name = "hide_text_tags", + Property = "HideTextTags", + Type = "bool", + Value = HideTextTags, + }); + types.Add(new OpenApiType() + { + Name = "message", + Property = "Message", + Type = "string", + Value = Message, + }); + types.Add(new OpenApiType() + { + Name = "metadata", + Property = "Metadata", + Type = "Dictionary", + Value = Metadata, + }); + types.Add(new OpenApiType() + { + Name = "signing_options", + Property = "SigningOptions", + Type = "SubSigningOptions", + Value = SigningOptions, + }); + types.Add(new OpenApiType() + { + Name = "subject", + Property = "Subject", + Type = "string", + Value = Subject, + }); + types.Add(new OpenApiType() + { + Name = "test_mode", + Property = "TestMode", + Type = "bool", + Value = TestMode, + }); + types.Add(new OpenApiType() + { + Name = "title", + Property = "Title", + Type = "string", + Value = Title, + }); + types.Add(new OpenApiType() + { + Name = "use_text_tags", + Property = "UseTextTags", + Type = "bool", + Value = UseTextTags, + }); + types.Add(new OpenApiType() + { + Name = "populate_auto_fill_fields", + Property = "PopulateAutoFillFields", + Type = "bool", + Value = PopulateAutoFillFields, + }); + types.Add(new OpenApiType() + { + Name = "expires_at", + Property = "ExpiresAt", + Type = "int?", + Value = ExpiresAt, + }); + + return types; + } + } + +} diff --git a/src/Dropbox.Sign/Model/SignatureRequestEditEmbeddedWithTemplateRequest.cs b/src/Dropbox.Sign/Model/SignatureRequestEditEmbeddedWithTemplateRequest.cs new file mode 100644 index 0000000..fcf32fa --- /dev/null +++ b/src/Dropbox.Sign/Model/SignatureRequestEditEmbeddedWithTemplateRequest.cs @@ -0,0 +1,557 @@ +/* + * Dropbox Sign API + * + * Dropbox Sign v3 API + * + * The version of the OpenAPI document: 3.0.0 + * Contact: apisupport@hellosign.com + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Dropbox.Sign.Client.OpenAPIDateConverter; + +namespace Dropbox.Sign.Model +{ + /// + /// SignatureRequestEditEmbeddedWithTemplateRequest + /// + [DataContract(Name = "SignatureRequestEditEmbeddedWithTemplateRequest")] + [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] + public partial class SignatureRequestEditEmbeddedWithTemplateRequest : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected SignatureRequestEditEmbeddedWithTemplateRequest() { } + /// + /// Initializes a new instance of the class. + /// + /// Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the template will be used. (required). + /// Allows signers to decline to sign a document if `true`. Defaults to `false`. (default to false). + /// Add CC email recipients. Required when a CC role exists for the Template.. + /// Client id of the app you're using to create this embedded signature request. Used for security purposes. (required). + /// An array defining values and options for custom fields. Required when a custom field exists in the Template.. + /// Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.. + /// Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.. + /// The custom message in the email that will be sent to the signers.. + /// Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long.. + /// Add Signers to your Templated-based Signature Request. (required). + /// signingOptions. + /// The subject in the email that will be sent to the signers.. + /// Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`. (default to false). + /// The title you want to assign to the SignatureRequest.. + /// Controls whether [auto fill fields](https://faq.hellosign.com/hc/en-us/articles/360051467511-Auto-Fill-Fields) can automatically populate a signer's information during signing. **NOTE:** Keep your signer's information safe by ensuring that the _signer on your signature request is the intended party_ before using this feature. (default to false). + public SignatureRequestEditEmbeddedWithTemplateRequest(List templateIds = default(List), bool allowDecline = false, List ccs = default(List), string clientId = default(string), List customFields = default(List), List files = default(List), List fileUrls = default(List), string message = default(string), Dictionary metadata = default(Dictionary), List signers = default(List), SubSigningOptions signingOptions = default(SubSigningOptions), string subject = default(string), bool testMode = false, string title = default(string), bool populateAutoFillFields = false) + { + + // to ensure "templateIds" is required (not null) + if (templateIds == null) + { + throw new ArgumentNullException("templateIds is a required property for SignatureRequestEditEmbeddedWithTemplateRequest and cannot be null"); + } + this.TemplateIds = templateIds; + // to ensure "clientId" is required (not null) + if (clientId == null) + { + throw new ArgumentNullException("clientId is a required property for SignatureRequestEditEmbeddedWithTemplateRequest and cannot be null"); + } + this.ClientId = clientId; + // to ensure "signers" is required (not null) + if (signers == null) + { + throw new ArgumentNullException("signers is a required property for SignatureRequestEditEmbeddedWithTemplateRequest and cannot be null"); + } + this.Signers = signers; + this.AllowDecline = allowDecline; + this.Ccs = ccs; + this.CustomFields = customFields; + this.Files = files; + this.FileUrls = fileUrls; + this.Message = message; + this.Metadata = metadata; + this.SigningOptions = signingOptions; + this.Subject = subject; + this.TestMode = testMode; + this.Title = title; + this.PopulateAutoFillFields = populateAutoFillFields; + } + + /// + /// Attempt to instantiate and hydrate a new instance of this class + /// + /// String of JSON data representing target object + public static SignatureRequestEditEmbeddedWithTemplateRequest Init(string jsonData) + { + var obj = JsonConvert.DeserializeObject(jsonData); + + if (obj == null) + { + throw new Exception("Unable to deserialize JSON to instance of SignatureRequestEditEmbeddedWithTemplateRequest"); + } + + return obj; + } + + /// + /// Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the template will be used. + /// + /// Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the template will be used. + [DataMember(Name = "template_ids", IsRequired = true, EmitDefaultValue = true)] + public List TemplateIds { get; set; } + + /// + /// Client id of the app you're using to create this embedded signature request. Used for security purposes. + /// + /// Client id of the app you're using to create this embedded signature request. Used for security purposes. + [DataMember(Name = "client_id", IsRequired = true, EmitDefaultValue = true)] + public string ClientId { get; set; } + + /// + /// Add Signers to your Templated-based Signature Request. + /// + /// Add Signers to your Templated-based Signature Request. + [DataMember(Name = "signers", IsRequired = true, EmitDefaultValue = true)] + public List Signers { get; set; } + + /// + /// Allows signers to decline to sign a document if `true`. Defaults to `false`. + /// + /// Allows signers to decline to sign a document if `true`. Defaults to `false`. + [DataMember(Name = "allow_decline", EmitDefaultValue = true)] + public bool AllowDecline { get; set; } + + /// + /// Add CC email recipients. Required when a CC role exists for the Template. + /// + /// Add CC email recipients. Required when a CC role exists for the Template. + [DataMember(Name = "ccs", EmitDefaultValue = true)] + public List Ccs { get; set; } + + /// + /// An array defining values and options for custom fields. Required when a custom field exists in the Template. + /// + /// An array defining values and options for custom fields. Required when a custom field exists in the Template. + [DataMember(Name = "custom_fields", EmitDefaultValue = true)] + public List CustomFields { get; set; } + + /// + /// Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. + /// + /// Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. + [DataMember(Name = "files", EmitDefaultValue = true)] + public List Files { get; set; } + + /// + /// Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. + /// + /// Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. + [DataMember(Name = "file_urls", EmitDefaultValue = true)] + public List FileUrls { get; set; } + + /// + /// The custom message in the email that will be sent to the signers. + /// + /// The custom message in the email that will be sent to the signers. + [DataMember(Name = "message", EmitDefaultValue = true)] + public string Message { get; set; } + + /// + /// Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. + /// + /// Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. + [DataMember(Name = "metadata", EmitDefaultValue = true)] + public Dictionary Metadata { get; set; } + + /// + /// Gets or Sets SigningOptions + /// + [DataMember(Name = "signing_options", EmitDefaultValue = true)] + public SubSigningOptions SigningOptions { get; set; } + + /// + /// The subject in the email that will be sent to the signers. + /// + /// The subject in the email that will be sent to the signers. + [DataMember(Name = "subject", EmitDefaultValue = true)] + public string Subject { get; set; } + + /// + /// Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`. + /// + /// Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`. + [DataMember(Name = "test_mode", EmitDefaultValue = true)] + public bool TestMode { get; set; } + + /// + /// The title you want to assign to the SignatureRequest. + /// + /// The title you want to assign to the SignatureRequest. + [DataMember(Name = "title", EmitDefaultValue = true)] + public string Title { get; set; } + + /// + /// Controls whether [auto fill fields](https://faq.hellosign.com/hc/en-us/articles/360051467511-Auto-Fill-Fields) can automatically populate a signer's information during signing. **NOTE:** Keep your signer's information safe by ensuring that the _signer on your signature request is the intended party_ before using this feature. + /// + /// Controls whether [auto fill fields](https://faq.hellosign.com/hc/en-us/articles/360051467511-Auto-Fill-Fields) can automatically populate a signer's information during signing. **NOTE:** Keep your signer's information safe by ensuring that the _signer on your signature request is the intended party_ before using this feature. + [DataMember(Name = "populate_auto_fill_fields", EmitDefaultValue = true)] + public bool PopulateAutoFillFields { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class SignatureRequestEditEmbeddedWithTemplateRequest {\n"); + sb.Append(" TemplateIds: ").Append(TemplateIds).Append("\n"); + sb.Append(" ClientId: ").Append(ClientId).Append("\n"); + sb.Append(" Signers: ").Append(Signers).Append("\n"); + sb.Append(" AllowDecline: ").Append(AllowDecline).Append("\n"); + sb.Append(" Ccs: ").Append(Ccs).Append("\n"); + sb.Append(" CustomFields: ").Append(CustomFields).Append("\n"); + sb.Append(" Files: ").Append(Files).Append("\n"); + sb.Append(" FileUrls: ").Append(FileUrls).Append("\n"); + sb.Append(" Message: ").Append(Message).Append("\n"); + sb.Append(" Metadata: ").Append(Metadata).Append("\n"); + sb.Append(" SigningOptions: ").Append(SigningOptions).Append("\n"); + sb.Append(" Subject: ").Append(Subject).Append("\n"); + sb.Append(" TestMode: ").Append(TestMode).Append("\n"); + sb.Append(" Title: ").Append(Title).Append("\n"); + sb.Append(" PopulateAutoFillFields: ").Append(PopulateAutoFillFields).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as SignatureRequestEditEmbeddedWithTemplateRequest); + } + + /// + /// Returns true if SignatureRequestEditEmbeddedWithTemplateRequest instances are equal + /// + /// Instance of SignatureRequestEditEmbeddedWithTemplateRequest to be compared + /// Boolean + public bool Equals(SignatureRequestEditEmbeddedWithTemplateRequest input) + { + if (input == null) + { + return false; + } + return + ( + this.TemplateIds == input.TemplateIds || + this.TemplateIds != null && + input.TemplateIds != null && + this.TemplateIds.SequenceEqual(input.TemplateIds) + ) && + ( + this.ClientId == input.ClientId || + (this.ClientId != null && + this.ClientId.Equals(input.ClientId)) + ) && + ( + this.Signers == input.Signers || + this.Signers != null && + input.Signers != null && + this.Signers.SequenceEqual(input.Signers) + ) && + ( + this.AllowDecline == input.AllowDecline || + this.AllowDecline.Equals(input.AllowDecline) + ) && + ( + this.Ccs == input.Ccs || + this.Ccs != null && + input.Ccs != null && + this.Ccs.SequenceEqual(input.Ccs) + ) && + ( + this.CustomFields == input.CustomFields || + this.CustomFields != null && + input.CustomFields != null && + this.CustomFields.SequenceEqual(input.CustomFields) + ) && + ( + this.Files == input.Files || + this.Files != null && + input.Files != null && + this.Files.SequenceEqual(input.Files) + ) && + ( + this.FileUrls == input.FileUrls || + this.FileUrls != null && + input.FileUrls != null && + this.FileUrls.SequenceEqual(input.FileUrls) + ) && + ( + this.Message == input.Message || + (this.Message != null && + this.Message.Equals(input.Message)) + ) && + ( + this.Metadata == input.Metadata || + this.Metadata != null && + input.Metadata != null && + this.Metadata.SequenceEqual(input.Metadata) + ) && + ( + this.SigningOptions == input.SigningOptions || + (this.SigningOptions != null && + this.SigningOptions.Equals(input.SigningOptions)) + ) && + ( + this.Subject == input.Subject || + (this.Subject != null && + this.Subject.Equals(input.Subject)) + ) && + ( + this.TestMode == input.TestMode || + this.TestMode.Equals(input.TestMode) + ) && + ( + this.Title == input.Title || + (this.Title != null && + this.Title.Equals(input.Title)) + ) && + ( + this.PopulateAutoFillFields == input.PopulateAutoFillFields || + this.PopulateAutoFillFields.Equals(input.PopulateAutoFillFields) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.TemplateIds != null) + { + hashCode = (hashCode * 59) + this.TemplateIds.GetHashCode(); + } + if (this.ClientId != null) + { + hashCode = (hashCode * 59) + this.ClientId.GetHashCode(); + } + if (this.Signers != null) + { + hashCode = (hashCode * 59) + this.Signers.GetHashCode(); + } + hashCode = (hashCode * 59) + this.AllowDecline.GetHashCode(); + if (this.Ccs != null) + { + hashCode = (hashCode * 59) + this.Ccs.GetHashCode(); + } + if (this.CustomFields != null) + { + hashCode = (hashCode * 59) + this.CustomFields.GetHashCode(); + } + if (this.Files != null) + { + hashCode = (hashCode * 59) + this.Files.GetHashCode(); + } + if (this.FileUrls != null) + { + hashCode = (hashCode * 59) + this.FileUrls.GetHashCode(); + } + if (this.Message != null) + { + hashCode = (hashCode * 59) + this.Message.GetHashCode(); + } + if (this.Metadata != null) + { + hashCode = (hashCode * 59) + this.Metadata.GetHashCode(); + } + if (this.SigningOptions != null) + { + hashCode = (hashCode * 59) + this.SigningOptions.GetHashCode(); + } + if (this.Subject != null) + { + hashCode = (hashCode * 59) + this.Subject.GetHashCode(); + } + hashCode = (hashCode * 59) + this.TestMode.GetHashCode(); + if (this.Title != null) + { + hashCode = (hashCode * 59) + this.Title.GetHashCode(); + } + hashCode = (hashCode * 59) + this.PopulateAutoFillFields.GetHashCode(); + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + // Message (string) maxLength + if (this.Message != null && this.Message.Length > 5000) + { + yield return new ValidationResult("Invalid value for Message, length must be less than 5000.", new[] { "Message" }); + } + + // Subject (string) maxLength + if (this.Subject != null && this.Subject.Length > 255) + { + yield return new ValidationResult("Invalid value for Subject, length must be less than 255.", new[] { "Subject" }); + } + + // Title (string) maxLength + if (this.Title != null && this.Title.Length > 255) + { + yield return new ValidationResult("Invalid value for Title, length must be less than 255.", new[] { "Title" }); + } + + yield break; + } + public List GetOpenApiTypes() + { + var types = new List(); + types.Add(new OpenApiType() + { + Name = "template_ids", + Property = "TemplateIds", + Type = "List", + Value = TemplateIds, + }); + types.Add(new OpenApiType() + { + Name = "client_id", + Property = "ClientId", + Type = "string", + Value = ClientId, + }); + types.Add(new OpenApiType() + { + Name = "signers", + Property = "Signers", + Type = "List", + Value = Signers, + }); + types.Add(new OpenApiType() + { + Name = "allow_decline", + Property = "AllowDecline", + Type = "bool", + Value = AllowDecline, + }); + types.Add(new OpenApiType() + { + Name = "ccs", + Property = "Ccs", + Type = "List", + Value = Ccs, + }); + types.Add(new OpenApiType() + { + Name = "custom_fields", + Property = "CustomFields", + Type = "List", + Value = CustomFields, + }); + types.Add(new OpenApiType() + { + Name = "files", + Property = "Files", + Type = "List", + Value = Files, + }); + types.Add(new OpenApiType() + { + Name = "file_urls", + Property = "FileUrls", + Type = "List", + Value = FileUrls, + }); + types.Add(new OpenApiType() + { + Name = "message", + Property = "Message", + Type = "string", + Value = Message, + }); + types.Add(new OpenApiType() + { + Name = "metadata", + Property = "Metadata", + Type = "Dictionary", + Value = Metadata, + }); + types.Add(new OpenApiType() + { + Name = "signing_options", + Property = "SigningOptions", + Type = "SubSigningOptions", + Value = SigningOptions, + }); + types.Add(new OpenApiType() + { + Name = "subject", + Property = "Subject", + Type = "string", + Value = Subject, + }); + types.Add(new OpenApiType() + { + Name = "test_mode", + Property = "TestMode", + Type = "bool", + Value = TestMode, + }); + types.Add(new OpenApiType() + { + Name = "title", + Property = "Title", + Type = "string", + Value = Title, + }); + types.Add(new OpenApiType() + { + Name = "populate_auto_fill_fields", + Property = "PopulateAutoFillFields", + Type = "bool", + Value = PopulateAutoFillFields, + }); + + return types; + } + } + +} diff --git a/src/Dropbox.Sign/Model/SignatureRequestEditRequest.cs b/src/Dropbox.Sign/Model/SignatureRequestEditRequest.cs new file mode 100644 index 0000000..f239fcf --- /dev/null +++ b/src/Dropbox.Sign/Model/SignatureRequestEditRequest.cs @@ -0,0 +1,793 @@ +/* + * Dropbox Sign API + * + * Dropbox Sign v3 API + * + * The version of the OpenAPI document: 3.0.0 + * Contact: apisupport@hellosign.com + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Dropbox.Sign.Client.OpenAPIDateConverter; + +namespace Dropbox.Sign.Model +{ + /// + /// SignatureRequestEditRequest + /// + [DataContract(Name = "SignatureRequestEditRequest")] + [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] + public partial class SignatureRequestEditRequest : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected SignatureRequestEditRequest() { } + /// + /// Initializes a new instance of the class. + /// + /// Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.. + /// Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.. + /// Add Signers to your Signature Request. This endpoint requires either **signers** or **grouped_signers**, but not both.. + /// Add Grouped Signers to your Signature Request. This endpoint requires either **signers** or **grouped_signers**, but not both.. + /// Allows signers to decline to sign a document if `true`. Defaults to `false`. (default to false). + /// Allows signers to reassign their signature requests to other signers if set to `true`. Defaults to `false`. **NOTE:** Only available for Premium plan and higher. (default to false). + /// A list describing the attachments. + /// The email addresses that should be CCed.. + /// The client id of the API App you want to associate with this request. Used to apply the branding and callback url defined for the app.. + /// When used together with merge fields, `custom_fields` allows users to add pre-filled data to their signature requests. Pre-filled data can be used with \"send-once\" signature requests by adding merge fields with `form_fields_per_document` or [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) while passing values back with `custom_fields` together in one API call. For using pre-filled on repeatable signature requests, merge fields are added to templates in the Dropbox Sign UI or by calling [/template/create_embedded_draft](/api/reference/operation/templateCreateEmbeddedDraft) and then passing `custom_fields` on subsequent signature requests referencing that template.. + /// fieldOptions. + /// Group information for fields defined in `form_fields_per_document`. String-indexed JSON array with `group_label` and `requirement` keys. `form_fields_per_document` must contain fields referencing a group defined in `form_field_groups`.. + /// Conditional Logic rules for fields defined in `form_fields_per_document`.. + /// The fields that should appear on the document, expressed as an array of objects. (For more details you can read about it here: [Using Form Fields per Document](/docs/openapi/form-fields-per-document).) **NOTE:** Fields like **text**, **dropdown**, **checkbox**, **radio**, and **hyperlink** have additional required and optional parameters. Check out the list of [additional parameters](/api/reference/constants/#form-fields-per-document) for these field types. * Text Field use `SubFormFieldsPerDocumentText` * Dropdown Field use `SubFormFieldsPerDocumentDropdown` * Hyperlink Field use `SubFormFieldsPerDocumentHyperlink` * Checkbox Field use `SubFormFieldsPerDocumentCheckbox` * Radio Field use `SubFormFieldsPerDocumentRadio` * Signature Field use `SubFormFieldsPerDocumentSignature` * Date Signed Field use `SubFormFieldsPerDocumentDateSigned` * Initials Field use `SubFormFieldsPerDocumentInitials` * Text Merge Field use `SubFormFieldsPerDocumentTextMerge` * Checkbox Merge Field use `SubFormFieldsPerDocumentCheckboxMerge`. + /// Enables automatic Text Tag removal when set to true. **NOTE:** Removing text tags this way can cause unwanted clipping. We recommend leaving this setting on `false` and instead hiding your text tags using white text or a similar approach. See the [Text Tags Walkthrough](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) for more information. (default to false). + /// Send with a value of `true` if you wish to enable [electronic identification (eID)](https://www.hellosign.com/features/electronic-id), which requires the signer to verify their identity with an eID provider to sign a document.<br> **NOTE:** eID is only available on the Premium API plan. Cannot be used in `test_mode`. Only works on requests with one signer. (default to false). + /// The custom message in the email that will be sent to the signers.. + /// Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long.. + /// signingOptions. + /// The URL you want signers redirected to after they successfully sign.. + /// The subject in the email that will be sent to the signers.. + /// Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`. (default to false). + /// The title you want to assign to the SignatureRequest.. + /// Send with a value of `true` if you wish to enable [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) parsing in your document. Defaults to disabled, or `false`. (default to false). + /// When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details.. + public SignatureRequestEditRequest(List files = default(List), List fileUrls = default(List), List signers = default(List), List groupedSigners = default(List), bool allowDecline = false, bool allowReassign = false, List attachments = default(List), List ccEmailAddresses = default(List), string clientId = default(string), List customFields = default(List), SubFieldOptions fieldOptions = default(SubFieldOptions), List formFieldGroups = default(List), List formFieldRules = default(List), List formFieldsPerDocument = default(List), bool hideTextTags = false, bool isEid = false, string message = default(string), Dictionary metadata = default(Dictionary), SubSigningOptions signingOptions = default(SubSigningOptions), string signingRedirectUrl = default(string), string subject = default(string), bool testMode = false, string title = default(string), bool useTextTags = false, int? expiresAt = default(int?)) + { + + this.Files = files; + this.FileUrls = fileUrls; + this.Signers = signers; + this.GroupedSigners = groupedSigners; + this.AllowDecline = allowDecline; + this.AllowReassign = allowReassign; + this.Attachments = attachments; + this.CcEmailAddresses = ccEmailAddresses; + this.ClientId = clientId; + this.CustomFields = customFields; + this.FieldOptions = fieldOptions; + this.FormFieldGroups = formFieldGroups; + this.FormFieldRules = formFieldRules; + this.FormFieldsPerDocument = formFieldsPerDocument; + this.HideTextTags = hideTextTags; + this.IsEid = isEid; + this.Message = message; + this.Metadata = metadata; + this.SigningOptions = signingOptions; + this.SigningRedirectUrl = signingRedirectUrl; + this.Subject = subject; + this.TestMode = testMode; + this.Title = title; + this.UseTextTags = useTextTags; + this.ExpiresAt = expiresAt; + } + + /// + /// Attempt to instantiate and hydrate a new instance of this class + /// + /// String of JSON data representing target object + public static SignatureRequestEditRequest Init(string jsonData) + { + var obj = JsonConvert.DeserializeObject(jsonData); + + if (obj == null) + { + throw new Exception("Unable to deserialize JSON to instance of SignatureRequestEditRequest"); + } + + return obj; + } + + /// + /// Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. + /// + /// Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. + [DataMember(Name = "files", EmitDefaultValue = true)] + public List Files { get; set; } + + /// + /// Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. + /// + /// Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. + [DataMember(Name = "file_urls", EmitDefaultValue = true)] + public List FileUrls { get; set; } + + /// + /// Add Signers to your Signature Request. This endpoint requires either **signers** or **grouped_signers**, but not both. + /// + /// Add Signers to your Signature Request. This endpoint requires either **signers** or **grouped_signers**, but not both. + [DataMember(Name = "signers", EmitDefaultValue = true)] + public List Signers { get; set; } + + /// + /// Add Grouped Signers to your Signature Request. This endpoint requires either **signers** or **grouped_signers**, but not both. + /// + /// Add Grouped Signers to your Signature Request. This endpoint requires either **signers** or **grouped_signers**, but not both. + [DataMember(Name = "grouped_signers", EmitDefaultValue = true)] + public List GroupedSigners { get; set; } + + /// + /// Allows signers to decline to sign a document if `true`. Defaults to `false`. + /// + /// Allows signers to decline to sign a document if `true`. Defaults to `false`. + [DataMember(Name = "allow_decline", EmitDefaultValue = true)] + public bool AllowDecline { get; set; } + + /// + /// Allows signers to reassign their signature requests to other signers if set to `true`. Defaults to `false`. **NOTE:** Only available for Premium plan and higher. + /// + /// Allows signers to reassign their signature requests to other signers if set to `true`. Defaults to `false`. **NOTE:** Only available for Premium plan and higher. + [DataMember(Name = "allow_reassign", EmitDefaultValue = true)] + public bool AllowReassign { get; set; } + + /// + /// A list describing the attachments + /// + /// A list describing the attachments + [DataMember(Name = "attachments", EmitDefaultValue = true)] + public List Attachments { get; set; } + + /// + /// The email addresses that should be CCed. + /// + /// The email addresses that should be CCed. + [DataMember(Name = "cc_email_addresses", EmitDefaultValue = true)] + public List CcEmailAddresses { get; set; } + + /// + /// The client id of the API App you want to associate with this request. Used to apply the branding and callback url defined for the app. + /// + /// The client id of the API App you want to associate with this request. Used to apply the branding and callback url defined for the app. + [DataMember(Name = "client_id", EmitDefaultValue = true)] + public string ClientId { get; set; } + + /// + /// When used together with merge fields, `custom_fields` allows users to add pre-filled data to their signature requests. Pre-filled data can be used with \"send-once\" signature requests by adding merge fields with `form_fields_per_document` or [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) while passing values back with `custom_fields` together in one API call. For using pre-filled on repeatable signature requests, merge fields are added to templates in the Dropbox Sign UI or by calling [/template/create_embedded_draft](/api/reference/operation/templateCreateEmbeddedDraft) and then passing `custom_fields` on subsequent signature requests referencing that template. + /// + /// When used together with merge fields, `custom_fields` allows users to add pre-filled data to their signature requests. Pre-filled data can be used with \"send-once\" signature requests by adding merge fields with `form_fields_per_document` or [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) while passing values back with `custom_fields` together in one API call. For using pre-filled on repeatable signature requests, merge fields are added to templates in the Dropbox Sign UI or by calling [/template/create_embedded_draft](/api/reference/operation/templateCreateEmbeddedDraft) and then passing `custom_fields` on subsequent signature requests referencing that template. + [DataMember(Name = "custom_fields", EmitDefaultValue = true)] + public List CustomFields { get; set; } + + /// + /// Gets or Sets FieldOptions + /// + [DataMember(Name = "field_options", EmitDefaultValue = true)] + public SubFieldOptions FieldOptions { get; set; } + + /// + /// Group information for fields defined in `form_fields_per_document`. String-indexed JSON array with `group_label` and `requirement` keys. `form_fields_per_document` must contain fields referencing a group defined in `form_field_groups`. + /// + /// Group information for fields defined in `form_fields_per_document`. String-indexed JSON array with `group_label` and `requirement` keys. `form_fields_per_document` must contain fields referencing a group defined in `form_field_groups`. + [DataMember(Name = "form_field_groups", EmitDefaultValue = true)] + public List FormFieldGroups { get; set; } + + /// + /// Conditional Logic rules for fields defined in `form_fields_per_document`. + /// + /// Conditional Logic rules for fields defined in `form_fields_per_document`. + [DataMember(Name = "form_field_rules", EmitDefaultValue = true)] + public List FormFieldRules { get; set; } + + /// + /// The fields that should appear on the document, expressed as an array of objects. (For more details you can read about it here: [Using Form Fields per Document](/docs/openapi/form-fields-per-document).) **NOTE:** Fields like **text**, **dropdown**, **checkbox**, **radio**, and **hyperlink** have additional required and optional parameters. Check out the list of [additional parameters](/api/reference/constants/#form-fields-per-document) for these field types. * Text Field use `SubFormFieldsPerDocumentText` * Dropdown Field use `SubFormFieldsPerDocumentDropdown` * Hyperlink Field use `SubFormFieldsPerDocumentHyperlink` * Checkbox Field use `SubFormFieldsPerDocumentCheckbox` * Radio Field use `SubFormFieldsPerDocumentRadio` * Signature Field use `SubFormFieldsPerDocumentSignature` * Date Signed Field use `SubFormFieldsPerDocumentDateSigned` * Initials Field use `SubFormFieldsPerDocumentInitials` * Text Merge Field use `SubFormFieldsPerDocumentTextMerge` * Checkbox Merge Field use `SubFormFieldsPerDocumentCheckboxMerge` + /// + /// The fields that should appear on the document, expressed as an array of objects. (For more details you can read about it here: [Using Form Fields per Document](/docs/openapi/form-fields-per-document).) **NOTE:** Fields like **text**, **dropdown**, **checkbox**, **radio**, and **hyperlink** have additional required and optional parameters. Check out the list of [additional parameters](/api/reference/constants/#form-fields-per-document) for these field types. * Text Field use `SubFormFieldsPerDocumentText` * Dropdown Field use `SubFormFieldsPerDocumentDropdown` * Hyperlink Field use `SubFormFieldsPerDocumentHyperlink` * Checkbox Field use `SubFormFieldsPerDocumentCheckbox` * Radio Field use `SubFormFieldsPerDocumentRadio` * Signature Field use `SubFormFieldsPerDocumentSignature` * Date Signed Field use `SubFormFieldsPerDocumentDateSigned` * Initials Field use `SubFormFieldsPerDocumentInitials` * Text Merge Field use `SubFormFieldsPerDocumentTextMerge` * Checkbox Merge Field use `SubFormFieldsPerDocumentCheckboxMerge` + [DataMember(Name = "form_fields_per_document", EmitDefaultValue = true)] + public List FormFieldsPerDocument { get; set; } + + /// + /// Enables automatic Text Tag removal when set to true. **NOTE:** Removing text tags this way can cause unwanted clipping. We recommend leaving this setting on `false` and instead hiding your text tags using white text or a similar approach. See the [Text Tags Walkthrough](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) for more information. + /// + /// Enables automatic Text Tag removal when set to true. **NOTE:** Removing text tags this way can cause unwanted clipping. We recommend leaving this setting on `false` and instead hiding your text tags using white text or a similar approach. See the [Text Tags Walkthrough](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) for more information. + [DataMember(Name = "hide_text_tags", EmitDefaultValue = true)] + public bool HideTextTags { get; set; } + + /// + /// Send with a value of `true` if you wish to enable [electronic identification (eID)](https://www.hellosign.com/features/electronic-id), which requires the signer to verify their identity with an eID provider to sign a document.<br> **NOTE:** eID is only available on the Premium API plan. Cannot be used in `test_mode`. Only works on requests with one signer. + /// + /// Send with a value of `true` if you wish to enable [electronic identification (eID)](https://www.hellosign.com/features/electronic-id), which requires the signer to verify their identity with an eID provider to sign a document.<br> **NOTE:** eID is only available on the Premium API plan. Cannot be used in `test_mode`. Only works on requests with one signer. + [DataMember(Name = "is_eid", EmitDefaultValue = true)] + public bool IsEid { get; set; } + + /// + /// The custom message in the email that will be sent to the signers. + /// + /// The custom message in the email that will be sent to the signers. + [DataMember(Name = "message", EmitDefaultValue = true)] + public string Message { get; set; } + + /// + /// Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. + /// + /// Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. + [DataMember(Name = "metadata", EmitDefaultValue = true)] + public Dictionary Metadata { get; set; } + + /// + /// Gets or Sets SigningOptions + /// + [DataMember(Name = "signing_options", EmitDefaultValue = true)] + public SubSigningOptions SigningOptions { get; set; } + + /// + /// The URL you want signers redirected to after they successfully sign. + /// + /// The URL you want signers redirected to after they successfully sign. + [DataMember(Name = "signing_redirect_url", EmitDefaultValue = true)] + public string SigningRedirectUrl { get; set; } + + /// + /// The subject in the email that will be sent to the signers. + /// + /// The subject in the email that will be sent to the signers. + [DataMember(Name = "subject", EmitDefaultValue = true)] + public string Subject { get; set; } + + /// + /// Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`. + /// + /// Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`. + [DataMember(Name = "test_mode", EmitDefaultValue = true)] + public bool TestMode { get; set; } + + /// + /// The title you want to assign to the SignatureRequest. + /// + /// The title you want to assign to the SignatureRequest. + [DataMember(Name = "title", EmitDefaultValue = true)] + public string Title { get; set; } + + /// + /// Send with a value of `true` if you wish to enable [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) parsing in your document. Defaults to disabled, or `false`. + /// + /// Send with a value of `true` if you wish to enable [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) parsing in your document. Defaults to disabled, or `false`. + [DataMember(Name = "use_text_tags", EmitDefaultValue = true)] + public bool UseTextTags { get; set; } + + /// + /// When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details. + /// + /// When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details. + [DataMember(Name = "expires_at", EmitDefaultValue = true)] + public int? ExpiresAt { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class SignatureRequestEditRequest {\n"); + sb.Append(" Files: ").Append(Files).Append("\n"); + sb.Append(" FileUrls: ").Append(FileUrls).Append("\n"); + sb.Append(" Signers: ").Append(Signers).Append("\n"); + sb.Append(" GroupedSigners: ").Append(GroupedSigners).Append("\n"); + sb.Append(" AllowDecline: ").Append(AllowDecline).Append("\n"); + sb.Append(" AllowReassign: ").Append(AllowReassign).Append("\n"); + sb.Append(" Attachments: ").Append(Attachments).Append("\n"); + sb.Append(" CcEmailAddresses: ").Append(CcEmailAddresses).Append("\n"); + sb.Append(" ClientId: ").Append(ClientId).Append("\n"); + sb.Append(" CustomFields: ").Append(CustomFields).Append("\n"); + sb.Append(" FieldOptions: ").Append(FieldOptions).Append("\n"); + sb.Append(" FormFieldGroups: ").Append(FormFieldGroups).Append("\n"); + sb.Append(" FormFieldRules: ").Append(FormFieldRules).Append("\n"); + sb.Append(" FormFieldsPerDocument: ").Append(FormFieldsPerDocument).Append("\n"); + sb.Append(" HideTextTags: ").Append(HideTextTags).Append("\n"); + sb.Append(" IsEid: ").Append(IsEid).Append("\n"); + sb.Append(" Message: ").Append(Message).Append("\n"); + sb.Append(" Metadata: ").Append(Metadata).Append("\n"); + sb.Append(" SigningOptions: ").Append(SigningOptions).Append("\n"); + sb.Append(" SigningRedirectUrl: ").Append(SigningRedirectUrl).Append("\n"); + sb.Append(" Subject: ").Append(Subject).Append("\n"); + sb.Append(" TestMode: ").Append(TestMode).Append("\n"); + sb.Append(" Title: ").Append(Title).Append("\n"); + sb.Append(" UseTextTags: ").Append(UseTextTags).Append("\n"); + sb.Append(" ExpiresAt: ").Append(ExpiresAt).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as SignatureRequestEditRequest); + } + + /// + /// Returns true if SignatureRequestEditRequest instances are equal + /// + /// Instance of SignatureRequestEditRequest to be compared + /// Boolean + public bool Equals(SignatureRequestEditRequest input) + { + if (input == null) + { + return false; + } + return + ( + this.Files == input.Files || + this.Files != null && + input.Files != null && + this.Files.SequenceEqual(input.Files) + ) && + ( + this.FileUrls == input.FileUrls || + this.FileUrls != null && + input.FileUrls != null && + this.FileUrls.SequenceEqual(input.FileUrls) + ) && + ( + this.Signers == input.Signers || + this.Signers != null && + input.Signers != null && + this.Signers.SequenceEqual(input.Signers) + ) && + ( + this.GroupedSigners == input.GroupedSigners || + this.GroupedSigners != null && + input.GroupedSigners != null && + this.GroupedSigners.SequenceEqual(input.GroupedSigners) + ) && + ( + this.AllowDecline == input.AllowDecline || + this.AllowDecline.Equals(input.AllowDecline) + ) && + ( + this.AllowReassign == input.AllowReassign || + this.AllowReassign.Equals(input.AllowReassign) + ) && + ( + this.Attachments == input.Attachments || + this.Attachments != null && + input.Attachments != null && + this.Attachments.SequenceEqual(input.Attachments) + ) && + ( + this.CcEmailAddresses == input.CcEmailAddresses || + this.CcEmailAddresses != null && + input.CcEmailAddresses != null && + this.CcEmailAddresses.SequenceEqual(input.CcEmailAddresses) + ) && + ( + this.ClientId == input.ClientId || + (this.ClientId != null && + this.ClientId.Equals(input.ClientId)) + ) && + ( + this.CustomFields == input.CustomFields || + this.CustomFields != null && + input.CustomFields != null && + this.CustomFields.SequenceEqual(input.CustomFields) + ) && + ( + this.FieldOptions == input.FieldOptions || + (this.FieldOptions != null && + this.FieldOptions.Equals(input.FieldOptions)) + ) && + ( + this.FormFieldGroups == input.FormFieldGroups || + this.FormFieldGroups != null && + input.FormFieldGroups != null && + this.FormFieldGroups.SequenceEqual(input.FormFieldGroups) + ) && + ( + this.FormFieldRules == input.FormFieldRules || + this.FormFieldRules != null && + input.FormFieldRules != null && + this.FormFieldRules.SequenceEqual(input.FormFieldRules) + ) && + ( + this.FormFieldsPerDocument == input.FormFieldsPerDocument || + this.FormFieldsPerDocument != null && + input.FormFieldsPerDocument != null && + this.FormFieldsPerDocument.SequenceEqual(input.FormFieldsPerDocument) + ) && + ( + this.HideTextTags == input.HideTextTags || + this.HideTextTags.Equals(input.HideTextTags) + ) && + ( + this.IsEid == input.IsEid || + this.IsEid.Equals(input.IsEid) + ) && + ( + this.Message == input.Message || + (this.Message != null && + this.Message.Equals(input.Message)) + ) && + ( + this.Metadata == input.Metadata || + this.Metadata != null && + input.Metadata != null && + this.Metadata.SequenceEqual(input.Metadata) + ) && + ( + this.SigningOptions == input.SigningOptions || + (this.SigningOptions != null && + this.SigningOptions.Equals(input.SigningOptions)) + ) && + ( + this.SigningRedirectUrl == input.SigningRedirectUrl || + (this.SigningRedirectUrl != null && + this.SigningRedirectUrl.Equals(input.SigningRedirectUrl)) + ) && + ( + this.Subject == input.Subject || + (this.Subject != null && + this.Subject.Equals(input.Subject)) + ) && + ( + this.TestMode == input.TestMode || + this.TestMode.Equals(input.TestMode) + ) && + ( + this.Title == input.Title || + (this.Title != null && + this.Title.Equals(input.Title)) + ) && + ( + this.UseTextTags == input.UseTextTags || + this.UseTextTags.Equals(input.UseTextTags) + ) && + ( + this.ExpiresAt == input.ExpiresAt || + (this.ExpiresAt != null && + this.ExpiresAt.Equals(input.ExpiresAt)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Files != null) + { + hashCode = (hashCode * 59) + this.Files.GetHashCode(); + } + if (this.FileUrls != null) + { + hashCode = (hashCode * 59) + this.FileUrls.GetHashCode(); + } + if (this.Signers != null) + { + hashCode = (hashCode * 59) + this.Signers.GetHashCode(); + } + if (this.GroupedSigners != null) + { + hashCode = (hashCode * 59) + this.GroupedSigners.GetHashCode(); + } + hashCode = (hashCode * 59) + this.AllowDecline.GetHashCode(); + hashCode = (hashCode * 59) + this.AllowReassign.GetHashCode(); + if (this.Attachments != null) + { + hashCode = (hashCode * 59) + this.Attachments.GetHashCode(); + } + if (this.CcEmailAddresses != null) + { + hashCode = (hashCode * 59) + this.CcEmailAddresses.GetHashCode(); + } + if (this.ClientId != null) + { + hashCode = (hashCode * 59) + this.ClientId.GetHashCode(); + } + if (this.CustomFields != null) + { + hashCode = (hashCode * 59) + this.CustomFields.GetHashCode(); + } + if (this.FieldOptions != null) + { + hashCode = (hashCode * 59) + this.FieldOptions.GetHashCode(); + } + if (this.FormFieldGroups != null) + { + hashCode = (hashCode * 59) + this.FormFieldGroups.GetHashCode(); + } + if (this.FormFieldRules != null) + { + hashCode = (hashCode * 59) + this.FormFieldRules.GetHashCode(); + } + if (this.FormFieldsPerDocument != null) + { + hashCode = (hashCode * 59) + this.FormFieldsPerDocument.GetHashCode(); + } + hashCode = (hashCode * 59) + this.HideTextTags.GetHashCode(); + hashCode = (hashCode * 59) + this.IsEid.GetHashCode(); + if (this.Message != null) + { + hashCode = (hashCode * 59) + this.Message.GetHashCode(); + } + if (this.Metadata != null) + { + hashCode = (hashCode * 59) + this.Metadata.GetHashCode(); + } + if (this.SigningOptions != null) + { + hashCode = (hashCode * 59) + this.SigningOptions.GetHashCode(); + } + if (this.SigningRedirectUrl != null) + { + hashCode = (hashCode * 59) + this.SigningRedirectUrl.GetHashCode(); + } + if (this.Subject != null) + { + hashCode = (hashCode * 59) + this.Subject.GetHashCode(); + } + hashCode = (hashCode * 59) + this.TestMode.GetHashCode(); + if (this.Title != null) + { + hashCode = (hashCode * 59) + this.Title.GetHashCode(); + } + hashCode = (hashCode * 59) + this.UseTextTags.GetHashCode(); + if (this.ExpiresAt != null) + { + hashCode = (hashCode * 59) + this.ExpiresAt.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + // Message (string) maxLength + if (this.Message != null && this.Message.Length > 5000) + { + yield return new ValidationResult("Invalid value for Message, length must be less than 5000.", new[] { "Message" }); + } + + // Subject (string) maxLength + if (this.Subject != null && this.Subject.Length > 255) + { + yield return new ValidationResult("Invalid value for Subject, length must be less than 255.", new[] { "Subject" }); + } + + // Title (string) maxLength + if (this.Title != null && this.Title.Length > 255) + { + yield return new ValidationResult("Invalid value for Title, length must be less than 255.", new[] { "Title" }); + } + + yield break; + } + public List GetOpenApiTypes() + { + var types = new List(); + types.Add(new OpenApiType() + { + Name = "files", + Property = "Files", + Type = "List", + Value = Files, + }); + types.Add(new OpenApiType() + { + Name = "file_urls", + Property = "FileUrls", + Type = "List", + Value = FileUrls, + }); + types.Add(new OpenApiType() + { + Name = "signers", + Property = "Signers", + Type = "List", + Value = Signers, + }); + types.Add(new OpenApiType() + { + Name = "grouped_signers", + Property = "GroupedSigners", + Type = "List", + Value = GroupedSigners, + }); + types.Add(new OpenApiType() + { + Name = "allow_decline", + Property = "AllowDecline", + Type = "bool", + Value = AllowDecline, + }); + types.Add(new OpenApiType() + { + Name = "allow_reassign", + Property = "AllowReassign", + Type = "bool", + Value = AllowReassign, + }); + types.Add(new OpenApiType() + { + Name = "attachments", + Property = "Attachments", + Type = "List", + Value = Attachments, + }); + types.Add(new OpenApiType() + { + Name = "cc_email_addresses", + Property = "CcEmailAddresses", + Type = "List", + Value = CcEmailAddresses, + }); + types.Add(new OpenApiType() + { + Name = "client_id", + Property = "ClientId", + Type = "string", + Value = ClientId, + }); + types.Add(new OpenApiType() + { + Name = "custom_fields", + Property = "CustomFields", + Type = "List", + Value = CustomFields, + }); + types.Add(new OpenApiType() + { + Name = "field_options", + Property = "FieldOptions", + Type = "SubFieldOptions", + Value = FieldOptions, + }); + types.Add(new OpenApiType() + { + Name = "form_field_groups", + Property = "FormFieldGroups", + Type = "List", + Value = FormFieldGroups, + }); + types.Add(new OpenApiType() + { + Name = "form_field_rules", + Property = "FormFieldRules", + Type = "List", + Value = FormFieldRules, + }); + types.Add(new OpenApiType() + { + Name = "form_fields_per_document", + Property = "FormFieldsPerDocument", + Type = "List", + Value = FormFieldsPerDocument, + }); + types.Add(new OpenApiType() + { + Name = "hide_text_tags", + Property = "HideTextTags", + Type = "bool", + Value = HideTextTags, + }); + types.Add(new OpenApiType() + { + Name = "is_eid", + Property = "IsEid", + Type = "bool", + Value = IsEid, + }); + types.Add(new OpenApiType() + { + Name = "message", + Property = "Message", + Type = "string", + Value = Message, + }); + types.Add(new OpenApiType() + { + Name = "metadata", + Property = "Metadata", + Type = "Dictionary", + Value = Metadata, + }); + types.Add(new OpenApiType() + { + Name = "signing_options", + Property = "SigningOptions", + Type = "SubSigningOptions", + Value = SigningOptions, + }); + types.Add(new OpenApiType() + { + Name = "signing_redirect_url", + Property = "SigningRedirectUrl", + Type = "string", + Value = SigningRedirectUrl, + }); + types.Add(new OpenApiType() + { + Name = "subject", + Property = "Subject", + Type = "string", + Value = Subject, + }); + types.Add(new OpenApiType() + { + Name = "test_mode", + Property = "TestMode", + Type = "bool", + Value = TestMode, + }); + types.Add(new OpenApiType() + { + Name = "title", + Property = "Title", + Type = "string", + Value = Title, + }); + types.Add(new OpenApiType() + { + Name = "use_text_tags", + Property = "UseTextTags", + Type = "bool", + Value = UseTextTags, + }); + types.Add(new OpenApiType() + { + Name = "expires_at", + Property = "ExpiresAt", + Type = "int?", + Value = ExpiresAt, + }); + + return types; + } + } + +} diff --git a/src/Dropbox.Sign/Model/SignatureRequestEditWithTemplateRequest.cs b/src/Dropbox.Sign/Model/SignatureRequestEditWithTemplateRequest.cs new file mode 100644 index 0000000..84990b8 --- /dev/null +++ b/src/Dropbox.Sign/Model/SignatureRequestEditWithTemplateRequest.cs @@ -0,0 +1,578 @@ +/* + * Dropbox Sign API + * + * Dropbox Sign v3 API + * + * The version of the OpenAPI document: 3.0.0 + * Contact: apisupport@hellosign.com + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Dropbox.Sign.Client.OpenAPIDateConverter; + +namespace Dropbox.Sign.Model +{ + /// + /// SignatureRequestEditWithTemplateRequest + /// + [DataContract(Name = "SignatureRequestEditWithTemplateRequest")] + [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] + public partial class SignatureRequestEditWithTemplateRequest : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected SignatureRequestEditWithTemplateRequest() { } + /// + /// Initializes a new instance of the class. + /// + /// Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the template will be used. (required). + /// Allows signers to decline to sign a document if `true`. Defaults to `false`. (default to false). + /// Add CC email recipients. Required when a CC role exists for the Template.. + /// Client id of the app to associate with the signature request. Used to apply the branding and callback url defined for the app.. + /// An array defining values and options for custom fields. Required when a custom field exists in the Template.. + /// Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.. + /// Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.. + /// Send with a value of `true` if you wish to enable [electronic identification (eID)](https://www.hellosign.com/features/electronic-id), which requires the signer to verify their identity with an eID provider to sign a document.<br> **NOTE:** eID is only available on the Premium API plan. Cannot be used in `test_mode`. Only works on requests with one signer. (default to false). + /// The custom message in the email that will be sent to the signers.. + /// Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long.. + /// Add Signers to your Templated-based Signature Request. (required). + /// signingOptions. + /// The URL you want signers redirected to after they successfully sign.. + /// The subject in the email that will be sent to the signers.. + /// Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`. (default to false). + /// The title you want to assign to the SignatureRequest.. + public SignatureRequestEditWithTemplateRequest(List templateIds = default(List), bool allowDecline = false, List ccs = default(List), string clientId = default(string), List customFields = default(List), List files = default(List), List fileUrls = default(List), bool isEid = false, string message = default(string), Dictionary metadata = default(Dictionary), List signers = default(List), SubSigningOptions signingOptions = default(SubSigningOptions), string signingRedirectUrl = default(string), string subject = default(string), bool testMode = false, string title = default(string)) + { + + // to ensure "templateIds" is required (not null) + if (templateIds == null) + { + throw new ArgumentNullException("templateIds is a required property for SignatureRequestEditWithTemplateRequest and cannot be null"); + } + this.TemplateIds = templateIds; + // to ensure "signers" is required (not null) + if (signers == null) + { + throw new ArgumentNullException("signers is a required property for SignatureRequestEditWithTemplateRequest and cannot be null"); + } + this.Signers = signers; + this.AllowDecline = allowDecline; + this.Ccs = ccs; + this.ClientId = clientId; + this.CustomFields = customFields; + this.Files = files; + this.FileUrls = fileUrls; + this.IsEid = isEid; + this.Message = message; + this.Metadata = metadata; + this.SigningOptions = signingOptions; + this.SigningRedirectUrl = signingRedirectUrl; + this.Subject = subject; + this.TestMode = testMode; + this.Title = title; + } + + /// + /// Attempt to instantiate and hydrate a new instance of this class + /// + /// String of JSON data representing target object + public static SignatureRequestEditWithTemplateRequest Init(string jsonData) + { + var obj = JsonConvert.DeserializeObject(jsonData); + + if (obj == null) + { + throw new Exception("Unable to deserialize JSON to instance of SignatureRequestEditWithTemplateRequest"); + } + + return obj; + } + + /// + /// Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the template will be used. + /// + /// Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the template will be used. + [DataMember(Name = "template_ids", IsRequired = true, EmitDefaultValue = true)] + public List TemplateIds { get; set; } + + /// + /// Add Signers to your Templated-based Signature Request. + /// + /// Add Signers to your Templated-based Signature Request. + [DataMember(Name = "signers", IsRequired = true, EmitDefaultValue = true)] + public List Signers { get; set; } + + /// + /// Allows signers to decline to sign a document if `true`. Defaults to `false`. + /// + /// Allows signers to decline to sign a document if `true`. Defaults to `false`. + [DataMember(Name = "allow_decline", EmitDefaultValue = true)] + public bool AllowDecline { get; set; } + + /// + /// Add CC email recipients. Required when a CC role exists for the Template. + /// + /// Add CC email recipients. Required when a CC role exists for the Template. + [DataMember(Name = "ccs", EmitDefaultValue = true)] + public List Ccs { get; set; } + + /// + /// Client id of the app to associate with the signature request. Used to apply the branding and callback url defined for the app. + /// + /// Client id of the app to associate with the signature request. Used to apply the branding and callback url defined for the app. + [DataMember(Name = "client_id", EmitDefaultValue = true)] + public string ClientId { get; set; } + + /// + /// An array defining values and options for custom fields. Required when a custom field exists in the Template. + /// + /// An array defining values and options for custom fields. Required when a custom field exists in the Template. + [DataMember(Name = "custom_fields", EmitDefaultValue = true)] + public List CustomFields { get; set; } + + /// + /// Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. + /// + /// Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. + [DataMember(Name = "files", EmitDefaultValue = true)] + public List Files { get; set; } + + /// + /// Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. + /// + /// Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. + [DataMember(Name = "file_urls", EmitDefaultValue = true)] + public List FileUrls { get; set; } + + /// + /// Send with a value of `true` if you wish to enable [electronic identification (eID)](https://www.hellosign.com/features/electronic-id), which requires the signer to verify their identity with an eID provider to sign a document.<br> **NOTE:** eID is only available on the Premium API plan. Cannot be used in `test_mode`. Only works on requests with one signer. + /// + /// Send with a value of `true` if you wish to enable [electronic identification (eID)](https://www.hellosign.com/features/electronic-id), which requires the signer to verify their identity with an eID provider to sign a document.<br> **NOTE:** eID is only available on the Premium API plan. Cannot be used in `test_mode`. Only works on requests with one signer. + [DataMember(Name = "is_eid", EmitDefaultValue = true)] + public bool IsEid { get; set; } + + /// + /// The custom message in the email that will be sent to the signers. + /// + /// The custom message in the email that will be sent to the signers. + [DataMember(Name = "message", EmitDefaultValue = true)] + public string Message { get; set; } + + /// + /// Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. + /// + /// Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. + [DataMember(Name = "metadata", EmitDefaultValue = true)] + public Dictionary Metadata { get; set; } + + /// + /// Gets or Sets SigningOptions + /// + [DataMember(Name = "signing_options", EmitDefaultValue = true)] + public SubSigningOptions SigningOptions { get; set; } + + /// + /// The URL you want signers redirected to after they successfully sign. + /// + /// The URL you want signers redirected to after they successfully sign. + [DataMember(Name = "signing_redirect_url", EmitDefaultValue = true)] + public string SigningRedirectUrl { get; set; } + + /// + /// The subject in the email that will be sent to the signers. + /// + /// The subject in the email that will be sent to the signers. + [DataMember(Name = "subject", EmitDefaultValue = true)] + public string Subject { get; set; } + + /// + /// Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`. + /// + /// Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`. + [DataMember(Name = "test_mode", EmitDefaultValue = true)] + public bool TestMode { get; set; } + + /// + /// The title you want to assign to the SignatureRequest. + /// + /// The title you want to assign to the SignatureRequest. + [DataMember(Name = "title", EmitDefaultValue = true)] + public string Title { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class SignatureRequestEditWithTemplateRequest {\n"); + sb.Append(" TemplateIds: ").Append(TemplateIds).Append("\n"); + sb.Append(" Signers: ").Append(Signers).Append("\n"); + sb.Append(" AllowDecline: ").Append(AllowDecline).Append("\n"); + sb.Append(" Ccs: ").Append(Ccs).Append("\n"); + sb.Append(" ClientId: ").Append(ClientId).Append("\n"); + sb.Append(" CustomFields: ").Append(CustomFields).Append("\n"); + sb.Append(" Files: ").Append(Files).Append("\n"); + sb.Append(" FileUrls: ").Append(FileUrls).Append("\n"); + sb.Append(" IsEid: ").Append(IsEid).Append("\n"); + sb.Append(" Message: ").Append(Message).Append("\n"); + sb.Append(" Metadata: ").Append(Metadata).Append("\n"); + sb.Append(" SigningOptions: ").Append(SigningOptions).Append("\n"); + sb.Append(" SigningRedirectUrl: ").Append(SigningRedirectUrl).Append("\n"); + sb.Append(" Subject: ").Append(Subject).Append("\n"); + sb.Append(" TestMode: ").Append(TestMode).Append("\n"); + sb.Append(" Title: ").Append(Title).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as SignatureRequestEditWithTemplateRequest); + } + + /// + /// Returns true if SignatureRequestEditWithTemplateRequest instances are equal + /// + /// Instance of SignatureRequestEditWithTemplateRequest to be compared + /// Boolean + public bool Equals(SignatureRequestEditWithTemplateRequest input) + { + if (input == null) + { + return false; + } + return + ( + this.TemplateIds == input.TemplateIds || + this.TemplateIds != null && + input.TemplateIds != null && + this.TemplateIds.SequenceEqual(input.TemplateIds) + ) && + ( + this.Signers == input.Signers || + this.Signers != null && + input.Signers != null && + this.Signers.SequenceEqual(input.Signers) + ) && + ( + this.AllowDecline == input.AllowDecline || + this.AllowDecline.Equals(input.AllowDecline) + ) && + ( + this.Ccs == input.Ccs || + this.Ccs != null && + input.Ccs != null && + this.Ccs.SequenceEqual(input.Ccs) + ) && + ( + this.ClientId == input.ClientId || + (this.ClientId != null && + this.ClientId.Equals(input.ClientId)) + ) && + ( + this.CustomFields == input.CustomFields || + this.CustomFields != null && + input.CustomFields != null && + this.CustomFields.SequenceEqual(input.CustomFields) + ) && + ( + this.Files == input.Files || + this.Files != null && + input.Files != null && + this.Files.SequenceEqual(input.Files) + ) && + ( + this.FileUrls == input.FileUrls || + this.FileUrls != null && + input.FileUrls != null && + this.FileUrls.SequenceEqual(input.FileUrls) + ) && + ( + this.IsEid == input.IsEid || + this.IsEid.Equals(input.IsEid) + ) && + ( + this.Message == input.Message || + (this.Message != null && + this.Message.Equals(input.Message)) + ) && + ( + this.Metadata == input.Metadata || + this.Metadata != null && + input.Metadata != null && + this.Metadata.SequenceEqual(input.Metadata) + ) && + ( + this.SigningOptions == input.SigningOptions || + (this.SigningOptions != null && + this.SigningOptions.Equals(input.SigningOptions)) + ) && + ( + this.SigningRedirectUrl == input.SigningRedirectUrl || + (this.SigningRedirectUrl != null && + this.SigningRedirectUrl.Equals(input.SigningRedirectUrl)) + ) && + ( + this.Subject == input.Subject || + (this.Subject != null && + this.Subject.Equals(input.Subject)) + ) && + ( + this.TestMode == input.TestMode || + this.TestMode.Equals(input.TestMode) + ) && + ( + this.Title == input.Title || + (this.Title != null && + this.Title.Equals(input.Title)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.TemplateIds != null) + { + hashCode = (hashCode * 59) + this.TemplateIds.GetHashCode(); + } + if (this.Signers != null) + { + hashCode = (hashCode * 59) + this.Signers.GetHashCode(); + } + hashCode = (hashCode * 59) + this.AllowDecline.GetHashCode(); + if (this.Ccs != null) + { + hashCode = (hashCode * 59) + this.Ccs.GetHashCode(); + } + if (this.ClientId != null) + { + hashCode = (hashCode * 59) + this.ClientId.GetHashCode(); + } + if (this.CustomFields != null) + { + hashCode = (hashCode * 59) + this.CustomFields.GetHashCode(); + } + if (this.Files != null) + { + hashCode = (hashCode * 59) + this.Files.GetHashCode(); + } + if (this.FileUrls != null) + { + hashCode = (hashCode * 59) + this.FileUrls.GetHashCode(); + } + hashCode = (hashCode * 59) + this.IsEid.GetHashCode(); + if (this.Message != null) + { + hashCode = (hashCode * 59) + this.Message.GetHashCode(); + } + if (this.Metadata != null) + { + hashCode = (hashCode * 59) + this.Metadata.GetHashCode(); + } + if (this.SigningOptions != null) + { + hashCode = (hashCode * 59) + this.SigningOptions.GetHashCode(); + } + if (this.SigningRedirectUrl != null) + { + hashCode = (hashCode * 59) + this.SigningRedirectUrl.GetHashCode(); + } + if (this.Subject != null) + { + hashCode = (hashCode * 59) + this.Subject.GetHashCode(); + } + hashCode = (hashCode * 59) + this.TestMode.GetHashCode(); + if (this.Title != null) + { + hashCode = (hashCode * 59) + this.Title.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + // Message (string) maxLength + if (this.Message != null && this.Message.Length > 5000) + { + yield return new ValidationResult("Invalid value for Message, length must be less than 5000.", new[] { "Message" }); + } + + // Subject (string) maxLength + if (this.Subject != null && this.Subject.Length > 255) + { + yield return new ValidationResult("Invalid value for Subject, length must be less than 255.", new[] { "Subject" }); + } + + // Title (string) maxLength + if (this.Title != null && this.Title.Length > 255) + { + yield return new ValidationResult("Invalid value for Title, length must be less than 255.", new[] { "Title" }); + } + + yield break; + } + public List GetOpenApiTypes() + { + var types = new List(); + types.Add(new OpenApiType() + { + Name = "template_ids", + Property = "TemplateIds", + Type = "List", + Value = TemplateIds, + }); + types.Add(new OpenApiType() + { + Name = "signers", + Property = "Signers", + Type = "List", + Value = Signers, + }); + types.Add(new OpenApiType() + { + Name = "allow_decline", + Property = "AllowDecline", + Type = "bool", + Value = AllowDecline, + }); + types.Add(new OpenApiType() + { + Name = "ccs", + Property = "Ccs", + Type = "List", + Value = Ccs, + }); + types.Add(new OpenApiType() + { + Name = "client_id", + Property = "ClientId", + Type = "string", + Value = ClientId, + }); + types.Add(new OpenApiType() + { + Name = "custom_fields", + Property = "CustomFields", + Type = "List", + Value = CustomFields, + }); + types.Add(new OpenApiType() + { + Name = "files", + Property = "Files", + Type = "List", + Value = Files, + }); + types.Add(new OpenApiType() + { + Name = "file_urls", + Property = "FileUrls", + Type = "List", + Value = FileUrls, + }); + types.Add(new OpenApiType() + { + Name = "is_eid", + Property = "IsEid", + Type = "bool", + Value = IsEid, + }); + types.Add(new OpenApiType() + { + Name = "message", + Property = "Message", + Type = "string", + Value = Message, + }); + types.Add(new OpenApiType() + { + Name = "metadata", + Property = "Metadata", + Type = "Dictionary", + Value = Metadata, + }); + types.Add(new OpenApiType() + { + Name = "signing_options", + Property = "SigningOptions", + Type = "SubSigningOptions", + Value = SigningOptions, + }); + types.Add(new OpenApiType() + { + Name = "signing_redirect_url", + Property = "SigningRedirectUrl", + Type = "string", + Value = SigningRedirectUrl, + }); + types.Add(new OpenApiType() + { + Name = "subject", + Property = "Subject", + Type = "string", + Value = Subject, + }); + types.Add(new OpenApiType() + { + Name = "test_mode", + Property = "TestMode", + Type = "bool", + Value = TestMode, + }); + types.Add(new OpenApiType() + { + Name = "title", + Property = "Title", + Type = "string", + Value = Title, + }); + + return types; + } + } + +} diff --git a/src/Dropbox.Sign/Model/SubFormFieldRuleAction.cs b/src/Dropbox.Sign/Model/SubFormFieldRuleAction.cs index a15a63f..b6af36b 100644 --- a/src/Dropbox.Sign/Model/SubFormFieldRuleAction.cs +++ b/src/Dropbox.Sign/Model/SubFormFieldRuleAction.cs @@ -40,16 +40,18 @@ public partial class SubFormFieldRuleAction : IEquatable public enum TypeEnum { /// - /// Enum FieldVisibility for value: change-field-visibility + /// Enum ChangeFieldVisibility for value: change-field-visibility /// [EnumMember(Value = "change-field-visibility")] - FieldVisibility = 1, + ChangeFieldVisibility = 1, + FieldVisibility = ChangeFieldVisibility, /// - /// Enum GroupVisibility for value: change-group-visibility + /// Enum ChangeGroupVisibility for value: change-group-visibility /// [EnumMember(Value = "change-group-visibility")] - GroupVisibility = 2 + ChangeGroupVisibility = 2, + GroupVisibility = ChangeGroupVisibility } diff --git a/templates/ApiClient.mustache b/templates/ApiClient.mustache index f8798bd..bd0a317 100644 --- a/templates/ApiClient.mustache +++ b/templates/ApiClient.mustache @@ -109,7 +109,7 @@ namespace {{packageName}}.Client if (response.Headers != null) { var filePath = string.IsNullOrEmpty(_configuration.TempFolderPath) - ? Path.GetTempPath() + ? global::System.IO.Path.GetTempPath() : _configuration.TempFolderPath; var regex = new Regex(@"Content-Disposition=.*filename=['""]?([^'""\s]+)['""]?$"); foreach (var header in response.Headers) @@ -338,7 +338,7 @@ namespace {{packageName}}.Client { foreach (var value in headerParam.Value) { - request.AddHeader(headerParam.Key, value); + request.AddOrUpdateHeader(headerParam.Key, value); } } } @@ -398,13 +398,21 @@ namespace {{packageName}}.Client var bytes = ClientUtils.ReadAsBytes(file); var fileStream = file as FileStream; if (fileStream != null) - request.AddFile(fileParam.Key, bytes, Path.GetFileName(fileStream.Name)); + request.AddFile(fileParam.Key, bytes, global::System.IO.Path.GetFileName(fileStream.Name)); else request.AddFile(fileParam.Key, bytes, "no_file_name_provided"); } } } + if (options.HeaderParameters != null) + { + if (options.HeaderParameters.TryGetValue("Content-Type", out var contentTypes) && contentTypes.Any(header => header.Contains("multipart/form-data"))) + { + request.AlwaysMultipartFormData = true; + } + } + return request; } @@ -476,7 +484,7 @@ namespace {{packageName}}.Client var clientOptions = new RestClientOptions(baseUrl) { ClientCertificates = configuration.ClientCertificates, - MaxTimeout = configuration.Timeout, + Timeout = configuration.Timeout, Proxy = configuration.Proxy, UserAgent = configuration.UserAgent, UseDefaultCredentials = configuration.UseDefaultCredentials, @@ -585,11 +593,11 @@ namespace {{packageName}}.Client } } - private RestResponse DeserializeRestResponseFromPolicy(RestClient client, RestRequest request, PolicyResult policyResult) + private async Task> DeserializeRestResponseFromPolicyAsync(RestClient client, RestRequest request, PolicyResult policyResult, CancellationToken cancellationToken = default) { if (policyResult.Outcome == OutcomeType.Successful) { - return client.Deserialize(policyResult.Result); + return await client.Deserialize(policyResult.Result, cancellationToken); } else { @@ -622,7 +630,7 @@ namespace {{packageName}}.Client { var policy = RetryConfiguration.RetryPolicy; var policyResult = policy.ExecuteAndCapture(() => client.Execute(request)); - return Task.FromResult(DeserializeRestResponseFromPolicy(client, request, policyResult)); + return DeserializeRestResponseFromPolicyAsync(client, request, policyResult); } else { @@ -648,7 +656,7 @@ namespace {{packageName}}.Client { var policy = RetryConfiguration.AsyncRetryPolicy; var policyResult = await policy.ExecuteAndCaptureAsync((ct) => client.ExecuteAsync(request, ct), cancellationToken).ConfigureAwait(false); - return DeserializeRestResponseFromPolicy(client, request, policyResult); + return await DeserializeRestResponseFromPolicyAsync(client, request, policyResult, cancellationToken); } else { diff --git a/templates/ApiClient.v790.mustache b/templates/ApiClient.v790.mustache new file mode 100644 index 0000000..a63d1c2 --- /dev/null +++ b/templates/ApiClient.v790.mustache @@ -0,0 +1,838 @@ +{{>partial_header}} + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.IO; +using System.Linq; +using System.Net; +using System.Reflection; +using System.Runtime.Serialization; +using System.Runtime.Serialization.Formatters; +using System.Text; +using System.Threading; +using System.Text.RegularExpressions; +using System.Threading.Tasks; +{{^net60OrLater}} +using System.Web; +{{/net60OrLater}} +using Newtonsoft.Json; +using Newtonsoft.Json.Serialization; +using RestSharp; +using RestSharp.Serializers; +using RestSharpMethod = RestSharp.Method; +using FileIO = System.IO.File; +{{#supportsRetry}} +using Polly; +{{/supportsRetry}} +{{#hasOAuthMethods}} +using {{packageName}}.Client.Auth; +{{/hasOAuthMethods}} +using {{packageName}}.{{modelPackage}}; + +namespace {{packageName}}.Client +{ + /// + /// Allows RestSharp to Serialize/Deserialize JSON using our custom logic, but only when ContentType is JSON. + /// + internal class CustomJsonCodec : IRestSerializer, ISerializer, IDeserializer + { + private readonly IReadableConfiguration _configuration; + private readonly JsonSerializerSettings _serializerSettings = new JsonSerializerSettings + { + // OpenAPI generated types generally hide default constructors. + ConstructorHandling = ConstructorHandling.AllowNonPublicDefaultConstructor, + ContractResolver = new DefaultContractResolver + { + NamingStrategy = new CamelCaseNamingStrategy + { + OverrideSpecifiedNames = false + } + } + }; + + public CustomJsonCodec(IReadableConfiguration configuration) + { + _configuration = configuration; + } + + public CustomJsonCodec(JsonSerializerSettings serializerSettings, IReadableConfiguration configuration) + { + _serializerSettings = serializerSettings; + _configuration = configuration; + } + + /// + /// Serialize the object into a JSON string. + /// + /// Object to be serialized. + /// A JSON string. + public string Serialize(object obj) + { + if (obj != null && obj is AbstractOpenAPISchema) + { + // the object to be serialized is an oneOf/anyOf schema + return ((AbstractOpenAPISchema)obj).ToJson(); + } + else + { + return JsonConvert.SerializeObject(obj, _serializerSettings); + } + } + + public string Serialize(Parameter bodyParameter) => Serialize(bodyParameter.Value); + + public T Deserialize(RestResponse response) + { + var result = (T)Deserialize(response, typeof(T)); + return result; + } + + /// + /// Deserialize the JSON string into a proper object. + /// + /// The HTTP response. + /// Object type. + /// Object representation of the JSON string. + internal object Deserialize(RestResponse response, Type type) + { + if (type == typeof(byte[])) // return byte array + { + return response.RawBytes; + } + + // TODO: ? if (type.IsAssignableFrom(typeof(Stream))) + if (type == typeof(Stream)) + { + var bytes = response.RawBytes; + if (response.Headers != null) + { + var filePath = string.IsNullOrEmpty(_configuration.TempFolderPath) + ? global::System.IO.Path.GetTempPath() + : _configuration.TempFolderPath; + var regex = new Regex(@"Content-Disposition=.*filename=['""]?([^'""\s]+)['""]?$"); + foreach (var header in response.Headers) + { + var match = regex.Match(header.ToString()); + if (match.Success) + { + string fileName = filePath + ClientUtils.SanitizeFilename(match.Groups[1].Value.Replace("\"", "").Replace("'", "")); + FileIO.WriteAllBytes(fileName, bytes); + return new FileStream(fileName, FileMode.Open); + } + } + } + var stream = new MemoryStream(bytes); + return stream; + } + + if (type.Name.StartsWith("System.Nullable`1[[System.DateTime")) // return a datetime object + { + return DateTime.Parse(response.Content, null, DateTimeStyles.RoundtripKind); + } + + if (type == typeof(string) || type.Name.StartsWith("System.Nullable")) // return primitive type + { + return Convert.ChangeType(response.Content, type); + } + + // at this point, it must be a model (json) + try + { + return JsonConvert.DeserializeObject(response.Content, type, _serializerSettings); + } + catch (Exception e) + { + throw new ApiException(500, e.Message); + } + } + + public ISerializer Serializer => this; + public IDeserializer Deserializer => this; + + public string[] AcceptedContentTypes => ContentType.JsonAccept; + + public SupportsContentType SupportsContentType => contentType => + contentType.Value.EndsWith("json", StringComparison.InvariantCultureIgnoreCase) || + contentType.Value.EndsWith("javascript", StringComparison.InvariantCultureIgnoreCase); + + public ContentType ContentType { get; set; } = ContentType.Json; + + public DataFormat DataFormat => DataFormat.Json; + } + {{! NOTE: Any changes related to RestSharp should be done in this class. All other client classes are for extensibility by consumers.}} + /// + /// Provides a default implementation of an Api client (both synchronous and asynchronous implementations), + /// encapsulating general REST accessor use cases. + /// + {{>visibility}} partial class ApiClient : ISynchronousClient{{#supportsAsync}}, IAsynchronousClient{{/supportsAsync}} + { + private readonly string _baseUrl; + + /// + /// Specifies the settings on a object. + /// These settings can be adjusted to accommodate custom serialization rules. + /// + public JsonSerializerSettings SerializerSettings { get; set; } = new JsonSerializerSettings + { + // OpenAPI generated types generally hide default constructors. + ConstructorHandling = ConstructorHandling.AllowNonPublicDefaultConstructor, + ContractResolver = new DefaultContractResolver + { + NamingStrategy = new CamelCaseNamingStrategy + { + OverrideSpecifiedNames = false + } + } + }; + + /// + /// Allows for extending request processing for generated code. + /// + /// The RestSharp request object + partial void InterceptRequest(RestRequest request); + + /// + /// Allows for extending response processing for generated code. + /// + /// The RestSharp request object + /// The RestSharp response object + partial void InterceptResponse(RestRequest request, RestResponse response); + + /// + /// Initializes a new instance of the , defaulting to the global configurations' base url. + /// + public ApiClient() + { + _baseUrl = GlobalConfiguration.Instance.BasePath; + } + + /// + /// Initializes a new instance of the + /// + /// The target service's base path in URL format. + /// + public ApiClient(string basePath) + { + if (string.IsNullOrEmpty(basePath)) + throw new ArgumentException("basePath cannot be empty"); + + _baseUrl = basePath; + } + + /// + /// Constructs the RestSharp version of an http method + /// + /// Swagger Client Custom HttpMethod + /// RestSharp's HttpMethod instance. + /// + private RestSharpMethod Method(HttpMethod method) + { + RestSharpMethod other; + switch (method) + { + case HttpMethod.Get: + other = RestSharpMethod.Get; + break; + case HttpMethod.Post: + other = RestSharpMethod.Post; + break; + case HttpMethod.Put: + other = RestSharpMethod.Put; + break; + case HttpMethod.Delete: + other = RestSharpMethod.Delete; + break; + case HttpMethod.Head: + other = RestSharpMethod.Head; + break; + case HttpMethod.Options: + other = RestSharpMethod.Options; + break; + case HttpMethod.Patch: + other = RestSharpMethod.Patch; + break; + default: + throw new ArgumentOutOfRangeException("method", method, null); + } + + return other; + } + + /// + /// Provides all logic for constructing a new RestSharp . + /// At this point, all information for querying the service is known. + /// Here, it is simply mapped into the RestSharp request. + /// + /// The http verb. + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. + /// It is assumed that any merge with GlobalConfiguration has been done before calling this method. + /// [private] A new RestRequest instance. + /// + private RestRequest NewRequest( + HttpMethod method, + string path, + RequestOptions options, + IReadableConfiguration configuration) + { + if (path == null) throw new ArgumentNullException("path"); + if (options == null) throw new ArgumentNullException("options"); + if (configuration == null) throw new ArgumentNullException("configuration"); + + RestRequest request = new RestRequest(path, Method(method)); + + if (options.PathParameters != null) + { + foreach (var pathParam in options.PathParameters) + { + request.AddParameter(pathParam.Key, pathParam.Value, ParameterType.UrlSegment); + } + } + + if (options.QueryParameters != null) + { + foreach (var queryParam in options.QueryParameters) + { + foreach (var value in queryParam.Value) + { + request.AddQueryParameter(queryParam.Key, value); + } + } + } + + if (configuration.DefaultHeaders != null) + { + foreach (var headerParam in configuration.DefaultHeaders) + { + request.AddHeader(headerParam.Key, headerParam.Value); + } + } + + if (options.HeaderParameters != null) + { + foreach (var headerParam in options.HeaderParameters) + { + foreach (var value in headerParam.Value) + { + request.AddHeader(headerParam.Key, value); + } + } + } + + if (options.FormParameters != null) + { + foreach (var formParam in options.FormParameters) + { + request.AddParameter(formParam.Key, formParam.Value); + } + } + + if (options.Data != null) + { + if (options.Data is Stream stream) + { + var contentType = "application/octet-stream"; + if (options.HeaderParameters != null) + { + var contentTypes = options.HeaderParameters["Content-Type"]; + contentType = contentTypes[0]; + } + + var bytes = ClientUtils.ReadAsBytes(stream); + request.AddParameter(contentType, bytes, ParameterType.RequestBody); + } + else + { + if (options.HeaderParameters != null) + { + var contentTypes = options.HeaderParameters["Content-Type"]; + if (contentTypes == null || contentTypes.Any(header => header.Contains("application/json"))) + { + request.RequestFormat = DataFormat.Json; + } + else + { + // TODO: Generated client user should add additional handlers. RestSharp only supports XML and JSON, with XML as default. + } + } + else + { + // Here, we'll assume JSON APIs are more common. XML can be forced by adding produces/consumes to openapi spec explicitly. + request.RequestFormat = DataFormat.Json; + } + + request.AddJsonBody(options.Data); + } + } + + if (options.FileParameters != null) + { + foreach (var fileParam in options.FileParameters) + { + foreach (var file in fileParam.Value) + { + var bytes = ClientUtils.ReadAsBytes(file); + var fileStream = file as FileStream; + if (fileStream != null) + request.AddFile(fileParam.Key, bytes, global::System.IO.Path.GetFileName(fileStream.Name)); + else + request.AddFile(fileParam.Key, bytes, "no_file_name_provided"); + } + } + } + + return request; + } + + /// + /// Transforms a RestResponse instance into a new ApiResponse instance. + /// At this point, we have a concrete http response from the service. + /// Here, it is simply mapped into the [public] ApiResponse object. + /// + /// The RestSharp response object + /// A new ApiResponse instance. + private ApiResponse ToApiResponse(RestResponse response) + { + T result = response.Data; + string rawContent = response.Content; + + var transformed = new ApiResponse(response.StatusCode, new Multimap({{#caseInsensitiveResponseHeaders}}StringComparer.OrdinalIgnoreCase{{/caseInsensitiveResponseHeaders}}), result, rawContent) + { + ErrorText = response.ErrorMessage, + Cookies = new List() + }; + + if (response.Headers != null) + { + foreach (var responseHeader in response.Headers) + { + transformed.Headers.Add(responseHeader.Name, ClientUtils.ParameterToString(responseHeader.Value)); + } + } + + if (response.ContentHeaders != null) + { + foreach (var responseHeader in response.ContentHeaders) + { + transformed.Headers.Add(responseHeader.Name, ClientUtils.ParameterToString(responseHeader.Value)); + } + } + + if (response.Cookies != null) + { + foreach (var responseCookies in response.Cookies.Cast()) + { + transformed.Cookies.Add( + new Cookie( + responseCookies.Name, + responseCookies.Value, + responseCookies.Path, + responseCookies.Domain) + ); + } + } + + return transformed; + } + + /// + /// Executes the HTTP request for the current service. + /// Based on functions received it can be async or sync. + /// + /// Local function that executes http request and returns http response. + /// Local function to specify options for the service. + /// The RestSharp request object + /// The RestSharp options object + /// A per-request configuration object. + /// It is assumed that any merge with GlobalConfiguration has been done before calling this method. + /// A new ApiResponse instance. + private async Task> ExecClientAsync(Func>> getResponse, Action setOptions, RestRequest request, RequestOptions options, IReadableConfiguration configuration) + { + var baseUrl = configuration.GetOperationServerUrl(options.Operation, options.OperationIndex) ?? _baseUrl; + var clientOptions = new RestClientOptions(baseUrl) + { + ClientCertificates = configuration.ClientCertificates, + MaxTimeout = configuration.Timeout, + Proxy = configuration.Proxy, + UserAgent = configuration.UserAgent, + UseDefaultCredentials = configuration.UseDefaultCredentials, + RemoteCertificateValidationCallback = configuration.RemoteCertificateValidationCallback + }; + setOptions(clientOptions); + + {{#hasOAuthMethods}} + if (!string.IsNullOrEmpty(configuration.OAuthTokenUrl) && + !string.IsNullOrEmpty(configuration.OAuthClientId) && + !string.IsNullOrEmpty(configuration.OAuthClientSecret) && + configuration.OAuthFlow != null) + { + clientOptions.Authenticator = new OAuthAuthenticator( + configuration.OAuthTokenUrl, + configuration.OAuthClientId, + configuration.OAuthClientSecret, + configuration.OAuthScope, + configuration.OAuthFlow, + SerializerSettings, + configuration); + } + + {{/hasOAuthMethods}} + using (RestClient client = new RestClient(clientOptions, + configureSerialization: serializerConfig => serializerConfig.UseSerializer(() => new CustomJsonCodec(SerializerSettings, configuration)))) + { + InterceptRequest(request); + + RestResponse response = await getResponse(client); + + // if the response type is oneOf/anyOf, call FromJSON to deserialize the data + if (typeof(AbstractOpenAPISchema).IsAssignableFrom(typeof(T))) + { + try + { + response.Data = (T)typeof(T).GetMethod("FromJson").Invoke(null, new object[] { response.Content }); + } + catch (Exception ex) + { + throw ex.InnerException != null ? ex.InnerException : ex; + } + } + else if (typeof(T).Name == "Stream") // for binary response + { + response.Data = (T)(object)new MemoryStream(response.RawBytes); + } + else if (typeof(T).Name == "Byte[]") // for byte response + { + response.Data = (T)(object)response.RawBytes; + } + else if (typeof(T).Name == "String") // for string response + { + response.Data = (T)(object)response.Content; + } + + InterceptResponse(request, response); + + var result = ToApiResponse(response); + if (response.ErrorMessage != null) + { + result.ErrorText = response.ErrorMessage; + } + + if (response.Cookies != null && response.Cookies.Count > 0) + { + if (result.Cookies == null) result.Cookies = new List(); + foreach (var restResponseCookie in response.Cookies.Cast()) + { + var cookie = new Cookie( + restResponseCookie.Name, + restResponseCookie.Value, + restResponseCookie.Path, + restResponseCookie.Domain + ) + { + Comment = restResponseCookie.Comment, + CommentUri = restResponseCookie.CommentUri, + Discard = restResponseCookie.Discard, + Expired = restResponseCookie.Expired, + Expires = restResponseCookie.Expires, + HttpOnly = restResponseCookie.HttpOnly, + Port = restResponseCookie.Port, + Secure = restResponseCookie.Secure, + Version = restResponseCookie.Version + }; + + result.Cookies.Add(cookie); + } + } + return result; + } + } + + private async Task> DeserializeRestResponseFromPolicyAsync(RestClient client, RestRequest request, PolicyResult policyResult, CancellationToken cancellationToken = default) + { + if (policyResult.Outcome == OutcomeType.Successful) + { + return await client.Deserialize(policyResult.Result, cancellationToken); + } + else + { + return new RestResponse(request) + { + ErrorException = policyResult.FinalException + }; + } + } + + private ApiResponse Exec(RestRequest request, RequestOptions options, IReadableConfiguration configuration) + { + Action setOptions = (clientOptions) => + { + var cookies = new CookieContainer(); + + if (options.Cookies != null && options.Cookies.Count > 0) + { + foreach (var cookie in options.Cookies) + { + cookies.Add(new Cookie(cookie.Name, cookie.Value)); + } + } + clientOptions.CookieContainer = cookies; + }; + + Func>> getResponse = (client) => + { + if (RetryConfiguration.RetryPolicy != null) + { + var policy = RetryConfiguration.RetryPolicy; + var policyResult = policy.ExecuteAndCapture(() => client.Execute(request)); + return DeserializeRestResponseFromPolicyAsync(client, request, policyResult); + } + else + { + return Task.FromResult(client.Execute(request)); + } + }; + + return ExecClientAsync(getResponse, setOptions, request, options, configuration).GetAwaiter().GetResult(); + } + + {{#supportsAsync}} + private Task> ExecAsync(RestRequest request, RequestOptions options, IReadableConfiguration configuration, CancellationToken cancellationToken = default(CancellationToken)) + { + Action setOptions = (clientOptions) => + { + //no extra options + }; + + Func>> getResponse = async (client) => + { + {{#supportsRetry}} + if (RetryConfiguration.AsyncRetryPolicy != null) + { + var policy = RetryConfiguration.AsyncRetryPolicy; + var policyResult = await policy.ExecuteAndCaptureAsync((ct) => client.ExecuteAsync(request, ct), cancellationToken).ConfigureAwait(false); + return await DeserializeRestResponseFromPolicyAsync(client, request, policyResult, cancellationToken); + } + else + { + {{/supportsRetry}} + return await client.ExecuteAsync(request, cancellationToken).ConfigureAwait(false); + {{#supportsRetry}} + } + {{/supportsRetry}} + }; + + return ExecClientAsync(getResponse, setOptions, request, options, configuration); + } + + #region IAsynchronousClient + /// + /// Make a HTTP GET request (async). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// Token that enables callers to cancel the request. + /// A Task containing ApiResponse + public Task> GetAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default) + { + var config = configuration ?? GlobalConfiguration.Instance; + return ExecAsync(NewRequest(HttpMethod.Get, path, options, config), options, config, cancellationToken); + } + + /// + /// Make a HTTP POST request (async). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// Token that enables callers to cancel the request. + /// A Task containing ApiResponse + public Task> PostAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default) + { + var config = configuration ?? GlobalConfiguration.Instance; + return ExecAsync(NewRequest(HttpMethod.Post, path, options, config), options, config, cancellationToken); + } + + /// + /// Make a HTTP PUT request (async). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// Token that enables callers to cancel the request. + /// A Task containing ApiResponse + public Task> PutAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default) + { + var config = configuration ?? GlobalConfiguration.Instance; + return ExecAsync(NewRequest(HttpMethod.Put, path, options, config), options, config, cancellationToken); + } + + /// + /// Make a HTTP DELETE request (async). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// Token that enables callers to cancel the request. + /// A Task containing ApiResponse + public Task> DeleteAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default) + { + var config = configuration ?? GlobalConfiguration.Instance; + return ExecAsync(NewRequest(HttpMethod.Delete, path, options, config), options, config, cancellationToken); + } + + /// + /// Make a HTTP HEAD request (async). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// Token that enables callers to cancel the request. + /// A Task containing ApiResponse + public Task> HeadAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default) + { + var config = configuration ?? GlobalConfiguration.Instance; + return ExecAsync(NewRequest(HttpMethod.Head, path, options, config), options, config, cancellationToken); + } + + /// + /// Make a HTTP OPTION request (async). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// Token that enables callers to cancel the request. + /// A Task containing ApiResponse + public Task> OptionsAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default) + { + var config = configuration ?? GlobalConfiguration.Instance; + return ExecAsync(NewRequest(HttpMethod.Options, path, options, config), options, config, cancellationToken); + } + + /// + /// Make a HTTP PATCH request (async). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// Token that enables callers to cancel the request. + /// A Task containing ApiResponse + public Task> PatchAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default) + { + var config = configuration ?? GlobalConfiguration.Instance; + return ExecAsync(NewRequest(HttpMethod.Patch, path, options, config), options, config, cancellationToken); + } + #endregion IAsynchronousClient + {{/supportsAsync}} + + #region ISynchronousClient + /// + /// Make a HTTP GET request (synchronous). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// A Task containing ApiResponse + public ApiResponse Get(string path, RequestOptions options, IReadableConfiguration configuration = null) + { + var config = configuration ?? GlobalConfiguration.Instance; + return Exec(NewRequest(HttpMethod.Get, path, options, config), options, config); + } + + /// + /// Make a HTTP POST request (synchronous). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// A Task containing ApiResponse + public ApiResponse Post(string path, RequestOptions options, IReadableConfiguration configuration = null) + { + var config = configuration ?? GlobalConfiguration.Instance; + return Exec(NewRequest(HttpMethod.Post, path, options, config), options, config); + } + + /// + /// Make a HTTP PUT request (synchronous). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// A Task containing ApiResponse + public ApiResponse Put(string path, RequestOptions options, IReadableConfiguration configuration = null) + { + var config = configuration ?? GlobalConfiguration.Instance; + return Exec(NewRequest(HttpMethod.Put, path, options, config), options, config); + } + + /// + /// Make a HTTP DELETE request (synchronous). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// A Task containing ApiResponse + public ApiResponse Delete(string path, RequestOptions options, IReadableConfiguration configuration = null) + { + var config = configuration ?? GlobalConfiguration.Instance; + return Exec(NewRequest(HttpMethod.Delete, path, options, config), options, config); + } + + /// + /// Make a HTTP HEAD request (synchronous). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// A Task containing ApiResponse + public ApiResponse Head(string path, RequestOptions options, IReadableConfiguration configuration = null) + { + var config = configuration ?? GlobalConfiguration.Instance; + return Exec(NewRequest(HttpMethod.Head, path, options, config), options, config); + } + + /// + /// Make a HTTP OPTION request (synchronous). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// A Task containing ApiResponse + public ApiResponse Options(string path, RequestOptions options, IReadableConfiguration configuration = null) + { + var config = configuration ?? GlobalConfiguration.Instance; + return Exec(NewRequest(HttpMethod.Options, path, options, config), options, config); + } + + /// + /// Make a HTTP PATCH request (synchronous). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// A Task containing ApiResponse + public ApiResponse Patch(string path, RequestOptions options, IReadableConfiguration configuration = null) + { + var config = configuration ?? GlobalConfiguration.Instance; + return Exec(NewRequest(HttpMethod.Patch, path, options, config), options, config); + } + #endregion ISynchronousClient + } +} diff --git a/templates/ClientUtils.mustache b/templates/ClientUtils.mustache index cacf67e..f8481e3 100644 --- a/templates/ClientUtils.mustache +++ b/templates/ClientUtils.mustache @@ -118,6 +118,14 @@ namespace {{packageName}}.Client // https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx#Anchor_8 // For example: 2009-06-15T13:45:30.0000000 return dateTimeOffset.ToString((configuration ?? GlobalConfiguration.Instance).DateTimeFormat); +{{#net60OrLater}} + if (obj is DateOnly dateOnly) + // Return a formatted date string - Can be customized with Configuration.DateTimeFormat + // Defaults to an ISO 8601, using the known as a Round-trip date/time pattern ("o") + // https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx#Anchor_8 + // For example: 2009-06-15 + return dateOnly.ToString((configuration ?? GlobalConfiguration.Instance).DateTimeFormat); +{{/net60OrLater}} if (obj is bool boolean) return boolean ? "true" : "false"; if (obj is ICollection collection) { diff --git a/templates/Configuration.mustache b/templates/Configuration.mustache index 64441d8..c81ca26 100644 --- a/templates/Configuration.mustache +++ b/templates/Configuration.mustache @@ -216,7 +216,7 @@ namespace {{packageName}}.Client }; // Setting Timeout has side effects (forces ApiClient creation). - Timeout = 100000; + Timeout = TimeSpan.FromSeconds(100); } /// @@ -300,9 +300,9 @@ namespace {{packageName}}.Client public virtual IDictionary DefaultHeaders { get; set; } /// - /// Gets or sets the HTTP timeout (milliseconds) of ApiClient. Default to 100000 milliseconds. + /// Gets or sets the HTTP timeout of ApiClient. Defaults to 100 seconds. /// - public virtual int Timeout { get; set; } + public virtual TimeSpan Timeout { get; set; } /// /// Gets or sets the proxy diff --git a/templates/Configuration.v790.mustache b/templates/Configuration.v790.mustache new file mode 100644 index 0000000..2753aaf --- /dev/null +++ b/templates/Configuration.v790.mustache @@ -0,0 +1,737 @@ +{{>partial_header}} + +using System; +{{^net35}} +using System.Collections.Concurrent; +{{/net35}} +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Net; +using System.Reflection; +using System.Security.Cryptography.X509Certificates; +using System.Text; +using System.Net.Http; +using System.Net.Security; +{{#useRestSharp}} +{{#hasOAuthMethods}}using {{packageName}}.Client.Auth; +{{/hasOAuthMethods}} +{{/useRestSharp}} + +namespace {{packageName}}.Client +{ + /// + /// Represents a set of configuration settings + /// + {{>visibility}} class Configuration : IReadableConfiguration + { + #region Constants + + /// + /// Version of the package. + /// + /// Version of the package. + public const string Version = "{{packageVersion}}"; + + /// + /// Identifier for ISO 8601 DateTime Format + /// + /// See https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx#Anchor_8 for more information. + // ReSharper disable once InconsistentNaming + public const string ISO8601_DATETIME_FORMAT = "o"; + + #endregion Constants + + #region Static Members + + /// + /// Default creation of exceptions for a given method name and response object + /// + public static readonly ExceptionFactory DefaultExceptionFactory = (methodName, response) => + { + var status = (int)response.StatusCode; + if (status >= 400) + { + return new ApiException(status, + string.Format("Error calling {0}: {1}", methodName, response.RawContent), + response.RawContent, response.Headers); + } + {{^netStandard}} + if (status == 0) + { + return new ApiException(status, + string.Format("Error calling {0}: {1}", methodName, response.ErrorText), response.ErrorText); + } + {{/netStandard}} + return null; + }; + + #endregion Static Members + + #region Private Members + + /// + /// Defines the base path of the target API server. + /// Example: http://localhost:3000/v1/ + /// + private string _basePath; + + private bool _useDefaultCredentials = false; + + /// + /// Gets or sets the API key based on the authentication name. + /// This is the key and value comprising the "secret" for accessing an API. + /// + /// The API key. + private IDictionary _apiKey; + + /// + /// Gets or sets the prefix (e.g. Token) of the API key based on the authentication name. + /// + /// The prefix of the API key. + private IDictionary _apiKeyPrefix; + + private string _dateTimeFormat = ISO8601_DATETIME_FORMAT; + private string _tempFolderPath = Path.GetTempPath(); + {{#servers.0}} + + /// + /// Gets or sets the servers defined in the OpenAPI spec. + /// + /// The servers + private IList> _servers; + {{/servers.0}} + + /// + /// Gets or sets the operation servers defined in the OpenAPI spec. + /// + /// The operation servers + private IReadOnlyDictionary>> _operationServers; + + {{#hasHttpSignatureMethods}} + + /// + /// HttpSigning configuration + /// + private HttpSigningConfiguration _HttpSigningConfiguration = null; + {{/hasHttpSignatureMethods}} + #endregion Private Members + + #region Constructors + + /// + /// Initializes a new instance of the class + /// + [global::System.Diagnostics.CodeAnalysis.SuppressMessage("ReSharper", "VirtualMemberCallInConstructor")] + public Configuration() + { + Proxy = null; + UserAgent = WebUtility.UrlEncode("{{httpUserAgent}}{{^httpUserAgent}}OpenAPI-Generator/{{packageVersion}}/csharp{{/httpUserAgent}}"); + BasePath = "{{{basePath}}}"; + DefaultHeaders = new {{^net35}}Concurrent{{/net35}}Dictionary(); + ApiKey = new {{^net35}}Concurrent{{/net35}}Dictionary(); + ApiKeyPrefix = new {{^net35}}Concurrent{{/net35}}Dictionary(); + {{#servers}} + {{#-first}} + Servers = new List>() + { + {{/-first}} + { + new Dictionary { + {"url", "{{{url}}}"}, + {"description", "{{{description}}}{{^description}}No description provided{{/description}}"}, + {{#variables}} + {{#-first}} + { + "variables", new Dictionary { + {{/-first}} + { + "{{{name}}}", new Dictionary { + {"description", "{{{description}}}{{^description}}No description provided{{/description}}"}, + {"default_value", {{#isString}}{{^isEnum}}@{{/isEnum}}{{/isString}}"{{{defaultValue}}}"}, + {{#enumValues}} + {{#-first}} + { + "enum_values", new List() { + {{/-first}} + "{{{.}}}"{{^-last}},{{/-last}} + {{#-last}} + } + } + {{/-last}} + {{/enumValues}} + } + }{{^-last}},{{/-last}} + {{#-last}} + } + } + {{/-last}} + {{/variables}} + } + }{{^-last}},{{/-last}} + {{#-last}} + }; + {{/-last}} + {{/servers}} + OperationServers = new Dictionary>>() + { + {{#apiInfo}} + {{#apis}} + {{#operations}} + {{#operation}} + {{#servers.0}} + { + "{{{classname}}}.{{{nickname}}}", new List> + { + {{#servers}} + { + new Dictionary + { + {"url", "{{{url}}}"}, + {"description", "{{{description}}}{{^description}}No description provided{{/description}}"} + } + }, + {{/servers}} + } + }, + {{/servers.0}} + {{/operation}} + {{/operations}} + {{/apis}} + {{/apiInfo}} + }; + + // Setting Timeout has side effects (forces ApiClient creation). + Timeout = 100000; + } + + /// + /// Initializes a new instance of the class + /// + [global::System.Diagnostics.CodeAnalysis.SuppressMessage("ReSharper", "VirtualMemberCallInConstructor")] + public Configuration( + IDictionary defaultHeaders, + IDictionary apiKey, + IDictionary apiKeyPrefix, + string basePath = "{{{basePath}}}") : this() + { + if (string.{{^net35}}IsNullOrWhiteSpace{{/net35}}{{#net35}}IsNullOrEmpty{{/net35}}(basePath)) + throw new ArgumentException("The provided basePath is invalid.", "basePath"); + if (defaultHeaders == null) + throw new ArgumentNullException("defaultHeaders"); + if (apiKey == null) + throw new ArgumentNullException("apiKey"); + if (apiKeyPrefix == null) + throw new ArgumentNullException("apiKeyPrefix"); + + BasePath = basePath; + + foreach (var keyValuePair in defaultHeaders) + { + DefaultHeaders.Add(keyValuePair); + } + + foreach (var keyValuePair in apiKey) + { + ApiKey.Add(keyValuePair); + } + + foreach (var keyValuePair in apiKeyPrefix) + { + ApiKeyPrefix.Add(keyValuePair); + } + } + + #endregion Constructors + + #region Properties + + /// + /// Gets or sets the base path for API access. + /// + public virtual string BasePath + { + get { return _basePath; } + set { _basePath = value; } + } + + /// + /// Determine whether or not the "default credentials" (e.g. the user account under which the current process is running) will be sent along to the server. The default is false. + /// + public virtual bool UseDefaultCredentials + { + get { return _useDefaultCredentials; } + set { _useDefaultCredentials = value; } + } + + /// + /// Gets or sets the default header. + /// + [Obsolete("Use DefaultHeaders instead.")] + public virtual IDictionary DefaultHeader + { + get + { + return DefaultHeaders; + } + set + { + DefaultHeaders = value; + } + } + + /// + /// Gets or sets the default headers. + /// + public virtual IDictionary DefaultHeaders { get; set; } + + /// + /// Gets or sets the HTTP timeout (milliseconds) of ApiClient. Default to 100000 milliseconds. + /// + public virtual int Timeout { get; set; } + + /// + /// Gets or sets the proxy + /// + /// Proxy. + public virtual WebProxy Proxy { get; set; } + + /// + /// Gets or sets the HTTP user agent. + /// + /// Http user agent. + public virtual string UserAgent { get; set; } + + /// + /// Gets or sets the username (HTTP basic authentication). + /// + /// The username. + public virtual string Username { get; set; } + + /// + /// Gets or sets the password (HTTP basic authentication). + /// + /// The password. + public virtual string Password { get; set; } + + /// + /// Gets the API key with prefix. + /// + /// API key identifier (authentication scheme). + /// API key with prefix. + public string GetApiKeyWithPrefix(string apiKeyIdentifier) + { + string apiKeyValue; + ApiKey.TryGetValue(apiKeyIdentifier, out apiKeyValue); + string apiKeyPrefix; + if (ApiKeyPrefix.TryGetValue(apiKeyIdentifier, out apiKeyPrefix)) + { + return apiKeyPrefix + " " + apiKeyValue; + } + + return apiKeyValue; + } + + /// + /// Gets or sets certificate collection to be sent with requests. + /// + /// X509 Certificate collection. + public X509CertificateCollection ClientCertificates { get; set; } + + /// + /// Gets or sets the access token for OAuth2 authentication. + /// + /// This helper property simplifies code generation. + /// + /// The access token. + public virtual string AccessToken { get; set; } + + {{#useRestSharp}} + {{#hasOAuthMethods}} + /// + /// Gets or sets the token URL for OAuth2 authentication. + /// + /// The OAuth Token URL. + public virtual string OAuthTokenUrl { get; set; } + + /// + /// Gets or sets the client ID for OAuth2 authentication. + /// + /// The OAuth Client ID. + public virtual string OAuthClientId { get; set; } + + /// + /// Gets or sets the client secret for OAuth2 authentication. + /// + /// The OAuth Client Secret. + public virtual string OAuthClientSecret { get; set; } + + /// + /// Gets or sets the client scope for OAuth2 authentication. + /// + /// The OAuth Client Scope. + public virtual string{{nrt?}} OAuthScope { get; set; } + + /// + /// Gets or sets the flow for OAuth2 authentication. + /// + /// The OAuth Flow. + public virtual OAuthFlow? OAuthFlow { get; set; } + + {{/hasOAuthMethods}} + {{/useRestSharp}} + /// + /// Gets or sets the temporary folder path to store the files downloaded from the server. + /// + /// Folder path. + public virtual string TempFolderPath + { + get { return _tempFolderPath; } + + set + { + if (string.IsNullOrEmpty(value)) + { + _tempFolderPath = Path.GetTempPath(); + return; + } + + // create the directory if it does not exist + if (!Directory.Exists(value)) + { + Directory.CreateDirectory(value); + } + + // check if the path contains directory separator at the end + if (value[value.Length - 1] == Path.DirectorySeparatorChar) + { + _tempFolderPath = value; + } + else + { + _tempFolderPath = value + Path.DirectorySeparatorChar; + } + } + } + + /// + /// Gets or sets the date time format used when serializing in the ApiClient + /// By default, it's set to ISO 8601 - "o", for others see: + /// https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx + /// and https://msdn.microsoft.com/en-us/library/8kb3ddd4(v=vs.110).aspx + /// No validation is done to ensure that the string you're providing is valid + /// + /// The DateTimeFormat string + public virtual string DateTimeFormat + { + get { return _dateTimeFormat; } + set + { + if (string.IsNullOrEmpty(value)) + { + // Never allow a blank or null string, go back to the default + _dateTimeFormat = ISO8601_DATETIME_FORMAT; + return; + } + + // Caution, no validation when you choose date time format other than ISO 8601 + // Take a look at the above links + _dateTimeFormat = value; + } + } + + /// + /// Gets or sets the prefix (e.g. Token) of the API key based on the authentication name. + /// + /// Whatever you set here will be prepended to the value defined in AddApiKey. + /// + /// An example invocation here might be: + /// + /// ApiKeyPrefix["Authorization"] = "Bearer"; + /// + /// … where ApiKey["Authorization"] would then be used to set the value of your bearer token. + /// + /// + /// OAuth2 workflows should set tokens via AccessToken. + /// + /// + /// The prefix of the API key. + public virtual IDictionary ApiKeyPrefix + { + get { return _apiKeyPrefix; } + set + { + if (value == null) + { + throw new InvalidOperationException("ApiKeyPrefix collection may not be null."); + } + _apiKeyPrefix = value; + } + } + + /// + /// Gets or sets the API key based on the authentication name. + /// + /// The API key. + public virtual IDictionary ApiKey + { + get { return _apiKey; } + set + { + if (value == null) + { + throw new InvalidOperationException("ApiKey collection may not be null."); + } + _apiKey = value; + } + } + {{#servers.0}} + + /// + /// Gets or sets the servers. + /// + /// The servers. + public virtual IList> Servers + { + get { return _servers; } + set + { + if (value == null) + { + throw new InvalidOperationException("Servers may not be null."); + } + _servers = value; + } + } + + /// + /// Gets or sets the operation servers. + /// + /// The operation servers. + public virtual IReadOnlyDictionary>> OperationServers + { + get { return _operationServers; } + set + { + if (value == null) + { + throw new InvalidOperationException("Operation servers may not be null."); + } + _operationServers = value; + } + } + + /// + /// Returns URL based on server settings without providing values + /// for the variables + /// + /// Array index of the server settings. + /// The server URL. + public string GetServerUrl(int index) + { + return GetServerUrl(Servers, index, null); + } + + /// + /// Returns URL based on server settings. + /// + /// Array index of the server settings. + /// Dictionary of the variables and the corresponding values. + /// The server URL. + public string GetServerUrl(int index, Dictionary inputVariables) + { + return GetServerUrl(Servers, index, inputVariables); + } + + /// + /// Returns URL based on operation server settings. + /// + /// Operation associated with the request path. + /// Array index of the server settings. + /// The operation server URL. + public string GetOperationServerUrl(string operation, int index) + { + return GetOperationServerUrl(operation, index, null); + } + + /// + /// Returns URL based on operation server settings. + /// + /// Operation associated with the request path. + /// Array index of the server settings. + /// Dictionary of the variables and the corresponding values. + /// The operation server URL. + public string GetOperationServerUrl(string operation, int index, Dictionary inputVariables) + { + if (operation != null && OperationServers.TryGetValue(operation, out var operationServer)) + { + return GetServerUrl(operationServer, index, inputVariables); + } + + return null; + } + + /// + /// Returns URL based on server settings. + /// + /// Dictionary of server settings. + /// Array index of the server settings. + /// Dictionary of the variables and the corresponding values. + /// The server URL. + private string GetServerUrl(IList> servers, int index, Dictionary inputVariables) + { + if (index < 0 || index >= servers.Count) + { + throw new InvalidOperationException($"Invalid index {index} when selecting the server. Must be less than {servers.Count}."); + } + + if (inputVariables == null) + { + inputVariables = new Dictionary(); + } + + IReadOnlyDictionary server = servers[index]; + string url = (string)server["url"]; + + if (server.ContainsKey("variables")) + { + // go through each variable and assign a value + foreach (KeyValuePair variable in (IReadOnlyDictionary)server["variables"]) + { + + IReadOnlyDictionary serverVariables = (IReadOnlyDictionary)(variable.Value); + + if (inputVariables.ContainsKey(variable.Key)) + { + if (((List)serverVariables["enum_values"]).Contains(inputVariables[variable.Key])) + { + url = url.Replace("{" + variable.Key + "}", inputVariables[variable.Key]); + } + else + { + throw new InvalidOperationException($"The variable `{variable.Key}` in the server URL has invalid value #{inputVariables[variable.Key]}. Must be {(List)serverVariables["enum_values"]}"); + } + } + else + { + // use default value + url = url.Replace("{" + variable.Key + "}", (string)serverVariables["default_value"]); + } + } + } + + return url; + } + {{/servers.0}} + {{#hasHttpSignatureMethods}} + + /// + /// Gets and Sets the HttpSigningConfiguration + /// + public HttpSigningConfiguration HttpSigningConfiguration + { + get { return _HttpSigningConfiguration; } + set { _HttpSigningConfiguration = value; } + } + {{/hasHttpSignatureMethods}} + + /// + /// Gets and Sets the RemoteCertificateValidationCallback + /// + public RemoteCertificateValidationCallback RemoteCertificateValidationCallback { get; set; } + + #endregion Properties + + #region Methods + + /// + /// Returns a string with essential information for debugging. + /// + public static string ToDebugReport() + { + string report = "C# SDK ({{{packageName}}}) Debug Report:\n"; + report += " OS: " + System.Environment.OSVersion + "\n"; + report += " .NET Framework Version: " + System.Environment.Version + "\n"; + report += " Version of the API: {{{version}}}\n"; + report += " SDK Package Version: {{{packageVersion}}}\n"; + + return report; + } + + /// + /// Add Api Key Header. + /// + /// Api Key name. + /// Api Key value. + /// + public void AddApiKey(string key, string value) + { + ApiKey[key] = value; + } + + /// + /// Sets the API key prefix. + /// + /// Api Key name. + /// Api Key value. + public void AddApiKeyPrefix(string key, string value) + { + ApiKeyPrefix[key] = value; + } + + #endregion Methods + + #region Static Members + /// + /// Merge configurations. + /// + /// First configuration. + /// Second configuration. + /// Merged configuration. + public static IReadableConfiguration MergeConfigurations(IReadableConfiguration first, IReadableConfiguration second) + { + if (second == null) return first ?? GlobalConfiguration.Instance; + + Dictionary apiKey = first.ApiKey.ToDictionary(kvp => kvp.Key, kvp => kvp.Value); + Dictionary apiKeyPrefix = first.ApiKeyPrefix.ToDictionary(kvp => kvp.Key, kvp => kvp.Value); + Dictionary defaultHeaders = first.DefaultHeaders.ToDictionary(kvp => kvp.Key, kvp => kvp.Value); + + foreach (var kvp in second.ApiKey) apiKey[kvp.Key] = kvp.Value; + foreach (var kvp in second.ApiKeyPrefix) apiKeyPrefix[kvp.Key] = kvp.Value; + foreach (var kvp in second.DefaultHeaders) defaultHeaders[kvp.Key] = kvp.Value; + + var config = new Configuration + { + ApiKey = apiKey, + ApiKeyPrefix = apiKeyPrefix, + DefaultHeaders = defaultHeaders, + BasePath = second.BasePath ?? first.BasePath, + Timeout = second.Timeout, + Proxy = second.Proxy ?? first.Proxy, + UserAgent = second.UserAgent ?? first.UserAgent, + Username = second.Username ?? first.Username, + Password = second.Password ?? first.Password, + AccessToken = second.AccessToken ?? first.AccessToken, + {{#useRestSharp}} + {{#hasOAuthMethods}} + OAuthTokenUrl = second.OAuthTokenUrl ?? first.OAuthTokenUrl, + OAuthClientId = second.OAuthClientId ?? first.OAuthClientId, + OAuthClientSecret = second.OAuthClientSecret ?? first.OAuthClientSecret, + OAuthScope = second.OAuthScope ?? first.OAuthScope, + OAuthFlow = second.OAuthFlow ?? first.OAuthFlow, + {{/hasOAuthMethods}} + {{/useRestSharp}} + {{#hasHttpSignatureMethods}} + HttpSigningConfiguration = second.HttpSigningConfiguration ?? first.HttpSigningConfiguration, + {{/hasHttpSignatureMethods}} + TempFolderPath = second.TempFolderPath ?? first.TempFolderPath, + DateTimeFormat = second.DateTimeFormat ?? first.DateTimeFormat, + ClientCertificates = second.ClientCertificates ?? first.ClientCertificates, + UseDefaultCredentials = second.UseDefaultCredentials, + RemoteCertificateValidationCallback = second.RemoteCertificateValidationCallback ?? first.RemoteCertificateValidationCallback, + }; + return config; + } + #endregion Static Members + } +} diff --git a/templates/Entry.cs b/templates/Entry.cs new file mode 100644 index 0000000..b642a7f --- /dev/null +++ b/templates/Entry.cs @@ -0,0 +1,8 @@ +namespace Dropbox.SignSandbox; + +public class Entry +{ + public static void Main() + { + } +} diff --git a/templates/HttpSigningConfiguration.mustache b/templates/HttpSigningConfiguration.mustache index faca675..97b855d 100644 --- a/templates/HttpSigningConfiguration.mustache +++ b/templates/HttpSigningConfiguration.mustache @@ -133,16 +133,18 @@ namespace {{packageName}}.Client foreach (var parameter in requestOptions.QueryParameters) { #if (NETCOREAPP) + string framework = RuntimeInformation.FrameworkDescription; + string key = framework.StartsWith(".NET 9")?parameter.Key:HttpUtility.UrlEncode(parameter.Key); if (parameter.Value.Count > 1) { // array foreach (var value in parameter.Value) { - httpValues.Add(HttpUtility.UrlEncode(parameter.Key) + "[]", value); + httpValues.Add(key + "[]", value); } } else { - httpValues.Add(HttpUtility.UrlEncode(parameter.Key), parameter.Value[0]); + httpValues.Add(key, parameter.Value[0]); } #else if (parameter.Value.Count > 1) @@ -389,7 +391,7 @@ namespace {{packageName}}.Client } /// - /// Convert ANS1 format to DER format. Not recommended to use because it generate inavlid signature occationally. + /// Convert ANS1 format to DER format. Not recommended to use because it generate invalid signature occasionally. /// /// /// diff --git a/templates/IReadableConfiguration.mustache b/templates/IReadableConfiguration.mustache index 5981728..6712aa6 100644 --- a/templates/IReadableConfiguration.mustache +++ b/templates/IReadableConfiguration.mustache @@ -101,10 +101,10 @@ namespace {{packageName}}.Client string TempFolderPath { get; } /// - /// Gets the HTTP connection timeout (in milliseconds) + /// Gets the HTTP connection timeout. /// /// HTTP connection timeout. - int Timeout { get; } + TimeSpan Timeout { get; } /// /// Gets the proxy. diff --git a/templates/IReadableConfiguration.v790.mustache b/templates/IReadableConfiguration.v790.mustache new file mode 100644 index 0000000..5981728 --- /dev/null +++ b/templates/IReadableConfiguration.v790.mustache @@ -0,0 +1,178 @@ +{{>partial_header}} + +using System; +using System.Collections.Generic; +using System.Net; +using System.Net.Security; +using System.Security.Cryptography.X509Certificates; +{{#useRestSharp}} +{{#hasOAuthMethods}}using {{packageName}}.Client.Auth; +{{/hasOAuthMethods}} +{{/useRestSharp}} + +namespace {{packageName}}.Client +{ + /// + /// Represents a readable-only configuration contract. + /// + public interface IReadableConfiguration + { + /// + /// Gets the access token. + /// + /// Access token. + string AccessToken { get; } + + {{#useRestSharp}} + {{#hasOAuthMethods}} + /// + /// Gets the OAuth token URL. + /// + /// OAuth Token URL. + string OAuthTokenUrl { get; } + + /// + /// Gets the OAuth client ID. + /// + /// OAuth Client ID. + string OAuthClientId { get; } + + /// + /// Gets the OAuth client secret. + /// + /// OAuth Client Secret. + string OAuthClientSecret { get; } + + /// + /// Gets the OAuth token scope. + /// + /// OAuth Token scope. + string{{nrt?}} OAuthScope { get; } + + /// + /// Gets the OAuth flow. + /// + /// OAuth Flow. + OAuthFlow? OAuthFlow { get; } + + {{/hasOAuthMethods}} + {{/useRestSharp}} + /// + /// Gets the API key. + /// + /// API key. + IDictionary ApiKey { get; } + + /// + /// Gets the API key prefix. + /// + /// API key prefix. + IDictionary ApiKeyPrefix { get; } + + /// + /// Gets the base path. + /// + /// Base path. + string BasePath { get; } + + /// + /// Gets the date time format. + /// + /// Date time format. + string DateTimeFormat { get; } + + /// + /// Gets the default header. + /// + /// Default header. + [Obsolete("Use DefaultHeaders instead.")] + IDictionary DefaultHeader { get; } + + /// + /// Gets the default headers. + /// + /// Default headers. + IDictionary DefaultHeaders { get; } + + /// + /// Gets the temp folder path. + /// + /// Temp folder path. + string TempFolderPath { get; } + + /// + /// Gets the HTTP connection timeout (in milliseconds) + /// + /// HTTP connection timeout. + int Timeout { get; } + + /// + /// Gets the proxy. + /// + /// Proxy. + WebProxy Proxy { get; } + + /// + /// Gets the user agent. + /// + /// User agent. + string UserAgent { get; } + + /// + /// Gets the username. + /// + /// Username. + string Username { get; } + + /// + /// Gets the password. + /// + /// Password. + string Password { get; } + + /// + /// Determine whether or not the "default credentials" (e.g. the user account under which the current process is running) will be sent along to the server. The default is false. + /// + bool UseDefaultCredentials { get; } + + /// + /// Get the servers associated with the operation. + /// + /// Operation servers. + IReadOnlyDictionary>> OperationServers { get; } + + /// + /// Gets the API key with prefix. + /// + /// API key identifier (authentication scheme). + /// API key with prefix. + string GetApiKeyWithPrefix(string apiKeyIdentifier); + + /// + /// Gets the Operation server url at the provided index. + /// + /// Operation server name. + /// Index of the operation server settings. + /// + string GetOperationServerUrl(string operation, int index); + + /// + /// Gets certificate collection to be sent with requests. + /// + /// X509 Certificate collection. + X509CertificateCollection ClientCertificates { get; } + {{#hasHttpSignatureMethods}} + + /// + /// Gets the HttpSigning configuration + /// + HttpSigningConfiguration HttpSigningConfiguration { get; } + {{/hasHttpSignatureMethods}} + + /// + /// Callback function for handling the validation of remote certificates. Useful for certificate pinning and + /// overriding certificate errors in the scope of a request. + /// + RemoteCertificateValidationCallback RemoteCertificateValidationCallback { get; } + } +} diff --git a/templates/README.mustache b/templates/README.mustache index f70a5da..7455a8f 100644 --- a/templates/README.mustache +++ b/templates/README.mustache @@ -67,7 +67,7 @@ this command. ## Dependencies {{#useRestSharp}} -- [RestSharp](https://www.nuget.org/packages/RestSharp) - 106.13.0 or later +- [RestSharp](https://www.nuget.org/packages/RestSharp) - 112.0.0 or later {{/useRestSharp}} - [Json.NET](https://www.nuget.org/packages/Newtonsoft.Json/) - 13.0.2 or later - [JsonSubTypes](https://www.nuget.org/packages/JsonSubTypes/) - 1.8.0 or later diff --git a/templates/Solution.mustache b/templates/Solution.mustache index f558967..268f8c7 100644 --- a/templates/Solution.mustache +++ b/templates/Solution.mustache @@ -2,14 +2,16 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio {{^netStandard}}2012{{/netStandard}}{{#netStandard}}14{{/netStandard}} VisualStudioVersion = {{^netStandard}}12.0.0.0{{/netStandard}}{{#netStandard}}14.0.25420.1{{/netStandard}} MinimumVisualStudioVersion = {{^netStandard}}10.0.0.1{{/netStandard}}{{#netStandard}}10.0.40219.1{{/netStandard}} -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "{{packageName}}", "src\{{packageName}}\{{packageName}}.csproj", "{{packageGuid}}" -EndProject {{^useCustomTemplateCode}} -{{^excludeTests}}Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "{{testPackageName}}", "src\{{testPackageName}}\{{testPackageName}}.csproj", "{19F1DEBC-DE5E-4517-8062-F000CD499087}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "{{packageName}}", "{{sourceFolder}}\{{packageName}}\{{packageName}}.csproj", "{{packageGuid}}" +EndProject +{{^excludeTests}}Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "{{testPackageName}}", "{{sourceFolder}}\{{testPackageName}}\{{testPackageName}}.csproj", "{19F1DEBC-DE5E-4517-8062-F000CD499087}" EndProject {{/excludeTests}}Global {{/useCustomTemplateCode}} {{#useCustomTemplateCode}} +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "{{packageName}}", "src\{{packageName}}\{{packageName}}.csproj", "{{packageGuid}}" +EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Dropbox.Sign.Test", "src\Dropbox.Sign.Test\Dropbox.Sign.Test.csproj", "{C305EB17-93FE-4BDA-89A4-120BD8C8A88A}" EndProject Global diff --git a/templates/api.mustache b/templates/api.mustache index 632833a..c0b29af 100644 --- a/templates/api.mustache +++ b/templates/api.mustache @@ -317,6 +317,7 @@ namespace {{packageName}}.{{apiPackage}} {{^useCustomTemplateCode}} var localVarContentType = {{packageName}}.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + var localVarMultipartFormData = localVarContentType == "multipart/form-data"; {{/useCustomTemplateCode}} if (localVarContentType != null) { @@ -403,7 +404,7 @@ namespace {{packageName}}.{{apiPackage}} {{/isArray}} {{/isFile}} {{^isFile}} - localVarRequestOptions.FormParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.{{#isPrimitiveType}}ParameterToString{{/isPrimitiveType}}{{^isPrimitiveType}}Serialize{{/isPrimitiveType}}({{paramName}})); // form parameter + localVarRequestOptions.FormParameters.Add("{{baseName}}", {{#isPrimitiveType}}{{packageName}}.Client.ClientUtils.ParameterToString({{paramName}}){{/isPrimitiveType}}{{^isPrimitiveType}}localVarMultipartFormData ? {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}}) : {{packageName}}.Client.ClientUtils.Serialize({{paramName}}){{/isPrimitiveType}}); // form parameter {{/isFile}} {{/required}} {{^required}} @@ -425,7 +426,7 @@ namespace {{packageName}}.{{apiPackage}} {{/isArray}} {{/isFile}} {{^isFile}} - localVarRequestOptions.FormParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.{{#isPrimitiveType}}ParameterToString{{/isPrimitiveType}}{{^isPrimitiveType}}Serialize{{/isPrimitiveType}}({{paramName}})); // form parameter + localVarRequestOptions.FormParameters.Add("{{baseName}}", {{#isPrimitiveType}}{{packageName}}.Client.ClientUtils.ParameterToString({{paramName}}){{/isPrimitiveType}}{{^isPrimitiveType}}localVarMultipartFormData ? {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}}) : {{packageName}}.Client.ClientUtils.Serialize({{paramName}}){{/isPrimitiveType}}); // form parameter {{/isFile}} } {{/required}} diff --git a/templates/auth/OAuthAuthenticator.mustache b/templates/auth/OAuthAuthenticator.mustache index d71f262..111270e 100644 --- a/templates/auth/OAuthAuthenticator.mustache +++ b/templates/auth/OAuthAuthenticator.mustache @@ -11,8 +11,25 @@ namespace {{packageName}}.Client.Auth /// /// An authenticator for OAuth2 authentication flows /// - public class OAuthAuthenticator : AuthenticatorBase + public class OAuthAuthenticator : IAuthenticator { + private TokenResponse{{nrt?}} _token; + + /// + /// Returns the current authentication token. Can return null if there is no authentication token, or it has expired. + /// + public string{{nrt?}} Token + { + get + { + if (_token == null) return null; + if (_token.ExpiresIn == null) return _token.AccessToken; + if (_token.ExpiresAt < DateTime.Now) return null; + + return _token.AccessToken; + } + } + readonly string _tokenUrl; readonly string _clientId; readonly string _clientSecret; @@ -31,7 +48,7 @@ namespace {{packageName}}.Client.Auth string{{nrt?}} scope, OAuthFlow? flow, JsonSerializerSettings serializerSettings, - IReadableConfiguration configuration) : base("") + IReadableConfiguration configuration) { _tokenUrl = tokenUrl; _clientId = clientId; @@ -62,9 +79,13 @@ namespace {{packageName}}.Client.Auth /// /// Creates an authentication parameter from an access token. /// - /// Access token to create a parameter from. /// An authentication parameter. - protected override async ValueTask GetAuthenticationParameter(string accessToken) +{{^useCustomTemplateCode}} + protected async ValueTask GetAuthenticationParameter() +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} + protected async ValueTask GetAuthenticationParameter(string accessToken) +{{/useCustomTemplateCode}} { var token = string.IsNullOrEmpty(Token) ? await GetToken().ConfigureAwait(false) : Token; return new HeaderParameter(KnownHeaders.Authorization, token); @@ -76,31 +97,45 @@ namespace {{packageName}}.Client.Auth /// An authentication token. async Task GetToken() { - var client = new RestClient(_tokenUrl, - configureSerialization: serializerConfig => serializerConfig.UseSerializer(() => new CustomJsonCodec(_serializerSettings, _configuration))); - - var request = new RestRequest() - .AddParameter("grant_type", _grantType) - .AddParameter("client_id", _clientId) - .AddParameter("client_secret", _clientSecret); + var client = new RestClient(_tokenUrl, configureSerialization: serializerConfig => serializerConfig.UseSerializer(() => new CustomJsonCodec(_serializerSettings, _configuration))); + var request = new RestRequest(); + if (!string.IsNullOrWhiteSpace(_token?.RefreshToken)) + { + request.AddParameter("grant_type", "refresh_token") + .AddParameter("refresh_token", _token.RefreshToken); + } + else + { + request + .AddParameter("grant_type", _grantType) + .AddParameter("client_id", _clientId) + .AddParameter("client_secret", _clientSecret); + } if (!string.IsNullOrEmpty(_scope)) { request.AddParameter("scope", _scope); } - - var response = await client.PostAsync(request).ConfigureAwait(false); - + _token = await client.PostAsync(request).ConfigureAwait(false); // RFC6749 - token_type is case insensitive. // RFC6750 - In Authorization header Bearer should be capitalized. // Fix the capitalization irrespective of token_type casing. - switch (response.TokenType?.ToLower()) + switch (_token?.TokenType?.ToLower()) { case "bearer": - return $"Bearer {response.AccessToken}"; + return $"Bearer {_token.AccessToken}"; default: - return $"{response.TokenType} {response.AccessToken}"; + return $"{_token?.TokenType} {_token?.AccessToken}"; } } + + /// + /// Retrieves the authentication token (creating a new one if necessary) and adds it to the current request + /// + /// + /// + /// + public async ValueTask Authenticate(IRestClient client, RestRequest request) + => request.AddOrUpdateParameter(await GetAuthenticationParameter().ConfigureAwait(false)); } } diff --git a/templates/auth/TokenResponse.mustache b/templates/auth/TokenResponse.mustache index f118b97..7a72e04 100644 --- a/templates/auth/TokenResponse.mustache +++ b/templates/auth/TokenResponse.mustache @@ -1,5 +1,6 @@ {{>partial_header}} +using System; using Newtonsoft.Json; namespace {{packageName}}.Client.Auth @@ -10,5 +11,14 @@ namespace {{packageName}}.Client.Auth public string TokenType { get; set; } [JsonProperty("access_token")] public string AccessToken { get; set; } + [JsonProperty("expires_in")] + public int? ExpiresIn { get; set; } + [JsonProperty("created")] + public DateTime? Created { get; set; } + + [JsonProperty("refresh_token")] + public string{{nrt?}} RefreshToken { get; set; } + + public DateTime? ExpiresAt => ExpiresIn == null ? null : Created?.AddSeconds(ExpiresIn.Value); } } \ No newline at end of file diff --git a/templates/gitignore.mustache b/templates/gitignore.mustache index a41122f..da28f4e 100644 --- a/templates/gitignore.mustache +++ b/templates/gitignore.mustache @@ -364,6 +364,8 @@ MigrationBackup/ FodyWeavers.xsd {{#useCustomTemplateCode}} +git_push.sh +global.json vendor /api .openapi-generator diff --git a/templates/libraries/generichost/ApiTestsBase.mustache b/templates/libraries/generichost/ApiTestsBase.mustache index 3292a1e..c71bc79 100644 --- a/templates/libraries/generichost/ApiTestsBase.mustache +++ b/templates/libraries/generichost/ApiTestsBase.mustache @@ -31,7 +31,7 @@ namespace {{packageName}}.Test.{{apiPackage}} {{#lambda.trimTrailingWithNewLine}} {{#apiKeyMethods}} string apiKeyTokenValue{{-index}} = context.Configuration[""] ?? throw new Exception("Token not found."); - ApiKeyToken apiKeyToken{{-index}} = new{{^net70OrLater}} ApiKeyToken{{/net70OrLater}}(apiKeyTokenValue{{-index}}, ClientUtils.ApiKeyHeader.{{#lambda.titlecase}}{{keyParamName}}{{/lambda.titlecase}}, timeout: TimeSpan.FromSeconds(1)); + ApiKeyToken apiKeyToken{{-index}} = new{{^net70OrLater}} ApiKeyToken{{/net70OrLater}}(apiKeyTokenValue{{-index}}, ClientUtils.ApiKeyHeader.{{#lambda.titlecase}}{{#lambda.alphabet_or_underscore}}{{keyParamName}}{{/lambda.alphabet_or_underscore}}{{/lambda.titlecase}}, timeout: TimeSpan.FromSeconds(1)); options.AddTokens(apiKeyToken{{-index}}); {{/apiKeyMethods}} diff --git a/templates/libraries/generichost/ClientUtils.mustache b/templates/libraries/generichost/ClientUtils.mustache index 269d20c..357d219 100644 --- a/templates/libraries/generichost/ClientUtils.mustache +++ b/templates/libraries/generichost/ClientUtils.mustache @@ -12,7 +12,11 @@ using System.Text; using System.Text.Json; using System.Text.RegularExpressions;{{#useCompareNetObjects}} using KellermanSoftware.CompareNetObjects;{{/useCompareNetObjects}} +{{#models}} +{{#-first}} using {{packageName}}.{{modelPackage}}; +{{/-first}} +{{/models}} using System.Runtime.CompilerServices; {{>Assembly}}namespace {{packageName}}.{{clientPackage}} @@ -20,7 +24,7 @@ using System.Runtime.CompilerServices; /// /// Utility functions providing some benefit to API client consumers. /// - {{>visibility}} static class ClientUtils + {{>visibility}} static {{#net70OrLater}}partial {{/net70OrLater}}class ClientUtils { {{#useCompareNetObjects}} /// @@ -60,7 +64,7 @@ using System.Runtime.CompilerServices; /// /// The {{keyParamName}} header /// - {{#lambda.titlecase}}{{keyParamName}}{{/lambda.titlecase}}{{^-last}},{{/-last}} + {{#lambda.titlecase}}{{#lambda.alphabet_or_underscore}}{{keyParamName}}{{/lambda.alphabet_or_underscore}}{{/lambda.titlecase}}{{^-last}},{{/-last}} {{/apiKeyMethods}} } @@ -76,7 +80,7 @@ using System.Runtime.CompilerServices; return value switch { {{#apiKeyMethods}} - ApiKeyHeader.{{#lambda.titlecase}}{{keyParamName}}{{/lambda.titlecase}} => "{{keyParamName}}", + ApiKeyHeader.{{#lambda.titlecase}}{{#lambda.alphabet_or_underscore}}{{keyParamName}}{{/lambda.alphabet_or_underscore}}{{/lambda.titlecase}} => "{{keyParamName}}", {{/apiKeyMethods}} _ => throw new System.ComponentModel.InvalidEnumArgumentException(nameof(value), (int)value, typeof(ApiKeyHeader)), }; @@ -85,7 +89,7 @@ using System.Runtime.CompilerServices; switch(value) { {{#apiKeyMethods}} - case ApiKeyHeader.{{#lambda.titlecase}}{{keyParamName}}{{/lambda.titlecase}}: + case ApiKeyHeader.{{#lambda.titlecase}}{{#lambda.alphabet_or_underscore}}{{keyParamName}}{{/lambda.alphabet_or_underscore}}{{/lambda.titlecase}}: return "{{keyParamName}}"; {{/apiKeyMethods}} default: @@ -139,17 +143,6 @@ using System.Runtime.CompilerServices; } } - /// - /// Sanitize filename by removing the path - /// - /// Filename - /// Filename - public static string SanitizeFilename(string filename) - { - Match match = Regex.Match(filename, @".*[/\\](.*)$"); - return match.Success ? match.Groups[1].Value : filename; - } - /// /// If parameter is DateTime, output in a formatted string (default ISO 8601), customizable with Configuration.DateTime. /// If parameter is a list, join the list with ",". @@ -172,6 +165,10 @@ using System.Runtime.CompilerServices; // https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx#Anchor_8 // For example: 2009-06-15T13:45:30.0000000 return dateTimeOffset.ToString(format); + {{#net60OrLater}} + if (obj is DateOnly dateOnly) + return dateOnly.ToString(format); + {{/net60OrLater}} if (obj is bool boolean) return boolean ? "true" @@ -317,7 +314,13 @@ using System.Runtime.CompilerServices; /// /// Provides a case-insensitive check that a provided content type is a known JSON-like content type. /// - public static readonly Regex JsonRegex = new Regex("(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$"); + {{#net70OrLater}} + [GeneratedRegex("(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$")] + private static partial Regex JsonRegex(); + {{/net70OrLater}} + {{^net70OrLater}} + private static readonly Regex JsonRegex = new Regex("(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$"); + {{/net70OrLater}} /// /// Check if the given MIME is a JSON MIME. @@ -333,7 +336,7 @@ using System.Runtime.CompilerServices; { if (string.IsNullOrWhiteSpace(mime)) return false; - return JsonRegex.IsMatch(mime) || mime.Equals("application/json-patch+json"); + return {{#net70OrLater}}JsonRegex(){{/net70OrLater}}{{^net70OrLater}}JsonRegex{{/net70OrLater}}.IsMatch(mime) || mime.Equals("application/json-patch+json"); } /// diff --git a/templates/libraries/generichost/DependencyInjectionTests.mustache b/templates/libraries/generichost/DependencyInjectionTests.mustache index aadf2c7..6085b51 100644 --- a/templates/libraries/generichost/DependencyInjectionTests.mustache +++ b/templates/libraries/generichost/DependencyInjectionTests.mustache @@ -21,7 +21,7 @@ namespace {{packageName}}.Test.{{apiPackage}} { {{#lambda.trimTrailingWithNewLine}} {{#apiKeyMethods}} - ApiKeyToken apiKeyToken{{-index}} = new{{^net70OrLater}} ApiKeyToken{{/net70OrLater}}("", ClientUtils.ApiKeyHeader.{{#lambda.titlecase}}{{keyParamName}}{{/lambda.titlecase}}, timeout: TimeSpan.FromSeconds(1)); + ApiKeyToken apiKeyToken{{-index}} = new{{^net70OrLater}} ApiKeyToken{{/net70OrLater}}("", ClientUtils.ApiKeyHeader.{{#lambda.titlecase}}{{#lambda.alphabet_or_underscore}}{{keyParamName}}{{/lambda.alphabet_or_underscore}}{{/lambda.titlecase}}, timeout: TimeSpan.FromSeconds(1)); options.AddTokens(apiKeyToken{{-index}}); {{/apiKeyMethods}} @@ -55,7 +55,7 @@ namespace {{packageName}}.Test.{{apiPackage}} { {{#lambda.trimTrailingWithNewLine}} {{#apiKeyMethods}} - ApiKeyToken apiKeyToken{{-index}} = new{{^net70OrLater}} ApiKeyToken{{/net70OrLater}}("", ClientUtils.ApiKeyHeader.{{#lambda.titlecase}}{{keyParamName}}{{/lambda.titlecase}}, timeout: TimeSpan.FromSeconds(1)); + ApiKeyToken apiKeyToken{{-index}} = new{{^net70OrLater}} ApiKeyToken{{/net70OrLater}}("", ClientUtils.ApiKeyHeader.{{#lambda.titlecase}}{{#lambda.alphabet_or_underscore}}{{keyParamName}}{{/lambda.alphabet_or_underscore}}{{/lambda.titlecase}}, timeout: TimeSpan.FromSeconds(1)); options.AddTokens(apiKeyToken{{-index}}); {{/apiKeyMethods}} @@ -92,7 +92,7 @@ namespace {{packageName}}.Test.{{apiPackage}} { {{#lambda.trimTrailingWithNewLine}} {{#apiKeyMethods}} - ApiKeyToken apiKeyToken{{-index}} = new{{^net70OrLater}} ApiKeyToken{{/net70OrLater}}("", ClientUtils.ApiKeyHeader.{{#lambda.titlecase}}{{keyParamName}}{{/lambda.titlecase}}, timeout: TimeSpan.FromSeconds(1)); + ApiKeyToken apiKeyToken{{-index}} = new{{^net70OrLater}} ApiKeyToken{{/net70OrLater}}("", ClientUtils.ApiKeyHeader.{{#lambda.titlecase}}{{#lambda.alphabet_or_underscore}}{{keyParamName}}{{/lambda.alphabet_or_underscore}}{{/lambda.titlecase}}, timeout: TimeSpan.FromSeconds(1)); options.AddTokens(apiKeyToken{{-index}}); {{/apiKeyMethods}} @@ -129,7 +129,7 @@ namespace {{packageName}}.Test.{{apiPackage}} { {{#lambda.trimTrailingWithNewLine}} {{#apiKeyMethods}} - ApiKeyToken apiKeyToken{{-index}} = new{{^net70OrLater}} ApiKeyToken{{/net70OrLater}}("", ClientUtils.ApiKeyHeader.{{#lambda.titlecase}}{{keyParamName}}{{/lambda.titlecase}}, timeout: TimeSpan.FromSeconds(1)); + ApiKeyToken apiKeyToken{{-index}} = new{{^net70OrLater}} ApiKeyToken{{/net70OrLater}}("", ClientUtils.ApiKeyHeader.{{#lambda.titlecase}}{{#lambda.alphabet_or_underscore}}{{keyParamName}}{{/lambda.alphabet_or_underscore}}{{/lambda.titlecase}}, timeout: TimeSpan.FromSeconds(1)); options.AddTokens(apiKeyToken{{-index}}); {{/apiKeyMethods}} diff --git a/templates/libraries/generichost/ExceptionEventArgs.mustache b/templates/libraries/generichost/ExceptionEventArgs.mustache index 016ef7c..b74fcfa 100644 --- a/templates/libraries/generichost/ExceptionEventArgs.mustache +++ b/templates/libraries/generichost/ExceptionEventArgs.mustache @@ -13,7 +13,7 @@ namespace {{packageName}}.{{clientPackage}} public Exception Exception { get; } /// - /// The ExcepetionEventArgs + /// The ExceptionEventArgs /// /// public ExceptionEventArgs(Exception exception) diff --git a/templates/libraries/generichost/HostConfiguration.mustache b/templates/libraries/generichost/HostConfiguration.mustache index d7d1e3b..1333f0e 100644 --- a/templates/libraries/generichost/HostConfiguration.mustache +++ b/templates/libraries/generichost/HostConfiguration.mustache @@ -11,7 +11,11 @@ using System.Text.Json.Serialization; using System.Net.Http; using Microsoft.Extensions.DependencyInjection; using {{packageName}}.{{apiPackage}}; +{{#models}} +{{#-first}} using {{packageName}}.{{modelPackage}}; +{{/-first}} +{{/models}} namespace {{packageName}}.{{clientPackage}} { diff --git a/templates/libraries/generichost/HttpSigningConfiguration.mustache b/templates/libraries/generichost/HttpSigningConfiguration.mustache index 5e0f773..357626f 100644 --- a/templates/libraries/generichost/HttpSigningConfiguration.mustache +++ b/templates/libraries/generichost/HttpSigningConfiguration.mustache @@ -65,7 +65,7 @@ namespace {{packageName}}.{{clientPackage}} public string SigningAlgorithm { get; set; } /// - /// Gets the Signature validaty period in seconds + /// Gets the Signature validity period in seconds /// public int SignatureValidityPeriod { get; set; } diff --git a/templates/libraries/generichost/JsonConverter.mustache b/templates/libraries/generichost/JsonConverter.mustache index 189acfd..0ff2753 100644 --- a/templates/libraries/generichost/JsonConverter.mustache +++ b/templates/libraries/generichost/JsonConverter.mustache @@ -51,7 +51,7 @@ {{/-first}} if (discriminator != null && discriminator.Equals("{{name}}")) - return JsonSerializer.Deserialize<{{{name}}}>(ref utf8JsonReader, jsonSerializerOptions) ?? throw new JsonException("The result was an unexpected value."); + return JsonSerializer.Deserialize<{{{classname}}}>(ref utf8JsonReader, jsonSerializerOptions) ?? throw new JsonException("The result was an unexpected value."); {{/children}} {{/discriminator}} @@ -342,13 +342,13 @@ public override void Write(Utf8JsonWriter writer, {{classname}} {{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}, JsonSerializerOptions jsonSerializerOptions) { {{#lambda.trimLineBreaks}} - {{#lambda.copy}} + {{#lambda.copyText}} {{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}} - {{/lambda.copy}} + {{/lambda.copyText}} {{#discriminator}} {{#children}} - if ({{#lambda.pasteLine}}{{/lambda.pasteLine}} is {{classname}} {{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}){ - JsonSerializer.Serialize<{{{name}}}>(writer, {{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}, jsonSerializerOptions); + if ({{#lambda.paste}}{{/lambda.paste}} is {{classname}} {{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}){ + JsonSerializer.Serialize<{{{classname}}}>(writer, {{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}, jsonSerializerOptions); return; } @@ -439,7 +439,7 @@ {{#isDiscriminator}} {{^model.composedSchemas.anyOf}} {{^model.composedSchemas.oneOf}} - writer.WriteString("{{baseName}}", {{^isEnum}}{{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}{{/isEnum}}{{#isNew}}{{#isEnum}}{{#isInnerEnum}}{{classname}}.{{{datatypeWithEnum}}}ToJsonValue{{/isInnerEnum}}{{^isInnerEnum}}{{{datatypeWithEnum}}}ValueConverter.ToJsonValue{{/isInnerEnum}}({{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}{{^required}}.Value{{/required}}){{/isEnum}}{{/isNew}}); + writer.WriteString("{{baseName}}", {{^isEnum}}{{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}{{/isEnum}}{{#isEnum}}{{#isInnerEnum}}{{classname}}.{{{datatypeWithEnum}}}ToJsonValue{{/isInnerEnum}}{{^isInnerEnum}}{{{datatypeWithEnum}}}ValueConverter.ToJsonValue{{/isInnerEnum}}({{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}{{^required}}.Value{{/required}}){{/isEnum}}); {{/model.composedSchemas.oneOf}} {{/model.composedSchemas.anyOf}} @@ -449,9 +449,9 @@ {{^isMap}} {{^isEnum}} {{^isUuid}} - {{#lambda.copy}} + {{#lambda.copyText}} writer.WriteString("{{baseName}}", {{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}); - {{/lambda.copy}} + {{/lambda.copyText}} {{#lambda.indent3}} {{>WriteProperty}} {{/lambda.indent3}} @@ -460,44 +460,44 @@ {{/isMap}} {{/isString}} {{#isBoolean}} - {{#lambda.copy}} + {{#lambda.copyText}} writer.WriteBoolean("{{baseName}}", {{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}{{^required}}Option.Value{{#vendorExtensions.x-is-value-type}}{{nrt!}}.Value{{/vendorExtensions.x-is-value-type}}{{/required}}{{#required}}{{#isNullable}}.Value{{/isNullable}}{{/required}}); - {{/lambda.copy}} + {{/lambda.copyText}} {{#lambda.indent3}} {{>WriteProperty}} {{/lambda.indent3}} {{/isBoolean}} {{^isEnum}} {{#isNumeric}} - {{#lambda.copy}} + {{#lambda.copyText}} writer.WriteNumber("{{baseName}}", {{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}{{^required}}Option.Value{{#vendorExtensions.x-is-value-type}}{{nrt!}}.Value{{/vendorExtensions.x-is-value-type}}{{/required}}{{#required}}{{#isNullable}}.Value{{/isNullable}}{{/required}}); - {{/lambda.copy}} + {{/lambda.copyText}} {{#lambda.indent3}} {{>WriteProperty}} {{/lambda.indent3}} {{/isNumeric}} {{/isEnum}} {{#isDate}} - {{#lambda.copy}} + {{#lambda.copyText}} writer.WriteString("{{baseName}}", {{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}{{^required}}Option.Value{{#vendorExtensions.x-is-value-type}}{{nrt!}}.Value{{/vendorExtensions.x-is-value-type}}{{/required}}{{#required}}{{#isNullable}}.Value{{/isNullable}}{{/required}}.ToString({{name}}Format)); - {{/lambda.copy}} + {{/lambda.copyText}} {{#lambda.indent3}} {{>WriteProperty}} {{/lambda.indent3}} {{/isDate}} {{#isDateTime}} - {{#lambda.copy}} + {{#lambda.copyText}} writer.WriteString("{{baseName}}", {{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}{{^required}}Option.Value{{#vendorExtensions.x-is-value-type}}{{nrt!}}.Value{{/vendorExtensions.x-is-value-type}}{{/required}}{{#required}}{{#isNullable}}.Value{{/isNullable}}{{/required}}.ToString({{name}}Format)); - {{/lambda.copy}} + {{/lambda.copyText}} {{#lambda.indent3}} {{>WriteProperty}} {{/lambda.indent3}} {{/isDateTime}} {{#isEnum}} {{#isNumeric}} - {{#lambda.copy}} + {{#lambda.copyText}} writer.WriteNumber("{{baseName}}", {{#isInnerEnum}}{{classname}}.{{/isInnerEnum}}{{{datatypeWithEnum}}}ToJsonValue({{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}{{^required}}Option.Value{{#vendorExtensions.x-is-value-type}}{{nrt!}}.Value{{/vendorExtensions.x-is-value-type}}{{/required}}{{#required}}{{#isNullable}}.Value{{/isNullable}}{{/required}})); - {{/lambda.copy}} + {{/lambda.copyText}} {{#lambda.indent3}} {{>WriteProperty}} {{/lambda.indent3}} @@ -519,9 +519,9 @@ {{/isNullable}} {{/isInnerEnum}} {{^isInnerEnum}} - {{#lambda.copy}} + {{#lambda.copyText}} {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} - {{/lambda.copy}} + {{/lambda.copyText}} {{#required}} {{#isNullable}} if ({{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}} == null) @@ -533,7 +533,7 @@ {{#enumVars}} {{#-first}} {{#isString}} - if ({{#lambda.pasteLine}}{{/lambda.pasteLine}}RawValue != null){{! we cant use name here because enumVar also has a name property, so use the paste lambda instead }} + if ({{#lambda.paste}}{{/lambda.paste}}RawValue != null){{! we cant use name here because enumVar also has a name property, so use the paste lambda instead }} writer.WriteString("{{baseName}}", {{#lambda.camelcase_sanitize_param}}{{nameInPascalCase}}{{/lambda.camelcase_sanitize_param}}RawValue); else writer.WriteNull("{{baseName}}"); @@ -552,10 +552,10 @@ {{#enumVars}} {{#-first}} {{^isNumeric}} - writer.WriteString("{{baseName}}", {{#lambda.pasteLine}}{{/lambda.pasteLine}}RawValue); + writer.WriteString("{{baseName}}", {{#lambda.paste}}{{/lambda.paste}}RawValue); {{/isNumeric}} {{#isNumeric}} - writer.WriteNumber("{{baseName}}", {{#lambda.camelcase_sanitize_param}}{{#lambda.pasteLine}}{{/lambda.pasteLine}}{{/lambda.camelcase_sanitize_param}}RawValue); + writer.WriteNumber("{{baseName}}", {{#lambda.camelcase_sanitize_param}}{{#lambda.paste}}{{/lambda.paste}}{{/lambda.camelcase_sanitize_param}}RawValue); {{/isNumeric}} {{/-first}} {{/enumVars}} @@ -568,16 +568,16 @@ {{#isNullable}} if ({{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}Option{{nrt!}}.Value != null) { - var {{#lambda.pasteLine}}{{/lambda.pasteLine}}RawValue = {{{datatypeWithEnum}}}ValueConverter.ToJsonValue({{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}Option.Value{{nrt!}}.Value); - writer.{{#lambda.first}}{{#allowableValues}}{{#enumVars}}{{^isNumeric}}WriteString {{/isNumeric}}{{#isNumeric}}WriteNumber {{/isNumeric}}{{/enumVars}}{{/allowableValues}}{{/lambda.first}}("{{baseName}}", {{#lambda.pasteLine}}{{/lambda.pasteLine}}RawValue); + var {{#lambda.paste}}{{/lambda.paste}}RawValue = {{{datatypeWithEnum}}}ValueConverter.ToJsonValue({{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}Option.Value{{nrt!}}.Value); + writer.{{#lambda.first}}{{#allowableValues}}{{#enumVars}}{{^isNumeric}}WriteString {{/isNumeric}}{{#isNumeric}}WriteNumber {{/isNumeric}}{{/enumVars}}{{/allowableValues}}{{/lambda.first}}("{{baseName}}", {{#lambda.paste}}{{/lambda.paste}}RawValue); } else writer.WriteNull("{{baseName}}"); {{/isNullable}} {{^isNullable}} { - var {{#lambda.pasteLine}}{{/lambda.pasteLine}}RawValue = {{{datatypeWithEnum}}}ValueConverter.ToJsonValue({{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}{{nrt!}}.Value); - writer.{{#lambda.first}}{{#allowableValues}}{{#enumVars}}{{^isNumeric}}WriteString {{/isNumeric}}{{#isNumeric}}WriteNumber {{/isNumeric}}{{/enumVars}}{{/allowableValues}}{{/lambda.first}}("{{baseName}}", {{#lambda.pasteLine}}{{/lambda.pasteLine}}RawValue); + var {{#lambda.paste}}{{/lambda.paste}}RawValue = {{{datatypeWithEnum}}}ValueConverter.ToJsonValue({{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}{{nrt!}}.Value); + writer.{{#lambda.first}}{{#allowableValues}}{{#enumVars}}{{^isNumeric}}WriteString {{/isNumeric}}{{#isNumeric}}WriteNumber {{/isNumeric}}{{/enumVars}}{{/allowableValues}}{{/lambda.first}}("{{baseName}}", {{#lambda.paste}}{{/lambda.paste}}RawValue); } {{/isNullable}} {{/required}} @@ -586,9 +586,9 @@ {{/isMap}} {{/isEnum}} {{#isUuid}} - {{#lambda.copy}} + {{#lambda.copyText}} writer.WriteString("{{baseName}}", {{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}{{^required}}Option.Value{{#vendorExtensions.x-is-value-type}}{{nrt!}}.Value{{/vendorExtensions.x-is-value-type}}{{/required}}{{#required}}{{#isNullable}}.Value{{/isNullable}}{{/required}}); - {{/lambda.copy}} + {{/lambda.copyText}} {{#lambda.indent3}} {{>WriteProperty}} {{/lambda.indent3}} diff --git a/templates/libraries/generichost/OnErrorDefaultImplementation.mustache b/templates/libraries/generichost/OnErrorDefaultImplementation.mustache index 7af8e07..a1a9fa9 100644 --- a/templates/libraries/generichost/OnErrorDefaultImplementation.mustache +++ b/templates/libraries/generichost/OnErrorDefaultImplementation.mustache @@ -1,2 +1,2 @@ - if (!suppressDefaultLog) - Logger.LogError(exception, "An error occurred while sending the request to the server."); \ No newline at end of file + if (!suppressDefaultLogLocalVar) + Logger.LogError(exceptionLocalVar, "An error occurred while sending the request to the server."); \ No newline at end of file diff --git a/templates/libraries/generichost/RateLimitProvider`1.mustache b/templates/libraries/generichost/RateLimitProvider`1.mustache index 857a505..bafe525 100644 --- a/templates/libraries/generichost/RateLimitProvider`1.mustache +++ b/templates/libraries/generichost/RateLimitProvider`1.mustache @@ -7,7 +7,6 @@ using System; using System.Collections.Generic; using System.Linq; -using System.Threading.Channels; namespace {{packageName}}.{{clientPackage}} { @@ -17,7 +16,7 @@ namespace {{packageName}}.{{clientPackage}} /// {{>visibility}} class RateLimitProvider : TokenProvider where TTokenBase : TokenBase { - internal Dictionary> AvailableTokens { get; } = new{{^net70OrLater}} Dictionary>{{/net70OrLater}}(); + internal Dictionary> AvailableTokens { get; } = new{{^net70OrLater}} Dictionary>{{/net70OrLater}}(); /// /// Instantiates a ThrottledTokenProvider. Your tokens will be rate limited based on the token's timeout. @@ -29,12 +28,12 @@ namespace {{packageName}}.{{clientPackage}} token.StartTimer(token.Timeout ?? TimeSpan.FromMilliseconds(40)); {{#lambda.copy}} - BoundedChannelOptions options = new BoundedChannelOptions(_tokens.Length) + global::System.Threading.Channels.BoundedChannelOptions options = new global::System.Threading.Channels.BoundedChannelOptions(_tokens.Length) { - FullMode = BoundedChannelFullMode.DropWrite + FullMode = global::System.Threading.Channels.BoundedChannelFullMode.DropWrite }; - AvailableTokens.Add(string.Empty, Channel.CreateBounded(options)); + AvailableTokens.Add(string.Empty, global::System.Threading.Channels.Channel.CreateBounded(options)); {{/lambda.copy}} {{#hasApiKeyMethods}} if (container is TokenContainer apiKeyTokenContainer) @@ -43,31 +42,35 @@ namespace {{packageName}}.{{clientPackage}} foreach (string header in headers) { - BoundedChannelOptions options = new BoundedChannelOptions(apiKeyTokenContainer.Tokens.Count(t => ClientUtils.ApiKeyHeaderToString(t.Header).Equals(header))) + global::System.Threading.Channels.BoundedChannelOptions options = new global::System.Threading.Channels.BoundedChannelOptions(apiKeyTokenContainer.Tokens.Count(t => ClientUtils.ApiKeyHeaderToString(t.Header).Equals(header))) { - FullMode = BoundedChannelFullMode.DropWrite + FullMode = global::System.Threading.Channels.BoundedChannelFullMode.DropWrite }; - AvailableTokens.Add(header, Channel.CreateBounded(options)); + AvailableTokens.Add(header, global::System.Threading.Channels.Channel.CreateBounded(options)); } } else { - {{#lambda.indent1}}{{#lambda.pasteLine}}{{/lambda.pasteLine}}{{/lambda.indent1}} + {{#lambda.indentAll1}} + {{#lambda.paste}} + {{/lambda.paste}} + {{/lambda.indentAll1}} } {{/hasApiKeyMethods}} {{^hasApiKeyMethods}} - {{#lambda.pasteLine}}{{/lambda.pasteLine}} + {{#lambda.paste}} + {{/lambda.paste}} {{/hasApiKeyMethods}} - foreach(Channel tokens in AvailableTokens.Values) + foreach(global::System.Threading.Channels.Channel tokens in AvailableTokens.Values) for (int i = 0; i < _tokens.Length; i++) _tokens[i].TokenBecameAvailable += ((sender) => tokens.Writer.TryWrite((TTokenBase) sender)); } internal override async System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default{{^netstandard20OrLater}}(global::System.Threading.CancellationToken){{/netstandard20OrLater}}) { - if (!AvailableTokens.TryGetValue(header, out Channel{{nrt?}} tokens)) + if (!AvailableTokens.TryGetValue(header, out global::System.Threading.Channels.Channel{{nrt?}} tokens)) throw new KeyNotFoundException($"Could not locate a token for header '{header}'."); return await tokens.Reader.ReadAsync(cancellation).ConfigureAwait(false); diff --git a/templates/libraries/generichost/ValidateRegex.mustache b/templates/libraries/generichost/ValidateRegex.mustache index 78aba8f..8918b8c 100644 --- a/templates/libraries/generichost/ValidateRegex.mustache +++ b/templates/libraries/generichost/ValidateRegex.mustache @@ -1,7 +1,7 @@ // {{{name}}} ({{{dataType}}}) pattern Regex regex{{{name}}} = new Regex(@"{{{vendorExtensions.x-regex}}}"{{#vendorExtensions.x-modifiers}}{{#-first}}, {{/-first}}RegexOptions.{{{.}}}{{^-last}} | {{/-last}}{{/vendorExtensions.x-modifiers}}); {{#lambda.copy}}this.{{{name}}}{{#useGenericHost}}{{^required}}Option.Value{{/required}}{{/useGenericHost}} != null && {{/lambda.copy}} -if ({{#lambda.first}}{{^required}}{{#lambda.pasteLine}}{{/lambda.pasteLine}} {{/required}}{{#isNullable}}{{#lambda.pasteLine}}{{/lambda.pasteLine}}{{/isNullable}}{{/lambda.first}}!regex{{{name}}}.Match(this.{{{name}}}{{#useGenericHost}}{{^required}}Option.Value{{/required}}{{/useGenericHost}}{{#isUuid}}.ToString(){{#lambda.first}}{{^required}}{{nrt!}} {{/required}}{{#isNullable}}! {{/isNullable}}{{/lambda.first}}{{/isUuid}}).Success) +if ({{#lambda.first}}{{^required}}{{#lambda.paste}}{{/lambda.paste}} {{/required}}{{#isNullable}}{{#lambda.paste}}{{/lambda.paste}}{{/isNullable}}{{/lambda.first}}!regex{{{name}}}.Match(this.{{{name}}}{{#useGenericHost}}{{^required}}Option.Value{{/required}}{{/useGenericHost}}{{#isUuid}}.ToString(){{#lambda.first}}{{^required}}{{nrt!}} {{/required}}{{#isNullable}}! {{/isNullable}}{{/lambda.first}}{{/isUuid}}).Success) { yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for {{{name}}}, must match a pattern of " + regex{{{name}}}, new [] { "{{{name}}}" }); } \ No newline at end of file diff --git a/templates/libraries/generichost/WritePropertyHelper.mustache b/templates/libraries/generichost/WritePropertyHelper.mustache index 183946c..616993b 100644 --- a/templates/libraries/generichost/WritePropertyHelper.mustache +++ b/templates/libraries/generichost/WritePropertyHelper.mustache @@ -1,9 +1,10 @@ {{#isNullable}} if ({{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}{{^required}}Option.Value{{/required}} != null) - {{#lambda.pasteLine}}{{/lambda.pasteLine}} + {{#lambda.paste}}{{/lambda.paste}} else writer.WriteNull("{{baseName}}"); {{/isNullable}} {{^isNullable}} -{{#lambda.pasteLine}}{{/lambda.pasteLine}} +{{#lambda.paste}} +{{/lambda.paste}} {{/isNullable}} \ No newline at end of file diff --git a/templates/libraries/generichost/api.mustache b/templates/libraries/generichost/api.mustache index 8c02da8..b33115f 100644 --- a/templates/libraries/generichost/api.mustache +++ b/templates/libraries/generichost/api.mustache @@ -85,6 +85,7 @@ namespace {{packageName}}.{{apiPackage}} {{/operation}} } {{#operation}} + {{^vendorExtensions.x-duplicates}} {{#responses}} {{#-first}} @@ -115,6 +116,7 @@ namespace {{packageName}}.{{apiPackage}} } {{/-first}} {{/responses}} + {{/vendorExtensions.x-duplicates}} {{/operation}} /// @@ -134,7 +136,7 @@ namespace {{packageName}}.{{apiPackage}} /// public event EventHandler{{nrt?}} OnError{{operationId}}; - internal void ExecuteOn{{operationId}}({{classname}}.{{operationId}}ApiResponse apiResponse) + internal void ExecuteOn{{operationId}}({{#vendorExtensions.x-duplicates}}{{.}}{{/vendorExtensions.x-duplicates}}{{^vendorExtensions.x-duplicates}}{{classname}}{{/vendorExtensions.x-duplicates}}.{{operationId}}ApiResponse apiResponse) { On{{operationId}}?.Invoke(this, new ApiResponseEventArgs(apiResponse)); } @@ -303,30 +305,30 @@ namespace {{packageName}}.{{apiPackage}} /// /// Logs exceptions that occur while retrieving the server response /// - /// - /// - /// + /// + /// + /// {{#allParams}} /// {{/allParams}} - private void OnError{{operationId}}DefaultImplementation({{#lambda.joinWithComma}}Exception exception string pathFormat string path {{#allParams}}{{^required}}Option<{{/required}}{{{dataType}}}{{>NullConditionalParameter}}{{^required}}>{{/required}} {{paramName}} {{/allParams}}{{/lambda.joinWithComma}}) + private void OnError{{operationId}}DefaultImplementation({{#lambda.joinWithComma}}Exception exceptionLocalVar string pathFormatLocalVar string pathLocalVar {{#allParams}}{{^required}}Option<{{/required}}{{{dataType}}}{{>NullConditionalParameter}}{{^required}}>{{/required}} {{paramName}} {{/allParams}}{{/lambda.joinWithComma}}) { - bool suppressDefaultLog = false; - OnError{{operationId}}({{#lambda.joinWithComma}}ref suppressDefaultLog exception pathFormat path {{#allParams}}{{paramName}} {{/allParams}}{{/lambda.joinWithComma}}); + bool suppressDefaultLogLocalVar = false; + OnError{{operationId}}({{#lambda.joinWithComma}}ref suppressDefaultLogLocalVar exceptionLocalVar pathFormatLocalVar pathLocalVar {{#allParams}}{{paramName}} {{/allParams}}{{/lambda.joinWithComma}}); {{>OnErrorDefaultImplementation}} } /// /// A partial method that gives developers a way to provide customized exception handling /// - /// - /// - /// - /// + /// + /// + /// + /// {{#allParams}} /// {{/allParams}} - partial void OnError{{operationId}}({{#lambda.joinWithComma}}ref bool suppressDefaultLog Exception exception string pathFormat string path {{#allParams}}{{^required}}Option<{{/required}}{{{dataType}}}{{>NullConditionalParameter}}{{^required}}>{{/required}} {{paramName}} {{/allParams}}{{/lambda.joinWithComma}}); + partial void OnError{{operationId}}({{#lambda.joinWithComma}}ref bool suppressDefaultLogLocalVar Exception exceptionLocalVar string pathFormatLocalVar string pathLocalVar {{#allParams}}{{^required}}Option<{{/required}}{{{dataType}}}{{>NullConditionalParameter}}{{^required}}>{{/required}} {{paramName}} {{/allParams}}{{/lambda.joinWithComma}}); /// /// {{summary}} {{notes}} @@ -380,7 +382,7 @@ namespace {{packageName}}.{{apiPackage}} uriBuilderLocalVar.Host = HttpClient.BaseAddress{{nrt!}}.Host; uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; - uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "{{path}}"; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "{{{path}}}"; {{/servers}} {{#servers}} {{#-first}} @@ -619,9 +621,9 @@ namespace {{packageName}}.{{apiPackage}} { string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync({{#net60OrLater}}cancellationToken{{/net60OrLater}}).ConfigureAwait(false); - ILogger<{{operationId}}ApiResponse> apiResponseLoggerLocalVar = LoggerFactory.CreateLogger<{{operationId}}ApiResponse>(); + ILogger<{{#vendorExtensions.x-duplicates}}{{.}}.{{/vendorExtensions.x-duplicates}}{{operationId}}ApiResponse> apiResponseLoggerLocalVar = LoggerFactory.CreateLogger<{{#vendorExtensions.x-duplicates}}{{.}}.{{/vendorExtensions.x-duplicates}}{{operationId}}ApiResponse>(); - {{operationId}}ApiResponse apiResponseLocalVar = new{{^net60OrLater}} {{operationId}}ApiResponse{{/net60OrLater}}(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "{{path}}", requestedAtLocalVar, _jsonSerializerOptions); + {{#vendorExtensions.x-duplicates}}{{.}}.{{/vendorExtensions.x-duplicates}}{{operationId}}ApiResponse apiResponseLocalVar = new{{^net60OrLater}} {{operationId}}ApiResponse{{/net60OrLater}}(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "{{{path}}}", requestedAtLocalVar, _jsonSerializerOptions); After{{operationId}}DefaultImplementation({{#lambda.joinWithComma}}apiResponseLocalVar {{#allParams}}{{paramName}} {{/allParams}}{{/lambda.joinWithComma}}); @@ -674,12 +676,13 @@ namespace {{packageName}}.{{apiPackage}} } catch(Exception e) { - OnError{{operationId}}DefaultImplementation({{#lambda.joinWithComma}}e "{{path}}" uriBuilderLocalVar.Path {{#allParams}}{{paramName}} {{/allParams}}{{/lambda.joinWithComma}}); + OnError{{operationId}}DefaultImplementation({{#lambda.joinWithComma}}e "{{{path}}}" uriBuilderLocalVar.Path {{#allParams}}{{paramName}} {{/allParams}}{{/lambda.joinWithComma}}); Events.ExecuteOnError{{operationId}}(e); throw; } {{/lambda.trimLineBreaks}} } + {{^vendorExtensions.x-duplicates}} {{#responses}} {{#-first}} @@ -792,6 +795,7 @@ namespace {{packageName}}.{{apiPackage}} } {{/-first}} {{/responses}} + {{/vendorExtensions.x-duplicates}} {{/operation}} } {{/operations}} diff --git a/templates/libraries/generichost/modelGeneric.mustache b/templates/libraries/generichost/modelGeneric.mustache index 6bf210b..04fb371 100644 --- a/templates/libraries/generichost/modelGeneric.mustache +++ b/templates/libraries/generichost/modelGeneric.mustache @@ -34,6 +34,13 @@ {{/isNew}} {{/isInherited}} {{/isDiscriminator}} + {{#vendorExtensions.x-is-base-or-new-discriminator}} + {{^model.composedSchemas.anyOf}} + {{^model.composedSchemas.oneOf}} + {{name}} = {{^isEnum}}this.GetType().Name{{/isEnum}}{{#isEnum}}({{datatypeWithEnum}})Enum.Parse(typeof({{datatypeWithEnum}}), this.GetType().Name){{/isEnum}}; + {{/model.composedSchemas.oneOf}} + {{/model.composedSchemas.anyOf}} + {{/vendorExtensions.x-is-base-or-new-discriminator}} {{/allVars}} OnCreated(); } @@ -71,6 +78,13 @@ {{/isNew}} {{/isInherited}} {{/isDiscriminator}} + {{#vendorExtensions.x-is-base-or-new-discriminator}} + {{^model.composedSchemas.anyOf}} + {{^model.composedSchemas.oneOf}} + {{name}} = {{^isEnum}}this.GetType().Name{{/isEnum}}{{#isEnum}}({{datatypeWithEnum}})Enum.Parse(typeof({{datatypeWithEnum}}), this.GetType().Name){{/isEnum}}; + {{/model.composedSchemas.oneOf}} + {{/model.composedSchemas.anyOf}} + {{/vendorExtensions.x-is-base-or-new-discriminator}} {{/allVars}} OnCreated(); } @@ -109,7 +123,7 @@ /// {{.}} {{/description}} {{#example}} - /// {{.}} + /* {{.}} */ {{/example}} [JsonPropertyName("{{baseName}}")] {{#deprecated}} @@ -136,7 +150,7 @@ /// {{#description}} /// {{.}}{{/description}} {{#example}} - /// {{.}} + /* {{.}} */ {{/example}} {{#deprecated}} [Obsolete] @@ -152,7 +166,7 @@ /// {{#description}} /// {{.}}{{/description}} {{#example}} - /// {{.}} + /* {{.}} */ {{/example}} {{#deprecated}} [Obsolete] @@ -162,7 +176,7 @@ {{/vendorExtensions.x-duplicated-data-type}} {{/composedSchemas.oneOf}} {{#allVars}} - {{#isDiscriminator}} + {{#vendorExtensions.x-is-base-or-new-discriminator}} {{^model.composedSchemas.anyOf}} {{^model.composedSchemas.oneOf}} /// @@ -170,12 +184,12 @@ /// [JsonIgnore] [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public {{#isNew}}new {{/isNew}}{{datatypeWithEnum}} {{name}} { get; } = {{^isNew}}"{{classname}}"{{/isNew}}{{#isNew}}{{^isEnum}}"{{classname}}"{{/isEnum}}{{#isEnum}}({{datatypeWithEnum}})Enum.Parse(typeof({{datatypeWithEnum}}), "{{classname}}"){{/isEnum}}{{/isNew}}; + public {{#isNew}}new {{/isNew}}{{datatypeWithEnum}} {{name}} { get; } {{/model.composedSchemas.oneOf}} {{/model.composedSchemas.anyOf}} - {{/isDiscriminator}} - {{^isDiscriminator}} + {{/vendorExtensions.x-is-base-or-new-discriminator}} + {{^vendorExtensions.x-is-base-or-new-discriminator}} {{^isEnum}} {{#isInherited}} {{#isNew}} @@ -193,7 +207,7 @@ /// {{#description}} /// {{.}}{{/description}} {{#example}} - /// {{.}} + /* {{.}} */ {{/example}} [JsonPropertyName("{{baseName}}")] {{#deprecated}} @@ -218,7 +232,7 @@ /// {{#description}} /// {{.}}{{/description}} {{#example}} - /// {{.}} + /* {{.}} */ {{/example}} [JsonPropertyName("{{baseName}}")] {{#deprecated}} @@ -228,7 +242,7 @@ {{/isInherited}} {{/isEnum}} - {{/isDiscriminator}} + {{/vendorExtensions.x-is-base-or-new-discriminator}} {{/allVars}} {{#isAdditionalPropertiesTrue}} {{^parentModel}} @@ -345,15 +359,17 @@ {{/readOnlyVars}} {{#readOnlyVars}} {{#lambda.copy}} - if ({{name}} != null) hashCode = (hashCode * 59) + {{name}}.GetHashCode(); + {{/lambda.copy}} {{#isNullable}} - {{#lambda.pasteOnce}}{{/lambda.pasteOnce}} + {{#lambda.pasteOnce}} + {{/lambda.pasteOnce}} {{/isNullable}} {{^required}} - {{#lambda.pasteOnce}}{{/lambda.pasteOnce}} + {{#lambda.pasteOnce}} + {{/lambda.pasteOnce}} {{/required}} {{/readOnlyVars}} {{#isAdditionalPropertiesTrue}} diff --git a/templates/libraries/httpclient/ApiClient.mustache b/templates/libraries/httpclient/ApiClient.mustache index cefe6be..603284a 100644 --- a/templates/libraries/httpclient/ApiClient.mustache +++ b/templates/libraries/httpclient/ApiClient.mustache @@ -481,7 +481,7 @@ namespace {{packageName}}.Client try { - if (configuration.Timeout > 0) + if (configuration.Timeout > TimeSpan.Zero) { timeoutTokenSource = new CancellationTokenSource(configuration.Timeout); finalTokenSource = CancellationTokenSource.CreateLinkedTokenSource(finalToken, timeoutTokenSource.Token); diff --git a/templates/modelGeneric.mustache b/templates/modelGeneric.mustache index 7392b27..5075f0e 100644 --- a/templates/modelGeneric.mustache +++ b/templates/modelGeneric.mustache @@ -10,7 +10,9 @@ [DataContract(Name = "{{{name}}}")] {{^useUnityWebRequest}} {{#discriminator}} + {{#mappedModels.size}} [JsonConverter(typeof(JsonSubtypes), "{{{discriminatorName}}}")] + {{/mappedModels.size}} {{#mappedModels}} [JsonSubtypes.KnownSubType(typeof({{{modelName}}}), "{{^vendorExtensions.x-discriminator-value}}{{{mappingName}}}{{/vendorExtensions.x-discriminator-value}}{{#vendorExtensions.x-discriminator-value}}{{{.}}}{{/vendorExtensions.x-discriminator-value}}")] {{/mappedModels}} @@ -46,7 +48,14 @@ /// {{.}} {{/description}} {{#example}} +{{^useCustomTemplateCode}} + /* + {{.}} + */ +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} /// {{.}} +{{/useCustomTemplateCode}} {{/example}} {{^conditionalSerialization}} [DataMember(Name = "{{baseName}}"{{#required}}, IsRequired = true{{/required}}, EmitDefaultValue = {{#vendorExtensions.x-emit-default-value}}true{{/vendorExtensions.x-emit-default-value}}{{^vendorExtensions.x-emit-default-value}}{{#required}}true{{/required}}{{^required}}{{#isBoolean}}true{{/isBoolean}}{{^isBoolean}}{{#isNullable}}true{{/isNullable}}{{^isNullable}}false{{/isNullable}}{{/isBoolean}}{{/required}}{{/vendorExtensions.x-emit-default-value}})] @@ -290,7 +299,14 @@ /// {{#description}} /// {{.}}{{/description}} {{#example}} +{{^useCustomTemplateCode}} + /* + {{.}} + */ +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} /// {{.}} +{{/useCustomTemplateCode}} {{/example}} {{^conditionalSerialization}} [DataMember(Name = "{{baseName}}"{{#required}}, IsRequired = true{{/required}}, EmitDefaultValue = {{#vendorExtensions.x-emit-default-value}}true{{/vendorExtensions.x-emit-default-value}}{{^vendorExtensions.x-emit-default-value}}{{#required}}true{{/required}}{{^required}}{{#isBoolean}}true{{/isBoolean}}{{^isBoolean}}{{#isNullable}}true{{/isNullable}}{{^isNullable}}false{{/isNullable}}{{/isBoolean}}{{/required}}{{/vendorExtensions.x-emit-default-value}})] diff --git a/templates/netcore_project.mustache b/templates/netcore_project.mustache index 01717e6..0624344 100644 --- a/templates/netcore_project.mustache +++ b/templates/netcore_project.mustache @@ -38,21 +38,16 @@ {{/useGenericHost}} {{#useRestSharp}} -{{^useCustomTemplateCode}} - -{{/useCustomTemplateCode}} -{{#useCustomTemplateCode}} -{{/useCustomTemplateCode}} {{/useRestSharp}} {{#useGenericHost}} - - + + {{#supportsRetry}} - + {{/supportsRetry}} {{#net80OrLater}} - + {{/net80OrLater}} {{^net60OrLater}} diff --git a/templates/netcore_testproject.mustache b/templates/netcore_testproject.mustache index 90d11eb..90434b7 100644 --- a/templates/netcore_testproject.mustache +++ b/templates/netcore_testproject.mustache @@ -9,9 +9,9 @@ - - - + + + diff --git a/templates/nuspec.mustache b/templates/nuspec.mustache index b473cbd..680ee2f 100644 --- a/templates/nuspec.mustache +++ b/templates/nuspec.mustache @@ -32,12 +32,7 @@ {{#useRestSharp}} -{{^useCustomTemplateCode}} - -{{/useCustomTemplateCode}} -{{#useCustomTemplateCode}} -{{/useCustomTemplateCode}} {{/useRestSharp}} {{#useCompareNetObjects}}