Neha Neha - 11 months ago 69
PHP Question

Screenleap returning NULL in php

I have created developer account in screenleap and trying to integrate screenleap API into my application, but when I am trying sample request code generated by screenleap it is giving me NULL.

How to test sample request in php?

$url = '';
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('authtoken:my_authtoken'));
curl_setopt($ch, CURLOPT_POSTFIELDS, 'accountid=my_accountid');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$data = curl_exec($ch);
$json = json_decode($data,true);

Answer Source

It's possible your system defaults aren't working for the SSL certificate verification.

You can try turning off the verification with:

curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);

If that works, see and for more information.