Appearance
提交验证码
当 checkQr 返回 status:10(企微要求二次验证)时,提交手机端显示的 6 位验证码。
说明与注意
- 提交成功返回空 data;随后
checkQr由 10 转 2(约 6 秒)。代理由系统自动取用缓存,无需传。
请求参数
| 参数 | 必填 | 类型 | 说明 |
|---|---|---|---|
appid | 是 | string | 获取二维码返回的实例 appid。示例:we_xxxxxxxxxxxxxxx |
code | 是 | string | 手机端显示的 6 位验证码。示例:993416 |
uuid | 是 | string | getQr 返回的 uuid。示例:F6FFE8CA3CFA8633EECF5F5A25600FEE |
请求示例
http
POST {BASE_URL}/wx-api/api/login/submitQrCode
Authorization: Bearer <你的 App Token>
Content-Type: application/json
{
"appid": "we_xxxxxxxxxxxxxxx",
"code": "993416",
"uuid": "F6FFE8CA3CFA8633EECF5F5A25600FEE"
}bash
curl -X POST '{BASE_URL}/wx-api/api/login/submitQrCode' \
-H 'Authorization: Bearer <你的 App Token>' \
-H 'Content-Type: application/json' \
--data-raw '{
"appid": "we_xxxxxxxxxxxxxxx",
"code": "993416",
"uuid": "F6FFE8CA3CFA8633EECF5F5A25600FEE"
}'python
import requests
url = "{BASE_URL}/wx-api/api/login/submitQrCode"
headers = {"Authorization": "Bearer <你的 App Token>", "Content-Type": "application/json"}
body = """{
"appid": "we_xxxxxxxxxxxxxxx",
"code": "993416",
"uuid": "F6FFE8CA3CFA8633EECF5F5A25600FEE"
}"""
resp = requests.post(url, headers=headers, data=body.encode("utf-8"))
print(resp.text)java
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
String url = "{BASE_URL}/wx-api/api/login/submitQrCode";
String body = "{\n" +
" \"appid\": \"we_xxxxxxxxxxxxxxx\",\n" +
" \"code\": \"993416\",\n" +
" \"uuid\": \"F6FFE8CA3CFA8633EECF5F5A25600FEE\"\n" +
"}";
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder(URI.create(url))
.header("Authorization", "Bearer <你的 App Token>")
.header("Content-Type", "application/json")
.POST(HttpRequest.BodyPublishers.ofString(body))
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());php
<?php
$url = '{BASE_URL}/wx-api/api/login/submitQrCode';
$body = <<<'JSON'
{
"appid": "we_xxxxxxxxxxxxxxx",
"code": "993416",
"uuid": "F6FFE8CA3CFA8633EECF5F5A25600FEE"
}
JSON;
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $body);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Authorization: Bearer <你的 App Token>',
'Content-Type: application/json',
]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
echo $response;响应示例
解析响应前确认字段
返回字段见本页「说明与注意」和登录模块总览。完整响应格式及未列出的字段,请通过开通与支持联系对接人确认后再解析。
提交成功时 data 为空;随后再调检测二维码,status 变为 2 才算登录成功。
响应字段
| 字段 | 类型 | 说明 |
|---|---|---|
code | int64 | 统一封套状态码:0=成功,负数=失败 |
detail | string | 附加明细,通常为空 |
message | string | 文案:成功为 ok;失败形如 -码|描述 |
time | string | 服务端处理时间 YYYY-MM-DD HH:MM:SS |