demellor | Posts: 52

Disabled User Clear Saved Signatures

0 votes

Since OneSpan applies saved signatures (from File and Drawn) for someone who is disabled as a sender but still signs documents we want to be able to clear those values so they aren't appied when someone is disabled.

Can I

  1. Going throught a list of users see when one is disabled
  2. Clear any saved image (from file)
  3. Clear a drawn image

 

Is this possible with the .NET API or even REST?

 


demellor | Posts: 52

Reply to: Disabled User Clear Saved Signatures

0 votes

I was able to determine if the user was active and remove the saved image using the code below.  How do I remove the hand drawn signature from them also?

                Sender theSender = oClient.AccountService.GetSender(senderId);
               Console.WriteLine("Sender Status=" + theSender.Status);
               if (theSender.Status != SenderStatus.ACTIVE)
                   Console.Write("Sender is NOT Active");
               oClient.AccountService.DeleteSenderImageSignature(senderId); //removed saved image


hhaidary | Posts: 6

Reply to: Disabled User Clear Saved Signatures

0 votes

Give this endpoint a try: https://community.onespan.com/products/onespan-sign/sandbox#/Senders/api.account.senders._senderId.signature.image.delete


demellor | Posts: 52

Reply to: Disabled User Clear Saved Signatures

0 votes

           HttpClient client = new HttpClient();
          client.BaseAddress = new Uri(GlobalSettings.eSignCurrentURL); //account used to connect State of Michigan or Subaccount key

          // Add an Accept header for JSON format.
          client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));

          //var byteArray = System.Text.Encoding.ASCII.GetBytes(userID + ":" + Pwd); //SOM\userid
          //client.DefaultRequestHeaders.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Basic", Convert.ToBase64String(byteArray));
          client.DefaultRequestHeaders.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Basic", GlobalSettings.eSignCurrentAPIKey);

          // List data response.
          string theDeleteURL = GlobalSettings.eSignCurrentURL + "/account/senders/" + senderID.ToString() + "/signature/image";
          HttpResponseMessage response = client.DeleteAsync(theDeleteURL).Result;  // Blocking call! Program will wait here until a response is received or a timeout occurs.
          // result = new JObject();
          //result = JObject.Parse(await response.Content.ReadAsStringAsync());
          string result = await response.Content.ReadAsStringAsync();

          client.Dispose();

          Console.WriteLine(response.ToString());
          Console.WriteLine("-----------------------------------------------------------------");
          Console.WriteLine(result.ToString());
 

 

the code works BUT it only removed the saved image, NOT the hand drawn signature.  I need to remove the signature because of how OneSpan applies saved files (signatures) and hand drawn signatures for users who are disabled and we don't want it too so the best way is to remove those items.


hhaidary | Posts: 6

Reply to: Disabled User Clear Saved Signatures

0 votes

To delete the handdrawn signature, you'll first need to do a GET on the sender details: https://community.onespan.com/products/onespan-sign/sandbox#/Senders/api.account.senders._senderId.get. Then modify the handdrawn field to null and update the sender details using the following API: https://community.onespan.com/products/onespan-sign/sandbox#/Senders/api.account.senders._senderId.post. 

You'll need to logout of your OneSpan Sign account in order to see the change. 


demellor | Posts: 52

Reply to: Disabled User Clear Saved Signatures

0 votes

I can't seem to get my code correct.  Where is the code library with examples that used to exist?  I want to look at this example and see what I'm missing.

 

Thank you


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