1.2获取api_key(api_access_id方式)
<p><strong>简要描述:</strong> </p>
<ul>
<li>
<p>获取api_key接口作为其他接口的基础接口,主要通过此接口获得api_key跟user_sn用于请求其他接口,api_key有效时间为俩小时,过期了需要重新请求一次登录接口获得旧的api_key。</p>
</li>
<li>6.6版本以上支持</li>
</ul>
<p><strong>请求URL:</strong> </p>
<ul>
<li><code>/api/login</code></li>
</ul>
<p><strong>请求方式:</strong></p>
<ul>
<li>POST </li>
</ul>
<p><strong>参数:</strong> </p>
<table>
<thead>
<tr>
<th style="text-align: left;">参数名</th>
<th style="text-align: left;">必选</th>
<th style="text-align: left;">类型</th>
<th>说明</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: left;">api_access_id</td>
<td style="text-align: left;">是</td>
<td style="text-align: left;">string</td>
<td>接口调用api_access_id</td>
</tr>
<tr>
<td style="text-align: left;">from</td>
<td style="text-align: left;">是</td>
<td style="text-align: left;">int</td>
<td>请求方式 :填1</td>
</tr>
<tr>
<td style="text-align: left;">sign</td>
<td style="text-align: left;">是</td>
<td style="text-align: left;">string</td>
<td>秘钥,生成方式:md5(api_access_id+api_access_secret+timestamp)</td>
</tr>
<tr>
<td style="text-align: left;">timestamp</td>
<td style="text-align: left;">是</td>
<td style="text-align: left;">string</td>
<td>当前时间(五分钟内),格式:Y-m-d H:i:s</td>
</tr>
</tbody>
</table>
<p><strong>返回示例</strong></p>
<pre><code>{
&quot;code&quot;: 0,
&quot;data&quot;: {
&quot;id&quot;: 3635,
&quot;user_sn&quot;: &quot;SYSUSER|b3397882e26ba9e7fb8f01f1af345bde&quot;,
&quot;user_name&quot;: &quot;zzh&quot;,
&quot;team_name&quot;: &quot;人工智能客户组&quot;,
&quot;team_sn&quot;: &quot;SON&quot;,
&quot;salt&quot;: null,
&quot;passwd&quot;: &quot;$2y$10$V1/8xg7Mq5YnEMfMYIef7evQCtIzdB4eW5Q9TvK97OnD/XmVC0Evi&quot;,
&quot;blocked&quot;: &quot;0&quot;,
&quot;bindip&quot;: null,
&quot;expired&quot;: &quot;2026-08-31&quot;,
&quot;amount&quot;: 1,
&quot;give_amount&quot;: 0,
&quot;priority&quot;: null,
&quot;status&quot;: null,
&quot;contact&quot;: &quot;郑志焕&quot;,
&quot;email&quot;: &quot;&quot;,
&quot;qq&quot;: &quot;&quot;,
&quot;wangwang&quot;: &quot;&quot;,
&quot;mobile&quot;: null,
&quot;phone&quot;: null,
&quot;ext&quot;: &quot;888999&quot;,
&quot;fax&quot;: null,
&quot;fax_ext&quot;: null,
&quot;local_phone&quot;: null,
&quot;is_staff&quot;: null,
&quot;is_active&quot;: 2,
&quot;forward_phones&quot;: null,
&quot;channel&quot;: null,
&quot;display_phone&quot;: null,
&quot;secret&quot;: null,
&quot;defaultringgroup&quot;: null,
&quot;gatewayaddr&quot;: null,
&quot;sipname&quot;: &quot;zb888999&quot;,
&quot;sippwd&quot;: null,
&quot;sipproxy&quot;: null,
&quot;enabled&quot;: null,
&quot;isswitch&quot;: null,
&quot;linkext&quot;: &quot;1&quot;,
&quot;hide_callid&quot;: null,
&quot;enable_record&quot;: null,
&quot;yd_display_phone&quot;: null,
&quot;remember_token&quot;: &quot;Sa0woa3azaRE8K0x8IHApgulqsX8PDlAZkVLo6X5Dyepd23AImJhOl35x2ao&quot;,
&quot;created_at&quot;: &quot;2018-12-04 17:20:58&quot;,
&quot;updated_at&quot;: &quot;2024-07-12 12:39:33&quot;,
&quot;phone_type&quot;: null,
&quot;is_order&quot;: &quot;1&quot;,
&quot;dep_phone&quot;: null,
&quot;company&quot;: null,
&quot;total_count&quot;: 0,
&quot;trunkgroup_id&quot;: &quot;0&quot;,
&quot;parent_sn&quot;: &quot;&quot;,
&quot;concurrency&quot;: null,
&quot;max_call_count&quot;: 14,
&quot;ai_count&quot;: 100,
&quot;start_at_one&quot;: &quot;08:30:00&quot;,
&quot;end_at_one&quot;: &quot;12:30:00&quot;,
&quot;start_at_two&quot;: &quot;13:30:00&quot;,
&quot;end_at_two&quot;: &quot;21:00:00&quot;,
&quot;start_at_three&quot;: null,
&quot;end_at_three&quot;: null,
&quot;start_at_four&quot;: null,
&quot;end_at_four&quot;: null,
&quot;project_sn&quot;: &quot;projects|1e99759eee92f3f8f0cd3649b4ffda96,projects|4a92f90b5339646b36e9805600820deb,projects|808dfdcb369470376086281d2fdf26a0,projects|5321ee12e21b9467f74a98488e07a8b4,projects|e5b1b8d0f503edab6d5425f91d405a35,projects|648aca1c1ab7f23eab195d02a52052ee,project|a9ade5d7f10b74b66fb32495b66b6a09,project|9ab8f8343f4df4d02787026d03732eeb,projects|840d68a964b8533a63f39cd6f484a4e6,projects|941b663b4f6bef79c0e5f096d173351a,project|0adb8f8cf37e8fb1a785f0605394ce6e,projects|edc0c84159c69dc8a60f360c564d9e80,project|4db886c528383a1120929896d7909d4a,projects|3ae34d77b8c93d8c05036beea1318bf9,project|c4c87e02795564d384c05045235acb90,projects|0b0bb0cc1a75d80ccb681e79fb1ceb19,projects|3a4197ee15668b5b3530d182afc19df2,projects|55581589145ce56d81a161cff3f11781,projects|dc63dfc04d227c34fbe47f38636e4d43,project|1069978be86a36d707af92d016aa18c8,projects|2fa651a14418d1ca536e68b3f81707ba,projects|6468ffd6eac9e3e630f8d991c49ddb34,project|24503865dfcffe8d798a7449eb313feb,projects|061f1b59707b0ae6fc303ced37155141,projects|bfca8e9779e7610d329b9e61a290b75e,projects|d919f1e29c84b2cdd57478894a233bb3,project|9e6f8440cfe587a4d3773eb0012105dc,projects|7c6c95a20d43f1aadfa75b3f3a494343,project|21a55abfb1769a458794773e35e2306b,projects|65f5bd63a1d6765562f0288ce7bec130,projects|2657330a4f82b6828a96a98177ccac21,project|d40c01fc8881579d212076a747ce0bbb,projects|74b4995e21375746bd9362ebf417b2cb,project|18912021113fb33301878d81150ce211,projects|837371e6eaf5a3388ce5c69b25419f3c,projects|c965dfd067ea948e58c324e578dd147e,projects|c965dfd067ea948e58c324e578dd147e,project|b870332c9845901e1d528087c05d212b,projects|d98f8ed376820d8a316954d52a44e50a,projects|c35d5e7d47180eb36b5fae85c9b79be1,projects|61b663bc358c392fbccad2b5c0105c84&quot;,
&quot;caller_group&quot;: &quot;888999,888999,200050,200053,888998,200049,200088,900002&quot;,
&quot;skillgroup_sn&quot;: null,
&quot;callin_project_sn&quot;: null,
&quot;dial_span&quot;: 1000,
&quot;callin_phone&quot;: &quot;970085,66866021,970087,886520865,02039723245,61982107,61982108&quot;,
&quot;api_user_id&quot;: 0,
&quot;api_domain&quot;: &quot;&quot;,
&quot;api_eid&quot;: 0,
&quot;api_account&quot;: &quot;&quot;,
&quot;api_pwd&quot;: &quot;&quot;,
&quot;ext_max&quot;: &quot;100&quot;,
&quot;remark&quot;: &quot;&quot;,
&quot;api_key&quot;: &quot;mQ1ZMmjZ&quot;,
&quot;api_key_expire&quot;: 1720767089,
&quot;open_interface&quot;: 1,
&quot;api_auto_cio&quot;:&quot;{\&quot;autoSetting\&quot;:\&quot;open\&quot;,\&quot;api_username\&quot;:\&quot;\高\沛\&quot;,\&quot;check_lb\&quot;:\&quot;13819,13819,13731,,,\&quot;}&quot;,
&quot;api_auto_status&quot;: null,
&quot;api_id&quot;: 0,
&quot;api_verify&quot;: &quot;&quot;,
&quot;api_check_time&quot;: &quot;1593593024&quot;,
&quot;caller_number&quot;: null,
&quot;open_sms&quot;: 1,
&quot;oper_id&quot;: 75,
&quot;website&quot;: &quot;&quot;,
&quot;industry&quot;: &quot;小贷行业&quot;,
&quot;city&quot;: &quot;深圳&quot;,
&quot;last_login_time&quot;: &quot;2024-07-09 15:09:04&quot;,
&quot;need_fix_tel&quot;: 0,
&quot;area_code&quot;: &quot;&quot;,
&quot;callback_url&quot;: &quot;https://adebf652-a052-443a-a337-8ff161ed19de.mock.pstmn.io&quot;,
&quot;open_callback&quot;: &quot;1&quot;,
&quot;time_type&quot;: 1,
&quot;is_aent_admin&quot;: null,
&quot;account_belong&quot;: &quot;admin&quot;,
&quot;job&quot;: &quot;管理员&quot;,
&quot;callout_project_sn&quot;: null,
&quot;connection_rate_warning&quot;: 5,
&quot;warning_stop_call&quot;: 0,
&quot;bind_phone&quot;: &quot;&quot;,
&quot;industry_id&quot;: &quot;1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,27,28,29,30,31,32,33,34,35,36,37,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,133,135,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,289,292,293,297,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,323,324,328,329,330,331,332,333,334,339,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,356,357,358,359,360,361,362,363,364,365,366,367,368,369,370,371,372,373,374,375,376,377,378,379,380,381,382,383,384,385,386,387,388,389,390,391,392,393,394,395,396,397,398,399,400,401,402,403,404,406,407,408,409,410,411,412,413,415,416&quot;,
&quot;test_project_sn&quot;: &quot;project|21a55abfb1769a458794773e35e2306b&quot;,
&quot;organization_id&quot;: 0,
&quot;analysis_callback_url&quot;: &quot;&quot;,
&quot;callback_interval_time&quot;: 0,
&quot;date_str&quot;: &quot;1&quot;,
&quot;open_number_check&quot;: 0,
&quot;number_check_total&quot;: 0,
&quot;used_number_check&quot;: 0,
&quot;sdzj_phone&quot;: null,
&quot;login_phone&quot;: &quot;&quot;,
&quot;is_global_hide&quot;: 0,
&quot;hm_data_analysis&quot;: 1,
&quot;hm_preference_setting&quot;: &quot;{\&quot;single_ai_sends_per_day\&quot;:\&quot;500\&quot;,\&quot;single_ai_hangon_per_day\&quot;:\&quot;300\&quot;,\&quot;single_seat_intervention_per_day\&quot;:\&quot;150\&quot;,\&quot;single_seat_intension_per_day\&quot;:\&quot;30\&quot;}&quot;,
&quot;start_at&quot;: &quot;00:00&quot;,
&quot;end_at&quot;: &quot;23:50&quot;,
&quot;ringing_time&quot;: 45,
&quot;task_callback_url&quot;: &quot;https://ae81c919-f263-4bbb-afda-b07ad0802d64.mock.pstmn.io&quot;,
&quot;periods&quot;: &quot;[{\&quot;start_at\&quot;:\&quot;08:30:00\&quot;,\&quot;end_at\&quot;:\&quot;22:01:00\&quot;}]&quot;,
&quot;min_dial_span&quot;: 1000,
&quot;organization_name&quot;: null,
&quot;wx_pushed_config&quot;: &quot;{\&quot;mode\&quot;:1,\&quot;classify\&quot;:\&quot;A,B,C,D\&quot;,\&quot;interval_min\&quot;:1,\&quot;update_time\&quot;:1700048960}&quot;,
&quot;classification_must_fill&quot;: 0,
&quot;open_nlp&quot;: 1,
&quot;flash_oper_id&quot;: null,
&quot;open_manual_asr&quot;: 1,
&quot;manual_call_channel&quot;: 100,
&quot;manual_call_channel_lock&quot;: 1,
&quot;number_check_type&quot;: &quot;empty&quot;,
&quot;number_check_total_basic&quot;: 0,
&quot;used_number_check_basic&quot;: 0,
&quot;is_change_pwd&quot;: 1,
&quot;open_auto_add_wechat&quot;: 1,
&quot;add_wechat_max&quot;: 50,
&quot;first_order_time&quot;: null,
&quot;is_searvistor&quot;: 0,
&quot;man_machine_seats_count&quot;: 80,
&quot;seats_count&quot;: 20,
&quot;add_wechat_type&quot;: 1,
&quot;is_local&quot;: 1,
&quot;total_minutes&quot;: 0,
&quot;balance_minutes&quot;: 0,
&quot;extend_months&quot;: 0
},
&quot;msg&quot;: &quot;login success&quot;
}
</code></pre>
<p><strong>返回参数说明</strong> </p>
<table>
<thead>
<tr>
<th style="text-align: left;">参数名</th>
<th>类型</th>
<th>说明</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: left;">user_name</td>
<td>string</td>
<td>用户名;</td>
</tr>
<tr>
<td style="text-align: left;">user_sn</td>
<td>string</td>
<td>用户唯一标识符;</td>
</tr>
<tr>
<td style="text-align: left;">team_name</td>
<td>string</td>
<td>团队名称;</td>
</tr>
<tr>
<td style="text-align: left;">team_sn</td>
<td>string</td>
<td>团队唯一标识符;</td>
</tr>
<tr>
<td style="text-align: left;">expired</td>
<td>string</td>
<td>账号过期时间;</td>
</tr>
<tr>
<td style="text-align: left;">ai_count</td>
<td>string</td>
<td>ai数量;</td>
</tr>
<tr>
<td style="text-align: left;">caller_group</td>
<td>string</td>
<td>电话组;</td>
</tr>
<tr>
<td style="text-align: left;">parent_sn</td>
<td>string</td>
<td>父级账号(为空表示主账号)</td>
</tr>
<tr>
<td style="text-align: left;">api_key</td>
<td>string</td>
<td>请求秘钥</td>
</tr>
<tr>
<td style="text-align: left;">api_key_expire</td>
<td>string</td>
<td>请求秘钥过期时间(俩小时内有效)</td>
</tr>
<tr>
<td style="text-align: left;">job</td>
<td>string</td>
<td>账号权限名称</td>
</tr>
</tbody>
</table>
<p><strong>返回参数code说明</strong> </p>
<table>
<thead>
<tr>
<th style="text-align: left;">参数名</th>
<th>说明</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: left;">0</td>
<td>登录成功</td>
</tr>
<tr>
<td style="text-align: left;">10001</td>
<td>验证不通过,数据可能被劫持</td>
</tr>
<tr>
<td style="text-align: left;">20001</td>
<td>数据传输方式不正确</td>
</tr>
<tr>
<td style="text-align: left;">20002</td>
<td>数据格式错误(少传公共参数)</td>
</tr>
<tr>
<td style="text-align: left;">20003</td>
<td>该类型客户端不存在</td>
</tr>
<tr>
<td style="text-align: left;">20004</td>
<td>用户名和密码错误</td>
</tr>
<tr>
<td style="text-align: left;">20005</td>
<td>api_key验证不通过</td>
</tr>
<tr>
<td style="text-align: left;">20006</td>
<td>api_key过期</td>
</tr>
</tbody>
</table>
<p><strong>备注</strong> </p>
<ul>
<li>更多返回错误代码请看首页的错误代码描述</li>
</ul>