ERPNext.com Frappe Cloud Support Partners Foundation Frappe School

Cross server API Issue

Hello ,
i want to insert donor details from PHP website to erpnext server… When i check my API from postman it will insert data successfully…but when i try to insert from PHP website server to erpnext local or global server…there is no response…any type of helps much much appreciated…below is my API details:

<?php

 $curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "http://127.0.0.1:8000/api/resource/Donor",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS =>"{\n    \"donor_name\":\"Abhinaba\",\n    \"donor_type\":\"Organization\",\n    \"email\":\"abhisek@gmail.com\"\n}",
  CURLOPT_HTTPHEADER => array(
    "Authorization: token *****************:***************",
    "Content-Type: application/json",
    "Cookie: sid=Guest; system_user=yes; full_name=Guest; user_id=Guest; user_image="
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

?>

More Over when i try to insert data from PHP local server to erpnext server…it will also reflect and insert in erpnext server…but cant any response when i am trying to insert data from PHP global server to erpnext local or global server…Please find the screenshot form better understanding.

Can you try removing the Cookie header?

yes i have already test without cookie settings. And more over i am able to display the error. Please find the attachment…

Here “7” is the curl error number. Any helps much much appriciated…as i have got no solution from anywhere…