【顺丰快递管家】通用接口文档


2.用户批量新增/修改接口

<h3>功能描述</h3> <p>&lt;font face=&quot;微软雅黑&quot; color=red size=5 &gt;批处理接口需注意性能瓶颈,建议每次请求最多100条数据&lt;/font&gt;</p> <ul> <li>该接口用于:批量新增/修改用户数据。</li> </ul> <h3>接口定义</h3> <table> <thead> <tr> <th style="text-align: center;">服务名称</th> <th style="text-align: center;">批量交易</th> <th style="text-align: center;">接口类型</th> <th style="text-align: center;">接口uri(同确认接口)</th> </tr> </thead> <tbody> <tr> <td style="text-align: center;">用户批量新增/修改接口</td> <td style="text-align: center;">支持</td> <td style="text-align: center;">接入/POST</td> <td style="text-align: center;">/public/user/v1/batchSave</td> </tr> </tbody> </table> <h3>元素&lt;请求&gt;</h3> <ul> <li><strong>主体</strong></li> </ul> <table> <thead> <tr> <th style="text-align: center;">序号</th> <th style="text-align: center;">字段名</th> <th style="text-align: center;">类型(约束)</th> <th style="text-align: center;">必填</th> <th style="text-align: center;">默认值</th> <th style="text-align: left;">描述</th> </tr> </thead> <tbody> <tr> <td style="text-align: center;">1</td> <td style="text-align: center;">companyId</td> <td style="text-align: center;">String(20)</td> <td style="text-align: center;">是</td> <td style="text-align: center;">分配客户sendAppId。</td> </tr> <tr> <td style="text-align: center;">2</td> <td style="text-align: center;">type</td> <td style="text-align: center;">Number(1)</td> <td style="text-align: center;">是</td> <td style="text-align: center;">接口类型:1-新增;2-修改;</td> </tr> <tr> <td style="text-align: center;">2</td> <td style="text-align: center;">userList</td> <td style="text-align: center;">List&lt;userInfo&gt;</td> <td style="text-align: center;">是</td> <td style="text-align: center;">用户数据集合。整体加密,加密方式详情请见《接入前必看-3.3Des加解密密工具类》。</td> </tr> </tbody> </table> <ul> <li><strong>userInfo 说明</strong></li> </ul> <table> <thead> <tr> <th style="text-align: center;">序号</th> <th style="text-align: center;">字段名</th> <th style="text-align: center;">类型(约束)</th> <th style="text-align: center;">必填</th> <th style="text-align: center;">默认值</th> <th style="text-align: left;">描述</th> </tr> </thead> <tbody> <tr> <td style="text-align: center;">1</td> <td style="text-align: center;">userNo</td> <td style="text-align: center;">String(50)</td> <td style="text-align: center;">是</td> <td style="text-align: center;">用户账号。6-20位纯小写字母、纯数字或者小写字母和数字的组合(字母仅限小写字母)</td> </tr> <tr> <td style="text-align: center;">2</td> <td style="text-align: center;">userPhone</td> <td style="text-align: center;">String(11)</td> <td style="text-align: center;">是</td> <td style="text-align: center;">手机号。</td> </tr> <tr> <td style="text-align: center;">3</td> <td style="text-align: center;">userRealName</td> <td style="text-align: center;">String(20)</td> <td style="text-align: center;">是</td> <td style="text-align: center;">姓名。</td> </tr> <tr> <td style="text-align: center;">4</td> <td style="text-align: center;">empNo</td> <td style="text-align: center;">String(11)</td> <td style="text-align: center;">否</td> <td style="text-align: center;">工号。</td> </tr> <tr> <td style="text-align: center;">5</td> <td style="text-align: center;">userEmail</td> <td style="text-align: center;">String(60)</td> <td style="text-align: center;">否</td> <td style="text-align: center;">企业邮箱。</td> </tr> <tr> <td style="text-align: center;">6</td> <td style="text-align: center;">custId</td> <td style="text-align: center;">String(4000)</td> <td style="text-align: center;">否</td> <td style="text-align: center;">月结卡号。用户可使用的月结(所属组织已有的月结卡号),若有多个,使用英文逗号隔开。</td> </tr> <tr> <td style="text-align: center;">7</td> <td style="text-align: center;">organizationName</td> <td style="text-align: center;">String(64)</td> <td style="text-align: center;">否</td> <td style="text-align: center;">组织名称。</td> </tr> <tr> <td style="text-align: center;">8</td> <td style="text-align: center;">organizationCode</td> <td style="text-align: center;">String(100)</td> <td style="text-align: center;">是</td> <td style="text-align: center;">组织编码。</td> </tr> <tr> <td style="text-align: center;">9</td> <td style="text-align: center;">userStatus</td> <td style="text-align: center;">Number(1)</td> <td style="text-align: center;">否</td> <td style="text-align: center;">用户状态:停用0,启用1,默认是启用的</td> </tr> <tr> <td style="text-align: center;">10</td> <td style="text-align: center;">thirdPlatformId</td> <td style="text-align: center;">String(50)</td> <td style="text-align: center;">否</td> <td style="text-align: center;">第三方平台用户ID。注:如果传该值,则userNo字段的格式是公司名称前三个字母或是汉字的首字母+第三方平台用户ID的hashCode的绝对值</td> </tr> </tbody> </table> <h3>元素&lt;响应&gt;</h3> <ul> <li><strong>主体</strong></li> </ul> <table> <thead> <tr> <th style="text-align: center;">序号</th> <th style="text-align: center;">字段名</th> <th style="text-align: center;">类型(约束)</th> <th style="text-align: center;">必填</th> <th style="text-align: center;">字段说明</th> <th style="text-align: left;">描述</th> </tr> </thead> <tbody> <tr> <td style="text-align: center;">1</td> <td style="text-align: center;">msg</td> <td style="text-align: center;">String(200)</td> <td style="text-align: center;">否</td> <td style="text-align: center;">信息</td> <td style="text-align: left;">提示信息</td> </tr> <tr> <td style="text-align: center;">2</td> <td style="text-align: center;">succ</td> <td style="text-align: center;">String(10)</td> <td style="text-align: center;">是</td> <td style="text-align: center;">状态码</td> <td style="text-align: left;">返回成功或失败信息(ok/fail)</td> </tr> <tr> <td style="text-align: center;">3</td> <td style="text-align: center;">result</td> <td style="text-align: center;">List&lt;errorInfo&gt;</td> <td style="text-align: center;">是</td> <td style="text-align: center;">错误数据集合</td> <td style="text-align: left;">succ = ok时为空;succ = fail时不为空;</td> </tr> </tbody> </table> <ul> <li><strong>errorInfo 说明</strong></li> </ul> <table> <thead> <tr> <th style="text-align: center;">序号</th> <th style="text-align: center;">字段名</th> <th style="text-align: center;">类型(约束)</th> <th style="text-align: center;">必填</th> <th style="text-align: center;">字段说明</th> <th style="text-align: left;">描述</th> </tr> </thead> <tbody> <tr> <td style="text-align: center;">1</td> <td style="text-align: center;">rowNo</td> <td style="text-align: center;">Number(10)</td> <td style="text-align: center;">是</td> <td style="text-align: center;">错误数据所在行号</td> </tr> <tr> <td style="text-align: center;">2</td> <td style="text-align: center;">userNo</td> <td style="text-align: center;">String(50)</td> <td style="text-align: center;">是</td> <td style="text-align: center;">用户账号</td> </tr> <tr> <td style="text-align: center;">3</td> <td style="text-align: center;">cause</td> <td style="text-align: center;">String(100)</td> <td style="text-align: center;">是</td> <td style="text-align: center;">错误原因</td> </tr> </tbody> </table> <h3>报文范例</h3> <ul> <li> <p><strong>请求报文</strong></p> <pre><code>{ &amp;quot;companyId&amp;quot;: &amp;quot;201905140011898&amp;quot;, &amp;quot;type&amp;quot;: 1, &amp;quot;userList&amp;quot;: [ { &amp;quot;userNo&amp;quot;: &amp;quot;zhangsan&amp;quot;, &amp;quot;userPhone&amp;quot;: &amp;quot;15012345678&amp;quot;, &amp;quot;userRealName&amp;quot;: &amp;quot;张三&amp;quot;, &amp;quot;empNo&amp;quot;: &amp;quot;000001&amp;quot;, &amp;quot;userEmail&amp;quot;: &amp;quot;aa@bb.com&amp;quot;, &amp;quot;custId&amp;quot;: &amp;quot;1234567890,1234567891,1234567892&amp;quot;, &amp;quot;organizationName&amp;quot;: &amp;quot;IT部&amp;quot;, &amp;quot;organizationCode&amp;quot;: &amp;quot;IT0001&amp;quot; }, { &amp;quot;userNo&amp;quot;: &amp;quot;lisi01&amp;quot;, &amp;quot;userPhone&amp;quot;: &amp;quot;15012345679&amp;quot;, &amp;quot;userRealName&amp;quot;: &amp;quot;李四&amp;quot;, &amp;quot;empNo&amp;quot;: &amp;quot;000002&amp;quot;, &amp;quot;userEmail&amp;quot;: &amp;quot;bb@cc.com&amp;quot;, &amp;quot;custId&amp;quot;: &amp;quot;1234567893&amp;quot;, &amp;quot;organizationName&amp;quot;: &amp;quot;行政部&amp;quot;, &amp;quot;organizationCode&amp;quot;: &amp;quot;XZ0001&amp;quot; } ] }</code></pre> </li> <li><strong>响应报文</strong> <ul> <li>成功报文 <pre><code>{ &amp;quot;succ&amp;quot;: &amp;quot;ok&amp;quot;, &amp;quot;msg&amp;quot;: &amp;quot;&amp;quot;, &amp;quot;result&amp;quot;: null }</code></pre></li> <li>失败报文-范例1 <pre><code>{ &amp;quot;succ&amp;quot;: &amp;quot;fail&amp;quot;, &amp;quot;msg&amp;quot;:&amp;quot;数据校验不通过&amp;quot;, &amp;quot;result&amp;quot;: [ { &amp;quot;rowNo&amp;quot;: 2, &amp;quot;userNo&amp;quot;: &amp;quot;lisi01&amp;quot;, &amp;quot;cause&amp;quot;: &amp;quot;用户账号已存在!&amp;quot; } ] }</code></pre></li> </ul></li> </ul> <h3>根据第三方平台用户ID生成账号示例</h3> <p>[ChinesePinyinUtils.txt](<a href="https://www.showdoc.com.cn/server/api/attachment/visitFile?sign=64d7e7afd511f4453d1b3c728256f8e2">https://www.showdoc.com.cn/server/api/attachment/visitFile?sign=64d7e7afd511f4453d1b3c728256f8e2</a> &quot;[ChinesePinyinUtils.txt&quot;)</p> <pre><code class="language-java">String userNo = ChinesePinyinUtils.getInitialLowerCase(companyName, 3) + Math.abs(thirdPlatformId.hashCode()); </code></pre>

页面列表

ITEM_HTML