Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Support iframeable_embed_url for sign request #925

Merged
merged 2 commits into from
Sep 25, 2023
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
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ public async Task CreateSignRequestAsync_ForCorrectSignRequestCreateRequest_Shou
{
Email = "[email protected]",
RedirectUrl = new Uri("https://www.box.com/redirect_url_signer_1"),
DeclinedRedirectUrl = new Uri("https://www.box.com/declined_redirect_url_singer_1")
DeclinedRedirectUrl = new Uri("https://www.box.com/declined_redirect_url_singer_1"),
EmbedUrlExternalUserId = UserId
}
},
ParentFolder = new BoxRequestEntity()
Expand All @@ -54,6 +55,10 @@ public async Task CreateSignRequestAsync_ForCorrectSignRequestCreateRequest_Shou
Assert.AreEqual(signRequestCreateRequest.DeclinedRedirectUrl.ToString(), signRequest.DeclinedRedirectUrl.ToString());
Assert.AreEqual(signRequestCreateRequest.ParentFolder.Id, signRequest.ParentFolder.Id);

// first signer is the sender with role final_copy_reader, second is the recipient with role signer
Assert.AreEqual(2, signRequest.Signers.Count);
Assert.IsNotNull(signRequest.Signers[1].IframeableEmbedUrl);

await UserClient.SignRequestsManager.CancelSignRequestAsync(signRequest.Id);

signRequest = await UserClient.SignRequestsManager.GetSignRequestByIdAsync(signRequest.Id);
Expand Down
3 changes: 3 additions & 0 deletions Box.V2.Test/BoxSignRequestsManagerTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ public async Task CreateSignRequest_OptionalParams_Success()
Assert.AreEqual("[email protected]", response.Signers[0].Email);
Assert.AreEqual("https://box.com/redirect_url_signer_1", response.Signers[0].RedirectUrl.ToString());
Assert.AreEqual("https://box.com/declined_redirect_url_signer_1", response.Signers[0].DeclinedRedirectUrl.ToString());
Assert.AreEqual("https://app.box.com/embed/sign/document/bf7aaac6/", response.Signers[0].IframeableEmbedUrl);
Assert.AreEqual(1, response.Signers[0].Inputs.Count);
Assert.IsTrue(response.Signers[0].Inputs[0].CheckboxValue.Value);
Assert.AreEqual(BoxSignRequestSingerInputContentType.checkbox, response.Signers[0].Inputs[0].ContentType);
Expand Down Expand Up @@ -213,6 +214,7 @@ public async Task GetSignRequest_Success()
Assert.AreEqual("[email protected]", response.Entries[0].Signers[0].Email);
Assert.AreEqual("https://box.com/redirect_url_signer_1", response.Entries[0].Signers[0].RedirectUrl.ToString());
Assert.AreEqual("https://box.com/declined_redirect_url_signer_1", response.Entries[0].Signers[0].DeclinedRedirectUrl.ToString());
Assert.AreEqual("https://app.box.com/embed/sign/document/bf7aaac6/", response.Entries[0].Signers[0].IframeableEmbedUrl);
Assert.AreEqual("12345", response.Entries[0].ParentFolder.Id);
Assert.IsTrue(response.Entries[0].IsDocumentPreparationNeeded);
Assert.IsTrue(response.Entries[0].AreRemindersEnabled);
Expand Down Expand Up @@ -259,6 +261,7 @@ public async Task GetSignRequestById_Success()
Assert.AreEqual("[email protected]", response.Signers[0].Email);
Assert.AreEqual("https://box.com/redirect_url_signer_1", response.Signers[0].RedirectUrl.ToString());
Assert.AreEqual("https://box.com/declined_redirect_url_signer_1", response.Signers[0].DeclinedRedirectUrl.ToString());
Assert.AreEqual("https://app.box.com/embed/sign/document/bf7aaac6/", response.Signers[0].IframeableEmbedUrl);
Assert.AreEqual(1, response.Signers[0].Inputs.Count);
Assert.IsTrue(response.Signers[0].Inputs[0].CheckboxValue.Value);
Assert.AreEqual(BoxSignRequestSingerInputContentType.checkbox, response.Signers[0].Inputs[0].ContentType);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@
],
"embed_url": "https://example.com",
"redirect_url": "https://box.com/redirect_url_signer_1",
"declined_redirect_url": "https://box.com/declined_redirect_url_signer_1"
"declined_redirect_url": "https://box.com/declined_redirect_url_signer_1",
"iframeable_embed_url": "https://app.box.com/embed/sign/document/bf7aaac6/"
}
],
"signing_log": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@
],
"embed_url": "https://example.com",
"redirect_url": "https://box.com/redirect_url_signer_1",
"declined_redirect_url": "https://box.com/declined_redirect_url_signer_1"
"declined_redirect_url": "https://box.com/declined_redirect_url_signer_1",
"iframeable_embed_url": "https://app.box.com/embed/sign/document/bf7aaac6/"
}
],
"signing_log": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@
],
"embed_url": "https://example.com",
"redirect_url": "https://box.com/redirect_url_signer_1",
"declined_redirect_url": "https://box.com/declined_redirect_url_signer_1"
"declined_redirect_url": "https://box.com/declined_redirect_url_signer_1",
"iframeable_embed_url": "https://app.box.com/embed/sign/document/bf7aaac6/"
}
],
"source_files": [
Expand Down
3 changes: 2 additions & 1 deletion Box.V2.Test/Fixtures/BoxSignRequest/GetSignRequest200.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@
],
"embed_url": "https://example.com",
"redirect_url": "https://box.com/redirect_url_signer_1",
"declined_redirect_url": "https://box.com/declined_redirect_url_signer_1"
"declined_redirect_url": "https://box.com/declined_redirect_url_signer_1",
"iframeable_embed_url": "https://app.box.com/embed/sign/document/bf7aaac6/"
}
],
"signing_log": {
Expand Down
7 changes: 7 additions & 0 deletions Box.V2/Models/BoxSignRequestSigner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ public class BoxSignRequestSigner
public const string FieldSignerDecision = "signer_decision";
public const string FieldDeclinedRedirectUrl = "declined_redirect_url";
public const string FieldRedirectUrl = "redirect_url";
public const string FieldIframeableEmbedUrl = "iframeable_embed_url";

/// <summary>
/// Email address of the signer.
Expand Down Expand Up @@ -90,6 +91,12 @@ public class BoxSignRequestSigner
/// </summary>
[JsonProperty(PropertyName = FieldRedirectUrl)]
public virtual Uri RedirectUrl { get; private set; }

/// <summary>
/// This URL is specifically designed for signing documents within an HTML iframe tag.
/// </summary>
[JsonProperty(PropertyName = FieldIframeableEmbedUrl)]
public virtual string IframeableEmbedUrl { get; private set; }
}

/// <summary>
Expand Down
Loading