Package com.hellosign.sdk.resource
Class SignatureRequest
- java.lang.Object
-
- com.hellosign.sdk.resource.AbstractResource
-
- com.hellosign.sdk.resource.AbstractRequest
-
- com.hellosign.sdk.resource.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.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
SIGREQ_ATTACHMENTS
static java.lang.String
SIGREQ_ATTACHMENTS_INDEX
static java.lang.String
SIGREQ_ATTACHMENTS_INSTRUCTIONS
static java.lang.String
SIGREQ_ATTACHMENTS_NAME
static java.lang.String
SIGREQ_ATTACHMENTS_REQUIRED
static java.lang.String
SIGREQ_CCS
static java.lang.String
SIGREQ_DETAILS_URL
static java.lang.String
SIGREQ_FILES
static java.lang.String
SIGREQ_FILES_URL
static java.lang.String
SIGREQ_FINAL_COPY_URL
static java.lang.String
SIGREQ_FORM_FIELDS
static java.lang.String
SIGREQ_FORMAT_PDF
static java.lang.String
SIGREQ_FORMAT_ZIP
static java.lang.String
SIGREQ_HAS_ERROR
static java.lang.String
SIGREQ_ID
static java.lang.String
SIGREQ_IS_COMPLETE
static java.lang.String
SIGREQ_IS_DECLINED
static java.lang.String
SIGREQ_KEY
static java.lang.String
SIGREQ_RESPONSE_DATA
static java.lang.String
SIGREQ_SIGNER_EMAIL
static java.lang.String
SIGREQ_SIGNER_NAME
static java.lang.String
SIGREQ_SIGNER_ORDER
static java.lang.String
SIGREQ_SIGNER_PIN
static java.lang.String
SIGREQ_SIGNERS
static java.lang.String
SIGREQ_SIGNING_URL
-
Fields inherited from class com.hellosign.sdk.resource.AbstractRequest
REQUEST_ALLOW_DECLINE, REQUEST_ALLOW_REASSIGN, REQUEST_CLIENT_ID, REQUEST_CUSTOM_FIELDS, REQUEST_HIDE_TEXT_TAGS, REQUEST_MESSAGE, REQUEST_METADATA, REQUEST_REDIRECT_URL, REQUEST_SUBJECT, REQUEST_TEST_MODE, REQUEST_TITLE, REQUEST_USE_PREEXISTING_FIELDS, REQUEST_USE_TEXT_TAGS, REQUEST_UX_VERSION, UX_VERSION_1, UX_VERSION_2
-
Fields inherited from class com.hellosign.sdk.resource.AbstractResource
dataObj, warnings
-
-
Constructor Summary
Constructors Constructor Description SignatureRequest()
SignatureRequest(org.json.JSONObject json)
SignatureRequest(org.json.JSONObject json, java.lang.String key)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
addCC(java.lang.String email)
Adds a CC'd email address to this request.void
addSigner(Signer signer)
Adds the signer to the list of signers for this request.void
addSigner(java.lang.String email, java.lang.String name)
Adds the signer to the list of signers for this request.void
addSigner(java.lang.String email, java.lang.String name, int order)
Adds the signer with the given order to the list of signers for this request.java.util.List<Attachment>
getAttachments()
java.util.List<Attachment>
getAttachmentsInResponse()
java.util.List<java.lang.String>
getCCs()
Returns the CC email addresses for this request.java.lang.String
getDetailsUrl()
java.lang.String
getFilesUrl()
Returns the API URL to retrieve the PDF copy of this signature request.java.lang.String
getFinalCopyUrl()
Deprecated.use getFilesUrl()java.lang.String
getId()
Returns the ID for this request.java.util.Map<java.lang.String,java.io.Serializable>
getPostFields()
Internal method used to retrieve the necessary POST fields to submit the signature request.java.util.List<ResponseData>
getResponseData()
Signature
getSignature(java.lang.String email, java.lang.String name)
Returns the signature for the given email/name combination, or null if not found on this request.Signature
getSignatureBySigner(java.lang.String email, java.lang.String name)
Deprecated.Use getSignature(email, name)java.util.List<Signature>
getSignatures()
Returns a list of signatures for this request.java.util.List<Signer>
getSigners()
Returns a reference to the signers list.java.lang.String
getSigningUrl()
boolean
hasError()
boolean
hasId()
Returns true if this request has an ID.boolean
isComplete()
Returns the HelloSign-designated signature status, indicating whether all signers have signed the document.boolean
isDeclined()
void
removeSigner(java.lang.String email)
Removes the signer from the list.void
setAttachments(java.util.List<Attachment> attachments)
void
setSigners(java.util.List<Signer> signers)
Overwrites the current list of signers for this request with the given list.-
Methods inherited from class com.hellosign.sdk.resource.AbstractRequest
addCustomField, addDocument, addDocument, addFile, addFile, addFileUrl, addMetadata, clearCustomFields, clearDocuments, getClientId, getCustomFields, getCustomFieldsList, getCustomFieldsMap, getDocuments, getFileUrls, getIsDeclinable, getMessage, getMetadata, getMetadata, getOrderMatters, getRedirectUrl, getSubject, getTitle, getUxVersion, hasAllowReassign, hasHideTextTags, hasMessage, hasRedirectUrl, hasSubject, hasTitle, hasUsePreexistingFields, hasUseTextTags, isAllowReassign, isHidingTextTags, isTestMode, isUsingPreexistingFields, isUsingTextTags, setAllowReassign, setClientId, setCustomFields, setCustomFieldValue, setDocuments, setFileUrls, setHideTextTags, setIsDeclinable, setMessage, setOrderMatters, setRedirectUrl, setSubject, setTestMode, setTitle, setUsePreexistingFields, setUseTextTags, setUxVersion
-
Methods inherited from class com.hellosign.sdk.resource.AbstractResource
add, addToList, clearList, get, getBoolean, getConstructor, getDate, getInteger, getJSONObject, getList, getList, getLong, getObject, getString, getWarnings, has, hasString, set, toString, toString
-
-
-
-
Field Detail
-
SIGREQ_KEY
public static final java.lang.String SIGREQ_KEY
- See Also:
- Constant Field Values
-
SIGREQ_ID
public static final java.lang.String SIGREQ_ID
- See Also:
- Constant Field Values
-
SIGREQ_SIGNERS
public static final java.lang.String SIGREQ_SIGNERS
- See Also:
- Constant Field Values
-
SIGREQ_SIGNER_EMAIL
public static final java.lang.String SIGREQ_SIGNER_EMAIL
- See Also:
- Constant Field Values
-
SIGREQ_SIGNER_NAME
public static final java.lang.String SIGREQ_SIGNER_NAME
- See Also:
- Constant Field Values
-
SIGREQ_SIGNER_ORDER
public static final java.lang.String SIGREQ_SIGNER_ORDER
- See Also:
- Constant Field Values
-
SIGREQ_SIGNER_PIN
public static final java.lang.String SIGREQ_SIGNER_PIN
- See Also:
- Constant Field Values
-
SIGREQ_CCS
public static final java.lang.String SIGREQ_CCS
- See Also:
- Constant Field Values
-
SIGREQ_FILES
public static final java.lang.String SIGREQ_FILES
- See Also:
- Constant Field Values
-
SIGREQ_FORM_FIELDS
public static final java.lang.String SIGREQ_FORM_FIELDS
- See Also:
- Constant Field Values
-
SIGREQ_IS_COMPLETE
public static final java.lang.String SIGREQ_IS_COMPLETE
- See Also:
- Constant Field Values
-
SIGREQ_HAS_ERROR
public static final java.lang.String SIGREQ_HAS_ERROR
- See Also:
- Constant Field Values
-
SIGREQ_RESPONSE_DATA
public static final java.lang.String SIGREQ_RESPONSE_DATA
- See Also:
- Constant Field Values
-
SIGREQ_FINAL_COPY_URL
public static final java.lang.String SIGREQ_FINAL_COPY_URL
- See Also:
- Constant Field Values
-
SIGREQ_FILES_URL
public static final java.lang.String SIGREQ_FILES_URL
- See Also:
- Constant Field Values
-
SIGREQ_SIGNING_URL
public static final java.lang.String SIGREQ_SIGNING_URL
- See Also:
- Constant Field Values
-
SIGREQ_DETAILS_URL
public static final java.lang.String SIGREQ_DETAILS_URL
- See Also:
- Constant Field Values
-
SIGREQ_IS_DECLINED
public static final java.lang.String SIGREQ_IS_DECLINED
- See Also:
- Constant Field Values
-
SIGREQ_ATTACHMENTS
public static final java.lang.String SIGREQ_ATTACHMENTS
- See Also:
- Constant Field Values
-
SIGREQ_ATTACHMENTS_NAME
public static final java.lang.String SIGREQ_ATTACHMENTS_NAME
- See Also:
- Constant Field Values
-
SIGREQ_ATTACHMENTS_INSTRUCTIONS
public static final java.lang.String SIGREQ_ATTACHMENTS_INSTRUCTIONS
- See Also:
- Constant Field Values
-
SIGREQ_ATTACHMENTS_INDEX
public static final java.lang.String SIGREQ_ATTACHMENTS_INDEX
- See Also:
- Constant Field Values
-
SIGREQ_ATTACHMENTS_REQUIRED
public static final java.lang.String SIGREQ_ATTACHMENTS_REQUIRED
- See Also:
- Constant Field Values
-
SIGREQ_FORMAT_ZIP
public static final java.lang.String SIGREQ_FORMAT_ZIP
- See Also:
- Constant Field Values
-
SIGREQ_FORMAT_PDF
public static final java.lang.String SIGREQ_FORMAT_PDF
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
SignatureRequest
public SignatureRequest()
-
SignatureRequest
public SignatureRequest(org.json.JSONObject json) throws HelloSignException
- Throws:
HelloSignException
-
SignatureRequest
public SignatureRequest(org.json.JSONObject json, java.lang.String key) throws HelloSignException
- Throws:
HelloSignException
-
-
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 classAbstractRequest
-
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 addressname
- 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
- Stringname
- 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
- Stringname
- Stringorder
- 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
- Stringname
- 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 classAbstractRequest
- 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()
-
-