Table of contents
Schedules
Download API definition:
This API is a Technical Preview and is available for testing purposes only. Do not use in production.
POST https://dev-api.bentley.com/schedules/{scheduleId}/task-query-filters

Creates a Task Query Filter for a Schedule.

Task Query Filter

Task Query Filters allows to define rules on how to filter tasks. They can then be used to filter tasks on the client side. These filters can be shared with others.

Task Query Filter Operations

Based on the property type it can have different types of operations to perform when filtering data.

  • Number or DateTime:
    • Equals
    • NotEquals
    • More
    • Less
    • MoreOrEqual
    • LessOrEqual
  • Enum or Boolean:
    • Equals
    • NotEquals
  • Text:
    • Equals
    • NotEquals
    • Contains
    • StartsWith
    • EndsWith
    • NotContains
    • NotStartsWith
    • NotEndsWith
    • ContainsCaseInsensitive
    • StartsWithCaseInsensitive
    • EndsWithCaseInsensitive
    • EqualsCaseInsensitive
    • NotEqualsCaseInsensitive
    • NotContainsCaseInsensitive
    • NotStartsWithCaseInsensitive
    • NotEndsWithCaseInsensitive

V10 Endpoint

This endpoint is only supported by v10 schedules. The schedule type can be identified by querying the /schedules/{scheduleId} endpoint.

Authentication

Requires Authorization header with valid Bearer token for scope itwin-platform.

For more documentation on authorization and how to get access token visit OAUTH2 Authorization page.

Rate limits

All iTwin Platform API operations have a rate limit. For more documentation on that visit Rate limits and quotas page.

Request parameters

Name
Required?
Description
scheduleId
Yes

The unique identifier of the Schedule.

Request headers

Name
Required?
Description
Authorization
Yes

OAuth access token with itwin-platform scope

Accept
Yes

Setting to application/vnd.bentley.itwin-platform.v1+json is recommended.

Request body

Task Query Filter Create Request

Name
Type
Required?
Description
id
String
No

The unique identifier of the Task Query Filter.

isShared
Boolean
No

Is this Task Query Filter shared.

name
String
No

The name of the Task Query Filter.

taskActualDuration
No

Task Actual Duration filter field.

taskActualPhysicalQuantity
No

Task Actual Physical Quantity filter field.

taskConstraintEarlyDate
No

Task Constraint Early Date filter field.

taskConstraintLateDate
No

Task Constraint Late Date filter field.

taskConstraintType
No

Task Constraint Type filter field.

taskDurationType
No

Task Duration filter field.

taskEstimatedRate
No

Task Estimated Rate filter field.

taskExpectedFinish
No

Task Expected Finish filter field.

taskIsWbs
No

Task Is WBS filter field.

taskName
No

Task Name filter field.

taskPercentComplete
No

Task Percent Complete filter field.

taskPhysicalQuantityUnit
No

Task Physical Quantity Unit filter field.

taskPlannedDuration
No

Task Planned Duration filter field.

taskPlannedPhysicalQuantity
No

Task Planned Physical Quantity filter field.

taskProgressType
No

Task Progress Type filter field.

taskRemainingDuration
No

Task Remaining Duration filter field.

taskRemainingPhysicalQuantity
No

Task Remaining Physical Quantity filter field.

taskStatus
No

Task Status filter field.

taskType
No

Task Type filter field.

taskUrl
No

Task URL filter field.

taskUserDefinedId
No

Task User Defined ID filter field.

version
Int32
No

The version of the Task Query Filter.

Example

json
{
    "id": "bfe4d22d-027c-45d4-b3cc-50ecfa4b1bd7",
    "isShared": true,
    "name": "Nearly completed work",
    "taskName": {
        "operation": "EndsWith",
        "values": [
            "TaskSuffix"
        ]
    },
    "taskPercentComplete": {
        "operation": "MoreOrEqual",
        "values": [
            90
        ]
    },
    "taskType": {
        "operation": "Equals",
        "values": [
            "Work"
        ]
    },
    "version": 1
}

Response 201 Created

Created

