Hi Craig,
I’ve made that change so that the JSON string looks like this:
$jsonstr = ‘{“requestor”: "’ . $requestor . ‘", “subject”: "’ . $subject . ‘", “content”: "’ . $content . ‘", “queue”: "’ . $queue . ‘", “CustomFields”: {“5”: "’ . $name . ‘", “4”: "’ . $phone . ‘", “6”: "’ . $email . ‘", “14”: "’ . $account_number . ‘", “13”: "’ . $service_address . ‘", “9”: "’ . $service_type . ‘", “8”: "’ . $service_provider . ‘", “19”: "’. $ticket_type . ‘"}}’;
{It remains unclear whether or not the JSON string needs to be encoded. I’ve had no success either way. This suggests that while one of those is problematic, the root cause of failure lies elsewhere. }
Still cannot create the ticket. Could there be a problem with authorization? We have a username, a password, and a token hash that was created from username & password.
What specific authorization format does this REST 2.0 API expect (in the context of a PHP CURL script; nothing that would otherwise e entered at a command line is of any use to us because we must automate this process via a web page containing a form and a PHP script called by that form)?
Would either of these be expected to work?
curl_setopt($ch, CURLOPT_HTTPHEADER, array(“Authorization: token $token”,‘Content-Type: application/json’));
curl_setopt($ch, CURLOPT_HTTPHEADER, array(‘Content-Type: application/json’));
curl_setopt($curl, CURLOPT_USERPWD, “username:password”);
Thanks in advance