Skip to content

Latest commit

 

History

History
149 lines (101 loc) · 4.48 KB

OAuthApi.md

File metadata and controls

149 lines (101 loc) · 4.48 KB

OAuthApi

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

oauthTokenGenerate

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.

Example

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();
        }
    }
}

Parameters

Name Type Description Notes
oauthTokenGenerateRequest OAuthTokenGenerateRequest

Return type

OAuthTokenResponse

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -

oauthTokenRefresh

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.

Example

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();
        }
    }
}

Parameters

Name Type Description Notes
oauthTokenRefreshRequest OAuthTokenRefreshRequest

Return type

OAuthTokenResponse

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -