gargic Posted June 19, 2015 Report Share Posted June 19, 2015 Hi, I was trying to link a zone with campaign through API. But I get an "Internal Server Error" each time. Below is my code snippet in node.js . var http = require("http"); var auth = "{removed}"; var hostname = "revive.example.com"; ///link zone campaign var postString = ""; var params = { hostname : hostname , path : "/www/api/rest_v1/rest.php?rest=/zon/197/cam/2112", method: "POST", headers: {"Content-type": "application/json","Content-Length": postString.length}, auth : auth } var req = http.request(params, function(res){ res.on('data', function (chunk) { console.log("inside data"); }); res.on('end', function() { console.log("inside end"); console.log(res.statusCode); ////500 console.log(res.statusMessage); /////Internal Server Error }); res.on('error', function(exception) { Console.log("error here in creating zone: "+exception); }); }); var e = req.write(postString); req.on('error', function(e) { console.log('problem with request post zone: ' + e.message); }); req.end(); *I have used other API calls like adding zones and campaigns successfully. Any help would be much appeciated. Thanks, gargic. Quote Link to comment Share on other sites More sharing options...
Revive Adserver Forum Posted June 19, 2015 Report Share Posted June 19, 2015 I removed your domain and login credentials from your post. That was not a very good idea. These credentials have been on the page for some time, for the world to see, so I suggest you change all your passwords IMMEDIATELY! Quote Link to comment Share on other sites More sharing options...
Revive Adserver Forum Posted June 19, 2015 Report Share Posted June 19, 2015 Also, it looks like you're using a third party product. This forum isn't suited for that, please ask your provider for support Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.