Jump to content

API & Client Custom Fields Help


BryanB

Recommended Posts

I'm using the clientadd API and everything is working except the client custom fields. They are not saving at all... Here is what I have:

 

00001916.png

 

$customfields = array(
   'customfield[1]' => "customfield[1]",
   'customfield[7]' => "customfield[7]",
   'customfield[14]' => "customfield[14]",
);
$postfields["customfields"] = base64_encode(serialize($customfields));

 

Does this look right? I'm not sure if I'm using the correct values. Here is what the form looks like:

 

<td class="fieldarea">Your Website</td> 
           <td><input type="text" size="30" name="customfield[1]" value=""> </td> 

 

 

Thanks!

Link to comment
Share on other sites

  • WHMCS CEO

Hi,

 

Close, but that's not quite right. The custom fields should be passed to the API like this:

 

$customfields = array(
   '1' => "xxxxxx",
   '7' => "yyyyyyyyyy",
   '14' => "zzzzzzzz",
);
$postfields["customfields"] = base64_encode(serialize($customfields));

 

Where 1, 7 and 14 are the field IDs from tblcustomfields.

 

Matt

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated