Page 1 of 1

access to data through a rest api

Posted: Tue Aug 16, 2022 7:26 pm
by criszalo1997
Hello everyone, I have a question about data access, it's great how applications are built with this rad, but I have a problem, how can I access nubuilder data through the rest api that handles the documentation, I couldn't find it documentation on data access with the rest api, of course I was able to capture the data by debugging it with the browser but there is some documentation that can explain how to log in to the api and consume the values


examples of data to collect
Image


data obtained through the nubuilder api with the google chrome element inspector

Image


I await your answers, greetings

Re: access to data through a rest api

Posted: Wed Aug 17, 2022 9:23 am
by kev1n
Hi,

I'm afraid nuBuilder does not have a REST API. You could write it yourself, ask someone to do it, or use an existing framework.

Attached is an example of a simple web service, which returns user data as JSON or XML.

Unzip the files and place the webservice folder in nuBuilder's root directory.
webservice.zip
Of course, you could extend this and add password authentication.

Screenshot of the web service portal:
webserivce.png
Result:
webservice_xml.png

Re: access to data through a rest api

Posted: Wed Aug 17, 2022 3:53 pm
by criszalo1997
I understand although I see that nubuilder makes ajax requests through the nuapi.php file, it is not possible to extend the use of that file to reuse and obtain data from nubuilder

if you use ajax I guess they handle some kind of token in the session to keep the user logged in I can reuse that session and somehow be able to use the nuapi.php api with postman

Re: access to data through a rest api

Posted: Thu Aug 18, 2022 4:18 pm
by kev1n
Basically, you will need to do a request similar to nuLoginRequest() in index.php. It's probably not that simple.