Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you create a user using RESTServer in Drupal?

Tags:

drupal

Using REST Server 6.x-2.0-beta3, I'm trying to understand how to post to user.save.

curl -d 'XX' -v http://localhost/services/rest/service_user/save

I've tried to replace XX with:

  • account{'name':'myname','pass':'mypassword','mail':'[email protected]'}
  • account = {'name':'myname','pass':'mypassword','mail':'[email protected]'}
  • account="name=myname,pass=mypassword,mail=myemail.org"
  • account=name=myname,pass=mypassword,mail=myemail.org
  • account=myname,mypassword,myemail.org

But none of these seems to be right and finding any documention regarding this is next to impossible.

I've also tried the following:

curl -H "Content-Type: application/json" -d 'account={"name":"myname","pass":"mypassword","email":"123"}' -v http://localhost/services/rest/service_user/save

The error I get in this case is:

HTTP/1.0 406 Not Acceptable: Missing required argument account

like image 808
D. Wroblewski Avatar asked Feb 25 '26 20:02

D. Wroblewski


1 Answers

Hi I also just started working with this module and wondering how to create content using JSON.

Just been able to create a simple node using this:

Post URL: http://path-to-site/services/rest/node

Request Header: Content-Type: application/json

Request Body: {"type":"story","title":"REST Test","body":"REST using JSON"}

I think you're using the wrong URL

like image 140
Ranil Wijeyratne Avatar answered Feb 27 '26 10:02

Ranil Wijeyratne