Update tasks

Update tasks

You may fully replace a container's tasks by omitting the index and providing a complete list of task IDs. Tasks that were previously in the container but are not included in the new list will be moved to the organization container. This replacement method is only supported on the worker container type.

curl -X PUT "https://onfleet.com/api/v2/containers/workers/2Fwp6wS5wLNjDn36r1LJPscA" \
     -u "<your_api_key>:" \
     -d '{"tasks":["b3F~z2sU7H*auNKkM6LoiXzP","1ry863mrjoQaqMNxnrD5YvxH","l33lg5WLrja3Tft*MO383Gub"]}'
onfleet.workers.setTasks(id="2Fwp6wS5wLNjDn36r1LJPscA", body={"tasks":["b3F~z2sU7H*auNKkM6LoiXzP","1ry863mrjoQaqMNxnrD5YvxH","l33lg5WLrja3Tft*MO383Gub"]})
onfleet.workers.setTasks("2Fwp6wS5wLNjDn36r1LJPscA", {"tasks":["b3F~z2sU7H*auNKkM6LoiXzP","1ry863mrjoQaqMNxnrD5YvxH","l33lg5WLrja3Tft*MO383Gub"]});
$onfleet->workers->setTasks("2Fwp6wS5wLNjDn36r1LJPscA", ["tasks" => ["b3F~z2sU7H*auNKkM6LoiXzP","1ry863mrjoQaqMNxnrD5YvxH","l33lg5WLrja3Tft*MO383Gub"]])
{
  "id": "NngUFbKT95Hly0PkFwPui*kg",
  "timeCreated": 1518563775000,
  "timeLastModified": 1518563775468,
  "organization": "yAM*fDkztrT3gUcz9mNDgNOL",
  "type": "WORKER",
  "activeTask": null,
  "tasks": [
    "b3F~z2sU7H*auNKkM6LoiXzP",
    "1ry863mrjoQaqMNxnrD5YvxH",
    "l33lg5WLrja3Tft*MO383Gub"
  ],
  "worker": "2Fwp6wS5wLNjDn36r1LJPscA"
}