Package com.hellosign.sdk
Class HelloSignClient
- java.lang.Object
-
- com.hellosign.sdk.HelloSignClient
-
public class HelloSignClient extends java.lang.Object
You'll need the HelloSignClient to do just about everything, from creating signatures to updating account information. To use this class, instantiate a client with valid credentials like so: HelloSignClient client = new HelloSignClient(user, key); Then, use the client to perform your requests. The client uses java.net.HttpURLConnection to perform its HTTP requests.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
ACCOUNT_CREATE_URI
static java.lang.String
ACCOUNT_URI
static java.lang.String
API_APP_LIST_URI
static java.lang.String
API_APP_URI
static java.lang.String
BULK_SEND_JOBS
static java.lang.String
BULK_SEND_JOBS_LIST
static java.lang.String
CLIENT_ID
static java.lang.String
CLIENT_SECRET
static java.lang.String
DEFAULT_BASE_API_URL
static java.lang.String
DEFAULT_ENCODING
static java.lang.String
DEFAULT_OAUTH_TOKEN_URL
static java.lang.String
EMBEDDED_EDIT_URL_URI
static java.lang.String
EMBEDDED_SIGN_URL_URI
static java.lang.String
EMBEDDED_TEMPLATE_CC_ROLES
static java.lang.String
EMBEDDED_TEMPLATE_MERGE_FIELDS
static java.lang.String
EMBEDDED_TEMPLATE_SKIP_SIGNER_ROLES
static java.lang.String
EMBEDDED_TEMPLATE_SKIP_SUBJECT_MESSAGE
static java.lang.String
FILES_FILE_EXT
static java.lang.String
FILES_FILE_NAME
static java.lang.String
FINAL_COPY_FILE_EXT
static java.lang.String
FINAL_COPY_FILE_NAME
static java.lang.String
OAUTH_CODE
static java.lang.String
OAUTH_GRANT_TYPE
static java.lang.String
OAUTH_GRANT_TYPE_AUTHORIZE_CODE
static java.lang.String
OAUTH_GRANT_TYPE_REFRESH_TOKEN
static java.lang.String
OAUTH_REFRESH_TOKEN
static java.lang.String
OAUTH_STATE
static java.lang.String
PARAM_FILE_TYPE_URI
static java.lang.String
PARAM_GET_URL
static java.lang.String
PARAM_QUERY
static java.lang.String
SIGNATURE_REQUEST_CANCEL_URI
static java.lang.String
SIGNATURE_REQUEST_EMBEDDED_TEMPLATE_URI
static java.lang.String
SIGNATURE_REQUEST_EMBEDDED_URI
static java.lang.String
SIGNATURE_REQUEST_FILES_URI
static java.lang.String
SIGNATURE_REQUEST_FINAL_COPY_URI
static java.lang.String
SIGNATURE_REQUEST_LIST_URI
static java.lang.String
SIGNATURE_REQUEST_REMIND_URI
static java.lang.String
SIGNATURE_REQUEST_REMOVE_URI
static java.lang.String
SIGNATURE_REQUEST_SEND_URI
static java.lang.String
SIGNATURE_REQUEST_UPDATE_URI
static java.lang.String
SIGNATURE_REQUEST_URI
static java.lang.String
TEAM_ADD_MEMBER_URI
static java.lang.String
TEAM_CREATE_URI
static java.lang.String
TEAM_DESTROY_URI
static java.lang.String
TEAM_REMOVE_MEMBER_URI
static java.lang.String
TEAM_URI
static java.lang.String
TEMPLATE_ADD_USER_URI
static java.lang.String
TEMPLATE_CREATE_EMBEDDED_DRAFT_URI
static java.lang.String
TEMPLATE_DELETE_URI
static java.lang.String
TEMPLATE_FILE_EXT
static java.lang.String
TEMPLATE_FILE_NAME
static java.lang.String
TEMPLATE_FILE_URI
static java.lang.String
TEMPLATE_LIST_URI
static java.lang.String
TEMPLATE_REMOVE_USER_URI
static java.lang.String
TEMPLATE_SIGNATURE_REQUEST_URI
static java.lang.String
TEMPLATE_UPDATE_FILES_URI
static java.lang.String
TEMPLATE_URI
static java.lang.String
UNCLAIMED_DRAFT_CREATE_EMBEDDED_URI
static java.lang.String
UNCLAIMED_DRAFT_CREATE_EMBEDDED_WITH_TEMPLATE_URI
static java.lang.String
UNCLAIMED_DRAFT_CREATE_URI
static java.lang.String
VALIDATE_ACCOUNT_URI
-
Constructor Summary
Constructors Modifier Constructor Description HelloSignClient(Authentication auth)
Creates a new HelloSign client using then given Authentication object.protected
HelloSignClient(HttpClient client, Authentication auth)
Default constructor for injection of dependencies (testing).HelloSignClient(java.lang.String apiKey)
Creates a new HelloSign client using your API key.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description Template
addTemplateUser(java.lang.String templateId, java.lang.String idOrEmail)
Adds the provided user to the template indicated by the provided template ID.boolean
cancelSignatureRequest(java.lang.String id)
Cancels an existing signature request.Account
createAccount(java.lang.String email)
Creates a new HelloSign account.Account
createAccount(java.lang.String email, java.lang.String clientId, java.lang.String clientSecret)
Creates a new HelloSign account and provides OAuth app credentials to automatically generate an OAuth token with the user Account response.ApiApp
createApiApp(ApiApp app)
Creates a new ApiApp using the properties set on the provided ApiApp.AbstractRequest
createEmbeddedRequest(EmbeddedRequest embeddedReq)
Creates a signature request that can be embedded within your website.TemplateDraft
createEmbeddedTemplateDraft(EmbeddedRequest req)
Creates a template draft that can be used for embedded template creation.Team
createTeam(java.lang.String teamName)
Creates a new team for the current user with the given name.UnclaimedDraft
createUnclaimedDraft(UnclaimedDraft draft)
Creates an unclaimed draft using the provided request draft object.boolean
deleteApiApp(java.lang.String clientId)
Attempts to delete the API app with the given client ID.boolean
deleteTemplate(java.lang.String templateId)
Delete the template designated by the template idboolean
destroyTeam()
Destroys the current user's team.Account
getAccount()
Returns the current user's account information.ApiApp
getApiApp(java.lang.String clientId)
Retrieves the API app configuration for the given Client ID.ApiAppList
getApiApps()
Retrieves a paged list of API apps for the authenticated account.protected Authentication
getAuth()
Retrieves the authentication details being used by this client.BulkSendJobById
getBulkSendByJobId(java.lang.String bulk_send_job_id)
Returns the status of the BulkSendJob and its SignatureRequests specified by the bulk_send_job_id parameter.BulkSendJobsList
getBulkSendJobList()
Returns a list of BulkSendJob that you can access.BulkSendJobsList
getBulkSendJobList(int page)
Retrieves a specific page number of the BulkSendJob List.BulkSendJobsList
getBulkSendJobList(int page, int pageSize)
Retrieves a specific page number of the BulkSendJob List, with Number of objects to be returned per page.EmbeddedResponse
getEmbeddedSignUrl(java.lang.String signatureId)
Retrieves the necessary information to build an embedded signature request.EmbeddedResponse
getEmbeddedTemplateEditUrl(java.lang.String templateId)
Retrieves the necessary information to edit an embedded template.EmbeddedResponse
getEmbeddedTemplateEditUrl(java.lang.String templateId, boolean skipSignerRoles, boolean skipSubjectMessage)
Retrieves the necessary information to edit an embedded template.EmbeddedResponse
getEmbeddedTemplateEditUrl(java.lang.String templateId, boolean skipSignerRoles, boolean skipSubjectMessage, boolean testMode)
Retrieves the necessary information to edit an embedded template.EmbeddedResponse
getEmbeddedTemplateEditUrl(java.lang.String templateId, boolean skipSignerRoles, boolean skipSubjectMessage, boolean testMode, java.util.Map<java.lang.String,FieldType> mergeFields, java.util.List<java.lang.String> ccRoles)
Big kahuna method for editing an embedded template.java.io.File
getFiles(java.lang.String requestId)
Retrieves a PDF copy of the files associated with a signature request.java.io.File
getFiles(java.lang.String requestId, java.lang.String format)
Retrieves the file associated with a signature request.FileUrlResponse
getFilesUrl(java.lang.String requestId)
Retrieves a URL for a file associated with a signature request.java.io.File
getFinalCopy(java.lang.String requestId)
Deprecated.Use {getFiles(String)
OauthData
getOauthData(java.lang.String code, java.lang.String clientId, java.lang.String secret, java.lang.String state, boolean autoSetRequestToken)
Performs an OAuth request and returns the necessary data for authorizing an API application, and will automatically set the access token and code for making authenticated requests with this client.SignatureRequest
getSignatureRequest(java.lang.String id)
Retrieves a Signature Request with the given ID.SignatureRequestList
getSignatureRequests()
Retrieves the current user's signature requests.SignatureRequestList
getSignatureRequests(int page)
Retrieves a specific page of the current user's signature requests.SignatureRequestList
getSignatureRequests(int page, int pageSize)
Retrieves a specific page of the current user's signature requests.SignatureRequestList
getSignatureRequests(int page, int pageSize, java.lang.String query)
Retrieves a specific page of the current user's signature requests.Team
getTeam()
Retrieves the Team for the current user account.Template
getTemplate(java.lang.String templateId)
Retrieves a specific Template based on the provided Template ID.java.io.File
getTemplateFile(java.lang.String templateId)
Retrieves the PDF file backing the Template specified by the provided Template ID.java.lang.String
getTemplateFileUrl(java.lang.String templateId)
Returns a signed URL that can be used to retrieve the file backing a template.TemplateList
getTemplates()
Retrieves the templates for the current user account.TemplateList
getTemplates(int page)
Retrieves a page of templates for the current user account.TemplateList
getTemplates(int page, int pageSize)
Retrieves a page of templates with a specific pageSizeTeam
inviteTeamMember(java.lang.String idOrEmail)
Adds the user to the current user's team.boolean
isAccountValid(java.lang.String email)
Returns true if an account exists with the provided email address.OauthData
refreshOauthData(java.lang.String refreshToken)
Refreshes the OauthData for this client with the provided refresh token.boolean
removeSignatureRequestAccess(java.lang.String signature_request_id)
Removes your access to a completed signature request.Team
removeTeamMember(java.lang.String idOrEmail)
Removes the team member indicated by the user account ID or email address.Template
removeTemplateUser(java.lang.String templateId, java.lang.String idOrEmail)
Adds the provided user to the template indicated by the provided template ID.SignatureRequest
requestEmailReminder(java.lang.String requestId, java.lang.String email)
Instructs HelloSign to email the given address with a reminder to sign the SignatureRequest referenced by the given request ID.SignatureRequest
sendSignatureRequest(SignatureRequest req)
Sends the provided signature request to HelloSign.SignatureRequest
sendTemplateSignatureRequest(TemplateSignatureRequest req)
Creates a new Signature Request based on the template provided.void
setAccessToken(java.lang.String accessToken, java.lang.String tokenType)
Sets the access token for the OAuth user that this client will use to perform requests.void
setAuthentication(Authentication auth)
Allows overriding of the authentication mechanism.Account
setCallback(java.lang.String callback)
Update your account callback URL.ApiApp
updateApiApp(ApiApp app)
Updates the API app with the given ApiApp object properties.SignatureRequest
updateSignatureRequest(java.lang.String signatureRequestId, java.lang.String signatureId, java.lang.String newEmailAddress, java.lang.String newSignerName)
Update a signer's email address.Team
updateTeamName(java.lang.String teamName)
Updates the current user's team name.java.lang.String
updateTemplateFiles(java.lang.String existingTemplateId, TemplateDraft newTemplate, java.lang.String clientId)
Replaces the backing documents for the given template with the given files.
-
-
-
Field Detail
-
DEFAULT_ENCODING
public static final java.lang.String DEFAULT_ENCODING
- See Also:
- Constant Field Values
-
DEFAULT_BASE_API_URL
public static final java.lang.String DEFAULT_BASE_API_URL
- See Also:
- Constant Field Values
-
DEFAULT_OAUTH_TOKEN_URL
public static final java.lang.String DEFAULT_OAUTH_TOKEN_URL
- See Also:
- Constant Field Values
-
ACCOUNT_URI
public static final java.lang.String ACCOUNT_URI
- See Also:
- Constant Field Values
-
VALIDATE_ACCOUNT_URI
public static final java.lang.String VALIDATE_ACCOUNT_URI
- See Also:
- Constant Field Values
-
ACCOUNT_CREATE_URI
public static final java.lang.String ACCOUNT_CREATE_URI
- See Also:
- Constant Field Values
-
TEAM_URI
public static final java.lang.String TEAM_URI
- See Also:
- Constant Field Values
-
TEAM_CREATE_URI
public static final java.lang.String TEAM_CREATE_URI
- See Also:
- Constant Field Values
-
TEAM_DESTROY_URI
public static final java.lang.String TEAM_DESTROY_URI
- See Also:
- Constant Field Values
-
TEAM_ADD_MEMBER_URI
public static final java.lang.String TEAM_ADD_MEMBER_URI
- See Also:
- Constant Field Values
-
TEAM_REMOVE_MEMBER_URI
public static final java.lang.String TEAM_REMOVE_MEMBER_URI
- See Also:
- Constant Field Values
-
SIGNATURE_REQUEST_URI
public static final java.lang.String SIGNATURE_REQUEST_URI
- See Also:
- Constant Field Values
-
SIGNATURE_REQUEST_LIST_URI
public static final java.lang.String SIGNATURE_REQUEST_LIST_URI
- See Also:
- Constant Field Values
-
SIGNATURE_REQUEST_SEND_URI
public static final java.lang.String SIGNATURE_REQUEST_SEND_URI
- See Also:
- Constant Field Values
-
TEMPLATE_URI
public static final java.lang.String TEMPLATE_URI
- See Also:
- Constant Field Values
-
TEMPLATE_FILE_URI
public static final java.lang.String TEMPLATE_FILE_URI
- See Also:
- Constant Field Values
-
TEMPLATE_LIST_URI
public static final java.lang.String TEMPLATE_LIST_URI
- See Also:
- Constant Field Values
-
TEMPLATE_ADD_USER_URI
public static final java.lang.String TEMPLATE_ADD_USER_URI
- See Also:
- Constant Field Values
-
TEMPLATE_REMOVE_USER_URI
public static final java.lang.String TEMPLATE_REMOVE_USER_URI
- See Also:
- Constant Field Values
-
TEMPLATE_DELETE_URI
public static final java.lang.String TEMPLATE_DELETE_URI
- See Also:
- Constant Field Values
-
TEMPLATE_UPDATE_FILES_URI
public static final java.lang.String TEMPLATE_UPDATE_FILES_URI
- See Also:
- Constant Field Values
-
TEMPLATE_CREATE_EMBEDDED_DRAFT_URI
public static final java.lang.String TEMPLATE_CREATE_EMBEDDED_DRAFT_URI
- See Also:
- Constant Field Values
-
TEMPLATE_SIGNATURE_REQUEST_URI
public static final java.lang.String TEMPLATE_SIGNATURE_REQUEST_URI
- See Also:
- Constant Field Values
-
SIGNATURE_REQUEST_CANCEL_URI
public static final java.lang.String SIGNATURE_REQUEST_CANCEL_URI
- See Also:
- Constant Field Values
-
SIGNATURE_REQUEST_REMIND_URI
public static final java.lang.String SIGNATURE_REQUEST_REMIND_URI
- See Also:
- Constant Field Values
-
SIGNATURE_REQUEST_FINAL_COPY_URI
public static final java.lang.String SIGNATURE_REQUEST_FINAL_COPY_URI
- See Also:
- Constant Field Values
-
SIGNATURE_REQUEST_FILES_URI
public static final java.lang.String SIGNATURE_REQUEST_FILES_URI
- See Also:
- Constant Field Values
-
SIGNATURE_REQUEST_UPDATE_URI
public static final java.lang.String SIGNATURE_REQUEST_UPDATE_URI
- See Also:
- Constant Field Values
-
SIGNATURE_REQUEST_EMBEDDED_URI
public static final java.lang.String SIGNATURE_REQUEST_EMBEDDED_URI
- See Also:
- Constant Field Values
-
SIGNATURE_REQUEST_EMBEDDED_TEMPLATE_URI
public static final java.lang.String SIGNATURE_REQUEST_EMBEDDED_TEMPLATE_URI
- See Also:
- Constant Field Values
-
EMBEDDED_SIGN_URL_URI
public static final java.lang.String EMBEDDED_SIGN_URL_URI
- See Also:
- Constant Field Values
-
EMBEDDED_EDIT_URL_URI
public static final java.lang.String EMBEDDED_EDIT_URL_URI
- See Also:
- Constant Field Values
-
UNCLAIMED_DRAFT_CREATE_URI
public static final java.lang.String UNCLAIMED_DRAFT_CREATE_URI
- See Also:
- Constant Field Values
-
UNCLAIMED_DRAFT_CREATE_EMBEDDED_URI
public static final java.lang.String UNCLAIMED_DRAFT_CREATE_EMBEDDED_URI
- See Also:
- Constant Field Values
-
UNCLAIMED_DRAFT_CREATE_EMBEDDED_WITH_TEMPLATE_URI
public static final java.lang.String UNCLAIMED_DRAFT_CREATE_EMBEDDED_WITH_TEMPLATE_URI
- See Also:
- Constant Field Values
-
API_APP_URI
public static final java.lang.String API_APP_URI
- See Also:
- Constant Field Values
-
API_APP_LIST_URI
public static final java.lang.String API_APP_LIST_URI
- See Also:
- Constant Field Values
-
BULK_SEND_JOBS_LIST
public static final java.lang.String BULK_SEND_JOBS_LIST
- See Also:
- Constant Field Values
-
BULK_SEND_JOBS
public static final java.lang.String BULK_SEND_JOBS
- See Also:
- Constant Field Values
-
SIGNATURE_REQUEST_REMOVE_URI
public static final java.lang.String SIGNATURE_REQUEST_REMOVE_URI
- See Also:
- Constant Field Values
-
PARAM_FILE_TYPE_URI
public static final java.lang.String PARAM_FILE_TYPE_URI
- See Also:
- Constant Field Values
-
PARAM_GET_URL
public static final java.lang.String PARAM_GET_URL
- See Also:
- Constant Field Values
-
PARAM_QUERY
public static final java.lang.String PARAM_QUERY
- See Also:
- Constant Field Values
-
FINAL_COPY_FILE_NAME
public static final java.lang.String FINAL_COPY_FILE_NAME
- See Also:
- Constant Field Values
-
FINAL_COPY_FILE_EXT
public static final java.lang.String FINAL_COPY_FILE_EXT
- See Also:
- Constant Field Values
-
FILES_FILE_NAME
public static final java.lang.String FILES_FILE_NAME
- See Also:
- Constant Field Values
-
FILES_FILE_EXT
public static final java.lang.String FILES_FILE_EXT
- See Also:
- Constant Field Values
-
TEMPLATE_FILE_NAME
public static final java.lang.String TEMPLATE_FILE_NAME
- See Also:
- Constant Field Values
-
TEMPLATE_FILE_EXT
public static final java.lang.String TEMPLATE_FILE_EXT
- See Also:
- Constant Field Values
-
OAUTH_CODE
public static final java.lang.String OAUTH_CODE
- See Also:
- Constant Field Values
-
OAUTH_STATE
public static final java.lang.String OAUTH_STATE
- See Also:
- Constant Field Values
-
OAUTH_GRANT_TYPE
public static final java.lang.String OAUTH_GRANT_TYPE
- See Also:
- Constant Field Values
-
OAUTH_REFRESH_TOKEN
public static final java.lang.String OAUTH_REFRESH_TOKEN
- See Also:
- Constant Field Values
-
OAUTH_GRANT_TYPE_AUTHORIZE_CODE
public static final java.lang.String OAUTH_GRANT_TYPE_AUTHORIZE_CODE
- See Also:
- Constant Field Values
-
OAUTH_GRANT_TYPE_REFRESH_TOKEN
public static final java.lang.String OAUTH_GRANT_TYPE_REFRESH_TOKEN
- See Also:
- Constant Field Values
-
CLIENT_SECRET
public static final java.lang.String CLIENT_SECRET
- See Also:
- Constant Field Values
-
CLIENT_ID
public static final java.lang.String CLIENT_ID
- See Also:
- Constant Field Values
-
EMBEDDED_TEMPLATE_SKIP_SIGNER_ROLES
public static final java.lang.String EMBEDDED_TEMPLATE_SKIP_SIGNER_ROLES
- See Also:
- Constant Field Values
-
EMBEDDED_TEMPLATE_SKIP_SUBJECT_MESSAGE
public static final java.lang.String EMBEDDED_TEMPLATE_SKIP_SUBJECT_MESSAGE
- See Also:
- Constant Field Values
-
EMBEDDED_TEMPLATE_MERGE_FIELDS
public static final java.lang.String EMBEDDED_TEMPLATE_MERGE_FIELDS
- See Also:
- Constant Field Values
-
EMBEDDED_TEMPLATE_CC_ROLES
public static final java.lang.String EMBEDDED_TEMPLATE_CC_ROLES
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
HelloSignClient
protected HelloSignClient(HttpClient client, Authentication auth)
Default constructor for injection of dependencies (testing).- Parameters:
client
- HttpClientauth
- Authentication- See Also:
HelloSignClient(String)
-
HelloSignClient
public HelloSignClient(java.lang.String apiKey)
Creates a new HelloSign client using your API key.- Parameters:
apiKey
- String API key- See Also:
- Account Settings
-
HelloSignClient
public HelloSignClient(Authentication auth)
Creates a new HelloSign client using then given Authentication object.- Parameters:
auth
- Authentication used primarily for setting OAuth token/secret
-
-
Method Detail
-
setAuthentication
public void setAuthentication(Authentication auth)
Allows overriding of the authentication mechanism. Used mainly for setting an OAuth token/secret.- Parameters:
auth
- Authentication used for setting the auth method for this client
-
getAuth
protected Authentication getAuth()
Retrieves the authentication details being used by this client. Used for testing purposes.- Returns:
- Authentication
-
getAccount
public Account getAccount() throws HelloSignException
Returns the current user's account information.- Returns:
- Account
- Throws:
HelloSignException
- thrown if there's a problem processing the HTTP request or the JSON response.
-
isAccountValid
public boolean isAccountValid(java.lang.String email) throws HelloSignException
Returns true if an account exists with the provided email address. Note this is limited to the visibility of the currently authenticated user.- Parameters:
email
- String email address- Returns:
- true if the account exists, false otherwise
- Throws:
HelloSignException
- Thrown if there's a problem communicating with the HelloSign API.
-
setCallback
public Account setCallback(java.lang.String callback) throws HelloSignException
Update your account callback URL. This URL is used to notify you of any signature request events that occur when your account is a party -- e.g., sender or signer/recipient.- Parameters:
callback
- String URL- Returns:
- Account
- Throws:
HelloSignException
- thrown if there's a problem processing the HTTP request or the JSON response.
-
createAccount
public Account createAccount(java.lang.String email) throws HelloSignException
Creates a new HelloSign account. The user will still need to validate their email address to complete the creation process to set a password. Note: This request does not require authentication, so just performs the basic POST.- Parameters:
email
- String New user's email address- Returns:
- Account New user's account information
- Throws:
HelloSignException
- thrown if there's a problem processing the HTTP request or the JSON response.
-
createAccount
public Account createAccount(java.lang.String email, java.lang.String clientId, java.lang.String clientSecret) throws HelloSignException
Creates a new HelloSign account and provides OAuth app credentials to automatically generate an OAuth token with the user Account response.- Parameters:
email
- String New user's email addressclientId
- String Client IDclientSecret
- String App secret- Returns:
- Account New user's account information
- Throws:
HelloSignException
- thrown if there's a problem processing the HTTP request or the JSON response.
-
getOauthData
public OauthData getOauthData(java.lang.String code, java.lang.String clientId, java.lang.String secret, java.lang.String state, boolean autoSetRequestToken) throws HelloSignException
Performs an OAuth request and returns the necessary data for authorizing an API application, and will automatically set the access token and code for making authenticated requests with this client.- Parameters:
code
- String OAuth codeclientId
- String OAuth client IDsecret
- String OAuth secretstate
- String OAuth client stateautoSetRequestToken
- true if the token should be applied to this client for future requests- Returns:
- OauthData object containing OAuth token details
- Throws:
HelloSignException
- thrown if there's a problem processing the HTTP request or the JSON response.
-
refreshOauthData
public OauthData refreshOauthData(java.lang.String refreshToken) throws HelloSignException
Refreshes the OauthData for this client with the provided refresh token.- Parameters:
refreshToken
- String- Returns:
- OauthData new OAuthData returned from HelloSign
- Throws:
HelloSignException
- thrown if there's a problem processing the HTTP request or the JSON response.
-
getTeam
public Team getTeam() throws HelloSignException
Retrieves the Team for the current user account.- Returns:
- Team
- Throws:
HelloSignException
- thrown if there's a problem processing the HTTP request or the JSON response.
-
createTeam
public Team createTeam(java.lang.String teamName) throws HelloSignException
Creates a new team for the current user with the given name.- Parameters:
teamName
- String team name- Returns:
- Team
- Throws:
HelloSignException
- thrown if there's a problem processing the HTTP request or the JSON response.
-
destroyTeam
public boolean destroyTeam() throws HelloSignException
Destroys the current user's team.- Returns:
- boolean if destroy was successful
- Throws:
HelloSignException
- thrown if there's a problem processing the HTTP request or the JSON response.
-
updateTeamName
public Team updateTeamName(java.lang.String teamName) throws HelloSignException
Updates the current user's team name.- Parameters:
teamName
- String team name- Returns:
- Team
- Throws:
HelloSignException
- thrown if there's a problem processing the HTTP request or the JSON response.
-
inviteTeamMember
public Team inviteTeamMember(java.lang.String idOrEmail) throws HelloSignException
Adds the user to the current user's team.- Parameters:
idOrEmail
- String new team member's account ID or email address- Returns:
- Team
- Throws:
HelloSignException
- thrown if there's a problem processing the HTTP request or the JSON response.
-
removeTeamMember
public Team removeTeamMember(java.lang.String idOrEmail) throws HelloSignException
Removes the team member indicated by the user account ID or email address.- Parameters:
idOrEmail
- String removed team member's account ID or email address- Returns:
- Team
- Throws:
HelloSignException
- thrown if there's a problem processing the HTTP request or the JSON response.
-
getSignatureRequest
public SignatureRequest getSignatureRequest(java.lang.String id) throws HelloSignException
Retrieves a Signature Request with the given ID.- Parameters:
id
- String signature ID- Returns:
- SignatureRequest
- Throws:
HelloSignException
- thrown if there's a problem processing the HTTP request or the JSON response.
-
getSignatureRequests
public SignatureRequestList getSignatureRequests() throws HelloSignException
Retrieves the current user's signature requests. The resulting object represents a paged query result. The page information can be retrieved on from the ListInfo object on the SignatureRequestList.- Returns:
- SignatureRequestList
- Throws:
HelloSignException
- thrown if there's a problem processing the HTTP request or the JSON response.
-
getSignatureRequests
public SignatureRequestList getSignatureRequests(int page) throws HelloSignException
Retrieves a specific page of the current user's signature requests.- Parameters:
page
- int- Returns:
- SignatureRequestList
- Throws:
HelloSignException
- thrown if there's a problem processing the HTTP request or the JSON response.
-
getSignatureRequests
public SignatureRequestList getSignatureRequests(int page, int pageSize) throws HelloSignException
Retrieves a specific page of the current user's signature requests.- Parameters:
page
- intpageSize
- int Must be between 1 and 100.- Returns:
- SignatureRequestList
- Throws:
HelloSignException
- thrown if there's a problem processing the HTTP request or the JSON response.
-
getSignatureRequests
public SignatureRequestList getSignatureRequests(int page, int pageSize, java.lang.String query) throws HelloSignException
Retrieves a specific page of the current user's signature requests.- Parameters:
page
- intpageSize
- int Must be between 1 and 100.query
- String that includes search terms and/or fields to be used to filter the SignatureRequest objects.- Returns:
- SignatureRequestList
- Throws:
HelloSignException
- thrown if there's a problem processing the HTTP request or the JSON response.
-
sendSignatureRequest
public SignatureRequest sendSignatureRequest(SignatureRequest req) throws HelloSignException
Sends the provided signature request to HelloSign.- Parameters:
req
- SignatureRequest- Returns:
- SignatureRequest
- Throws:
HelloSignException
- thrown if there's a problem processing the HTTP request or the JSON response.
-
updateSignatureRequest
public SignatureRequest updateSignatureRequest(java.lang.String signatureRequestId, java.lang.String signatureId, java.lang.String newEmailAddress, java.lang.String newSignerName) throws HelloSignException
Update a signer's email address. This method requires the ID of the siganture request that has already been sent, as well as the signature_id that represents the signer that should be updated. The ema- Parameters:
signatureRequestId
- String ID of the signature request that has already been sent and needs to be updated.signatureId
- String ID of the signer that needs to be updated.newEmailAddress
- String email address that the signer should be changed to- Returns:
- SignatureRequest The updated request data
- Throws:
HelloSignException
- thrown if there's a problem processing the HTTP request or the JSON response.
-
getTemplates
public TemplateList getTemplates() throws HelloSignException
Retrieves the templates for the current user account.- Returns:
- TemplateList
- Throws:
HelloSignException
- thrown if there's a problem processing the HTTP request or the JSON response.
-
getTemplates
public TemplateList getTemplates(int page) throws HelloSignException
Retrieves a page of templates for the current user account.- Parameters:
page
- int- Returns:
- TemplateList
- Throws:
HelloSignException
- thrown if there's a problem processing the HTTP request or the JSON response.
-
getTemplates
public TemplateList getTemplates(int page, int pageSize) throws HelloSignException
Retrieves a page of templates with a specific pageSize- Parameters:
page
- intpageSize
- int Must be between 1 and 100.- Returns:
- TemplateList
- Throws:
HelloSignException
- thrown if there's a problem processing the HTTP request or the JSON response.
-
getTemplateFile
public java.io.File getTemplateFile(java.lang.String templateId) throws HelloSignException
Retrieves the PDF file backing the Template specified by the provided Template ID.- Parameters:
templateId
- String Template ID- Returns:
- File PDF file object
- Throws:
HelloSignException
- thrown if there's a problem processing the HTTP request or the JSON response.
-
getTemplateFileUrl
public java.lang.String getTemplateFileUrl(java.lang.String templateId) throws HelloSignException
Returns a signed URL that can be used to retrieve the file backing a template.- Parameters:
templateId
- String Template ID- Returns:
- String URL or null if no file URL can be retrieved
- Throws:
HelloSignException
- thrown if there's a problem processing the HTTP request or the JSON response.
-
getTemplate
public Template getTemplate(java.lang.String templateId) throws HelloSignException
Retrieves a specific Template based on the provided Template ID.- Parameters:
templateId
- String Template ID- Returns:
- Template
- Throws:
HelloSignException
- thrown if there's a problem processing the HTTP request or the JSON response.
-
addTemplateUser
public Template addTemplateUser(java.lang.String templateId, java.lang.String idOrEmail) throws HelloSignException
Adds the provided user to the template indicated by the provided template ID. The new user can be designated using their account ID or email address.- Parameters:
templateId
- String template IDidOrEmail
- String account ID or email address- Returns:
- Template
- Throws:
HelloSignException
- thrown if there's a problem processing the HTTP request or the JSON response.
-
deleteTemplate
public boolean deleteTemplate(java.lang.String templateId) throws HelloSignException
Delete the template designated by the template id- Parameters:
templateId
- String template ID- Returns:
- true if the delete was successful, false otherwise
- Throws:
HelloSignException
- thrown if there is a problem processing the HTTP request
-
updateTemplateFiles
public java.lang.String updateTemplateFiles(java.lang.String existingTemplateId, TemplateDraft newTemplate, java.lang.String clientId) throws HelloSignException
Replaces the backing documents for the given template with the given files. Note that certain rules apply to this endpoint: https://app.hellosign.com/api/reference#update_template_files- Parameters:
existingTemplateId
- String ID of the template from which the overlay data (signatures, text fields, etc.) will be retrieved.newTemplate
- TemplateDraft that holds the data and documents which will be used as the basis for the new template. The following fields can be set in this request: files or file_urls, subject, message, and test_mode.clientId
- String optional ID of the app which is generating this new template. Set to null if not used.- Returns:
- String ID of the template to be created
- Throws:
HelloSignException
- thrown if there is a problem processing the HTTP request
-
removeTemplateUser
public Template removeTemplateUser(java.lang.String templateId, java.lang.String idOrEmail) throws HelloSignException
Adds the provided user to the template indicated by the provided template ID. The new user can be designated using their account ID or email address.- Parameters:
templateId
- String template IDidOrEmail
- String account ID or email address- Returns:
- Template
- Throws:
HelloSignException
- thrown if there's a problem processing the HTTP request or the JSON response.
-
sendTemplateSignatureRequest
public SignatureRequest sendTemplateSignatureRequest(TemplateSignatureRequest req) throws HelloSignException
Creates a new Signature Request based on the template provided.- Parameters:
req
- TemplateSignatureRequest- Returns:
- SignatureRequest
- Throws:
HelloSignException
- thrown if there's a problem processing the HTTP request or the JSON response.
-
cancelSignatureRequest
public boolean cancelSignatureRequest(java.lang.String id) throws HelloSignException
Cancels an existing signature request. If it has been completed, it will delete the signature request from your account.- Parameters:
id
- SignatureRequest id- Returns:
- boolean true if successful
- Throws:
HelloSignException
- thrown if there's a problem processing the HTTP request or the JSON response.
-
requestEmailReminder
public SignatureRequest requestEmailReminder(java.lang.String requestId, java.lang.String email) throws HelloSignException
Instructs HelloSign to email the given address with a reminder to sign the SignatureRequest referenced by the given request ID. Note: You cannot send a reminder within 1 hours of the last reminder that was sent, manually or automatically.- Parameters:
requestId
- String SignatureRequest IDemail
- String email- Returns:
- SignatureRequest The request to be reminded
- Throws:
HelloSignException
- thrown if there's a problem processing the HTTP request or the JSON response.
-
getFinalCopy
@Deprecated public java.io.File getFinalCopy(java.lang.String requestId) throws HelloSignException
Deprecated.Use {getFiles(String)
Retrieves the final PDF copy of a signature request, if it exists.- Parameters:
requestId
- String SignatureRequest ID- Returns:
- File final copy file, or null if it does not yet exist
- Throws:
HelloSignException
- thrown if there's a problem processing the HTTP request or the JSON response.
-
getFiles
public java.io.File getFiles(java.lang.String requestId) throws HelloSignException
Retrieves a PDF copy of the files associated with a signature request.- Parameters:
requestId
- String signature ID- Returns:
- File PDF file
- Throws:
HelloSignException
- thrown if there's a problem processing the HTTP request or the JSON response.
-
getFiles
public java.io.File getFiles(java.lang.String requestId, java.lang.String format) throws HelloSignException
Retrieves the file associated with a signature request.- Parameters:
requestId
- String signature request IDformat
- String format, see SignatureRequest for available types- Returns:
- File
- Throws:
HelloSignException
- thrown if there's a problem processing the HTTP request or the JSON response.
-
getFilesUrl
public FileUrlResponse getFilesUrl(java.lang.String requestId) throws HelloSignException
Retrieves a URL for a file associated with a signature request.- Parameters:
requestId
- String signature request ID- Returns:
FileUrlResponse
- Throws:
HelloSignException
- thrown if there's a problem processing the HTTP request or the JSON response.- See Also:
- https://app.hellosign.com/api/reference#get_files
-
createEmbeddedRequest
public AbstractRequest createEmbeddedRequest(EmbeddedRequest embeddedReq) throws HelloSignException
Creates a signature request that can be embedded within your website.- Parameters:
embeddedReq
- EmbeddedRequest- Returns:
- SignatureRequest
- Throws:
HelloSignException
- thrown if there's a problem processing the HTTP request or the JSON response.
-
getEmbeddedSignUrl
public EmbeddedResponse getEmbeddedSignUrl(java.lang.String signatureId) throws HelloSignException
Retrieves the necessary information to build an embedded signature request.- Parameters:
signatureId
- String ID of the signature request to embed- Returns:
- EmbeddedResponse
- Throws:
HelloSignException
- thrown if there's a problem processing the HTTP request or the JSON response.
-
getEmbeddedTemplateEditUrl
public EmbeddedResponse getEmbeddedTemplateEditUrl(java.lang.String templateId) throws HelloSignException
Retrieves the necessary information to edit an embedded template.- Parameters:
templateId
- String ID of the signature request to embed- Returns:
- EmbeddedResponse
- Throws:
HelloSignException
- thrown if there's a problem processing the HTTP request or the JSON response.
-
getEmbeddedTemplateEditUrl
public EmbeddedResponse getEmbeddedTemplateEditUrl(java.lang.String templateId, boolean skipSignerRoles, boolean skipSubjectMessage) throws HelloSignException
Retrieves the necessary information to edit an embedded template.- Parameters:
templateId
- String ID of the signature request to embedskipSignerRoles
- true if the edited template should not allow the user to modify the template's signer roles. Defaults to false.skipSubjectMessage
- true if the edited template should not allow the user to modify the template's subject and message. Defaults to false.- Returns:
- EmbeddedResponse
- Throws:
HelloSignException
- thrown if there's a problem processing the HTTP request or the JSON response.
-
getEmbeddedTemplateEditUrl
public EmbeddedResponse getEmbeddedTemplateEditUrl(java.lang.String templateId, boolean skipSignerRoles, boolean skipSubjectMessage, boolean testMode) throws HelloSignException
Retrieves the necessary information to edit an embedded template.- Parameters:
templateId
- String ID of the signature request to embedskipSignerRoles
- true if the edited template should not allow the user to modify the template's signer roles. Defaults to false.skipSubjectMessage
- true if the edited template should not allow the user to modify the template's subject and message. Defaults to false.testMode
- true if this request is a test request. Useful for editing locked templates.- Returns:
- EmbeddedResponse
- Throws:
HelloSignException
- thrown if there's a problem processing the HTTP request or the JSON response.
-
getEmbeddedTemplateEditUrl
public EmbeddedResponse getEmbeddedTemplateEditUrl(java.lang.String templateId, boolean skipSignerRoles, boolean skipSubjectMessage, boolean testMode, java.util.Map<java.lang.String,FieldType> mergeFields, java.util.List<java.lang.String> ccRoles) throws HelloSignException
Big kahuna method for editing an embedded template. This method allows the updating of merge fields and CC roles (both optional parameters).- Parameters:
templateId
- String ID of the signature request to embedskipSignerRoles
- true if the edited template should not allow the user to modify the template's signer roles. Defaults to false.skipSubjectMessage
- true if the edited template should not allow the user to modify the template's subject and message. Defaults to false.testMode
- true if this request is a test request. Useful for editing locked templates.mergeFields
- These will overwrite the current merge fields for the embedded template. To remove all merge fields, pass in an empty Map.ccRoles
- These will overwrite the current CC Roles for the embedded template. To remove all CC roles, pass in null or an empty List.- Returns:
- EmbeddedResponse
- Throws:
HelloSignException
- thrown if there's a problem processing the HTTP request or the JSON response.
-
createUnclaimedDraft
public UnclaimedDraft createUnclaimedDraft(UnclaimedDraft draft) throws HelloSignException
Creates an unclaimed draft using the provided request draft object.- Parameters:
draft
- UnclaimedDraft- Returns:
- UnclaimedDraft The created draft
- Throws:
HelloSignException
- thrown if there's a problem processing the HTTP request or the JSON response.
-
createEmbeddedTemplateDraft
public TemplateDraft createEmbeddedTemplateDraft(EmbeddedRequest req) throws HelloSignException
Creates a template draft that can be used for embedded template creation.- Parameters:
req
- EmbeddedRequest- Returns:
- Template the unclaimed template draft
- Throws:
HelloSignException
- thrown if there's a problem processing the HTTP request or the JSON response.
-
getApiApp
public ApiApp getApiApp(java.lang.String clientId) throws HelloSignException
Retrieves the API app configuration for the given Client ID.- Parameters:
clientId
- String- Returns:
- ApiApp
- Throws:
HelloSignException
- thrown if there's a problem processing the HTTP request or the JSON response.
-
getApiApps
public ApiAppList getApiApps() throws HelloSignException
Retrieves a paged list of API apps for the authenticated account.- Returns:
- ApiAppList
- Throws:
HelloSignException
- thrown if there's a problem processing the HTTP request or the JSON response.
-
createApiApp
public ApiApp createApiApp(ApiApp app) throws HelloSignException
Creates a new ApiApp using the properties set on the provided ApiApp.- Parameters:
app
- ApiApp- Returns:
- ApiApp newly created ApiApp
- Throws:
HelloSignException
- thrown if there's a problem processing the HTTP request or the JSON response.
-
deleteApiApp
public boolean deleteApiApp(java.lang.String clientId) throws HelloSignException
Attempts to delete the API app with the given client ID.- Parameters:
clientId
- String The Client ID of the app that should be deleted.- Returns:
- boolean true if the API app was successfully deleted
- Throws:
HelloSignException
- thrown if there's a problem processing the HTTP request or the JSON response.
-
updateApiApp
public ApiApp updateApiApp(ApiApp app) throws HelloSignException
Updates the API app with the given ApiApp object properties.- Parameters:
app
- ApiApp- Returns:
- ApiApp updated ApiApp
- Throws:
HelloSignException
- thrown if there's a problem processing the HTTP request or the JSON response.
-
setAccessToken
public void setAccessToken(java.lang.String accessToken, java.lang.String tokenType) throws HelloSignException
Sets the access token for the OAuth user that this client will use to perform requests.- Parameters:
accessToken
- String access tokentokenType
- String token type- Throws:
HelloSignException
- thrown if there's a problem setting the access token.
-
getBulkSendJobList
public BulkSendJobsList getBulkSendJobList() throws HelloSignException
Returns a list of BulkSendJob that you can access.- Returns:
- bulkSendJobsList
- Throws:
HelloSignException
- thrown if there's a problem processing the HTTP request or the JSON response.
-
getBulkSendJobList
public BulkSendJobsList getBulkSendJobList(int page) throws HelloSignException
Retrieves a specific page number of the BulkSendJob List.- Parameters:
page
- int- Returns:
- BulkSendJobsList
- Throws:
HelloSignException
- thrown if there's a problem processing the HTTP request or the JSON response.
-
getBulkSendJobList
public BulkSendJobsList getBulkSendJobList(int page, int pageSize) throws HelloSignException
Retrieves a specific page number of the BulkSendJob List, with Number of objects to be returned per page. Must be between 1 and 100. Default is 20.- Parameters:
page
- intpageSize
- int Must be between 1 and 100.- Returns:
- BulkSendJobsList
- Throws:
HelloSignException
- thrown if there's a problem processing the HTTP request or the JSON response.
-
getBulkSendByJobId
public BulkSendJobById getBulkSendByJobId(java.lang.String bulk_send_job_id) throws HelloSignException
Returns the status of the BulkSendJob and its SignatureRequests specified by the bulk_send_job_id parameter.- Parameters:
bulk_send_job_id
-- Returns:
- Throws:
HelloSignException
-
removeSignatureRequestAccess
public boolean removeSignatureRequestAccess(java.lang.String signature_request_id) throws HelloSignException
Removes your access to a completed signature request. This action is not reversible. The signature request must be fully executed by all parties (signed or declined to sign). Other parties will continue to maintain access to the completed signature request document(s).- Parameters:
signature_request_id
- SignatureRequest id- Returns:
- boolean true if successful
- Throws:
HelloSignException
- thrown if there's a problem processing the HTTP request or the JSON response.
-
-