THEME ASSETS API NOT WORKING BUT PRODUCTS API WORKING

Highlighted
New Member
13 0 0

HI,

I am new on shopify, I'm creating an app. I need to create a custom button under store's checkout button on cart page. I am using theme API to get asssets of a theme like this
 

//$url = "https://{$STORE_URL}/admin/products.json";
$url = "https://{$STORE_URL}/admin/themes/#{theme_id}/assets.json?theme_id=1342631654";

$session = curl_init();
curl_setopt($session, CURLOPT_URL, $url);
curl_setopt($session, CURLOPT_HTTPGET, 1); 
curl_setopt($session, CURLOPT_HEADER, false);
curl_setopt($session, CURLOPT_HTTPHEADER, array("X-Shopify-Access-Token:$TOKEN", "Content-type:application/json; charset=utf-8"));
curl_setopt($session, CURLOPT_RETURNTRANSFER, true);

if(ereg("^(https)",$url)) curl_setopt($session,CURLOPT_SSL_VERIFYPEER,false);

$response = curl_exec($session);
curl_close($session);
echo $response;

This snippet of code shows me store's login page. But when I use products API to fetch products it successfully show me products in respnose.
Please help me to fix this problem.
I'm working on a development store.

Thanks for your time.

0 Likes
Highlighted
New Member
13 0 0

Can someone reply on it.

0 Likes