How can I directly mark complete / incomplete from PHP Api integration of Asana on my website

completetasks

#1

How can I directly mark complete / incomplete from PHP Api integration of Asana on my website.


#2

Did you try to use the completed field?


#3

Hi Bastien,
I have followed the guide but bumped into error, I am using “Google Apps Script - Javascript”

function asana_update() {
  var updt    = '{"data": { "completed": true} }';
  var options = {
    "method"     : "PUT",
    "headers"    : {"Authorization": bearerToken},
    "contentType": 'application/json',
    "payload"    : updt
//    "payload"    : JSON.stringify(updt)
  };
  try {
    var url      = "https://app.asana.com/api/1.0/tasks/";
    var request  = UrlFetchApp.fetch(url+"828446317663433", options);
    var response = request.getContentText();
    return done;
  } 
  catch (e) {
    Logger.log(e);
  }
}

image

What did I do wrong?


#4

And you are sure the id is the one of a task?


#5

Hi Bastien, thanks for replying!

Yes I think so. Actually the whole thing under this particular workspace is either identifed as “Unknown Object” or “I dont have access” even though I created the workspace. I tried to update other task in different workspace, it works!


#6

@johnnygoodnow any idea?