Access webpage content using REST API

Hii everone,

I want to access my web page details using Frappe’s default REST API.

https://frappe.io/frappejs/docs/server/rest here mentions all the details about how to access doctypes using the default Rest API, but there is no mention of how to access web page details.

Manav_Mandli, how are you doing?

Can you elaborate more?

You wanna access the records of the Web Page doctype or the rendered webpage?

@max_morais_dmm

For example: Right now, I have generated a web template in which I have included fields for the topic, title, and attachment. I added this to my web page. Now, I want to fetch these details on the frontend side through an API and get them in JSON format according to the web template. Is this possible?

@Manav_Mandli easy way is to embed those details on the webtemplate from the backend!

trought a web request is possible, but will require more extra steps!

you can create an javscript variable in your webtemplate example!

<script type="text/javascript">
    window.my_var = {{ as_json(doc) }}
</script>

Also the scripting of the webpage, allow you to inject backend variables, in the same way I showed above!

Wow, can we get the doc details in the front end?

Yes, TurkerTunali!

Most of my webpage at www.techmaxsolucoes.com.br use this kind of features!

For instance Gestão de TIC

This section is generated by items on an specific item group

2 Likes

@max_morais_dmm

It is helpful for me. Thank you for your response.

1 Like

I see. Is that built with Frappe Builder or else?

That is built with the website module only, but we have projects built with the builder

1 Like

are they public? Can we check them?

I believe that there should be separate market for the Frappe Builder Templates.

There are some

2 Likes