json
{
    "taskQueryFilter": {
        "createdBy": "ca76991e-3b1a-4c9a-9b90-e4fcf7beec52",
        "deleted": false,
        "id": "bfe4d22d-027c-45d4-b3cc-50ecfa4b1bd7",
        "isShared": true,
        "name": "Nearly completed work",
        "taskActualDuration": null,
        "taskActualPhysicalQuantity": null,
        "taskConstraintEarlyDate": null,
        "taskConstraintLateDate": null,
        "taskConstraintType": null,
        "taskDurationType": null,
        "taskEstimatedRate": null,
        "taskExpectedFinish": null,
        "taskIsWbs": null,
        "taskName": null,
        "taskPercentComplete": {
            "operation": "MoreOrEqual",
            "values": [
                90
            ]
        },
        "taskPhysicalQuantityUnit": null,
        "taskPlannedDuration": null,
        "taskPlannedPhysicalQuantity": null,
        "taskRemainingPhysicalQuantity": null,
        "taskStatus": null,
        "taskType": {
            "operation": "Equals",
            "values": [
                "Work"
            ]
        },
        "taskUrl": null,
        "taskUserDefinedId": null,
        "version": 1
    }
}

Response headers

Name
Description
Location

A header that identifies the location of a specific resource. For more information see the official documentation.

Response 400 Bad Request

The 400 (Bad Request) status code indicates that the request cannot be processed by the server due to a client error (e.g. malformed request syntax)

json
{
    "error": {
        "code": "InvalidSchedulesRequest",
        "details": [{
                "code": "MissingRequiredProperty",
                "message": "A required property is missing or empty.",
                "target": "name"
            },
            {
                "code": "MissingRequiredProperty",
                "message": "A required property is missing or empty.",
                "target": "version"
            },
            {
                "code": "InvalidProperty",
                "message": "The 'values' property must not contain more than 200 items.",
                "target": "taskPercentComplete.values"
            },
            {
                "code": "InvalidProperty",
                "message": "The 'values' property must not be empty.",
                "target": "taskName.values"
            }
        ],
        "message": "The request contains invalid properties."
    }
}

Response 401 Unauthorized

This response indicates that request lacks valid authentication credentials. Access token might not been provided, issued by the wrong issuer, does not have required scopes or request headers were malformed.

json
{
    "error": {
        "code": "HeaderNotFound",
        "message": "Header Authorization was not found in the request. Access denied."
    }
}

Response 404 Not Found

This response indicates that the provided Schedule is not available.

json
{
    "error": {
        "code": "ScheduleNotFound",
        "message": "Requested Schedule is not available.",
        "target": "scheduleId"
    }
}

Response 409 Conflict

Indicates that the entity being created conflicts with an existing one.

json
{
    "error": {
        "code": "TaskQueryFilterExists",
        "message": "Task Query Filter with provided Id already exists."
    }
}

Response 429 Too many requests

This response indicates that the client sent more requests than allowed by this API for the current tier of the client.

json
{
    "error": {
        "code": "RateLimitExceeded",
        "message": "The client sent more requests than allowed by this API for the current tier of the client."
    }
}

Response headers

Name
Description
retry-after

Number of seconds to wait until client is allowed to make more requests.

Boolean Filter Field

Representation of a filter field for boolean values.

Name
Type
Description
operation

Value matching operation for filtering.

values
Boolean[]

Boolean values to filter by.

Date Time Filter Field

Representation of a filter field for datetime values.

Name
Type
Description
operation

Value matching operation for filtering.

values
String[]

Date Time values to filter by.

Double Filter Field

Representation of a filter field for double numeric values.

Name
Type
Description
operation

Value matching operation for filtering.

values
Number[]

Double numeric values to filter by.

Filter Enum Operation

Defines the type of enum matching operation for filtering. The match succeeds if a value matches any of the provided filter values.

Name
Type
Description
Equals
String
NotEquals
String

Filter Number Operation

Defines the type of number matching operation for filtering. The match succeeds if a value matches any of the provided filter values. Note that only the Equals operation makes sense if providing multiple filter values.

Name
Type
Description
Equals
String
NotEquals
String
More
String
Less
String
MoreOrEqual
String
LessOrEqual
String

Filter Text Operation

Defines the type of text matching operation for filtering. The match succeeds if a value matches any of the provided filter values.

