Skip to content

Added option in Document.Download() for getting the document with the… #6

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
4 changes: 2 additions & 2 deletions CSLibrary/Document.cs
Original file line number Diff line number Diff line change
Expand Up @@ -199,12 +199,12 @@ public static dynamic Delete(string AccessToken, string DocumentId, string Resul
/// <param name="SaveFileName">File Name without Extension</param>
/// <param name="ResultFormat">JSON, XML</param>
/// <returns>Collapsed document in PDF format saved to a the location provided.</returns>
public static dynamic Download(string AccessToken, string DocumentId, string SaveFilePath = "", string SaveFileName = "my-collapsed-document", string ResultFormat = "JSON")
public static dynamic Download(string AccessToken, string DocumentId, bool WithHistory = false, string SaveFilePath = "", string SaveFileName = "my-collapsed-document", string ResultFormat = "JSON")
{
var client = new RestClient();
client.BaseUrl = new Uri(Config.ApiHost);

var request = new RestRequest("/document/" + DocumentId + "/download?type=collapsed", Method.GET)
var request = new RestRequest("/document/" + DocumentId + "/download" + (WithHistory ? "/collapsed?with_history=1" : "?type=collapsed"), Method.GET)
.AddHeader("Accept", "application/json")
.AddHeader("Authorization", "Bearer " + AccessToken);

Expand Down
9 changes: 7 additions & 2 deletions Examples/Examples.cs
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,14 @@ static void Main(string[] args)

//Download Document
ConsoleH2("Downloading Document");
JObject downloadDocRes = SignNow.Document.Download(AccessToken, DocumentId, "/", "sample");
JObject downloadDocRes = SignNow.Document.Download(AccessToken, DocumentId, false, "/", "sample");
Console.WriteLine("Download Document: {0} \r\n\r\n\r\n", downloadDocRes["file"].ToString());


//Download Document With History
ConsoleH2("Downloading Document With History");
JObject downloadDocWithHistoryRes = SignNow.Document.Download(AccessToken, DocumentId, true, "/", "sample");
Console.WriteLine("Download Document With History: {0} \r\n\r\n\r\n", downloadDocWithHistoryRes["file"].ToString());

//Send Free Form Invite
ConsoleH2("Sending Role-based Invite");
dynamic inviteDataObj = new
Expand Down