如何使用sendy检查用户(已订阅或未订阅)的状态
How to check status of the user (subscribed or not) using sendy
我使用sendyAPI,从代码中订阅用户。我正在使用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获取用户状态时出错{[Error:[404 Error]如果您在安装后看到此错误,请查看此常见问题解答以获得修复:https://sendy.co/troubleshooting#404-错误][message]:'[404 error]如果您在安装后看到此错误,请查看此常见问题解答以获得修复:https://sendy.co/troubleshooting#404-错误'}在[2016年5月10日星期二12:55:30 GMT+0530(IST)]jobScheduler:error:performJob失败{[error:[404 error]如果您在安装后看到此错误,请查看此常见问题解答以获得修复:https://sendy.co/troubleshooting#404-错误][message]:'[404 error]如果您在安装后看到此错误,请查看此常见问题解答以获得修复:https://sendy.co/troubleshooting#404-错误'}在〔2016年5月10日星期二12:55:30 GMT+0530(IST)〕
有人知道如何解决这个问题吗?我做错什么了?
我忘记添加"api key",所以我得到了错误,因为它是在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.
});
相关文章:
- 事件和状态
- 获取选择框的状态
- 相位器状态未捕获参考错误
- 如何更改reactjs中外部/独立组件的状态或属性
- 如何使用密码检测网络中的状态连接
- Ember.js-接口状态应该存储在哪里
- 混合 ui-sref 和 $state.go 在 Angular ui-router 中进行状态转换
- 在Angular 2中布线期间保持零部件处于活动状态
- 在mvc应用程序中,在回发时保留最初隐藏的文本框的隐藏或可见状态
- XMLHttpRequest未返回值-状态202
- 使用javascript反复检查用户在facebook上的登录状态
- 如何使bxslider仅在移动视图中处于活动状态
- 获取ASP.NET Ajax Timer状态
- React redux初始化功能,无论状态变化如何
- 无法在现有状态转换期间更新-未使用任何非法的setState()
- 悬停下拉菜单即使在鼠标移出后也保持活动状态
- 从组件状态的数组中删除元素
- iOS 中的按钮触摸状态
- 使用AngularJS中的UI路由器将状态重定向到默认子状态
- 如何使用sendy检查用户(已订阅或未订阅)的状态