Replies: 1 comment
-
In Opencart 4.0.1.1 The correct URL should $url = 'https://***********/index.php?route=api/sale/order|load&language=en-gb&order_id=15'; Pay attend to "api/sale/order|load" instead of "api/sale/order.load" |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I would like to send an API request to change the status of my order, unfortunately I get the HTTP/1.1 404 Not Found message for all requests except index.php?route=api/account/login&language=en-gb&store_id=0. I would like to use the index.php?route=api/sale/order.load&language=en-gb&store_id=0 request.
The api/account/login call is successful, I get session_id.
The version of Opencart I am using is 4.0.1.1 unfortunately the upgrade is not possible for the moment due to incompatibility of some extensions. Please can you help me to change something or how to send the request correctly?
Thanks in advance for your help.
I used this code now:
`
$url = 'https://***********/index.php?route=api/sale/order.load&language=en-gb&order_id=15';
$curl2 = curl_init();
curl_setopt($curl2, CURLOPT_URL, $url);
curl_setopt($curl2, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl2, CURLOPT_HEADER, true);
curl_setopt($curl2, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($curl2, CURLOPT_CONNECTTIMEOUT, 30);
curl_setopt($curl2, CURLOPT_TIMEOUT, 30);
curl_setopt($curl2, CURLOPT_POST, 1);
curl_setopt($curl2, CURLOPT_POSTFIELDS, $request_data);
curl_setopt($curl2, CURLOPT_COOKIE, 'OCSESSID=' . $session_id);
$response = curl_exec($curl2);`
Beta Was this translation helpful? Give feedback.
All reactions