christophergregory / shopify-node-api

OAuth2 Module for Shopify API
MIT License
216 stars 74 forks source link

quick question #63

Closed BryanYeh closed 8 years ago

BryanYeh commented 8 years ago
  1. user installs app
  2. user accepts app charge
  3. app Shopify.exchange_temporary_token and saves token to database
  4. app POST creates uninstall webhook
  5. user uninstalls app
  6. app receives the POST from webhook
  7. app gets from database the token and replaces token below, after shop, api key, secret are input correctly
var Shopify = new shopifyAPI({
  shop: 'MYSHOP', // MYSHOP.myshopify.com
  shopify_api_key: '', // Your API key
  shopify_shared_secret: '', // Your Shared Secret
  access_token: 'token', //permanent token
});
  1. app DELETE Shopify.delete the uninstall webhook
    • app is getting 401 Invalid API key or access token (unrecognized login or wrong password)

My question is did I mess up or miss anything on any of the steps I listed to get the 401 error?

nodeit commented 8 years ago

Once the user uninstalls the app, the token is no longer valid. You can not make requests on behalf of an uninstalled user.

You didn't do anything wrong per se, the API is working as expected.