Script tags api returns empty result

Highlighted
New Member
4 0 0

I am using the scripts tags and fetching all the scripts tags using shopify_call($token, $shop, "/admin/api/2019-10/script_tags.json", array(), 'GET');

I am getting all the scripts that are fine

Array
(
[script_tags] => Array
(
[0] => Array
(
[id] => 113761419401
[src] => https://coliving.kindlebit.com/custom-product-builder/js/shopify.js
[event] => onload
[created_at] => 2020-01-02T04:45:28-05:00
[updated_at] => 2020-01-02T04:45:28-05:00
[display_scope] => all
)

[1] => Array
(
[id] => 113761452169
[src] => https://coliving.kindlebit.com/custom-product-builder/js/shopify.js
[event] => onload
[created_at] => 2020-01-02T04:45:34-05:00
[updated_at] => 2020-01-02T04:45:34-05:00
[display_scope] => all
)

[2] => Array
(
[id] => 113762500745
[src] => https://coliving.kindlebit.com/custom-product-builder/js/shopify.js
[event] => onload
[created_at] => 2020-01-02T05:07:28-05:00
[updated_at] => 2020-01-02T05:07:28-05:00
[display_scope] => all
)

[3] => Array
(
[id] => 113762599049
[src] => https://coliving.kindlebit.com/custom-product-builder/js/shopify.js
[event] => onload
[created_at] => 2020-01-02T05:09:11-05:00
[updated_at] => 2020-01-02T05:09:11-05:00
[display_scope] => all
)

[4] => Array
(
[id] => 113762631817
[src] => https://coliving.kindlebit.com/custom-product-builder/js/shopify.js
[event] => onload
[created_at] => 2020-01-02T05:09:29-05:00
[updated_at] => 2020-01-02T05:09:29-05:00
[display_scope] => all
)

)

)

But now i am going to fetch the scripts related to specific url like shopify_call($token, $shop, "/admin/api/2019-10/script_tags.json?src=https://coliving.kindlebit.com/custom-product-builder/js/shopify.js", array(), 'GET'); This gives me empty array like

Array
(
[script_tags] => Array
(
)

)

Is anything going wrong here can you please guide me on how I can get the scripts related to a specific URL?

 

0 Likes
Highlighted
Shopify Staff
Shopify Staff
586 71 128

Hey @kindlebit,

 

This likely has to do with the slashes in the script tag URL not being escaped properly. Can you confirm if the same call works using Postman or Insomnia? Also if you can provide the X-Shopify-Request-ID from the response header of the call where you're getting back an empty array, I can check our logs and confirm what we're receiving.

JB | Developer Support @ Shopify
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Click Accept as Solution 

0 Likes