CORS issue when connecting to Admin API

seanrs97
Shopify Partner
1 0 1

Hi 

 

I'm getting a CORS error whenever I try to connect to a private app that I've created in the backend for reading & writing content. I really only need the app to pull in data for data such as blog posts, products etc.

 

The request I'm using can be found below.

 

 

       const config = {
          headers: {
            'Access-Control-Allow-Origin': "*",
            'Access-Control-Allow-Methods': "GET",
            'Access-Control-Allow-Headers': "*",
            'X-Shopify-Access-Token': "{{ACCESS-TOKEN}}",
            'Content-Type': 'application/json',
          }
        };
        const url = "{{shop.url}}/admin/api/2022-04/blogs/{{blog.id}}/articles.json";
        await axios.get(url, config)

 

 

 After this, I'm just using the response to log the data. Unfortunately it doesn't get this far, instead it gets caught in the catch that I'm using, which just throws an Axios error. 

 

Any help on this is really appreciated.

Replies 0 (0)