Get single task by shortId

Get single task by shortId

Retrieve a task's details by its shortId.

A Task will return a routePlan field if it is a part of a Route Plan. The field will be absent if the task is not in a Route Plan.

curl -X GET "https://onfleet.com/api/v2/tasks/shortId/e5f0cc28" \
       -u "cd3b3de84cc1ee040bf06512d233719c:"
onfleet.tasks.get(shortId="e5f0cc28")
onfleet.tasks.get("e5f0cc28", "shortId");
$onfleet->tasks->get("e5f0cc28", "shortId");
{
  "id": "Eyi36gfoJMdAMyK3QiC3iFLq",
  "timeCreated": 1455152029000,
  "timeLastModified": 1455153428203,
  "organization": "yAM*fDkztrT3gUcz9mNDgNOL",
  "shortId": "e5f0cc28",
  "trackingURL": "https://onf.lt/e5f0cc28",
  "worker": null,
  "merchant": "yAM*fDkztrT3gUcz9mNDgNOL",
  "executor": "cBrUjKvQQgdRp~s1qvQNLpK*",
  "creator": "EJmsbJgHiRLPjNVE7GEIPs7*",
  "dependencies": [],
  "state": 0,
  "completeAfter": 1455151071727,
  "completeBefore": null,
  "pickupTask": true,
  "notes": "Order 332: 24oz Stumptown Finca El Puente, 10 x Aji de Gallina Empanadas, 13-inch Lelenitas Tres Leches",
  "completionDetails": {
    "events": [],
    "time": null
  },
  "feedback": [],
  "metadata": [],
  "overrides": {
    "recipientSkipSMSNotifications": null,
    "recipientNotes": null,
    "recipientName": null
  },
  "container": {
    "type": "ORGANIZATION",
    "organization": "cBrUjKvQQgdRp~s1qvQNLpK*"
  },
  "recipients": [],
  "destination": {
    "id": "d~jvinosyxbjVo5yt3wY8lJl",
    "timeCreated": 1455152029000,
    "timeLastModified": 1455153428197,
    "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": []
  }
}
{
  "code": "InvalidCredentials",
  "message": {
    "error": 1103,
    "message": "The resource requested is outside of the authenticated user's permissions scope.",
    "request": "d823bad3-2296-4d8f-91f4-518b96f54139"
  }
}
{
    "id": "M~NgEWdvKl4naQcNz29zDN8v",
    "timeCreated": 1721148688000,
    "timeLastModified": 1721148691872,
    "organization": "IkslFemIdKalRKmVYY3pWCW~",
    "shortId": "02cf3365",
    "orderShortId": null,
    "trackingURL": "https://onf.lt/02cf3365",
    "worker": null,
    "merchant": "IkslFemIdKalRKmVYY3pWCW~",
    "executor": "IkslFemIdKalRKmVYY3pWCW~",
    "creator": "lyEgBv9h12D6KjO~Wd~3K~qp",
    "dependencies": [],
    "state": 0,
    "completeAfter": null,
    "completeBefore": null,
    "pickupTask": false,
    "notes": "",
    "completionDetails": {
        "failureNotes": "",
        "successNotes": "",
        "failureReason": "NONE",
        "events": [],
        "actions": [],
        "time": null,
        "signatureUploadId": null,
        "photoUploadId": null,
        "photoUploadIds": null,
        "firstLocation": [],
        "lastLocation": [],
        "unavailableAttachments": []
    },
    "feedback": [],
    "metadata": [],
    "overrides": {},
    "quantity": 0,
    "additionalQuantities": {
        "quantityA": 0,
        "quantityB": 0,
        "quantityC": 0
    },
    "serviceTime": 0,
    "identity": {
        "failedScanCount": 0,
        "checksum": null
    },
    "appearance": {
        "triangleColor": null
    },
    "scanOnlyRequiredBarcodes": false,
    "customFields": [
        {
            "description": "",
            "asArray": false,
            "visibility": [
                "admin",
                "api",
                "worker"
            ],
            "editability": [
                "admin",
                "api"
            ],
            "key": "boolTest2",
            "name": "deleted no req bool test",
            "type": "boolean",
            "contexts": [
                {
                    "isRequired": false,
                    "conditions": [],
                    "name": "save"
                }
            ],
            "value": false
        },
        {
            "description": "",
            "asArray": false,
            "visibility": [
                "admin",
                "api",
                "worker"
            ],
            "editability": [
                "admin",
                "api"
            ],
            "key": "boolTest2",
            "name": "no req bool test",
            "type": "boolean",
            "contexts": [
                {
                    "isRequired": false,
                    "conditions": [],
                    "name": "save"
                }
            ],
            "value": false
        },
        {
            "description": "testing field order",
            "asArray": false,
            "visibility": [
                "admin",
                "api",
                "worker"
            ],
            "editability": [
                "admin",
                "api"
            ],
            "key": "newfield",
            "name": "new field!",
            "type": "boolean",
            "contexts": [
                {
                    "isRequired": false,
                    "conditions": [],
                    "name": "save"
                }
            ],
            "value": false
        }
    ],
    "routePlan": "d4q6sSH1WBbZsP0z4tsAh9Ir",
    "container": {
        "type": "ORGANIZATION",
        "organization": "IkslFemIdKalRKmVYY3pWCW~"
    },
    "trackingViewed": false,
    "recipients": [],
    "estimatedCompletionTime": null,
    "estimatedArrivalTime": null,
    "delayTime": null,
    "eta": null,
    "destination": {
        "id": "2jHSBD7~SktinmoEdS2FqwZK",
        "timeCreated": 1721148688000,
        "timeLastModified": 1721148688629,
        "location": [
            -117.8862833,
            33.9156138
        ],
        "address": {
            "apartment": "",
            "state": "California",
            "postalCode": "92821",
            "number": "1065",
            "street": "Brea Mall",
            "city": "Brea",
            "country": "United States",
            "name": "Brea Mall"
        },
        "notes": "",
        "metadata": [],
        "googlePlaceId": "ChIJwS0hgwbV3IARL4oucH0V6P8",
        "warnings": [],
        "useGPS": false
    }
}

When attempting to access a task shortId endpoint that does not belong to your organization, an error message will be thrown stating that the request is outside of your permission scope.

📘

Data Types and Response Formats

For more information on datatype and formats, please see Data Types and Response Formats or free conversion tool online here.