cURL
curl --request POST \
--url https://apiv1.cakeip.com/openapi/account/getSubAccountKeys \
--header 'Content-Type: application/json' \
--data '
{
"appKey": "YOUR_AGENT_APP_KEY"
}
'import requests
url = "https://apiv1.cakeip.com/openapi/account/getSubAccountKeys"
payload = { "appKey": "YOUR_AGENT_APP_KEY" }
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({appKey: 'YOUR_AGENT_APP_KEY'})
};
fetch('https://apiv1.cakeip.com/openapi/account/getSubAccountKeys', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://apiv1.cakeip.com/openapi/account/getSubAccountKeys",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'appKey' => 'YOUR_AGENT_APP_KEY'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://apiv1.cakeip.com/openapi/account/getSubAccountKeys"
payload := strings.NewReader("{\n \"appKey\": \"YOUR_AGENT_APP_KEY\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://apiv1.cakeip.com/openapi/account/getSubAccountKeys")
.header("Content-Type", "application/json")
.body("{\n \"appKey\": \"YOUR_AGENT_APP_KEY\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://apiv1.cakeip.com/openapi/account/getSubAccountKeys")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"appKey\": \"YOUR_AGENT_APP_KEY\"\n}"
response = http.request(request)
puts response.read_body{
"code": 0,
"msg": "Success",
"data": {
"users": [
{
"account": "Jagent01",
"password": "Pagent01",
"name": "agent@example.com",
"key": ""
},
{
"account": "Jchild01",
"password": "Pchild01",
"name": "child@example.com",
"key": ""
}
]
}
}代理商相关
批量查询子账户认证信息
仅限代理商:查询本人及所有直属子账户的优选池认证账号、密码。没有优选池账号的用户不返回;key 固定为空字符串。
POST
/
account
/
getSubAccountKeys
cURL
curl --request POST \
--url https://apiv1.cakeip.com/openapi/account/getSubAccountKeys \
--header 'Content-Type: application/json' \
--data '
{
"appKey": "YOUR_AGENT_APP_KEY"
}
'import requests
url = "https://apiv1.cakeip.com/openapi/account/getSubAccountKeys"
payload = { "appKey": "YOUR_AGENT_APP_KEY" }
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({appKey: 'YOUR_AGENT_APP_KEY'})
};
fetch('https://apiv1.cakeip.com/openapi/account/getSubAccountKeys', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://apiv1.cakeip.com/openapi/account/getSubAccountKeys",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'appKey' => 'YOUR_AGENT_APP_KEY'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://apiv1.cakeip.com/openapi/account/getSubAccountKeys"
payload := strings.NewReader("{\n \"appKey\": \"YOUR_AGENT_APP_KEY\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://apiv1.cakeip.com/openapi/account/getSubAccountKeys")
.header("Content-Type", "application/json")
.body("{\n \"appKey\": \"YOUR_AGENT_APP_KEY\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://apiv1.cakeip.com/openapi/account/getSubAccountKeys")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"appKey\": \"YOUR_AGENT_APP_KEY\"\n}"
response = http.request(request)
puts response.read_body{
"code": 0,
"msg": "Success",
"data": {
"users": [
{
"account": "Jagent01",
"password": "Pagent01",
"name": "agent@example.com",
"key": ""
},
{
"account": "Jchild01",
"password": "Pchild01",
"name": "child@example.com",
"key": ""
}
]
}
}使用代理商的 appKey,一次获取代理商本人及其所有直属子账户的优选池代理认证账号和密码。无需传入子账户的
没有子账户时,只要代理商本人有优选池认证账号,仍会返回本人。没有优选池认证账号的用户会被跳过;所有目标账户均无有效记录时,返回
appKey 或 params。
返回的 data.users 中,每项包含:
| 字段 | 说明 |
|---|---|
account | 优选池代理认证账号,对应创建接口的 proxyUser |
password | 优选池代理认证密码,对应创建接口的 proxyPass |
name | 平台用户名,对应创建时的 params.username |
key | 兼容历史响应的字段,固定为空字符串 |
接口路径沿用历史名称
getSubAccountKeys,当前返回优选池认证凭据。key 不是子账户的 appKey,也不用于优选池代理认证。users: []。历史标准池认证信息不会返回。
只有代理商可以调用此接口,且只能查询本人及其直属子账户。检查响应中的 code 判断业务是否成功:0 表示成功,400 表示 appKey 无效或调用方不是代理商。
创建新子账户时,也可以直接从创建子账户的成功响应获取认证凭据。Body
application/json
代理商的 appKey
Example:
"YOUR_AGENT_APP_KEY"

