Refresh access_token

POST https://{{baseUrl}}/open-apis/authen/v1/refresh_access_token

Reference

  1. 接口参考刷新 access_token
  2. 注意 参数中的refresh_token 是 1.3.1 获取登录用户身份接口返回结果中的refreshtoken字段,而非accesstoken字段;并且该refreshtoken只能用一次;用错的情况下会获得以下 ``` { code: 20007, msg: "generate accesstoken fail" } ```

Success Response Sample

{
    "code": 0,
    "data": {
        "access_token": "u-In71D01i3jngErbYTYKdjf",
        "avatar_big": "https://s3-fs.pstatp.com/static-resource/v1/31d0fc66-5175-4848-98e9-6cedbc10820g~?image_size=640x640&cut_type=&quality=&format=image&sticker_format=.webp",
        "avatar_middle": "https://s1-fs.pstatp.com/static-resource/v1/31d0fc66-5175-4848-98e9-6cedbc10820g~?image_size=240x240&cut_type=&quality=&format=image&sticker_format=.webp",
        "avatar_thumb": "https://s3-fs.pstatp.com/static-resource/v1/31d0fc66-5175-4848-98e9-6cedbc10820g~?image_size=72x72&cut_type=&quality=&format=image&sticker_format=.webp",
        "avatar_url": "https://s3-fs.pstatp.com/static-resource/v1/31d0fc66-5175-4848-98e9-6cedbc10820g~?image_size=72x72&cut_type=&quality=&format=image&sticker_format=.webp",
        "email": "",
        "en_name": "敬之Lynx1",
        "expires_in": 6900,
        "mobile": "+86199998888",
        "name": "敬之Lynx1",
        "open_id": "ou_e0ddd8cfc3524b973bef3d0e83400e67",
        "refresh_expires_in": 2591700,
        "refresh_token": "ur-OI8USnxkLOOlEB5WqUvyme",
        "tenant_key": "2cc0cbb58a8e175e",
        "token_type": "Bearer",
        "union_id": "on_c9e970ebba9f25f7a711e6104e08b68f",
        "user_id": "2482944f"
    },
    "msg": "success"
}

Request Body

{"grant_type"=>"refresh_token", "refresh_token"=>"ur-IhFccy8GDMe2imnkRuCHld"}

HEADERS

KeyDatatypeRequiredDescription
Authorizationstringapp_access_token
Content-Typestring