Name
Type
Description
Equals
String
NotEquals
String
Contains
String
StartsWith
String
EndsWith
String
NotContains
String
NotStartsWith
String
NotEndsWith
String
ContainsCaseInsensitive
String
StartsWithCaseInsensitive
String
EndsWithCaseInsensitive
String
EqualsCaseInsensitive
String
NotEqualsCaseInsensitive
String
NotContainsCaseInsensitive
String
NotStartsWithCaseInsensitive
String
NotEndsWithCaseInsensitive
String

Int32 Filter Field

Representation of a filter field for int32 numeric values.

Name
Type
Description
operation

Value matching operation for filtering.

values
Integer[]

Int32 numeric values to filter by.

Resource Unit Type

The possible unit types for resources.

Name
Type
Description
CubicFeet
String
CubicMeter
String
Liter
String
Millimeter
String
Meter
String
Feet
String
Each
String
Pair
String
Dozen
String
Gross
String
SqFoot
String
SqYard
String
SqMeter
String
Pound
String
Gram
String
Kilo
String
Bag
String
Box
String
Bucket
String
Bundle
String
Card
String
Carton
String
Coil
String
Pack
String
Pegs
String
Length
String
Outer
String
Pallet
String
Roll
String
Sachet
String
Set
String
Sheet
String
Ton
String
Person
String
Item
String
CubicYard
String
MetricTon
String
Hour
String
LinearMeter
String
Unknown
String

Resource Unit Type Filter Field

Representation of a filter field for Resource Unit Type enum values.

Name
Type
Description
operation

Value matching operation for filtering.

values

Resource Unit Type enum values to filter by.

String Filter Field

Representation of a filter field for string values.

Name
Type
Description
operation

Value matching operation for filtering.

values
String[]

String values to filter by.

Task Constraint Type

Task Constraints determine the rules under which a Task can be started and rescheduled. See the Task Constraint Types section for details.

Name
Type
Description
NoConstraint
String
CannotReschedule
String
StartAsap
String
StartAlap
String
StartOn
String
StartAfter
String
StartBefore
String
StartBetween
String
FinishOn
String
FinishAfter
String
FinishBefore
String
FinishBetween
String
MandatoryStart
String
MandatoryFinish
String
WorkBetween
String
WorkOut
String
Unknown
String

Task Constraint Type Filter Field

Representation of a filter field for Task Constraint Type enum values.

Name
Type
Description
operation

Value matching operation for filtering.

values

Task Constraint Type enum values to filter by.

Task Duration Type

The Task duration type value specifies way that Task Duration is determined. See the Task Duration Types section for details.

Name
Type
Description
Fixed
String
PhysicalQuantityDependent
String
ResourceUnitsDependent
String
Unknown
String

Task Duration Type Filter Field

Representation of a filter field for Task Duration Type enum values.

Name
Type
Description
operation

Value matching operation for filtering.

values

Task Duration Type enum values to filter by.

Task Progress Type

The Task progress type value specifies way that Task Progress is determined. See the Task Progress Types section for details.

Name
Type
Description
Automatic
String
Manual
String
Duration
String
Physical
String
Unit
String
Unknown
String

Task Progress Type Filter Field

Representation of a filter field for Task Progress Type enum values.

Name
Type
Description
operation

Value matching operation for filtering.

values

Task Progress Type enum values to filter by.

Task Query Filter

Representation of a filtered task query. The returned tasks will match all applied filters.

Name
Type
Description
createdBy
String

The unique identifier of who created this Task Query Filter.

deleted
Boolean

Is this Task Query Filter deleted.

id
String

The unique identifier of the Task Query Filter.

isShared
Boolean

Is this Task Query Filter shared.

name
String, null

The name of the Task Query Filter.

taskActualDuration

Task Actual Duration filter field.

taskActualPhysicalQuantity

Task Actual Physical Quantity filter field.

taskConstraintEarlyDate

Task Constraint Early Date filter field.

taskConstraintLateDate

Task Constraint Late Date filter field.

taskConstraintType

Task Constraint Type filter field.

taskDurationType

Task Duration filter field.

taskEstimatedRate

Task Estimated Rate filter field.

taskExpectedFinish

Task Expected Finish filter field.

taskIsWbs

Task Is WBS filter field.

taskName

Task Name filter field.

