Following are the points which seems to be vital in order to receive the token:
- Setting the correct content-type and Content-Length values.
- The request should be a HTTPS request.
- Method should be POST.
- I also installed and used Open SSL, just to avoid any issue caused due to non secure calls made by the server.
- Calls made using Requestify were failing each time, even when I set the identical header information mentioned in #1 above. As visible in the attached screenshot, it works fine with normal https request calls.
JSON response from subsequent queries was obtained from the following code:
var request = require("request");
var jobURL = 'https://api.elance.com/api2/jobs/my?access_token=' + _token;
request(jobURL, function (error, response, body) {
res.write(body);
res.end();
});