<p>You'd normally use a front-end form to create users on a Craft site. You can add fields to this form to submit more than the standard set of fields. I believe you could use the same form within your Express app. You are just sending the data via a POST request.</p>

<p>Check <a href="https://craftcms.com/docs/templating/user-registration-form" rel="nofollow">the documentation</a> for an example.</p>

CC BY-SA 3.0
2016-08-11T14:32:37.800Z
Hey Luke. Thanks for the advice. Perhaps I don't fully understand the concept of what you are trying to help me with. Firstly, even if I should use the form, where would I point that form to. How would my express server even know where the data needs to go. Also, how would craft even know where and how to save the data. Sorry. I have never had to use a form before for CRAFT. I don't really want to waist time on something thats not really helpfull.
Gevann Mullins
CC BY-SA 3.0
2016-08-11T14:35:57.427Z
When you make your request to the Element API you are hitting Craft's files and in turn the database. Your form would have an action URL which runs a controller within Craft to create the new user and add the data. This data would then be retrievable via the Element API.
Luke Pearce
CC BY-SA 3.0
2016-08-11T14:59:16.153Z
So what you are saying is that I can create an endpoint in ElementAPI, send my form data to that endpoint, write a function for that endpoint to handle the data and save it to the Craft database. Makes sense. Just a quick question on that, would I then have to use something in the line of "entries->saveEntry($entry)". And then just make sure that my $entry contains all my data that I would like to save. Thanks for the assistance so far. It is really appreciated.
Gevann Mullins
CC BY-SA 3.0
2016-08-11T15:30:07.787Z
I'm saying Craft has already written the functionality, all you need to do is send the data to the action URL `users/saveUser` https://craftcms.com/docs/plugins/controllers#linking-directly-to-controller-actions
Luke Pearce
CC BY-SA 3.0
2016-08-11T17:18:18.547Z
@GevannMullins: how are you running node.js and calling Craft?  ElementAPI is strictly [one-dimensional](http://craftcms.stackexchange.com/questions/12692/creating-a-post-request-endpoint-using-element-api). You can **get** data but you can't pass it back in. You're basically using Craft like a headless CMS, correct? If you do it that way, that means you need to build some sort of functionality to handle what you're looking to do.  In Craft, typically that functionality comes in the form of plugins unless there's a built-in controller action to handle it.
RitterKnight
CC BY-SA 3.0
2016-08-11T17:19:23.470Z
If you're looking for a more RESTful way to get data, you might want to consider using the [http messages](https://github.com/airtype/craft-httpmessages) plugin (which is a newer version of the old [restfulapi](https://github.com/airtype/restfulapi)).
RitterKnight
CC BY-SA 3.0
2016-08-11T18:00:08.543Z
@ritterKnight. Yes you are correct. So far ElementAPI has been working well to get data from Craft and till now this has been all I have been needing from craft. I've done some research regarding ElementAPI and as far as I know it is only a one way endpoint. But now I need to post data to Craft and there is lies my problem. Thanks for pointing me to HttpMessages. I will have a look and see how this will work for me. Is there any further advice you can share on how I can use this plugin to save entries to Craft. Any advice will be most welcome
Gevann Mullins
CC BY-SA 3.0
2016-08-11T14:03:35.640Z
2016-08-11T14:03:35.640Z
Luke Pearce
<p>First of all let me just say that I have only been using Craft for a few months and still has allot to learn about it.</p>

<p>My issue is quite simple in that I have an express server running to display the data on the front-end. I am using Craft as a solution for the client to add or change content on their site. This is working well. I am even able to use your Element API to retrieve data from Craft and together with my Express server I can manipulate and display content where it is needed. </p>

<p>My client has now recently asked me to add a section that would allow users to register users and this is where I am starting to have problems. Or at least, this is where I need some expert knowledge.</p>

<p>I would just like to save the user data via post. I have looked at a few options out there but honestly I don't want to build a plugin to handle this. Is there a way I could post and save data to Craft without it being too complicated?</p>

CC BY-SA 3.0
2016-08-11T17:10:35.283Z
When you say users register users, are you asking about an admin adding users? Or website users themselves registering for an "account" on the site?
RitterKnight
<users><post>
Express Server posting user data to Craft
# Express Server posting user data to Craft

(Asked by: username_0 on 2016-08-11)

First of all let me just say that I have only been using Craft for a few months and still has allot to learn about it.

My issue is quite simple in that I have an express server running to display the data on the front-end. I am using Craft as a solution for the client to add or change content on their site. This is working well. I am even able to use your Element API to retrieve data from Craft and together with my Express server I can manipulate and display content where it is needed.

My client has now recently asked me to add a section that would allow users to register users and this is where I am starting to have problems. Or at least, this is where I need some expert knowledge.

I would just like to save the user data via post. I have looked at a few options out there but honestly I don't want to build a plugin to handle this. Is there a way I could post and save data to Craft without it being too complicated?

**Tags:** users, post
> **Comments:**
> **username_1**: When you say users register users, are you asking about an admin adding users? Or website users themselves registering for an "account" on the site?  

---

## 1 answers

### Answer by username_2 on 2016-08-11. Score: 2

You'd normally use a front-end form to create users on a Craft site. You can add fields to this form to submit more than the standard set of fields. I believe you could use the same form within your Express app. You are just sending the data via a POST request.

Check [the documentation](https://craftcms.com/docs/templating/user-registration-form) for an example.

> **Comments:**
> **username_0**: Hey Luke. Thanks for the advice. Perhaps I don't fully understand the concept of what you are trying to help me with. Firstly, even if I should use the form, where would I point that form to. How would my express server even know where the data needs to go. Also, how would craft even know where and how to save the data. Sorry. I have never had to use a form before for CRAFT. I don't really want to waist time on something thats not really helpfull.  
> **username_2**: When you make your request to the Element API you are hitting Craft's files and in turn the database. Your form would have an action URL which runs a controller within Craft to create the new user and add the data. This data would then be retrievable via the Element API.  
> **username_0**: So what you are saying is that I can create an endpoint in ElementAPI, send my form data to that endpoint, write a function for that endpoint to handle the data and save it to the Craft database. Makes sense. Just a quick question on that, would I then have to use something in the line of "entries->saveEntry($entry)". And then just make sure that my $entry contains all my data that I would like to save. Thanks for the assistance so far. It is really appreciated.  
> **username_2**: I'm saying Craft has already written the functionality, all you need to do is send the data to the action URL `users/saveUser` https://craftcms.com/docs/plugins/controllers#linking-directly-to-controller-actions  
> **username_1**: @GevannMullins: how are you running node.js and calling Craft?  ElementAPI is strictly [one-dimensional](http://craftcms.stackexchange.com/questions/12692/creating-a-post-request-endpoint-using-element-api). You can **get** data but you can't pass it back in. You're basically using Craft like a headless CMS, correct? If you do it that way, that means you need to build some sort of functionality to handle what you're looking to do.  In Craft, typically that functionality comes in the form of plugins unless there's a built-in controller action to handle it.  
> **username_1**: If you're looking for a more RESTful way to get data, you might want to consider using the [http messages](https://github.com/airtype/craft-httpmessages) plugin (which is a newer version of the old [restfulapi](https://github.com/airtype/restfulapi)).  
> **username_0**: @ritterKnight. Yes you are correct. So far ElementAPI has been working well to get data from Craft and till now this has been all I have been needing from craft. I've done some research regarding ElementAPI and as far as I know it is only a one way endpoint. But now I need to post data to Craft and there is lies my problem. Thanks for pointing me to HttpMessages. I will have a look and see how this will work for me. Is there any further advice you can share on how I can use this plugin to save entries to Craft. Any advice will be most welcome  

---

