百度智能小程序授权流程——获取预授权码pre_auth_code

openapi 用于获取预授权码,预授权码用于小程序授权时的第三方平台方安全验证。

接口调用请求说明

GET https://openapi.baidu.com/rest/2.0/smartapp/tp/createpreauthcode?access_token=42.89210dcaa616b575cdca56f978cefbc2.2592000.1535617875.Wf0l2sXgdy5SabS_wP00-34gJWz93WxN4e9rQhN

参数说明

参数名              类型     是否必须      描述

access_token    string        是       TP的access_token,可参考:获取第三方平台接口调用凭据tp_access_token   

 

返回值说明

字段名                  类型         描述

pre_auth_code    string       预授权码    

expires_in             int          凭证有效时间,单位:秒,默认20分钟。    

返回值示例

{
   "errno": 0,
   "msg": "success",
   "data": {
       "pre_auth_code": "c210YXBwMjAzMTQxODMzMThiMDlhMzhlZmEzMGM2MjAzY2NjMGQ5MTBlNGNmZWI1",
       "expires_in": 1200
   }
}
    

错误情况下:

字段名                    类型           描述

error                      string    错误码;关于错误码的详细信息请参考 http://developer.baidu.com/wiki/index.php?title=docs/oauth/error 。    

error_description    string    错误描述信息,用来帮助理解和解决发生的错误。 

   

发表评论

邮箱地址不会被公开。 必填项已用*标注

联系我们

在线咨询:点击这里给我发消息