Skip to content
Grav 2.0 is officially stable. Read the announcement →

Community guidelines

Please keep discussions civil and on-topic. Repeated violations may lead to a temporary ban.

General

REST API for pages

Started by Christian B. 8 years ago · 4 replies · 4067 views
8 years ago

Hey there,

I know this question has been asked before and the asnwers are very different and confusing when looking into the archive, depending on when it was asked/answered. That is why I'm asking it again.

I would love to be able to have GET/POST(/PUT) access to pages using JSON.

There are some plugins on github that have not been updated for at least a year and mostly do not have docs. (Some of them don't even have a lot of code...)

I don't want to complain, I would love to hear from people that have been able to achieve something like this (fully or partially) or that can tell me how to get started building a simple plugin that does just that.

My main use case is "in page editing" like in a wiki. So if there are any ideas flying around related to that they re also welcome.

I'm open for PM's on slack as well (@karfau).

Hope this becomes an updated pool of helpful information.

8 years ago

Last I used it, somewhere around v1.3.x of Grav, the API-plugin worked as expected for pages. You don't actually need much code for a REST API, just a receiver and ideally authentication.

The prospect of a fully-fledged API has been discussed, especially the possibility of a GraphQL-implementation. This, however, requires major work to integrate well with core - and as such it is at best in the pipeline for Grav v2.

👍 1
8 years ago

GraphQL integration would be so nice for modern frontend developer using Vue.js or React.js!

I hope Grav Team still consider it!

It is one of the most wanted feature IMO.

8 years ago

Man, this is now asked almost weekly and every thread has useful new info. I've never seen the API plugin @OleVik mentions in response, for example.

I do think this should concept have a canonical home. My paralysis is "where?". Github issue perhaps? Or maybe within the API plugin repo, which seems like it could use a new maintainer.

Suggested topics

Topic Participants Replies Views Activity
General · by Jerry Hunt, 4 days ago
2 82 11 hours ago
General · by pamtbaau, 17 hours ago
1 55 16 hours ago
General · by Andy Miller, 1 day ago
0 45 1 day ago
General · by Marcel, 12 months ago
6 348 5 days ago
General · by Duc , 5 days ago
3 43 5 days ago