MarketUP平台开放接口接口认证
<h3>接口请求认证鉴权</h3>
<h4>MarketUP提供2种可选的认证方式 Basic 和 Bearer认证,根据需要选择其中一种就行了</h4>
<h4>appKey 和 appSecret</h4>
<p>appKey 和 appSecret 需要在这个页面首生成后获取 <a href="https://uc.marketup.cn/settings/accountSetting"><a href="https://uc.marketup.cn/settings/accountSetting">https://uc.marketup.cn/settings/accountSetting</a>
</a></p>
<h4>可选方式一:Basic认证:</h4>
<p>>1. 首先按照 <code>${appKey}:${appSecret}</code> 拼接成一个字符串
>2. 然后进行Base64编码得到 encodedData
>3. 字符串最前面拼上认证类型字符串"Basic",得到的最终Authorization-Open-Platform值为:Basic ${encodedData}</p>
<table>
<thead>
<tr>
<th style="text-align: left;">>请求的时候需要在 http 的 header 中传入如下的内容:
></th>
<th style="text-align: left;">字段</th>
<th>类型</th>
<th>空</th>
<th>模拟数据</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: left;">Authorization-Open-Platform</td>
<td style="text-align: left;">string</td>
<td>否</td>
<td>Basic xxxxxx</td>
</tr>
</tbody>
</table>
<h4>可选方式二:Bearer Token认证:</h4>
<h5>第一步 获取token</h5>
<ol>
<li>获取token url get请求: <code>https://openplatform.marketup.cn/api/open-platform/v1/open/getAccessToken?appKey=a1c3434&amp;appSecret=dqzl9f234ci934343</code></li>
<li>返回数据示例:
<pre><code>{
&quot;code&quot;: 200,
&quot;message&quot;: &quot;SUCCESS&quot;,
&quot;data&quot;: &quot;eyJ0eXBlIjoiSldUIiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJtYXJrZXR1cCIsImV4cCI6MTcwMjg5NTM1MiwiaWF0IjoxNzAyODg3ODUyLCJhcHBLZXkiOiJhMWM3OGRlMjJmYzc0ZGRiYTUwOTk4MjQ4NTExMzQ3ZSJ9.OthhOnvAYxgxL6CaY58WZ6uX8tEFun0wirEJs1qSHYn71x2J4uy4baAapuzpUjqZT1VrGLQArOh0_K1niSooFNHG-SlIJc7US17vUE8IiiF3NHlj_j7vWIXWHKBn-kWgX_VKjY3RXhbnwrgPsZfGojRg-f7uc3SFPX3QvSHeMwHyJg0KaGJPLMnUl_uu0nnvk_ySwXL-7BZG6LgT7hd4v6BwU5CyDHCF49kZggHkfmdHlEVvkFLPhLg_n1DZHdqBK2liul7ASND66qMmZvfDGjypvvNq0Bjg8M6lAvRnZaBTY92O5ti2RmRA36TW8GlXm11jNYcSwp5lXxZFRAe-BA&quot;
}</code></pre>
<p>data数据即为token。</p>
<h5>第二步 使用token请求接口</h5>
<p>请求的时候需要在header 中传入如下的内容:</p></li>
</ol>
<table>
<thead>
<tr>
<th style="text-align: left;">字段</th>
<th style="text-align: left;">类型</th>
<th>空</th>
<th>模拟数据</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: left;">Authorization-Open-Platform</td>
<td style="text-align: left;">string</td>
<td>否</td>
<td>Bearer ${token}</td>
</tr>
</tbody>
</table>
<h5>使用说明</h5>
<p>token有效期为2小时,过期前重新获取token。请避免每次请求都重新获取token。若想简化开发,可以使用Basic认证。</p>
<p>> 如有疑问 可加微信 15295790581 沟通。</p>