#Node Resource ##Retrieve
- Args:
- HTTP Method : GET
- Example URL : http://drupal6-services/services/plist/node/1
- Expected Response(in JSON):
{"nid":"1","type":"story","language":"","uid":"0","status":"0","created":"1286592762","changed":"1286592762","comment":"2","promote":"0","moderate":"0","sticky":"0","tined":"0","translate":"0","vid":"1","revision_uid":"1","title":"test","body":"test","teaser":"test","log":"","revision_timestamp":"1286592762","format":"1","name":"","picture":"","data":null,"last_comment_timestamp":"1286592762","last_comment_name":null,"comment_count":"0","taxonomy":[],"files":[],"uric":"http:\/\/drupal6-services\/services\/plist\/node\/1"}
##Create
- Args: node*
- HTTP Method: POST
- Example URL : http://drupal6-services/services/plist/node
- Example: &node[title]=testnode&node[type]=story&node[field_test][0][value]=testtting
- Notes: field_test is a CCK field.
- Expected Response(in JSON):
{"nid":"45","uri":"http:\/\/drupal6-services\/services\/plist\/node\/45"}
##Update
- Args: node*
- HTTP Method: PUT
- Example URL : http://drupal6-services/services/plist/node/1
- Example: &node[title]=testnode&node[type]=story&node[field_test][0][value]=testtting
- Expected Response(in JSON):
"1"
##Delete
- Args:
- HTTP Method: DELETE
- Example URL : http://drupal6-services/services/plist/node/1
- Example:
- Expected Response(in JSON):
1
#Comment Resource ##Retrieve
- Args:
- HTTP Method : GET
- Example URL : http://drupal6-services/services/plist/comment/30
- Expected Response(in JSON):
{"cid":"30","pid":"0","nid":"48","uid":"1","subject":"asdfadf","comment":"dfgsdfgsdg","hostname":"127.0.0.1","timestamp":"1294792128","status":"0","format":"1","thread":"01\/","name":"admin","mail":"","homepage":""}
##Create
- Args: comment*
- HTTP Method: POST
- Example URL : http://drupal6-services/services/plist/comment
- Example:&comment[body]=commentbody&comment[nid]=49
- Expected Response(in JSON):
{"cid":"31","uri":"http:\/\/drupal6-services\/services\/plist\/comment\/31"}
##Update
- Args: data*
- HTTP Method: PUT
- Example URL : http://drupal6-services/services/plist/comment/30
- Example: &data[body]=commentbody&data[nid]=49
- Expected Response(in JSON):
"30"
##Delete
- Args:
- HTTP Method: DELETE
- Example URL : http://drupal6-services/services/plist/comment/30
- Example:
- Expected Response(in JSON):
1
#User Resource ##Retrieve
- Args:
- HTTP Method : GET
- Example URL : http://drupal6-services/services/plist/user/1
- Expected Response(in JSON):
{"uid":"1","name":"admin","pass":"1a1dc91c907325c69271ddf0c944bc72","mail":"kyle@workhabit.com","mode":"0","sort":"0","threshold":"0","theme":"","signature":"","signature_format":"0","created":"1286571725","access":"1294792121","login":"1293782855","status":"1","timezone":null,"language":"","picture":"","init":"kyle@workhabit.com","data":"a:0:{}","roles":{"2":"authenticated user"}}
##Create
- Args: account*
- HTTP Method: POST
- Example URL : http://drupal6-services/services/plist/user
- Example: &account[name]=test&account[mail]=test@test.com&account[pass]=pass
- Expected Response(in JSON):
{"uid":"15","name":"test","pass":"1a1dc91c907325c69271ddf0c944bc72","mail":"test@test.com","mode":"0","sort":"0","threshold":"0","theme":"","signature":"","signature_format":"0","created":"1294793391","access":"1294793391","login":"0","status":"1","timezone":"-25200","language":"","picture":"","init":"test@test.com","data":"a:0:{}","roles":{"2":"authenticated user"},"password":"pass"}
##Update
- Args: data*
- HTTP Method: PUT
- Example URL : http://drupal6-services/services/plist/user/15
- Example: &data[name]=test&data[mail]=test@testing.com&data[pass]=pass
- Expected Response(in JSON):
{"name":"test","mail":"test@testing.com","pass":"pass","uid":"15"}
##Delete
- Args:
- HTTP Method: DELETE
- Example URL : http://drupal6-services/services/plist/user/15
- Example:
- Expected Response(in JSON):
1
##Login
- Args:
- HTTP Method: POST
- Example URL : http://drupal6-services/services/plist/user/login
- Example: &name=admin&pass=pass
- Expected Response(in JSON):
{"sessid":"853c6c7f6eaa051724080dff202eeec0","session_name":"SESS8b1f176c338bbcc3922a56004cec3c41","user":{"uid":"1","name":"admin","pass":"1a1dc91c907325c69271ddf0c944bc72","mail":"kyle@workhabit.com","mode":"0","sort":"0","threshold":"0","theme":"","signature":"","signature_format":"0","created":"1286571725","access":"1294794381","login":1294794548,"status":"1","timezone":null,"language":"","picture":"","init":"kyle@workhabit.com","data":"a:0:{}","roles":{"2":"authenticated user"}}}
##Logout
- Args:
- HTTP Method: POST
- Example URL : http://drupal6-services/services/plist/user/logout
- Example:
- Expected Response(in JSON):
1
Hi,
Thanks for taking the time to respond. I tried what you suggested, but got the same error. - HTTP 406 - User Not logged in. attached is a log.
Request :
curl http://127.0.0.1:8080/drupal622/myendpoint/system/connect -d"" -v
Resposne:
{"sessid":"atc8335n25ak2b8d3ii6h04bi4","user":{"uid":0,"hostname":"127.0.0.1","roles":{"1":"anonymous user"},"session":"","cache":0}}
Request:
curl http://127.0.0.1:8080/drupal622/myendpoint/user/login -d"username=user&password=pass&sessid=atc8335n25ak2b8d3ii6h04bi4" -v
< Date: Sun, 11 Sep 2011 18:37:30 GMT
< Server: Apache/2.2.17 (Win32) PHP/5.3.5
< X-Powered-By: PHP/5.3.5
< Set-Cookie: SESS0902a91cf59c38431753fb2428aaaeea=83hp3e9lqtoaujlerpo9a9n8c0; expires=Tue, 04-Oct-2011 22:10:51 GMT; pa
th=/
< Expires: Sun, 19 Nov 1978 05:00:00 GMT
< Last-Modified: Sun, 11 Sep 2011 18:37:31 GMT
< Cache-Control: store, no-cache, must-revalidate
< Cache-Control: post-check=0, pre-check=0
< Vary: Accept
< Set-Cookie: SESS0902a91cf59c38431753fb2428aaaeea=l3olkdfneiadvrv7t33k0tefu4; expires=Tue, 04-Oct-2011 22:10:52 GMT; pa
th=/
< Set-Cookie: SESS0902a91cf59c38431753fb2428aaaeea=4g05o3hq1r5gnf6i94ev5c01h1; expires=Tue, 04-Oct-2011 22:10:52 GMT; pa
th=/
< Content-Length: 646
< Content-Type: application/json
<
{"sessid":"4g05o3hq1r5gnf6i94ev5c01h1","session_name":"SESS0902a91cf59c38431753fb2428aaaeea","user":{"uid":"3","name":"u
ser","pass":"1a1dc91c907325c69271ddf0c944bc72","mail":"user@abcdefgh.net","mode":"0","sort":"0","threshold":"0","theme":
"","signature":"","signature_format":"0","created":"1309028308","access":"1315765845","login":1315766252,"status":"1","t
imezone":"-14400","language":"","picture":"","init":"user@abcdefg.net","data":"a:1:{s:13:"form_build_id";s:37:"form-
69a6d76484049252cfb469a3bc76266e";}","timezone_name":"America/New_York","form_build_id":"form-69a6d76484049252cfb469a3
bc76266e","roles":{"2":"authenticated user"}}}* Connection #0 to host 127.0.0.1 left intact
Request:
curl http://127.0.0.1:8080/drupal622/myendpoint/user/logout -d "" -H "Cookie: SESS0902a91cf59c38431753fb2428aaaeea=4g05o3hq1r5gnf6i94ev5c01h1;" -v
< HTTP/1.0 406 Not Acceptable: User is not logged in.
< Date: Sun, 11 Sep 2011 18:44:13 GMT
< Server: Apache/2.2.17 (Win32) PHP/5.3.5
< X-Powered-By: PHP/5.3.5
< Expires: Sun, 19 Nov 1978 05:00:00 GMT
< Last-Modified: Sun, 11 Sep 2011 18:44:14 GMT
< Cache-Control: store, no-cache, must-revalidate
< Cache-Control: post-check=0, pre-check=0
< Vary: Accept
< Content-Length: 4
< Connection: close
< Content-Type: application/json
<
null* Closing connection #0