I've set a service named "test" (endpoint "services/test") activating the "user/retrieve" resource. D7 is installed in a subdir. Using REST I reach the service at "http://www.example.com/path/to/d7/services".

Pointing to "http://www.example.com/path/to/d7/services/test/user/retrieve" I get an XML "<result/>".
Pointing to "http://www.example.com/path/to/d7/services/test/user/retrieve/1.json" I get an XML "Oops! This link appears broken.".

Am i wrong somehow? Thankx.

Comments

cotto’s picture

Please read the documentation more carefuly. servers/rest_server/README.markdown says that a GET request to api-endpoint/user/1 will get you the data for uid 1 using the user resource's retrieve method.

You'll also need to set up an endpoint, which you can do from the Structure -> Services menu.

tpainton’s picture

I have to say, I too am confused. The document you mention says nothing about users.. It specifically talks about nodes.. not users. I followed the exact same docs the initial poster did (http://drupal.org/node/783722) and arrived at the same errors. I've been programming in php for 5 years.. I know that stuff, but it's amazing to me that after two days, I still cannot simply return information from the REST server.. Instead I get null, I get empty XML etc and I'm following the docs word for word.. Clearly, so is the original poster because we have identical errors.

Really what the module needs is a just a very simple, one page doc that shows how to set up, and test the REST server. The readme.markdown is confusing. I've read it 10 times.. what is this?

X = CRUD
A = Action
T = Targeted action
R = Relationship request

COUNT |0|1|2|3|4|N|
-------------------
GET |X|X|R|R|R|R|
-------------------
POST |X|A|T|T|T|T|
-------------------
PUT | |X| | | | |
-------------------
DELETE| |X| | | | |
-------------------

This means nothing to me. I'm sure a concrete example would make it crystal clear.

I have found that there really are not very many truly confusing things in php/drupal.. there is a lot of confusing documentation however..

tpainton’s picture

and by the way, the solution to the problem of the original poster lies in making sure that "Session Authentication" is checked.. I know this makes no sense because because it clearly states beneath this option, "Choose which authentication schemes that should be used with your endpoint. If no authentication method is selected all requests will be done by an anonymous user." So it leads one to believe you don't need anything checked, in fact you do to get your XML filled in..

kylebrowning’s picture

Status: Active » Closed (won't fix)

Thats because you cant retrieve a user as anonymous.

Elementica’s picture

I don't think that's the point... first I've said nothing about authentication (!), anyway the same happens for any other resouce... which one could I try (say without authentication, as I also need anonymous services)? Also "node/retrieve", "services_test/test" and other resources arise the same message (so "<result/>" with an url ending with the resource reference - like ".../node/retrieve" - and "link broken" if I add a parameter)... which one could I try, so? Thankx!