首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何使用sendy检查用户的状态(订阅与否)

如何使用sendy检查用户的状态(订阅与否)
EN

Stack Overflow用户
提问于 2016-05-10 07:36:31
回答 1查看 434关注 0票数 4

我正在使用辛迪-api,从代码中订阅用户。我在使用javascript。我还跟踪了sendy-github

我想在订阅之前检查用户的状态。如果用户已经取消订阅,我不想再次订阅。给出我试过的密码。

代码语言:javascript
复制
var Sendy = require('sendy-api'),
    sendy = new Sendy('http://your_sendy_installation'),
    
    sendyStatus = new Sendy('http://your_sendy_installation/api/subscribers/subscription-status.php'); //There is something wrong in this part I think

var eachUser = {em : 'abcd@xyz.com'};

 sendyStatus.status({email: eachUser.em, list_id: 'someListID'}, function(err, userInfo)                       
   {
      console.log(userInfo)
   });

得到的错误如下:

从sendy{ 错误:[404错误]如果安装后看到此错误,请检查此常见问题以获得修复:[https://sendy.co/troubleshooting#404-error]消息获得用户状态时出错如果安装后看到此错误,请检查此FAQ在Tue 2016 5月10日的修复程序:https://sendy.co/troubleshooting#404-error‘} 12:55:30 GMT+0530的作业计划程序: performJob失败{ 错误:[404错误]如果安装后看到此错误,请检查此常见问题以获得修复:[https://sendy.co/troubleshooting#404-error]消息:'404错误如果您在安装后看到此错误,请检查此FAQ是否修复:https://sendy.co/troubleshooting#404-error}2016年5月10日12:55:30 GMT+0530 (IST)

有谁知道如何解决这个问题吗?我做错什么了吗?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2016-05-12 13:55:08

我忘记添加‘api’,所以我得到了错误,因为它是用github编写的。

现在代码如下所示,它正在工作:-

代码语言:javascript
复制
var Sendy = require('sendy-api'),
    sendy = new Sendy('http://your_sendy_installation', 'api-key'); // Without api key it won't work.
   

var eachUser = {em : 'abcd@xyz.com'};

 sendy.status({email: eachUser.em, list_id: 'someListID'}, function(err, userInfo)                       
   {
      console.log(userInfo) // will give status of the user.
   });

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/37132066

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档