Rest-API Bestellstaus ändern

Hallo und guten Morgen Ich versuche über die REST_API den Bestellstatus zu ändern. Ich habe mich genau an die ONlinehilfe gehalten. Die REST_API funktioniert. Nun habe ich aber folgendes Problem: Wenn ich den Bestellstatus ändern möchte erhalte ich folgende Fehlermeldung:

HTTP: 302

PHP Notice: Use of undefined constant JSON_ERROR_NONE - assumed ‘JSON_ERROR_NONE’ in Embedded code on line 66PHP Notice: Use of undefined constant JSON_ERROR_DEPTH - assumed ‘JSON_ERROR_DEPTH’ in Embedded code on line 67PHP Notice: Use of undefined constant JSON_ERROR_CTRL_CHAR - assumed ‘JSON_ERROR_CTRL_CHAR’ in Embedded code on line 68PHP Notice: Use of undefined constant JSON_ERROR_SYNTAX - assumed ‘JSON_ERROR_SYNTAX’ in Embedded code on line 69

Could not decode json

PHP Fatal error: Call to undefined function json_last_error() in Embedded code on line 72 Der Bestellstatus wird aber korrekt geändert. Source-genau nach Beispiel: class ApiClient { const METHODE_GET = ‘GET’; const METHODE_PUT = ‘PUT’; const METHODE_POST = ‘POST’; const METHODE_DELETE = ‘DELETE’; protected $validMethods = array( self::METHODE_GET, self::METHODE_PUT, self::METHODE_POST, self::METHODE_DELETE ); protected $apiUrl; protected $cURL; public function __construct($apiUrl, $username, $apiKey) { $this->apiUrl = rtrim($apiUrl, ‘/’) . ‘/’; //Initializes the cURL instance $this->cURL = curl_init(); curl_setopt($this->cURL, CURLOPT_RETURNTRANSFER, true); curl_setopt($this->cURL, CURLOPT_FOLLOWLOCATION, false); curl_setopt($this->cURL, CURLOPT_HTTPAUTH, CURLAUTH_DIGEST); curl_setopt($this->cURL, CURLOPT_USERPWD, $username . ‘:’ . $apiKey); curl_setopt($this->cURL, CURLOPT_HTTPHEADER, array( ‘Content-Type: application/json; charset=utf-8’, )); } public function call($url, $method = self::METHODE_GET, $data = array(), $params = array()) { if (!in_array($method, $this->validMethods)) { throw new Exception('Invalid HTTP-Methode: ’ . $method); } $queryString = ‘’; if (!empty($params)) { $queryString = http_build_query($params); } $url = rtrim($url, ‘?’) . ‘?’; $url = $this->apiUrl . $url . $queryString; $dataString = json_encode($data); curl_setopt($this->cURL, CURLOPT_URL, $url); curl_setopt($this->cURL, CURLOPT_CUSTOMREQUEST, $method); curl_setopt($this->cURL, CURLOPT_POSTFIELDS, $dataString); $result = curl_exec($this->cURL); $httpCode = curl_getinfo($this->cURL, CURLINFO_HTTP_CODE); return $this->prepareResponse($result, $httpCode); } public function get($url, $params = array()) { return $this->call($url, self::METHODE_GET, array(), $params); } public function post($url, $data = array(), $params = array()) { return $this->call($url, self::METHODE_POST, $data, $params); } public function put($url, $data = array(), $params = array()) { return $this->call($url, self::METHODE_PUT, $data, $params); } public function delete($url, $params = array()) { return $this->call($url, self::METHODE_DELETE, array(), $params); } protected function prepareResponse($result, $httpCode) { echo "

HTTP: $httpCode

"; if (null === $decodedResult = json_decode($result, true)) { $jsonErrors = array( JSON_ERROR_NONE => ‘Es ist kein Fehler aufgetreten’, JSON_ERROR_DEPTH => ‘Die maximale Stacktiefe wurde erreicht’, JSON_ERROR_CTRL_CHAR => ‘Steuerzeichenfehler, möglicherweise fehlerhaft kodiert’, JSON_ERROR_SYNTAX => ‘Syntaxfehler’, ); echo "

Could not decode json

"; echo "json_last_error: " . $jsonErrors[json_last_error()]; echo "
Raw:
"; echo "

" . print\_r($result, true) . "

"; return; } if (!isset($decodedResult[‘success’])) { echo “Invalid Response”; return; } if (!$decodedResult[‘success’]) { echo "

No Success

"; echo "

" . $decodedResult[‘message’] . "

"; return; } echo "

Success

"; if (isset($decodedResult[‘data’])) { echo "

" . print\_r($decodedResult['data'], true) . "

"; } return $decodedResult; } }; $client = new ApiClient(‘http://shop.aqula.ch/api’,‘userapi’,'HEVgLyZkHTShHNH5yvqAE’); $client->call(‘orders/3479’, ApiClient::METHODE_PUT, array( ‘orderStatusId’ => 2, )); Für jede Hilfe bin ich dankbar! Grüsse Urs

Für Hilfe wäre ich sehr dankbar-würde schon gerne wissen was mir diese Fehlermeldung sagen möchte