All URIs are relative to https://api.hellosign.com/v3
Method | HTTP request | Description |
---|---|---|
oauthTokenGenerate | POST /oauth/token | OAuth Token Generate |
oauthTokenRefresh | POST /oauth/token?refresh | OAuth Token Refresh |
OAuthTokenResponse oauthTokenGenerate(oauthTokenGenerateRequest)
OAuth Token Generate
Once you have retrieved the code from the user callback, you will need to exchange it for an access token via a backend call.
import com.dropbox.sign.ApiException;
import com.dropbox.sign.Configuration;
import com.dropbox.sign.api.*;
import com.dropbox.sign.auth.*;
import com.dropbox.sign.model.*;
public class Example {
public static void main(String[] args) {
var apiClient = Configuration.getDefaultApiClient();
var oAuthApi = new OAuthApi(apiClient);
var data = new OAuthTokenGenerateRequest()
.state("900e06e2")
.code("1b0d28d90c86c141")
.clientId("cc91c61d00f8bb2ece1428035716b")
.clientSecret("1d14434088507ffa390e6f5528465");
try {
OAuthTokenResponse result = oAuthApi.oauthTokenGenerate(data);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling AccountApi#accountCreate");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
oauthTokenGenerateRequest | OAuthTokenGenerateRequest |
No authorization required
- Content-Type: application/json
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | successful operation | * X-RateLimit-Limit - * X-RateLimit-Remaining - * X-Ratelimit-Reset - |
4XX | failed_operation | - |
OAuthTokenResponse oauthTokenRefresh(oauthTokenRefreshRequest)
OAuth Token Refresh
Access tokens are only valid for a given period of time (typically one hour) for security reasons. Whenever acquiring an new access token its TTL is also given (see expires_in
), along with a refresh token that can be used to acquire a new access token after the current one has expired.
import com.dropbox.sign.ApiException;
import com.dropbox.sign.Configuration;
import com.dropbox.sign.api.*;
import com.dropbox.sign.auth.*;
import com.dropbox.sign.model.*;
public class Example {
public static void main(String[] args) {
var apiClient = Configuration.getDefaultApiClient();
var oAuthApi = new OAuthApi(apiClient);
var data = new OAuthTokenRefreshRequest()
.refreshToken("hNTI2MTFmM2VmZDQxZTZjOWRmZmFjZmVmMGMyNGFjMzI2MGI5YzgzNmE3");
try {
OAuthTokenResponse result = oAuthApi.oauthTokenRefresh(data);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling AccountApi#accountCreate");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
oauthTokenRefreshRequest | OAuthTokenRefreshRequest |
No authorization required
- Content-Type: application/json
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | successful operation | * X-RateLimit-Limit - * X-RateLimit-Remaining - * X-Ratelimit-Reset - |
4XX | failed_operation | - |