锐捷网络API文档说明

API ROOT: https://apis.ruijie.com.cn/api

Alt text

获取授权

使用申请/分配的APPID及APPKEY获取授权token,过期需重新获取。

    url: 'https://apis.ruijie.com.cn/oauth/token',
    {
        "grant_type":"password",
        "client_id": "appid",
         "client_secret":"appkey",
        "username":"username",
        "password":"userpassword",
        "scope":"demo"
    }

    { 
        access_token: 'xxxx',
        expires_in: 1209600,
        refresh_token: 'xxx',
        token_type: 'Bearer' 
    }

过期token换取新token

token过期需重新换取。

    url: 'https://apis.ruijie.com.cn/oauth/token',
     {
        "grant_type": "refresh_token",
        "client_id": "your clientid",
        "client_secret": "appkey",
        "refresh_token": "***********"
     }

    {
        "access_token": "xN2836yQAQfDURxVPds0IM9vfUk3IJC5",
        "expires_in": 604800,
        "scope": "demo",
        "refresh_token": "VFlAp82EUWNQJkokRvoELSPhPpO3pSPS",
        "token_type": "Bearer"
    }

用户API (新版)

返回结果结构:


{
"status": 1,
"code": "",
"message":"",
"data":{}
}

服务器返回有关错误信息以及消息代码,请参见:Link


登录

用户登录API,支持官网注册用户、社区注册用户及渠道用户,(本版本暂不区分渠道、官网用户类型)

    {
        "username":"your name ",
        "password": "your password"
    }
    curl -i -X POST \
     -H "Content-Type:application/json" \
      -d \
        '{
            "username":"panyuntao",
            "password": "123456"
        }
        ' \
    'https://apis.ruijie.com.cn/api/account/login?access_token=yourtoken'


注册

用户注册API,用户信息可以选填.


    //手机注册-生成新用户. code为获取到的验证码
    {   
            "code" : "validate code",
            "username":"your name ",
            "password": "your password",
            "mobile":"your mobile number",
            ...
    }
    //邮箱注册
    {   
            "email":"your email",
            "username":"your name ",
            "password": "your password",
    }
邮箱注册:
    curl -i -X POST \
    -H "Content-Type:application/json" \
    -d \
    '{
            "username": "panyuntao19",
            "email": "panyuntao19@ruijie.com.cn",
            "password": "777777",
            "idcardtype": "身份证",
            "idcard": "1234566",
            "resideprovince": "江西省",
            "residecity": "萍乡市",
            "residedist": "区",
            .......其他.....
    }' \
 'https://apis.ruijie.com.cn/api/account?access_token=your access token'

手机注册:

    curl -i -X POST \
    -H "Content-Type:application/json" \
    -d \
    '{
            "username": "panyuntao15",
            "mobile": "13401183771",
            "code":"6804",
            "password": "777777",
            "fax": "115457"

    }' \
    'https://apis.ruijie.com.cn/api/account?access_token=your access token'


更新用户资料(完整更新)

更新用户资料API.此API仅可以更改用户资料API,但是不可以更改用户帐号信息.例如密码、用户名

    {   
            "realname":"your realname",
            "birthyear":"your birthyear ",
            "birthmonth": "your birthmonth",
            "birthday":"your birthday",
            "company":"your company",
            ...
    }
    curl -i -X PUT \
     -H "Content-Type:application/json" \
    -d \
    '{
            "realname": "测试",
            "birthyear": "2003",
            "birthmonth": "2",
        ... 其他...
    }' \
    'https://apis.ruijie.com.cn/api/account/panyuntao19?access_token=your access token'

更新用户资料(部分更新)

更新用户资料API.此API仅可以更改用户资料API,但是不可以更改用户帐号信息.例如密码、用户名

    {   
            "realname":"your realname",
            "birthyear":"your birthyear ",
            "birthmonth": "your birthmonth",
            "birthday":"your birthday",
            "company":"your company",
            ...
    }
    curl -i -X Patch \
     -H "Content-Type:application/json" \
    -d \
    '{
            "realname": "测试",
            "birthyear": "2003",
            "birthmonth": "2",
        ... 其他...
    }' \
    'https://apis.ruijie.com.cn/api/account/panyuntao19?access_token=your access token'

删除用户

删除用户的API,慎用.

    curl -i -X DELETE \
     -H "Content-Type:application/json" \
    'https://apis.ruijie.com.cn/api/account/panyuntao11?access_token=your access token'

获取用户信息

    {
    "username": "user's name",
    "email": "user's email",
    "mobile": "user's mobile",
    "realname": "user's realname",
    "idcardtype": "user's idcard type",
    "birthyear": 0,
    "birthmonth": 0,
    "birthday": 0,
    ...
    }
    curl -i -X GET \
     -H "Content-Type:application/json" \
     'https://apis.ruijie.com.cn/api/account/panyuntao19?access_token=your access token'

通过邮箱/手机重置密码

重置密码的API

{
  "email":"your email",
  "code":"validate code",
  "newpassword":"your new password"
}


{
  "mobile":"your mobile",
  "code":"validate code",
  "newpassword":"your new password"
}

    curl -i -X POST \
    -H "Content-Type:application/json" \
    -d \
    '{
    "email":"panyuntao@ruijie.com.cn",
    "code":"1234",
    "newpassword":"password"
    }' \
    'https://apis.ruijie.com.cn/api/account/password?access_token=your access token'


通过用户原密码修改密码

依据用户正确的原密码修改新的密码

{
  "username":"your email/username",
  "password":"your old password",
  "newpassword":"your new password"
}
    curl -i -X POST \
    -H "Content-Type:application/json" \
    -d \
    '{
        "username":"panyuntao",
        "password":"Qq123456",
        "newpassword":"Qq123456"
    }' \
    'https://apis.ruijie.com.cn/api/account/password2?access_token=your access token'


手机号码绑定

    {
        "username":"your user identity",
        "mobile":"your mobile",
        "code": "your code"
    }
    curl -i -X POST \
    -H "Content-Type:application/json" \
    -d \
    ' {
        "username":"panyuntao",
        "mobile":"13910661542",
        "code": "2345"
    }' \
 'https://apis.ruijie.com.cn/api/account/mobilebinding?access_token=your access token'

邮箱绑定

    {
        "username":"your user identity",
        "email":"your email",
        "code": "your code"
    }

手机号码解除绑定

    {
        "username":"your user identity"
    }

获取验证码

获取用户验证码的API

    {
      "email":"your email address"
    }


    {
      "mobile":"your mobile number"
    }

    curl -i -X POST \
    -H "Content-Type:application/json" \
    -d \
    '{
        "mobile": "your mobile"
    }' \
    'https://apis.ruijie.com.cn/api/account/safecode?access_token=your access token'


验证用户账户关键字

{
    "type":3,
    "code":"validation content",
    "userid":"" //此字段选填,仅在检查类型为4、5的时候必须填写.
}
    curl -i -X POST \
    -H "Content-Type:application/json" \
    -d \
    '{
        "type":1,
        "code":"panyuntao"
    }' \
    'https://apis.ruijie.com.cn/api/account/checking?access_token=your access token'