# REST API ...  useNumberAsID

**URL:** <https://forum.shopware.com/t/rest-api-usenumberasid/45724>\
**Category:** Programmierung\
**Created:** [12. Mai 2017 um 12:43 UTC](https://forum.shopware.com/t/rest-api-usenumberasid/45724 "2017-05-12T12:43:43Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![Kaster](https://avatars.discourse-cdn.com/v4/letter/k/a6a055/32.png) [@Kaster](https://forum.shopware.com/u/Kaster)\
**Post date:** [16. Mai 2017 um 15:16 UTC](https://forum.shopware.com/t/rest-api-usenumberasid/45724/4 "2017-05-16T15:16:48Z")

</div>

Also,

mit RestSharp abgesendeter GET Request kommt nicht klar mit dem Erkennen wann die ID als Artikelnummer zu verwenden ist und wann nicht.

Habe jetzt eine Änderung in Articles.php (function getAction()) gemacht mit der es funktioniert:

* * *

&nbsp; &nbsp; &nbsp; &nbsp; $id = $this-\>Request()-\>getParam(‚id‘);  
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;  
&nbsp; &nbsp; &nbsp; &nbsp; Shopware()-\>PluginLogger()-\>info(„getAction id vorher: „.urldecode($id));  
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;$stuecke = spliti (“?“, urldecode($id), 2);  
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;$id = $stuecke[0];  
&nbsp; &nbsp; &nbsp; &nbsp; Shopware()-\>PluginLogger()-\>info(„getAction id nacher: „.$id);  
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;$stuecke2 = spliti (“=“, $stuecke[1], 2);  
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;if ($stuecke2[0] == „useNumberAsId“) {  
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;$useNumberAsId = (boolean) $stuecke2[1] == „true“;  
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;} else {  
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;$useNumberAsId = (boolean) 0;  
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;}  
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;//$useNumberAsId = (boolean) $this-\>Request()-\>getParam(‚useNumberAsId‘, 0);

* * *

Ich weiss nicht genau warum der Request dort in dem Fall so ankommt, aber als workaround, bis das gefixt wird, taugt das hier erstmal.

Gruß,

Kaster

---

_[View the full topic](https://forum.shopware.com/t/rest-api-usenumberasid/45724)._
