Jump to content

Create pages from external API


Mijo
 Share

Recommended Posts

Hello all, I'm playing with Wordpress API and I trying to create pages in Processwire from WP API, did anybody do something like that (or any other api)? What is the best approach for creating pages via external API, any advice, examples would be awesome, thank you all :-)

Link to comment
Share on other sites

2 minutes ago, Mijo said:

Hello all, I'm playing with Wordpress API and I trying to create pages in Processwire from WP API, did anybody do something like that (or any other api)? What is the best approach for creating pages via external API, any advice, examples would be awesome, thank you all :-)

Maybe it is easier (even better?) to instead bootstrap ProcessWire inside your WP and use ProcessWire to create ProcessWire pages. 

https://processwire.com/api/include/

  • Like 4
Link to comment
Share on other sites

Got to agree with Kongondo: if that is doable for you, i.e. both sites sit on the same server, bootstrapping ProcessWire is probably your best bet.

Otherwise I'd recommend checking out the REST API site profile and/or ProcessGraphQL. To my best understanding both provide the ability to create content via the API, and both have some sort of authentication mechanism available.

Authentication is basically the main thing here: it's really easy to create a ProcessWire page that takes POST requests and creates pages etc. but you don't want, under any conditions, that to be publicly available without some sort of authentication. This is why I'd recommend checking the existing solutions first, and only rolling out your own solution if it's absolutely your only option :)

  • Like 4
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...