0

I don't understand Ninox API. Please help me

hello guys. I've got my site. There is html form including two fields (name and tell). I've got api key. I created a database and table in my Ninox interface. What's next? How to integreate html form with Ninox database's table? When user click "send" button on my site the data of inputs should connect to my Ninox DB's table and create new fields (name and tell). The question is - how to connect hrml form with Ninox DB's tables? Please give me php/js code example.

13 replies

null
    • Ninox developper
    • Jacques_TUR
    • 3 yrs ago
    • Reported - view

    You can try with Advenced REST Client. This software help you to test your API methode. When is right, it provide you samples codes in differents langage (HTTP, JavaScript, Phyton, C...).

    I can send you Ninox sample with Ninox code to generate HTML & JS code to create ComboBox.

    Send me your email at my adresse jacques.tur@neuf.fr

    • Ninox developper
    • Jacques_TUR
    • 3 yrs ago
    • Reported - view

    Maybe this code https can help you : https://www.w3schools.com/code/tryit.asp?filename=GMJXIP6OLQIB

    From HTML and JS code, it display all teams, databases, tables, records and fields.

    At thist time, this draft display only text, choice, image and PDF data from Ninox fields table.

    • 89002325266
    • 3 yrs ago
    • Reported - view

    Thanks you very much, i'll try to make it.

    • Sean
    • 3 yrs ago
    • Reported - view

    Jacques,

    That's great, thanks for sharing!! I'm curious, do you even bother with Ninox's interface builder or do you roll your own using HTML/CSS/JavaScript?

    • Ninox developper
    • Jacques_TUR
    • 3 yrs ago
    • Reported - view

    I’m not sure to understood Sean. I wrote it friday to try reading and manipulate images and PDF files (others fields formats seem easier to read). I used AdvencedRestClient and somes w3schools exemples to did it. I'm not familiar to web langages.
    I wanted to create a more complete print generator than Ninox's, but I discovered that Ninox does not share formula values in API. It's a shame, with API Rest I'm blind to big part of the my datas !

    • Sean
    • 3 yrs ago
    • Reported - view

    Well, it's impressive that you put that together without much knowledge of web languages. Since you've gotten that far using JavaScript, why don't you use it to calculate the forumlas you created in Ninox?

    • Ninox developper
    • Jacques_TUR
    • 3 yrs ago
    • Reported - view

    C'est impressionnant de voir que vous avez mis cela en place sans grande connaissance des langues du web. Puisque vous en êtes arrivé là avec JavaScript, pourquoi ne pas l'utiliser pour calculer les forums que vous avez créés dans Ninox ?

    Je n’ai pas beaucoup de conaissance en JS et HTML, mais j'ai passé une partie de ma vie à programmer sur d'autres plateformes (assembleur, pascal, C, WinDev et beaucoup d’autres langages). A la fin, tout se ressemble.

    Les formules sur Ninox, c'est très bien. Toutes les formules sont calculées au bon moment. Ca évite de consommer trop de temps. De plus, c'est structurant de concevoir des données calculée à partir d’une formule et de la manipuler comme un champ.
    Si je drois recréer des fonctions en dehors de Ninox, autant faire complétement autrement : utiliser MySql ou un autre serveur SQL standard pour récupérer/enregistrer des données, ou encore utiliser une autre base de données à faible code.

    La façon dont Ninox structure les données est très efficace pour construire rapidement et correctement une application de base de données. C’est brillant, je n'avais jamais vu la même chose ailleurs. Il est juste dommage de limiter les extensions possible.

    En plus, je vois qu’il y a une communauté dynamique qui s’investi à recréer la documentation inexistante, à partager des exemples, à soutenir les débutants. Tout ça mis bout à bout, donne me donne envie d’aller plus loins. Encore faut-il pouvoir le faire.

    • Sean
    • 3 yrs ago
    • Reported - view

    Je n'étais pas sûr de savoir jusqu'où vous étiez prêt à aller coder en dehors de Ninox et vous avez dit que vous vouliez créer un générateur d'impression plus complet. Comment vos formules se compareraient-elles à un générateur d'impression? Je comprends votre point cependant. 😉

    • Ninox developper
    • Jacques_TUR
    • 3 yrs ago
    • Reported - view

    I found the solution:

    1 - the following code returns all the declarations of all the database: tables, fields, function, layout elements, declaration and global parameters Inside there are all the scripts of the functions :

    let response := http("GET", "https://api.ninoxdb.de/v1/teams/" + myTeamID + "/databases/" + myDatabaseID, {
    Authorization: "Bearer" + myKey,
    Content-Type': "application/json".
    ), null);

    2 - thanks to a post by Uwe (https://ninox.com/en/forum/technical-help-5ab8fe445fe2b42b7dd39ee7/note-query-values-of-function-fields-via-rest-api-5fdd74f8dce72f67d2750e70): thank you very much for his patience in collect all this informations 🙏.

    There is a "query" parameter in the GET function which allows to execute a Ninox code remotely :
    let response := http("GET", "https://api.ninoxdb.de/v1/teams/" + myTeamID + "/databases/" + myDatabaseID + "/query?query=" + "first(select Kontakt[id = 2]).fxName", {
    Authorization: "Bearer" + myKey,
    Content-Type': "application/json".
    ), null);

    => {"result": "Christoph P"}.

    I can now execute any function or trigger in the database, ask for the value of a formula or execute free code from a JavaScript code.

    • 89002325266
    • 3 yrs ago
    • Reported - view

    Guys. The most important thing is that we are trying to use JavaScript. That means anyone can get our api key. It's not good at all. Is there any way to use php ? Or how to hide your api key?

    • Sean
    • 3 yrs ago
    • Reported - view

    javascript hide api key... seems to be a popular topic on google 

    • Sean
    • 3 yrs ago
    • Reported - view

    One more suggestion is to see if you can get some guidance from Ninox on their undocumented function 

     

    getVault(string)

    • Ninox developper
    • Jacques_TUR
    • 3 yrs ago
    • Reported - view

    Thank you both for your advice.

    Sean, I will be investing in the getVault feature. Anyone ever done this yet?

Content aside

  • 3 yrs agoLast active
  • 13Replies
  • 1827Views