I am trying to post a task in asana with the following node/express function

exports.addTask = function(req, res) {
  var url ='/api/1.0/tasks?workspace=' + req.session.workspace_id
  var postBase = "app.asana.com";
  var options = {
    host: postBase,
    port: 443,
    path: url,
    method: 'POST',
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded',
      'Authorization': 'Bearer ' + JSON.parse(req.session.user).access_token,
    }
  };
  var req2 = https.request(options, function(res2) {
    res2.on('data', function(chunk) {
      console.log(chunk + "");
    });
    res2.on('error', function(e){
      console.log(e.message);
    });
  });

  req2.end();
}

I get the correct response back from asana which is:

{"data":{"id":8253508011735,"created_at":"2013-10-20T16:17:53.140Z","modified_at":"2013-10-20T16:17:53.140Z","name":"","notes":"","completed":false,"assignee_status":"upcoming","completed_at":null,"due_on":null,"workspace":{"id":1361701377437,"name":"getspur.com"},"assignee":null,"parent":null,"followers":[{"id":1050147548705,"name":"Gorkem Yurtseven"}],"projects":[],"tags":[]}}

but nothing seems to be added in my asana tasks..

ps. I am currently at the Facebook Hackathon in New York,so bring it on!

有帮助吗?

解决方案

It could be because the assignee is null, and it's not in any projects - that basically makes it impossible to find (except perhaps via Search?)

Without seeing the post body I'm not sure if that's intentional or just a formatting issue.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top