App reviews, troubleshooting, and recommendations
We're moving the community! Starting July 7, the current community will be read-only for approx. 2 weeks. You can browse content, but posting will be temporarily unavailable. Learn more
Hi,
I'm new in Shopify APP development, I'm working on custom app which use script tag api. Successfully install app on development store but when i run the app it throws an error.
Error: Array ( [error] => 783: unexpected token at 'script_tag%5Bevent%5D=onload&script_tag%5Bsrc%5D=https%3A%2F%2Fflamead.com%2Fauksales_shopify_app%2Fjs%2Fscript_tag.js' )
Script tag API request code:
<?php
require_once("inc/functions.php");
$token = 'cec259e930e2e9bf4c175e2b9677be4d';
$shop_url = 'checkout-scripts';
$script_tag = array('script_tag'=> array('event'=>'onload',"src"=>"https://flamead.com/auksales_shopify_app/js/script_tag.js"));
$scriptTag = shopify_call($token,$shop_url,'/admin/api/2020-10/script_tags.json',$script_tag,'POST');
$scriptTag = json_decode($scriptTag['response'],JSON_PRETTY_PRINT);
print_r($scriptTag);
?>
Please guide me how can i solve this. I tried it but un-successful.
Thanks,
Faisal