public class HelloSignClient extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
CLIENT_ID |
static String |
CLIENT_SECRET |
static String |
DEFAULT_ENCODING |
static String |
FILES_FILE_EXT |
static String |
FILES_FILE_NAME |
static String |
FINAL_COPY_FILE_EXT |
static String |
FINAL_COPY_FILE_NAME |
static String |
OAUTH_CODE |
static String |
OAUTH_GRANT_TYPE |
static String |
OAUTH_GRANT_TYPE_AUTHORIZE_CODE |
static String |
OAUTH_GRANT_TYPE_REFRESH_TOKEN |
static String |
OAUTH_REFRESH_TOKEN |
static String |
OAUTH_STATE |
| Constructor and Description |
|---|
HelloSignClient(Authentication auth)
Create a client with the provided authentication object.
|
HelloSignClient(String apiKey)
Creates a new HelloSign client using your API key.
|
HelloSignClient(String email,
String password)
Creates a new HelloSign client using your website account's
email address and password.
|
| Modifier and Type | Method and Description |
|---|---|
Template |
addTemplateUser(String templateId,
String idOrEmail)
Adds the provided user to the template indicated by the provided template ID.
|
int |
cancelSignatureRequest(String id)
Cancels an existing signature request.
|
Account |
createAccount(String email)
Creates a new HelloSign account.
|
Account |
createAccount(String email,
String password)
Deprecated.
as of 3.1.1, replaced by
createAccount(String) |
Account |
createAccount(String email,
String clientId,
String clientSecret)
Creates a new HelloSign account and provides OAuth app credentials to automatically
generate an OAuth token with the user Account response.
|
Account |
createAccount(String email,
String password,
String clientId,
String clientSecret)
Deprecated.
as of 3.1.1, replaced by
createAccount(String, String, String) |
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(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 |
deleteTemplate(String templateId) |
int |
destroyTeam()
Destroys the current user's team.
|
Account |
getAccount()
Returns the current user's account information.
|
String |
getApiUrl() |
EmbeddedResponse |
getEmbeddedSignUrl(String signatureId)
Retrieves the necessary information to build an embedded signature
request.
|
EmbeddedResponse |
getEmbeddedTemplateEditUrl(String templateId)
Retrieves the necessary information to edit an embedded template.
|
File |
getFiles(String requestId)
Retrieves a PDF copy of the files associated with a signature request.
|
File |
getFiles(String requestId,
String format)
Retrieves the file associated with a signature request.
|
File |
getFinalCopy(String requestId)
Deprecated.
Use getFiles(requestId)
|
OauthData |
getOauthData(String code,
String clientId,
String secret)
Performs an OAuth request and returns the necessary data for authorizing an API
application.
|
OauthData |
getOauthData(String code,
String clientId,
String secret,
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(String id)
Retrieves a Signature Request with the given ID.
|
String |
getSignatureRequestCancelUrl() |
SignatureRequestList |
getSignatureRequests()
Retrieves the current user's signature requests.
|
SignatureRequestList |
getSignatureRequests(int page)
Retrieves a specific page of the current user's signature requests.
|
String |
getSignatureRequestSendUrl() |
String |
getSignatureRequestUrl() |
Team |
getTeam()
Retrieves the Team for the current user account.
|
Template |
getTemplate(String templateId)
Retrieves a specific Template based on the provided Template ID.
|
TemplateList |
getTemplates()
Retrieves the templates for the current user account.
|
TemplateList |
getTemplates(int page)
Retreives a page of templates for the current user account.
|
String |
getTemplateSignatureRequestUrl() |
Team |
inviteTeamMember(String idOrEmail)
Adds the user to the current user's team.
|
boolean |
isAccountValid(String email)
Returns true if an account exists with the provided email address.
|
boolean |
isOnline()
Performs a simple call to the HelloSign API to see if it's available
with the given credentials.
|
OauthData |
refreshOauthData(String refreshToken)
Refreshes the OauthData for this client with the provided refresh
token.
|
Team |
removeTeamMember(String idOrEmail)
Removes the team member indicated by the user account ID or email address.
|
Template |
removeTemplateUser(String templateId,
String idOrEmail)
Adds the provided user to the template indicated by the provided template ID.
|
SignatureRequest |
requestEmailReminder(String requestId,
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(String accessToken,
String tokenType)
Sets the access token for the OAuth user that this client will use to
perform requests.
|
Account |
setCallback(String callback)
Updates the current user's callback URL.
|
Team |
updateTeamName(String teamName)
Updates the current user's team name.
|
public static final String DEFAULT_ENCODING
public static final String FINAL_COPY_FILE_NAME
public static final String FINAL_COPY_FILE_EXT
public static final String FILES_FILE_NAME
public static final String FILES_FILE_EXT
public static final String OAUTH_CODE
public static final String OAUTH_STATE
public static final String OAUTH_GRANT_TYPE
public static final String OAUTH_REFRESH_TOKEN
public static final String OAUTH_GRANT_TYPE_AUTHORIZE_CODE
public static final String OAUTH_GRANT_TYPE_REFRESH_TOKEN
public static final String CLIENT_SECRET
public static final String CLIENT_ID
public HelloSignClient(String apiKey)
apiKey - String API keypublic HelloSignClient(String email, String password) throws HelloSignException
email - String emailpassword - String passwordHelloSignExceptionpublic HelloSignClient(Authentication auth) throws HelloSignException
auth - HelloSignAuthenticationHelloSignException - thrown if the HelloSignAuthentication
parameters are invalid or nullpublic Account getAccount() throws HelloSignException
HelloSignExceptionpublic boolean isAccountValid(String email) throws HelloSignException
email - String email addressHelloSignExceptionpublic Account setCallback(String callback) throws HelloSignException
callback - String URLHelloSignExceptionpublic Account createAccount(String email) throws HelloSignException
email - String New user's email addressHelloSignExceptionpublic Account createAccount(String email, String password) throws HelloSignException
createAccount(String)email - String New user's email addresspassword - String New user's passwordHelloSignExceptionpublic Account createAccount(String email, String clientId, String clientSecret) throws HelloSignException
email - String New user's email addressclientId - String Client IDclientSecret - String App secretHelloSignExceptionpublic Account createAccount(String email, String password, String clientId, String clientSecret) throws HelloSignException
createAccount(String, String, String)email - String New user's email addresspassword - String New user's password (NOTE: WILL BE IGNORED BY THE API)clientId - String Client IDclientSecret - String App secretHelloSignExceptionpublic OauthData getOauthData(String code, String clientId, String secret) throws HelloSignException
code - String OAuth codeclientId - String OAuth client IDsecret - String OAuth secretHelloSignExceptionpublic OauthData getOauthData(String code, String clientId, String secret, boolean autoSetRequestToken) throws HelloSignException
code - String OAuth codeclientId - String OAuth client IDsecret - String OAuth secretautoSetRequestToken - true if the token should be immediately applied to
this clientHelloSignExceptionpublic OauthData refreshOauthData(String refreshToken) throws HelloSignException
refreshToken - StringHelloSignExceptionpublic Team getTeam() throws HelloSignException
HelloSignExceptionpublic Team createTeam(String teamName) throws HelloSignException
teamName - String team nameHelloSignExceptionpublic int destroyTeam()
throws HelloSignException
HelloSignExceptionpublic Team updateTeamName(String teamName) throws HelloSignException
teamName - String team nameHelloSignExceptionpublic Team inviteTeamMember(String idOrEmail) throws HelloSignException
idOrEmail - String new team member's account ID or email addressHelloSignExceptionpublic Team removeTeamMember(String idOrEmail) throws HelloSignException
idOrEmail - String removed team member's account ID or email addressHelloSignExceptionpublic SignatureRequest getSignatureRequest(String id) throws HelloSignException
id - String signature IDHelloSignExceptionpublic SignatureRequestList getSignatureRequests() throws HelloSignException
HelloSignExceptionpublic SignatureRequestList getSignatureRequests(int page) throws HelloSignException
page - intHelloSignExceptionpublic SignatureRequest sendSignatureRequest(SignatureRequest req) throws HelloSignException
req - SignatureRequestHelloSignExceptionpublic TemplateList getTemplates() throws HelloSignException
HelloSignExceptionpublic TemplateList getTemplates(int page) throws HelloSignException
page - intHelloSignExceptionpublic Template getTemplate(String templateId) throws HelloSignException
templateId - String Template IDHelloSignExceptionpublic Template addTemplateUser(String templateId, String idOrEmail) throws HelloSignException
templateId - String template IDidOrEmail - String account ID or email addressHelloSignExceptionpublic boolean deleteTemplate(String templateId) throws HelloSignException
HelloSignExceptionpublic Template removeTemplateUser(String templateId, String idOrEmail) throws HelloSignException
templateId - String template IDidOrEmail - String account ID or email addressHelloSignExceptionpublic SignatureRequest sendTemplateSignatureRequest(TemplateSignatureRequest req) throws HelloSignException
req - TemplateSignatureRequestHelloSignExceptionpublic int cancelSignatureRequest(String id) throws HelloSignException
id - SignatureRequest idHelloSignExceptionpublic SignatureRequest requestEmailReminder(String requestId, String email) throws HelloSignException
requestId - String SignatureRequest IDemail - String emailHelloSignExceptionpublic File getFinalCopy(String requestId) throws HelloSignException
requestId - String SignatureRequest IDHelloSignExceptionpublic File getFiles(String requestId) throws HelloSignException
requestId - String signature IDHelloSignExceptionpublic File getFiles(String requestId, String format) throws HelloSignException
requestId - String signature IDformat - String format, see SignatureRequest for available typesHelloSignExceptionpublic AbstractRequest createEmbeddedRequest(EmbeddedRequest embeddedReq) throws HelloSignException
embeddedReq - EmbeddedRequestHelloSignExceptionpublic EmbeddedResponse getEmbeddedSignUrl(String signatureId) throws HelloSignException
signatureId - String ID of the signature request to embedHelloSignExceptionpublic EmbeddedResponse getEmbeddedTemplateEditUrl(String templateId) throws HelloSignException
templateId - String ID of the signature request to embedHelloSignExceptionpublic UnclaimedDraft createUnclaimedDraft(UnclaimedDraft draft) throws HelloSignException
draft - UnclaimedDraftHelloSignExceptionpublic TemplateDraft createEmbeddedTemplateDraft(EmbeddedRequest req) throws HelloSignException
req - EmbeddedRequestHelloSignExceptionpublic boolean isOnline()
public void setAccessToken(String accessToken, String tokenType) throws HelloSignException
accessToken - String access tokentokenType - String token typeHelloSignExceptionpublic String getApiUrl()
public String getSignatureRequestUrl()
public String getSignatureRequestSendUrl()
public String getSignatureRequestCancelUrl()
public String getTemplateSignatureRequestUrl()
Copyright © 2015 HelloSign. All rights reserved.