cURL
curl --request POST \
--url https://apiv1.cakeip.com/openapi/account/addUser \
--header 'Content-Type: application/json' \
--data '
{
"appKey": "<string>",
"params": {
"username": "<string>",
"password": "<string>"
}
}
'import requests
url = "https://apiv1.cakeip.com/openapi/account/addUser"
payload = {
"appKey": "<string>",
"params": {
"username": "<string>",
"password": "<string>"
}
}
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: '<string>', params: {username: '<string>', password: '<string>'}})
};
fetch('https://apiv1.cakeip.com/openapi/account/addUser', 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/addUser",
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' => '<string>',
'params' => [
'username' => '<string>',
'password' => '<string>'
]
]),
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/addUser"
payload := strings.NewReader("{\n \"appKey\": \"<string>\",\n \"params\": {\n \"username\": \"<string>\",\n \"password\": \"<string>\"\n }\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/addUser")
.header("Content-Type", "application/json")
.body("{\n \"appKey\": \"<string>\",\n \"params\": {\n \"username\": \"<string>\",\n \"password\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://apiv1.cakeip.com/openapi/account/addUser")
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\": \"<string>\",\n \"params\": {\n \"username\": \"<string>\",\n \"password\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"code": 0,
"msg": "注册成功",
"data": {
"appKey": "SUB_ACCOUNT_APP_KEY",
"proxyUser": "Jexample",
"proxyPass": "Pexample",
"key": "",
"chenProxyUser": "",
"chenProxyPass": ""
},
"_deprecation": "标准池已下架,新用户仅创建优选池账号,未创建 CHEN 标准池账号"
}
代理商相关
创建子账户
代理商创建直属子账户,仅创建优选池账号。成功时返回子账户 appKey 和代理认证账号、密码。
POST
/
account
/
addUser
cURL
curl --request POST \
--url https://apiv1.cakeip.com/openapi/account/addUser \
--header 'Content-Type: application/json' \
--data '
{
"appKey": "<string>",
"params": {
"username": "<string>",
"password": "<string>"
}
}
'import requests
url = "https://apiv1.cakeip.com/openapi/account/addUser"
payload = {
"appKey": "<string>",
"params": {
"username": "<string>",
"password": "<string>"
}
}
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: '<string>', params: {username: '<string>', password: '<string>'}})
};
fetch('https://apiv1.cakeip.com/openapi/account/addUser', 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/addUser",
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' => '<string>',
'params' => [
'username' => '<string>',
'password' => '<string>'
]
]),
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/addUser"
payload := strings.NewReader("{\n \"appKey\": \"<string>\",\n \"params\": {\n \"username\": \"<string>\",\n \"password\": \"<string>\"\n }\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/addUser")
.header("Content-Type", "application/json")
.body("{\n \"appKey\": \"<string>\",\n \"params\": {\n \"username\": \"<string>\",\n \"password\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://apiv1.cakeip.com/openapi/account/addUser")
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\": \"<string>\",\n \"params\": {\n \"username\": \"<string>\",\n \"password\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"code": 0,
"msg": "注册成功",
"data": {
"appKey": "SUB_ACCOUNT_APP_KEY",
"proxyUser": "Jexample",
"proxyPass": "Pexample",
"key": "",
"chenProxyUser": "",
"chenProxyPass": ""
},
"_deprecation": "标准池已下架,新用户仅创建优选池账号,未创建 CHEN 标准池账号"
}
使用代理商的 appKey 创建直属子账户。当前仅创建优选池账号。
成功响应的
data 同时返回子账户的 appKey、代理认证账号 proxyUser 和代理认证密码 proxyPass,请保存这些字段。
params.username 和 params.password 是子账户的平台登录凭据;代理认证凭据由系统另外生成。
key、chenProxyUser、chenProxyPass 为兼容历史调用保留,固定为空字符串。响应顶层的 _deprecation 说明标准池已下架。
创建后可使用子账户的 appKey 再次查询认证信息,也可以使用代理商的 appKey 批量查询本人及直属子账户的认证信息。Body
application/json
Response
200 - application/json
检查 code 判断业务结果:0 为成功,非 0 为失败

