【问题标题】:'Full authentication is required to access this resource' Clockify API with Node JS'访问此资源需要完全身份验证' 使用 Node JS 的 Clockify API
【发布时间】:2021-11-21 13:57:28
【问题描述】:

我无法在 Node js 中使用 Clockify API 添加新客户端。以下 axios 发布请求返回错误消息:“访问此资源需要完全身份验证”。但是,我可以使用具有相同 API 密钥的 axios.get() 方法获取客户端列表,所以我不确定为什么发布请求说我没有经过身份验证。请让我知道我错过了什么

async function addNewClient(clientName) {
return response = await axios.post(`${url}/workspaces/${workspaceId}/clients`, {
    data: {
        'name': clientName
    },
    headers: {
        'X-Api-Key': CLOCKIFY_API_KEY,
        'Content-Type': 'application/json',
    },
   
}).catch(function (error) {
    console.log(error.response.data.message);
    return
});

}

【问题讨论】:

    标签: node.js https clockify


    【解决方案1】:

    我有同样的问题。重新生成API_KEY 解决了它。

    【讨论】:

      猜你喜欢
      • 2020-03-30
      • 2016-10-03
      • 2017-06-30
      • 2016-11-11
      • 2015-01-08
      • 2018-09-11
      • 2019-01-01
      • 2020-11-21
      • 2016-07-21
      相关资源
      最近更新 更多