Is it possibile to get .png files from signature control (for example Smooth Signature) after form submit?

  • Profile Image
    deslab
    Asked on June 13, 2019 at 11:47 AM

    Hello,

    is it possibile to get .png files from signature control (for example Smooth Signature) after form submit?

    I read that is possibile to download file from your server by JotForm API. Is it correct?

    I work in .NET c#. If yes, how can i do it?

    Thanks.

    Regards.

  • Profile Image
    Richie_P
    Answered on June 13, 2019 at 01:12 PM

    You may download the submission with the signature as they are sent in image format. They are also included as URLs when you export your form submissions to Excel or CSV. http://www.jotform.com/help/73-How-to-Download-Form-Submissions-to-Excel-CSV-PDF

    You may check this link regarding API download https://api.jotform.com/docs/#usecases

    For more information regarding our API kindly check this guide: https://api.jotform.com/docs/
    For API related questions you may contact our API Team at api@jotform.com.

    Hope this information helps.


  • Profile Image
    deslab
    Answered on June 14, 2019 at 11:59 AM

    I downloaded c# api from this link https://github.com/jotform/jotform-api-csharp. There is a test project too.


    I executed test project but it raised an exception when called the getUser method: could not create SSL/TLS secure channel.

    This is the code:

    var client = new JotForm.APIClient("my-api-key");

    var user = client.getUser();

    ......


    Yestarday, I did contact api support team at api@jotform.com, but I didn't receive any answer.

  • Profile Image
    Richie_P
    Answered on June 14, 2019 at 01:19 PM

    Can you please try adding these line of codes?

    ServicePointManager.Expect100Continue = true;
    ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;

    Can you please move move this line: "ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3 | SecurityProtocolType.Tls | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls12;"

    Before this line:" HttpWebRequest request = (HttpWebRequest)WebRequest.Create(uri);"?

    You may check this article form the internet for more information. https://stackoverflow.com/questions/32994464/could-not-create-ssl-tls-secure-channel-despite-setting-servercertificatevalida


    Please give it a try and let us know how it goes.

  • Profile Image
    deslab
    Answered on June 17, 2019 at 02:10 PM

    It's Perfect!

    Now, I have another problem :)

    How can I download image signature of a specific submission?

    This is the code:

     

    var client = new JotForm.APIClient("API KEY");

    client.euProtected = true;

    long subID = xxxxxxxx;

    var itemSub = client.getSubmission(subID);

    var itemContent = itemSub["content"];

    var itemAnswers = itemContent["answers"];

    var answers = itemAnswers.Children();

    foreach (var ans in answers)

    {

           var token = ans.First();

           var name = token["name"].ToString();

           if (!name.StartsWith("img"))

                 continue;

           //get absolute image url

           var imgUrl = token["answer"].ToString();

     

           //download image stream

           ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3 | SecurityProtocolType.Tls | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls12;

           WebRequest req = WebRequest.Create(imgUrl);

           req.Method = "GET";

           HttpWebResponse resp = (HttpWebResponse)req.GetResponse();

           .....

    }

     

    When it calls GetResponse method, it's raised an Exception like below:

    System.Net.WebException: 'Server remote error: (404) ......'    

  • Profile Image
    Richie_P
    Answered on June 17, 2019 at 03:27 PM

    The name for getting the data from the "E-Signature" widget is "signature". However, I'm not sure if its possible using API.
    You may contact our API Team at api@jotform.com for more information.

    You may try using PHP and Post data. Please check the following guide, it gives all of the information about getting post data from your form with PHP:

    http://www.jotform.com/help/213-Send-POST-Data-From-JotForm-Using-PHP-in-Custom-Thank-You-Page


  • Profile Image
    deslab
    Answered on June 18, 2019 at 03:41 AM

    The widget is "Smooth Signature" and this is the token content returned:

    {

      "cfname": "Smooth Signature",

      "name": "img-sign1",

      "order": "61",

      "selectedField": "529467003477f3512000001f",

      "static": "No",

      "text": "Insert signature",

      "type": "control_widget",

      "answer": "https://www.jotform.com/uploads/deslab/91614831281354/4361394383218411624/4361394383218411624_base64_114.png"

    }


    If I try to access to above URL by a new WebRequest, it raises the Exception "Server remote error: (404)".

    Should I use another widget?

    Thanks.

  • Profile Image
    AndrewHag
    Answered on June 18, 2019 at 04:55 AM

    I am able to download the images using that link.

    1560848015ApplicationFrameHost_vfwHcBI1E

    Could you please go to your account settings and disable the Require login to view upload files option?

    1560848122chrome_LXEfoliayr.png

  • Profile Image
    deslab
    Answered on June 18, 2019 at 06:04 AM

    Ok, thank you so mutch!

    Regards.