# API + Textbaustein ändern

**URL:** <https://forum.shopware.com/t/api-textbaustein-aendern/104669>\
**Category:** Shopware 6 (German)\
**Created:** [27. Juli 2024 um 12:31 UTC](https://forum.shopware.com/t/api-textbaustein-aendern/104669 "2024-07-27T12:31:20Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![User1](https://avatars.discourse-cdn.com/v4/letter/u/5daacb/32.png) [@User1](https://forum.shopware.com/u/User1)\
**Post date:** [27. Juli 2024 um 12:31 UTC](https://forum.shopware.com/t/api-textbaustein-aendern/104669/1 "2024-07-27T12:31:20Z")

</div>

Ich versuche gerade einen Textbaustein per API zu ändern. Aber funktioniert leider nicht, wo liegt mein Fehler:?

$curl = curl\_init(); curl\_setopt\_array($curl, [  
CURLOPT\_URL =\> „[https://www.domain.de/api/snippet/xxxxxxxxx](https://www.domain.de/api/snippet/xxxxxxxxx)“,  
CURLOPT\_RETURNTRANSFER =\> true,CURLOPT\_ENCODING =\> „“,CURLOPT\_MAXREDIRS =\> 10,CURLOPT\_TIMEOUT =\> 30,CURLOPT\_HTTP\_VERSION =\> CURL\_HTTP\_VERSION\_1\_1,CURLOPT\_CUSTOMREQUEST =\> „PATCH“,CURLOPT\_POSTFIELDS =\> json\_encode([  
‚value‘ =\> [‚Textbautstein‘],  
CURLOPT\_HTTPHEADER =\> [„Accept: application/json“,„Authorization: $token“,„Content-Type: application/json“],]);  
$response = curl\_exec($curl);$err = curl\_error($curl);curl\_close($curl);
