获取文档 URL-业务方自定义参数

阅读次数 319

https://o.wpsgo.com/office/:type/:fileid?_w_tokentype=1&_w_appid=xxx&&xxx(业务方自定义参数) 业务方可通过自定义参数传递, WebOffice 将会在回调接口通过 X-User-Query 的 Header 字段中回传编辑链接上的 Query 信息

https://o.wpsgo.com/office/:type/:fileid?_w_tokentype=1&_w_appid=xxx&x-co-client=E18E07C7335E452C813AA018FF2743E1&x-co-timestamp=1539843173902&x-co-sign=xxxxxxx

在回调接口头部是这样添加上吗

image.png

我的网关需要验签(参数来源 header 中 3个参数)

3 Answers

是通过名为x-user-query的header来传递额外参数的

x-user-query: a=1&b=2

WebOffice 服务与接入方进行数据交互, 先走到我们的统一外部网关,网关从header 中获取参数,会做接口鉴权以及签名校验,再转发到具体的接口服务,参数不能按照上面赋值吗 ( header 中 x-user-query: a=1&b=2 改成a:1 b:2)

x-user-query用的是urlencode的方法进行编码,可以对header进行decode之后,取出所需的键值对