说明
<h1>1.API 地址</h1>
<p>测试环境地址: <a href="http://app-gateway-dev.wireless-tek.com/">http://app-gateway-dev.wireless-tek.com/</a>
生产环境地址:<a href="https://app-gateway.wireless-tek.com/">https://app-gateway.wireless-tek.com/</a></p>
<h1>2.用户会话</h1>
<p>登录成功后,会返回登录的access_token,客户端需要保存,后续API请求需要在HTTP头部中带上这个access_token,未登录时的接口将该字段留空处理。</p>
<pre><code class="language-js">Authorization: HMAC-SHA256 Appid=APPID User=token Timestamp=Timestamp Sign=signature
</code></pre>
<pre><code class="language-js">> POST /witek-auth/user/login HTTP/1.1
> Host: m.combway.com
> User-Agent: curl/7.84.0
> Accept: */*
> Authorization: HMAC-SHA256 Appid=740952df2dbfd756 User= Timestamp=1662358379 Sign=8cd99e17af1c811d92979f0428bab62feef4b0d5b63ac65ea8f07e15c036b007
> Content-Type: application/json; charset=utf-8
> Content-Length: 79
</code></pre>
<pre><code class="language-js">> POST /witek-auth/user/getUserByEmail HTTP/1.1
> Host: m.combway.com
> User-Agent: curl/7.84.0
> Accept: */*
> Authorization: HMAC-SHA256 Appid=7ad3836b5e9bd784 User=b77aa469-d4ad-40b4-b79f-027d5c9941de Timestamp=1675410694 Sign=7ba2927d9a5270721eb58b35c292e1225066ad33d4cdf91895be0805edfb112a
> Content-Type: application/json; charset=utf-8
> Content-Length: 79
</code></pre>
<h1>3.接口签名</h1>
<p>所有接口调用时需要提供签名信息,平台提供两个信息:<strong>APPID</strong>, <strong>APPSECRET</strong></p>
<p>例<strong>APPID</strong>为abcdefg1234567, <strong>APPSECRET</strong>为12345abcde67890fghijk01234567890ab</p>
<p>签名算法如下:</p>
<pre><code class="language-js">Sign=HexEncode(HMAC_SHA256(APPSECRET, HTTP_Request_Method + '\n' + URI + '\n' + Timestamp + '\n' + APPID + '\n' + token + '\n' + APPSECRET))
</code></pre>
<p>其中Timestamp为Unix EPOCH时间,单位为秒。</p>
<p>待签名数据示例:</p>
<p>注册/登录时<strong>token</strong>为空</p>
<pre><code class="language-js">POST
/witek-auth/user/login
1658721764
abcdefg1234567
12345abcde67890fghijk01234567890ab</code></pre>
<p>成功登录后时<strong>Session</strong>值假设为7c8342539fcd3cf2</p>
<pre><code class="language-js">POST
/witek-auth/user/login
1658721764
abcdefg1234567
7c8342539fcd3cf2
12345abcde67890fghijk01234567890ab</code></pre>
<h1>4.响应说明</h1>
<pre><code class="language-js">{
"code": 0,
"msg": "success",
"data": Object
}</code></pre>
<h6>1. code: 状态码</h6>
<p>0 - 成功
非0 - 失败</p>
<h6>2. msg: 错误码</h6>
<p>msg会提示具体的错误描述,错误码可以参考错误码说明</p>
<h6>3. data: 响应数据</h6>
<p>数据每个接口具体定义。</p>