1

I am currently using Element API to serve Craft contents.

What I'm wondering is, is it possible to create an endpoint that handle POST requests? Like form submission and such?

All the examples that I've seen so far is to serve Craft entries as JSON.

1

The ElementAPI plugin currently only supports consuming data from a Craft installation, not creating/POSTing to it.

It's on our long-term list to have a full on REST API for Craft where this would be possible, though.

| improve this answer | |
  • Ah, good to know. Any rough timeline on when you guys would have this ready? – bert_teng Dec 4 '15 at 18:48
  • Sorry, no ETA... – Brad Bell Dec 4 '15 at 18:55
3

You might want to check out this plug-in:

Restful Api

Restful Api is a plugin for Craft CMS that exposes elements as resources via a restful api. While similar to Craft's own Element Api plugin, Restful Api offers a few more features such as support for more HTTP verbs, authentication and element type based permissions.

Restful Api utilizes Fractal to transform and serialize responses. Restful Api is also PSR-7 complaint. Its request and response objects can even be utilized by third party plugins if desired, although this has not been extensively tested yet.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.