简体   繁体   English

使用Zapier + Prosperworks获取API调用

[英]Fetch API call with Zapier + Prosperworks

I'm trying to call the Prosperworks API through Code by Zapier. 我正在尝试通过Zapier的代码调用Prosperworks API。 I can do this easy through curl, but for the life of me cannot get this POST call to work using fetch. 我可以通过curl轻松做到这一点,但是对我而言,我一生无法使用fetch使此POST调用起作用。 Below is what I've got...any help appreciated. 以下是我所得到的...任何帮助。 Thanks 谢谢

fetch('https://api.prosperworks.com/developer_api/v1/people/fetch_by_email', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'X-PW-AccessToken': 'API_TOKEN',
    'X-PW-Application': 'developer_api',
    'X-PW-UserEmail': 'EMAIL'
  },
  body: JSON.stringify({'email': input.email})
  }).then(function(res) {
     var people_id = res.id;
     return res.json();
  }).then(function(body) {
    callback(null, {id: 1234, rawHTML: body});
  }).catch(function(error) {
    callback("error");
  });

I'm the lead engineer on the ProsperWorks developer API. 我是ProsperWorks开发人员API的首席工程师。 sideshowbarker is correct; sideshowbarker是正确的; we do not accept cross-origin requests from Zapier. 我们不接受Zapier的跨域请求。 Given that we offer Zapier integration, though, perhaps we should. 鉴于我们提供了Zapier集成,也许我们应该这样做。 I'll bring it up with the dev team and see if we can get that onto an upcoming release :) 我将与开发团队联系,看看是否可以将其发布到即将发布的版本中:)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM