1 year ago

#370168

test-img

icg

True Caller Mobile Web SDK Integration

I am integrating Truecaller mobile web SDK in my CodeIgniter application for verification. I am successfully invoking the true caller for verification, but I am not getting the response at the endpoints. It is mentioned in the document that they post the response in a few milliseconds, but I am accessing that with the $_POST variable. Is it correct? Can anyone guide me in this, please?

if (isset($_POST["requestId"]) != 'null') {
    $endpoints = $_POST["endpoint"];
    log_message('error', $_POST["requestId"]);

    $url = $endpoint;
    $curl = curl_init($url);
    curl_setopt($curl, CURLOPT_URL, $url);
    curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
    $access_token = "Bearer ".$_POST["accessToken"];
    $headers = array(
        "Authorization: $access_token",
        "Cache-Control: no-cache",
        "Content-Type: application/json",
    );
    curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
    //for debug only!
    curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);
    curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);

    $resp = curl_exec($curl);
    curl_close($curl);
    var_dump($resp);
}

php

json

codeigniter

response

0 Answers

Your Answer

Accepted video resources