我在 Bigcommerce 中创建了一个新应用程序,然后从那里返回 hello world。 在登录后端并转到我的草稿应用程序时,我单击安装应用程序,它显示错误:
{"message":"Request returned error code: 400 and body: {\"error\":\"invalid_client\",\"error_description\":\"Unknown client ID {rbruk81rd5fq4dteoeahxl1yh7tm008}\"}"}
我关注了这个视频:https://www.youtube.com/watch?v=Do1vRfEdn70
所有步骤都很好,但最后显示错误。
运行时
npm run build
工作正常。
编辑: .env 文件
# Get the Client ID and Secret from the Developer Portal
# https://developer.bigcommerce.com/api-docs/apps/quick-start#register-a-draft-app
CLIENT_ID={rbruk81rd5fq4dteoeahxl1yh7tm008}
CLIENT_SECRET={8d450e3542018e9f11a30bfdc5c2d09eb6cf06587fc38ee47a184f24b580fb55}
# Test locally with ngrok
# https://developer.bigcommerce.com/api-docs/apps/guide/development#testing-locally-with-ngrok
AUTH_CALLBACK=https://c9e8-203-122-42-46.ngrok.io/api/auth
# Specify the type of database
DB_TYPE=MySQL
# If using mysql, enter your config here
MYSQL_HOST={localhost}
MYSQL_DATABASE={ecommerce}
MYSQL_USERNAME={root}
MYSQL_PASSWORD={hestabit}
可能有点晚了,但对于发现这有帮助的人来说: 你必须删除大括号。
例如:
CLIENT_ID= ifai84ainrb85h98g539g95