# Probleme mit API

**URL:** <https://forum.shopware.com/t/probleme-mit-api/26782>\
**Category:** Programmierung\
**Created:** [2. Mai 2015 um 07:47 UTC](https://forum.shopware.com/t/probleme-mit-api/26782 "2015-05-02T07:47:17Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Urs\_Landis](https://avatars.discourse-cdn.com/v4/letter/u/3be4f8/32.png) [@Urs\_Landis](https://forum.shopware.com/u/Urs_Landis)\
**Post date:** [2. Mai 2015 um 07:47 UTC](https://forum.shopware.com/t/probleme-mit-api/26782/1 "2015-05-02T07:47:17Z")

</div>

Guten Tag Unsere API Scripte, welche unter 4 problemlos liefen werfen unter 5.0 alle einen Fehler:

## HTTP: 0

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 Jemand eine Idee was das sein könnte? Grüsse Urs

---

<div class="post-metadata">

**Author:** ![DanielNogel](https://avatars.discourse-cdn.com/v4/letter/d/96bed5/32.png) [@DanielNogel](https://forum.shopware.com/u/DanielNogel)\
**Post date:** [2. Mai 2015 um 09:32 UTC](https://forum.shopware.com/t/probleme-mit-api/26782/2 "2015-05-02T09:32:14Z")

</div>

Hi, die Fehlermeldung sagt ja letztlich, dass bspw. JSON\_ERROR\_NONE keine gültige Konstante ist und PHP versucht, das als Zeichenkette zu interpretieren. Das ist aber schon verkehrt, die Konstanten werden durch JSON definiert. Kannst du mal einen Blick in Grundeinstellungen-\>Systeminfo werfen, ob da alles grün ist? Benutzt du die ganz normale Rest-API oder was eigenes? Daniel

---

<div class="post-metadata">

**Author:** ![Urs\_Landis](https://avatars.discourse-cdn.com/v4/letter/u/3be4f8/32.png) [@Urs\_Landis](https://forum.shopware.com/u/Urs_Landis)\
**Post date:** [3. Mai 2015 um 07:09 UTC](https://forum.shopware.com/t/probleme-mit-api/26782/3 "2015-05-03T07:09:36Z")

</div>

Guten Morgen In den Systemifos ist Alles grün. Ich verwende die ganz normale REST-Api Grüsse Urs

---

<div class="post-metadata">

**Author:** ![DanielNogel](https://avatars.discourse-cdn.com/v4/letter/d/96bed5/32.png) [@DanielNogel](https://forum.shopware.com/u/DanielNogel)\
**Post date:** [3. Mai 2015 um 07:54 UTC](https://forum.shopware.com/t/probleme-mit-api/26782/4 "2015-05-03T07:54:27Z")

</div>

Hi, auch merkwürdig: [quote]PHP Fatal error: Call to undefined function json\_last\_error()[/quote] laut PHP Doc ist das ab PHP 5.3. verfügbar. Das riecht schon alles nach einem Problem mit der PHP-Version. Daniel

---

<div class="post-metadata">

**Author:** ![Urs\_Landis](https://avatars.discourse-cdn.com/v4/letter/u/3be4f8/32.png) [@Urs\_Landis](https://forum.shopware.com/u/Urs_Landis)\
**Post date:** [3. Mai 2015 um 08:59 UTC](https://forum.shopware.com/t/probleme-mit-api/26782/5 "2015-05-03T08:59:28Z")

</div>

Aber diese PHP Installation lief fehlerfrei mit SW 4

---

<div class="post-metadata">

**Author:** ![Urs\_Landis](https://avatars.discourse-cdn.com/v4/letter/u/3be4f8/32.png) [@Urs\_Landis](https://forum.shopware.com/u/Urs_Landis)\
**Post date:** [3. Mai 2015 um 15:22 UTC](https://forum.shopware.com/t/probleme-mit-api/26782/6 "2015-05-03T15:22:18Z")

</div>

Problem gefunden und gelöst! Wir haben vor längerer Zeit unseren Shop umgetauft und die API Befehle wurden an die alte Domain gesendet, welche nach wie vor noch funktioniert. Unter SW4 war dies kein Problem, unter SW5 anscheinend schon. Danke für die Hilfe!

---

<div class="post-metadata">

**Author:** ![reddwarf](https://avatars.discourse-cdn.com/v4/letter/r/f0a364/32.png) [@reddwarf](https://forum.shopware.com/u/reddwarf)\
**Post date:** [9. Mai 2015 um 14:15 UTC](https://forum.shopware.com/t/probleme-mit-api/26782/7 "2015-05-09T14:15:12Z")

</div>

Hallo, darf ich mal fragen, wie ihr das gelöst habt? Wir haben vor einiger Zeit auf https überall umgestellt. Unter Shopware4 war das kein Problem. Die Api hat funktioniert. Heute hab ich auf die 5 aktualisiert und die Api geht nicht mehr. Kann mich auch nicht in /api/articles einloggen. Gruß Mario

---

<div class="post-metadata">

**Author:** ![Urs\_Landis](https://avatars.discourse-cdn.com/v4/letter/u/3be4f8/32.png) [@Urs\_Landis](https://forum.shopware.com/u/Urs_Landis)\
**Post date:** [15. Mai 2015 um 12:41 UTC](https://forum.shopware.com/t/probleme-mit-api/26782/8 "2015-05-15T12:41:40Z")

</div>

Hallo Mario Den API-Aufruf auf die [http://domain.ch](http://domain.ch) geändert. Vorher leifen sie bei uns problemlos über ein Alias, geht in 5.0 anscheinend nicht mehr… Grüsse Urs
