It would be better if you showed the part of the code that is giving error. But the common mistakes when using CURL is that it is not installed on the server, the way it handles data and the SSL configuration. You can try the following:
Verify that it is installed:
function _isCurl() {
return function_exists('curl_version');
}
In the parameter setting set 0 (zero) to SSL:
$ch = curl_init("URL_PARA_CONECTAR");
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
...
Treat the result as a json array:
...
$data = curl_exec($ch);
$response = json_decode($data, true); // o true indica que você quer o resultado como array
An example configuration would be:
$valoresParaSubmeter = array('key1' => 'valor1', 'key2' => 'valor2');
$ch = curl_init("URL_PARA_CONECTAR");
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, FALSE);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $valoresParaSubmeter);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
$data = curl_exec($ch);
$response = json_decode($data, true); // o true indica que você quer o resultado como array
var_dump($response);
I hope I have helped. :)