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 |
static String |
TEMPLATE_FILE_EXT |
static String |
TEMPLATE_FILE_NAME |
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) |
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(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(String clientId)
Attempts to delete the API app with the given client ID.
|
boolean |
deleteTemplate(String templateId) |
int |
destroyTeam()
Destroys the current user's team.
|
Account |
getAccount()
Returns the current user's account information.
|
ApiApp |
getApiApp(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.
|
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.
|
EmbeddedResponse |
getEmbeddedTemplateEditUrl(String templateId,
boolean skipSignerRoles,
boolean skipSubjectMessage)
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.
|
File |
getTemplateFile(String templateId)
Retrieves the PDF file backing the Template specified by
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.
|
ApiApp |
updateApiApp(ApiApp app)
Updates the API app with the given ApiApp object properties.
|
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 TEMPLATE_FILE_NAME
public static final String TEMPLATE_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 passwordHelloSignException
- thrown if there is a problem setting
the credentialspublic HelloSignClient(Authentication auth) throws HelloSignException
auth
- HelloSignAuthenticationHelloSignException
- thrown if the HelloSignAuthentication
parameters are invalid or nullpublic Account getAccount() throws HelloSignException
HelloSignException
- thrown if there's a problem processing
the HTTP request or the JSON response.public boolean isAccountValid(String email) throws HelloSignException
email
- String email addressHelloSignException
- thrown if there's a problem processing
the HTTP request or the JSON response.public Account setCallback(String callback) throws HelloSignException
callback
- String URLHelloSignException
- thrown if there's a problem processing
the HTTP request or the JSON response.public Account createAccount(String email) throws HelloSignException
email
- String New user's email addressHelloSignException
- thrown if there's a problem processing
the HTTP request or the JSON response.public Account createAccount(String email, String password) throws HelloSignException
createAccount(String)
email
- String New user's email addresspassword
- String New user's passwordHelloSignException
- thrown if there's a problem processing
the HTTP request or the JSON response.public Account createAccount(String email, String clientId, String clientSecret) throws HelloSignException
email
- String New user's email addressclientId
- String Client IDclientSecret
- String App secretHelloSignException
- thrown if there's a problem processing
the HTTP request or the JSON response.public 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 secretHelloSignException
- thrown if there's a problem processing
the HTTP request or the JSON response.public OauthData getOauthData(String code, String clientId, String secret) throws HelloSignException
code
- String OAuth codeclientId
- String OAuth client IDsecret
- String OAuth secretHelloSignException
- thrown if there's a problem processing
the HTTP request or the JSON response.public 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 clientHelloSignException
- thrown if there's a problem processing
the HTTP request or the JSON response.public OauthData refreshOauthData(String refreshToken) throws HelloSignException
refreshToken
- StringHelloSignException
- thrown if there's a problem processing
the HTTP request or the JSON response.public Team getTeam() throws HelloSignException
HelloSignException
- thrown if there's a problem processing
the HTTP request or the JSON response.public Team createTeam(String teamName) throws HelloSignException
teamName
- String team nameHelloSignException
- thrown if there's a problem processing
the HTTP request or the JSON response.public int destroyTeam() throws HelloSignException
HelloSignException
- thrown if there's a problem processing
the HTTP request or the JSON response.public Team updateTeamName(String teamName) throws HelloSignException
teamName
- String team nameHelloSignException
- thrown if there's a problem processing
the HTTP request or the JSON response.public Team inviteTeamMember(String idOrEmail) throws HelloSignException
idOrEmail
- String new team member's account ID or email addressHelloSignException
- thrown if there's a problem processing
the HTTP request or the JSON response.public Team removeTeamMember(String idOrEmail) throws HelloSignException
idOrEmail
- String removed team member's account ID or email addressHelloSignException
- thrown if there's a problem processing
the HTTP request or the JSON response.public SignatureRequest getSignatureRequest(String id) throws HelloSignException
id
- String signature IDHelloSignException
- thrown if there's a problem processing
the HTTP request or the JSON response.public SignatureRequestList getSignatureRequests() throws HelloSignException
HelloSignException
- thrown if there's a problem processing
the HTTP request or the JSON response.public SignatureRequestList getSignatureRequests(int page) throws HelloSignException
page
- intHelloSignException
- thrown if there's a problem processing
the HTTP request or the JSON response.public SignatureRequest sendSignatureRequest(SignatureRequest req) throws HelloSignException
req
- SignatureRequestHelloSignException
- thrown if there's a problem processing
the HTTP request or the JSON response.public TemplateList getTemplates() throws HelloSignException
HelloSignException
- thrown if there's a problem processing
the HTTP request or the JSON response.public TemplateList getTemplates(int page) throws HelloSignException
page
- intHelloSignException
- thrown if there's a problem processing
the HTTP request or the JSON response.public File getTemplateFile(String templateId) throws HelloSignException
templateId
- String Template IDHelloSignException
- thrown if there's a problem processing
the HTTP request or the JSON response.public Template getTemplate(String templateId) throws HelloSignException
templateId
- String Template IDHelloSignException
- thrown if there's a problem processing
the HTTP request or the JSON response.public Template addTemplateUser(String templateId, String idOrEmail) throws HelloSignException
templateId
- String template IDidOrEmail
- String account ID or email addressHelloSignException
- thrown if there's a problem processing
the HTTP request or the JSON response.public boolean deleteTemplate(String templateId) throws HelloSignException
HelloSignException
public Template removeTemplateUser(String templateId, String idOrEmail) throws HelloSignException
templateId
- String template IDidOrEmail
- String account ID or email addressHelloSignException
- thrown if there's a problem processing
the HTTP request or the JSON response.public SignatureRequest sendTemplateSignatureRequest(TemplateSignatureRequest req) throws HelloSignException
req
- TemplateSignatureRequestHelloSignException
- thrown if there's a problem processing
the HTTP request or the JSON response.public int cancelSignatureRequest(String id) throws HelloSignException
id
- SignatureRequest idHelloSignException
- thrown if there's a problem processing
the HTTP request or the JSON response.public SignatureRequest requestEmailReminder(String requestId, String email) throws HelloSignException
requestId
- String SignatureRequest IDemail
- String emailHelloSignException
- thrown if there's a problem processing
the HTTP request or the JSON response.public File getFinalCopy(String requestId) throws HelloSignException
requestId
- String SignatureRequest IDHelloSignException
- thrown if there's a problem processing
the HTTP request or the JSON response.public File getFiles(String requestId) throws HelloSignException
requestId
- String signature IDHelloSignException
- thrown if there's a problem processing
the HTTP request or the JSON response.public File getFiles(String requestId, String format) throws HelloSignException
requestId
- String signature IDformat
- String format, see SignatureRequest for available typesHelloSignException
- thrown if there's a problem processing
the HTTP request or the JSON response.public AbstractRequest createEmbeddedRequest(EmbeddedRequest embeddedReq) throws HelloSignException
embeddedReq
- EmbeddedRequestHelloSignException
- thrown if there's a problem processing
the HTTP request or the JSON response.public EmbeddedResponse getEmbeddedSignUrl(String signatureId) throws HelloSignException
signatureId
- String ID of the signature request to embedHelloSignException
- thrown if there's a problem processing
the HTTP request or the JSON response.public EmbeddedResponse getEmbeddedTemplateEditUrl(String templateId) throws HelloSignException
templateId
- String ID of the signature request to embedHelloSignException
- thrown if there's a problem processing
the HTTP request or the JSON response.public EmbeddedResponse getEmbeddedTemplateEditUrl(String templateId, boolean skipSignerRoles, boolean skipSubjectMessage) throws HelloSignException
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.HelloSignException
- thrown if there's a problem processing
the HTTP request or the JSON response.public UnclaimedDraft createUnclaimedDraft(UnclaimedDraft draft) throws HelloSignException
draft
- UnclaimedDraftHelloSignException
- thrown if there's a problem processing
the HTTP request or the JSON response.public TemplateDraft createEmbeddedTemplateDraft(EmbeddedRequest req) throws HelloSignException
req
- EmbeddedRequestHelloSignException
- thrown if there's a problem processing
the HTTP request or the JSON response.public ApiApp getApiApp(String clientId) throws HelloSignException
clientId
- StringHelloSignException
- thrown if there's a problem processing
the HTTP request or the JSON response.public ApiAppList getApiApps() throws HelloSignException
HelloSignException
- thrown if there's a problem processing
the HTTP request or the JSON response.public ApiApp createApiApp(ApiApp app) throws HelloSignException
app
- ApiAppHelloSignException
- thrown if there's a problem processing
the HTTP request or the JSON response.public boolean deleteApiApp(String clientId) throws HelloSignException
clientId
- String The Client ID of the app that should be deleted.HelloSignException
- thrown if there's a problem processing
the HTTP request or the JSON response.public ApiApp updateApiApp(ApiApp app) throws HelloSignException
app
- ApiAppHelloSignException
- thrown if there's a problem processing
the HTTP request or the JSON response.public boolean isOnline()
public void setAccessToken(String accessToken, String tokenType) throws HelloSignException
accessToken
- String access tokentokenType
- String token typeHelloSignException
- thrown if there's a problem setting the access token.public String getApiUrl()
public String getSignatureRequestUrl()
public String getSignatureRequestSendUrl()
public String getSignatureRequestCancelUrl()
public String getTemplateSignatureRequestUrl()
Copyright © 2016 HelloSign. All rights reserved.