活动接口文档 -- 更新帖子和回帖
好热闹 活动
更新帖子
Method and URL Structure
| Method |
Resource URL |
| POST |
/activity/${topic_id}/topic_update/ |
Request Parameters
参数以 application/json 格式,在 request.body 中传递给接口
| Name |
Description |
Required |
Default |
| username |
用户名 |
YES |
|
| password |
密码 |
YES |
|
| topic |
帖子 |
YES |
|
Activity Data Member List
| Name |
Description |
Required |
Max Length |
Default |
| title |
标题 |
YES |
64 |
|
| content |
内容 |
YES |
|
|
| pictures |
图片列表 |
NO |
|
|
| vidoes |
视频列表 |
NO |
|
|
Request
{ "username":"18012345678", "password":"123456", "topic":{ "title": "Online Activity Testing 001", "content": "You need a fully-functional a middleware that", "pictures":"pic1,pic2,pic3", "videos":"1.mp4,2.mp4,3.mp4", }}
cURL Example
$ curl -H "Accept: application/json" -H "Content-Type: applcaitonjson" -X POST \--data '{ "topic": { "title":"This is testing teaching topic 001", "content":"You will likely use the django.contrib.auth.backends.ModelBackend along with the OAuth2 backend (or you might not be able to log in into the admin), only pay attention to the order in which Django processes authentication backends.", }}' 'http://www.haorenao.cn/activity/123/topic_update/'
JSON Response
| Name |
Description |
NOTE |
| ret |
标识是否成功。 |
@Depracted |
| reason |
失败原因 |
@Depracted |
| status |
Status Code |
|
| message |
Failure Message |
|
{ "ret":"ok", # ok, 成功; failed, 失败 "reason":"", "status":0, "message":"",}
更新回帖
只有加入活动的用户能回帖
Method and URL Structure
| Method |
Resource URL |
| POST |
/activity/${post_id}/post_update/ |
Request Parameters
参数以 application/json 格式,在 request.body 中传递给接口
| Name |
Description |
Required |
Default |
| username |
用户名 |
YES |
|
| password |
密码 |
YES |
|
| post |
回帖 |
YES |
|
Activity Data Member List
| Name |
Description |
Required |
Default t |
| content |
内容 |
YES |
|
| pictures |
图片列表 |
NO |
|
| vidoes |
视频列表 |
NO |
|
Request
{ "username":"18012345678", "password":"123456", "post":{ "content": "You need a fully-functional a middleware that", "pictures":"pic1,pic2,pic3", "videos":"1234.mp4," }}
cURL Example
$ curl -H "Accept: application/json" -H "Content-Type: applcaitonjson" -X POST \--data '{ "post": { "content":"What you need to do is decide when and how those token objects should be created. In your app, does every user automatically get a token? Or only certain authorized users? Or only when they specifically request one?" "pictures":"pic1.jpg,pic2.jpg", "vidoes":"1.mp4,2.mp4", }}' 'http://www.haorenao.cn/activity/1935/post_update/'
JSON Response
| Name |
Description |
NOTE |
| ret |
标识是否成功。 |
@Depracted |
| reason |
失败原因 |
@Depracted |
| status |
Status Code |
|
| message |
Failure Message |
|
{ "ret":"ok", # ok, 成功; failed, 失败 "reason":"", "status":0, "message":"",}