diff --git a/README.md b/README.md index c5d6a46..a3079a5 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # signNow API Java SDK -## v3.2.1 +## v3.4 [![Java Version](https://img.shields.io/badge/codebase-java--11-yellowgreen)](https://www.java.com/) diff --git a/examples/DocumentGroupTemplateExample.java b/examples/DocumentGroupTemplateExample.java new file mode 100644 index 0000000..b9f92d9 --- /dev/null +++ b/examples/DocumentGroupTemplateExample.java @@ -0,0 +1,43 @@ +import com.signnow.api.documentgrouptemplate.request.DocumentGroupTemplatePostRequest; +import com.signnow.api.documentgrouptemplate.response.DocumentGroupTemplatePostResponse; +import com.signnow.core.ApiClient; +import com.signnow.core.exception.SignNowApiException; +import com.signnow.core.factory.SdkFactory; + +public class DocumentGroupTemplateExample { + public static void main(String[] args) { + + // Set your actual input data here + // Note: following values are dummy, just for example + //---------------------------------------------------- + // if it is not specified here, a new Bearer token will be created automatically + String bearerToken = ""; + String templateGroupId = "5d66ca4accdd4ab28f8b2c71001093b5cb3bcb8a"; + String groupName = "My Document Group"; + String clientTimestamp = "2024-01-15T10:30:00Z"; + String folderId = "5d66ca4accdd4ab28f8b2c71001093b5cb3bcb8b"; + + try { + ApiClient client = SdkFactory.createApiClientWithBearerToken(bearerToken); + + // Create document group from template + DocumentGroupTemplatePostRequest request = new DocumentGroupTemplatePostRequest( + groupName, + clientTimestamp, + folderId + ).withTemplateGroupId(templateGroupId); + + DocumentGroupTemplatePostResponse response = (DocumentGroupTemplatePostResponse) client.send(request).getResponse(); + + System.out.println("Document Group created successfully!"); + System.out.println("Document Group ID: " + response.getData().getUniqueId()); + System.out.println("Document Group Name: " + response.getData().getName()); + System.out.println("Document Group State: " + response.getData().getState()); + System.out.println("Owner Email: " + response.getData().getOwnerEmail()); + System.out.println("Created: " + response.getData().getCreated()); + + } catch (SignNowApiException e) { + System.out.println("ERROR: " + e.getMessage()); + } + } +} diff --git a/src/main/java/com/signnow/api/document/response/data/ShareInfo.java b/src/main/java/com/signnow/api/document/response/data/ShareInfo.java index fe59f6d..071f506 100644 --- a/src/main/java/com/signnow/api/document/response/data/ShareInfo.java +++ b/src/main/java/com/signnow/api/document/response/data/ShareInfo.java @@ -10,6 +10,7 @@ package com.signnow.api.document.response.data; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import com.signnow.core.data.ApiData; import java.util.LinkedHashMap; @@ -18,6 +19,7 @@ import org.jetbrains.annotations.NotNull; /** This class represents the share information of a document. */ +@JsonIgnoreProperties(ignoreUnknown = true) public final class ShareInfo extends ApiData { /** A boolean value indicating whether the document is shared with the team. */ diff --git a/src/main/java/com/signnow/api/document/response/data/fieldinvite/Cfr.java b/src/main/java/com/signnow/api/document/response/data/fieldinvite/Cfr.java new file mode 100644 index 0000000..19b7750 --- /dev/null +++ b/src/main/java/com/signnow/api/document/response/data/fieldinvite/Cfr.java @@ -0,0 +1,231 @@ +/* + * This file is a part of signNow SDK API client. + * + * (с) Copyright © 2011-present airSlate Inc. (https://www.signnow.com) + * + * For more details on copyright, see LICENSE.md file + * that was distributed with this source code. + */ + +package com.signnow.api.document.response.data.fieldinvite; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.signnow.core.data.ApiData; +import org.jetbrains.annotations.Contract; +import org.jetbrains.annotations.NotNull; + +import java.util.LinkedHashMap; +import java.util.Map; + +/** + * Represents the CFR data for field invites. + */ +@JsonIgnoreProperties(ignoreUnknown = true) +public final class Cfr extends ApiData { + + @JsonProperty("cfr_title_21_part_11") + private final int cfrTitle21Part11; + + @JsonProperty("front_end_session_length") + private final String frontEndSessionLength; + + @JsonProperty("require_authentication_for_invites") + private final String requireAuthenticationForInvites; + + @JsonProperty("auto_apply_signatures_and_initials_to_document_fields") + private final String autoApplySignaturesAndInitialsToDocumentFields; + + @JsonProperty("every_signature_and_initials_field_requires_user_authentication") + private final String everySignatureAndInitialsFieldRequiresUserAuthentication; + + @JsonProperty("emailed_docs_include_history") + private final String emailedDocsIncludeHistory; + + @JsonProperty("cloud_export_with_history") + private final String cloudExportWithHistory; + + @JsonProperty("require_login_for_signing") + private final String requireLoginForSigning; + + @JsonProperty("logout_on_signing") + private final String logoutOnSigning; + + @JsonProperty("add_signature_stamp_with_name") + private final String addSignatureStampWithName; + + /** + * Constructs a new Cfr instance. + * + * @param cfrTitle21Part11 The CFR Title 21 Part 11 value. + * @param frontEndSessionLength The front-end session length. + * @param requireAuthenticationForInvites Whether authentication is required for invites. + * @param autoApplySignaturesAndInitialsToDocumentFields Whether to auto-apply signatures and initials to document fields. + * @param everySignatureAndInitialsFieldRequiresUserAuthentication Whether every signature and initials field requires user authentication. + * @param emailedDocsIncludeHistory Whether emailed documents include history. + * @param cloudExportWithHistory Whether cloud export includes history. + * @param requireLoginForSigning Whether login is required for signing. + * @param logoutOnSigning Whether to logout on signing. + * @param addSignatureStampWithName Whether to add a signature stamp with name. + */ + @JsonCreator + public Cfr( + @JsonProperty("cfr_title_21_part_11") int cfrTitle21Part11, + @JsonProperty("front_end_session_length") String frontEndSessionLength, + @JsonProperty("require_authentication_for_invites") String requireAuthenticationForInvites, + @JsonProperty("auto_apply_signatures_and_initials_to_document_fields") String autoApplySignaturesAndInitialsToDocumentFields, + @JsonProperty("every_signature_and_initials_field_requires_user_authentication") String everySignatureAndInitialsFieldRequiresUserAuthentication, + @JsonProperty("emailed_docs_include_history") String emailedDocsIncludeHistory, + @JsonProperty("cloud_export_with_history") String cloudExportWithHistory, + @JsonProperty("require_login_for_signing") String requireLoginForSigning, + @JsonProperty("logout_on_signing") String logoutOnSigning, + @JsonProperty("add_signature_stamp_with_name") String addSignatureStampWithName + ) { + this.cfrTitle21Part11 = cfrTitle21Part11; + this.frontEndSessionLength = frontEndSessionLength; + this.requireAuthenticationForInvites = requireAuthenticationForInvites; + this.autoApplySignaturesAndInitialsToDocumentFields = autoApplySignaturesAndInitialsToDocumentFields; + this.everySignatureAndInitialsFieldRequiresUserAuthentication = everySignatureAndInitialsFieldRequiresUserAuthentication; + this.emailedDocsIncludeHistory = emailedDocsIncludeHistory; + this.cloudExportWithHistory = cloudExportWithHistory; + this.requireLoginForSigning = requireLoginForSigning; + this.logoutOnSigning = logoutOnSigning; + this.addSignatureStampWithName = addSignatureStampWithName; + } + + /** + * Gets the CFR Title 21 Part 11 value. + * + * @return The CFR Title 21 Part 11 value. + */ + public int getCfrTitle21Part11() { + return this.cfrTitle21Part11; + } + + /** + * Gets the front-end session length. + * + * @return The front-end session length. + */ + public String getFrontEndSessionLength() { + return this.frontEndSessionLength; + } + + /** + * Gets whether authentication is required for invites. + * + * @return Whether authentication is required for invites. + */ + public String getRequireAuthenticationForInvites() { + return this.requireAuthenticationForInvites; + } + + /** + * Gets whether to auto-apply signatures and initials to document fields. + * + * @return Whether to auto-apply signatures and initials to document fields. + */ + public String getAutoApplySignaturesAndInitialsToDocumentFields() { + return this.autoApplySignaturesAndInitialsToDocumentFields; + } + + /** + * Gets whether every signature and initials field requires user authentication. + * + * @return Whether every signature and initials field requires user authentication. + */ + public String getEverySignatureAndInitialsFieldRequiresUserAuthentication() { + return this.everySignatureAndInitialsFieldRequiresUserAuthentication; + } + + /** + * Gets whether emailed documents include history. + * + * @return Whether emailed documents include history. + */ + public String getEmailedDocsIncludeHistory() { + return this.emailedDocsIncludeHistory; + } + + /** + * Gets whether cloud export includes history. + * + * @return Whether cloud export includes history. + */ + public String getCloudExportWithHistory() { + return this.cloudExportWithHistory; + } + + /** + * Gets whether login is required for signing. + * + * @return Whether login is required for signing. + */ + public String getRequireLoginForSigning() { + return this.requireLoginForSigning; + } + + /** + * Gets whether to logout on signing. + * + * @return Whether to logout on signing. + */ + public String getLogoutOnSigning() { + return this.logoutOnSigning; + } + + /** + * Gets whether to add a signature stamp with name. + * + * @return Whether to add a signature stamp with name. + */ + public String getAddSignatureStampWithName() { + return this.addSignatureStampWithName; + } + + /** + * Converts the Cfr object to a map. + * + * @return A map representation of the Cfr object. + */ + @NotNull + @Override + public Map toMap() { + Map map = new LinkedHashMap<>(); + map.put("cfr_title_21_part_11", this.getCfrTitle21Part11()); + map.put("front_end_session_length", this.getFrontEndSessionLength()); + map.put("require_authentication_for_invites", this.getRequireAuthenticationForInvites()); + map.put("auto_apply_signatures_and_initials_to_document_fields", this.getAutoApplySignaturesAndInitialsToDocumentFields()); + map.put("every_signature_and_initials_field_requires_user_authentication", this.getEverySignatureAndInitialsFieldRequiresUserAuthentication()); + map.put("emailed_docs_include_history", this.getEmailedDocsIncludeHistory()); + map.put("cloud_export_with_history", this.getCloudExportWithHistory()); + map.put("require_login_for_signing", this.getRequireLoginForSigning()); + map.put("logout_on_signing", this.getLogoutOnSigning()); + map.put("add_signature_stamp_with_name", this.getAddSignatureStampWithName()); + return map; + } + + /** + * Creates a Cfr object from a map. + * + * @param data The map containing the data. + * @return A new Cfr object. + */ + @NotNull + @Contract("_ -> new") + public static Cfr fromMap(@NotNull Map data) { + return new Cfr( + (int) data.getOrDefault("cfr_title_21_part_11", 0), + (String) data.getOrDefault("front_end_session_length", null), + (String) data.getOrDefault("require_authentication_for_invites", null), + (String) data.getOrDefault("auto_apply_signatures_and_initials_to_document_fields", null), + (String) data.getOrDefault("every_signature_and_initials_field_requires_user_authentication", null), + (String) data.getOrDefault("emailed_docs_include_history", null), + (String) data.getOrDefault("cloud_export_with_history", null), + (String) data.getOrDefault("require_login_for_signing", null), + (String) data.getOrDefault("logout_on_signing", null), + (String) data.getOrDefault("add_signature_stamp_with_name", null) + ); + } +} diff --git a/src/main/java/com/signnow/api/document/response/data/fieldinvite/Compliance.java b/src/main/java/com/signnow/api/document/response/data/fieldinvite/Compliance.java new file mode 100644 index 0000000..6dd8cb6 --- /dev/null +++ b/src/main/java/com/signnow/api/document/response/data/fieldinvite/Compliance.java @@ -0,0 +1,70 @@ +/* + * This file is a part of signNow SDK API client. + * + * (с) Copyright © 2011-present airSlate Inc. (https://www.signnow.com) + * + * For more details on copyright, see LICENSE.md file + * that was distributed with this source code. + */ + +package com.signnow.api.document.response.data.fieldinvite; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import org.jetbrains.annotations.Contract; +import org.jetbrains.annotations.NotNull; + +import java.util.LinkedHashMap; +import java.util.Map; + +@JsonIgnoreProperties(ignoreUnknown = true) +public final class Compliance { + + private final Cfr cfr; + + /** + * Constructs a new Compliance instance. + * + * @param cfr the Cfr object, can be null. + */ + @JsonCreator + public Compliance(@JsonProperty("cfr") Cfr cfr) { + this.cfr = cfr; + } + + /** + * Gets the Cfr object. + * + * @return the Cfr object, can be null. + */ + public Cfr getCfr() { + return this.cfr; + } + + /** + * Converts the Compliance object to a Map. + * + * @return a Map representation of the Compliance object. + */ + @NotNull + public Map toMap() { + Map map = new LinkedHashMap<>(); + map.put("cfr", this.cfr != null ? this.cfr.toMap() : null); + return map; + } + + /** + * Creates a Compliance object from a Map. + * + * @param data the Map containing the data. + * @return a new Compliance object. + */ + @NotNull + @Contract("_ -> new") + public static Compliance fromMap(@NotNull Map data) { + return new Compliance( + data.containsKey("cfr") ? Cfr.fromMap((Map) data.get("cfr")) : null + ); + } +} diff --git a/src/main/java/com/signnow/api/document/response/data/fieldinvite/FieldInvite.java b/src/main/java/com/signnow/api/document/response/data/fieldinvite/FieldInvite.java index 7c47dbd..bf5bdce 100644 --- a/src/main/java/com/signnow/api/document/response/data/fieldinvite/FieldInvite.java +++ b/src/main/java/com/signnow/api/document/response/data/fieldinvite/FieldInvite.java @@ -162,6 +162,15 @@ public final class FieldInvite extends ApiData { @JsonProperty("language") private final String language; + @JsonProperty("is_finish_redirect_canceled") + private final Boolean isFinishRedirectCanceled; + + @JsonProperty("is_close_redirect_canceled") + private final Boolean isCloseRedirectCanceled; + + @JsonProperty("is_decline_redirect_canceled") + private final Boolean isDeclineRedirectCanceled; + /** * The phone invite of the signer associated with the FieldInvite. */ @@ -342,6 +351,9 @@ public final class FieldInvite extends ApiData { @JsonProperty("signature_type") private final String signatureType; + @JsonProperty("compliance") + private final Compliance compliance; + /** * Constructs a new FieldInvite with the provided parameters. * @@ -424,6 +436,9 @@ public FieldInvite( @JsonProperty("id_verified") String idVerified, @JsonProperty("embedded_signer") EmbeddedSignerCollection embeddedSigner, @JsonProperty("language") String language, + @JsonProperty("is_finish_redirect_canceled") Boolean isFinishRedirectCanceled, + @JsonProperty("is_close_redirect_canceled") Boolean isCloseRedirectCanceled, + @JsonProperty("is_decline_redirect_canceled") Boolean isDeclineRedirectCanceled, @JsonProperty("signer_phone_invite") String signerPhoneInvite, @JsonProperty("password_type") String passwordType, @JsonProperty("password_method") String passwordMethod, @@ -453,7 +468,8 @@ public FieldInvite( @JsonProperty("prefill_signature_name") String prefillSignatureName, @JsonProperty("force_new_signature") int forceNewSignature, @JsonProperty("signing_instructions") String signingInstructions, - @JsonProperty("signature_type") String signatureType) { + @JsonProperty("signature_type") String signatureType, + @JsonProperty("compliance") Compliance compliance) { this.id = id; this.signerUserId = signerUserId; this.status = status; @@ -477,6 +493,9 @@ public FieldInvite( this.idVerified = idVerified; this.embeddedSigner = embeddedSigner; this.language = language; + this.isFinishRedirectCanceled = isFinishRedirectCanceled; + this.isCloseRedirectCanceled = isCloseRedirectCanceled; + this.isDeclineRedirectCanceled = isDeclineRedirectCanceled; this.signerPhoneInvite = signerPhoneInvite; this.passwordType = passwordType; this.passwordMethod = passwordMethod; @@ -507,6 +526,7 @@ public FieldInvite( this.forceNewSignature = forceNewSignature; this.signingInstructions = signingInstructions; this.signatureType = signatureType; + this.compliance = compliance; } public String getId() { @@ -717,10 +737,26 @@ public String getSignatureType() { return this.signatureType; } + public Compliance getCompliance() { + return this.compliance; + } + public String getLanguage() { return this.language; } + public Boolean isFinishRedirectCanceled() { + return this.isFinishRedirectCanceled; + } + + public Boolean isCloseRedirectCanceled() { + return this.isCloseRedirectCanceled; + } + + public Boolean isDeclineRedirectCanceled() { + return this.isDeclineRedirectCanceled; + } + @NotNull @Override public Map toMap() { @@ -777,7 +813,11 @@ public Map toMap() { map.put("force_new_signature", this.getForceNewSignature()); map.put("signing_instructions", this.getSigningInstructions()); map.put("signature_type", this.getSignatureType()); + map.put("compliance", this.getCompliance() != null ? this.getCompliance().toMap() : null); map.put("language", this.getLanguage()); + map.put("is_finish_redirect_canceled", this.isFinishRedirectCanceled()); + map.put("is_close_redirect_canceled", this.isCloseRedirectCanceled()); + map.put("is_decline_redirect_canceled", this.isDeclineRedirectCanceled()); return map; } @@ -808,6 +848,9 @@ public static FieldInvite fromMap(@NotNull Map data) { (String) data.get("id_verified"), (EmbeddedSignerCollection) data.get("embedded_signer"), (String) data.get("language"), + (Boolean) data.get("is_finish_redirect_canceled"), + (Boolean) data.get("is_close_redirect_canceled"), + (Boolean) data.get("is_decline_redirect_canceled"), (String) data.get("signer_phone_invite"), (String) data.get("password_type"), (String) data.get("password_method"), @@ -837,6 +880,7 @@ public static FieldInvite fromMap(@NotNull Map data) { (String) data.get("prefill_signature_name"), (Integer) data.get("force_new_signature"), (String) data.get("signing_instructions"), - (String) data.get("signature_type")); + (String) data.get("signature_type"), + data.get("compliance") != null ? Compliance.fromMap((Map) data.get("compliance")) : null); } } \ No newline at end of file diff --git a/src/main/java/com/signnow/api/document/response/data/viewerfieldinvite/ViewerFieldInvite.java b/src/main/java/com/signnow/api/document/response/data/viewerfieldinvite/ViewerFieldInvite.java index c4c02a1..92264b0 100644 --- a/src/main/java/com/signnow/api/document/response/data/viewerfieldinvite/ViewerFieldInvite.java +++ b/src/main/java/com/signnow/api/document/response/data/viewerfieldinvite/ViewerFieldInvite.java @@ -10,6 +10,7 @@ package com.signnow.api.document.response.data.viewerfieldinvite; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import com.signnow.core.data.ApiData; import com.signnow.core.util.Cast; @@ -21,6 +22,7 @@ /** * This class represents a ViewerFieldInvite object. */ +@JsonIgnoreProperties(ignoreUnknown = true) public final class ViewerFieldInvite extends ApiData { /** @@ -53,6 +55,12 @@ public final class ViewerFieldInvite extends ApiData { @JsonProperty("email") private final String email; + /** + * The is_close_redirect_canceled associated with the ViewerFieldInvite. + */ + @JsonProperty("is_close_redirect_canceled") + private final Boolean isCloseRedirectCanceled; + /** * The redirect target of the ViewerFieldInvite. */ @@ -103,6 +111,7 @@ public final class ViewerFieldInvite extends ApiData { * @param created The creation date of the ViewerFieldInvite. * @param updated The last updated date of the ViewerFieldInvite. * @param email The email associated with the ViewerFieldInvite. + * @param isCloseRedirectCanceled whether the close redirect is canceled * @param redirectTarget The redirect target of the ViewerFieldInvite. * @param emailGroup The email group of the ViewerFieldInvite. * @param emailStatuses The email statuses of the ViewerFieldInvite. @@ -118,6 +127,7 @@ public ViewerFieldInvite( @JsonProperty("created") String created, @JsonProperty("updated") String updated, @JsonProperty("email") String email, + @JsonProperty("is_close_redirect_canceled") Boolean isCloseRedirectCanceled, @JsonProperty("redirect_target") String redirectTarget, @JsonProperty("email_group") EmailGroup emailGroup, @JsonProperty("email_statuses") EmailStatusCollection emailStatuses, @@ -130,6 +140,7 @@ public ViewerFieldInvite( this.created = created; this.updated = updated; this.email = email; + this.isCloseRedirectCanceled = isCloseRedirectCanceled; this.redirectTarget = redirectTarget; this.emailGroup = emailGroup; this.emailStatuses = emailStatuses; @@ -211,6 +222,15 @@ public String getRoleId() { return this.roleId; } + /** + * Checks if the close redirect is canceled. + * + * @return true if canceled, otherwise false + */ + public Boolean isCloseRedirectCanceled() { + return this.isCloseRedirectCanceled; + } + /** * Returns the close redirect URI of the ViewerFieldInvite. * @@ -264,6 +284,7 @@ public Map toMap() { map.put("role", this.getRole()); map.put("email", this.getEmail()); map.put("role_id", this.getRoleId()); + map.put("is_close_redirect_canceled", this.isCloseRedirectCanceled()); map.put("close_redirect_uri", this.getCloseRedirectUri()); map.put("redirect_target", this.getRedirectTarget()); map.put("email_group", this.getEmailGroup()); @@ -286,6 +307,7 @@ public static ViewerFieldInvite fromMap(@NotNull Map data) { (String) data.get("created"), (String) data.get("updated"), (String) data.get("email"), + (Boolean) data.get("is_close_redirect_canceled"), (String) data.get("redirect_target"), EmailGroup.fromMap(Cast.safeToMap(data.get("email_group"), String.class, Object.class)), (EmailStatusCollection) data.get("email_statuses"), diff --git a/src/main/java/com/signnow/api/documentgrouptemplate/request/DocumentGroupTemplatePostRequest.java b/src/main/java/com/signnow/api/documentgrouptemplate/request/DocumentGroupTemplatePostRequest.java new file mode 100644 index 0000000..481e8ce --- /dev/null +++ b/src/main/java/com/signnow/api/documentgrouptemplate/request/DocumentGroupTemplatePostRequest.java @@ -0,0 +1,130 @@ +/* + * This file is a part of signNow SDK API client. + * + * (с) Copyright © 2011-present airSlate Inc. (https://www.signnow.com) + * + * For more details on copyright, see LICENSE.md file + * that was distributed with this source code. + */ + +package com.signnow.api.documentgrouptemplate.request; + +import com.signnow.core.request.ApiEndpoint; +import com.signnow.core.request.RequestInterface; +import java.util.HashMap; +import java.util.Map; +import org.jetbrains.annotations.Contract; +import org.jetbrains.annotations.NotNull; + +/** + * This class represents a request to create a document group from a template. + * It implements the RequestInterface with an Object type. + */ +@ApiEndpoint( + name = "createDocumentGroupFromTemplate", + url = "/v2/document-group-templates/{template_group_id}/document-group", + method = "post", + auth = "bearer", + namespace = "documentGroupTemplate", + entity = "documentGroupTemplate", + type = "application/json") +public final class DocumentGroupTemplatePostRequest implements RequestInterface { + + /** + * The name of the group. + */ + private final String groupName; + + /** + * The client timestamp. + */ + private final String clientTimestamp; + + /** + * The folder ID. + */ + private final String folderId; + + /** + * URI parameters for the request. + */ + private final HashMap uriParams = new HashMap<>(); + + /** + * Constructs a new DocumentGroupTemplatePostRequest with the specified group name, + * client timestamp, and folder ID. + * + * @param groupName the name of the group + * @param clientTimestamp the client timestamp + * @param folderId the folder ID + */ + public DocumentGroupTemplatePostRequest(String groupName, String clientTimestamp, String folderId) { + this.groupName = groupName; + this.clientTimestamp = clientTimestamp; + this.folderId = folderId; + } + + /** + * Returns the name of the group. + * + * @return the name of the group + */ + public String getGroupName() { + return this.groupName; + } + + /** + * Returns the client timestamp. + * + * @return the client timestamp + */ + public String getClientTimestamp() { + return this.clientTimestamp; + } + + /** + * Returns the folder ID. + * + * @return the folder ID + */ + public String getFolderId() { + return this.folderId; + } + + /** + * Sets the template group ID in the URI parameters. + * + * @param templateGroupId the template group ID + * @return the current instance of DocumentGroupTemplatePostRequest + */ + public DocumentGroupTemplatePostRequest withTemplateGroupId(String templateGroupId) { + this.uriParams.put("template_group_id", templateGroupId); + return this; + } + + /** + * Returns the URI parameters for the request. + * + * @return a HashMap containing the URI parameters as key-value pairs + */ + @NotNull + @Contract(value = " -> new", pure = true) + @Override + public HashMap uriParams() { + return new HashMap<>(this.uriParams); + } + + /** + * Returns a Map with the payload of the request. + * + * @return a Map with the payload of the request + */ + @NotNull + public Map payload() { + Map map = new HashMap<>(); + map.put("group_name", this.getGroupName()); + map.put("client_timestamp", this.getClientTimestamp()); + map.put("folder_id", this.getFolderId()); + return map; + } +} diff --git a/src/main/java/com/signnow/api/documentgrouptemplate/response/DocumentGroupTemplatePostResponse.java b/src/main/java/com/signnow/api/documentgrouptemplate/response/DocumentGroupTemplatePostResponse.java new file mode 100644 index 0000000..aaa0671 --- /dev/null +++ b/src/main/java/com/signnow/api/documentgrouptemplate/response/DocumentGroupTemplatePostResponse.java @@ -0,0 +1,46 @@ +/* + * This file is a part of signNow SDK API client. + * + * (с) Copyright © 2011-present airSlate Inc. (https://www.signnow.com) + * + * For more details on copyright, see LICENSE.md file + * that was distributed with this source code. + */ + +package com.signnow.api.documentgrouptemplate.response; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.signnow.api.documentgrouptemplate.response.data.data.Data; + +/** + * This class represents the response received after a document group template post request. + * It ignores unknown properties in the JSON response. + */ +@JsonIgnoreProperties(ignoreUnknown = true) +public class DocumentGroupTemplatePostResponse { + + /** + * The data associated with the document group template post response. + */ + @JsonProperty("data") + private final Data data; + + /** + * Constructs a new DocumentGroupTemplatePostResponse with the specified data. + * + * @param data the data associated with the document group template post response. + */ + public DocumentGroupTemplatePostResponse(Data data) { + this.data = data; + } + + /** + * Returns the data associated with the document group template post response. + * + * @return the data associated with the document group template post response. + */ + public Data getData() { + return this.data; + } +} diff --git a/src/main/java/com/signnow/api/documentgrouptemplate/response/data/data/Data.java b/src/main/java/com/signnow/api/documentgrouptemplate/response/data/data/Data.java new file mode 100644 index 0000000..a0f5d1c --- /dev/null +++ b/src/main/java/com/signnow/api/documentgrouptemplate/response/data/data/Data.java @@ -0,0 +1,142 @@ +/* + * This file is a part of signNow SDK API client. + * + * (с) Copyright © 2011-present airSlate Inc. (https://www.signnow.com) + * + * For more details on copyright, see LICENSE.md file + * that was distributed with this source code. + */ + +package com.signnow.api.documentgrouptemplate.response.data.data; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.signnow.core.data.ApiData; +import org.jetbrains.annotations.Contract; +import org.jetbrains.annotations.NotNull; + +import java.util.LinkedHashMap; +import java.util.Map; + +@JsonIgnoreProperties(ignoreUnknown = true) +public final class Data extends ApiData { + + @JsonProperty("unique_id") + private final String uniqueId; + + @JsonProperty("name") + private final String name; + + @JsonProperty("created") + private final int created; + + @JsonProperty("state") + private final String state; + + @JsonProperty("owner_email") + private final String ownerEmail; + + @JsonProperty("documents") + private final DocumentCollection documents; + + @JsonProperty("owner") + private final Owner owner; + + @JsonProperty("invite_id") + private final String inviteId; + + @JsonProperty("last_invite_id") + private final String lastInviteId; + + @JsonCreator + public Data( + @JsonProperty("unique_id") String uniqueId, + @JsonProperty("name") String name, + @JsonProperty("created") int created, + @JsonProperty("state") String state, + @JsonProperty("owner_email") String ownerEmail, + @JsonProperty("documents") DocumentCollection documents, + @JsonProperty("owner") Owner owner, + @JsonProperty("invite_id") String inviteId, + @JsonProperty("last_invite_id") String lastInviteId + ) { + this.uniqueId = uniqueId; + this.name = name; + this.created = created; + this.state = state; + this.ownerEmail = ownerEmail; + this.documents = documents; + this.owner = owner; + this.inviteId = inviteId; + this.lastInviteId = lastInviteId; + } + + public String getUniqueId() { + return this.uniqueId; + } + + public String getName() { + return this.name; + } + + public int getCreated() { + return this.created; + } + + public String getInviteId() { + return this.inviteId; + } + + public String getState() { + return this.state; + } + + public String getLastInviteId() { + return this.lastInviteId; + } + + public String getOwnerEmail() { + return this.ownerEmail; + } + + public DocumentCollection getDocuments() { + return this.documents; + } + + public Owner getOwner() { + return this.owner; + } + + @NotNull + @Override + public Map toMap() { + Map map = new LinkedHashMap<>(); + map.put("unique_id", this.getUniqueId()); + map.put("name", this.getName()); + map.put("created", this.getCreated()); + map.put("invite_id", this.getInviteId()); + map.put("state", this.getState()); + map.put("last_invite_id", this.getLastInviteId()); + map.put("owner_email", this.getOwnerEmail()); + map.put("documents", this.getDocuments()); + map.put("owner", this.getOwner()); + return map; + } + + @NotNull + @Contract("_ -> new") + public static Data fromMap(@NotNull Map data) { + return new Data( + (String) data.get("unique_id"), + (String) data.get("name"), + (int) data.get("created"), + (String) data.get("state"), + (String) data.get("owner_email"), + (DocumentCollection) data.get("documents"), + Owner.fromMap((Map) data.get("owner")), + (String) data.getOrDefault("invite_id", null), + (String) data.getOrDefault("last_invite_id", null) + ); + } +} diff --git a/src/main/java/com/signnow/api/documentgrouptemplate/response/data/data/Document.java b/src/main/java/com/signnow/api/documentgrouptemplate/response/data/data/Document.java new file mode 100644 index 0000000..9f8d229 --- /dev/null +++ b/src/main/java/com/signnow/api/documentgrouptemplate/response/data/data/Document.java @@ -0,0 +1,182 @@ +/* + * This file is a part of signNow SDK API client. + * + * (с) Copyright © 2011-present airSlate Inc. (https://www.signnow.com) + * + * For more details on copyright, see LICENSE.md file + * that was distributed with this source code. + */ + +package com.signnow.api.documentgrouptemplate.response.data.data; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.signnow.core.data.ApiData; +import com.signnow.core.util.Cast; +import org.jetbrains.annotations.Contract; +import org.jetbrains.annotations.NotNull; + +import java.util.LinkedHashMap; +import java.util.Map; + +/** + * Represents a Document with associated roles, name, ID, thumbnail, origin document ID, + * and flags for unassigned fields and credit card numbers. + */ +@JsonIgnoreProperties(ignoreUnknown = true) +public final class Document extends ApiData { + + @JsonProperty("roles") + private final RoleCollection roles; + + @JsonProperty("document_name") + private final String documentName; + + @JsonProperty("id") + private final String id; + + @JsonProperty("thumbnail") + private final Thumbnail thumbnail; + + @JsonProperty("origin_document_id") + private final String originDocumentId; + + @JsonProperty("has_unassigned_field") + private final boolean hasUnassignedField; + + @JsonProperty("has_credit_card_number") + private final boolean hasCreditCardNumber; + + /** + * Constructs a new Document instance. + * + * @param roles the roles associated with the document + * @param documentName the name of the document + * @param id the unique identifier of the document + * @param thumbnail the thumbnail of the document + * @param originDocumentId the origin document ID + * @param hasUnassignedField flag indicating if there are unassigned fields + * @param hasCreditCardNumber flag indicating if there is a credit card number + */ + @JsonCreator + public Document( + @JsonProperty("roles") RoleCollection roles, + @JsonProperty("document_name") String documentName, + @JsonProperty("id") String id, + @JsonProperty("thumbnail") Thumbnail thumbnail, + @JsonProperty("origin_document_id") String originDocumentId, + @JsonProperty("has_unassigned_field") boolean hasUnassignedField, + @JsonProperty("has_credit_card_number") boolean hasCreditCardNumber + ) { + this.roles = roles; + this.documentName = documentName; + this.id = id; + this.thumbnail = thumbnail; + this.originDocumentId = originDocumentId; + this.hasUnassignedField = hasUnassignedField; + this.hasCreditCardNumber = hasCreditCardNumber; + } + + /** + * Gets the roles associated with the document. + * + * @return the roles + */ + public RoleCollection getRoles() { + return this.roles; + } + + /** + * Gets the name of the document. + * + * @return the document name + */ + public String getDocumentName() { + return this.documentName; + } + + /** + * Gets the unique identifier of the document. + * + * @return the document ID + */ + public String getId() { + return this.id; + } + + /** + * Gets the thumbnail of the document. + * + * @return the thumbnail + */ + public Thumbnail getThumbnail() { + return this.thumbnail; + } + + /** + * Gets the origin document ID. + * + * @return the origin document ID + */ + public String getOriginDocumentId() { + return this.originDocumentId; + } + + /** + * Checks if there are unassigned fields in the document. + * + * @return true if there are unassigned fields, false otherwise + */ + public boolean hasUnassignedField() { + return this.hasUnassignedField; + } + + /** + * Checks if there is a credit card number in the document. + * + * @return true if there is a credit card number, false otherwise + */ + public boolean hasCreditCardNumber() { + return this.hasCreditCardNumber; + } + + /** + * Converts the Document object to a map representation. + * + * @return a map containing the document data + */ + @NotNull + @Override + public Map toMap() { + Map map = new LinkedHashMap<>(); + map.put("roles", this.getRoles()); + map.put("document_name", this.getDocumentName()); + map.put("id", this.getId()); + map.put("thumbnail", this.getThumbnail()); + map.put("origin_document_id", this.getOriginDocumentId()); + map.put("has_unassigned_field", this.hasUnassignedField()); + map.put("has_credit_card_number", this.hasCreditCardNumber()); + return map; + } + + /** + * Creates a Document instance from a map representation. + * + * @param data the map containing the document data + * @return a new Document instance + */ + @NotNull + @Contract("_ -> new") + public static Document fromMap(@NotNull Map data) { + return new Document( + (RoleCollection) data.get("roles"), + (String) data.get("document_name"), + (String) data.get("id"), + Thumbnail.fromMap(Cast.safeToMap(data.get("thumbnail"), String.class, Object.class)), + (String) data.get("origin_document_id"), + (Boolean) data.get("has_unassigned_field"), + (Boolean) data.get("has_credit_card_number") + ); + } +} diff --git a/src/main/java/com/signnow/api/documentgrouptemplate/response/data/data/DocumentCollection.java b/src/main/java/com/signnow/api/documentgrouptemplate/response/data/data/DocumentCollection.java new file mode 100644 index 0000000..8c4f66e --- /dev/null +++ b/src/main/java/com/signnow/api/documentgrouptemplate/response/data/data/DocumentCollection.java @@ -0,0 +1,22 @@ +/* + * This file is a part of signNow SDK API client. + * + * (с) Copyright © 2011-present airSlate Inc. (https://www.signnow.com) + * + * For more details on copyright, see LICENSE.md file + * that was distributed with this source code. + */ + +package com.signnow.api.documentgrouptemplate.response.data.data; + +import com.signnow.core.collection.TypedCollection; + +/** + * Represents a collection of Document objects. + * + *

