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
updatedAt Time of update 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:20.396Z",
  "updatedAt": "2014-05-21T09:14:02.300Z",
  "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,
      "exclusiveMinimum": 0
    },
    "version": {
      "type": "integer",
      "description": "Activity version",
      "readOnly": true,
      "exclusiveMinimum": 0
    },
    "comment": {
      "allOf": [
        {
          "$ref": "#/components/schemas/Formattable"
        },
        {
        }
      ]
    },
    "details": {
      "type": "array",
      "readOnly": true,
      "items": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Formattable"
          }
        ]
      }
    },
    "createdAt": {
      "type": "string",
      "format": "date-time",
      "description": "Time of creation",
      "readOnly": true
    },
    "updatedAt": {
      "type": "string",
      "format": "date-time",
      "description": "Time of update",
      "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:20.721Z",
    "updatedAt": "2014-05-21T09:14:02.929Z",
    "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:20.396Z",
  "updatedAt": "2014-05-21T09:14:02.776Z",
  "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,
      "exclusiveMinimum": 0
    },
    "version": {
      "type": "integer",
      "description": "Activity version",
      "readOnly": true,
      "exclusiveMinimum": 0
    },
    "comment": {
      "allOf": [
        {
          "$ref": "#/components/schemas/Formattable"
        },
        {
        }
      ]
    },
    "details": {
      "type": "array",
      "readOnly": true,
      "items": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Formattable"
          }
        ]
      }
    },
    "createdAt": {
      "type": "string",
      "format": "date-time",
      "description": "Time of creation",
      "readOnly": true
    },
    "updatedAt": {
      "type": "string",
      "format": "date-time",
      "description": "Time of update",
      "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:20.721Z",
    "updatedAt": "2014-05-21T09:14:02.929Z",
    "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."
}
ErrorResponse
{
  "type": "object",
  "required": [
    "_type",
    "errorIdentifier",
    "message"
  ],
  "properties": {
    "_embedded": {
      "type": "object",
      "properties": {
        "details": {
          "type": "object",
          "properties": {
            "attribute": {
              "type": "string",
              "example": "project"
            }
          }
        }
      }
    },
    "_type": {
      "type": "string",
      "enum": [
        "Error"
      ]
    },
    "errorIdentifier": {
      "type": "string",
      "example": "urn:openproject-org:api:v3:errors:PropertyConstraintViolation"
    },
    "message": {
      "type": "string",
      "example": "Project can't be blank."
    }
  }
}

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."
}
ErrorResponse
{
  "type": "object",
  "required": [
    "_type",
    "errorIdentifier",
    "message"
  ],
  "properties": {
    "_embedded": {
      "type": "object",
      "properties": {
        "details": {
          "type": "object",
          "properties": {
            "attribute": {
              "type": "string",
              "example": "project"
            }
          }
        }
      }
    },
    "_type": {
      "type": "string",
      "enum": [
        "Error"
      ]
    },
    "errorIdentifier": {
      "type": "string",
      "example": "urn:openproject-org:api:v3:errors:PropertyConstraintViolation"
    },
    "message": {
      "type": "string",
      "example": "Project can't be blank."
    }
  }
}

406

Occurs when the client did not send a Content-Type header

"Missing content-type header"
{
  "type": "string"
}

415

Occurs when the client sends an unsupported Content-Type header.

{
  "_type": "Error",
  "errorIdentifier": "urn:openproject-org:api:v3:errors:TypeNotSupported",
  "message": "Expected CONTENT-TYPE to be (expected value) but got (actual value)."
}
ErrorResponse
{
  "type": "object",
  "required": [
    "_type",
    "errorIdentifier",
    "message"
  ],
  "properties": {
    "_embedded": {
      "type": "object",
      "properties": {
        "details": {
          "type": "object",
          "properties": {
            "attribute": {
              "type": "string",
              "example": "project"
            }
          }
        }
      }
    },
    "_type": {
      "type": "string",
      "enum": [
        "Error"
      ]
    },
    "errorIdentifier": {
      "type": "string",
      "example": "urn:openproject-org:api:v3:errors:PropertyConstraintViolation"
    },
    "message": {
      "type": "string",
      "example": "Project can't be blank."
    }
  }
}

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."
}
ErrorResponse
{
  "type": "object",
  "required": [
    "_type",
    "errorIdentifier",
    "message"
  ],
  "properties": {
    "_embedded": {
      "type": "object",
      "properties": {
        "details": {
          "type": "object",
          "properties": {
            "attribute": {
              "type": "string",
              "example": "project"
            }
          }
        }
      }
    },
    "_type": {
      "type": "string",
      "enum": [
        "Error"
      ]
    },
    "errorIdentifier": {
      "type": "string",
      "example": "urn:openproject-org:api:v3:errors:PropertyConstraintViolation"
    },
    "message": {
      "type": "string",
      "example": "Project can't be blank."
    }
  }
}