How do I save a multi-select HTML form element using the API?

Curl example:

curl -u ‘email:token’ -X PUT -H ‘Content-Type: application/xml’ -d ‘Twitter,Facebook’ https://secure.solve360.com/contacts/111073786

In this example, we’re selecting both Twitter and Facebook label options for the custom multi-select field in our system.

PHP Example:

  1. In the HTML form post the multiple values for the element as a single array by adding a set of square brackets to the form element’s name e.g. name=”myCustomField[]”

  2. In the PHP script convert the posted array to a comma delimited string e.g. $fieldValueToSendToSolve = implode(‘, ‘, $_GET[‘myCustomField’]);

  3. In the PHP script save the variable containing the comma delimited string as the Solve multi-select field value