Skip to content
Insane edited this page Sep 9, 2015 · 1 revision

1. POST /login.do

request payload:

{"account_name": "13408654680", "password": "111111"}

json response:

{
"error_code": 0, 
"username": "袋鼠", 
"school_name": "成都市第三军区幼儿园", 
"access_token": "134232308654680", 
"account_name": "13408654680"
}

2. POST /checkphonenum.do

request payload:

{"phonenum": "13408654680"}

json response:

{"check_phone_result": "1102"}

1101 means 'phone number is inactive'

1102 means ok

1100 means no such phone number registered

3. POST /receiveBindInfo.do (deprecated)

replaced by /api/v1/binding

Bind the phone number with push information and related privilege.

It will reset the token after each successful binding.

request payload:

{
"phonenum": "13408654680", 
"user_id": "925387477040815555", 
"channel_id": "", 
"device_type": "ios", 
"access_token": "1386849160299"
}

device_type: "ios" or "android" by default.

access_token comes from /login.do response.

user_id is the Pushid which should be retrieved from baidu push notification sdk from mobile client

json response:

{
  "error_code":0,
  "access_token":"1386849160798",
  "username":"袋鼠",
  "account_name":"13408654680",
  "school_id":93740362,
  "school_name":"成都市第三军区幼儿园"
}

error_code:

1 -> no valid phone number at all, which means the phone number does not exists or has been deleted by school

2 -> user is expired, it is also possible because the whole school are expired as well.

3 -> only token is invalid, which is more likely that someone else logged this phone number into our system

0 -> success

if the binding method is failing, please ask user to re-login again.

4. POST /resetpwd.do

Reset the password by auth code to given new password.

It will reset the token after each successful resetting.

request payload:

{
"account_name": "1386849160798", 
"authcode": "111111", 
"new_password": "222222"
}

json response:

{"error_code":0,"access_token":"1393763572585"}

5. POST /changepwd.do

Change the password to a new one.

*** It will reset the token after each successful changing. ***

request payload:

{
"account_name": "1386849160798", 
"old_password": "111111", 
"new_password": "333333"
}

json response:

{"error_code":0,"access_token":"1393763572585"}

6. POST /api/v1/binding

New version of /receiveBindInfo.do the phone number with push information and related privilege.

It will reset the token after each successful binding.

request payload:

{
"phonenum": "13408654680", 
"user_id": "925387477040815555", 
"channel_id": "", 
"device_type": "ios", 
"access_token": "1386849160299"
}

device_type: "ios" or "android" by default.

access_token comes from /login.do response.

user_id is the Pushid which should be retrieved from baidu push notification sdk from mobile client

json response:

{
  "error_code":0,
  "access_token":"1386849160798",
  "username":"袋鼠",
  "account_name":"13408654680",
  "school_id":93740362,
  "school_name":"成都市第三军区幼儿园",
  "member_status":"free"
}

error_code:

1 -> no valid phone number at all, which means the phone number does not exists or has been deleted by school

2 -> user is expired, it is also possible because the whole school are expired as well.

3 -> only token is invalid, which is more likely that someone else logged this phone number into our system

0 -> success

member_status:

free -> this user is only allow to access School News and Receive daily check in/out push notification.

paid -> this user has full access to all functions.

suspended -> this user is suspended, should be blocked from any further actions in app.

Clone this wiki locally