如何访问或创建Shopify店面令牌[403 Forbidden]?

时间:2018-10-23 10:42:22

标签: shopify shopify-javascript-buy-sdk

我正在尝试访问或创建Shopify店面访问令牌。为此,我遵循Shopify文档[LINK],并且按照doc上定义的过程进行操作,但是在响应中遇到了错误。

{
    "errors": "App must have a channel record to create a storefront access token."
}

在进行身份验证时,我还定义了未经身份验证的范围。 (unauthenticated_read_content,unauthenticated_write_customers,unauthenticated_write_checkouts,unauthenticated_read_product_listings),但仍然出现此错误。

请求信息:

var request = require("request");

var options = { method: 'POST',
  url: 'https://teststore-myteststore.myshopify.com/admin/storefront_access_tokens.json',
  headers: 
   { 'Postman-Token': 'cc407456-0d7c-42e5-8517-405c3ec6acaf',
     'Content-Type': 'application/json',
     'X-Shopify-Access-Token': '5c00cd60a76e6dce56e6112dfagfhxvlp' },
  body: { storefront_access_token: { title: 'Test2' } },
  json: true };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});

0 个答案:

没有答案