【问题标题】:zendesk authentication in zapier codezapier 代码中的 zendesk 身份验证
【发布时间】:2016-12-27 18:53:18
【问题描述】:

我正在 zapier 中构建一个 zap,我需要在代码中手动验证 zendesk。那里只支持 vanilla nodejs 代码和 fetch 方法。我在这里关注 zendesk 文档https://developer.zendesk.com/rest_api/docs/core/introduction#security-and-authentication 及其 curl 命令

curl -u jdoe@example.com/token:6wiIBWbGkBMo1mRDMuVwkw1EPsNkeUj95PIz2akv https://obscura.zendesk.com/api/v2/users.json

那么我怎样才能用 zapier 代码写这个呢?

【问题讨论】:

    标签: node.js zapier zendesk-api


    【解决方案1】:

    在您的 pre proll 或 pre write 函数中,您应该在标题中编码您的身份验证。

    在 base64 中转换您的用户/密码: https://zapier.com/developer/documentation/v2/built-functions-tools/#base-64-encoding

    var token = btoa(jdoe@example.com/token:6wiIBWbGkBMo1mRDMuVwkw1EPsNkeUj95PIz2akv);
    
    bundle.request.headers.Authorization = 'Basic ' + token ;
    

    【讨论】:

      猜你喜欢
      • 2022-07-28
      • 2018-02-06
      • 2018-09-06
      • 1970-01-01
      • 2022-01-23
      • 2020-12-03
      • 2021-11-19
      • 1970-01-01
      • 2018-03-13
      相关资源
      最近更新 更多