Update task

Update task

Note that, for active tasks, only notes and metadata can be updated. Only metadata can be updated for completed tasks. Embedded updates are not currently supported. To update the embedded entity requires update to the appropriate objects first, then provided the entity’s ID for updates in the Update Task endpoint. For example, once you have updated the destination object, you can simply supply the ID within the Update Task payload as below:

{
  "destination":  "zrVXZi5aDzOZlAghZaLfGAfA"
}

Regular requests:

curl -X PUT "https://onfleet.com/api/v2/tasks/kc8SS1tzuZ~jqjlebKGrUmpe" \
       -u "cd3b3de84cc1ee040bf06512d233719c:" \
       -d '{"notes":"Patxi\'s deep dish meat lover special, 2 bottles of Basque cider","container":{"type":"TEAM","team":"fwflFNVvrK~4t0m5hKFIxBUl"}}'
onfleet.tasks.update(id="kc8SS1tzuZ~jqjlebKGrUmpe",
                     body={
                       "notes":"Patxi\'s deep dish meat lover special, 2 bottles of Basque cider",
                       "container":{
                         "type":"TEAM",
                         "team":"fwflFNVvrK~4t0m5hKFIxBUl"
                       }
                     })
onfleet.tasks.update("kc8SS1tzuZ~jqjlebKGrUmpe", 
                     {"notes":"Patxi\'s deep dish meat lover special, 2 bottles of Basque cider",
                      "container":{
                        "type":"TEAM",
                        "team":"fwflFNVvrK~4t0m5hKFIxBUl"
                      }
                     });
$onfleet->tasks->update("kc8SS1tzuZ~jqjlebKGrUmpe", 
                        ["notes" => "Patxi\'s deep dish meat lover special, 2 bottles of Basque cider",
                         "container" => ["type" => "TEAM",
                                         "team" => "fwflFNVvrK~4t0m5hKFIxBUl"]
                        ])
{
  "id": "kc8SS1tzuZ~jqjlebKGrUmpe",
  "timeCreated": 1455156667000,
  "timeLastModified": 1455156668922,
  "organization": "yAM*fDkztrT3gUcz9mNDgNOL",
  "shortId": "8f983639",
  "trackingURL": "https://onf.lt/8f98363993",
  "worker": null,
  "merchant": "yAM*fDkztrT3gUcz9mNDgNOL",
  "executor": "yAM*fDkztrT3gUcz9mNDgNOL",
  "creator": "EJmsbJgHiRLPjNVE7GEIPs7*",
  "dependencies": [],
  "state": 0,
  "completeAfter": 1455151071727,
  "completeBefore": null,
  "pickupTask": false,
  "notes": "Patxi's deep dish meat lover special, 2 bottles of Basque cider",
  "completionDetails": {
    "events": [],
    "time": null
  },
  "feedback": [],
  "metadata": [],
  "overrides": {
    "recipientSkipSMSNotifications": null,
    "recipientNotes": null,
    "recipientName": null
  },
  "container": {
    "type": "TEAM",
    "team": "fwflFNVvrK~4t0m5hKFIxBUl"
  },
  "recipients": [
    {
      "id": "G7rcM2nqblmh8vj2do1FpaOQ",
      "organization": "yAM*fDkztrT3gUcz9mNDgNOL",
      "timeCreated": 1455156667000,
      "timeLastModified": 1455156667229,
      "name": "Blas Silkovich",
      "phone": "+16505554481",
      "notes": "Knows Neiman, VIP status.",
      "skipSMSNotifications": false,
      "metadata": []
    }
  ],
  "destination": {
    "id": "zrVXZi5aDzOZlAghZaLfGAfA",
    "timeCreated": 1455156667000,
    "timeLastModified": 1455156667220,
    "location": [
      -122.4438337,
      37.7940329
    ],
    "address": {
      "apartment": "",
      "state": "California",
      "postalCode": "94123",
      "country": "United States",
      "city": "San Francisco",
      "street": "Vallejo Street",
      "number": "2829"
    },
    "notes": "Small green door by garage door has pin pad, enter *4821*",
    "metadata": []
  }
}

📘

Updating metadata

While metadata can be updated during any state of a Task, we strongly recommend keeping a record of the response when executing that API request.

📘

Update fields

It is not required to include all fields in the task for an update to take effect; only include field(s) you would like to update.