2011-11-15 2 views
2

WHMCS APIの 'add client'を使用して、追加のクライアントの詳細を挿入しようとしています。 しかし、挿入が行われますが、customfieldsは何の効果も得ない、私はWHMCSクライアントarea.Iでチェックするときcustomfield[1],[2]...[5]は、クライアントarea.Theコードスニペットのフィールドとして追加したカスタムフィールドがWHMCS APIを使用して挿入されない

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

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

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

を次のようなソリューションを提案してください。

答えて

6

私はこの問題を解決しました。

私はちょうど

$postfields["customfield[1]"] = "ABC"; 
$postfields["customfield[2]"] = "XYZ"; 
+0

何人かの人々が有用見つけることだけ注意を。私が何を試しても、新しいクライアントを作成するときにカスタムフィールドをAPI経由で挿入することはできませんでしたが、クライアントを作成するときに機能し、その後、 'updateclient' APIコマンドを使用してカスタムフィールドでクライアントを更新しました。 – azzy81

1

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

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

を変更し、次の問題を解決する必要があります。

$customfields = array('1' => "ABC", '2' => "XYZ"); 
$postfields["customfields"] = base64_encode(serialize($customfields) 
関連する問題