Skip to main content

主页工具

地址解析

/tool/home/address
地址文本智能解析服务。

请求参数

参数名类型必选说明
addressstring地址文本
POST /tool/home/address
Content-Type: application/json
Authorization: Bearer YOUR_TOKEN

{
  "address": "张三 13800138000 浙江省杭州市西湖区文三路 443号"
}
支持智能识别收件人姓名、电话号码、省市区及详细地址。

OAuth认证

OAuth认证概述

提供完整的OAuth 2.0认证流程支持:
  • 匿名用户认证
  • 授权码模式
  • 令牌刷新

匿名认证

/tool/home/oauth/anonymous
创建匿名用户并获取访问令牌。

请求参数

参数名类型必选说明
anonymousstring匿名标识符
passwdstring密码
POST /tool/home/oauth/anonymous
Content-Type: application/json

{
  "anonymous": "anon_123",
  "passwd": "password123"
}
匿名用户令牌有效期为1小时,刷新令牌有效期为30天。

授权码换取令牌

/tool/home/oauth/token
使用授权码获取访问令牌。

请求参数

参数名类型必选说明
codestring授权码
client_idstring客户端ID
POST /tool/home/oauth/token
Content-Type: application/x-www-form-urlencoded

{
  "grant_type": "authorization_code",
  "code": "auth_code_123",
  "client_id": "client_123"
}

刷新访问令牌

/tool/home/oauth/rtoken
使用刷新令牌获取新的访问令牌。

请求参数

参数名类型必选说明
grant_typestringrefresh_token
refresh_tokenstring刷新令牌
client_idstring客户端ID
POST /tool/home/oauth/rtoken
Content-Type: application/x-www-form-urlencoded
Authorization: Bearer OLD_ACCESS_TOKEN

{
  "grant_type": "refresh_token",
  "refresh_token": "ryJxx...",
  "client_id": "client_123"
}
刷新令牌仅可使用一次,使用后会自动失效并生成新的刷新令牌。

错误码说明

错误码说明
400请求参数错误
401未授权或令牌无效
403权限不足
500服务器错误