Skip to content
This repository was archived by the owner on Oct 17, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions src/main/java/com/hellosign/sdk/HelloSignClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ public class HelloSignClient {
public static final String UNCLAIMED_DRAFT_CREATE_EMBEDDED_WITH_TEMPLATE_URI = "/unclaimed_draft/create_embedded_with_template";
public static final String API_APP_URI = "/api_app";
public static final String API_APP_LIST_URI = "/api_app/list";
public static final String SIGNATURE_REQUEST_REMOVE_URI = "/signature_request/remove";


public static final String PARAM_FILE_TYPE_URI = "file_type";
public static final String PARAM_GET_URL = "get_url";
Expand Down Expand Up @@ -1037,4 +1039,21 @@ public ApiApp updateApiApp(ApiApp app) throws HelloSignException {
public void setAccessToken(String accessToken, String tokenType) throws HelloSignException {
auth.setAccessToken(accessToken, tokenType);
}

/**
* Removes your access to a completed signature request. This action is not reversible.
*
* The signature request must be fully executed by all parties (signed or declined to sign).
* Other parties will continue to maintain access to the completed signature request document(s).
*
* @param signature_request_id SignatureRequest id
* @return boolean true if successful
* @throws HelloSignException thrown if there's a problem processing the HTTP request or the
* JSON response.
*/
public boolean removeSignatureRequestAccess(String signature_request_id) throws HelloSignException {
String url = BASE_URI + SIGNATURE_REQUEST_REMOVE_URI + "/" + signature_request_id;
return HttpURLConnection.HTTP_OK == httpClient.withAuth(auth).post(url).asHttpCode();
}

}
10 changes: 10 additions & 0 deletions src/test/java/com/hellosign/sdk/HelloSignClientTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -1115,4 +1115,14 @@ public void testRemovingSignersByEmail() throws HelloSignException {
var set = signers.entrySet();
Assert.assertEquals(0, set.size());
}

/**
* Test to verify Remove your access to a completed signature request.
* @throws Exception
*/
@Test
public void testRemoveSignatureRequestAccess() throws Exception {
mockResponseCode(200);
assertTrue(client.removeSignatureRequestAccess("44cf71a0238811c846f49483014f534cfd8caba6"));
}
}