Kyon147/laravel-shopify

API Requests in scheduled jobs

tom-gurney opened this issue · 2 comments

hello there,

not a bug or feature request, just after some pointers.

I'm looking to create a simple product import app for a client, products will come from a CSV file, uploaded to an FTP server at fixed intervals. I want to read that file every X minutes/hours/whatever and import any additional products into Shopify.

I've got a basic Shopify app set up following the installation guide, but I'm wondering how to send API requests in a scheduled job.

I've had a look at #313 where someone is doing something similar, but I'm not 100% clear on how to achieve what I want.

I was hoping to do something like this:

$shop = Auth::user()
// or
$shop = Auth::loginUsingId(1);

$res = $shop->api()->rest('etc', 'etc');

but I'm getting [API] Invalid API key or access token (unrecognized login or wrong password) back from that.

any suggestions would be great.

(hold fire, I could be an idiot and forgot to comment out the password cast on the user model)

(can confirm, am idiot)