【发布时间】:2017-11-09 11:06:40
【问题描述】:
我正在设置我的初始 js 文件,但是在构建时我收到一个错误,客户端现在需要我的客户端密码和客户端 ID。奇怪的是,当我第一次构建我的应用程序时,所有初始 API 请求都去了只需 api 密钥即可。我可以在 clarifai 预览 UI 上看到我上传的 + 培训图片,因此我知道它们已成功完成。从那时起,每个电话都失败了。由于文档只为我提供了一个 api 密钥,因此不确定我从哪里获得客户端密码和 ID。
// Require the client
const config = require('../config/config');
const Clarifai = require('../../node_modules/clarifai/src');
// initialize with your api key. This will also work in your browser via http://browserify.org/
const app = new Clarifai.App({
apiKey: config['CLARAFAI_API_KEY']
});
如网站所述...
After creating your API Key, you are ready to make API calls. If you are using a client, authentication will be handled for you. If you are using the REST API, you will need to add the Authorization header as described in the cURL example.
编辑 2017 年 7 月 27 日: Screenshot of error msg
【问题讨论】:
标签: javascript authentication clarifai