3

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

1

2 Answers 2

2

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

Sign up to request clarification or add additional context in comments.

1 Comment

The user service isn't available as a resource oriented service in services 6-2, so /services/rest/user isn't available.
1

I figured it out:

curl -H “application/x-www-form-urlencoded” -d "sessid=xxxx" -d "account[name]=MyName&account[pass]=mypass&account[mail][email protected]&account[conf_mail][email protected]" -v http://path-to-site/services/rest/service_user/save

You only have to add -d "sessid=xxxx" if you have configured Services to require a session. Make sure in that case to replace xxxx with your actual session id (from system.connect).

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.