Open Context Protocol is live! 🚀 Read the launch post

getAttachmentById

Get attachment by id

Details

  • Method: GET
  • Path: /attachments/{id}
  • Operation ID: getAttachmentById

Parameters

{
  "id": {
    "description": "The ID of the attachment to be returned. If you don't know the attachment's ID, use Get attachments for page/blogpost/custom content.",
    "required": true,
    "location": "path",
    "type": "string"
  },
  "version": {
    "description": "Allows you to retrieve a previously published version. Specify the previous version's number to retrieve its details.",
    "required": false,
    "location": "query",
    "type": "integer"
  },
  "include-labels": {
    "description": "Includes labels associated with this attachment in the response.\nThe number of results will be limited to 50 and sorted in the default sort order. \nA `meta` and `_links` property will be present to indicate if more results are available and a link to retrieve the rest of the results.",
    "required": false,
    "location": "query",
    "type": "boolean"
  },
  "include-properties": {
    "description": "Includes content properties associated with this attachment in the response.\nThe number of results will be limited to 50 and sorted in the default sort order. \nA `meta` and `_links` property will be present to indicate if more results are available and a link to retrieve the rest of the results.",
    "required": false,
    "location": "query",
    "type": "boolean"
  },
  "include-operations": {
    "description": "Includes operations associated with this attachment in the response, as defined in the `Operation` object.\nThe number of results will be limited to 50 and sorted in the default sort order. \nA `meta` and `_links` property will be present to indicate if more results are available and a link to retrieve the rest of the results.",
    "required": false,
    "location": "query",
    "type": "boolean"
  },
  "include-versions": {
    "description": "Includes versions associated with this attachment in the response.\nThe number of results will be limited to 50 and sorted in the default sort order. \nA `meta` and `_links` property will be present to indicate if more results are available and a link to retrieve the rest of the results.",
    "required": false,
    "location": "query",
    "type": "boolean"
  },
  "include-version": {
    "description": "Includes the current version associated with this attachment in the response.\nBy default this is included and can be omitted by setting the value to `false`.",
    "required": false,
    "location": "query",
    "type": "boolean"
  },
  "include-collaborators": {
    "description": "Includes collaborators on the attachment.",
    "required": false,
    "location": "query",
    "type": "boolean"
  }
}

Response Schema

{
  "allOf": [
    {
      "$ref": "#/components/schemas/AttachmentSingle"
    },
    {
      "type": "object",
      "properties": {
        "_links": {
          "type": "object",
          "properties": {
            "base": {
              "type": "string",
              "description": "Base url of the Confluence site."
            }
          }
        }
      }
    }
  ]
}

Usage

from ocp_agent import OCPAgent

agent = OCPAgent()
await agent.register_api('confluence')

# Call this tool
result = await agent.call_tool('getAttachmentById', {
    # Add required parameters here
})