手相分析
<h3>接口描述</h3>
<ul>
<li>利用大数据,对手相特征点进行分析,结合《麻衣相术》对运势进行推断,成功率较高。该接口有一定的识别失败率。不过以下两点建议可以显著提高识别成功率:1.手在图中的占比不建议太高,太高会导致误识别。2.图片四周建议多些留白部分,不要让手部紧贴图片边缘。
<a href="<a href="https://anq-file.oss-cn-hangzhou.aliyuncs.com/api-document/shouxiang/incorrect_sample.jpg">错误示例</a>">https://anq-file.oss-cn-hangzhou.aliyuncs.com/api-document/shouxiang/incorrect_sample.jpg">错误示例</a></a>; <a href="<a href="https://anq-file.oss-cn-hangzhou.aliyuncs.com/api-document/shouxiang/correct_sample.jpg">正确示例</a>">https://anq-file.oss-cn-hangzhou.aliyuncs.com/api-document/shouxiang/correct_sample.jpg">正确示例</a></a>;</li>
</ul>
<h3>请求地址</h3>
<p><code>https://api.jumdata.com/palmistry/analysis</code></p>
<h3>请求方式</h3>
<ul>
<li>POST</li>
</ul>
<h3>请求格式</h3>
<ul>
<li>form-data</li>
</ul>
<h3>请求参数</h3>
<table>
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>必须</th>
<th><div style="width:420px">说明</div></th>
</tr>
</thead>
<tbody>
<tr>
<td>appId</td>
<td>String</td>
<td>是</td>
<td>服务商分配的唯一标识</td>
</tr>
<tr>
<td>timestamp</td>
<td>Long</td>
<td>是</td>
<td>当前时间的毫秒数</td>
</tr>
<tr>
<td>sign</td>
<td>String</td>
<td>是</td>
<td>签名,见签名算法说明</td>
</tr>
<tr>
<td>base64</td>
<td>String</td>
<td>否</td>
<td>手相图base64串 原图url,file、base64三选一 图片格式jpg、png</td>
</tr>
<tr>
<td>file</td>
<td>File</td>
<td>否</td>
<td>手相图 原图url,file、base64三选一 图片格式jpg、png</td>
</tr>
<tr>
<td>url</td>
<td>String</td>
<td>否</td>
<td>手相图url 原图url,file、base64三选一 图片格式jpg、png</td>
</tr>
<tr>
<td>lang</td>
<td>String</td>
<td>否</td>
<td>多语言:zh-cn 、zh-tw 默认为 zh-cn</td>
</tr>
</tbody>
</table>
<p>> base64、file、url 必须提供一个,优先级:base64 > file > url 图片不能大于4M</p>
<h3>签名算法说明</h3>
<pre><code>sign = sha256( appId + appSecret + timestamp)</code></pre>
<p>用服务商分配的 appId、服务商分配的 appSecret,当前时间毫秒数 timestamp,按上述顺序拼接成字符串,再进行 sha256 哈希得到。如下:</p>
<pre><code class="language-java">String appId = &quot;xyzxy2121zxyz&quot;;
String timestamp = &quot;1555378976238&quot;;
String appSecret = &quot;efcefcef1121cefcefc1212121&quot;;
String str = appId + appSecret + timestamp;
String sign = sha256(str);</code></pre>
<h3>正确返回样例</h3>
<pre><code class="language-json">{
&quot;code&quot;: 200,
&quot;msg&quot;: &quot;成功&quot;,
&quot;taskNo&quot;: &quot;183257012232596491134327&quot;,
&quot;charge&quot;: true,
&quot;data&quot;: {
&quot;hands_muzhi_shape&quot;: &quot;火&quot;, //拇指五行属性
&quot;hands_muzhi_shape_desc&quot;: &quot;《麻衣相术》有云,夫手足之道,谓之四肢,加之一首,谓之五体,以象五行。你的拇指五行属......&quot;, //拇指解析
&quot;hands_shizhi_shape&quot;: &quot;土&quot;, //食指五行属性
&quot;hands_shizhi_shape_desc&quot;: &quot;《麻衣相术》有云,夫手足之道,谓之四肢,加之一首,谓之五体,以象五行。你的食指五行属......&quot;,//食指解析
&quot;hands_zhongzhi_shape&quot;: &quot;金&quot;, //中指五行属性
&quot;hands_zhongzhi_shape_desc&quot;: &quot;《麻衣相术》有云,夫手足之道,谓之四肢,加之一首,谓之五体,以象五行。你的中指五行属......&quot;,//中指解析
&quot;hands_wumingzhi_shape&quot;: &quot;水&quot;,//无名指五行属性
&quot;hands_wumingzhi_shape_desc&quot;: &quot;《麻衣相术》有云,夫手足之道,谓之四肢,加之一首,谓之五体,以象五行。你的无名指五行属.....&quot;,//无名指解析
&quot;hands_xiaozhi_shape&quot;: &quot;火&quot;,//小指五行属性
&quot;hands_xiaozhi_shape_desc&quot;: &quot;《麻衣相术》有云,夫手足之道,谓之四肢,加之一首,谓之五体,以象五行。你的小指五行属......&quot;,//小指解析
&quot;hands_shape_score&quot;: 76, //手相打分
&quot;shouxiang_further_30&quot;: &quot;从0到30岁,你展现出出彩的性格。儿童......&quot;,//0-30而立之年运势
&quot;shouxiang_further_40&quot;: &quot;步入31到40岁,你的运势可谓是......&quot;, //31-40知命之年运势
&quot;shouxiang_further_50&quot;: &quot;步入41到50岁,你的运势较好。在财运方面......&quot;,//41-50不惑之年运势
&quot;shouxiang_further_60&quot;: &quot;步入51到60岁,你的运势呈现出一般......&quot;,//51-60花甲之年运势
&quot;hands_shape&quot;: &quot;火形手&quot;, //手形五行属性
&quot;hands_shape_desc&quot;: &quot;火形手的人性格充满活力和决心。他们通常充......&quot;//手形解析
}
}</code></pre>
<h3>错误返回样例</h3>
<pre><code class="language-json">{
&quot;msg&quot;: &quot;图片不能为空&quot;,
&quot;code&quot;: 400
}</code></pre>
<h3>返回字段说明</h3>
<table>
<thead>
<tr>
<th>字段名</th>
<th><div style="width:420px">说明</div></th>
</tr>
</thead>
<tbody>
<tr>
<td>code</td>
<td>返回码,详见code返回码说明</td>
</tr>
<tr>
<td>msg</td>
<td>code对应的描述</td>
</tr>
<tr>
<td>charge</td>
<td>是否计费</td>
</tr>
<tr>
<td>taskNo</td>
<td>本次请求号</td>
</tr>
<tr>
<td>data</td>
<td>返回具体结果,object类型,详见成功返回体</td>
</tr>
</tbody>
</table>
<h4>code返回码说明</h4>
<table>
<thead>
<tr>
<th>code</th>
<th><div style="width:420px">说明</div></th>
</tr>
</thead>
<tbody>
<tr>
<td>200</td>
<td>成功 (计费)</td>
</tr>
<tr>
<td>400</td>
<td>参数错误,具体查看返回的错误描述</td>
</tr>
<tr>
<td>404</td>
<td>接口地址不正确</td>
</tr>
<tr>
<td>500</td>
<td>系统维护,请稍候再试</td>
</tr>
<tr>
<td>601</td>
<td>接口未开通</td>
</tr>
<tr>
<td>602</td>
<td>账号停用</td>
</tr>
<tr>
<td>603</td>
<td>余额不足请充值</td>
</tr>
<tr>
<td>604</td>
<td>接口停用</td>
</tr>
<tr>
<td>606</td>
<td>调用超限,请稍候再试</td>
</tr>
<tr>
<td>607</td>
<td>ip不在白名单</td>
</tr>
<tr>
<td>609</td>
<td>请求过于频繁,请稍候再试</td>
</tr>
<tr>
<td>610</td>
<td>请求超时</td>
</tr>
<tr>
<td>999</td>
<td>其他,以实际返回为准</td>
</tr>
</tbody>
</table>