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’:’my@email.org’}
- account = {‘name’:’myname’,’pass’:’mypassword’,’mail’:’my@email.org’}
- 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
I figured it out:
curl -H “application/x-www-form-urlencoded” -d “sessid=xxxx” -d “account[name]=MyName&account[pass]=mypass&account[mail]=myemail@gmail.com&account[conf_mail]=myemail@gmail.com” -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).