icodeforlove / node-cloudflare

Node.js CloudFlare V4 API wrapper
MIT License
30 stars 14 forks source link

Update user rule by API #9

Closed Thinkdiff closed 6 years ago

Thinkdiff commented 7 years ago

Hi I1m using Nodejs + Expressjs and "cloudflare4" npm package. I just have a problem in updating user rule by API. this is my code:

cloudFApi.userFirewallAccessRuleUpdate('45cb36dcd7f79a59cc8607383c5748c0',{mode:"challenge", configuration:{value:"44.44.44.45",target:"ip"} , notes: "mode chalenged by node app"} , true).then(function (result) { resp.send(result); }).catch(function(err){ resp.send(err); });

When I submitted this action, I`ll get nothing, no error, and no result. Other APIs action like adding CNAME are working correctly but updating user rule, response nothing!!! How can I fix it?

icodeforlove commented 7 years ago

Does the method ever complete? You can also try supplying a 3rd argument as true (raw). And it should give you the raw response directly from CF.

Thinkdiff commented 7 years ago

I set the raw to true and false but both of them are not work!!

This is my config:

var cloudFApi = new CloudFlareAPI({ /* all settings are default settings */ email: 'mail@email.com', key: 'key-11111111111111111111', itemsPerPage: 100, maxRetries: 5, raw: false , /* clacifying result */ autoPagination: false, autoPaginationConcurrency: 1 });

Thinkdiff commented 7 years ago

please help me

icodeforlove commented 6 years ago

Not enough information