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

未使用WHMCS API插入自定义字段,api,whmcs,Api,Whmcs,我试图使用WHMCS API的“添加客户端”插入一些额外的客户端详细信息。 然而,当我在WHMCS客户端区域中检查时,插入发生了,但是customfields没有效果。我已经在客户端区域中添加了customfield[1]、[2]…[5]作为字段。代码片段如下 $postfields["action"] = "addclient"; $customfields = array( 'customfield[1]' => "ABC", 'customfield[2]' => "XYZ

我试图使用WHMCS API的“添加客户端”插入一些额外的客户端详细信息。 然而,当我在WHMCS客户端区域中检查时,插入发生了,但是customfields没有效果。我已经在客户端区域中添加了
customfield[1]、[2]…[5]
作为字段。代码片段如下

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

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

$postfields["customfields"] = base64_encode(serialize($customfields)

请提出解决方案。

我已经解决了这个问题

我刚换了衣服

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

$postfields["customfields"] = base64_encode(serialize($customfields)
进入


以下几点应该可以解决这个问题:

$customfields=array('1'=>“ABC”、'2'=>“XYZ”);
$postfields[“customfields”]=base64_编码(序列化($customfields)

请注意,有些人可能会觉得这很有用。无论我做了什么尝试,在创建新客户机时都无法通过API插入自定义字段,但在创建客户机时确实有效,然后使用“updateclient”API命令直接用自定义字段更新客户机。
$postfields["customfield[1]"] = "ABC";
$postfields["customfield[2]"] = "XYZ";