This class extends the TypedCollection class with Document as the generic type. + * It is designed to hold and manage a collection of Document instances. + * + * @see com.signnow.core.collection.TypedCollection + */ +public class DocumentCollection extends TypedCollection {} diff --git a/src/main/java/com/signnow/api/documentgrouptemplate/response/data/data/Organization.java b/src/main/java/com/signnow/api/documentgrouptemplate/response/data/data/Organization.java new file mode 100644 index 0000000..d75f2ed --- /dev/null +++ b/src/main/java/com/signnow/api/documentgrouptemplate/response/data/data/Organization.java @@ -0,0 +1,74 @@ +/* + * This file is a part of signNow SDK API client. + * + * (с) Copyright © 2011-present airSlate Inc. (https://www.signnow.com) + * + * For more details on copyright, see LICENSE.md file + * that was distributed with this source code. + */ + +package com.signnow.api.documentgrouptemplate.response.data.data; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.signnow.core.data.ApiData; +import org.jetbrains.annotations.Contract; +import org.jetbrains.annotations.NotNull; + +import java.util.LinkedHashMap; +import java.util.Map; + +/** + * Represents an organization with an optional ID. + */ +@JsonIgnoreProperties(ignoreUnknown = true) +public final class Organization extends ApiData { + + @JsonProperty("id") + private final String id; + + /** + * Constructs an Organization instance. + * + * @param id the ID of the organization, can be null. + */ + @JsonCreator + public Organization(@JsonProperty("id") String id) { + this.id = id; + } + + /** + * Gets the ID of the organization. + * + * @return the ID of the organization, can be null. + */ + public String getId() { + return this.id; + } + + /** + * Converts the organization data to a map. + * + * @return a map representation of the organization data. + */ + @NotNull + @Override + public Map toMap() { + Map map = new LinkedHashMap<>(); + map.put("id", this.getId()); + return map; + } + + /** + * Creates an Organization instance from a map. + * + * @param data the map containing organization data. + * @return a new Organization instance. + */ + @NotNull + @Contract("_ -> new") + public static Organization fromMap(@NotNull Map data) { + return new Organization((String) data.get("id")); + } +} diff --git a/src/main/java/com/signnow/api/documentgrouptemplate/response/data/data/Owner.java b/src/main/java/com/signnow/api/documentgrouptemplate/response/data/data/Owner.java new file mode 100644 index 0000000..1d1ade1 --- /dev/null +++ b/src/main/java/com/signnow/api/documentgrouptemplate/response/data/data/Owner.java @@ -0,0 +1,110 @@ +/* + * This file is a part of signNow SDK API client. + * + * (с) Copyright © 2011-present airSlate Inc. (https://www.signnow.com) + * + * For more details on copyright, see LICENSE.md file + * that was distributed with this source code. + */ + +package com.signnow.api.documentgrouptemplate.response.data.data; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.signnow.core.data.ApiData; +import com.signnow.core.util.Cast; +import org.jetbrains.annotations.Contract; +import org.jetbrains.annotations.NotNull; + +import java.util.LinkedHashMap; +import java.util.Map; + +@JsonIgnoreProperties(ignoreUnknown = true) +public final class Owner extends ApiData { + + @JsonProperty("id") + private final String id; + + @JsonProperty("email") + private final String email; + + @JsonProperty("organization") + private final Organization organization; + + /** + * Constructs an Owner instance. + * + * @param id the unique identifier of the owner + * @param email the email address of the owner + * @param organization the organization associated with the owner + */ + @JsonCreator + public Owner( + @JsonProperty("id") String id, + @JsonProperty("email") String email, + @JsonProperty("organization") Organization organization + ) { + this.id = id; + this.email = email; + this.organization = organization; + } + + /** + * Gets the unique identifier of the owner. + * + * @return the owner's ID + */ + public String getId() { + return this.id; + } + + /** + * Gets the email address of the owner. + * + * @return the owner's email + */ + public String getEmail() { + return this.email; + } + + /** + * Gets the organization associated with the owner. + * + * @return the owner's organization + */ + public Organization getOrganization() { + return this.organization; + } + + /** + * Converts the Owner object to a map representation. + * + * @return a map containing the owner's data + */ + @NotNull + @Override + public Map toMap() { + Map map = new LinkedHashMap<>(); + map.put("id", this.getId()); + map.put("email", this.getEmail()); + map.put("organization", this.getOrganization()); + return map; + } + + /** + * Creates an Owner instance from a map representation. + * + * @param data a map containing the owner's data + * @return a new Owner instance + */ + @NotNull + @Contract("_ -> new") + public static Owner fromMap(@NotNull Map data) { + return new Owner( + (String) data.get("id"), + (String) data.get("email"), + Organization.fromMap(Cast.safeToMap(data.get("organization"), String.class, Object.class)) + ); + } +} diff --git a/src/main/java/com/signnow/api/documentgrouptemplate/response/data/data/RoleCollection.java b/src/main/java/com/signnow/api/documentgrouptemplate/response/data/data/RoleCollection.java new file mode 100644 index 0000000..0b203fb --- /dev/null +++ b/src/main/java/com/signnow/api/documentgrouptemplate/response/data/data/RoleCollection.java @@ -0,0 +1,23 @@ +/* + * This file is a part of signNow SDK API client. + * + * (с) Copyright © 2011-present airSlate Inc. (https://www.signnow.com) + * + * For more details on copyright, see LICENSE.md file + * that was distributed with this source code. + */ + +package com.signnow.api.documentgrouptemplate.response.data.data; + +import com.signnow.core.collection.StringCollection; + +/** + * Represents a collection of roles. + * + *

This class is a part of the signNow SDK API client and extends the + * {@link com.signnow.core.collection.StringCollection} class. + * + *

For more details on usage, refer to the documentation provided with the + * signNow SDK. + */ +public class RoleCollection extends StringCollection {} diff --git a/src/main/java/com/signnow/api/documentgrouptemplate/response/data/data/Thumbnail.java b/src/main/java/com/signnow/api/documentgrouptemplate/response/data/data/Thumbnail.java new file mode 100644 index 0000000..0d43c5d --- /dev/null +++ b/src/main/java/com/signnow/api/documentgrouptemplate/response/data/data/Thumbnail.java @@ -0,0 +1,112 @@ +/* + * This file is a part of signNow SDK API client. + * + * (с) Copyright © 2011-present airSlate Inc. (https://www.signnow.com) + * + * For more details on copyright, see LICENSE.md file + * that was distributed with this source code. + */ + +package com.signnow.api.documentgrouptemplate.response.data.data; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.signnow.core.data.ApiData; +import org.jetbrains.annotations.Contract; +import org.jetbrains.annotations.NotNull; + +import java.util.LinkedHashMap; +import java.util.Map; + +/** + * Represents a Thumbnail with different sizes. + */ +@JsonIgnoreProperties(ignoreUnknown = true) +public final class Thumbnail extends ApiData { + + @JsonProperty("small") + private final String small; + + @JsonProperty("medium") + private final String medium; + + @JsonProperty("large") + private final String large; + + /** + * Constructs a Thumbnail with specified sizes. + * + * @param small the small size thumbnail + * @param medium the medium size thumbnail + * @param large the large size thumbnail + */ + @JsonCreator + public Thumbnail( + @JsonProperty("small") String small, + @JsonProperty("medium") String medium, + @JsonProperty("large") String large + ) { + this.small = small; + this.medium = medium; + this.large = large; + } + + /** + * Gets the small size thumbnail. + * + * @return the small size thumbnail + */ + public String getSmall() { + return this.small; + } + + /** + * Gets the medium size thumbnail. + * + * @return the medium size thumbnail + */ + public String getMedium() { + return this.medium; + } + + /** + * Gets the large size thumbnail. + * + * @return the large size thumbnail + */ + public String getLarge() { + return this.large; + } + + /** + * Converts the Thumbnail to a map representation. + * + * @return a map containing the thumbnail sizes + */ + @NotNull + @Override + public Map toMap() { + Map map = new LinkedHashMap<>(); + map.put("small", this.getSmall()); + map.put("medium", this.getMedium()); + map.put("large", this.getLarge()); + return map; + } + + /** + * Creates a Thumbnail from a map representation. + * + * @param data the map containing thumbnail sizes + * @return a new Thumbnail instance + */ + @NotNull + @Contract("_ -> new") + public static Thumbnail fromMap(@NotNull Map data) { + return new Thumbnail( + (String) data.get("small"), + (String) data.get("medium"), + (String) data.get("large") + ); + } +} diff --git a/src/main/java/com/signnow/core/config/ConfigRepository.java b/src/main/java/com/signnow/core/config/ConfigRepository.java index b92534c..a36d3da 100644 --- a/src/main/java/com/signnow/core/config/ConfigRepository.java +++ b/src/main/java/com/signnow/core/config/ConfigRepository.java @@ -16,7 +16,7 @@ public class ConfigRepository { private static final int READ_TIMEOUT = 15; - private static final String CLIENT_NAME = "SignNowApiClient/v3.2.1 (Java)"; + private static final String CLIENT_NAME = "SignNowApiClient/v3.4 (Java)"; private static final String DEFAULT_DOWNLOADS_DIR = "./src/main/resources/downloads"; private final Map configMap; diff --git a/src/test/resources/wiremock/mappings/create_document_group_from_template_post.json b/src/test/resources/wiremock/mappings/create_document_group_from_template_post.json new file mode 100644 index 0000000..3e02700 --- /dev/null +++ b/src/test/resources/wiremock/mappings/create_document_group_from_template_post.json @@ -0,0 +1,13 @@ +{ + "request": { + "method": "POST", + "urlPathPattern": "/v2/document-group-templates/[0-9a-z]{40}/document-group" + }, + "response": { + "status": 200, + "body": "{\"data\":{\"unique_id\":\"7fcf46b0d307c27ba495c2c5b3eeee377592b179\",\"name\":\"quia\",\"created\":138108469,\"invite_id\":\"0f117c09ca5743d81fa03aa44208002f86b647cf\",\"state\":\"quia\",\"last_invite_id\":\"5dd2fc6b5ddffcaa5d06a63875f3ae2b103e5361\",\"owner_email\":\"imoore@yahoo.com\",\"documents\":[{\"roles\":[\"laborum\"],\"document_name\":\"cupiditate ut\",\"id\":\"34763dff13990f8a575ffc2785afb9562b3b1932\",\"thumbnail\":{\"small\":\"https:\\/\\/api.signnow.com\\/document\\/a06b6381f64d302447f4df2d68d900fc8eb0bd96\\/thumbnail?size=small\",\"medium\":\"https:\\/\\/api.signnow.com\\/document\\/a06b6381f64d302447f4df2d68d900fc8eb0bd96\\/thumbnail?size=medium\",\"large\":\"https:\\/\\/api.signnow.com\\/document\\/a06b6381f64d302447f4df2d68d900fc8eb0bd96\\/thumbnail?size=large\"},\"origin_document_id\":\"68503fc27ab587d8380b25df8f94c48f2c079843\",\"has_unassigned_field\":true,\"has_credit_card_number\":false}],\"owner\":\"colten08@keeling.net\"}}", + "headers": { + "Content-Type": "application/json" + } + } +} diff --git a/src/test/resources/wiremock/mappings/get_document_get.json b/src/test/resources/wiremock/mappings/get_document_get.json index 61904f0..c965d10 100644 --- a/src/test/resources/wiremock/mappings/get_document_get.json +++ b/src/test/resources/wiremock/mappings/get_document_get.json @@ -5,7 +5,7 @@ }, "response": { "status": 200, - "body": "{\"id\":\"e2e913db4ba9815a31c8a28a196b7df96fe1cc46\",\"user_id\":\"a8277972fe195eb7a9f86db0e9e33dffa55deac9\",\"document_name\":\"eaet ter\",\"page_count\":\"0\",\"created\":332223105,\"is_template\":false,\"updated\":78692571,\"original_filename\":\"ea.doc\",\"owner\":\"evan69@yahoo.com\",\"owner_name\":\"Lia Legros\",\"template\":false,\"parent_id\":\"09588059592430c7bf6c3a2baacfc48694966d67\",\"originator_logo\":\"\",\"pages\":[{\"src\":\"https://api.signnow.com/document/29ab8396df93d14aeb676cbeef60901362861d69/thumbnail?size\\u003dlarge\\u0026page\\u003d0\",\"size\":{\"width\":829,\"height\":348}}],\"version_time\":1260995138,\"routing_details\":[{\"id\":\"bac6c72343c0f2f4e1675f62615bf4393ec0bb7d\",\"data\":[{\"default_email\":\"bayer.imani@herman.com\",\"inviter_role\":true,\"name\":\"Signer\",\"role_id\":\"340495da66cde18ba68dfd78c964b3ee74b9988f\",\"signing_order\":1230}],\"created\":1045893054,\"updated\":1045893054}],\"thumbnail\":{\"small\":\"https://api.signnow.com/document/0161dc5c9cf90e0499bc049f0d930f2348b6ee1e/thumbnail?size\\u003dsmall\",\"medium\":\"https://api.signnow.com/document/0161dc5c9cf90e0499bc049f0d930f2348b6ee1e/thumbnail?size\\u003dmedium\",\"large\":\"https://api.signnow.com/document/0161dc5c9cf90e0499bc049f0d930f2348b6ee1e/thumbnail?size\\u003dlarge\"},\"signatures\":[{\"id\":\"2d74aabcd91cb312bce8c97fde38c62918d42b8f\",\"user_id\":\"fc5642a54f796a224b4a88f0a22f40d893419888\",\"signature_request_id\":\"9524bc5c1271dcf316b006c8975d0b25da12c9d0\",\"email\":\"laisha.dickens@johnson.com\",\"page_number\":\"harum\",\"width\":\"aut\",\"height\":\"consequatur\",\"x\":\"voluptatem\",\"y\":\"temporibus\",\"subtype\":\"doloribus\",\"allow_editing\":false,\"owner_as_recipient\":true,\"created\":659085581,\"data\":\"iVBORw0KGgoAAAANSUhEUgAAAAQAAAAECAYAAACp8Z5+AAAABHNCSVQICAgIfAhkiAAAABl0RVh0U29mdHdhcmUAZ25vbWUtc2NyZWVuc2hvdO8Dvz4AAAApSURBVAiZVcvBCQAgEMTAObH/itX1IYgG8ksqc8RDA9WO6CDrFpXkWzZ2uwn/AFD5ZAAAAABJRU5ErkJggg\\u003d\\u003d\"}],\"tags\":[{\"type\":\"aliquid\",\"name\":\"error\"}],\"fields\":[{\"id\":\"76f7e03d447cde2aa4fede21d2fceb5011ea5052\",\"type\":\"rem\",\"role_id\":\"b9a845f5c36909a9acb07aec0de7f3c18767a33e\",\"json_attributes\":{\"page_number\":0,\"x\":12920,\"y\":31445,\"width\":97151,\"height\":34405,\"required\":true,\"name\":\"asperiores\",\"label\":\"illo\",\"color\":\"CE0000\",\"bold\":false,\"italic\":false,\"underline\":false,\"align\":\"left\",\"valign\":\"top\",\"font\":\"Arial\",\"font_size\":9,\"size\":14,\"arrangement\":\"none\",\"max_lines\":27516,\"max_chars\":29326,\"validator_id\":\"82af84f6b43c7ebf30c9af66ec5f040859073ece\",\"prefilled_text\":\"demo\"},\"role\":\"voluptas\",\"originator\":\"smayert@ziemann.net\",\"fulfiller\":\"nya38@ernser.biz\",\"field_request_id\":\"064703e57950efe9abe0fa462bb2bffc2fc80a8b\",\"field_request_canceled\":\"eligendi\",\"element_id\":\"57d0df6c9146fd5b24320a45535a0857a3378373\",\"field_id\":\"2b1763d62a18048094165f90b68f71bdbc89b8e0\",\"template_field_id\":\"dbf6c4fc9b88c9ac276bbe8eeec8f696f51e2c78\"}],\"roles\":[{\"unique_id\":\"ut\",\"signing_order\":\"autem\",\"name\":\"reprehenderit\"}],\"viewer_roles\":[{\"unique_id\":\"accusamus\",\"signing_order\":\"sint\",\"name\":\"reprehenderit\"}],\"signing_session_settings\":{\"welcome_message\":\"nam\"},\"enumeration_options\": [{\"id\":\"fa35b2b8896263d132208df7b0bf5249fe343443\",\"enumeration_id\": \"ee528851367a3b5f8d99734f35123adbb861f81e\",\"data\": \"M\",\"created\": \"1739110185\",\"updated\": \"1739110185\",\"json_attributes\": \"[]\"}],\"originator_organization_settings\":[{\"setting\":\"excepturi\",\"value\":\"enim\"}],\"document_group_info\":{\"document_group_id\":\"praesentium\",\"document_group_name\":\"sit\",\"invite_id\":\"iure\",\"invite_status\":\"beatae\",\"sign_as_merged\":false,\"doc_count_in_group\":0,\"freeform_invite\":{\"id\":\"250cc8fa1abf3cb91ba8ea396ee82726164d7547\"},\"state\":\"odit\"},\"settings\":{\"no_document_attachment\":false,\"copy_export\":true,\"no_document_file_attachments\":false,\"no_user_signature_return\":true,\"mobileweb_option\":true,\"require_drawn_signatures\":true,\"org_allowed_team_admins\":false,\"cloud_auto_export\":true,\"digitally_sign_dowloaded_docs\":true,\"invite_completion_redirect_url\":false,\"invite_decline_redirect_url\":true,\"add_signature_stamp\":true,\"pending_invite_document_view_notification\":true,\"signing_link_document_download\":false,\"required_preset_signature_name\":true,\"cloud_export_with_history\":false,\"emailed_docs_include_history\":true,\"require_email_subject\":false,\"document_completion_retention_days\":false,\"enable_hyperlink_protection\":false,\"enable_advanced_threat_protection\":false,\"require_login_for_signing\":false,\"logout_on_signing\":false,\"audit_trail_completion_retention_days\":true,\"front_end_session_length\":false,\"email_admin_on_banned_login\":false,\"add_signature_stamp_with_name\":true,\"cfr_title_21_part_11\":true,\"unsuccessful_logout_attempts_allowed\":false,\"require_authentication_for_invites\":false,\"electronic_consent_required\":true,\"electronic_consent_text\":true,\"document_guide\":true,\"watermark_downloaded_document\":true,\"restrict_download\":true,\"disable_email_notifications\":false,\"upload_limit\":true,\"document_schema_extended\":false,\"invite_update_notifications_for_all_invites_at_invite_create\":true,\"enable_full_story_tracker\":true,\"document_attachment_only_for_signer\":true,\"sso-only-login\":false,\"block_export_options_when_credit_card_validation_is_used\":false,\"only_administrator_is_able_to_invite_to_the_team\":false,\"block_login_via_social_networks\":false,\"redirect_to_registration_when_fields_saved\":false,\"common_experiments\":false,\"hide_decline_to_sign_option_in_signing_session\":false,\"hide_upgrade_subscription_button\":false,\"do_no_consent_redirect_url\":false,\"lock_signing_date_by_default\":false,\"allow_download_certificate\":false,\"have_merged_document_group_option\":false,\"enable_eu_date_format\":false,\"guide_signers_only_through_required_fields\":false,\"allow_document_copying_to_other_accounts\":false,\"email_custom_subject\":false,\"email_custom_message\":false,\"invite_expiration_days\":false,\"enable_mfa\":false,\"enable_document_download_link_for_invite_completion_mails\":false,\"allow_big_attachment_file\":false,\"allow_big_count_of_attachment_fields_per_document\":false,\"enable_hyperlink_field\":false,\"disable_download_action_in_editor\":false,\"signature_stamp_position\":false,\"enable_pki\":false,\"enable_document_comments\":false,\"cc_completion_email_contain_only_downloading_document_link\":false,\"save_signer_signature_and_initials\":false,\"auto_apply_signatures_and_initials_to_document_fields\":false,\"block_organization_selfleave_by_member\":false,\"receive_signer_email_after_sent_field_invite_to_yourself\":false,\"date_format\":false,\"completed_document_name_formula\":false,\"agreement_to_test_new_functionality_in_organization\":false,\"agree_to_be_beta_tester\":false,\"default_field_invite_remind_before\":false,\"default_field_invite_remind_after\":false,\"default_field_invite_remind_repeat\":false,\"default_field_invite_expiration_time\":false,\"email_logo_position\":false,\"email_btn_bkgd_color\":false,\"email_btn_text_color\":false,\"allow_edit_document_after_signing\":false,\"allow_embedded_extended_token_expiration\":false,\"every_signature_and_initials_field_requires_user_authentication\":false,\"enable_render_pages_in_editor_as_images\":false,\"enable_team_admin_move_docs\":false,\"disable_email_recipients\":false,\"allow_team_admin_rename_docs\":false,\"email_footer_enabled\":false,\"parse_only_signature_fields\":false,\"flatten_before_aspose\":false,\"run_experiments\":false,\"disable_form_search\":false,\"allow_team_admin_create_csv_report_for_shared_template\":false,\"enable_team_generic_email\":false,\"use_team_generic_data\":false,\"signing_reason\":false,\"allow_qes\":false,\"enable_qes\":false,\"advanced_signing_flow\":false,\"document_prefill_disable_fields_existing_validation\":false,\"disable_problem_invite_email_notifications\":false,\"default_workspace_assigned\":false,\"workspace_organization\":false,\"default_workspace\":false,\"workspace_subscription_admin\":false,\"dashboard_tips_enabled\":false,\"dashboard_onboarding_enabled\":false,\"dashboard_onboarding_current_step\":false},\"share_info\":{\"is_team_shared\":false,\"role\":\"sender\",\"is_personally_shared_to_others\":true}}", + "body": "{\"id\":\"e2e913db4ba9815a31c8a28a196b7df96fe1cc46\",\"user_id\":\"a8277972fe195eb7a9f86db0e9e33dffa55deac9\",\"document_name\":\"eaet ter\",\"page_count\":\"0\",\"created\":332223105,\"is_template\":false,\"updated\":78692571,\"original_filename\":\"ea.doc\",\"owner\":\"evan69@yahoo.com\",\"owner_name\":\"Lia Legros\",\"template\":false,\"parent_id\":\"09588059592430c7bf6c3a2baacfc48694966d67\",\"originator_logo\":\"\",\"pages\":[{\"src\":\"https://api.signnow.com/document/29ab8396df93d14aeb676cbeef60901362861d69/thumbnail?size\\u003dlarge\\u0026page\\u003d0\",\"size\":{\"width\":829,\"height\":348}}],\"version_time\":1260995138,\"routing_details\":[{\"id\":\"bac6c72343c0f2f4e1675f62615bf4393ec0bb7d\",\"data\":[{\"default_email\":\"bayer.imani@herman.com\",\"inviter_role\":true,\"name\":\"Signer\",\"role_id\":\"340495da66cde18ba68dfd78c964b3ee74b9988f\",\"signing_order\":1230}],\"created\":1045893054,\"updated\":1045893054}],\"thumbnail\":{\"small\":\"https://api.signnow.com/document/0161dc5c9cf90e0499bc049f0d930f2348b6ee1e/thumbnail?size\\u003dsmall\",\"medium\":\"https://api.signnow.com/document/0161dc5c9cf90e0499bc049f0d930f2348b6ee1e/thumbnail?size\\u003dmedium\",\"large\":\"https://api.signnow.com/document/0161dc5c9cf90e0499bc049f0d930f2348b6ee1e/thumbnail?size\\u003dlarge\"},\"signatures\":[{\"id\":\"2d74aabcd91cb312bce8c97fde38c62918d42b8f\",\"user_id\":\"fc5642a54f796a224b4a88f0a22f40d893419888\",\"signature_request_id\":\"9524bc5c1271dcf316b006c8975d0b25da12c9d0\",\"email\":\"laisha.dickens@johnson.com\",\"page_number\":\"harum\",\"width\":\"aut\",\"height\":\"consequatur\",\"x\":\"voluptatem\",\"y\":\"temporibus\",\"subtype\":\"doloribus\",\"allow_editing\":false,\"owner_as_recipient\":true,\"created\":659085581,\"data\":\"iVBORw0KGgoAAAANSUhEUgAAAAQAAAAECAYAAACp8Z5+AAAABHNCSVQICAgIfAhkiAAAABl0RVh0U29mdHdhcmUAZ25vbWUtc2NyZWVuc2hvdO8Dvz4AAAApSURBVAiZVcvBCQAgEMTAObH/itX1IYgG8ksqc8RDA9WO6CDrFpXkWzZ2uwn/AFD5ZAAAAABJRU5ErkJggg\\u003d\\u003d\"}],\"tags\":[{\"type\":\"aliquid\",\"name\":\"error\"}],\"fields\":[{\"id\":\"76f7e03d447cde2aa4fede21d2fceb5011ea5052\",\"type\":\"rem\",\"role_id\":\"b9a845f5c36909a9acb07aec0de7f3c18767a33e\",\"json_attributes\":{\"page_number\":0,\"x\":12920,\"y\":31445,\"width\":97151,\"height\":34405,\"required\":true,\"name\":\"asperiores\",\"label\":\"illo\",\"color\":\"CE0000\",\"bold\":false,\"italic\":false,\"underline\":false,\"align\":\"left\",\"valign\":\"top\",\"font\":\"Arial\",\"font_size\":9,\"size\":14,\"arrangement\":\"none\",\"max_lines\":27516,\"max_chars\":29326,\"validator_id\":\"82af84f6b43c7ebf30c9af66ec5f040859073ece\",\"prefilled_text\":\"demo\"},\"role\":\"voluptas\",\"originator\":\"smayert@ziemann.net\",\"fulfiller\":\"nya38@ernser.biz\",\"field_request_id\":\"064703e57950efe9abe0fa462bb2bffc2fc80a8b\",\"field_request_canceled\":\"eligendi\",\"element_id\":\"57d0df6c9146fd5b24320a45535a0857a3378373\",\"field_id\":\"2b1763d62a18048094165f90b68f71bdbc89b8e0\",\"template_field_id\":\"dbf6c4fc9b88c9ac276bbe8eeec8f696f51e2c78\"}],\"roles\":[{\"unique_id\":\"ut\",\"signing_order\":\"autem\",\"name\":\"reprehenderit\"}],\"viewer_roles\":[{\"unique_id\":\"accusamus\",\"signing_order\":\"sint\",\"name\":\"reprehenderit\"}],\"signing_session_settings\":{\"welcome_message\":\"nam\"},\"field_invites\":[{\"id\":\"3ac71a4a7bf44de3b25ce6747c3cbec90689bc19\",\"signer_user_id\":\"a5bfc53329924ababfa78490478231b36e428e93\",\"status\":\"pending\",\"password_protected\":\"0\",\"reassign\":\"0\",\"created\":\"1751628601\",\"updated\":\"1751628602\",\"email_group\":{\"id\":null,\"name\":null},\"email\":\"test.user@airslate.com\",\"email_statuses\":[{\"status\":\"sent\",\"created_at\":1751628605,\"last_reaction_at\":1751628605}],\"role\":\"Signer\",\"role_id\":\"3003e0b87b474b3fb5645a1f1eb84f69ea3eaa28\",\"reminder\":\"0\",\"expiration_time\":\"1754220602\",\"redirect_uri\":\"https://example.com\",\"decline_redirect_uri\":\"https://signnow.com\",\"close_redirect_uri\":\"https://close-redirect-uri.com\",\"redirect_target\":\"blank\",\"is_draft_exists\":\"0\",\"is_full_declined\":false,\"is_embedded\":false,\"is_document_locked\":\"0\",\"declined\":[],\"decline_by_signature\":\"0\",\"electronic_consent_required\":0,\"delivery_type\":\"email\",\"id_verification_required\":\"NO\",\"id_verified\":\"UNVERIFIED\",\"stripe_ach_bank_account_verified\":\"0\",\"stripe_ach_bank_account_present\":\"0\",\"embedded_signer\":[],\"prefill_signature_name\":\"Signer 1\",\"force_new_signature\":1,\"compliance\":{\"cfr\":{\"cfr_title_21_part_11\":1,\"front_end_session_length\":\"15\",\"require_authentication_for_invites\":\"1\",\"auto_apply_signatures_and_initials_to_document_fields\":\"0\",\"every_signature_and_initials_field_requires_user_authentication\":\"on\",\"emailed_docs_include_history\":\"1\",\"cloud_export_with_history\":\"1\",\"require_login_for_signing\":\"1\",\"logout_on_signing\":\"1\",\"add_signature_stamp_with_name\":\"1\"}}}],\"enumeration_options\": [{\"id\":\"fa35b2b8896263d132208df7b0bf5249fe343443\",\"enumeration_id\": \"ee528851367a3b5f8d99734f35123adbb861f81e\",\"data\": \"M\",\"created\": \"1739110185\",\"updated\": \"1739110185\",\"json_attributes\": \"[]\"}],\"originator_organization_settings\":[{\"setting\":\"excepturi\",\"value\":\"enim\"}],\"document_group_info\":{\"document_group_id\":\"praesentium\",\"document_group_name\":\"sit\",\"invite_id\":\"iure\",\"invite_status\":\"beatae\",\"sign_as_merged\":false,\"doc_count_in_group\":0,\"freeform_invite\":{\"id\":\"250cc8fa1abf3cb91ba8ea396ee82726164d7547\"},\"state\":\"odit\"},\"settings\":{\"no_document_attachment\":false,\"copy_export\":true,\"no_document_file_attachments\":false,\"no_user_signature_return\":true,\"mobileweb_option\":true,\"require_drawn_signatures\":true,\"org_allowed_team_admins\":false,\"cloud_auto_export\":true,\"digitally_sign_dowloaded_docs\":true,\"invite_completion_redirect_url\":false,\"invite_decline_redirect_url\":true,\"add_signature_stamp\":true,\"pending_invite_document_view_notification\":true,\"signing_link_document_download\":false,\"required_preset_signature_name\":true,\"cloud_export_with_history\":false,\"emailed_docs_include_history\":true,\"require_email_subject\":false,\"document_completion_retention_days\":false,\"enable_hyperlink_protection\":false,\"enable_advanced_threat_protection\":false,\"require_login_for_signing\":false,\"logout_on_signing\":false,\"audit_trail_completion_retention_days\":true,\"front_end_session_length\":false,\"email_admin_on_banned_login\":false,\"add_signature_stamp_with_name\":true,\"cfr_title_21_part_11\":true,\"unsuccessful_logout_attempts_allowed\":false,\"require_authentication_for_invites\":false,\"electronic_consent_required\":true,\"electronic_consent_text\":true,\"document_guide\":true,\"watermark_downloaded_document\":true,\"restrict_download\":true,\"disable_email_notifications\":false,\"upload_limit\":true,\"document_schema_extended\":false,\"invite_update_notifications_for_all_invites_at_invite_create\":true,\"enable_full_story_tracker\":true,\"document_attachment_only_for_signer\":true,\"sso-only-login\":false,\"block_export_options_when_credit_card_validation_is_used\":false,\"only_administrator_is_able_to_invite_to_the_team\":false,\"block_login_via_social_networks\":false,\"redirect_to_registration_when_fields_saved\":false,\"common_experiments\":false,\"hide_decline_to_sign_option_in_signing_session\":false,\"hide_upgrade_subscription_button\":false,\"do_no_consent_redirect_url\":false,\"lock_signing_date_by_default\":false,\"allow_download_certificate\":false,\"have_merged_document_group_option\":false,\"enable_eu_date_format\":false,\"guide_signers_only_through_required_fields\":false,\"allow_document_copying_to_other_accounts\":false,\"email_custom_subject\":false,\"email_custom_message\":false,\"invite_expiration_days\":false,\"enable_mfa\":false,\"enable_document_download_link_for_invite_completion_mails\":false,\"allow_big_attachment_file\":false,\"allow_big_count_of_attachment_fields_per_document\":false,\"enable_hyperlink_field\":false,\"disable_download_action_in_editor\":false,\"signature_stamp_position\":false,\"enable_pki\":false,\"enable_document_comments\":false,\"cc_completion_email_contain_only_downloading_document_link\":false,\"save_signer_signature_and_initials\":false,\"auto_apply_signatures_and_initials_to_document_fields\":false,\"block_organization_selfleave_by_member\":false,\"receive_signer_email_after_sent_field_invite_to_yourself\":false,\"date_format\":false,\"completed_document_name_formula\":false,\"agreement_to_test_new_functionality_in_organization\":false,\"agree_to_be_beta_tester\":false,\"default_field_invite_remind_before\":false,\"default_field_invite_remind_after\":false,\"default_field_invite_remind_repeat\":false,\"default_field_invite_expiration_time\":false,\"email_logo_position\":false,\"email_btn_bkgd_color\":false,\"email_btn_text_color\":false,\"allow_edit_document_after_signing\":false,\"allow_embedded_extended_token_expiration\":false,\"every_signature_and_initials_field_requires_user_authentication\":false,\"enable_render_pages_in_editor_as_images\":false,\"enable_team_admin_move_docs\":false,\"disable_email_recipients\":false,\"allow_team_admin_rename_docs\":false,\"email_footer_enabled\":false,\"parse_only_signature_fields\":false,\"flatten_before_aspose\":false,\"run_experiments\":false,\"disable_form_search\":false,\"allow_team_admin_create_csv_report_for_shared_template\":false,\"enable_team_generic_email\":false,\"use_team_generic_data\":false,\"signing_reason\":false,\"allow_qes\":false,\"enable_qes\":false,\"advanced_signing_flow\":false,\"document_prefill_disable_fields_existing_validation\":false,\"disable_problem_invite_email_notifications\":false,\"default_workspace_assigned\":false,\"workspace_organization\":false,\"default_workspace\":false,\"workspace_subscription_admin\":false,\"dashboard_tips_enabled\":false,\"dashboard_onboarding_enabled\":false,\"dashboard_onboarding_current_step\":false},\"share_info\":{\"is_team_shared\":false,\"role\":\"sender\",\"is_personally_shared_to_others\":true}}", "headers": { "Content-Type": "application/json" }