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,
String password)
Creates a new HelloSign account.
|
Account |
createAccount(String email,
String password,
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.
|
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 passwordHelloSignException
public HelloSignClient(Authentication auth) throws HelloSignException
auth
- HelloSignAuthenticationHelloSignException
- thrown if the HelloSignAuthentication
parameters are invalid or nullpublic Account getAccount() throws HelloSignException
HelloSignException
public boolean isAccountValid(String email) throws HelloSignException
email
- String email addressHelloSignException
public Account setCallback(String callback) throws HelloSignException
callback
- String URLHelloSignException
public Account createAccount(String email, String password) throws HelloSignException
email
- String New user's email addresspassword
- String New user's passwordHelloSignException
public Account createAccount(String email, String password, String clientId, String clientSecret) throws HelloSignException
email
- String New user's email addresspassword
- String New user's passwordclientId
- String Client IDclientSecret
- String App secretHelloSignException
public OauthData getOauthData(String code, String clientId, String secret) throws HelloSignException
code
- String OAuth codeclientId
- String OAuth client IDsecret
- String OAuth secretHelloSignException
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
public OauthData refreshOauthData(String refreshToken) throws HelloSignException
refreshToken
- StringHelloSignException
public Team getTeam() throws HelloSignException
HelloSignException
public Team createTeam(String teamName) throws HelloSignException
teamName
- String team nameHelloSignException
public int destroyTeam() throws HelloSignException
HelloSignException
public Team updateTeamName(String teamName) throws HelloSignException
teamName
- String team nameHelloSignException
public Team inviteTeamMember(String idOrEmail) throws HelloSignException
idOrEmail
- String new team member's account ID or email addressHelloSignException
public Team removeTeamMember(String idOrEmail) throws HelloSignException
idOrEmail
- String removed team member's account ID or email addressHelloSignException
public SignatureRequest getSignatureRequest(String id) throws HelloSignException
id
- String signature IDHelloSignException
public SignatureRequestList getSignatureRequests() throws HelloSignException
HelloSignException
public SignatureRequestList getSignatureRequests(int page) throws HelloSignException
page
- intHelloSignException
public SignatureRequest sendSignatureRequest(SignatureRequest req) throws HelloSignException
req
- SignatureRequestHelloSignException
public TemplateList getTemplates() throws HelloSignException
HelloSignException
public TemplateList getTemplates(int page) throws HelloSignException
page
- intHelloSignException
public Template getTemplate(String templateId) throws HelloSignException
templateId
- String Template IDHelloSignException
public Template addTemplateUser(String templateId, String idOrEmail) throws HelloSignException
templateId
- String template IDidOrEmail
- String account ID or email addressHelloSignException
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
public SignatureRequest sendTemplateSignatureRequest(TemplateSignatureRequest req) throws HelloSignException
req
- TemplateSignatureRequestHelloSignException
public int cancelSignatureRequest(String id) throws HelloSignException
id
- SignatureRequest idHelloSignException
public SignatureRequest requestEmailReminder(String requestId, String email) throws HelloSignException
requestId
- String SignatureRequest IDemail
- String emailHelloSignException
public File getFinalCopy(String requestId) throws HelloSignException
requestId
- String SignatureRequest IDHelloSignException
public File getFiles(String requestId) throws HelloSignException
requestId
- String signature IDHelloSignException
public File getFiles(String requestId, String format) throws HelloSignException
requestId
- String signature IDformat
- String format, see SignatureRequest for available typesHelloSignException
public AbstractRequest createEmbeddedRequest(EmbeddedRequest embeddedReq) throws HelloSignException
embeddedReq
- EmbeddedRequestHelloSignException
public EmbeddedResponse getEmbeddedSignUrl(String signatureId) throws HelloSignException
signatureId
- String ID of the signature request to embedHelloSignException
public EmbeddedResponse getEmbeddedTemplateEditUrl(String templateId) throws HelloSignException
templateId
- String ID of the signature request to embedHelloSignException
public UnclaimedDraft createUnclaimedDraft(UnclaimedDraft draft) throws HelloSignException
draft
- UnclaimedDraftHelloSignException
public TemplateDraft createEmbeddedTemplateDraft(EmbeddedRequest req) throws HelloSignException
req
- EmbeddedRequestHelloSignException
public boolean isOnline()
public void setAccessToken(String accessToken, String tokenType) throws HelloSignException
accessToken
- String access tokentokenType
- String token typeHelloSignException
public String getApiUrl()
public String getSignatureRequestUrl()
public String getSignatureRequestSendUrl()
public String getSignatureRequestCancelUrl()
public String getTemplateSignatureRequestUrl()
Copyright © 2015 HelloSign. All rights reserved.