跳转到主要内容
uitstudio 提交于 8 November 2012

 

本文中,request接受application/json和multipart/form-data格式,个人建议尽量采用json格式,图片上传仅支持form-data格式,response仅返回application/json格式。

用户登录: 操作:POST 地址:http://demo.uitstudio.com/rest/user/login json:{"username":"","password":""}

用户注销: 操作:POST 地址:http://demo.uitstudio.com/rest/user/logout

用户注册: 操作:POST 地址:http://demo.uitstudio.com/rest/user/register json:{"name":"","pass":"","mail":""}

获取所有用户: 操作:GET 地址:http://demo.uitstudio.com/rest/user

获取单个用户: 操作:GET 地址:http://demo.uitstudio.com/rest/user/id

创建用户: 操作:POST 地址:http://demo.uitstudio.com/rest/user json:{"name":"","pass":"","mail":""}

更新用户: 操作:PUT 地址:http://demo.uitstudio.com/rest/user/id json:{"name":""}

删除用户: 操作:DELETE 地址:http://demo.uitstudio.com/rest/user/id

获取所有词汇: 操作:GET 地址:http://demo.uitstudio.com/rest/taxonomy_vocabulary

获取单个词汇: 操作:GET 地址:http://demo.uitstudio.com/rest/taxonomy_vocabulary/id

创建词汇: 操作:POST 地址:http://demo.uitstudio.com/rest/taxonomy_vocabulary json:{"name":"","machine_name":""}

更新词汇: 操作:PUT 地址:http://demo.uitstudio.com/rest/taxonomy_vocabulary/id json:{"name":""}

删除词汇: 操作:DELETE 地址:http://demo.uitstudio.com/rest/taxonomy_vocabulary/id

获取词汇树: 操作:POST 地址:http://demo.uitstudio.com/rest/taxonomy_vocabulary/getTree json:{"vid":"","parent":"","maxdepth":""}

获取所有术语: 操作:GET 地址:http://demo.uitstudio.com/rest/taxonomy_term

获取单个术语: 操作:GET 地址:http://demo.uitstudio.com/rest/taxonomy_term/id

创建术语: 操作:POST 地址:http://demo.uitstudio.com/rest/taxonomy_term json:{"name":"","vid":""}

更新术语: 操作:PUT 地址:http://demo.uitstudio.com/rest/taxonomy_term/id json:{"name":""}

删除术语: 操作:DELETE 地址:http://demo.uitstudio.com/rest/taxonomy_term/id

获取术语对应的节点: 操作:POST 地址:http://demo.uitstudio.com/rest/taxonomy_term/selectNodes json:{"tid":""}

获取所有节点: 操作:GET 地址:http://demo.uitstudio.com/rest/node

获取单个节点: 操作:GET 地址:http://demo.uitstudio.com/rest/node/id

创建节点: 操作:POST 地址:http://demo.uitstudio.com/rest/node json:{"title":"","type":"","body":{"und":[{"value":""}]}}

更新节点: 操作:PUT 地址:http://demo.uitstudio.com/rest/node/id json:{"title":""}

删除节点: 操作:DELETE 地址:http://demo.uitstudio.com/rest/node/id

获取节点关联的附件: 操作:GET 地址:http://demo.uitstudio.com/rest/node/id/files

获取节点的评论: 操作:GET 地址:http://demo.uitstudio.com/rest/node/id/comments

为节点添加附件: <form action="http://demo.uitstudio.com/rest/node/id/attach_file" method="post" enctype="multipart/form-data"> <input name="files[0]" type="file" /> <input name="files[1]" type="file" /><!--多文件--> <input name="field_name" type="text" value="field_image" /> <input name="attach" type="text" value="0" /> 0覆盖 1附加 <input type="submit" value="提交" /> </form>

获取所有评论: 操作:GET 地址:http://demo.uitstudio.com/rest/comment

获取单个评论: 操作:GET 地址:http://demo.uitstudio.com/rest/comment/id

创建评论: 操作:POST 地址:http://demo.uitstudio.com/rest/comment json:{"subject":"","comment_body":{"und":[{"value":"","format":""}]},"name":"","nid":"","uid":""}

更新评论: 操作:PUT 地址:http://demo.uitstudio.com/rest/comment/id json:{"subject":""}

删除评论: 操作:DELETE 地址:http://demo.uitstudio.com/rest/comment/id

获取评论总数: 操作:POST 地址:http://demo.uitstudio.com/rest/comment/countAll json:{"nid":""}

获取新评论总数: 操作:POST 地址:http://demo.uitstudio.com/rest/comment/countNew json:{"nid":"","since":""}

获取所有附件: 操作:GET 地址:http://demo.uitstudio.com/rest/file

获取单个附件: 操作:GET 地址:http://demo.uitstudio.com/rest/file/id

创建附件: 操作:POST 地址:http://demo.uitstudio.com/rest/file json:{"filename":"","file":"base64加密","uid":""}

删除附件: 操作:DELETE 地址:http://demo.uitstudio.com/rest/file/id

创建原始附件: <form action="http://demo.uitstudio.com/rest/file/create_raw" method="post" enctype="multipart/form-data"> <input name="files[0]" type="file" /> <input type="submit" value="提交" /> </form>

获取连接信息: 操作:POST 地址:http://demo.uitstudio.com/rest/system/connect

获取系统变量: 操作:POST 地址:http://demo.uitstudio.com/rest/system/get_variable json:{"name":""}

设置系统变量: 操作:POST 地址:http://demo.uitstudio.com/rest/system/set_variable json:{"name":"","value":""}

删除系统变量: 操作:POST 地址:http://demo.uitstudio.com/rest/system/del_variable json:{"name":""}

补充: parameters:过滤条件,如parameters[id]=id1,id2 fields:过滤字段,如fields=id,name pager:是否分页,如page=true/false pagesize:每页记录条数,如pagesize=value page:获取的页,如page=value count:获取的记录条数,如count=value offset:偏移的记录条数,如offset=value

Taxonomy upgrade extras