Skip to content
Tabrez Shaikh edited this page Sep 20, 2016 · 1 revision

Frequently Asked Questions:

  1. While calling, I get the below SSL error: Call failed due to unhandled exception/error(SSL certificate problem: unable to get local issuer certificate)

Ans:

Call the below function before calling sendJson() function

Unirest::verifyPeer(false);

Example:

<?php

require_once __DIR__.'/vendor/autoload.php';

use PepipostAPIV10Lib\Controllers\Email;

$email = new Email();

$data = array(
...
Unirest::verifyPeer(false);

try {
    $response = $email->sendJson( $data );
    //var_dump($response);
    if(empty($response->errorcode)){
        print "Email sent successfully.\n";
    }
    else {
        print "Email sent Failed.\n";
        print "errormessage(" . $response->errormessage . ") \n";
        print "errorcode(" . $response->errorcode . ").\n";
    }
}
catch(Exception $e){
    print 'Call failed due to unhandled exception/error('. $e->getMessage().')'."\n";
}
...
Clone this wiki locally