Tasks

Introduction

The Task API enables external systems to create a task against an existing form. This functionality will allow all current options available to Tasks to be leveraged by external systems. The Task API will receive the required data to create a task against a form and the data fields of the requested form.

Task API Setup Information

Getting Started

All API requests require an authorization token – reference our Authentication page for more information

API Structure

POST api/integration/CreateTask

Required Request Parameters

NameLocationDescription
Authorization tokenHeaderSee Login Authentication page documentation
TaskNameBodyTask name of the task
FormIDBodyFormID or FormRef (FormName either one is mandatory, Form ID to take precedence in case both are provided
FormRefBodyFormID or FormRef (FormName either one is mandatory, Form ID to take precedence in case both are provided
LocationIDBodyLocationID or LocationName Either one is mandatory – Location ID to take precedence in case both are provided
LocationNameBodyLocationID or LocationName Either one is mandatory – Location ID to take precedence in case both are provided
WorkgroupNameBodyWorkgroup assigned to the task
FormDetailsBodyEmpty string can be used ":[]" if no values are predefined for the task

Optional Request Parameters

NameLocationDescription
ResourceNameBody
DueByBodyIn case due by date provided then use Tenant time zone. Field must be set to a valid date, format MM-DD-YYYY
IANATimezoneBodyIf NOT included the time zone defaults to the tenant default time zone. Accepted time zone values are referenced below.
TaskExpirationBodyIf provided the task expiration date will be calculated based on the past due date and the task expiration settings (ExpirationIntervalValue and ExpirationIntervalType).

Example:
"DueBy": {
 "DueByDate": "08/20/2021 16:40",
 "IANATimezone": "US/Central"
},
"TaskExpiration": {
 "ExpirationIntervalValue": "2",
 "ExpirationIntervalType": "Day"
}

In this case, TaskExpirationDate will be, "08/22/2021 16:40"

Valid ExpirationIntervalType are:
Never, Day, Week, Month, Year
NoteBody

Request JSON

{
  "Data": {
    "TaskSummaryDetail": [
      {
        "TaskName": "TaskName",
        "FormRef": {
          "Id": null,
          "Name": "OEE - Batch Initialization"
        },
        "Resource": {
          "Id": null,
          "Name": "Garden Salad"
        },
        "Location": {
          "Id": null,
          "Name": "USA - Salinas"
        },
        "Workgroup": {
          "Id": null,
          "Name": "OEE"
        },
        "DueBy": {
          "DueByDate": "02/22/2020 10:40",
          "IANATimezone": "US/Central"
        },
        "Note": "Add Note",
        "TaskData": {
          "FormDetails": [
            {
              "ShortName": "BatchID",
              "Value": "BPCharred02222020"
            }
          ]
        }
      }
    ]
  },
  "Operation": "Insert",
  "Status": true,
  "Errors": null,
  "RefreshToken": false,
  "PartialSuccess": false
}

Request JSON Multiple Example

{
    "Data": {
        "TaskSummaryDetail": [
            {
                "TaskName": "TaskName_POTask100",
                "FormRef": {
                    "Id": null,
                    "Name": "Receiving Inspection Form"
                },
                "Resource": {
                    "Id": null,
                    "Name": "FT12345"
                },
                "Location": {
                    "Id": null,
                    "Name": "New York, NY"
                },
                "Workgroup": {
                    "Id": null,
                    "Name": "Food Safety"
                },
                "DueBy": {
                    "DueByDate": "03/15/2020 08:00",
                    "IANATimezone": "US/Eastern"
                },
                "Note": "Add Note",
                "TaskData": {
                    "FormDetails": [
                        {
                            "ShortName": "INT_PO Number",
                            "Value": "123456Test100"
                        },
                        {
                            "ShortName": "INT_Vendor Name",
                            "Value": "Best Produce"
                        },
                        {
                            "ShortName": "INT_Lot Number",
                            "Value": "9999872"
                        },
                        {
                            "ShortName": "INT_Country of Origin",
                            "Value": "Mexico"
                        },
                        {
                            "ShortName": "INT_USDA Inspection?",
                            "Value": "Yes"
                        },
                        {
                            "ShortName": "INT_Receiving Quantity",
                            "Value": "100"
                        }
                    ]
                }
            },
            {
                "TaskName": "TaskName_POTask101",
                "FormRef": {
                    "Id": null,
                    "Name": "Receiving Inspection Form"
                },
                "Resource": {
                    "Id": null,
                    "Name": "FT12345"
                },
                "Location": {
                    "Id": null,
                    "Name": "New York, NY"
                },
                "Workgroup": {
                    "Id": null,
                    "Name": "Food Safety"
                },
                "DueBy": {
                    "DueByDate": "03/16/2020 08:00",
                    "IANATimezone": "US/Eastern"
                },
                "Note": "Add Note",
                "TaskData": {
                    "FormDetails": [
                        {
                            "ShortName": "INT_PO Number",
                            "Value": "123456Test101"
                        },
                        {
                            "ShortName": "INT_Vendor Name",
                            "Value": "Best Produce"
                        },
                        {
                            "ShortName": "INT_Lot Number",
                            "Value": "9999872"
                        },
                        {
                            "ShortName": "INT_Country of Origin",
                            "Value": "Mexico"
                        },
                        {
                            "ShortName": "INT_USDA Inspection?",
                            "Value": "Yes"
                        },
                        {
                            "ShortName": "INT_Receiving Quantity",
                            "Value": "100"
                        }
                    ]
                }
            }
        ]
    },
    "Operation": "Insert",
    "Status": true,
    "Errors": null,
    "RefreshToken": false,
    "PartialSuccess": false
}

Request JSON with Expiration Date

{
  "Data": {
    "TaskSummaryDetail": [
      {
        "TaskName": "Task123456-03102021",
        "FormRef": {
          "Id": "",
          "Name": "Receiving Form"
        },
        "Resource": {
          "Id": "",
          "Name": "Garden Salad"
        },
        "Location": {
          "Id": "",
          "Name": "New York, NY"
        },
        "Workgroup": {
          "Id": "",
          "Name": "Category Manager"
        },
        "DueBy": {
          "DueByDate": "04/20/2021 16:40",
          "IANATimezone": "US/Central"
        },
        "Note": "Add note",
        "TaskData": {
          "FormDetails": []
        },
        "TaskExpiration": {
          "ExpirationIntervalValue": "2",
          "ExpirationIntervalType": "Week"
        }
      }
    ]
  },
  "Operation": "Insert",
  "Status": true,
  "Errors": null,
  "RefreshToken": false,
  "PartialSuccess": false
}

Response Parameters

NameDescription
RequestIDUse this GUID within our GetBatchStatus API to request updates on when the request will be processed outside of the UI. See Request Status API documentation for more information on GetBatchStatus.
RequestStatusIf no syntax errors are present the default response is Pending until the request can be processed.
RequestErrorError object providing information if an error occurs
StatusIndicating the success of the API request
ErrorsReturns null if no errors are encountered
RefreshTokenReturns false

Response JSON

{
  "RequestId": "5b0d5b9e-dcff-4a18-b90d-dedf44dc6231",
  "RequestStatus": "Pending",
  "RequestError": null,
  "DetailedError": null,
  "Status": true,
  "Errors": null,
  "RefreshToken": false
}

Task Scheduler and Task Inbox

Tasks are visible in the Task tab or in the Task Scheduler Inbox, tasks create with the CreateTask API are not visible on the task scheduler.

Tasks Screen

Task Scheduler Inbox