taskPercentComplete

Task Percent Complete filter field.

taskPhysicalQuantityUnit

Task Physical Quantity Unit filter field.

taskPlannedDuration

Task Planned Duration filter field.

taskPlannedPhysicalQuantity

Task Planned Physical Quantity filter field.

taskProgressType

Task Progress Type filter field.

taskRemainingDuration

Task Remaining Duration filter field.

taskRemainingPhysicalQuantity

Task Remaining Physical Quantity filter field.

taskStatus

Task Status filter field.

taskType

Task Type filter field.

taskUrl

Task URL filter field.

taskUserDefinedId

Task User Defined ID filter field.

version
Int32

The version of the Task Query Filter.

Task Query Filter Create Request

Properties of the Task Query Filter to be created.

Name
Type
Description
id
String

The unique identifier of the Task Query Filter.

isShared
Boolean

Is this Task Query Filter shared.

name
String

The name of the Task Query Filter.

taskActualDuration

Task Actual Duration filter field.

taskActualPhysicalQuantity

Task Actual Physical Quantity filter field.

taskConstraintEarlyDate

Task Constraint Early Date filter field.

taskConstraintLateDate

Task Constraint Late Date filter field.

taskConstraintType

Task Constraint Type filter field.

taskDurationType

Task Duration filter field.

taskEstimatedRate

Task Estimated Rate filter field.

taskExpectedFinish

Task Expected Finish filter field.

taskIsWbs

Task Is WBS filter field.

taskName

Task Name filter field.

taskPercentComplete

Task Percent Complete filter field.

taskPhysicalQuantityUnit

Task Physical Quantity Unit filter field.

taskPlannedDuration

Task Planned Duration filter field.

taskPlannedPhysicalQuantity

Task Planned Physical Quantity filter field.

taskProgressType

Task Progress Type filter field.

taskRemainingDuration

Task Remaining Duration filter field.

taskRemainingPhysicalQuantity

Task Remaining Physical Quantity filter field.

taskStatus

Task Status filter field.

taskType

Task Type filter field.

taskUrl

Task URL filter field.

taskUserDefinedId

Task User Defined ID filter field.

version
Int32

The version of the Task Query Filter.

Task Query Filter Response

Container for Task Query Filter object.

Name
Type
Description
taskQueryFilter

Task Query Filter properties.

Task Status Type

Task status type specifies the current status of the Task.

Name
Type
Description
Planned
String
Started
String
Finished
String
Unknown
String

Task Status Type Filter Field

Representation of a filter field for Task Status Type enum values.

Name
Type
Description
operation

Value matching operation for filtering.

values

Task Status Type enum values to filter by.

Task Type

Task Type provides a categorization (or classification) of project Tasks. See the Task Types section for details.

Name
Type
Description
Work
String
StartKeyDate
String
FinishKeyDate
String
ShortHammock
String
LongHammock
String
Rfi
String
ChangeOrder
String
Testing
String
Delivery
String
Meeting
String
Rework
String
Design
String
Maintenance
String
Manufacture
String
Storage
String
Purchase
String
Receive
String
Delay
String
WeatherDelay
String
Unknown
String

Task Type Filter Field

Representation of a filter field for Task Type enum values.

Name
Type
Description
operation

Value matching operation for filtering.

values

Task Type enum values to filter by.

DetailedError

Contains error information and an array of more specific errors.

Name
Type
Description
code
String

One of a server-defined set of error codes.

message
String

A human-readable representation of the error.

target
String, null

The target of the error.

details

Optional array of more specific errors.

Detailed Error Response

Gives details for an error that occurred while handling the request. Note that clients MUST NOT assume that every failed request will produce an object of this schema, or that all of the properties in the response will be non-null, as the error may have prevented this response from being constructed.

Name
Type
Description
error

Error Detailed information.

Error

Contains error information.

Name
Type
Description
code
String

One of a server-defined set of error codes.

message
String

A human-readable representation of the error.

target
String, null

The target of the error.

Error Response

Gives details for an error that occurred while handling the request. Note that clients MUST NOT assume that every failed request will produce an object of this schema, or that all of the properties in the response will be non-null, as the error may have prevented this response from being constructed.

Name
Type
Description
error

Error information.

Was this page helpful?