微信扫码授权码换 token(subject=unionid||openid,首次即注册)
POST
/v1/auth/wechat/exchange
const url = 'https://api.tansr.com/v1/auth/wechat/exchange';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"code":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.tansr.com/v1/auth/wechat/exchange \ --header 'Content-Type: application/json' \ --data '{ "code": "example" }'Parameters
Section titled “Parameters”Header Parameters
Section titled “Header Parameters”x-tansr-growth-capture
string
GR-34 Growth Ed25519 来源/当前访问凭证。API在接收时本地验签并记录捕获时间;缺失、过期或无效仅阻止媒体归因,不阻塞登录或建单。首次注册冻结来源,订单使用当次访问凭证;不接受浏览器自报账户、点击ID或捕获时刻。
Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
code
required
微信 qrconnect 回调授权码
string
Examplegenerated
{ "code": "example"}Responses
Section titled “Responses”Token
微信登录未交割(ED-S8)
本文是否有帮助?
感谢反馈,我们会持续改进这篇文章。