我正在使用辛迪-api,从代码中订阅用户。我在使用javascript。我还跟踪了sendy-github。
我想在订阅之前检查用户的状态。如果用户已经取消订阅,我不想再次订阅。给出我试过的密码。
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)
有谁知道如何解决这个问题吗?我做错什么了吗?
发布于 2016-05-12 13:55:08
我忘记添加‘api’,所以我得到了错误,因为它是用github编写的。
现在代码如下所示,它正在工作:-
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.
});
https://stackoverflow.com/questions/37132066
复制相似问题