Class SignatureRequest


  • public class SignatureRequest
    extends AbstractRequest
    Represents a HelloSign signature request. This object is used to both submit a request and to represent the request object returned from the server.
    • Method Detail

      • getAttachments

        public java.util.List<Attachment> getAttachments()
      • getAttachmentsInResponse

        public java.util.List<Attachment> getAttachmentsInResponse()
      • setAttachments

        public void setAttachments​(java.util.List<Attachment> attachments)
      • getId

        public java.lang.String getId()
        Returns the ID for this request.
        Specified by:
        getId in class AbstractRequest
      • hasId

        public boolean hasId()
        Returns true if this request has an ID. Useful if checking to see if this request is for submission or is the result of a call to HelloSign.
        Returns:
        true if the request has an ID, false otherwise
      • getCCs

        public java.util.List<java.lang.String> getCCs()
        Returns the CC email addresses for this request.
        Returns:
        List
      • addCC

        public void addCC​(java.lang.String email)
        Adds a CC'd email address to this request.
        Parameters:
        email - String email address
      • getSignatures

        public java.util.List<Signature> getSignatures()
        Returns a list of signatures for this request.
        Returns:
        List
      • getSignature

        public Signature getSignature​(java.lang.String email,
                                      java.lang.String name)
                               throws HelloSignException
        Returns the signature for the given email/name combination, or null if not found on this request.
        Parameters:
        email - String email address
        name - String name
        Returns:
        Signature or null if not found
        Throws:
        HelloSignException - if the email or name are empty
      • addSigner

        public void addSigner​(Signer signer)
        Adds the signer to the list of signers for this request.
        Parameters:
        signer - Signer
      • addSigner

        public void addSigner​(java.lang.String email,
                              java.lang.String name)
                       throws HelloSignException
        Adds the signer to the list of signers for this request.
        Parameters:
        email - String
        name - String
        Throws:
        HelloSignException - thrown if there is a problem adding the signer.
      • addSigner

        public void addSigner​(java.lang.String email,
                              java.lang.String name,
                              int order)
                       throws HelloSignException
        Adds the signer with the given order to the list of signers for this request. NOTE: The order refers to the 1-base index, not 0-base. This is to reflect the indexing used by the HelloSign API. This means that adding an item at order 1 will place it in the 0th index of the list (it will be the first item).
        Parameters:
        email - String
        name - String
        order - int
        Throws:
        HelloSignException - thrown if there is a problem adding the signer.
      • getSigners

        public java.util.List<Signer> getSigners()
        Returns a reference to the signers list. This can be modified and re-added to the request using setSigners(). Useful for more explicit modification.
        Returns:
        List
      • setSigners

        public void setSigners​(java.util.List<Signer> signers)
        Overwrites the current list of signers for this request with the given list.
        Parameters:
        signers - List
      • removeSigner

        public void removeSigner​(java.lang.String email)
                          throws HelloSignException
        Removes the signer from the list. If that user does not exist, this will throw a HelloSignException.
        Parameters:
        email - String
        Throws:
        HelloSignException - thrown if there is a problem removing the signer.
      • getSignatureBySigner

        @Deprecated
        public Signature getSignatureBySigner​(java.lang.String email,
                                              java.lang.String name)
        Deprecated.
        Use getSignature(email, name)
        Utility method that allows you to search for a Signature object on this request by email and name. It requires both because neither alone is enough to guarantee uniqueness (some requests can have multiple signers using the same email address or name).
        Parameters:
        email - String
        name - String
        Returns:
        Signature, if found on this request, or null
      • getPostFields

        public java.util.Map<java.lang.String,​java.io.Serializable> getPostFields()
                                                                                 throws HelloSignException
        Internal method used to retrieve the necessary POST fields to submit the signature request.
        Overrides:
        getPostFields in class AbstractRequest
        Returns:
        Map
        Throws:
        HelloSignException - thrown if there is a problem serializing the POST fields.
      • isComplete

        public boolean isComplete()
        Returns the HelloSign-designated signature status, indicating whether all signers have signed the document.
        Returns:
        true, if all signers have signed the document, false otherwise.
      • hasError

        public boolean hasError()
      • getResponseData

        public java.util.List<ResponseData> getResponseData()
      • getFinalCopyUrl

        @Deprecated
        public java.lang.String getFinalCopyUrl()
        Deprecated.
        use getFilesUrl()
        Returns:
        String URL
      • getFilesUrl

        public java.lang.String getFilesUrl()
        Returns the API URL to retrieve the PDF copy of this signature request.
        Returns:
        String URL
      • getSigningUrl

        public java.lang.String getSigningUrl()
      • getDetailsUrl

        public java.lang.String getDetailsUrl()
      • isDeclined

        public boolean isDeclined()