Get analyticsToken

Get analyticsToken

evgeniy_simonov
New Member
5 0 0

Hello, I ran into a problem when getting analyticsToken, I am trying to get it by request GraphQL 

 

var axios = require('axios');
var data = JSON.stringify({
  query: `{
  shop {
    id
    analyticsToken
  }
}`,
  variables: {}
});

var config = {
  method: 'post',
  url: 'https://wellabsnew.myshopify.com/admin/api/2021-10/graphql.json',
  headers: { 
    'Content-Type': 'application/json', 
    'X-Shopify-Access-Token': 'xxx'
  },
  data : data
};

axios(config)
.then(function (response) {
  console.log(JSON.stringify(response.data));
})
.catch(function (error) {
  console.log(error);
});

 

but I get an error in response

 

{
    "data": null,
    "errors": [
        {
            "message": "analytics_token access denied",
            "locations": [
                {
                    "line": 7,
                    "column": 5
                }
            ],
            "path": [
                "shop",
                "analyticsToken"
            ]
        }
    ],
    "extensions": {
        "cost": {
            "requestedQueryCost": 1,
            "actualQueryCost": 1,
            "throttleStatus": {
                "maximumAvailable": 1000.0,
                "currentlyAvailable": 999,
                "restoreRate": 50.0
            }
        }
    }
}

 

Earlier, I contacted on this issue, I was told that an extended plan is required to access analytics from external systems, at the moment this condition is met, but I still cannot get access to unloading analytics into my own information system. Please help me to resolve this issue, I will be extremely grateful.

Replies 0 (0)