API: Activities

Local Properties

Property Description Type Constraints Supported operations
id Activity id Integer x > 0 READ
version Activity version Integer x > 0 READ
comment   Formattable   READ / WRITE
details   Array of Formattable   READ
createdAt Time of creation DateTime   READ

Activity can be either _type Activity or _type Activity::Comment.

Methods

View activity

id
integer

required path

Activity id

Example:
1

200

OK

{
  "_links": {
    "self": {
      "href": "/api/v3/activity/1",
      "title": "Priority changed from High to Low"
    },
    "user": {
      "href": "/api/v3/users/1",
      "title": "John Sheppard - admin"
    },
    "workPackage": {
      "href": "/api/v3/work_packages/1",
      "title": "quis numquam qui voluptatum quia praesentium blanditiis nisi"
    }
  },
  "_type": "Activity::Comment",
  "comment": {
    "format": "markdown",
    "html": "<p>Lorem ipsum dolor sit amet.</p>",
    "raw": "Lorem ipsum dolor sit amet."
  },
  "createdAt": "2014-05-21T08:51:20Z",
  "details": [
    {
      "format": "markdown",
      "html": "<p>Lorem ipsum dolor sit amet.</p>",
      "raw": "Lorem ipsum dolor sit amet."
    }
  ],
  "id": 1,
  "version": 31
}

ActivityModel

{
  "type": "object",
  "properties": {
    "id": {
      "type": "integer",
      "description": "Activity id",
      "readOnly": true,
      "minimum": 0,
      "exclusiveMinimum": true
    },
    "version": {
      "type": "integer",
      "description": "Activity version",
      "readOnly": true,
      "minimum": 0,
      "exclusiveMinimum": true
    },
    "comment": {
      "allOf": [
        {
          "$ref": "#/components/schemas/Formattable"
        },
        {
        }
      ]
    },
    "details": {
      "type": "array of formattable",
      "readOnly": true
    },
    "createdAt": {
      "type": "string",
      "format": "date-time",
      "description": "Time of creation",
      "readOnly": true
    }
  },
  "example": {
    "_type": "Activity::Comment",
    "_links": {
      "self": {
        "href": "/api/v3/activity/1",
        "title": "Priority changed from High to Low"
      },
      "workPackage": {
        "href": "/api/v3/work_packages/1",
        "title": "quis numquam qui voluptatum quia praesentium blanditiis nisi"
      },
      "user": {
        "href": "/api/v3/users/1",
        "title": "John Sheppard - admin"
      }
    },
    "id": 1,
    "details": [
      {
        "format": "markdown",
        "raw": "Lorem ipsum dolor sit amet.",
        "html": "<p>Lorem ipsum dolor sit amet.</p>"
      }
    ],
    "comment": {
      "format": "markdown",
      "raw": "Lorem ipsum dolor sit amet.",
      "html": "<p>Lorem ipsum dolor sit amet.</p>"
    },
    "createdAt": "2014-05-21T08:51:20Z",
    "version": 31
  }
}

Update activity

Updates an activity’s comment and, on success, returns the updated activity.

id
integer

required path

Activity id

Example:
1

{
  "comment": {
    "raw": "The updated comment"
  }
}
{
  "comment": {
    "properties": {
      "raw": {
        "type": "string"
      }
    },
    "type": "object"
  }
}

200

OK

{
  "_links": {
    "self": {
      "href": "/api/v3/activity/1",
      "title": "Priority changed from High to Low"
    },
    "user": {
      "href": "/api/v3/users/1",
      "title": "John Sheppard - admin"
    },
    "workPackage": {
      "href": "/api/v3/work_packages/1",
      "title": "quis numquam qui voluptatum quia praesentium blanditiis nisi"
    }
  },
  "_type": "Activity::Comment",
  "comment": {
    "format": "markdown",
    "html": "<p>Lorem ipsum dolor sit amet.</p>",
    "raw": "Lorem ipsum dolor sit amet."
  },
  "createdAt": "2014-05-21T08:51:20Z",
  "details": [
    {
      "format": "markdown",
      "html": "<p>Lorem ipsum dolor sit amet.</p>",
      "raw": "Lorem ipsum dolor sit amet."
    }
  ],
  "id": 1,
  "version": 31
}

ActivityModel

{
  "type": "object",
  "properties": {
    "id": {
      "type": "integer",
      "description": "Activity id",
      "readOnly": true,
      "minimum": 0,
      "exclusiveMinimum": true
    },
    "version": {
      "type": "integer",
      "description": "Activity version",
      "readOnly": true,
      "minimum": 0,
      "exclusiveMinimum": true
    },
    "comment": {
      "allOf": [
        {
          "$ref": "#/components/schemas/Formattable"
        },
        {
        }
      ]
    },
    "details": {
      "type": "array of formattable",
      "readOnly": true
    },
    "createdAt": {
      "type": "string",
      "format": "date-time",
      "description": "Time of creation",
      "readOnly": true
    }
  },
  "example": {
    "_type": "Activity::Comment",
    "_links": {
      "self": {
        "href": "/api/v3/activity/1",
        "title": "Priority changed from High to Low"
      },
      "workPackage": {
        "href": "/api/v3/work_packages/1",
        "title": "quis numquam qui voluptatum quia praesentium blanditiis nisi"
      },
      "user": {
        "href": "/api/v3/users/1",
        "title": "John Sheppard - admin"
      }
    },
    "id": 1,
    "details": [
      {
        "format": "markdown",
        "raw": "Lorem ipsum dolor sit amet.",
        "html": "<p>Lorem ipsum dolor sit amet.</p>"
      }
    ],
    "comment": {
      "format": "markdown",
      "raw": "Lorem ipsum dolor sit amet.",
      "html": "<p>Lorem ipsum dolor sit amet.</p>"
    },
    "createdAt": "2014-05-21T08:51:20Z",
    "version": 31
  }
}

400

Occurs when the client did not send a valid JSON object in the request body.

{
  "_type": "Error",
  "errorIdentifier": "urn:openproject-org:api:v3:errors:InvalidRequestBody",
  "message": "The request body was not a single JSON object."
}

403

Returned if the client does not have sufficient permissions.

Required permission: edit journals

{
  "_type": "Error",
  "errorIdentifier": "urn:openproject-org:api:v3:errors:MissingPermission",
  "message": "You are not allowed to edit the comment of this journal entry."
}

422

Returned if the client tries to modify a read-only property.

{
  "_type": "Error",
  "errorIdentifier": "urn:openproject-org:api:v3:errors:PropertyIsReadOnly",
  "message": "The ID of an activity can't be changed."
}