gnikyt / laravel-shopify

A full-featured Laravel package for aiding in Shopify App development
MIT License
1.24k stars 374 forks source link

Can't get template by rest api (not found) #520

Closed rakkot-vm closed 4 years ago

rakkot-vm commented 4 years ago

Expected Behavior

$shop->api()->rest('GET', '/admin/api/2020-04/themes/103399653540/assets.json?asset[key]=templates/404.liquid' Should return template of 404 page

Current Behavior

$shop->api()->rest('GET', '/admin/api/2020-04/themes/103399653540/assets.json?asset[key]=templates/404.liquid' return error not found but if I do this request by browser it returns template

Failure Information

When I try to get a template by rest API it always returns error "not found"

image

rakkot-vm commented 4 years ago

Looks like this issue can have a similar problem https://github.com/osiset/laravel-shopify/issues/521

rakkot-vm commented 4 years ago

I wasn't an error, the right way to request was - $shop->api()->rest('GET', '/admin/api/2020-04/themes/'. $themeId .'/assets.json', ['asset' => ['key' => 'templates/404.liquid']])