CreateEffortRecord - Record actual work hours

Updated at:

Records actual work hours for a specified work item.

Applicable editions

Central edition, Region edition

Endpoint and authorization information

  • Obtain an endpoint: Replace {domain} in the API request syntax.

  • Obtain a personal access token.

  • Obtain the organizationId: This is required only for the Central edition. To obtain the organization ID, go to the Basic Information page in the Organization Management console.

Product

Resource

Required permission

Project Collaboration

Actual work hours

Read and write

Request syntax

Central edition

POST https://{domain}/oapi/v1/projex/organizations/{organizationId}/workitems/{id}/effortRecords

Region edition

POST https://{domain}/oapi/v1/projex/workitems/{id}/effortRecords

Request headers

Parameter

Type

Required

Description

Example

x-yunxiao-token

string

Yes

The personal access token.

pt-0fh3****0fbG_35af****0484

Request parameters

Parameter

Type

Position

Required

Description

Example

id

string

path

Yes

The unique ID of the work item.

organizationId

string

path

  • Yes: Central edition

  • No: Region edition

The organization ID.

-

object

body

No

actualTime

number

body

Yes

The actual work hours.

1.5

description

string

body

No

The work description.

Description content

gmtEnd

string

body

Yes

Start and end dates of the work.

gmtStart

string

body

Yes

The start date of the work.

operatorId

string

body

No

The user ID of the operator. Defaults to the current operator if not specified.

The user ID of the operator. If you do not specify this parameter, the current operator is used by default.

workType

string

body

No

The type of work.

Backend development

Request examples

Central edition

curl -X 'POST' \
  'https://{domain}/oapi/v1/projex/organizations/{organizationId}/workitems/{id}/effortRecords' \
  -H 'Content-Type: application/json' \
  -H 'x-yunxiao-token: pt-0fh3****0fbG_35af****0484' \
  --data '
    {
        "actualTime": 1.5,
        "description": "Description content",
        "gmtEnd": "",
        "gmtStart": "",
        "operatorId": "The user ID of the operator. If you do not specify this parameter, the current operator is used by default.",
        "workType": "Backend development"
    }'

Region edition

curl -X 'POST' \
  'https://{domain}/oapi/v1/projex/workitems/{id}/effortRecords' \
  -H 'Content-Type: application/json' \
  -H 'x-yunxiao-token: pt-0fh3****0fbG_35af****0484' \
  --data '
    {
        "actualTime": 1.5,
        "description": "Description content",
        "gmtEnd": "",
        "gmtStart": "",
        "operatorId": "The user ID of the operator. If you do not specify this parameter, the current operator is used by default.",
        "workType": "Backend development"
    }'

Response parameters

Parameter

Type

Description

Example

-

object

id

string

The effort record ID.

id-xxx

Response example

{
    "id": "id-xxx"
}

Error codes

For API-related error codes, see the Error Code Center.