naresh_kota | Posts: 22

Singatories

0 votes

Hi,

 

when request is placed to OSS for signatory, do both sender and signer need to sign (or signing process will be completed if singer does the signature?)

Thank you!

Naresh

 


Duo_Liang | Posts: 3776

Reply to: Singatories

0 votes

Hi Naresh,

 

Depending on how you designed the package, both could be possible - in order to complete a remote signing process, all parties (either sender or signer) be assigned signature(s) are required to sign based on the signing order you specified.

Also, if it's related to your previous post, do you mind sharing more about your use case and the goal you want to achieve?

 

Duo


naresh_kota | Posts: 22

Reply to: Singatories

0 votes

Hi Duo,

do you have sample code for the following scenarios (.NET API). POC done with single doc and single signatory

1. Single doc with multiple signatory

2. mutiple docs with multiple signatory

 

Thanks

Naresh


Duo_Liang | Posts: 3776

Reply to: Singatories

0 votes

Hi Naresh,

 

You can find the sample .NET REST code to create a single doc with multiple signatures in this quick start guide and this code share.

Based on that, below code snippet gives you an idea how to "create a package with mutiple docs with multiple signatory"

 

        public void Execute()
        {

            string apiKey = "your_api_key";
            string url = "https://sandbox.esignlive.com/api";


            string jsonString = "{\"roles\":[{\"id\":\"Role1\",\"signers\":[{\"email\":\"[email protected]\",\"firstName\":\"1.firstname\",\"lastName\":\"1.lastname\",\"company\":\"OneSpan Sign\"}]},{\"id\":\"Role2\",\"signers\":[{\"email\":\"[email protected]\",\"firstName\":\"2.firstname\",\"lastName\":\"2.lastname\",\"company\":\"OneSpan Sign\"}]}],\"documents\":[{\"approvals\":[{\"role\":\"Role1\",\"fields\":[{\"page\":0,\"top\":100,\"subtype\":\"FULLNAME\",\"height\":50,\"left\":100,\"width\":200,\"type\":\"SIGNATURE\"}]},{\"role\":\"Role2\",\"fields\":[{\"page\":0,\"top\":300,\"subtype\":\"FULLNAME\",\"height\":50,\"left\":100,\"width\":200,\"type\":\"SIGNATURE\"}]}],\"name\":\"Test Document\"},{\"approvals\":[{\"role\":\"Role1\",\"fields\":[{\"page\":0,\"top\":100,\"subtype\":\"FULLNAME\",\"height\":50,\"left\":100,\"width\":200,\"type\":\"SIGNATURE\"}]},{\"role\":\"Role2\",\"fields\":[{\"page\":0,\"top\":300,\"subtype\":\"FULLNAME\",\"height\":50,\"left\":100,\"width\":200,\"type\":\"SIGNATURE\"}]}],\"name\":\"Test Document2\"}],\"name\":\"Example Package\",\"type\":\"PACKAGE\",\"language\":\"en\",\"emailMessage\":\"\",\"description\":\"New Package\",\"autocomplete\":true,\"status\":\"SENT\"}";

            StringContent jsonContent = new StringContent(jsonString, Encoding.UTF8, "application/json");

            byte[] fileByteArray = File.ReadAllBytes("your_file_path1");
            ByteArrayContent content = new ByteArrayContent(fileByteArray);
            content.Headers.ContentDisposition = new ContentDispositionHeaderValue("form-data");
            content.Headers.ContentDisposition.Name = "\"file\"";


            byte[] fileByteArray2 = File.ReadAllBytes("your_file_path2");
            ByteArrayContent content2 = new ByteArrayContent(fileByteArray2);
            content2.Headers.ContentDisposition = new ContentDispositionHeaderValue("form-data");
            content2.Headers.ContentDisposition.Name = "\"file\"";

            MultipartFormDataContent form = new MultipartFormDataContent();
            form.Add(content, "\"file\"", "\"Document1\"");
            form.Add(content2, "\"file\"", "\"Document2\"");

            form.Add(jsonContent, "\"payload\"");

            HttpClient myClient = new HttpClient();
            myClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", apiKey);
            myClient.DefaultRequestHeaders.Add("Accept", "application/json");

            var response = myClient.PostAsync(new Uri(url) + "/packages/", form).Result;
            Debug.WriteLine(response.Content.ReadAsStringAsync().Result);

        }

 

 

Two places to notice:

(1)build the JSON accordingly and add a node to "documents" array

(2)add binaries to MultipartFormDataContent in sequence, with the same formdata name "file". The order matches with the "documents" array in JSON.

 

Duo


Hello! Looks like you're enjoying the discussion, but haven't signed up for an account.

When you create an account, we remember exactly what you've read, so you always come right back where you left off