Welcome to the nuBuilder Forums!

Register and log in to access exclusive forums and content available only to registered users.

access to data through a rest api

Questions related to using nuBuilder Forte.
Post Reply
criszalo1997
Posts: 2
Joined: Wed Aug 10, 2022 3:06 am

access to data through a rest api

Unread post 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
kev1n
nuBuilder Team
Posts: 4297
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 445 times
Contact:

Re: access to data through a rest api

Unread post 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
You do not have the required permissions to view the files attached to this post.
criszalo1997
Posts: 2
Joined: Wed Aug 10, 2022 3:06 am

Re: access to data through a rest api

Unread post 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
kev1n
nuBuilder Team
Posts: 4297
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 445 times
Contact:

Re: access to data through a rest api

Unread post by kev1n »

Basically, you will need to do a request similar to nuLoginRequest() in index.php. It's probably not that simple.
Post Reply