Skip to content

Latest commit

 

History

History
161 lines (108 loc) · 4.34 KB

OAuthApi.md

File metadata and controls

161 lines (108 loc) · 4.34 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()

oauthTokenGenerate(oAuthTokenGenerateRequest: OAuthTokenGenerateRequest): OAuthTokenResponse

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.

TypeScript Example

import * as DropboxSign from "@dropbox/sign";

const oAuthApi = new DropboxSign.OAuthApi();

const data = new DropboxSign.OAuthTokenGenerateRequest();
data.state = "900e06e2";
data.code = "1b0d28d90c86c141";
data.clientId = "cc91c61d00f8bb2ece1428035716b";
data.clientSecret = "1d14434088507ffa390e6f5528465";

const result = oAuthApi.oauthTokenGenerate(data);
result.then(response => {
  console.log(response.body);
}).catch(error => {
  console.log("Exception when calling Dropbox Sign API:");
  console.log(error.body);
});

JavaScript Example

import * as DropboxSign from "@dropbox/sign";

const oAuthApi = new DropboxSign.OAuthApi();

const data = new DropboxSign.OAuthTokenGenerateRequest();
data.state = "900e06e2";
data.code = "1b0d28d90c86c141";
data.clientId = "cc91c61d00f8bb2ece1428035716b";
data.clientSecret = "1d14434088507ffa390e6f5528465";

const result = oAuthApi.oauthTokenGenerate(data);
result.then(response => {
  console.log(response.body);
}).catch(error => {
  console.log("Exception when calling Dropbox Sign API:");
  console.log(error.body);
});

Parameters

Name Type Description Notes
oAuthTokenGenerateRequest OAuthTokenGenerateRequest

Return type

OAuthTokenResponse

Authorization

No authorization required

HTTP request headers

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

[Back to top] [Back to API list] [Back to Model list] [Back to README]

oauthTokenRefresh()

oauthTokenRefresh(oAuthTokenRefreshRequest: OAuthTokenRefreshRequest): OAuthTokenResponse

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.

TypeScript Example

import * as DropboxSign from "@dropbox/sign";

const oAuthApi = new DropboxSign.OAuthApi();

const data = new DropboxSign.OAuthTokenRefreshRequest();
data.refreshToken = "hNTI2MTFmM2VmZDQxZTZjOWRmZmFjZmVmMGMyNGFjMzI2MGI5YzgzNmE3";

const result = oAuthApi.oauthTokenRefresh(data);
result.then(response => {
  console.log(response.body);
}).catch(error => {
  console.log("Exception when calling Dropbox Sign API:");
  console.log(error.body);
});

JavaScript Example

import * as DropboxSign from "@dropbox/sign";

const oAuthApi = new DropboxSign.OAuthApi();

const data = new DropboxSign.OAuthTokenRefreshRequest();
data.refreshToken = "hNTI2MTFmM2VmZDQxZTZjOWRmZmFjZmVmMGMyNGFjMzI2MGI5YzgzNmE3";

const result = oAuthApi.oauthTokenRefresh(data);
result.then(response => {
  console.log(response.body);
}).catch(error => {
  console.log("Exception when calling Dropbox Sign API:");
  console.log(error.body);
});

Parameters

Name Type Description Notes
oAuthTokenRefreshRequest OAuthTokenRefreshRequest

Return type

OAuthTokenResponse

Authorization

No authorization required

HTTP request headers

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

[Back to top] [Back to API list] [Back to Model list] [Back to README]