Putting and deleting forms on nodeJS

  • shalomazar
    Asked on September 26, 2017 at 2:16 PM

    I don't see any sample instructions on the API page on how to put and delete forms on nodeJS. Is it even possible to put and delete forms on nodeJS?

  • Sabbir
    Replied on September 26, 2017 at 2:30 PM

    Hello,

    You can go to our API page to get all the information regarding working with Jotform in NodeJS.

    This is the JotForm API for NodeJS: https://github.com/jotform/jotform-api-nodejs

    Also go to http://api.jotform.com/docs/

    Then from the left side drop down box, select NodeJS and you will find all the methods underneath to see how to use them in Jotform.

    Putting and deleting forms on nodeJS Image 1 Screenshot 20

    Hope this will help.

    Let us know if you have any further query regarding this.

    Thanks


  • shalomazar
    Replied on September 26, 2017 at 2:50 PM

    I already checked all those places and there are no instructions for methods of putting and deleting forms on nodeJS. Can you please put the instructions up, Thank you

  • Sabbir
    Replied on September 26, 2017 at 3:02 PM

    Hello,

    The PUT, DELETE methods are already there for forms.

    Putting and deleting forms on nodeJS Image 1 Screenshot 20

  • shalomazar
    Replied on September 26, 2017 at 3:09 PM

    Hi,

    Methods are there as you illustrated but there is no coding or using the API sample like the get method in node or put and delete in Python and java. Is it possible that can be added?

  • Kevin Support Team Lead
    Replied on September 26, 2017 at 3:27 PM

    @shalomazar, 

    Please find some examples on this link: https://github.com/jotform/jotform-api-nodejs/blob/master/index.js 

    Create form.

    exports.createForm = function(formData) {

        var deferred = Q.defer();

        if(typeof formData != 'object' || formData == null) {

            return;

        }


        var endPoint = "/user/forms"

        , requestUrl = _url + (_version==="latest" ? "" : "/v"+_version) + endPoint + "?apiKey=" + _apiKey

        , requestVerb =  "post"

        , postData = formData


        sendRequest(deferred, requestUrl, requestVerb, postData);

        return deferred.promise;     

    }

    Delete Form.

    exports.deleteForm = function(formID) {

        var deferred = Q.defer();


        var endPoint = "/form/" + formID

        , requestUrl = _url + (_version==="latest" ? "" : "/v"+_version) + endPoint + "?apiKey=" + _apiKey

        , requestVerb =  "delete";


        sendRequest(deferred, requestUrl, requestVerb);

        return deferred.promise;    

    }

    You may find more information on the GitHub repository for our Node JS API: https://github.com/jotform/jotform-api-nodejs 

    I hope this helps.