Appearance
查询在线微信列表
查询当前开发者账号下仍在线的微信实例列表。
接口地址: POST /queryLoginWx
说明与注意
- 只查单个实例的状态用 查询实例登录状态。
请求参数
无请求参数,传空 JSON 即可。
请求示例
http
POST {BASE_URL}/queryLoginWx
Authorization: Bearer <你的调用凭证>
Content-Type: application/json
{}bash
curl -X POST '{BASE_URL}/queryLoginWx' \
-H 'Authorization: Bearer <你的调用凭证>' \
-H 'Content-Type: application/json' \
--data-raw '{}'python
import requests
url = "{BASE_URL}/queryLoginWx"
headers = {"Authorization": "Bearer <你的调用凭证>", "Content-Type": "application/json"}
body = """{}"""
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}/queryLoginWx";
String body = "{}";
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder(URI.create(url))
.header("Authorization", "Bearer <你的调用凭证>")
.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}/queryLoginWx';
$body = <<<'JSON'
{}
JSON;
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $body);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Authorization: Bearer <你的调用凭证>',
'Content-Type: application/json',
]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
echo $response;成功响应
json
{
"code": "1000",
"message": "成功",
"data": [
{
"wcId": "wxid_i6qsbbjenju2",
"wId": "72223018-7f2a-4f4f-bfa3-26e47dbd61"
}
]
}错误响应
json
{
"code": "1001",
"message": "失败",
"data": null
}响应参数
| 参数名 | 类型 | 说明 |
|---|---|---|
| code | string | 1000 成功;其他值都是失败,通常是 1001 |
| message | string | 反馈信息 |
| data[].wcId | string | 微信 ID |
| data[].wId | string | 登录实例标识 |