Table of contents
Schedules
Download API definition:
POST https://dev-api.bentley.com/schedules/{scheduleId}/tasks/resource-assignments

Assign a Resource to a Task.

Various types of Resources can be assigned to a Task, allowing to see the required Resources for the Task's completion. an Appearance Profile must also be assigned, these provide an indication of how a particular Resource is used.

Operation

Operations, also known as LROs (Long Running Operations), are time-consuming tasks that would not be completed in the appropriate timeframe for a single request response. Endpoints that use operations return an operation id that can be used on a separate endpoint to track the progress of the task that is being handled.

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.

Entity to post for creation.

Request body

Task Resource Assignment Create Request

Name
Type
Required?
Description
appearanceProfileId
String
No

The unique identifier of the Appearance Profile.

id
String
No

The unique identifier of the Task Resource Assignment.

resourceId
String
No

The unique identifier of the resource.

taskId
String
No

The unique identifier of the Task.

Example

json
{
    "appearanceProfileId": "42aa53f0-d4ad-4ec4-826b-fc6439090d46",
    "id": "91c3aaab-5c86-43ec-870d-6c34949ab1f3",
    "resourceId": "00639b2a-cb59-46d3-a7f0-5434bc335b02",
    "taskId": "53d03dd8-941e-4663-995e-d23a306ee3b6"
}

Response 200 OK

This response indicates that the Task Resource Assignment was Created.

json
{
    "operation": {
        "id": "1604789f-68c4-46ba-b20d-8a19f8319362"
    },
    "resourceAssignment": {
        "actualUtilization": {
            "resourceCount": 0,
            "resourceUnits": 0
        },
        "appearanceProfileId": "42aa53f0-d4ad-4ec4-826b-fc6439090d46",
        "deleted": false,
        "id": "91c3aaab-5c86-43ec-870d-6c34949ab1f3",
        "plannedUtilization": {
            "percentOfOneResourceUnitPerDay": 0,
            "percentOfTotalResourceUnitsPerDay": 0,
            "resourceCount": 0,
            "resourceUnits": 0,
            "resourceUnitsPerDay": 0
        },
        "remainingUtilization": {
            "percentOfOneResourceUnitPerDay": 0,
            "percentOfTotalResourceUnitsPerDay": 0,
            "resourceCount": 0,
            "resourceUnits": 0,
            "resourceUnitsPerDay": 0
        },
        "resourceId": "00639b2a-cb59-46d3-a7f0-5434bc335b02",
        "taskId": "53d03dd8-941e-4663-995e-d23a306ee3b6"
    },
    "_links": {
        "operationLocation": {
            "href": "https://api.bentley.com/schedules/5e11b21e-cba2-48a8-a2c1-2977d2d373e0/operations/1604789f-68c4-46ba-b20d-8a19f8319362"
        }
    }
}

Response headers

Name
Description
ETag

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

Operation-Id

The unique identifier of the Operation.

Operation-Location

URL to the Operations endpoint with pre-entered Operation ID.

Response 202 Accepted

This response indicates that the requested long-running operation was Accepted.

json
{
    "operation": {
        "id": "1604789f-68c4-46ba-b20d-8a19f8319362"
    },
    "resourceAssignment": {
        "id": "91c3aaab-5c86-43ec-870d-6c34949ab1f3"
    },
    "_links": {
        "operationLocation": {
            "href": "https://api.bentley.com/schedules/5e11b21e-cba2-48a8-a2c1-2977d2d373e0/operations/1604789f-68c4-46ba-b20d-8a19f8319362"
        }
    }
}

Response headers

Name
Description
Operation-Id

The unique identifier of the Operation.

Operation-Location

URL to the Operations endpoint with pre-entered Operation ID.

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": "InvalidValue",
            "message": "Provided 'appearanceProfileId' value is not valid. Requested Appearance Profile is not available.",
            "target": "appearanceProfileId"
        }],
        "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 403 Forbidden

User is not authorized to create a Task Resource Assignment.

json
{
    "error": {
        "code": "InsufficientPermissions",
        "message": "The user has insufficient permissions for the requested operation."
    }
}

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": "DuplicateResourceAssignment",
        "message": "The Resource is already assigned to the Task."
    }
}

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.

Actual Resource Utilization

Container to represent the actual utilization properties of a task assigned resource.

Name
Type
Description
resourceCount
Double

The number of people or machines needed for the task.

resourceUnits
Double

The resource units for the task (eg. 48 man-hours or 100 cubic yards).

Link

Hyperlink container.

Name
Type
Description
href
String

Hyperlink to the specific entity.

Operation Create Response Properties

Contains the id of the created long-running operation.

Name
Type
Description
id
String, null

The unique identifier of the Operation.

Operation Location

Contains the URL to the Operations endpoint to check the information about a long-running operation.

Name
Type
Description
operationLocation

URL to the Operations endpoint with pre-entered Operation ID.

Resource Utilization

Container to represent the utilization properties of a task assigned resource.

Name
Type
Description
percentOfOneResourceUnitPerDay
Double

The utilization percentage of one resource unit (human or equipment) per day.

percentOfTotalResourceUnitsPerDay
Double

The percentage of total resource units per day.

resourceCount
Double

The number of people or machines needed for the task.

resourceUnits
Double

The resource units for the task (eg. 48 man-hours or 100 cubic yards).

resourceUnitsPerDay
Double

The resource unit progression per day (eg. 8 man-hours or 12 cubic yards).

Task Resource Assignment

Representation of a Task Resource Assignment.

Name
Type
Description
actualUtilization

The actual utilization of the resource.

appearanceProfileId
String

The unique identifier of the Appearance Profile.

deleted
Boolean, null

Is this Task Resource Assignment deleted.

drivingResource
Boolean, null

Use the resource when calculating task duration.

fixedUnits
Boolean, null

Use utilization in units or resource count instead of units/time rate.

id
String

The unique identifier of the Task Resource Assignment.

plannedUtilization

The planned utilization of the resource.

remainingUtilization

The remaining utilization of the resource.

resourceId
String

The unique identifier of the Resource.

taskId
String

The unique identifier of the Task.

Task Resource Assignment Create Request

Properties of the Task Resource Assignment to be created.

Name
Type
Description
appearanceProfileId
String

The unique identifier of the Appearance Profile.

id
String

The unique identifier of the Task Resource Assignment.

resourceId
String

The unique identifier of the resource.

taskId
String

The unique identifier of the Task.

Task Resource Assignment Create Response

Contains properties of the created Resource Assignment.

Name
Type
Description
operation

Contains properties of the created long-running operation.

resourceAssignment

Properties of the Resource Assignment.

_links

Contains the hyperlink to the Operations endpoint to check the operation information.

Task Resource Assignment Operation Response

Contains properties of the created long-running operation, and a link to this operation.

Name
Type
Description
operation

Contains properties of the created long-running operation.

resourceAssignment

Properties of the Task Resource Assignment to be created.

_links

Contains the hyperlink to the Operations endpoint to check the operation information.

Task Resource Assignment Create Operation Properties

Contains properties of the Task Resource Assignment that is queued for creation.

Name
Type
Description
id
String

The unique identifier of the Task Resource Assignment.

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?