注册新用户
新版API将会发送验证短信到用户手机,届时一个将会对同一手机的注册严格控制频率。
Form Parameters: | |
---|---|
|
|
Status Codes: |
|
用户认证,获取用户的token。
当存在device_token字段时,将登记设备用于接受消息推送。
响应:
HTTP/1.1 201 OK
Content-Type: application/json
{
"access_token": "a80ba5617b6c4ec6acae2475a9cbdaee",
"token_type": "bearer",
"user": {
"username": "test",
"first_name": "",
"id": 1
},
"refresh_token": "139881d1e4ad4fb18038287453f951a2"
}
Form Parameters: | |
---|---|
|
|
Status Codes: |
|
注册设备,在didRegisterForRemoteNotificationsWithDeviceToken中注册Token 如果Token更改或者第一次启动应用。
输出:
HTTP/1.1 200 OK
Content-Type: application/json
{
"pk": 1,
"model": "ios_notifications.device",
"fields": {
"deactivated_at": null,
"users": [],
"service": 1,
"platform": "",
"last_notified_at": null,
"is_active": true,
"added_at": "2013-05-09T07:17:39Z",
"os_version": "",
"token": "a4faf00f4654246b9fd7e78ae29a49b321673892ae81721b8e74ad9d285b3c27",
"display": ""
}
}
Form Parameters: | |
---|---|
|
|
Statuscode : | 201 |
推送消息到iOS设备。
官方专用API,需要发送Base-Auth验证有权限的账号。
Form Parameters: | |
---|---|
|
|
Status Codes: |
|
拉取活动列表。
响应:
HTTP/1.1 200 OK
Content-Type: application/json
[
{
"id": 2,
"subject": "The second activity."
"owner": {
"username": "test",
"first_name": "",
"id": 1
},
"user": [
{
"username": "test",
"first_name": "",
"id": 1
}
],
}
]
Query Parameters: | |
---|---|
|
|
Status Codes: |
|
创建活动,当邀请的用户注册时自动成为活动的成员。
响应:
HTTP/1.1 200 OK
Content-Type: application/json
{
"id": 2,
"subject": "The second activity."
"owner": {
"username": "test",
"first_name": "",
"id": 1
},
"user": [
{
"username": "test",
"first_name": "",
"id": 1
}
],
}
Form Parameters: | |
---|---|
|
:form invitations:邀请朋友,格式是手机号码,半角逗号分割多个号码。 :form access_token: Access token :statuscode 200: 成功
获取最新的消息。
输出:
HTTP/1.1 200 OK
Content-Type: application/json
[
]
Query Parameters: | |
---|---|
|
|
Status Codes: |
|
发送消息。
Form Parameters: | |
---|---|
|
|
Status Codes: |
|
获得聊天纪录。
输出:
HTTP/1.1 200 OK
Content-Type: application/json
[
{
"chat_id": 1001,
"text": "Chat text 1001.",
"created_at": "",
},
{
"chat_id": 1002,
"text": "Chat text 1002.",
"created_at": "",
}
]
Query Parameters: | |
---|---|
|
|
Status Codes: |
|
获得聊天内容,当聊天内容超过字数后,需要从这个资源里获得完整的内容。
输出:
HTTP/1.1 200 OK
Content-Type: application/json
{
"id": 1,
"text": "hello",
"activity": {
"id": 1,
"subject": "Activity subject.",
"owner": [
{
"id": 1,
"first_name": "CJ"
}
],
"users": [
{
"id": 1,
"first_name: "CJ"
}
]
},
"created_at": ""
}
Query Parameters: | |
---|---|
|
|
Status Codes: |
|
发送聊天,成功以后会给该活动下所有成员发送聊天内容(除了发送者本人)。
Form Parameters: | |
---|---|
|
|
Status Codes: |
|