PHP Curl POST Error

Hi,
I have a doubt in php curl posting. I posted the following data
$data = [
“CompanyCode” => 01,
“TxnCode” => “GJV”,
“TxnDate” => $pay_date,
“TxnNum” => $trackid,
“ReferenceNum” => $ref,
“Description” => $temp_result[‘MerchantInvoiceDescription’],
“JournalType” => null,
“JournalLineCount” => null,
“AccountType” => 2,
“AccountCode” => “B001”,
“FinancialSegments” => null,
“CurrencyCode” => “KWD”,
“DrCrType” => 1,
“EnteredAmount” => $temp_result[‘Amount’],
“AccountedAmount” => $temp_result[‘Amount’],
“Remarks” => null,

];
	
	$apisetting = "SELECT access_token FROM ApiSettings where id = 1";
	$apisetting = mysql_fetch_assoc(mysql_query($apisetting));
	
	$url  = "https://ws.enfinityoncloud.com/api/Journal/CreateJournal";
	
	$ch = curl_init();
	$headers = array(
		"Authorization: Bearer ".$apisetting["access_token"],
		"Content-Type: application/json"
	);
	
	curl_setopt($ch, CURLOPT_URL, $url);
	curl_setopt($ch, CURLOPT_POST, TRUE);
	curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
	curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:2.0) Gecko/20100101 Firefox/4.0");
	curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
	curl_setopt($ch, CURLOPT_BINARYTRANSFER, TRUE);
	curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
	$output = curl_exec($ch);
	curl_close($ch);

I got this error.
“An exception was thrown while attempting to evaluate a LINQ query parameter expression. To show additional information call EnableSensitiveDataLogging() when overriding DbContext.OnConfiguring.”

Can anyone help me?

LINQ is mostly used in C# environments, so you are having some trouble from the underlying software, or the API is returning this error - but at least it has nothing to do with the code you posted.

1 Like

Okie. Thankyou for your response

Yeah, this is an issue on the API side, not yours. To verify this, you can use a tool like Postman or Fiddler to make a request to the API.

Sponsor our Newsletter | Privacy Policy | Terms of Service