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.StringSIGREQ_ATTACHMENTSstatic java.lang.StringSIGREQ_ATTACHMENTS_INDEXstatic java.lang.StringSIGREQ_ATTACHMENTS_INSTRUCTIONSstatic java.lang.StringSIGREQ_ATTACHMENTS_NAMEstatic java.lang.StringSIGREQ_ATTACHMENTS_REQUIREDstatic java.lang.StringSIGREQ_CCSstatic java.lang.StringSIGREQ_DETAILS_URLstatic java.lang.StringSIGREQ_FILESstatic java.lang.StringSIGREQ_FILES_URLstatic java.lang.StringSIGREQ_FINAL_COPY_URLstatic java.lang.StringSIGREQ_FORM_FIELDSstatic java.lang.StringSIGREQ_FORMAT_PDFstatic java.lang.StringSIGREQ_FORMAT_ZIPstatic java.lang.StringSIGREQ_HAS_ERRORstatic java.lang.StringSIGREQ_IDstatic java.lang.StringSIGREQ_IS_COMPLETEstatic java.lang.StringSIGREQ_IS_DECLINEDstatic java.lang.StringSIGREQ_KEYstatic java.lang.StringSIGREQ_RESPONSE_DATAstatic java.lang.StringSIGREQ_SIGNER_EMAILstatic java.lang.StringSIGREQ_SIGNER_NAMEstatic java.lang.StringSIGREQ_SIGNER_ORDERstatic java.lang.StringSIGREQ_SIGNER_PINstatic java.lang.StringSIGREQ_SIGNERSstatic java.lang.StringSIGREQ_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 voidaddCC(java.lang.String email)Adds a CC'd email address to this request.voidaddSigner(Signer signer)Adds the signer to the list of signers for this request.voidaddSigner(java.lang.String email, java.lang.String name)Adds the signer to the list of signers for this request.voidaddSigner(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.StringgetDetailsUrl()java.lang.StringgetFilesUrl()Returns the API URL to retrieve the PDF copy of this signature request.java.lang.StringgetFinalCopyUrl()Deprecated.use getFilesUrl()java.lang.StringgetId()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()SignaturegetSignature(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.SignaturegetSignatureBySigner(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.StringgetSigningUrl()booleanhasError()booleanhasId()Returns true if this request has an ID.booleanisComplete()Returns the HelloSign-designated signature status, indicating whether all signers have signed the document.booleanisDeclined()voidremoveSigner(java.lang.String email)Removes the signer from the list.voidsetAttachments(java.util.List<Attachment> attachments)voidsetSigners(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:
getIdin 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 HelloSignExceptionAdds 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 HelloSignExceptionAdds 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 HelloSignExceptionRemoves 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 HelloSignExceptionInternal method used to retrieve the necessary POST fields to submit the signature request.- Overrides:
getPostFieldsin 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()
-
-