AnsweredAssumed Answered

v10 API calls fail when content has equal sign (=)

Question asked by paperless on Jan 19, 2015
Latest reply on Feb 2, 2015 by Alex Nassi
The bulk post request fails when it has = sign in a field:
$bulk_arguments = array(  "requests" => array(
      array(
        "url" => "/v10/Accounts",
        "method" => "POST",
        "data"=>"{\"name\": \"Bulk Test 3\",\"description\": \"Bulk Description 3\"}",
    ),
      array(
        "url" => "/v10/Accounts",
        "method" => "POST",
        "data"=>"{\"name\": \"Bulk Test 4\",\"description\": \"Bulk with = sign\"}",
    ),    
  )
);
$bulk_response = call($url."/bulk", $oauth2_token_result->access_token, 'POST', $bulk_arguments);

Bulk request content:
{"requests":[{"url":"\/v10\/Accounts","method":"POST","data":"{\"name\": \"Bulk Test 3\",\"description\": \"Bulk Description 3\"}"},{"url":"\/v10\/Accounts","method":"POST","data":"{\"name\": \"Bulk Test 4\",\"description\": \"Bulk with = sign\"}"}]}

API response:
Bad data passed in; <a href="https://url...";

Did substitute %3d and \u003d and &#61; for = sign and they go through as is, instead of producing = sign.

Another simple non-bulk POST request also fails with the same API error:
$parameters = array(     "name" => "Test with Equal Sign",   
    "description" => "a+b=c", 
);
$get_record_result = call($base_url ."/Notes", $oauth2_token_result->access_token, 'POST',$parameters);

Outcomes