php - "body":"[API] 此操作需要商家批准 read_customers 范围。"
问题描述
我是 Shopify 开发的新手,在尝试让客户使用代码时遇到该错误:
$id = '5207879811243';
$shop = Auth::user();
$request = $shop->api()->rest('GET', '/admin/api/customers/search.json', ['customers' => "id:{$id}"]);
return $request;
解决方案
在进行任何 API 调用之前,您必须执行以下操作:
- 对于私有应用程序,请确保您已勾选 read_customers范围
- 对于公共应用程序,请确保您的 oAuth 范围包括read_customers范围
Shopify 提供的大量文档向您展示了 App Scopes。
推荐阅读
- ios - NavigationController 在 push 和 pop 后会切掉阴影吗?
- spring - 如何从 Open API 3 规范全局忽略 Spring Boot 的 API?
- ios - 如何预加载 SCNAudioSource 以防止第一次播放声音时出现延迟?
- angular - AngularFontAwesome 不会显示在通过管道注入 Html 的表格中
- javascript - Firebase 托管:如何生成可在所有页面上使用的全局“地图/数组”,而不是在每个页面加载时解析数据库
- ios - 用排序的图像填充表格
- firebase - 当我使用 Firebase CLI 将数据发送到 Arduino UNO 到 Cloud Firestore 数据库时,我收到 404 错误
- sql - 对数据库表名使用 CONCAT
- java - 在 Spring Boot 中排除 BootstrapConfiguration 类以进行测试
- docker - Windows Docker 映像、更改语言、区域设置、标准编码