1

I'm trying to submit a small amount of data to the ZenDesk api. This works fine 99% of the time, the only issue occurs when an exclamation mark is present in the text.

I'm using the following to add the record:

$company_name = "Company Name!";
curl_setopt($ch, CURLOPT_URL,"https://company.zendesk.com/api/v2/organizations.json");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 
$body = '{"organization": {"name": "'.$company_name.'","domain_names": ["'.$company_url.'"]}}';
curl_setopt($ch, CURLOPT_POSTFIELDS,$body);
curl_setopt($ch, CURLOPT_USERPWD, $username . ":" . $password);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json',
'Connection: Keep-Alive'
));
4

1 に答える 1