> Markdown versions of all pages of this connector library are available by appending `.md` to the page URL. For the full index of connectors, see [llms.txt](https://connectors.appmixer.com/llms.txt).

# Find Channel Messages

- Component: `appmixer.telegram.user.FindChannelMessages`
- Kind: Action
- Version: 1.0.0
- Visibility: Public
- Connector: [appmixer.telegram 1.1.2](https://connectors.appmixer.com/connector/appmixer.telegram/1.1.2.md)
- Component page: <https://connectors.appmixer.com/connector/appmixer.telegram/1.1.2/component/appmixer.telegram.user.FindChannelMessages>

Returns messages from a public Telegram channel, newest first, without joining it. Use it to backfill history: limit the number of messages, read only messages newer than a known message ID, or only messages published before a date. Channels restricted in the account's region return no messages.

## Input ports

### Port `in`

| Field | Type | Description |
| --- | --- | --- |
| Channel (`channel`) | text | Public channel _@username_ or _https://t.me/username_ link. Private channels and invite links are not supported. |
| Max Results (`maxResults`) | number | Maximum number of messages to return in total (1-1000), newest first. Defaults to 20. The messages are read in pages internally. |
| After Message ID (`minId`) | number | Only return messages with an ID greater than this one, for example the last message ID you already processed. |
| Before Date (`offsetDate`) | date-time | Only return messages published before this date and time. |
| Output Type (`outputType`) | select | Choose whether you want to receive the result set as one complete list, first item only, one item at a time, or stream the items to a file. |

## Output ports

### Port `out`

Variables are loaded dynamically from `/component/appmixer/telegram/user/FindChannelMessages?outPort=out&ignoreAuth=true`.

### Port `notFound`

_No fields defined for this port._

## Full metadata (component.json)

```json
{
  "name": "appmixer.telegram.user.FindChannelMessages",
  "label": "Find Channel Messages",
  "description": "Returns messages from a public Telegram channel, newest first, without joining it. Use it to backfill history: limit the number of messages, read only messages newer than a known message ID, or only messages published before a date. Channels restricted in the account's region return no messages.",
  "author": "Appmixer <info@appmixer.com>",
  "version": "1.0.0",
  "auth": {
    "service": "appmixer:telegram:user"
  },
  "quota": {
    "manager": "appmixer:telegram:user",
    "resources": "requests",
    "scope": {
      "userId": "{{userId}}"
    }
  },
  "inPorts": [
    {
      "name": "in",
      "schema": {
        "type": "object",
        "properties": {
          "channel": {
            "type": "string"
          },
          "maxResults": {
            "type": "integer",
            "minimum": 1,
            "maximum": 1000
          },
          "minId": {
            "type": "integer",
            "minimum": 0
          },
          "offsetDate": {
            "type": "string"
          },
          "outputType": {
            "type": "string"
          }
        },
        "required": [
          "channel"
        ]
      },
      "inspector": {
        "inputs": {
          "channel": {
            "type": "text",
            "index": 1,
            "label": "Channel",
            "tooltip": "Public channel <i>@username</i> or <i>https://t.me/username</i> link. Private channels and invite links are not supported."
          },
          "maxResults": {
            "type": "number",
            "index": 2,
            "label": "Max Results",
            "defaultValue": 20,
            "min": 1,
            "max": 1000,
            "step": 1,
            "tooltip": "Maximum number of messages to return in total (1-1000), newest first. Defaults to 20. The messages are read in pages internally."
          },
          "minId": {
            "type": "number",
            "index": 3,
            "label": "After Message ID",
            "min": 0,
            "tooltip": "Only return messages with an ID greater than this one, for example the last message ID you already processed."
          },
          "offsetDate": {
            "type": "date-time",
            "index": 4,
            "label": "Before Date",
            "tooltip": "Only return messages published before this date and time."
          },
          "outputType": {
            "type": "select",
            "index": 5,
            "label": "Output Type",
            "defaultValue": "array",
            "tooltip": "Choose whether you want to receive the result set as one complete list, first item only, one item at a time, or stream the items to a file.",
            "options": [
              {
                "label": "First Item Only",
                "value": "first"
              },
              {
                "label": "All items at once",
                "value": "array"
              },
              {
                "label": "One item at a time",
                "value": "object"
              },
              {
                "label": "Store to CSV file",
                "value": "file"
              }
            ]
          }
        }
      }
    }
  ],
  "outPorts": [
    {
      "name": "out",
      "source": {
        "url": "/component/appmixer/telegram/user/FindChannelMessages?outPort=out&ignoreAuth=true",
        "data": {
          "properties": {
            "generateOutputPortOptions": true
          },
          "messages": {
            "in/channel": "dummy",
            "in/outputType": "inputs/in/outputType"
          }
        }
      }
    },
    {
      "name": "notFound",
      "schema": {
        "type": "object",
        "properties": {}
      }
    }
  ],
  "icon": "(data URI omitted)"
}
```
