Delete Attachments Associated with a Project

DELETE /projects/{id}/attachments/{attachment_ids} — Use this method to delete attachments with the specified attachment IDs associated with the project with the specified internal ID, or clear the association between the workspace document with the specified attachment ID and the project with the specified internal ID.

Parameters

Path parameters

Path parameter

Required / Optional

Description

Type

{id}

Required

The internal ID of the project.

integer

{attachment_ids}

Required

A comma-separated list of internal IDs for the attachments. The list must not include more than 1000 attachment IDs.

integer

Query string parameter

Path parameter

Required / Optional

Description

Type

filterSetId

Optional

The internal ID of the filter set to be applied.

  • When specified, the request is successful only if the action is available when the specified filter set is active in OpenAir. The filter set with the specified internal ID must exist and must be associated with the user who authorized the application as per the access token.

  • Otherwise and by default, the primary filter set associated with the user who authorized the application is applied.

integer

Response definitions

A successful or failed request returns a JSON object with the following properties:

Property

Description

message

If your request includes multiple attachment IDs, both valid and invalid, the request will complete successfully for valid attachment IDs and return an error message for invalid attachment IDs — e.g. "Access to Attachment #693 denied". The response status will be 207 Multiple statuses returned.

If your request more than 1,000 attachment IDs, an error is returned — e.g. "Bulk action limit reached, sent 1001 entities of 1000 allowed".

Sample request

            DELETE /rest/v1/projects/237/attachments/4982,4983 HTTP/1.1
Host: company-id.app.openair.com
Authorization: Bearer <OAuth2_access_token> 

          

In the example, <OAuth2_access_token> is the OAuth 2.0 access token obtained for the client application connecting to OpenAir. See Authentication.

Sample response

            {
   "data": [
      {
         "4982" : {
              "data": [{
                   "id": "4982"
              }],
              "message": "success"
         },
          "4983" : {
              "data": [{
                   "id": "4983"
              }],
              "message": "success"
         }
      }
   ],
   "message": "success"
}