public interface DrupalService
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":"[email protected]","mode":"0","sort":"0","threshold":"0","theme":"","signature":"","signature_format":"0","created":"1286571725","access":"1294792121","login":"1293782855","status":"1","timezone":null,"language":"","picture":"","init":"[email protected]","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][email protected]&account[pass]=pass Expected Response(in JSON): {"uid":"15","name":"test","pass":"1a1dc91c907325c69271ddf0c944bc72","mail":"[email protected]","mode":"0","sort":"0","threshold":"0","theme":"","signature":"","signature_format":"0","created":"1294793391","access":"1294793391","login":"0","status":"1","timezone":"-25200","language":"","picture":"","init":"[email protected]","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][email protected]&data[pass]=pass Expected Response(in JSON): {"name":"test","mail":"[email protected]","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":"[email protected]","mode":"0","sort":"0","threshold":"0","theme":"","signature":"","signature_format":"0","created":"1286571725","access":"1294794381","login":1294794548,"status":"1","timezone":null,"language":"","picture":"","init":"[email protected]","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
Modifier and Type | Interface and Description |
---|---|
static class |
DrupalService.Comment |
static class |
DrupalService.Login |
static class |
DrupalService.Logout |
static class |
DrupalService.Node
Node.
|
static class |
DrupalService.Picture |
static class |
DrupalService.User |
static class |
DrupalService.Views |
static class |
DrupalService.Vocabulary |
Modifier and Type | Method and Description |
---|---|
void |
addComment(java.lang.String comment,
int nid,
|
void |
addComment(java.lang.String subject,
java.lang.String comment,
int nid,
Create comment.
|
void |
deleteComment(int cid,
Delete comment.
|
void |
getComment(int cid,
Get comment.
|
void |
getNode(int nid,
|
void |
getProfile(
userProfile.
|
void |
getProfile(java.lang.String accessToken,
|
void |
getTaxonomyVocabulary(int vid,
int parent,
|
void |
getTaxonomyVocabulary(int vid,
int parent,
int maxdepth,
|
void |
getToken( |
void |
getToken(java.lang.String username,
java.lang.String password,
|
void |
getUser(int uid,
getUser.
|
void |
getUser(int uid,
java.lang.String accessToken,
|
void |
getViews(java.lang.String name,
int limit,
java.lang.String args,
int displayId,
|
void |
login(java.lang.String username,
java.lang.String password,
userLogin.
|
void |
logout(
userLogout.
|
|
observeLogin(java.lang.String username,
java.lang.String password) |
|
observeToken() |
void |
register(java.lang.String username,
java.lang.String email,
java.lang.String password,
Register.
|
void |
setComment(int cid,
java.lang.String comment,
int nid,
Update comment.
|
void |
systemConnect( |
void register(java.lang.String username, java.lang.String email, java.lang.String password,callback)
Args: account* HTTP Method: POST Example URL : http://drupal6-services/services/plist/user Example: &account[name]=test&account[mail][email protected]&account[pass]=pass Expected Response(in JSON): { "password": "pass", "roles": { "2": "authenticated user" }, "data": "a:0:{}", "init": "[email protected]", "picture": "", "theme": "", "threshold": "0", "sort": "0", "mode": "0", "mail": "[email protected]", "pass": "1a1dc91c907325c69271ddf0c944bc72", "name": "test", "uid": "15", "signature": "", "signature_format": "0", "created": "1294793391", "access": "1294793391", "login": "0", "status": "1", "timezone": "-25200", "language": "" }
void login(java.lang.String username, java.lang.String password,callback)
Args: HTTP Method: POST Example URL : http://drupal6-services/services/plist/user/login Example: &name=admin&pass=pass
observeLogin(java.lang.String username, java.lang.String password)
void getProfile(callback)
resource provided by oauth2_login_provider module.
Args: HTTP Method: POST Example URL : http://drupal6-services/services/plist/user/login Example: &access_token or with cookie/session header
void getProfile(java.lang.String accessToken,callback)
void getUser(int uid,callback)
Example URL : http://drupal6-services/services/plist/user/1 Expected Response(in JSON): {"uid":"1","name":"admin","pass":"1a1dc91c907325c69271ddf0c944bc72","mail":"[email protected]","mode":"0","sort":"0","threshold":"0","theme":"","signature":"","signature_format":"0","created":"1286571725","access":"1294792121","login":"1293782855","status":"1","timezone":null,"language":"","picture":"","init":"[email protected]","data":"a:0:{}","roles":{"2":"authenticated user"}}
void getUser(int uid, java.lang.String accessToken,callback)
void logout(callback)
Args: HTTP Method: POST Example URL : http://drupal6-services/services/plist/user/logout Example: Expected Response(in JSON): 1
void systemConnect(callback)
void getNode(int nid,callback)
void getTaxonomyVocabulary(int vid, int parent,callback)
void getTaxonomyVocabulary(int vid, int parent, int maxdepth,callback)
void getViews(java.lang.String name, int limit, java.lang.String args, int displayId,callback)
void getToken(java.lang.String username, java.lang.String password,callback)
void getToken(callback)
observeToken()
void getComment(int cid,callback)
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":""} curl -k -c cookie -b cookie -X GET 'https://example.com/api/comment/1.json' -H 'X-CSRF-Token: JAndrohmVrkBkRq7PoGwSsI6MoPGQz0VixZgyKC7XaQ'
void addComment(java.lang.String subject, java.lang.String comment, int nid,callback)
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"} curl -k -c cookie.txt -b cookie.txt -X POST 'https://example.com/api/comment.json' -H 'X-CSRF-Token: JAndrohmVrkBkRq7PoGwSsI6MoPGQz0VixZgyKC7XaQ' -d 'nid=2&subject=yo&comment_body[und][0][value]=yoo'
tests/functional/ServicesResourceCommentTests.test
void addComment(java.lang.String comment, int nid,callback)
void setComment(int cid, java.lang.String comment, int nid,callback)
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"
{ "path": "https://example.com/content/test", "data": "a:2:{s:20:\"l10n_client_disabled\";b:0;s:7:\"overlay\";i:1;}", "picture": "0", "name": "foo", "comment_count": "0", "last_comment_uid": "1", "last_comment_name": null, "last_comment_timestamp": "1389341070", "cid": "0", "rdf_mapping": { "last_activity": { "callback": "date_iso8601", "datatype": "xsd:dateTime", "predicates": [ "sioc:last_activity_date" ] }, "rdftype": [ "foaf:Document" ], "title": { "predicates": [ "dc:title" ] }, "created": { "callback": "date_iso8601", "datatype": "xsd:dateTime", "predicates": [ "dc:date", "dc:created" ] }, "changed": { "callback": "date_iso8601", "datatype": "xsd:dateTime", "predicates": [ "dc:modified" ] }, "body": { "predicates": [ "content:encoded" ] }, "uid": { "type": "rel", "predicates": [ "sioc:has_creator" ] }, "name": { "predicates": [ "foaf:name" ] }, "comment_count": { "datatype": "xsd:integer", "predicates": [ "sioc:num_replies" ] } }, "body": { "und": [ { "safe_summary": "", "safe_value": "test
\n", "format": "filtered_html", "summary": "", "value": "test" } ] }, "revision_uid": "1", "sticky": "0", "promote": "0", "comment": "1", "status": "1", "log": "", "title": "test", "uid": "1", "vid": "1", "nid": "1", "type": "page", "language": "und", "created": "1389341070", "changed": "1389341070", "tnid": "0", "translate": "0", "revision_timestamp": "1389341070" }
void deleteComment(int cid,callback)
Args: n/a HTTP Method: DELETE Example URL : http://drupal6-services/services/plist/comment/30 Example: Expected Response(in JSON): 1