script tag adding issue

script tag adding issue

1 0 0

Hey everyone. there is some trouble with adding script tags
trying to add script tag using curl according to documentation
curl -d '{"script_tag":{"event":"onload","src":""}}' \
-X POST "" \
-H "X-Shopify-Access-Token: [REDACTED]"
example2 using node js :
{"errors":{"script_tag":"Required parameter missing or invalid"}}
const data = await{
path: 'script_tags',
body: { "script_tag": { "event": "onload", "src": "" } },
type: DataType.JSON,
Received an error response (400 Bad Request) from Shopify a046fc80-db6f-4cad-b658-c260ab05a3fc

Reply 1 (1)

Shopify Staff
249 42 36

Hey @Victor_DS, I tested this functionality with no issue using both cURL and an api client, then took a closer look at the info shared info shared. From now, I would suggest some additional testing using our examples here, as well as with multiple supported versions to confirm if the issue persists across each. Eg. 2021-07 and 2021-10.  

If you continue to get the same error, please feel free to share any x-request-id headers returned back with me here, and I would be happy to pass on insights moving forward - Cheers!

awwdam | API Support @ Shopify
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit or the Shopify Web Design and Development Blog