$email=$_REQUEST['email'];
$pass=$_REQUEST['pass'];
$fields_string="email=".$email."&password=".$pass."&isEmailVerified=false";
$ch = curl_init();
curl_setopt_array($ch, array(
CURLOPT_RETURNTRANSFER => 1,
CURLOPT_URL => 'https://int.mylinkables.com/consumerapi/consumer',
CURLOPT_USERAGENT => 'Codular Sample cURL Request'
));
curl_setopt($ch,CURLOPT_POSTFIELDS, $fields_string);
$headr = array();
$accesstoken="bfcb2d9f-ab6a-41d1-82db-0a5fba85201b";
$headr[] = 'api: 1.0.0';
$headr[] = 'Accept: application/json';
$headr[] = 'Authorization: Bearer '.$accesstoken;
curl_setopt($ch, CURLOPT_HTTPHEADER,$headr);
curl_setopt($ch, CURLOPT_POST,true);
$file_contents = curl_exec($ch);
if(curl_exec($ch) === false)
{
echo 'Curl error: ' . curl_error($ch);
}
else
{
echo 'Operation completed without any errors';
}
curl_close($ch);
$json = json_decode($file_contents, true);
//printing some values from json
print '<br>';
print "statusCode=".$json[statusCode];
print '<br>';
print "consumerToken=".$consumerToken=$json[consumerToken];
print '<br>';
$pass=$_REQUEST['pass'];
$fields_string="email=".$email."&password=".$pass."&isEmailVerified=false";
$ch = curl_init();
curl_setopt_array($ch, array(
CURLOPT_RETURNTRANSFER => 1,
CURLOPT_URL => 'https://int.mylinkables.com/consumerapi/consumer',
CURLOPT_USERAGENT => 'Codular Sample cURL Request'
));
curl_setopt($ch,CURLOPT_POSTFIELDS, $fields_string);
$headr = array();
$accesstoken="bfcb2d9f-ab6a-41d1-82db-0a5fba85201b";
$headr[] = 'api: 1.0.0';
$headr[] = 'Accept: application/json';
$headr[] = 'Authorization: Bearer '.$accesstoken;
curl_setopt($ch, CURLOPT_HTTPHEADER,$headr);
curl_setopt($ch, CURLOPT_POST,true);
$file_contents = curl_exec($ch);
if(curl_exec($ch) === false)
{
echo 'Curl error: ' . curl_error($ch);
}
else
{
echo 'Operation completed without any errors';
}
curl_close($ch);
$json = json_decode($file_contents, true);
//printing some values from json
print '<br>';
print "statusCode=".$json[statusCode];
print '<br>';
print "consumerToken=".$consumerToken=$json[consumerToken];
print '<br>';