simov / purest

REST API Client Library

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Purest use on shopify

thurstjo63 opened this issue · comments

Hi, You might have noticed my tweet. I'm trying to use Grant and Purest for an app that I'm writing. The testing was going well. I was able to authenticate in test but once I deployed to Heroku, I ran into "Oauth error invalid_request: The redirect_uri is missing or not whitelisted" error. I mapped it in exactly the same way you did in the Grant demo app but am still getting this error.

As well, I'm not totally clear on how to use Purest. I have a clear idea of the REST api call for shopify but don't see what parameters I need to supply to and in what structure to use it for Shopify. Any and all help will be greatly appreciated.

Kind Regards,

John (legendsofthesport.co)

commented

For example you can use this code to get the admin/shop endpoint of the Shopify API:

var Purest = require('purest')
var shopify = new Purest({provider:'shopify'})
shopify.query()
  .get('admin/shop')
  .options({subdomain:'your_company_name'})
  .auth('your_access_token')
  .request(function (err, res, body) {
    // body contains the parsed JSON response
  })

Purest is built on top of the request module, you can see all of its options here.

Simeon,

Again thanks. If you want I can write up an article for you involving Grant and Purest on how to use it with Shopify. I would imagine it will attract a lot of interest to your code. Just let me know if you're happy for me to do it.

Kind Regards,

John

commented

Sure, that would be great!
I'm closing this issue, let me know if you have any other issues 👍