Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

Error with API key when i reinstall app

Error with API key when i reinstall app

hieunoobpro
Shopify Partner
16 0 1

I am creating an app and had call to graphql like this:

  const { session } = await authenticate.admin(request)
    const {shop, accessToken } = session;

    try{

        const response = await fetch(`https://${shop}/admin/api/${apiVersion}/graphql.json`, {
            method: "POST",
            headers: {
                "Content-Type": "application/graphql",
                "X-Shopify-Access-Token": accessToken!
            },
            body: query

        });
        const data = await response.json()
it run successful at the first time and i can access. But when i uninstall app and reinstall it. i have error:
errors: '[API] Invalid API key or access token (unrecognized login or wrong password)'
I have console.log "session", "shop" and "accessToken". It still print out the information . I used them in Postman and it still has error:
  errors: '[API] Invalid API key or access token (unrecognized login or wrong password)



Replies 0 (0)