自定义字段未使用WHMCS API插入

ben*_*nji 2 api whmcs

我试图使用WHMCS API的"添加客户端"插入一些额外的客户端详细信息.但是当我检查WHMCS客户区时,插入发生了,但是自定义域没有效果.我在客户区customfield[1],[2]...[5]添加了字段.代码片段如下

$postfields["action"] = "addclient"; 

$customfields = array(
'customfield[1]' => "ABC",
'customfield[2]' => "XYZ"
);

$postfields["customfields"] = base64_encode(serialize($customfields)
Run Code Online (Sandbox Code Playgroud)

请提出解决方案.

ben*_*nji 6

我已经解决了这个问题.

我改变了

$customfields = array(
'customfield[1]' => "ABC",
'customfield[2]' => "XYZ"
);

$postfields["customfields"] = base64_encode(serialize($customfields)
Run Code Online (Sandbox Code Playgroud)

$postfields["customfield[1]"] = "ABC";
$postfields["customfield[2]"] = "XYZ";
Run Code Online (Sandbox Code Playgroud)